[i386] Fold __builtin_ia32_shufpd to VEC_PERM_EXPR
[official-gcc.git] / gcc / doc / invoke.texi
blob5e3e8873d355b443a01fceb5c3df4cb98dd26d60
1 @c Copyright (C) 1988-2019 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-2019 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), dbx(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 Some options take one or more arguments typically separated either
125 by a space or by the equals sign (@samp{=}) from the option name.
126 Unless documented otherwise, an argument can be either numeric or
127 a string.  Numeric arguments must typically be small unsigned decimal
128 or hexadecimal integers.  Hexadecimal arguments must begin with
129 the @samp{0x} prefix.  Arguments to options that specify a size
130 threshold of some sort may be arbitrarily large decimal or hexadecimal
131 integers followed by a byte size suffix designating a multiple of bytes
132 such as @code{kB} and @code{KiB} for kilobyte and kibibyte, respectively,
133 @code{MB} and @code{MiB} for megabyte and mebibyte, @code{GB} and
134 @code{GiB} for gigabyte and gigibyte, and so on.  Such arguments are
135 designated by @var{byte-size} in the following text.  Refer to the NIST,
136 IEC, and other relevant national and international standards for the full
137 listing and explanation of the binary and decimal byte size prefixes.
139 @c man end
141 @xref{Option Index}, for an index to GCC's options.
143 @menu
144 * Option Summary::      Brief list of all options, without explanations.
145 * Overall Options::     Controlling the kind of output:
146                         an executable, object files, assembler files,
147                         or preprocessed source.
148 * Invoking G++::        Compiling C++ programs.
149 * C Dialect Options::   Controlling the variant of C language compiled.
150 * C++ Dialect Options:: Variations on C++.
151 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
152                         and Objective-C++.
153 * Diagnostic Message Formatting Options:: Controlling how diagnostics should
154                         be formatted.
155 * Warning Options::     How picky should the compiler be?
156 * Debugging Options::   Producing debuggable code.
157 * Optimize Options::    How much optimization?
158 * Instrumentation Options:: Enabling profiling and extra run-time error checking.
159 * Preprocessor Options:: Controlling header files and macro definitions.
160                          Also, getting dependency information for Make.
161 * Assembler Options::   Passing options to the assembler.
162 * Link Options::        Specifying libraries and so on.
163 * Directory Options::   Where to find header files and libraries.
164                         Where to find the compiler executable files.
165 * Code Gen Options::    Specifying conventions for function calls, data layout
166                         and register usage.
167 * Developer Options::   Printing GCC configuration info, statistics, and
168                         debugging dumps.
169 * Submodel Options::    Target-specific options, such as compiling for a
170                         specific processor variant.
171 * Spec Files::          How to pass switches to sub-processes.
172 * Environment Variables:: Env vars that affect GCC.
173 * Precompiled Headers:: Compiling a header once, and using it many times.
174 @end menu
176 @c man begin OPTIONS
178 @node Option Summary
179 @section Option Summary
181 Here is a summary of all the options, grouped by type.  Explanations are
182 in the following sections.
184 @table @emph
185 @item Overall Options
186 @xref{Overall Options,,Options Controlling the Kind of Output}.
187 @gccoptlist{-c  -S  -E  -o @var{file}  -x @var{language}  @gol
188 -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  --version @gol
189 -pass-exit-codes  -pipe  -specs=@var{file}  -wrapper  @gol
190 @@@var{file}  -ffile-prefix-map=@var{old}=@var{new}  @gol
191 -fplugin=@var{file}  -fplugin-arg-@var{name}=@var{arg}  @gol
192 -fdump-ada-spec@r{[}-slim@r{]}  -fada-spec-parent=@var{unit}  -fdump-go-spec=@var{file}}
194 @item C Language Options
195 @xref{C Dialect Options,,Options Controlling C Dialect}.
196 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
197 -fpermitted-flt-eval-methods=@var{standard} @gol
198 -aux-info @var{filename}  -fallow-parameterless-variadic-functions @gol
199 -fno-asm  -fno-builtin  -fno-builtin-@var{function}  -fgimple@gol
200 -fhosted  -ffreestanding @gol
201 -fopenacc  -fopenacc-dim=@var{geom} @gol
202 -fopenmp  -fopenmp-simd @gol
203 -fms-extensions  -fplan9-extensions  -fsso-struct=@var{endianness} @gol
204 -fallow-single-precision  -fcond-mismatch  -flax-vector-conversions @gol
205 -fsigned-bitfields  -fsigned-char @gol
206 -funsigned-bitfields  -funsigned-char}
208 @item C++ Language Options
209 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
210 @gccoptlist{-fabi-version=@var{n}  -fno-access-control @gol
211 -faligned-new=@var{n}  -fargs-in-order=@var{n}  -fchar8_t  -fcheck-new @gol
212 -fconstexpr-depth=@var{n}  -fconstexpr-loop-limit=@var{n} @gol
213 -fconstexpr-ops-limit=@var{n} -fno-elide-constructors @gol
214 -fno-enforce-eh-specs @gol
215 -fno-gnu-keywords @gol
216 -fno-implicit-templates @gol
217 -fno-implicit-inline-templates @gol
218 -fno-implement-inlines  -fms-extensions @gol
219 -fnew-inheriting-ctors @gol
220 -fnew-ttp-matching @gol
221 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
222 -fno-optional-diags  -fpermissive @gol
223 -fno-pretty-templates @gol
224 -frepo  -fno-rtti  -fsized-deallocation @gol
225 -ftemplate-backtrace-limit=@var{n} @gol
226 -ftemplate-depth=@var{n} @gol
227 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
228 -fno-weak  -nostdinc++ @gol
229 -fvisibility-inlines-hidden @gol
230 -fvisibility-ms-compat @gol
231 -fext-numeric-literals @gol
232 -Wabi=@var{n}  -Wabi-tag  -Wconversion-null  -Wctor-dtor-privacy @gol
233 -Wdelete-non-virtual-dtor  -Wdeprecated-copy  -Wdeprecated-copy-dtor @gol
234 -Wliteral-suffix @gol
235 -Wmultiple-inheritance  -Wno-init-list-lifetime @gol
236 -Wnamespaces  -Wnarrowing @gol
237 -Wpessimizing-move  -Wredundant-move @gol
238 -Wnoexcept  -Wnoexcept-type  -Wclass-memaccess @gol
239 -Wnon-virtual-dtor  -Wreorder  -Wregister @gol
240 -Weffc++  -Wstrict-null-sentinel  -Wtemplates @gol
241 -Wno-non-template-friend  -Wold-style-cast @gol
242 -Woverloaded-virtual  -Wno-pmf-conversions @gol
243 -Wno-class-conversion  -Wno-terminate @gol
244 -Wsign-promo  -Wvirtual-inheritance}
246 @item Objective-C and Objective-C++ Language Options
247 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
248 Objective-C and Objective-C++ Dialects}.
249 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
250 -fgnu-runtime  -fnext-runtime @gol
251 -fno-nil-receivers @gol
252 -fobjc-abi-version=@var{n} @gol
253 -fobjc-call-cxx-cdtors @gol
254 -fobjc-direct-dispatch @gol
255 -fobjc-exceptions @gol
256 -fobjc-gc @gol
257 -fobjc-nilcheck @gol
258 -fobjc-std=objc1 @gol
259 -fno-local-ivars @gol
260 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
261 -freplace-objc-classes @gol
262 -fzero-link @gol
263 -gen-decls @gol
264 -Wassign-intercept @gol
265 -Wno-protocol  -Wselector @gol
266 -Wstrict-selector-match @gol
267 -Wundeclared-selector}
269 @item Diagnostic Message Formatting Options
270 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
271 @gccoptlist{-fmessage-length=@var{n}  @gol
272 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
273 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
274 -fdiagnostics-format=@r{[}text@r{|}json@r{]}  @gol
275 -fno-diagnostics-show-option  -fno-diagnostics-show-caret @gol
276 -fno-diagnostics-show-labels  -fno-diagnostics-show-line-numbers @gol
277 -fdiagnostics-minimum-margin-width=@var{width} @gol
278 -fdiagnostics-parseable-fixits  -fdiagnostics-generate-patch @gol
279 -fdiagnostics-show-template-tree  -fno-elide-type @gol
280 -fno-show-column}
282 @item Warning Options
283 @xref{Warning Options,,Options to Request or Suppress Warnings}.
284 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
285 -pedantic-errors @gol
286 -w  -Wextra  -Wall  -Waddress  -Waddress-of-packed-member @gol
287 -Waggregate-return  -Waligned-new @gol
288 -Walloc-zero  -Walloc-size-larger-than=@var{byte-size} @gol
289 -Walloca  -Walloca-larger-than=@var{byte-size} @gol
290 -Wno-aggressive-loop-optimizations  -Warray-bounds  -Warray-bounds=@var{n} @gol
291 -Wno-attributes  -Wattribute-alias=@var{n}  @gol
292 -Wbool-compare  -Wbool-operation @gol
293 -Wno-builtin-declaration-mismatch @gol
294 -Wno-builtin-macro-redefined  -Wc90-c99-compat  -Wc99-c11-compat @gol
295 -Wc++-compat  -Wc++11-compat  -Wc++14-compat  -Wc++17-compat  @gol
296 -Wcast-align  -Wcast-align=strict  -Wcast-function-type  -Wcast-qual  @gol
297 -Wchar-subscripts  -Wcatch-value  -Wcatch-value=@var{n} @gol
298 -Wclobbered  -Wcomment  -Wconditionally-supported @gol
299 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wdangling-else  -Wdate-time @gol
300 -Wdelete-incomplete @gol
301 -Wno-attribute-warning @gol
302 -Wno-deprecated  -Wno-deprecated-declarations  -Wno-designated-init @gol
303 -Wdisabled-optimization @gol
304 -Wno-discarded-qualifiers  -Wno-discarded-array-qualifiers @gol
305 -Wno-div-by-zero  -Wdouble-promotion @gol
306 -Wduplicated-branches  -Wduplicated-cond @gol
307 -Wempty-body  -Wenum-compare  -Wno-endif-labels  -Wexpansion-to-defined @gol
308 -Werror  -Werror=*  -Wextra-semi  -Wfatal-errors @gol
309 -Wfloat-equal  -Wformat  -Wformat=2 @gol
310 -Wno-format-contains-nul  -Wno-format-extra-args  @gol
311 -Wformat-nonliteral  -Wformat-overflow=@var{n} @gol
312 -Wformat-security  -Wformat-signedness  -Wformat-truncation=@var{n} @gol
313 -Wformat-y2k  -Wframe-address @gol
314 -Wframe-larger-than=@var{byte-size}  -Wno-free-nonheap-object @gol
315 -Wjump-misses-init @gol
316 -Whsa  -Wif-not-aligned @gol
317 -Wignored-qualifiers  -Wignored-attributes  -Wincompatible-pointer-types @gol
318 -Wimplicit  -Wimplicit-fallthrough  -Wimplicit-fallthrough=@var{n} @gol
319 -Wimplicit-function-declaration  -Wimplicit-int @gol
320 -Winit-self  -Winline  -Wno-int-conversion  -Wint-in-bool-context @gol
321 -Wno-int-to-pointer-cast  -Winvalid-memory-model  -Wno-invalid-offsetof @gol
322 -Winvalid-pch  -Wlarger-than=@var{byte-size} @gol
323 -Wlogical-op  -Wlogical-not-parentheses  -Wlong-long @gol
324 -Wmain  -Wmaybe-uninitialized  -Wmemset-elt-size  -Wmemset-transposed-args @gol
325 -Wmisleading-indentation  -Wmissing-attributes  -Wmissing-braces @gol
326 -Wmissing-field-initializers  -Wmissing-format-attribute @gol
327 -Wmissing-include-dirs  -Wmissing-noreturn  -Wmissing-profile @gol
328 -Wno-multichar  -Wmultistatement-macros  -Wnonnull  -Wnonnull-compare @gol
329 -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
330 -Wnull-dereference  -Wodr  -Wno-overflow  -Wopenmp-simd  @gol
331 -Woverride-init-side-effects  -Woverlength-strings @gol
332 -Wpacked  -Wpacked-bitfield-compat -Wpacked-not-aligned  -Wpadded @gol
333 -Wparentheses  -Wno-pedantic-ms-format @gol
334 -Wplacement-new  -Wplacement-new=@var{n} @gol
335 -Wpointer-arith  -Wpointer-compare  -Wno-pointer-to-int-cast @gol
336 -Wno-pragmas  -Wno-prio-ctor-dtor  -Wredundant-decls @gol
337 -Wrestrict  -Wno-return-local-addr @gol
338 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
339 -Wshadow=global,  -Wshadow=local,  -Wshadow=compatible-local @gol
340 -Wshift-overflow  -Wshift-overflow=@var{n} @gol
341 -Wshift-count-negative  -Wshift-count-overflow  -Wshift-negative-value @gol
342 -Wsign-compare  -Wsign-conversion  -Wfloat-conversion @gol
343 -Wno-scalar-storage-order  -Wsizeof-pointer-div @gol
344 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
345 -Wstack-protector  -Wstack-usage=@var{byte-size}  -Wstrict-aliasing @gol
346 -Wstrict-aliasing=n  -Wstrict-overflow  -Wstrict-overflow=@var{n} @gol
347 -Wstringop-overflow=@var{n}  -Wstringop-truncation  -Wsubobject-linkage @gol
348 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}malloc@r{]} @gol
349 -Wsuggest-final-types @gol  -Wsuggest-final-methods  -Wsuggest-override @gol
350 -Wswitch  -Wswitch-bool  -Wswitch-default  -Wswitch-enum @gol
351 -Wswitch-unreachable  -Wsync-nand @gol
352 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
353 -Wtype-limits  -Wundef @gol
354 -Wuninitialized  -Wunknown-pragmas @gol
355 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
356 -Wunused-label  -Wunused-local-typedefs  -Wunused-macros @gol
357 -Wunused-parameter  -Wno-unused-result @gol
358 -Wunused-value  -Wunused-variable @gol
359 -Wunused-const-variable  -Wunused-const-variable=@var{n} @gol
360 -Wunused-but-set-parameter  -Wunused-but-set-variable @gol
361 -Wuseless-cast  -Wvariadic-macros  -Wvector-operation-performance @gol
362 -Wvla  -Wvla-larger-than=@var{byte-size}  -Wvolatile-register-var @gol
363 -Wwrite-strings @gol
364 -Wzero-as-null-pointer-constant}
366 @item C and Objective-C-only Warning Options
367 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
368 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
369 -Wold-style-declaration  -Wold-style-definition @gol
370 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
371 -Wdeclaration-after-statement  -Wpointer-sign}
373 @item Debugging Options
374 @xref{Debugging Options,,Options for Debugging Your Program}.
375 @gccoptlist{-g  -g@var{level}  -gdwarf  -gdwarf-@var{version} @gol
376 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
377 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
378 -gas-loc-support  -gno-as-loc-support @gol
379 -gas-locview-support  -gno-as-locview-support @gol
380 -gcolumn-info  -gno-column-info @gol
381 -gstatement-frontiers  -gno-statement-frontiers @gol
382 -gvariable-location-views  -gno-variable-location-views @gol
383 -ginternal-reset-location-views  -gno-internal-reset-location-views @gol
384 -ginline-points  -gno-inline-points @gol
385 -gvms  -gxcoff  -gxcoff+  -gz@r{[}=@var{type}@r{]} @gol
386 -gsplit-dwarf  -gdescribe-dies  -gno-describe-dies @gol
387 -fdebug-prefix-map=@var{old}=@var{new}  -fdebug-types-section @gol
388 -fno-eliminate-unused-debug-types @gol
389 -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
390 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
391 -feliminate-unused-debug-symbols  -femit-class-debug-always @gol
392 -fno-merge-debug-strings  -fno-dwarf2-cfi-asm @gol
393 -fvar-tracking  -fvar-tracking-assignments}
395 @item Optimization Options
396 @xref{Optimize Options,,Options that Control Optimization}.
397 @gccoptlist{-faggressive-loop-optimizations @gol
398 -falign-functions[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
399 -falign-jumps[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
400 -falign-labels[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
401 -falign-loops[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
402 -fassociative-math  -fauto-profile  -fauto-profile[=@var{path}] @gol
403 -fauto-inc-dec  -fbranch-probabilities @gol
404 -fbranch-target-load-optimize  -fbranch-target-load-optimize2 @gol
405 -fbtr-bb-exclusive  -fcaller-saves @gol
406 -fcombine-stack-adjustments  -fconserve-stack @gol
407 -fcompare-elim  -fcprop-registers  -fcrossjumping @gol
408 -fcse-follow-jumps  -fcse-skip-blocks  -fcx-fortran-rules @gol
409 -fcx-limited-range @gol
410 -fdata-sections  -fdce  -fdelayed-branch @gol
411 -fdelete-null-pointer-checks  -fdevirtualize  -fdevirtualize-speculatively @gol
412 -fdevirtualize-at-ltrans  -fdse @gol
413 -fearly-inlining  -fipa-sra  -fexpensive-optimizations  -ffat-lto-objects @gol
414 -ffast-math  -ffinite-math-only  -ffloat-store  -fexcess-precision=@var{style} @gol
415 -fforward-propagate  -ffp-contract=@var{style}  -ffunction-sections @gol
416 -fgcse  -fgcse-after-reload  -fgcse-las  -fgcse-lm  -fgraphite-identity @gol
417 -fgcse-sm  -fhoist-adjacent-loads  -fif-conversion @gol
418 -fif-conversion2  -findirect-inlining @gol
419 -finline-functions  -finline-functions-called-once  -finline-limit=@var{n} @gol
420 -finline-small-functions  -fipa-cp  -fipa-cp-clone @gol
421 -fipa-bit-cp  -fipa-vrp  -fipa-pta  -fipa-profile  -fipa-pure-const @gol
422 -fipa-reference  -fipa-reference-addressable @gol
423 -fipa-stack-alignment  -fipa-icf  -fira-algorithm=@var{algorithm} @gol
424 -flive-patching=@var{level} @gol
425 -fira-region=@var{region}  -fira-hoist-pressure @gol
426 -fira-loop-pressure  -fno-ira-share-save-slots @gol
427 -fno-ira-share-spill-slots @gol
428 -fisolate-erroneous-paths-dereference  -fisolate-erroneous-paths-attribute @gol
429 -fivopts  -fkeep-inline-functions  -fkeep-static-functions @gol
430 -fkeep-static-consts  -flimit-function-alignment  -flive-range-shrinkage @gol
431 -floop-block  -floop-interchange  -floop-strip-mine @gol
432 -floop-unroll-and-jam  -floop-nest-optimize @gol
433 -floop-parallelize-all  -flra-remat  -flto  -flto-compression-level @gol
434 -flto-partition=@var{alg}  -fmerge-all-constants @gol
435 -fmerge-constants  -fmodulo-sched  -fmodulo-sched-allow-regmoves @gol
436 -fmove-loop-invariants  -fno-branch-count-reg @gol
437 -fno-defer-pop  -fno-fp-int-builtin-inexact  -fno-function-cse @gol
438 -fno-guess-branch-probability  -fno-inline  -fno-math-errno  -fno-peephole @gol
439 -fno-peephole2  -fno-printf-return-value  -fno-sched-interblock @gol
440 -fno-sched-spec  -fno-signed-zeros @gol
441 -fno-toplevel-reorder  -fno-trapping-math  -fno-zero-initialized-in-bss @gol
442 -fomit-frame-pointer  -foptimize-sibling-calls @gol
443 -fpartial-inlining  -fpeel-loops  -fpredictive-commoning @gol
444 -fprefetch-loop-arrays @gol
445 -fprofile-correction @gol
446 -fprofile-use  -fprofile-use=@var{path}  -fprofile-values @gol
447 -fprofile-reorder-functions @gol
448 -freciprocal-math  -free  -frename-registers  -freorder-blocks @gol
449 -freorder-blocks-algorithm=@var{algorithm} @gol
450 -freorder-blocks-and-partition  -freorder-functions @gol
451 -frerun-cse-after-loop  -freschedule-modulo-scheduled-loops @gol
452 -frounding-math  -fsave-optimization-record @gol
453 -fsched2-use-superblocks  -fsched-pressure @gol
454 -fsched-spec-load  -fsched-spec-load-dangerous @gol
455 -fsched-stalled-insns-dep[=@var{n}]  -fsched-stalled-insns[=@var{n}] @gol
456 -fsched-group-heuristic  -fsched-critical-path-heuristic @gol
457 -fsched-spec-insn-heuristic  -fsched-rank-heuristic @gol
458 -fsched-last-insn-heuristic  -fsched-dep-count-heuristic @gol
459 -fschedule-fusion @gol
460 -fschedule-insns  -fschedule-insns2  -fsection-anchors @gol
461 -fselective-scheduling  -fselective-scheduling2 @gol
462 -fsel-sched-pipelining  -fsel-sched-pipelining-outer-loops @gol
463 -fsemantic-interposition  -fshrink-wrap  -fshrink-wrap-separate @gol
464 -fsignaling-nans @gol
465 -fsingle-precision-constant  -fsplit-ivs-in-unroller  -fsplit-loops@gol
466 -fsplit-paths @gol
467 -fsplit-wide-types  -fssa-backprop  -fssa-phiopt @gol
468 -fstdarg-opt  -fstore-merging  -fstrict-aliasing @gol
469 -fthread-jumps  -ftracer  -ftree-bit-ccp @gol
470 -ftree-builtin-call-dce  -ftree-ccp  -ftree-ch @gol
471 -ftree-coalesce-vars  -ftree-copy-prop  -ftree-dce  -ftree-dominator-opts @gol
472 -ftree-dse  -ftree-forwprop  -ftree-fre  -fcode-hoisting @gol
473 -ftree-loop-if-convert  -ftree-loop-im @gol
474 -ftree-phiprop  -ftree-loop-distribution  -ftree-loop-distribute-patterns @gol
475 -ftree-loop-ivcanon  -ftree-loop-linear  -ftree-loop-optimize @gol
476 -ftree-loop-vectorize @gol
477 -ftree-parallelize-loops=@var{n}  -ftree-pre  -ftree-partial-pre  -ftree-pta @gol
478 -ftree-reassoc  -ftree-scev-cprop  -ftree-sink  -ftree-slsr  -ftree-sra @gol
479 -ftree-switch-conversion  -ftree-tail-merge @gol
480 -ftree-ter  -ftree-vectorize  -ftree-vrp  -funconstrained-commons @gol
481 -funit-at-a-time  -funroll-all-loops  -funroll-loops @gol
482 -funsafe-math-optimizations  -funswitch-loops @gol
483 -fipa-ra  -fvariable-expansion-in-unroller  -fvect-cost-model  -fvpt @gol
484 -fweb  -fwhole-program  -fwpa  -fuse-linker-plugin @gol
485 --param @var{name}=@var{value}
486 -O  -O0  -O1  -O2  -O3  -Os  -Ofast  -Og}
488 @item Program Instrumentation Options
489 @xref{Instrumentation Options,,Program Instrumentation Options}.
490 @gccoptlist{-p  -pg  -fprofile-arcs  --coverage  -ftest-coverage @gol
491 -fprofile-abs-path @gol
492 -fprofile-dir=@var{path}  -fprofile-generate  -fprofile-generate=@var{path} @gol
493 -fprofile-update=@var{method}  -fprofile-filter-files=@var{regex} @gol
494 -fprofile-exclude-files=@var{regex} @gol
495 -fsanitize=@var{style}  -fsanitize-recover  -fsanitize-recover=@var{style} @gol
496 -fasan-shadow-offset=@var{number}  -fsanitize-sections=@var{s1},@var{s2},... @gol
497 -fsanitize-undefined-trap-on-error  -fbounds-check @gol
498 -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]} @gol
499 -fstack-protector  -fstack-protector-all  -fstack-protector-strong @gol
500 -fstack-protector-explicit  -fstack-check @gol
501 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
502 -fno-stack-limit  -fsplit-stack @gol
503 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
504 -fvtv-counts  -fvtv-debug @gol
505 -finstrument-functions @gol
506 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
507 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}}
509 @item Preprocessor Options
510 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
511 @gccoptlist{-A@var{question}=@var{answer} @gol
512 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
513 -C  -CC  -D@var{macro}@r{[}=@var{defn}@r{]} @gol
514 -dD  -dI  -dM  -dN  -dU @gol
515 -fdebug-cpp  -fdirectives-only  -fdollars-in-identifiers  @gol
516 -fexec-charset=@var{charset}  -fextended-identifiers  @gol
517 -finput-charset=@var{charset}  -fmacro-prefix-map=@var{old}=@var{new}  @gol
518 -fno-canonical-system-headers  -fpch-deps  -fpch-preprocess  @gol
519 -fpreprocessed  -ftabstop=@var{width}  -ftrack-macro-expansion  @gol
520 -fwide-exec-charset=@var{charset}  -fworking-directory @gol
521 -H  -imacros @var{file}  -include @var{file} @gol
522 -M  -MD  -MF  -MG  -MM  -MMD  -MP  -MQ  -MT @gol
523 -no-integrated-cpp  -P  -pthread  -remap @gol
524 -traditional  -traditional-cpp  -trigraphs @gol
525 -U@var{macro}  -undef  @gol
526 -Wp,@var{option}  -Xpreprocessor @var{option}}
528 @item Assembler Options
529 @xref{Assembler Options,,Passing Options to the Assembler}.
530 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
532 @item Linker Options
533 @xref{Link Options,,Options for Linking}.
534 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker}  -l@var{library} @gol
535 -nostartfiles  -nodefaultlibs  -nolibc  -nostdlib @gol
536 -e @var{entry}  --entry=@var{entry} @gol
537 -pie  -pthread  -r  -rdynamic @gol
538 -s  -static  -static-pie  -static-libgcc  -static-libstdc++ @gol
539 -static-libasan  -static-libtsan  -static-liblsan  -static-libubsan @gol
540 -shared  -shared-libgcc  -symbolic @gol
541 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
542 -u @var{symbol}  -z @var{keyword}}
544 @item Directory Options
545 @xref{Directory Options,,Options for Directory Search}.
546 @gccoptlist{-B@var{prefix}  -I@var{dir}  -I- @gol
547 -idirafter @var{dir} @gol
548 -imacros @var{file}  -imultilib @var{dir} @gol
549 -iplugindir=@var{dir}  -iprefix @var{file} @gol
550 -iquote @var{dir}  -isysroot @var{dir}  -isystem @var{dir} @gol
551 -iwithprefix @var{dir}  -iwithprefixbefore @var{dir}  @gol
552 -L@var{dir}  -no-canonical-prefixes  --no-sysroot-suffix @gol
553 -nostdinc  -nostdinc++  --sysroot=@var{dir}}
555 @item Code Generation Options
556 @xref{Code Gen Options,,Options for Code Generation Conventions}.
557 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
558 -ffixed-@var{reg}  -fexceptions @gol
559 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
560 -fasynchronous-unwind-tables @gol
561 -fno-gnu-unique @gol
562 -finhibit-size-directive  -fno-common  -fno-ident @gol
563 -fpcc-struct-return  -fpic  -fPIC  -fpie  -fPIE  -fno-plt @gol
564 -fno-jump-tables @gol
565 -frecord-gcc-switches @gol
566 -freg-struct-return  -fshort-enums  -fshort-wchar @gol
567 -fverbose-asm  -fpack-struct[=@var{n}]  @gol
568 -fleading-underscore  -ftls-model=@var{model} @gol
569 -fstack-reuse=@var{reuse_level} @gol
570 -ftrampolines  -ftrapv  -fwrapv @gol
571 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
572 -fstrict-volatile-bitfields  -fsync-libcalls}
574 @item Developer Options
575 @xref{Developer Options,,GCC Developer Options}.
576 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
577 -dumpfullversion  -fchecking  -fchecking=@var{n}  -fdbg-cnt-list @gol
578 -fdbg-cnt=@var{counter-value-list} @gol
579 -fdisable-ipa-@var{pass_name} @gol
580 -fdisable-rtl-@var{pass_name} @gol
581 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
582 -fdisable-tree-@var{pass_name} @gol
583 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
584 -fdump-debug  -fdump-earlydebug @gol
585 -fdump-noaddr  -fdump-unnumbered  -fdump-unnumbered-links @gol
586 -fdump-final-insns@r{[}=@var{file}@r{]} @gol
587 -fdump-ipa-all  -fdump-ipa-cgraph  -fdump-ipa-inline @gol
588 -fdump-lang-all @gol
589 -fdump-lang-@var{switch} @gol
590 -fdump-lang-@var{switch}-@var{options} @gol
591 -fdump-lang-@var{switch}-@var{options}=@var{filename} @gol
592 -fdump-passes @gol
593 -fdump-rtl-@var{pass}  -fdump-rtl-@var{pass}=@var{filename} @gol
594 -fdump-statistics @gol
595 -fdump-tree-all @gol
596 -fdump-tree-@var{switch} @gol
597 -fdump-tree-@var{switch}-@var{options} @gol
598 -fdump-tree-@var{switch}-@var{options}=@var{filename} @gol
599 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
600 -fenable-@var{kind}-@var{pass} @gol
601 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
602 -fira-verbose=@var{n} @gol
603 -flto-report  -flto-report-wpa  -fmem-report-wpa @gol
604 -fmem-report  -fpre-ipa-mem-report  -fpost-ipa-mem-report @gol
605 -fopt-info  -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
606 -fprofile-report @gol
607 -frandom-seed=@var{string}  -fsched-verbose=@var{n} @gol
608 -fsel-sched-verbose  -fsel-sched-dump-cfg  -fsel-sched-pipelining-verbose @gol
609 -fstats  -fstack-usage  -ftime-report  -ftime-report-details @gol
610 -fvar-tracking-assignments-toggle  -gtoggle @gol
611 -print-file-name=@var{library}  -print-libgcc-file-name @gol
612 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
613 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
614 -print-sysroot  -print-sysroot-headers-suffix @gol
615 -save-temps  -save-temps=cwd  -save-temps=obj  -time@r{[}=@var{file}@r{]}}
617 @item Machine-Dependent Options
618 @xref{Submodel Options,,Machine-Dependent Options}.
619 @c This list is ordered alphanumerically by subsection name.
620 @c Try and put the significant identifier (CPU or system) first,
621 @c so users have a clue at guessing where the ones they want will be.
623 @emph{AArch64 Options}
624 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
625 -mgeneral-regs-only @gol
626 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
627 -mstrict-align  -mno-strict-align @gol
628 -momit-leaf-frame-pointer @gol
629 -mtls-dialect=desc  -mtls-dialect=traditional @gol
630 -mtls-size=@var{size} @gol
631 -mfix-cortex-a53-835769  -mfix-cortex-a53-843419 @gol
632 -mlow-precision-recip-sqrt  -mlow-precision-sqrt  -mlow-precision-div @gol
633 -mpc-relative-literal-loads @gol
634 -msign-return-address=@var{scope} @gol
635 -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}]|@var{bti} @gol
636 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}  @gol
637 -moverride=@var{string}  -mverbose-cost-dump @gol
638 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{sysreg} @gol
639 -mstack-protector-guard-offset=@var{offset} -mtrack-speculation }
641 @emph{Adapteva Epiphany Options}
642 @gccoptlist{-mhalf-reg-file  -mprefer-short-insn-regs @gol
643 -mbranch-cost=@var{num}  -mcmove  -mnops=@var{num}  -msoft-cmpsf @gol
644 -msplit-lohi  -mpost-inc  -mpost-modify  -mstack-offset=@var{num} @gol
645 -mround-nearest  -mlong-calls  -mshort-calls  -msmall16 @gol
646 -mfp-mode=@var{mode}  -mvect-double  -max-vect-align=@var{num} @gol
647 -msplit-vecmove-early  -m1reg-@var{reg}}
649 @emph{AMD GCN Options}
650 @gccoptlist{-march=@var{gpu} -mtune=@var{gpu} -mstack-size=@var{bytes}}
652 @emph{ARC Options}
653 @gccoptlist{-mbarrel-shifter  -mjli-always @gol
654 -mcpu=@var{cpu}  -mA6  -mARC600  -mA7  -mARC700 @gol
655 -mdpfp  -mdpfp-compact  -mdpfp-fast  -mno-dpfp-lrsr @gol
656 -mea  -mno-mpy  -mmul32x16  -mmul64  -matomic @gol
657 -mnorm  -mspfp  -mspfp-compact  -mspfp-fast  -msimd  -msoft-float  -mswap @gol
658 -mcrc  -mdsp-packa  -mdvbf  -mlock  -mmac-d16  -mmac-24  -mrtsc  -mswape @gol
659 -mtelephony  -mxy  -misize  -mannotate-align  -marclinux  -marclinux_prof @gol
660 -mlong-calls  -mmedium-calls  -msdata  -mirq-ctrl-saved @gol
661 -mrgf-banked-regs  -mlpc-width=@var{width}  -G @var{num} @gol
662 -mvolatile-cache  -mtp-regno=@var{regno} @gol
663 -malign-call  -mauto-modify-reg  -mbbit-peephole  -mno-brcc @gol
664 -mcase-vector-pcrel  -mcompact-casesi  -mno-cond-exec  -mearly-cbranchsi @gol
665 -mexpand-adddi  -mindexed-loads  -mlra  -mlra-priority-none @gol
666 -mlra-priority-compact mlra-priority-noncompact  -mmillicode @gol
667 -mmixed-code  -mq-class  -mRcq  -mRcw  -msize-level=@var{level} @gol
668 -mtune=@var{cpu}  -mmultcost=@var{num}  -mcode-density-frame @gol
669 -munalign-prob-threshold=@var{probability}  -mmpy-option=@var{multo} @gol
670 -mdiv-rem  -mcode-density  -mll64  -mfpu=@var{fpu}  -mrf16  -mbranch-index}
672 @emph{ARM Options}
673 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
674 -mabi=@var{name} @gol
675 -mapcs-stack-check  -mno-apcs-stack-check @gol
676 -mapcs-reentrant  -mno-apcs-reentrant @gol
677 -mgeneral-regs-only @gol
678 -msched-prolog  -mno-sched-prolog @gol
679 -mlittle-endian  -mbig-endian @gol
680 -mbe8  -mbe32 @gol
681 -mfloat-abi=@var{name} @gol
682 -mfp16-format=@var{name}
683 -mthumb-interwork  -mno-thumb-interwork @gol
684 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
685 -mtune=@var{name}  -mprint-tune-info @gol
686 -mstructure-size-boundary=@var{n} @gol
687 -mabort-on-noreturn @gol
688 -mlong-calls  -mno-long-calls @gol
689 -msingle-pic-base  -mno-single-pic-base @gol
690 -mpic-register=@var{reg} @gol
691 -mnop-fun-dllimport @gol
692 -mpoke-function-name @gol
693 -mthumb  -marm  -mflip-thumb @gol
694 -mtpcs-frame  -mtpcs-leaf-frame @gol
695 -mcaller-super-interworking  -mcallee-super-interworking @gol
696 -mtp=@var{name}  -mtls-dialect=@var{dialect} @gol
697 -mword-relocations @gol
698 -mfix-cortex-m3-ldrd @gol
699 -munaligned-access @gol
700 -mneon-for-64bits @gol
701 -mslow-flash-data @gol
702 -masm-syntax-unified @gol
703 -mrestrict-it @gol
704 -mverbose-cost-dump @gol
705 -mpure-code @gol
706 -mcmse}
708 @emph{AVR Options}
709 @gccoptlist{-mmcu=@var{mcu}  -mabsdata  -maccumulate-args @gol
710 -mbranch-cost=@var{cost} @gol
711 -mcall-prologues  -mgas-isr-prologues  -mint8 @gol
712 -mn_flash=@var{size}  -mno-interrupts @gol
713 -mmain-is-OS_task  -mrelax  -mrmw  -mstrict-X  -mtiny-stack @gol
714 -mfract-convert-truncate @gol
715 -mshort-calls  -nodevicelib @gol
716 -Waddr-space-convert  -Wmisspelled-isr}
718 @emph{Blackfin Options}
719 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
720 -msim  -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
721 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
722 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
723 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
724 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
725 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
726 -mfast-fp  -minline-plt  -mmulticore  -mcorea  -mcoreb  -msdram @gol
727 -micplb}
729 @emph{C6X Options}
730 @gccoptlist{-mbig-endian  -mlittle-endian  -march=@var{cpu} @gol
731 -msim  -msdata=@var{sdata-type}}
733 @emph{CRIS Options}
734 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
735 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
736 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
737 -mstack-align  -mdata-align  -mconst-align @gol
738 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
739 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
740 -mmul-bug-workaround  -mno-mul-bug-workaround}
742 @emph{CR16 Options}
743 @gccoptlist{-mmac @gol
744 -mcr16cplus  -mcr16c @gol
745 -msim  -mint32  -mbit-ops
746 -mdata-model=@var{model}}
748 @emph{C-SKY Options}
749 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu} @gol
750 -mbig-endian  -EB  -mlittle-endian  -EL @gol
751 -mhard-float  -msoft-float  -mfpu=@var{fpu}  -mdouble-float  -mfdivdu @gol
752 -melrw  -mistack  -mmp  -mcp  -mcache  -msecurity  -mtrust @gol
753 -mdsp  -medsp  -mvdsp @gol
754 -mdiv  -msmart  -mhigh-registers  -manchor @gol
755 -mpushpop  -mmultiple-stld  -mconstpool  -mstack-size  -mccrt @gol
756 -mbranch-cost=@var{n}  -mcse-cc  -msched-prolog}
758 @emph{Darwin Options}
759 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
760 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
761 -client_name  -compatibility_version  -current_version @gol
762 -dead_strip @gol
763 -dependency-file  -dylib_file  -dylinker_install_name @gol
764 -dynamic  -dynamiclib  -exported_symbols_list @gol
765 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
766 -force_flat_namespace  -headerpad_max_install_names @gol
767 -iframework @gol
768 -image_base  -init  -install_name  -keep_private_externs @gol
769 -multi_module  -multiply_defined  -multiply_defined_unused @gol
770 -noall_load   -no_dead_strip_inits_and_terms @gol
771 -nofixprebinding  -nomultidefs  -noprebind  -noseglinkedit @gol
772 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
773 -private_bundle  -read_only_relocs  -sectalign @gol
774 -sectobjectsymbols  -whyload  -seg1addr @gol
775 -sectcreate  -sectobjectsymbols  -sectorder @gol
776 -segaddr  -segs_read_only_addr  -segs_read_write_addr @gol
777 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
778 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
779 -single_module  -static  -sub_library  -sub_umbrella @gol
780 -twolevel_namespace  -umbrella  -undefined @gol
781 -unexported_symbols_list  -weak_reference_mismatches @gol
782 -whatsloaded  -F  -gused  -gfull  -mmacosx-version-min=@var{version} @gol
783 -mkernel  -mone-byte-bool}
785 @emph{DEC Alpha Options}
786 @gccoptlist{-mno-fp-regs  -msoft-float @gol
787 -mieee  -mieee-with-inexact  -mieee-conformant @gol
788 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
789 -mtrap-precision=@var{mode}  -mbuild-constants @gol
790 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
791 -mbwx  -mmax  -mfix  -mcix @gol
792 -mfloat-vax  -mfloat-ieee @gol
793 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
794 -msmall-text  -mlarge-text @gol
795 -mmemory-latency=@var{time}}
797 @emph{FR30 Options}
798 @gccoptlist{-msmall-model  -mno-lsim}
800 @emph{FT32 Options}
801 @gccoptlist{-msim  -mlra  -mnodiv  -mft32b  -mcompress  -mnopm}
803 @emph{FRV Options}
804 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
805 -mhard-float  -msoft-float @gol
806 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
807 -mdouble  -mno-double @gol
808 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
809 -mfdpic  -minline-plt  -mgprel-ro  -multilib-library-pic @gol
810 -mlinked-fp  -mlong-calls  -malign-labels @gol
811 -mlibrary-pic  -macc-4  -macc-8 @gol
812 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
813 -moptimize-membar  -mno-optimize-membar @gol
814 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
815 -mvliw-branch  -mno-vliw-branch @gol
816 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
817 -mno-nested-cond-exec  -mtomcat-stats @gol
818 -mTLS  -mtls @gol
819 -mcpu=@var{cpu}}
821 @emph{GNU/Linux Options}
822 @gccoptlist{-mglibc  -muclibc  -mmusl  -mbionic  -mandroid @gol
823 -tno-android-cc  -tno-android-ld}
825 @emph{H8/300 Options}
826 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr  -mno-exr  -mint32  -malign-300}
828 @emph{HPPA Options}
829 @gccoptlist{-march=@var{architecture-type} @gol
830 -mcaller-copies  -mdisable-fpregs  -mdisable-indexing @gol
831 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
832 -mfixed-range=@var{register-range} @gol
833 -mjump-in-delay  -mlinker-opt  -mlong-calls @gol
834 -mlong-load-store  -mno-disable-fpregs @gol
835 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
836 -mno-jump-in-delay  -mno-long-load-store @gol
837 -mno-portable-runtime  -mno-soft-float @gol
838 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
839 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
840 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
841 -munix=@var{unix-std}  -nolibdld  -static  -threads}
843 @emph{IA-64 Options}
844 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
845 -mvolatile-asm-stop  -mregister-names  -msdata  -mno-sdata @gol
846 -mconstant-gp  -mauto-pic  -mfused-madd @gol
847 -minline-float-divide-min-latency @gol
848 -minline-float-divide-max-throughput @gol
849 -mno-inline-float-divide @gol
850 -minline-int-divide-min-latency @gol
851 -minline-int-divide-max-throughput  @gol
852 -mno-inline-int-divide @gol
853 -minline-sqrt-min-latency  -minline-sqrt-max-throughput @gol
854 -mno-inline-sqrt @gol
855 -mdwarf2-asm  -mearly-stop-bits @gol
856 -mfixed-range=@var{register-range}  -mtls-size=@var{tls-size} @gol
857 -mtune=@var{cpu-type}  -milp32  -mlp64 @gol
858 -msched-br-data-spec  -msched-ar-data-spec  -msched-control-spec @gol
859 -msched-br-in-data-spec  -msched-ar-in-data-spec  -msched-in-control-spec @gol
860 -msched-spec-ldc  -msched-spec-control-ldc @gol
861 -msched-prefer-non-data-spec-insns  -msched-prefer-non-control-spec-insns @gol
862 -msched-stop-bits-after-every-cycle  -msched-count-spec-in-critical-path @gol
863 -msel-sched-dont-check-control-spec  -msched-fp-mem-deps-zero-cost @gol
864 -msched-max-memory-insns-hard-limit  -msched-max-memory-insns=@var{max-insns}}
866 @emph{LM32 Options}
867 @gccoptlist{-mbarrel-shift-enabled  -mdivide-enabled  -mmultiply-enabled @gol
868 -msign-extend-enabled  -muser-enabled}
870 @emph{M32R/D Options}
871 @gccoptlist{-m32r2  -m32rx  -m32r @gol
872 -mdebug @gol
873 -malign-loops  -mno-align-loops @gol
874 -missue-rate=@var{number} @gol
875 -mbranch-cost=@var{number} @gol
876 -mmodel=@var{code-size-model-type} @gol
877 -msdata=@var{sdata-type} @gol
878 -mno-flush-func  -mflush-func=@var{name} @gol
879 -mno-flush-trap  -mflush-trap=@var{number} @gol
880 -G @var{num}}
882 @emph{M32C Options}
883 @gccoptlist{-mcpu=@var{cpu}  -msim  -memregs=@var{number}}
885 @emph{M680x0 Options}
886 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
887 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
888 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
889 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
890 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
891 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
892 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
893 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
894 -mxgot  -mno-xgot  -mlong-jump-table-offsets}
896 @emph{MCore Options}
897 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
898 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
899 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
900 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
901 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
903 @emph{MeP Options}
904 @gccoptlist{-mabsdiff  -mall-opts  -maverage  -mbased=@var{n}  -mbitops @gol
905 -mc=@var{n}  -mclip  -mconfig=@var{name}  -mcop  -mcop32  -mcop64  -mivc2 @gol
906 -mdc  -mdiv  -meb  -mel  -mio-volatile  -ml  -mleadz  -mm  -mminmax @gol
907 -mmult  -mno-opts  -mrepeat  -ms  -msatur  -msdram  -msim  -msimnovec  -mtf @gol
908 -mtiny=@var{n}}
910 @emph{MicroBlaze Options}
911 @gccoptlist{-msoft-float  -mhard-float  -msmall-divides  -mcpu=@var{cpu} @gol
912 -mmemcpy  -mxl-soft-mul  -mxl-soft-div  -mxl-barrel-shift @gol
913 -mxl-pattern-compare  -mxl-stack-check  -mxl-gp-opt  -mno-clearbss @gol
914 -mxl-multiply-high  -mxl-float-convert  -mxl-float-sqrt @gol
915 -mbig-endian  -mlittle-endian  -mxl-reorder  -mxl-mode-@var{app-model} @gol
916 -mpic-data-is-text-relative}
918 @emph{MIPS Options}
919 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
920 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
921 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
922 -mips16  -mno-mips16  -mflip-mips16 @gol
923 -minterlink-compressed  -mno-interlink-compressed @gol
924 -minterlink-mips16  -mno-interlink-mips16 @gol
925 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
926 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
927 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
928 -mno-float  -msingle-float  -mdouble-float @gol
929 -modd-spreg  -mno-odd-spreg @gol
930 -mabs=@var{mode}  -mnan=@var{encoding} @gol
931 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
932 -mmcu  -mmno-mcu @gol
933 -meva  -mno-eva @gol
934 -mvirt  -mno-virt @gol
935 -mxpa  -mno-xpa @gol
936 -mcrc  -mno-crc @gol
937 -mginv  -mno-ginv @gol
938 -mmicromips  -mno-micromips @gol
939 -mmsa  -mno-msa @gol
940 -mloongson-mmi  -mno-loongson-mmi @gol
941 -mloongson-ext  -mno-loongson-ext @gol
942 -mloongson-ext2  -mno-loongson-ext2 @gol
943 -mfpu=@var{fpu-type} @gol
944 -msmartmips  -mno-smartmips @gol
945 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
946 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
947 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
948 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
949 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
950 -membedded-data  -mno-embedded-data @gol
951 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
952 -mcode-readable=@var{setting} @gol
953 -msplit-addresses  -mno-split-addresses @gol
954 -mexplicit-relocs  -mno-explicit-relocs @gol
955 -mcheck-zero-division  -mno-check-zero-division @gol
956 -mdivide-traps  -mdivide-breaks @gol
957 -mload-store-pairs  -mno-load-store-pairs @gol
958 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
959 -mmad  -mno-mad  -mimadd  -mno-imadd  -mfused-madd  -mno-fused-madd  -nocpp @gol
960 -mfix-24k  -mno-fix-24k @gol
961 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
962 -mfix-r5900  -mno-fix-r5900 @gol
963 -mfix-r10000  -mno-fix-r10000  -mfix-rm7000  -mno-fix-rm7000 @gol
964 -mfix-vr4120  -mno-fix-vr4120 @gol
965 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
966 -mflush-func=@var{func}  -mno-flush-func @gol
967 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
968 -mcompact-branches=@var{policy} @gol
969 -mfp-exceptions  -mno-fp-exceptions @gol
970 -mvr4130-align  -mno-vr4130-align  -msynci  -mno-synci @gol
971 -mlxc1-sxc1  -mno-lxc1-sxc1  -mmadd4  -mno-madd4 @gol
972 -mrelax-pic-calls  -mno-relax-pic-calls  -mmcount-ra-address @gol
973 -mframe-header-opt  -mno-frame-header-opt}
975 @emph{MMIX Options}
976 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
977 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
978 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
979 -mno-base-addresses  -msingle-exit  -mno-single-exit}
981 @emph{MN10300 Options}
982 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
983 -mno-am33  -mam33  -mam33-2  -mam34 @gol
984 -mtune=@var{cpu-type} @gol
985 -mreturn-pointer-on-d0 @gol
986 -mno-crt0  -mrelax  -mliw  -msetlb}
988 @emph{Moxie Options}
989 @gccoptlist{-meb  -mel  -mmul.x  -mno-crt0}
991 @emph{MSP430 Options}
992 @gccoptlist{-msim  -masm-hex  -mmcu=  -mcpu=  -mlarge  -msmall  -mrelax @gol
993 -mwarn-mcu @gol
994 -mcode-region=  -mdata-region= @gol
995 -msilicon-errata=  -msilicon-errata-warn= @gol
996 -mhwmult=  -minrt}
998 @emph{NDS32 Options}
999 @gccoptlist{-mbig-endian  -mlittle-endian @gol
1000 -mreduced-regs  -mfull-regs @gol
1001 -mcmov  -mno-cmov @gol
1002 -mext-perf  -mno-ext-perf @gol
1003 -mext-perf2  -mno-ext-perf2 @gol
1004 -mext-string  -mno-ext-string @gol
1005 -mv3push  -mno-v3push @gol
1006 -m16bit  -mno-16bit @gol
1007 -misr-vector-size=@var{num} @gol
1008 -mcache-block-size=@var{num} @gol
1009 -march=@var{arch} @gol
1010 -mcmodel=@var{code-model} @gol
1011 -mctor-dtor  -mrelax}
1013 @emph{Nios II Options}
1014 @gccoptlist{-G @var{num}  -mgpopt=@var{option}  -mgpopt  -mno-gpopt @gol
1015 -mgprel-sec=@var{regexp}  -mr0rel-sec=@var{regexp} @gol
1016 -mel  -meb @gol
1017 -mno-bypass-cache  -mbypass-cache @gol
1018 -mno-cache-volatile  -mcache-volatile @gol
1019 -mno-fast-sw-div  -mfast-sw-div @gol
1020 -mhw-mul  -mno-hw-mul  -mhw-mulx  -mno-hw-mulx  -mno-hw-div  -mhw-div @gol
1021 -mcustom-@var{insn}=@var{N}  -mno-custom-@var{insn} @gol
1022 -mcustom-fpu-cfg=@var{name} @gol
1023 -mhal  -msmallc  -msys-crt0=@var{name}  -msys-lib=@var{name} @gol
1024 -march=@var{arch}  -mbmx  -mno-bmx  -mcdx  -mno-cdx}
1026 @emph{Nvidia PTX Options}
1027 @gccoptlist{-m32  -m64  -mmainkernel  -moptimize}
1029 @emph{OpenRISC Options}
1030 @gccoptlist{-mboard=@var{name}  -mnewlib  -mhard-mul  -mhard-div @gol
1031 -msoft-mul  -msoft-div @gol
1032 -mcmov  -mror  -msext  -msfimm  -mshftimm}
1034 @emph{PDP-11 Options}
1035 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
1036 -mint32  -mno-int16  -mint16  -mno-int32 @gol
1037 -msplit  -munix-asm  -mdec-asm  -mgnu-asm  -mlra}
1039 @emph{picoChip Options}
1040 @gccoptlist{-mae=@var{ae_type}  -mvliw-lookahead=@var{N} @gol
1041 -msymbol-as-address  -mno-inefficient-warnings}
1043 @emph{PowerPC Options}
1044 See RS/6000 and PowerPC Options.
1046 @emph{RISC-V Options}
1047 @gccoptlist{-mbranch-cost=@var{N-instruction} @gol
1048 -mplt  -mno-plt @gol
1049 -mabi=@var{ABI-string} @gol
1050 -mfdiv  -mno-fdiv @gol
1051 -mdiv  -mno-div @gol
1052 -march=@var{ISA-string} @gol
1053 -mtune=@var{processor-string} @gol
1054 -mpreferred-stack-boundary=@var{num} @gol
1055 -msmall-data-limit=@var{N-bytes} @gol
1056 -msave-restore  -mno-save-restore @gol
1057 -mstrict-align  -mno-strict-align @gol
1058 -mcmodel=medlow  -mcmodel=medany @gol
1059 -mexplicit-relocs  -mno-explicit-relocs @gol
1060 -mrelax  -mno-relax @gol
1061 -mriscv-attribute  -mmo-riscv-attribute}
1063 @emph{RL78 Options}
1064 @gccoptlist{-msim  -mmul=none  -mmul=g13  -mmul=g14  -mallregs @gol
1065 -mcpu=g10  -mcpu=g13  -mcpu=g14  -mg10  -mg13  -mg14 @gol
1066 -m64bit-doubles  -m32bit-doubles  -msave-mduc-in-interrupts}
1068 @emph{RS/6000 and PowerPC Options}
1069 @gccoptlist{-mcpu=@var{cpu-type} @gol
1070 -mtune=@var{cpu-type} @gol
1071 -mcmodel=@var{code-model} @gol
1072 -mpowerpc64 @gol
1073 -maltivec  -mno-altivec @gol
1074 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
1075 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
1076 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mpopcntd  -mno-popcntd @gol
1077 -mfprnd  -mno-fprnd @gol
1078 -mcmpb  -mno-cmpb  -mmfpgpr  -mno-mfpgpr  -mhard-dfp  -mno-hard-dfp @gol
1079 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
1080 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
1081 -malign-power  -malign-natural @gol
1082 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
1083 -mupdate  -mno-update @gol
1084 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
1085 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
1086 -mstrict-align  -mno-strict-align  -mrelocatable @gol
1087 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
1088 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
1089 -mdynamic-no-pic  -mswdiv  -msingle-pic-base @gol
1090 -mprioritize-restricted-insns=@var{priority} @gol
1091 -msched-costly-dep=@var{dependence_type} @gol
1092 -minsert-sched-nops=@var{scheme} @gol
1093 -mcall-aixdesc  -mcall-eabi  -mcall-freebsd  @gol
1094 -mcall-linux  -mcall-netbsd  -mcall-openbsd  @gol
1095 -mcall-sysv  -mcall-sysv-eabi  -mcall-sysv-noeabi @gol
1096 -mtraceback=@var{traceback_type} @gol
1097 -maix-struct-return  -msvr4-struct-return @gol
1098 -mabi=@var{abi-type}  -msecure-plt  -mbss-plt @gol
1099 -mlongcall  -mno-longcall  -mpltseq  -mno-pltseq  @gol
1100 -mblock-move-inline-limit=@var{num} @gol
1101 -mblock-compare-inline-limit=@var{num} @gol
1102 -mblock-compare-inline-loop-limit=@var{num} @gol
1103 -mstring-compare-inline-limit=@var{num} @gol
1104 -misel  -mno-isel @gol
1105 -mvrsave  -mno-vrsave @gol
1106 -mmulhw  -mno-mulhw @gol
1107 -mdlmzb  -mno-dlmzb @gol
1108 -mprototype  -mno-prototype @gol
1109 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
1110 -msdata=@var{opt}  -mreadonly-in-sdata  -mvxworks  -G @var{num} @gol
1111 -mrecip  -mrecip=@var{opt}  -mno-recip  -mrecip-precision @gol
1112 -mno-recip-precision @gol
1113 -mveclibabi=@var{type}  -mfriz  -mno-friz @gol
1114 -mpointers-to-nested-functions  -mno-pointers-to-nested-functions @gol
1115 -msave-toc-indirect  -mno-save-toc-indirect @gol
1116 -mpower8-fusion  -mno-mpower8-fusion  -mpower8-vector  -mno-power8-vector @gol
1117 -mcrypto  -mno-crypto  -mhtm  -mno-htm @gol
1118 -mquad-memory  -mno-quad-memory @gol
1119 -mquad-memory-atomic  -mno-quad-memory-atomic @gol
1120 -mcompat-align-parm  -mno-compat-align-parm @gol
1121 -mfloat128  -mno-float128  -mfloat128-hardware  -mno-float128-hardware @gol
1122 -mgnu-attribute  -mno-gnu-attribute @gol
1123 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
1124 -mstack-protector-guard-offset=@var{offset}}
1126 @emph{RX Options}
1127 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
1128 -mcpu=@gol
1129 -mbig-endian-data  -mlittle-endian-data @gol
1130 -msmall-data @gol
1131 -msim  -mno-sim@gol
1132 -mas100-syntax  -mno-as100-syntax@gol
1133 -mrelax@gol
1134 -mmax-constant-size=@gol
1135 -mint-register=@gol
1136 -mpid@gol
1137 -mallow-string-insns  -mno-allow-string-insns@gol
1138 -mjsr@gol
1139 -mno-warn-multiple-fast-interrupts@gol
1140 -msave-acc-in-interrupts}
1142 @emph{S/390 and zSeries Options}
1143 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1144 -mhard-float  -msoft-float  -mhard-dfp  -mno-hard-dfp @gol
1145 -mlong-double-64  -mlong-double-128 @gol
1146 -mbackchain  -mno-backchain  -mpacked-stack  -mno-packed-stack @gol
1147 -msmall-exec  -mno-small-exec  -mmvcle  -mno-mvcle @gol
1148 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
1149 -mhtm  -mvx  -mzvector @gol
1150 -mtpf-trace  -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
1151 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size  -mstack-guard @gol
1152 -mhotpatch=@var{halfwords},@var{halfwords}}
1154 @emph{Score Options}
1155 @gccoptlist{-meb  -mel @gol
1156 -mnhwloop @gol
1157 -muls @gol
1158 -mmac @gol
1159 -mscore5  -mscore5u  -mscore7  -mscore7d}
1161 @emph{SH Options}
1162 @gccoptlist{-m1  -m2  -m2e @gol
1163 -m2a-nofpu  -m2a-single-only  -m2a-single  -m2a @gol
1164 -m3  -m3e @gol
1165 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
1166 -m4a-nofpu  -m4a-single-only  -m4a-single  -m4a  -m4al @gol
1167 -mb  -ml  -mdalign  -mrelax @gol
1168 -mbigtable  -mfmovd  -mrenesas  -mno-renesas  -mnomacsave @gol
1169 -mieee  -mno-ieee  -mbitops  -misize  -minline-ic_invalidate  -mpadstruct @gol
1170 -mprefergot  -musermode  -multcost=@var{number}  -mdiv=@var{strategy} @gol
1171 -mdivsi3_libfunc=@var{name}  -mfixed-range=@var{register-range} @gol
1172 -maccumulate-outgoing-args @gol
1173 -matomic-model=@var{atomic-model} @gol
1174 -mbranch-cost=@var{num}  -mzdcbranch  -mno-zdcbranch @gol
1175 -mcbranch-force-delay-slot @gol
1176 -mfused-madd  -mno-fused-madd  -mfsca  -mno-fsca  -mfsrra  -mno-fsrra @gol
1177 -mpretend-cmove  -mtas}
1179 @emph{Solaris 2 Options}
1180 @gccoptlist{-mclear-hwcap  -mno-clear-hwcap  -mimpure-text  -mno-impure-text @gol
1181 -pthreads}
1183 @emph{SPARC Options}
1184 @gccoptlist{-mcpu=@var{cpu-type} @gol
1185 -mtune=@var{cpu-type} @gol
1186 -mcmodel=@var{code-model} @gol
1187 -mmemory-model=@var{mem-model} @gol
1188 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1189 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1190 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1191 -mhard-quad-float  -msoft-quad-float @gol
1192 -mstack-bias  -mno-stack-bias @gol
1193 -mstd-struct-return  -mno-std-struct-return @gol
1194 -munaligned-doubles  -mno-unaligned-doubles @gol
1195 -muser-mode  -mno-user-mode @gol
1196 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1197 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1198 -mvis4  -mno-vis4  -mvis4b  -mno-vis4b @gol
1199 -mcbcond  -mno-cbcond  -mfmaf  -mno-fmaf  -mfsmuld  -mno-fsmuld  @gol
1200 -mpopc  -mno-popc  -msubxc  -mno-subxc @gol
1201 -mfix-at697f  -mfix-ut699  -mfix-ut700  -mfix-gr712rc @gol
1202 -mlra  -mno-lra}
1204 @emph{SPU Options}
1205 @gccoptlist{-mwarn-reloc  -merror-reloc @gol
1206 -msafe-dma  -munsafe-dma @gol
1207 -mbranch-hints @gol
1208 -msmall-mem  -mlarge-mem  -mstdmain @gol
1209 -mfixed-range=@var{register-range} @gol
1210 -mea32  -mea64 @gol
1211 -maddress-space-conversion  -mno-address-space-conversion @gol
1212 -mcache-size=@var{cache-size} @gol
1213 -matomic-updates  -mno-atomic-updates}
1215 @emph{System V Options}
1216 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1218 @emph{TILE-Gx Options}
1219 @gccoptlist{-mcpu=CPU  -m32  -m64  -mbig-endian  -mlittle-endian @gol
1220 -mcmodel=@var{code-model}}
1222 @emph{TILEPro Options}
1223 @gccoptlist{-mcpu=@var{cpu}  -m32}
1225 @emph{V850 Options}
1226 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1227 -mprolog-function  -mno-prolog-function  -mspace @gol
1228 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1229 -mapp-regs  -mno-app-regs @gol
1230 -mdisable-callt  -mno-disable-callt @gol
1231 -mv850e2v3  -mv850e2  -mv850e1  -mv850es @gol
1232 -mv850e  -mv850  -mv850e3v5 @gol
1233 -mloop @gol
1234 -mrelax @gol
1235 -mlong-jumps @gol
1236 -msoft-float @gol
1237 -mhard-float @gol
1238 -mgcc-abi @gol
1239 -mrh850-abi @gol
1240 -mbig-switch}
1242 @emph{VAX Options}
1243 @gccoptlist{-mg  -mgnu  -munix}
1245 @emph{Visium Options}
1246 @gccoptlist{-mdebug  -msim  -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1247 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type}  -msv-mode  -muser-mode}
1249 @emph{VMS Options}
1250 @gccoptlist{-mvms-return-codes  -mdebug-main=@var{prefix}  -mmalloc64 @gol
1251 -mpointer-size=@var{size}}
1253 @emph{VxWorks Options}
1254 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1255 -Xbind-lazy  -Xbind-now}
1257 @emph{x86 Options}
1258 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1259 -mtune-ctrl=@var{feature-list}  -mdump-tune-features  -mno-default @gol
1260 -mfpmath=@var{unit} @gol
1261 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1262 -mno-fp-ret-in-387  -m80387  -mhard-float  -msoft-float @gol
1263 -mno-wide-multiply  -mrtd  -malign-double @gol
1264 -mpreferred-stack-boundary=@var{num} @gol
1265 -mincoming-stack-boundary=@var{num} @gol
1266 -mcld  -mcx16  -msahf  -mmovbe  -mcrc32 @gol
1267 -mrecip  -mrecip=@var{opt} @gol
1268 -mvzeroupper  -mprefer-avx128  -mprefer-vector-width=@var{opt} @gol
1269 -mmmx  -msse  -msse2  -msse3  -mssse3  -msse4.1  -msse4.2  -msse4  -mavx @gol
1270 -mavx2  -mavx512f  -mavx512pf  -mavx512er  -mavx512cd  -mavx512vl @gol
1271 -mavx512bw  -mavx512dq  -mavx512ifma  -mavx512vbmi  -msha  -maes @gol
1272 -mpclmul  -mfsgsbase  -mrdrnd  -mf16c  -mfma  -mpconfig  -mwbnoinvd  @gol
1273 -mptwrite  -mprefetchwt1  -mclflushopt  -mclwb  -mxsavec  -mxsaves @gol
1274 -msse4a  -m3dnow  -m3dnowa  -mpopcnt  -mabm  -mbmi  -mtbm  -mfma4  -mxop @gol
1275 -madx  -mlzcnt  -mbmi2  -mfxsr  -mxsave  -mxsaveopt  -mrtm  -mhle  -mlwp @gol
1276 -mmwaitx  -mclzero  -mpku  -mthreads  -mgfni  -mvaes  -mwaitpkg @gol
1277 -mshstk -mmanual-endbr -mforce-indirect-call -mavx512vbmi2 -mavx512bf16 @gol
1278 -mvpclmulqdq  -mavx512bitalg  -mmovdiri  -mmovdir64b  -mavx512vpopcntdq @gol
1279 -mavx5124fmaps  -mavx512vnni  -mavx5124vnniw  -mprfchw  -mrdpid @gol
1280 -mrdseed  -msgx @gol
1281 -mcldemote  -mms-bitfields  -mno-align-stringops  -minline-all-stringops @gol
1282 -minline-stringops-dynamically  -mstringop-strategy=@var{alg} @gol
1283 -mmemcpy-strategy=@var{strategy}  -mmemset-strategy=@var{strategy} @gol
1284 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1285 -m96bit-long-double  -mlong-double-64  -mlong-double-80  -mlong-double-128 @gol
1286 -mregparm=@var{num}  -msseregparm @gol
1287 -mveclibabi=@var{type}  -mvect8-ret-in-mem @gol
1288 -mpc32  -mpc64  -mpc80  -mstackrealign @gol
1289 -momit-leaf-frame-pointer  -mno-red-zone  -mno-tls-direct-seg-refs @gol
1290 -mcmodel=@var{code-model}  -mabi=@var{name}  -maddress-mode=@var{mode} @gol
1291 -m32  -m64  -mx32  -m16  -miamcu  -mlarge-data-threshold=@var{num} @gol
1292 -msse2avx  -mfentry  -mrecord-mcount  -mnop-mcount  -m8bit-idiv @gol
1293 -minstrument-return=@var{type} -mfentry-name=@var{name} -mfentry-section=@var{name} @gol
1294 -mavx256-split-unaligned-load  -mavx256-split-unaligned-store @gol
1295 -malign-data=@var{type}  -mstack-protector-guard=@var{guard} @gol
1296 -mstack-protector-guard-reg=@var{reg} @gol
1297 -mstack-protector-guard-offset=@var{offset} @gol
1298 -mstack-protector-guard-symbol=@var{symbol} @gol
1299 -mgeneral-regs-only  -mcall-ms2sysv-xlogues @gol
1300 -mindirect-branch=@var{choice}  -mfunction-return=@var{choice} @gol
1301 -mindirect-branch-register}
1303 @emph{x86 Windows Options}
1304 @gccoptlist{-mconsole  -mcygwin  -mno-cygwin  -mdll @gol
1305 -mnop-fun-dllimport  -mthread @gol
1306 -municode  -mwin32  -mwindows  -fno-set-stack-executable}
1308 @emph{Xstormy16 Options}
1309 @gccoptlist{-msim}
1311 @emph{Xtensa Options}
1312 @gccoptlist{-mconst16  -mno-const16 @gol
1313 -mfused-madd  -mno-fused-madd @gol
1314 -mforce-no-pic @gol
1315 -mserialize-volatile  -mno-serialize-volatile @gol
1316 -mtext-section-literals  -mno-text-section-literals @gol
1317 -mauto-litpools  -mno-auto-litpools @gol
1318 -mtarget-align  -mno-target-align @gol
1319 -mlongcalls  -mno-longcalls}
1321 @emph{zSeries Options}
1322 See S/390 and zSeries Options.
1323 @end table
1326 @node Overall Options
1327 @section Options Controlling the Kind of Output
1329 Compilation can involve up to four stages: preprocessing, compilation
1330 proper, assembly and linking, always in that order.  GCC is capable of
1331 preprocessing and compiling several files either into several
1332 assembler input files, or into one assembler input file; then each
1333 assembler input file produces an object file, and linking combines all
1334 the object files (those newly compiled, and those specified as input)
1335 into an executable file.
1337 @cindex file name suffix
1338 For any given input file, the file name suffix determines what kind of
1339 compilation is done:
1341 @table @gcctabopt
1342 @item @var{file}.c
1343 C source code that must be preprocessed.
1345 @item @var{file}.i
1346 C source code that should not be preprocessed.
1348 @item @var{file}.ii
1349 C++ source code that should not be preprocessed.
1351 @item @var{file}.m
1352 Objective-C source code.  Note that you must link with the @file{libobjc}
1353 library to make an Objective-C program work.
1355 @item @var{file}.mi
1356 Objective-C source code that should not be preprocessed.
1358 @item @var{file}.mm
1359 @itemx @var{file}.M
1360 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1361 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1362 to a literal capital M@.
1364 @item @var{file}.mii
1365 Objective-C++ source code that should not be preprocessed.
1367 @item @var{file}.h
1368 C, C++, Objective-C or Objective-C++ header file to be turned into a
1369 precompiled header (default), or C, C++ header file to be turned into an
1370 Ada spec (via the @option{-fdump-ada-spec} switch).
1372 @item @var{file}.cc
1373 @itemx @var{file}.cp
1374 @itemx @var{file}.cxx
1375 @itemx @var{file}.cpp
1376 @itemx @var{file}.CPP
1377 @itemx @var{file}.c++
1378 @itemx @var{file}.C
1379 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1380 the last two letters must both be literally @samp{x}.  Likewise,
1381 @samp{.C} refers to a literal capital C@.
1383 @item @var{file}.mm
1384 @itemx @var{file}.M
1385 Objective-C++ source code that must be preprocessed.
1387 @item @var{file}.mii
1388 Objective-C++ source code that should not be preprocessed.
1390 @item @var{file}.hh
1391 @itemx @var{file}.H
1392 @itemx @var{file}.hp
1393 @itemx @var{file}.hxx
1394 @itemx @var{file}.hpp
1395 @itemx @var{file}.HPP
1396 @itemx @var{file}.h++
1397 @itemx @var{file}.tcc
1398 C++ header file to be turned into a precompiled header or Ada spec.
1400 @item @var{file}.f
1401 @itemx @var{file}.for
1402 @itemx @var{file}.ftn
1403 Fixed form Fortran source code that should not be preprocessed.
1405 @item @var{file}.F
1406 @itemx @var{file}.FOR
1407 @itemx @var{file}.fpp
1408 @itemx @var{file}.FPP
1409 @itemx @var{file}.FTN
1410 Fixed form Fortran source code that must be preprocessed (with the traditional
1411 preprocessor).
1413 @item @var{file}.f90
1414 @itemx @var{file}.f95
1415 @itemx @var{file}.f03
1416 @itemx @var{file}.f08
1417 Free form Fortran source code that should not be preprocessed.
1419 @item @var{file}.F90
1420 @itemx @var{file}.F95
1421 @itemx @var{file}.F03
1422 @itemx @var{file}.F08
1423 Free form Fortran source code that must be preprocessed (with the
1424 traditional preprocessor).
1426 @item @var{file}.go
1427 Go source code.
1429 @item @var{file}.brig
1430 BRIG files (binary representation of HSAIL).
1432 @item @var{file}.d
1433 D source code.
1435 @item @var{file}.di
1436 D interface file.
1438 @item @var{file}.dd
1439 D documentation code (Ddoc).
1441 @item @var{file}.ads
1442 Ada source code file that contains a library unit declaration (a
1443 declaration of a package, subprogram, or generic, or a generic
1444 instantiation), or a library unit renaming declaration (a package,
1445 generic, or subprogram renaming declaration).  Such files are also
1446 called @dfn{specs}.
1448 @item @var{file}.adb
1449 Ada source code file containing a library unit body (a subprogram or
1450 package body).  Such files are also called @dfn{bodies}.
1452 @c GCC also knows about some suffixes for languages not yet included:
1453 @c Ratfor:
1454 @c @var{file}.r
1456 @item @var{file}.s
1457 Assembler code.
1459 @item @var{file}.S
1460 @itemx @var{file}.sx
1461 Assembler code that must be preprocessed.
1463 @item @var{other}
1464 An object file to be fed straight into linking.
1465 Any file name with no recognized suffix is treated this way.
1466 @end table
1468 @opindex x
1469 You can specify the input language explicitly with the @option{-x} option:
1471 @table @gcctabopt
1472 @item -x @var{language}
1473 Specify explicitly the @var{language} for the following input files
1474 (rather than letting the compiler choose a default based on the file
1475 name suffix).  This option applies to all following input files until
1476 the next @option{-x} option.  Possible values for @var{language} are:
1477 @smallexample
1478 c  c-header  cpp-output
1479 c++  c++-header  c++-cpp-output
1480 objective-c  objective-c-header  objective-c-cpp-output
1481 objective-c++ objective-c++-header objective-c++-cpp-output
1482 assembler  assembler-with-cpp
1485 f77  f77-cpp-input f95  f95-cpp-input
1487 brig
1488 @end smallexample
1490 @item -x none
1491 Turn off any specification of a language, so that subsequent files are
1492 handled according to their file name suffixes (as they are if @option{-x}
1493 has not been used at all).
1494 @end table
1496 If you only want some of the stages of compilation, you can use
1497 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1498 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1499 @command{gcc} is to stop.  Note that some combinations (for example,
1500 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1502 @table @gcctabopt
1503 @item -c
1504 @opindex c
1505 Compile or assemble the source files, but do not link.  The linking
1506 stage simply is not done.  The ultimate output is in the form of an
1507 object file for each source file.
1509 By default, the object file name for a source file is made by replacing
1510 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1512 Unrecognized input files, not requiring compilation or assembly, are
1513 ignored.
1515 @item -S
1516 @opindex S
1517 Stop after the stage of compilation proper; do not assemble.  The output
1518 is in the form of an assembler code file for each non-assembler input
1519 file specified.
1521 By default, the assembler file name for a source file is made by
1522 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1524 Input files that don't require compilation are ignored.
1526 @item -E
1527 @opindex E
1528 Stop after the preprocessing stage; do not run the compiler proper.  The
1529 output is in the form of preprocessed source code, which is sent to the
1530 standard output.
1532 Input files that don't require preprocessing are ignored.
1534 @cindex output file option
1535 @item -o @var{file}
1536 @opindex o
1537 Place output in file @var{file}.  This applies to whatever
1538 sort of output is being produced, whether it be an executable file,
1539 an object file, an assembler file or preprocessed C code.
1541 If @option{-o} is not specified, the default is to put an executable
1542 file in @file{a.out}, the object file for
1543 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1544 assembler file in @file{@var{source}.s}, a precompiled header file in
1545 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1546 standard output.
1548 @item -v
1549 @opindex v
1550 Print (on standard error output) the commands executed to run the stages
1551 of compilation.  Also print the version number of the compiler driver
1552 program and of the preprocessor and the compiler proper.
1554 @item -###
1555 @opindex ###
1556 Like @option{-v} except the commands are not executed and arguments
1557 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1558 This is useful for shell scripts to capture the driver-generated command lines.
1560 @item --help
1561 @opindex help
1562 Print (on the standard output) a description of the command-line options
1563 understood by @command{gcc}.  If the @option{-v} option is also specified
1564 then @option{--help} is also passed on to the various processes
1565 invoked by @command{gcc}, so that they can display the command-line options
1566 they accept.  If the @option{-Wextra} option has also been specified
1567 (prior to the @option{--help} option), then command-line options that
1568 have no documentation associated with them are also displayed.
1570 @item --target-help
1571 @opindex target-help
1572 Print (on the standard output) a description of target-specific command-line
1573 options for each tool.  For some targets extra target-specific
1574 information may also be printed.
1576 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1577 Print (on the standard output) a description of the command-line
1578 options understood by the compiler that fit into all specified classes
1579 and qualifiers.  These are the supported classes:
1581 @table @asis
1582 @item @samp{optimizers}
1583 Display all of the optimization options supported by the
1584 compiler.
1586 @item @samp{warnings}
1587 Display all of the options controlling warning messages
1588 produced by the compiler.
1590 @item @samp{target}
1591 Display target-specific options.  Unlike the
1592 @option{--target-help} option however, target-specific options of the
1593 linker and assembler are not displayed.  This is because those
1594 tools do not currently support the extended @option{--help=} syntax.
1596 @item @samp{params}
1597 Display the values recognized by the @option{--param}
1598 option.
1600 @item @var{language}
1601 Display the options supported for @var{language}, where
1602 @var{language} is the name of one of the languages supported in this
1603 version of GCC@.
1605 @item @samp{common}
1606 Display the options that are common to all languages.
1607 @end table
1609 These are the supported qualifiers:
1611 @table @asis
1612 @item @samp{undocumented}
1613 Display only those options that are undocumented.
1615 @item @samp{joined}
1616 Display options taking an argument that appears after an equal
1617 sign in the same continuous piece of text, such as:
1618 @samp{--help=target}.
1620 @item @samp{separate}
1621 Display options taking an argument that appears as a separate word
1622 following the original option, such as: @samp{-o output-file}.
1623 @end table
1625 Thus for example to display all the undocumented target-specific
1626 switches supported by the compiler, use:
1628 @smallexample
1629 --help=target,undocumented
1630 @end smallexample
1632 The sense of a qualifier can be inverted by prefixing it with the
1633 @samp{^} character, so for example to display all binary warning
1634 options (i.e., ones that are either on or off and that do not take an
1635 argument) that have a description, use:
1637 @smallexample
1638 --help=warnings,^joined,^undocumented
1639 @end smallexample
1641 The argument to @option{--help=} should not consist solely of inverted
1642 qualifiers.
1644 Combining several classes is possible, although this usually
1645 restricts the output so much that there is nothing to display.  One
1646 case where it does work, however, is when one of the classes is
1647 @var{target}.  For example, to display all the target-specific
1648 optimization options, use:
1650 @smallexample
1651 --help=target,optimizers
1652 @end smallexample
1654 The @option{--help=} option can be repeated on the command line.  Each
1655 successive use displays its requested class of options, skipping
1656 those that have already been displayed.  If @option{--help} is also
1657 specified anywhere on the command line then this takes precedence
1658 over any @option{--help=} option.
1660 If the @option{-Q} option appears on the command line before the
1661 @option{--help=} option, then the descriptive text displayed by
1662 @option{--help=} is changed.  Instead of describing the displayed
1663 options, an indication is given as to whether the option is enabled,
1664 disabled or set to a specific value (assuming that the compiler
1665 knows this at the point where the @option{--help=} option is used).
1667 Here is a truncated example from the ARM port of @command{gcc}:
1669 @smallexample
1670   % gcc -Q -mabi=2 --help=target -c
1671   The following options are target specific:
1672   -mabi=                                2
1673   -mabort-on-noreturn                   [disabled]
1674   -mapcs                                [disabled]
1675 @end smallexample
1677 The output is sensitive to the effects of previous command-line
1678 options, so for example it is possible to find out which optimizations
1679 are enabled at @option{-O2} by using:
1681 @smallexample
1682 -Q -O2 --help=optimizers
1683 @end smallexample
1685 Alternatively you can discover which binary optimizations are enabled
1686 by @option{-O3} by using:
1688 @smallexample
1689 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1690 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1691 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1692 @end smallexample
1694 @item --version
1695 @opindex version
1696 Display the version number and copyrights of the invoked GCC@.
1698 @item -pass-exit-codes
1699 @opindex pass-exit-codes
1700 Normally the @command{gcc} program exits with the code of 1 if any
1701 phase of the compiler returns a non-success return code.  If you specify
1702 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1703 the numerically highest error produced by any phase returning an error
1704 indication.  The C, C++, and Fortran front ends return 4 if an internal
1705 compiler error is encountered.
1707 @item -pipe
1708 @opindex pipe
1709 Use pipes rather than temporary files for communication between the
1710 various stages of compilation.  This fails to work on some systems where
1711 the assembler is unable to read from a pipe; but the GNU assembler has
1712 no trouble.
1714 @item -specs=@var{file}
1715 @opindex specs
1716 Process @var{file} after the compiler reads in the standard @file{specs}
1717 file, in order to override the defaults which the @command{gcc} driver
1718 program uses when determining what switches to pass to @command{cc1},
1719 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
1720 @option{-specs=@var{file}} can be specified on the command line, and they
1721 are processed in order, from left to right.  @xref{Spec Files}, for
1722 information about the format of the @var{file}.
1724 @item -wrapper
1725 @opindex wrapper
1726 Invoke all subcommands under a wrapper program.  The name of the
1727 wrapper program and its parameters are passed as a comma separated
1728 list.
1730 @smallexample
1731 gcc -c t.c -wrapper gdb,--args
1732 @end smallexample
1734 @noindent
1735 This invokes all subprograms of @command{gcc} under
1736 @samp{gdb --args}, thus the invocation of @command{cc1} is
1737 @samp{gdb --args cc1 @dots{}}.
1739 @item -ffile-prefix-map=@var{old}=@var{new}
1740 @opindex ffile-prefix-map
1741 When compiling files residing in directory @file{@var{old}}, record
1742 any references to them in the result of the compilation as if the
1743 files resided in directory @file{@var{new}} instead.  Specifying this
1744 option is equivalent to specifying all the individual
1745 @option{-f*-prefix-map} options.  This can be used to make reproducible
1746 builds that are location independent.  See also
1747 @option{-fmacro-prefix-map} and @option{-fdebug-prefix-map}.
1749 @item -fplugin=@var{name}.so
1750 @opindex fplugin
1751 Load the plugin code in file @var{name}.so, assumed to be a
1752 shared object to be dlopen'd by the compiler.  The base name of
1753 the shared object file is used to identify the plugin for the
1754 purposes of argument parsing (See
1755 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1756 Each plugin should define the callback functions specified in the
1757 Plugins API.
1759 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1760 @opindex fplugin-arg
1761 Define an argument called @var{key} with a value of @var{value}
1762 for the plugin called @var{name}.
1764 @item -fdump-ada-spec@r{[}-slim@r{]}
1765 @opindex fdump-ada-spec
1766 For C and C++ source and include files, generate corresponding Ada specs.
1767 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1768 GNAT User's Guide}, which provides detailed documentation on this feature.
1770 @item -fada-spec-parent=@var{unit}
1771 @opindex fada-spec-parent
1772 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1773 Ada specs as child units of parent @var{unit}.
1775 @item -fdump-go-spec=@var{file}
1776 @opindex fdump-go-spec
1777 For input files in any language, generate corresponding Go
1778 declarations in @var{file}.  This generates Go @code{const},
1779 @code{type}, @code{var}, and @code{func} declarations which may be a
1780 useful way to start writing a Go interface to code written in some
1781 other language.
1783 @include @value{srcdir}/../libiberty/at-file.texi
1784 @end table
1786 @node Invoking G++
1787 @section Compiling C++ Programs
1789 @cindex suffixes for C++ source
1790 @cindex C++ source file suffixes
1791 C++ source files conventionally use one of the suffixes @samp{.C},
1792 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1793 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1794 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1795 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1796 files with these names and compiles them as C++ programs even if you
1797 call the compiler the same way as for compiling C programs (usually
1798 with the name @command{gcc}).
1800 @findex g++
1801 @findex c++
1802 However, the use of @command{gcc} does not add the C++ library.
1803 @command{g++} is a program that calls GCC and automatically specifies linking
1804 against the C++ library.  It treats @samp{.c},
1805 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1806 files unless @option{-x} is used.  This program is also useful when
1807 precompiling a C header file with a @samp{.h} extension for use in C++
1808 compilations.  On many systems, @command{g++} is also installed with
1809 the name @command{c++}.
1811 @cindex invoking @command{g++}
1812 When you compile C++ programs, you may specify many of the same
1813 command-line options that you use for compiling programs in any
1814 language; or command-line options meaningful for C and related
1815 languages; or options that are meaningful only for C++ programs.
1816 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1817 explanations of options for languages related to C@.
1818 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1819 explanations of options that are meaningful only for C++ programs.
1821 @node C Dialect Options
1822 @section Options Controlling C Dialect
1823 @cindex dialect options
1824 @cindex language dialect options
1825 @cindex options, dialect
1827 The following options control the dialect of C (or languages derived
1828 from C, such as C++, Objective-C and Objective-C++) that the compiler
1829 accepts:
1831 @table @gcctabopt
1832 @cindex ANSI support
1833 @cindex ISO support
1834 @item -ansi
1835 @opindex ansi
1836 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1837 equivalent to @option{-std=c++98}.
1839 This turns off certain features of GCC that are incompatible with ISO
1840 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1841 such as the @code{asm} and @code{typeof} keywords, and
1842 predefined macros such as @code{unix} and @code{vax} that identify the
1843 type of system you are using.  It also enables the undesirable and
1844 rarely used ISO trigraph feature.  For the C compiler,
1845 it disables recognition of C++ style @samp{//} comments as well as
1846 the @code{inline} keyword.
1848 The alternate keywords @code{__asm__}, @code{__extension__},
1849 @code{__inline__} and @code{__typeof__} continue to work despite
1850 @option{-ansi}.  You would not want to use them in an ISO C program, of
1851 course, but it is useful to put them in header files that might be included
1852 in compilations done with @option{-ansi}.  Alternate predefined macros
1853 such as @code{__unix__} and @code{__vax__} are also available, with or
1854 without @option{-ansi}.
1856 The @option{-ansi} option does not cause non-ISO programs to be
1857 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1858 addition to @option{-ansi}.  @xref{Warning Options}.
1860 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1861 option is used.  Some header files may notice this macro and refrain
1862 from declaring certain functions or defining certain macros that the
1863 ISO standard doesn't call for; this is to avoid interfering with any
1864 programs that might use these names for other things.
1866 Functions that are normally built in but do not have semantics
1867 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1868 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1869 built-in functions provided by GCC}, for details of the functions
1870 affected.
1872 @item -std=
1873 @opindex std
1874 Determine the language standard. @xref{Standards,,Language Standards
1875 Supported by GCC}, for details of these standard versions.  This option
1876 is currently only supported when compiling C or C++.
1878 The compiler can accept several base standards, such as @samp{c90} or
1879 @samp{c++98}, and GNU dialects of those standards, such as
1880 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1881 compiler accepts all programs following that standard plus those
1882 using GNU extensions that do not contradict it.  For example,
1883 @option{-std=c90} turns off certain features of GCC that are
1884 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1885 keywords, but not other GNU extensions that do not have a meaning in
1886 ISO C90, such as omitting the middle term of a @code{?:}
1887 expression. On the other hand, when a GNU dialect of a standard is
1888 specified, all features supported by the compiler are enabled, even when
1889 those features change the meaning of the base standard.  As a result, some
1890 strict-conforming programs may be rejected.  The particular standard
1891 is used by @option{-Wpedantic} to identify which features are GNU
1892 extensions given that version of the standard. For example
1893 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1894 comments, while @option{-std=gnu99 -Wpedantic} does not.
1896 A value for this option must be provided; possible values are
1898 @table @samp
1899 @item c90
1900 @itemx c89
1901 @itemx iso9899:1990
1902 Support all ISO C90 programs (certain GNU extensions that conflict
1903 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1905 @item iso9899:199409
1906 ISO C90 as modified in amendment 1.
1908 @item c99
1909 @itemx c9x
1910 @itemx iso9899:1999
1911 @itemx iso9899:199x
1912 ISO C99.  This standard is substantially completely supported, modulo
1913 bugs and floating-point issues
1914 (mainly but not entirely relating to optional C99 features from
1915 Annexes F and G).  See
1916 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1917 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1919 @item c11
1920 @itemx c1x
1921 @itemx iso9899:2011
1922 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1923 substantially completely supported, modulo bugs, floating-point issues
1924 (mainly but not entirely relating to optional C11 features from
1925 Annexes F and G) and the optional Annexes K (Bounds-checking
1926 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1928 @item c17
1929 @itemx c18
1930 @itemx iso9899:2017
1931 @itemx iso9899:2018
1932 ISO C17, the 2017 revision of the ISO C standard
1933 (published in 2018).  This standard is
1934 same as C11 except for corrections of defects (all of which are also
1935 applied with @option{-std=c11}) and a new value of
1936 @code{__STDC_VERSION__}, and so is supported to the same extent as C11.
1938 @item c2x
1939 The next version of the ISO C standard, still under development.  The
1940 support for this version is experimental and incomplete.
1942 @item gnu90
1943 @itemx gnu89
1944 GNU dialect of ISO C90 (including some C99 features).
1946 @item gnu99
1947 @itemx gnu9x
1948 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1950 @item gnu11
1951 @itemx gnu1x
1952 GNU dialect of ISO C11.
1953 The name @samp{gnu1x} is deprecated.
1955 @item gnu17
1956 @itemx gnu18
1957 GNU dialect of ISO C17.  This is the default for C code.
1959 @item gnu2x
1960 The next version of the ISO C standard, still under development, plus
1961 GNU extensions.  The support for this version is experimental and
1962 incomplete.
1964 @item c++98
1965 @itemx c++03
1966 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1967 additional defect reports. Same as @option{-ansi} for C++ code.
1969 @item gnu++98
1970 @itemx gnu++03
1971 GNU dialect of @option{-std=c++98}.
1973 @item c++11
1974 @itemx c++0x
1975 The 2011 ISO C++ standard plus amendments.
1976 The name @samp{c++0x} is deprecated.
1978 @item gnu++11
1979 @itemx gnu++0x
1980 GNU dialect of @option{-std=c++11}.
1981 The name @samp{gnu++0x} is deprecated.
1983 @item c++14
1984 @itemx c++1y
1985 The 2014 ISO C++ standard plus amendments.
1986 The name @samp{c++1y} is deprecated.
1988 @item gnu++14
1989 @itemx gnu++1y
1990 GNU dialect of @option{-std=c++14}.
1991 This is the default for C++ code.
1992 The name @samp{gnu++1y} is deprecated.
1994 @item c++17
1995 @itemx c++1z
1996 The 2017 ISO C++ standard plus amendments.
1997 The name @samp{c++1z} is deprecated.
1999 @item gnu++17
2000 @itemx gnu++1z
2001 GNU dialect of @option{-std=c++17}.
2002 The name @samp{gnu++1z} is deprecated.
2004 @item c++2a
2005 The next revision of the ISO C++ standard, tentatively planned for
2006 2020.  Support is highly experimental, and will almost certainly
2007 change in incompatible ways in future releases.
2009 @item gnu++2a
2010 GNU dialect of @option{-std=c++2a}.  Support is highly experimental,
2011 and will almost certainly change in incompatible ways in future
2012 releases.
2013 @end table
2015 @item -fgnu89-inline
2016 @opindex fgnu89-inline
2017 The option @option{-fgnu89-inline} tells GCC to use the traditional
2018 GNU semantics for @code{inline} functions when in C99 mode.
2019 @xref{Inline,,An Inline Function is As Fast As a Macro}.
2020 Using this option is roughly equivalent to adding the
2021 @code{gnu_inline} function attribute to all inline functions
2022 (@pxref{Function Attributes}).
2024 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
2025 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
2026 specifies the default behavior).
2027 This option is not supported in @option{-std=c90} or
2028 @option{-std=gnu90} mode.
2030 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
2031 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
2032 in effect for @code{inline} functions.  @xref{Common Predefined
2033 Macros,,,cpp,The C Preprocessor}.
2035 @item -fpermitted-flt-eval-methods=@var{style}
2036 @opindex fpermitted-flt-eval-methods
2037 @opindex fpermitted-flt-eval-methods=c11
2038 @opindex fpermitted-flt-eval-methods=ts-18661-3
2039 ISO/IEC TS 18661-3 defines new permissible values for
2040 @code{FLT_EVAL_METHOD} that indicate that operations and constants with
2041 a semantic type that is an interchange or extended format should be
2042 evaluated to the precision and range of that type.  These new values are
2043 a superset of those permitted under C99/C11, which does not specify the
2044 meaning of other positive values of @code{FLT_EVAL_METHOD}.  As such, code
2045 conforming to C11 may not have been written expecting the possibility of
2046 the new values.
2048 @option{-fpermitted-flt-eval-methods} specifies whether the compiler
2049 should allow only the values of @code{FLT_EVAL_METHOD} specified in C99/C11,
2050 or the extended set of values specified in ISO/IEC TS 18661-3.
2052 @var{style} is either @code{c11} or @code{ts-18661-3} as appropriate.
2054 The default when in a standards compliant mode (@option{-std=c11} or similar)
2055 is @option{-fpermitted-flt-eval-methods=c11}.  The default when in a GNU
2056 dialect (@option{-std=gnu11} or similar) is
2057 @option{-fpermitted-flt-eval-methods=ts-18661-3}.
2059 @item -aux-info @var{filename}
2060 @opindex aux-info
2061 Output to the given filename prototyped declarations for all functions
2062 declared and/or defined in a translation unit, including those in header
2063 files.  This option is silently ignored in any language other than C@.
2065 Besides declarations, the file indicates, in comments, the origin of
2066 each declaration (source file and line), whether the declaration was
2067 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
2068 @samp{O} for old, respectively, in the first character after the line
2069 number and the colon), and whether it came from a declaration or a
2070 definition (@samp{C} or @samp{F}, respectively, in the following
2071 character).  In the case of function definitions, a K&R-style list of
2072 arguments followed by their declarations is also provided, inside
2073 comments, after the declaration.
2075 @item -fallow-parameterless-variadic-functions
2076 @opindex fallow-parameterless-variadic-functions
2077 Accept variadic functions without named parameters.
2079 Although it is possible to define such a function, this is not very
2080 useful as it is not possible to read the arguments.  This is only
2081 supported for C as this construct is allowed by C++.
2083 @item -fno-asm
2084 @opindex fno-asm
2085 @opindex fasm
2086 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
2087 keyword, so that code can use these words as identifiers.  You can use
2088 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
2089 instead.  @option{-ansi} implies @option{-fno-asm}.
2091 In C++, this switch only affects the @code{typeof} keyword, since
2092 @code{asm} and @code{inline} are standard keywords.  You may want to
2093 use the @option{-fno-gnu-keywords} flag instead, which has the same
2094 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
2095 switch only affects the @code{asm} and @code{typeof} keywords, since
2096 @code{inline} is a standard keyword in ISO C99.
2098 @item -fno-builtin
2099 @itemx -fno-builtin-@var{function}
2100 @opindex fno-builtin
2101 @opindex fbuiltin
2102 @cindex built-in functions
2103 Don't recognize built-in functions that do not begin with
2104 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
2105 functions provided by GCC}, for details of the functions affected,
2106 including those which are not built-in functions when @option{-ansi} or
2107 @option{-std} options for strict ISO C conformance are used because they
2108 do not have an ISO standard meaning.
2110 GCC normally generates special code to handle certain built-in functions
2111 more efficiently; for instance, calls to @code{alloca} may become single
2112 instructions which adjust the stack directly, and calls to @code{memcpy}
2113 may become inline copy loops.  The resulting code is often both smaller
2114 and faster, but since the function calls no longer appear as such, you
2115 cannot set a breakpoint on those calls, nor can you change the behavior
2116 of the functions by linking with a different library.  In addition,
2117 when a function is recognized as a built-in function, GCC may use
2118 information about that function to warn about problems with calls to
2119 that function, or to generate more efficient code, even if the
2120 resulting code still contains calls to that function.  For example,
2121 warnings are given with @option{-Wformat} for bad calls to
2122 @code{printf} when @code{printf} is built in and @code{strlen} is
2123 known not to modify global memory.
2125 With the @option{-fno-builtin-@var{function}} option
2126 only the built-in function @var{function} is
2127 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
2128 function is named that is not built-in in this version of GCC, this
2129 option is ignored.  There is no corresponding
2130 @option{-fbuiltin-@var{function}} option; if you wish to enable
2131 built-in functions selectively when using @option{-fno-builtin} or
2132 @option{-ffreestanding}, you may define macros such as:
2134 @smallexample
2135 #define abs(n)          __builtin_abs ((n))
2136 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
2137 @end smallexample
2139 @item -fgimple
2140 @opindex fgimple
2142 Enable parsing of function definitions marked with @code{__GIMPLE}.
2143 This is an experimental feature that allows unit testing of GIMPLE
2144 passes.
2146 @item -fhosted
2147 @opindex fhosted
2148 @cindex hosted environment
2150 Assert that compilation targets a hosted environment.  This implies
2151 @option{-fbuiltin}.  A hosted environment is one in which the
2152 entire standard library is available, and in which @code{main} has a return
2153 type of @code{int}.  Examples are nearly everything except a kernel.
2154 This is equivalent to @option{-fno-freestanding}.
2156 @item -ffreestanding
2157 @opindex ffreestanding
2158 @cindex hosted environment
2160 Assert that compilation targets a freestanding environment.  This
2161 implies @option{-fno-builtin}.  A freestanding environment
2162 is one in which the standard library may not exist, and program startup may
2163 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
2164 This is equivalent to @option{-fno-hosted}.
2166 @xref{Standards,,Language Standards Supported by GCC}, for details of
2167 freestanding and hosted environments.
2169 @item -fopenacc
2170 @opindex fopenacc
2171 @cindex OpenACC accelerator programming
2172 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
2173 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
2174 compiler generates accelerated code according to the OpenACC Application
2175 Programming Interface v2.0 @w{@uref{https://www.openacc.org}}.  This option
2176 implies @option{-pthread}, and thus is only supported on targets that
2177 have support for @option{-pthread}.
2179 @item -fopenacc-dim=@var{geom}
2180 @opindex fopenacc-dim
2181 @cindex OpenACC accelerator programming
2182 Specify default compute dimensions for parallel offload regions that do
2183 not explicitly specify.  The @var{geom} value is a triple of
2184 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'.  A size
2185 can be omitted, to use a target-specific default value.
2187 @item -fopenmp
2188 @opindex fopenmp
2189 @cindex OpenMP parallel
2190 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
2191 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
2192 compiler generates parallel code according to the OpenMP Application
2193 Program Interface v4.5 @w{@uref{https://www.openmp.org}}.  This option
2194 implies @option{-pthread}, and thus is only supported on targets that
2195 have support for @option{-pthread}. @option{-fopenmp} implies
2196 @option{-fopenmp-simd}.
2198 @item -fopenmp-simd
2199 @opindex fopenmp-simd
2200 @cindex OpenMP SIMD
2201 @cindex SIMD
2202 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
2203 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
2204 are ignored.
2206 @item -fgnu-tm
2207 @opindex fgnu-tm
2208 When the option @option{-fgnu-tm} is specified, the compiler
2209 generates code for the Linux variant of Intel's current Transactional
2210 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
2211 an experimental feature whose interface may change in future versions
2212 of GCC, as the official specification changes.  Please note that not
2213 all architectures are supported for this feature.
2215 For more information on GCC's support for transactional memory,
2216 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
2217 Transactional Memory Library}.
2219 Note that the transactional memory feature is not supported with
2220 non-call exceptions (@option{-fnon-call-exceptions}).
2222 @item -fms-extensions
2223 @opindex fms-extensions
2224 Accept some non-standard constructs used in Microsoft header files.
2226 In C++ code, this allows member names in structures to be similar
2227 to previous types declarations.
2229 @smallexample
2230 typedef int UOW;
2231 struct ABC @{
2232   UOW UOW;
2234 @end smallexample
2236 Some cases of unnamed fields in structures and unions are only
2237 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
2238 fields within structs/unions}, for details.
2240 Note that this option is off for all targets but x86 
2241 targets using ms-abi.
2243 @item -fplan9-extensions
2244 @opindex fplan9-extensions
2245 Accept some non-standard constructs used in Plan 9 code.
2247 This enables @option{-fms-extensions}, permits passing pointers to
2248 structures with anonymous fields to functions that expect pointers to
2249 elements of the type of the field, and permits referring to anonymous
2250 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2251 struct/union fields within structs/unions}, for details.  This is only
2252 supported for C, not C++.
2254 @item -fcond-mismatch
2255 @opindex fcond-mismatch
2256 Allow conditional expressions with mismatched types in the second and
2257 third arguments.  The value of such an expression is void.  This option
2258 is not supported for C++.
2260 @item -flax-vector-conversions
2261 @opindex flax-vector-conversions
2262 Allow implicit conversions between vectors with differing numbers of
2263 elements and/or incompatible element types.  This option should not be
2264 used for new code.
2266 @item -funsigned-char
2267 @opindex funsigned-char
2268 Let the type @code{char} be unsigned, like @code{unsigned char}.
2270 Each kind of machine has a default for what @code{char} should
2271 be.  It is either like @code{unsigned char} by default or like
2272 @code{signed char} by default.
2274 Ideally, a portable program should always use @code{signed char} or
2275 @code{unsigned char} when it depends on the signedness of an object.
2276 But many programs have been written to use plain @code{char} and
2277 expect it to be signed, or expect it to be unsigned, depending on the
2278 machines they were written for.  This option, and its inverse, let you
2279 make such a program work with the opposite default.
2281 The type @code{char} is always a distinct type from each of
2282 @code{signed char} or @code{unsigned char}, even though its behavior
2283 is always just like one of those two.
2285 @item -fsigned-char
2286 @opindex fsigned-char
2287 Let the type @code{char} be signed, like @code{signed char}.
2289 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2290 the negative form of @option{-funsigned-char}.  Likewise, the option
2291 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2293 @item -fsigned-bitfields
2294 @itemx -funsigned-bitfields
2295 @itemx -fno-signed-bitfields
2296 @itemx -fno-unsigned-bitfields
2297 @opindex fsigned-bitfields
2298 @opindex funsigned-bitfields
2299 @opindex fno-signed-bitfields
2300 @opindex fno-unsigned-bitfields
2301 These options control whether a bit-field is signed or unsigned, when the
2302 declaration does not use either @code{signed} or @code{unsigned}.  By
2303 default, such a bit-field is signed, because this is consistent: the
2304 basic integer types such as @code{int} are signed types.
2306 @item -fsso-struct=@var{endianness}
2307 @opindex fsso-struct
2308 Set the default scalar storage order of structures and unions to the
2309 specified endianness.  The accepted values are @samp{big-endian},
2310 @samp{little-endian} and @samp{native} for the native endianness of
2311 the target (the default).  This option is not supported for C++.
2313 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2314 code that is not binary compatible with code generated without it if the
2315 specified endianness is not the native endianness of the target.
2316 @end table
2318 @node C++ Dialect Options
2319 @section Options Controlling C++ Dialect
2321 @cindex compiler options, C++
2322 @cindex C++ options, command-line
2323 @cindex options, C++
2324 This section describes the command-line options that are only meaningful
2325 for C++ programs.  You can also use most of the GNU compiler options
2326 regardless of what language your program is in.  For example, you
2327 might compile a file @file{firstClass.C} like this:
2329 @smallexample
2330 g++ -g -fstrict-enums -O -c firstClass.C
2331 @end smallexample
2333 @noindent
2334 In this example, only @option{-fstrict-enums} is an option meant
2335 only for C++ programs; you can use the other options with any
2336 language supported by GCC@.
2338 Some options for compiling C programs, such as @option{-std}, are also
2339 relevant for C++ programs.
2340 @xref{C Dialect Options,,Options Controlling C Dialect}.
2342 Here is a list of options that are @emph{only} for compiling C++ programs:
2344 @table @gcctabopt
2346 @item -fabi-version=@var{n}
2347 @opindex fabi-version
2348 Use version @var{n} of the C++ ABI@.  The default is version 0.
2350 Version 0 refers to the version conforming most closely to
2351 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2352 will change in different versions of G++ as ABI bugs are fixed.
2354 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2356 Version 2 is the version of the C++ ABI that first appeared in G++
2357 3.4, and was the default through G++ 4.9.
2359 Version 3 corrects an error in mangling a constant address as a
2360 template argument.
2362 Version 4, which first appeared in G++ 4.5, implements a standard
2363 mangling for vector types.
2365 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2366 attribute const/volatile on function pointer types, decltype of a
2367 plain decl, and use of a function parameter in the declaration of
2368 another parameter.
2370 Version 6, which first appeared in G++ 4.7, corrects the promotion
2371 behavior of C++11 scoped enums and the mangling of template argument
2372 packs, const/static_cast, prefix ++ and --, and a class scope function
2373 used as a template argument.
2375 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2376 builtin type and corrects the mangling of lambdas in default argument
2377 scope.
2379 Version 8, which first appeared in G++ 4.9, corrects the substitution
2380 behavior of function types with function-cv-qualifiers.
2382 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2383 @code{nullptr_t}.
2385 Version 10, which first appeared in G++ 6.1, adds mangling of
2386 attributes that affect type identity, such as ia32 calling convention
2387 attributes (e.g.@: @samp{stdcall}).
2389 Version 11, which first appeared in G++ 7, corrects the mangling of
2390 sizeof... expressions and operator names.  For multiple entities with
2391 the same name within a function, that are declared in different scopes,
2392 the mangling now changes starting with the twelfth occurrence.  It also
2393 implies @option{-fnew-inheriting-ctors}.
2395 Version 12, which first appeared in G++ 8, corrects the calling
2396 conventions for empty classes on the x86_64 target and for classes
2397 with only deleted copy/move constructors.  It accidentally changes the
2398 calling convention for classes with a deleted copy constructor and a
2399 trivial move constructor.
2401 Version 13, which first appeared in G++ 8.2, fixes the accidental
2402 change in version 12.
2404 See also @option{-Wabi}.
2406 @item -fabi-compat-version=@var{n}
2407 @opindex fabi-compat-version
2408 On targets that support strong aliases, G++
2409 works around mangling changes by creating an alias with the correct
2410 mangled name when defining a symbol with an incorrect mangled name.
2411 This switch specifies which ABI version to use for the alias.
2413 With @option{-fabi-version=0} (the default), this defaults to 11 (GCC 7
2414 compatibility).  If another ABI version is explicitly selected, this
2415 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2416 use @option{-fabi-compat-version=2}.
2418 If this option is not provided but @option{-Wabi=@var{n}} is, that
2419 version is used for compatibility aliases.  If this option is provided
2420 along with @option{-Wabi} (without the version), the version from this
2421 option is used for the warning.
2423 @item -fno-access-control
2424 @opindex fno-access-control
2425 @opindex faccess-control
2426 Turn off all access checking.  This switch is mainly useful for working
2427 around bugs in the access control code.
2429 @item -faligned-new
2430 @opindex faligned-new
2431 Enable support for C++17 @code{new} of types that require more
2432 alignment than @code{void* ::operator new(std::size_t)} provides.  A
2433 numeric argument such as @code{-faligned-new=32} can be used to
2434 specify how much alignment (in bytes) is provided by that function,
2435 but few users will need to override the default of
2436 @code{alignof(std::max_align_t)}.
2438 This flag is enabled by default for @option{-std=c++17}.
2440 @item -fchar8_t
2441 @itemx -fno-char8_t
2442 @opindex fchar8_t
2443 @opindex fno-char8_t
2444 Enable support for @code{char8_t} as adopted for C++2a.  This includes
2445 the addition of a new @code{char8_t} fundamental type, changes to the
2446 types of UTF-8 string and character literals, new signatures for
2447 user-defined literals, associated standard library updates, and new
2448 @code{__cpp_char8_t} and @code{__cpp_lib_char8_t} feature test macros.
2450 This option enables functions to be overloaded for ordinary and UTF-8
2451 strings:
2453 @smallexample
2454 int f(const char *);    // #1
2455 int f(const char8_t *); // #2
2456 int v1 = f("text");     // Calls #1
2457 int v2 = f(u8"text");   // Calls #2
2458 @end smallexample
2460 @noindent
2461 and introduces new signatures for user-defined literals:
2463 @smallexample
2464 int operator""_udl1(char8_t);
2465 int v3 = u8'x'_udl1;
2466 int operator""_udl2(const char8_t*, std::size_t);
2467 int v4 = u8"text"_udl2;
2468 template<typename T, T...> int operator""_udl3();
2469 int v5 = u8"text"_udl3;
2470 @end smallexample
2472 @noindent
2473 The change to the types of UTF-8 string and character literals introduces
2474 incompatibilities with ISO C++11 and later standards.  For example, the
2475 following code is well-formed under ISO C++11, but is ill-formed when
2476 @option{-fchar8_t} is specified.
2478 @smallexample
2479 char ca[] = u8"xx";     // error: char-array initialized from wide
2480                         //        string
2481 const char *cp = u8"xx";// error: invalid conversion from
2482                         //        `const char8_t*' to `const char*'
2483 int f(const char*);
2484 auto v = f(u8"xx");     // error: invalid conversion from
2485                         //        `const char8_t*' to `const char*'
2486 std::string s@{u8"xx"@};  // error: no matching function for call to
2487                         //        `std::basic_string<char>::basic_string()'
2488 using namespace std::literals;
2489 s = u8"xx"s;            // error: conversion from
2490                         //        `basic_string<char8_t>' to non-scalar
2491                         //        type `basic_string<char>' requested
2492 @end smallexample
2494 @item -fcheck-new
2495 @opindex fcheck-new
2496 Check that the pointer returned by @code{operator new} is non-null
2497 before attempting to modify the storage allocated.  This check is
2498 normally unnecessary because the C++ standard specifies that
2499 @code{operator new} only returns @code{0} if it is declared
2500 @code{throw()}, in which case the compiler always checks the
2501 return value even without this option.  In all other cases, when
2502 @code{operator new} has a non-empty exception specification, memory
2503 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2504 @samp{new (nothrow)}.
2506 @item -fconcepts
2507 @opindex fconcepts
2508 Enable support for the C++ Extensions for Concepts Technical
2509 Specification, ISO 19217 (2015), which allows code like
2511 @smallexample
2512 template <class T> concept bool Addable = requires (T t) @{ t + t; @};
2513 template <Addable T> T add (T a, T b) @{ return a + b; @}
2514 @end smallexample
2516 @item -fconstexpr-depth=@var{n}
2517 @opindex fconstexpr-depth
2518 Set the maximum nested evaluation depth for C++11 constexpr functions
2519 to @var{n}.  A limit is needed to detect endless recursion during
2520 constant expression evaluation.  The minimum specified by the standard
2521 is 512.
2523 @item -fconstexpr-loop-limit=@var{n}
2524 @opindex fconstexpr-loop-limit
2525 Set the maximum number of iterations for a loop in C++14 constexpr functions
2526 to @var{n}.  A limit is needed to detect infinite loops during
2527 constant expression evaluation.  The default is 262144 (1<<18).
2529 @item -fconstexpr-ops-limit=@var{n}
2530 @opindex fconstexpr-ops-limit
2531 Set the maximum number of operations during a single constexpr evaluation.
2532 Even when number of iterations of a single loop is limited with the above limit,
2533 if there are several nested loops and each of them has many iterations but still
2534 smaller than the above limit, or if in a body of some loop or even outside
2535 of a loop too many expressions need to be evaluated, the resulting constexpr
2536 evaluation might take too long.
2537 The default is 33554432 (1<<25).
2539 @item -fdeduce-init-list
2540 @opindex fdeduce-init-list
2541 Enable deduction of a template type parameter as
2542 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2544 @smallexample
2545 template <class T> auto forward(T t) -> decltype (realfn (t))
2547   return realfn (t);
2550 void f()
2552   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2554 @end smallexample
2556 This deduction was implemented as a possible extension to the
2557 originally proposed semantics for the C++11 standard, but was not part
2558 of the final standard, so it is disabled by default.  This option is
2559 deprecated, and may be removed in a future version of G++.
2561 @item -fno-elide-constructors
2562 @opindex fno-elide-constructors
2563 @opindex felide-constructors
2564 The C++ standard allows an implementation to omit creating a temporary
2565 that is only used to initialize another object of the same type.
2566 Specifying this option disables that optimization, and forces G++ to
2567 call the copy constructor in all cases.  This option also causes G++
2568 to call trivial member functions which otherwise would be expanded inline.
2570 In C++17, the compiler is required to omit these temporaries, but this
2571 option still affects trivial member functions.
2573 @item -fno-enforce-eh-specs
2574 @opindex fno-enforce-eh-specs
2575 @opindex fenforce-eh-specs
2576 Don't generate code to check for violation of exception specifications
2577 at run time.  This option violates the C++ standard, but may be useful
2578 for reducing code size in production builds, much like defining
2579 @code{NDEBUG}.  This does not give user code permission to throw
2580 exceptions in violation of the exception specifications; the compiler
2581 still optimizes based on the specifications, so throwing an
2582 unexpected exception results in undefined behavior at run time.
2584 @item -fextern-tls-init
2585 @itemx -fno-extern-tls-init
2586 @opindex fextern-tls-init
2587 @opindex fno-extern-tls-init
2588 The C++11 and OpenMP standards allow @code{thread_local} and
2589 @code{threadprivate} variables to have dynamic (runtime)
2590 initialization.  To support this, any use of such a variable goes
2591 through a wrapper function that performs any necessary initialization.
2592 When the use and definition of the variable are in the same
2593 translation unit, this overhead can be optimized away, but when the
2594 use is in a different translation unit there is significant overhead
2595 even if the variable doesn't actually need dynamic initialization.  If
2596 the programmer can be sure that no use of the variable in a
2597 non-defining TU needs to trigger dynamic initialization (either
2598 because the variable is statically initialized, or a use of the
2599 variable in the defining TU will be executed before any uses in
2600 another TU), they can avoid this overhead with the
2601 @option{-fno-extern-tls-init} option.
2603 On targets that support symbol aliases, the default is
2604 @option{-fextern-tls-init}.  On targets that do not support symbol
2605 aliases, the default is @option{-fno-extern-tls-init}.
2607 @item -fno-gnu-keywords
2608 @opindex fno-gnu-keywords
2609 @opindex fgnu-keywords
2610 Do not recognize @code{typeof} as a keyword, so that code can use this
2611 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2612 This option is implied by the strict ISO C++ dialects: @option{-ansi},
2613 @option{-std=c++98}, @option{-std=c++11}, etc.
2615 @item -fno-implicit-templates
2616 @opindex fno-implicit-templates
2617 @opindex fimplicit-templates
2618 Never emit code for non-inline templates that are instantiated
2619 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2620 If you use this option, you must take care to structure your code to
2621 include all the necessary explicit instantiations to avoid getting
2622 undefined symbols at link time.
2623 @xref{Template Instantiation}, for more information.
2625 @item -fno-implicit-inline-templates
2626 @opindex fno-implicit-inline-templates
2627 @opindex fimplicit-inline-templates
2628 Don't emit code for implicit instantiations of inline templates, either.
2629 The default is to handle inlines differently so that compiles with and
2630 without optimization need the same set of explicit instantiations.
2632 @item -fno-implement-inlines
2633 @opindex fno-implement-inlines
2634 @opindex fimplement-inlines
2635 To save space, do not emit out-of-line copies of inline functions
2636 controlled by @code{#pragma implementation}.  This causes linker
2637 errors if these functions are not inlined everywhere they are called.
2639 @item -fms-extensions
2640 @opindex fms-extensions
2641 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2642 int and getting a pointer to member function via non-standard syntax.
2644 @item -fnew-inheriting-ctors
2645 @opindex fnew-inheriting-ctors
2646 Enable the P0136 adjustment to the semantics of C++11 constructor
2647 inheritance.  This is part of C++17 but also considered to be a Defect
2648 Report against C++11 and C++14.  This flag is enabled by default
2649 unless @option{-fabi-version=10} or lower is specified.
2651 @item -fnew-ttp-matching
2652 @opindex fnew-ttp-matching
2653 Enable the P0522 resolution to Core issue 150, template template
2654 parameters and default arguments: this allows a template with default
2655 template arguments as an argument for a template template parameter
2656 with fewer template parameters.  This flag is enabled by default for
2657 @option{-std=c++17}.
2659 @item -fno-nonansi-builtins
2660 @opindex fno-nonansi-builtins
2661 @opindex fnonansi-builtins
2662 Disable built-in declarations of functions that are not mandated by
2663 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2664 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2666 @item -fnothrow-opt
2667 @opindex fnothrow-opt
2668 Treat a @code{throw()} exception specification as if it were a
2669 @code{noexcept} specification to reduce or eliminate the text size
2670 overhead relative to a function with no exception specification.  If
2671 the function has local variables of types with non-trivial
2672 destructors, the exception specification actually makes the
2673 function smaller because the EH cleanups for those variables can be
2674 optimized away.  The semantic effect is that an exception thrown out of
2675 a function with such an exception specification results in a call
2676 to @code{terminate} rather than @code{unexpected}.
2678 @item -fno-operator-names
2679 @opindex fno-operator-names
2680 @opindex foperator-names
2681 Do not treat the operator name keywords @code{and}, @code{bitand},
2682 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2683 synonyms as keywords.
2685 @item -fno-optional-diags
2686 @opindex fno-optional-diags
2687 @opindex foptional-diags
2688 Disable diagnostics that the standard says a compiler does not need to
2689 issue.  Currently, the only such diagnostic issued by G++ is the one for
2690 a name having multiple meanings within a class.
2692 @item -fpermissive
2693 @opindex fpermissive
2694 Downgrade some diagnostics about nonconformant code from errors to
2695 warnings.  Thus, using @option{-fpermissive} allows some
2696 nonconforming code to compile.
2698 @item -fno-pretty-templates
2699 @opindex fno-pretty-templates
2700 @opindex fpretty-templates
2701 When an error message refers to a specialization of a function
2702 template, the compiler normally prints the signature of the
2703 template followed by the template arguments and any typedefs or
2704 typenames in the signature (e.g.@: @code{void f(T) [with T = int]}
2705 rather than @code{void f(int)}) so that it's clear which template is
2706 involved.  When an error message refers to a specialization of a class
2707 template, the compiler omits any template arguments that match
2708 the default template arguments for that template.  If either of these
2709 behaviors make it harder to understand the error message rather than
2710 easier, you can use @option{-fno-pretty-templates} to disable them.
2712 @item -frepo
2713 @opindex frepo
2714 Enable automatic template instantiation at link time.  This option also
2715 implies @option{-fno-implicit-templates}.  @xref{Template
2716 Instantiation}, for more information.
2718 @item -fno-rtti
2719 @opindex fno-rtti
2720 @opindex frtti
2721 Disable generation of information about every class with virtual
2722 functions for use by the C++ run-time type identification features
2723 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2724 of the language, you can save some space by using this flag.  Note that
2725 exception handling uses the same information, but G++ generates it as
2726 needed. The @code{dynamic_cast} operator can still be used for casts that
2727 do not require run-time type information, i.e.@: casts to @code{void *} or to
2728 unambiguous base classes.
2730 Mixing code compiled with @option{-frtti} with that compiled with
2731 @option{-fno-rtti} may not work.  For example, programs may
2732 fail to link if a class compiled with @option{-fno-rtti} is used as a base 
2733 for a class compiled with @option{-frtti}.  
2735 @item -fsized-deallocation
2736 @opindex fsized-deallocation
2737 Enable the built-in global declarations
2738 @smallexample
2739 void operator delete (void *, std::size_t) noexcept;
2740 void operator delete[] (void *, std::size_t) noexcept;
2741 @end smallexample
2742 as introduced in C++14.  This is useful for user-defined replacement
2743 deallocation functions that, for example, use the size of the object
2744 to make deallocation faster.  Enabled by default under
2745 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2746 warns about places that might want to add a definition.
2748 @item -fstrict-enums
2749 @opindex fstrict-enums
2750 Allow the compiler to optimize using the assumption that a value of
2751 enumerated type can only be one of the values of the enumeration (as
2752 defined in the C++ standard; basically, a value that can be
2753 represented in the minimum number of bits needed to represent all the
2754 enumerators).  This assumption may not be valid if the program uses a
2755 cast to convert an arbitrary integer value to the enumerated type.
2757 @item -fstrong-eval-order
2758 @opindex fstrong-eval-order
2759 Evaluate member access, array subscripting, and shift expressions in
2760 left-to-right order, and evaluate assignment in right-to-left order,
2761 as adopted for C++17.  Enabled by default with @option{-std=c++17}.
2762 @option{-fstrong-eval-order=some} enables just the ordering of member
2763 access and shift expressions, and is the default without
2764 @option{-std=c++17}.
2766 @item -ftemplate-backtrace-limit=@var{n}
2767 @opindex ftemplate-backtrace-limit
2768 Set the maximum number of template instantiation notes for a single
2769 warning or error to @var{n}.  The default value is 10.
2771 @item -ftemplate-depth=@var{n}
2772 @opindex ftemplate-depth
2773 Set the maximum instantiation depth for template classes to @var{n}.
2774 A limit on the template instantiation depth is needed to detect
2775 endless recursions during template class instantiation.  ANSI/ISO C++
2776 conforming programs must not rely on a maximum depth greater than 17
2777 (changed to 1024 in C++11).  The default value is 900, as the compiler
2778 can run out of stack space before hitting 1024 in some situations.
2780 @item -fno-threadsafe-statics
2781 @opindex fno-threadsafe-statics
2782 @opindex fthreadsafe-statics
2783 Do not emit the extra code to use the routines specified in the C++
2784 ABI for thread-safe initialization of local statics.  You can use this
2785 option to reduce code size slightly in code that doesn't need to be
2786 thread-safe.
2788 @item -fuse-cxa-atexit
2789 @opindex fuse-cxa-atexit
2790 Register destructors for objects with static storage duration with the
2791 @code{__cxa_atexit} function rather than the @code{atexit} function.
2792 This option is required for fully standards-compliant handling of static
2793 destructors, but only works if your C library supports
2794 @code{__cxa_atexit}.
2796 @item -fno-use-cxa-get-exception-ptr
2797 @opindex fno-use-cxa-get-exception-ptr
2798 @opindex fuse-cxa-get-exception-ptr
2799 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2800 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2801 if the runtime routine is not available.
2803 @item -fvisibility-inlines-hidden
2804 @opindex fvisibility-inlines-hidden
2805 This switch declares that the user does not attempt to compare
2806 pointers to inline functions or methods where the addresses of the two functions
2807 are taken in different shared objects.
2809 The effect of this is that GCC may, effectively, mark inline methods with
2810 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2811 appear in the export table of a DSO and do not require a PLT indirection
2812 when used within the DSO@.  Enabling this option can have a dramatic effect
2813 on load and link times of a DSO as it massively reduces the size of the
2814 dynamic export table when the library makes heavy use of templates.
2816 The behavior of this switch is not quite the same as marking the
2817 methods as hidden directly, because it does not affect static variables
2818 local to the function or cause the compiler to deduce that
2819 the function is defined in only one shared object.
2821 You may mark a method as having a visibility explicitly to negate the
2822 effect of the switch for that method.  For example, if you do want to
2823 compare pointers to a particular inline method, you might mark it as
2824 having default visibility.  Marking the enclosing class with explicit
2825 visibility has no effect.
2827 Explicitly instantiated inline methods are unaffected by this option
2828 as their linkage might otherwise cross a shared library boundary.
2829 @xref{Template Instantiation}.
2831 @item -fvisibility-ms-compat
2832 @opindex fvisibility-ms-compat
2833 This flag attempts to use visibility settings to make GCC's C++
2834 linkage model compatible with that of Microsoft Visual Studio.
2836 The flag makes these changes to GCC's linkage model:
2838 @enumerate
2839 @item
2840 It sets the default visibility to @code{hidden}, like
2841 @option{-fvisibility=hidden}.
2843 @item
2844 Types, but not their members, are not hidden by default.
2846 @item
2847 The One Definition Rule is relaxed for types without explicit
2848 visibility specifications that are defined in more than one
2849 shared object: those declarations are permitted if they are
2850 permitted when this option is not used.
2851 @end enumerate
2853 In new code it is better to use @option{-fvisibility=hidden} and
2854 export those classes that are intended to be externally visible.
2855 Unfortunately it is possible for code to rely, perhaps accidentally,
2856 on the Visual Studio behavior.
2858 Among the consequences of these changes are that static data members
2859 of the same type with the same name but defined in different shared
2860 objects are different, so changing one does not change the other;
2861 and that pointers to function members defined in different shared
2862 objects may not compare equal.  When this flag is given, it is a
2863 violation of the ODR to define types with the same name differently.
2865 @item -fno-weak
2866 @opindex fno-weak
2867 @opindex fweak
2868 Do not use weak symbol support, even if it is provided by the linker.
2869 By default, G++ uses weak symbols if they are available.  This
2870 option exists only for testing, and should not be used by end-users;
2871 it results in inferior code and has no benefits.  This option may
2872 be removed in a future release of G++.
2874 @item -nostdinc++
2875 @opindex nostdinc++
2876 Do not search for header files in the standard directories specific to
2877 C++, but do still search the other standard directories.  (This option
2878 is used when building the C++ library.)
2879 @end table
2881 In addition, these optimization, warning, and code generation options
2882 have meanings only for C++ programs:
2884 @table @gcctabopt
2885 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2886 @opindex Wabi
2887 @opindex Wno-abi
2888 Warn when G++ it generates code that is probably not compatible with
2889 the vendor-neutral C++ ABI@.  Since G++ now defaults to updating the
2890 ABI with each major release, normally @option{-Wabi} will warn only if
2891 there is a check added later in a release series for an ABI issue
2892 discovered since the initial release.  @option{-Wabi} will warn about
2893 more things if an older ABI version is selected (with
2894 @option{-fabi-version=@var{n}}).
2896 @option{-Wabi} can also be used with an explicit version number to
2897 warn about compatibility with a particular @option{-fabi-version}
2898 level, e.g.@: @option{-Wabi=2} to warn about changes relative to
2899 @option{-fabi-version=2}.
2901 If an explicit version number is provided and
2902 @option{-fabi-compat-version} is not specified, the version number
2903 from this option is used for compatibility aliases.  If no explicit
2904 version number is provided with this option, but
2905 @option{-fabi-compat-version} is specified, that version number is
2906 used for ABI warnings.
2908 Although an effort has been made to warn about
2909 all such cases, there are probably some cases that are not warned about,
2910 even though G++ is generating incompatible code.  There may also be
2911 cases where warnings are emitted even though the code that is generated
2912 is compatible.
2914 You should rewrite your code to avoid these warnings if you are
2915 concerned about the fact that code generated by G++ may not be binary
2916 compatible with code generated by other compilers.
2918 Known incompatibilities in @option{-fabi-version=2} (which was the
2919 default from GCC 3.4 to 4.9) include:
2921 @itemize @bullet
2923 @item
2924 A template with a non-type template parameter of reference type was
2925 mangled incorrectly:
2926 @smallexample
2927 extern int N;
2928 template <int &> struct S @{@};
2929 void n (S<N>) @{2@}
2930 @end smallexample
2932 This was fixed in @option{-fabi-version=3}.
2934 @item
2935 SIMD vector types declared using @code{__attribute ((vector_size))} were
2936 mangled in a non-standard way that does not allow for overloading of
2937 functions taking vectors of different sizes.
2939 The mangling was changed in @option{-fabi-version=4}.
2941 @item
2942 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2943 qualifiers, and @code{decltype} of a plain declaration was folded away.
2945 These mangling issues were fixed in @option{-fabi-version=5}.
2947 @item
2948 Scoped enumerators passed as arguments to a variadic function are
2949 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2950 On most targets this does not actually affect the parameter passing
2951 ABI, as there is no way to pass an argument smaller than @code{int}.
2953 Also, the ABI changed the mangling of template argument packs,
2954 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2955 a class scope function used as a template argument.
2957 These issues were corrected in @option{-fabi-version=6}.
2959 @item
2960 Lambdas in default argument scope were mangled incorrectly, and the
2961 ABI changed the mangling of @code{nullptr_t}.
2963 These issues were corrected in @option{-fabi-version=7}.
2965 @item
2966 When mangling a function type with function-cv-qualifiers, the
2967 un-qualified function type was incorrectly treated as a substitution
2968 candidate.
2970 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
2972 @item
2973 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
2974 unaligned accesses.  Note that this did not affect the ABI of a
2975 function with a @code{nullptr_t} parameter, as parameters have a
2976 minimum alignment.
2978 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
2980 @item
2981 Target-specific attributes that affect the identity of a type, such as
2982 ia32 calling conventions on a function type (stdcall, regparm, etc.),
2983 did not affect the mangled name, leading to name collisions when
2984 function pointers were used as template arguments.
2986 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
2988 @end itemize
2990 It also warns about psABI-related changes.  The known psABI changes at this
2991 point include:
2993 @itemize @bullet
2995 @item
2996 For SysV/x86-64, unions with @code{long double} members are 
2997 passed in memory as specified in psABI.  For example:
2999 @smallexample
3000 union U @{
3001   long double ld;
3002   int i;
3004 @end smallexample
3006 @noindent
3007 @code{union U} is always passed in memory.
3009 @end itemize
3011 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
3012 @opindex Wabi-tag
3013 @opindex Wabi-tag
3014 Warn when a type with an ABI tag is used in a context that does not
3015 have that ABI tag.  See @ref{C++ Attributes} for more information
3016 about ABI tags.
3018 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
3019 @opindex Wctor-dtor-privacy
3020 @opindex Wno-ctor-dtor-privacy
3021 Warn when a class seems unusable because all the constructors or
3022 destructors in that class are private, and it has neither friends nor
3023 public static member functions.  Also warn if there are no non-private
3024 methods, and there's at least one private member function that isn't
3025 a constructor or destructor.
3027 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
3028 @opindex Wdelete-non-virtual-dtor
3029 @opindex Wno-delete-non-virtual-dtor
3030 Warn when @code{delete} is used to destroy an instance of a class that
3031 has virtual functions and non-virtual destructor. It is unsafe to delete
3032 an instance of a derived class through a pointer to a base class if the
3033 base class does not have a virtual destructor.  This warning is enabled
3034 by @option{-Wall}.
3036 @item -Wdeprecated-copy @r{(C++ and Objective-C++ only)}
3037 @opindex Wdeprecated-copy
3038 @opindex Wno-deprecated-copy
3039 Warn that the implicit declaration of a copy constructor or copy
3040 assignment operator is deprecated if the class has a user-provided
3041 copy constructor or copy assignment operator, in C++11 and up.  This
3042 warning is enabled by @option{-Wextra}.  With
3043 @option{-Wdeprecated-copy-dtor}, also deprecate if the class has a
3044 user-provided destructor.
3046 @item -Wno-init-list-lifetime @r{(C++ and Objective-C++ only)}
3047 @opindex Winit-list-lifetime
3048 @opindex Wno-init-list-lifetime
3049 Do not warn about uses of @code{std::initializer_list} that are likely
3050 to result in dangling pointers.  Since the underlying array for an
3051 @code{initializer_list} is handled like a normal C++ temporary object,
3052 it is easy to inadvertently keep a pointer to the array past the end
3053 of the array's lifetime.  For example:
3055 @itemize @bullet
3056 @item
3057 If a function returns a temporary @code{initializer_list}, or a local
3058 @code{initializer_list} variable, the array's lifetime ends at the end
3059 of the return statement, so the value returned has a dangling pointer.
3061 @item
3062 If a new-expression creates an @code{initializer_list}, the array only
3063 lives until the end of the enclosing full-expression, so the
3064 @code{initializer_list} in the heap has a dangling pointer.
3066 @item
3067 When an @code{initializer_list} variable is assigned from a
3068 brace-enclosed initializer list, the temporary array created for the
3069 right side of the assignment only lives until the end of the
3070 full-expression, so at the next statement the @code{initializer_list}
3071 variable has a dangling pointer.
3073 @smallexample
3074 // li's initial underlying array lives as long as li
3075 std::initializer_list<int> li = @{ 1,2,3 @};
3076 // assignment changes li to point to a temporary array
3077 li = @{ 4, 5 @};
3078 // now the temporary is gone and li has a dangling pointer
3079 int i = li.begin()[0] // undefined behavior
3080 @end smallexample
3082 @item
3083 When a list constructor stores the @code{begin} pointer from the
3084 @code{initializer_list} argument, this doesn't extend the lifetime of
3085 the array, so if a class variable is constructed from a temporary
3086 @code{initializer_list}, the pointer is left dangling by the end of
3087 the variable declaration statement.
3089 @end itemize
3091 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
3092 @opindex Wliteral-suffix
3093 @opindex Wno-literal-suffix
3094 Warn when a string or character literal is followed by a ud-suffix which does
3095 not begin with an underscore.  As a conforming extension, GCC treats such
3096 suffixes as separate preprocessing tokens in order to maintain backwards
3097 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
3098 For example:
3100 @smallexample
3101 #define __STDC_FORMAT_MACROS
3102 #include <inttypes.h>
3103 #include <stdio.h>
3105 int main() @{
3106   int64_t i64 = 123;
3107   printf("My int64: %" PRId64"\n", i64);
3109 @end smallexample
3111 In this case, @code{PRId64} is treated as a separate preprocessing token.
3113 Additionally, warn when a user-defined literal operator is declared with
3114 a literal suffix identifier that doesn't begin with an underscore. Literal
3115 suffix identifiers that don't begin with an underscore are reserved for
3116 future standardization.
3118 This warning is enabled by default.
3120 @item -Wlto-type-mismatch
3121 @opindex Wlto-type-mismatch
3122 @opindex Wno-lto-type-mismatch
3124 During the link-time optimization warn about type mismatches in
3125 global declarations from different compilation units.
3126 Requires @option{-flto} to be enabled.  Enabled by default.
3128 @item -Wno-narrowing @r{(C++ and Objective-C++ only)}
3129 @opindex Wnarrowing
3130 @opindex Wno-narrowing
3131 For C++11 and later standards, narrowing conversions are diagnosed by default,
3132 as required by the standard.  A narrowing conversion from a constant produces
3133 an error, and a narrowing conversion from a non-constant produces a warning,
3134 but @option{-Wno-narrowing} suppresses the diagnostic.
3135 Note that this does not affect the meaning of well-formed code;
3136 narrowing conversions are still considered ill-formed in SFINAE contexts.
3138 With @option{-Wnarrowing} in C++98, warn when a narrowing
3139 conversion prohibited by C++11 occurs within
3140 @samp{@{ @}}, e.g.
3142 @smallexample
3143 int i = @{ 2.2 @}; // error: narrowing from double to int
3144 @end smallexample
3146 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
3148 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
3149 @opindex Wnoexcept
3150 @opindex Wno-noexcept
3151 Warn when a noexcept-expression evaluates to false because of a call
3152 to a function that does not have a non-throwing exception
3153 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
3154 the compiler to never throw an exception.
3156 @item -Wnoexcept-type @r{(C++ and Objective-C++ only)}
3157 @opindex Wnoexcept-type
3158 @opindex Wno-noexcept-type
3159 Warn if the C++17 feature making @code{noexcept} part of a function
3160 type changes the mangled name of a symbol relative to C++14.  Enabled
3161 by @option{-Wabi} and @option{-Wc++17-compat}.
3163 As an example:
3165 @smallexample
3166 template <class T> void f(T t) @{ t(); @};
3167 void g() noexcept;
3168 void h() @{ f(g); @} 
3169 @end smallexample
3171 @noindent
3172 In C++14, @code{f} calls @code{f<void(*)()>}, but in
3173 C++17 it calls @code{f<void(*)()noexcept>}.
3175 @item -Wclass-memaccess @r{(C++ and Objective-C++ only)}
3176 @opindex Wclass-memaccess
3177 @opindex Wno-class-memaccess
3178 Warn when the destination of a call to a raw memory function such as
3179 @code{memset} or @code{memcpy} is an object of class type, and when writing
3180 into such an object might bypass the class non-trivial or deleted constructor
3181 or copy assignment, violate const-correctness or encapsulation, or corrupt
3182 virtual table pointers.  Modifying the representation of such objects may
3183 violate invariants maintained by member functions of the class.  For example,
3184 the call to @code{memset} below is undefined because it modifies a non-trivial
3185 class object and is, therefore, diagnosed.  The safe way to either initialize
3186 or clear the storage of objects of such types is by using the appropriate
3187 constructor or assignment operator, if one is available.
3188 @smallexample
3189 std::string str = "abc";
3190 memset (&str, 0, sizeof str);
3191 @end smallexample
3192 The @option{-Wclass-memaccess} option is enabled by @option{-Wall}.
3193 Explicitly casting the pointer to the class object to @code{void *} or
3194 to a type that can be safely accessed by the raw memory function suppresses
3195 the warning.
3197 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
3198 @opindex Wnon-virtual-dtor
3199 @opindex Wno-non-virtual-dtor
3200 Warn when a class has virtual functions and an accessible non-virtual
3201 destructor itself or in an accessible polymorphic base class, in which
3202 case it is possible but unsafe to delete an instance of a derived
3203 class through a pointer to the class itself or base class.  This
3204 warning is automatically enabled if @option{-Weffc++} is specified.
3206 @item -Wregister @r{(C++ and Objective-C++ only)}
3207 @opindex Wregister
3208 @opindex Wno-register
3209 Warn on uses of the @code{register} storage class specifier, except
3210 when it is part of the GNU @ref{Explicit Register Variables} extension.
3211 The use of the @code{register} keyword as storage class specifier has
3212 been deprecated in C++11 and removed in C++17.
3213 Enabled by default with @option{-std=c++17}.
3215 @item -Wreorder @r{(C++ and Objective-C++ only)}
3216 @opindex Wreorder
3217 @opindex Wno-reorder
3218 @cindex reordering, warning
3219 @cindex warning for reordering of member initializers
3220 Warn when the order of member initializers given in the code does not
3221 match the order in which they must be executed.  For instance:
3223 @smallexample
3224 struct A @{
3225   int i;
3226   int j;
3227   A(): j (0), i (1) @{ @}
3229 @end smallexample
3231 @noindent
3232 The compiler rearranges the member initializers for @code{i}
3233 and @code{j} to match the declaration order of the members, emitting
3234 a warning to that effect.  This warning is enabled by @option{-Wall}.
3236 @item -Wno-pessimizing-move @r{(C++ and Objective-C++ only)}
3237 @opindex Wpessimizing-move
3238 @opindex Wno-pessimizing-move
3239 This warning warns when a call to @code{std::move} prevents copy
3240 elision.  A typical scenario when copy elision can occur is when returning in
3241 a function with a class return type, when the expression being returned is the
3242 name of a non-volatile automatic object, and is not a function parameter, and
3243 has the same type as the function return type.
3245 @smallexample
3246 struct T @{
3247 @dots{}
3249 T fn()
3251   T t;
3252   @dots{}
3253   return std::move (t);
3255 @end smallexample
3257 But in this example, the @code{std::move} call prevents copy elision.
3259 This warning is enabled by @option{-Wall}.
3261 @item -Wno-redundant-move @r{(C++ and Objective-C++ only)}
3262 @opindex Wredundant-move
3263 @opindex Wno-redundant-move
3264 This warning warns about redundant calls to @code{std::move}; that is, when
3265 a move operation would have been performed even without the @code{std::move}
3266 call.  This happens because the compiler is forced to treat the object as if
3267 it were an rvalue in certain situations such as returning a local variable,
3268 where copy elision isn't applicable.  Consider:
3270 @smallexample
3271 struct T @{
3272 @dots{}
3274 T fn(T t)
3276   @dots{}
3277   return std::move (t);
3279 @end smallexample
3281 Here, the @code{std::move} call is redundant.  Because G++ implements Core
3282 Issue 1579, another example is:
3284 @smallexample
3285 struct T @{ // convertible to U
3286 @dots{}
3288 struct U @{
3289 @dots{}
3291 U fn()
3293   T t;
3294   @dots{}
3295   return std::move (t);
3297 @end smallexample
3298 In this example, copy elision isn't applicable because the type of the
3299 expression being returned and the function return type differ, yet G++
3300 treats the return value as if it were designated by an rvalue.
3302 This warning is enabled by @option{-Wextra}.
3304 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
3305 @opindex fext-numeric-literals
3306 @opindex fno-ext-numeric-literals
3307 Accept imaginary, fixed-point, or machine-defined
3308 literal number suffixes as GNU extensions.
3309 When this option is turned off these suffixes are treated
3310 as C++11 user-defined literal numeric suffixes.
3311 This is on by default for all pre-C++11 dialects and all GNU dialects:
3312 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
3313 @option{-std=gnu++14}.
3314 This option is off by default
3315 for ISO C++11 onwards (@option{-std=c++11}, ...).
3316 @end table
3318 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
3320 @table @gcctabopt
3321 @item -Weffc++ @r{(C++ and Objective-C++ only)}
3322 @opindex Weffc++
3323 @opindex Wno-effc++
3324 Warn about violations of the following style guidelines from Scott Meyers'
3325 @cite{Effective C++} series of books:
3327 @itemize @bullet
3328 @item
3329 Define a copy constructor and an assignment operator for classes
3330 with dynamically-allocated memory.
3332 @item
3333 Prefer initialization to assignment in constructors.
3335 @item
3336 Have @code{operator=} return a reference to @code{*this}.
3338 @item
3339 Don't try to return a reference when you must return an object.
3341 @item
3342 Distinguish between prefix and postfix forms of increment and
3343 decrement operators.
3345 @item
3346 Never overload @code{&&}, @code{||}, or @code{,}.
3348 @end itemize
3350 This option also enables @option{-Wnon-virtual-dtor}, which is also
3351 one of the effective C++ recommendations.  However, the check is
3352 extended to warn about the lack of virtual destructor in accessible
3353 non-polymorphic bases classes too.
3355 When selecting this option, be aware that the standard library
3356 headers do not obey all of these guidelines; use @samp{grep -v}
3357 to filter out those warnings.
3359 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
3360 @opindex Wstrict-null-sentinel
3361 @opindex Wno-strict-null-sentinel
3362 Warn about the use of an uncasted @code{NULL} as sentinel.  When
3363 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
3364 to @code{__null}.  Although it is a null pointer constant rather than a
3365 null pointer, it is guaranteed to be of the same size as a pointer.
3366 But this use is not portable across different compilers.
3368 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
3369 @opindex Wno-non-template-friend
3370 @opindex Wnon-template-friend
3371 Disable warnings when non-template friend functions are declared
3372 within a template.  In very old versions of GCC that predate implementation
3373 of the ISO standard, declarations such as 
3374 @samp{friend int foo(int)}, where the name of the friend is an unqualified-id,
3375 could be interpreted as a particular specialization of a template
3376 function; the warning exists to diagnose compatibility problems, 
3377 and is enabled by default.
3379 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
3380 @opindex Wold-style-cast
3381 @opindex Wno-old-style-cast
3382 Warn if an old-style (C-style) cast to a non-void type is used within
3383 a C++ program.  The new-style casts (@code{dynamic_cast},
3384 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
3385 less vulnerable to unintended effects and much easier to search for.
3387 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
3388 @opindex Woverloaded-virtual
3389 @opindex Wno-overloaded-virtual
3390 @cindex overloaded virtual function, warning
3391 @cindex warning for overloaded virtual function
3392 Warn when a function declaration hides virtual functions from a
3393 base class.  For example, in:
3395 @smallexample
3396 struct A @{
3397   virtual void f();
3400 struct B: public A @{
3401   void f(int);
3403 @end smallexample
3405 the @code{A} class version of @code{f} is hidden in @code{B}, and code
3406 like:
3408 @smallexample
3409 B* b;
3410 b->f();
3411 @end smallexample
3413 @noindent
3414 fails to compile.
3416 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
3417 @opindex Wno-pmf-conversions
3418 @opindex Wpmf-conversions
3419 Disable the diagnostic for converting a bound pointer to member function
3420 to a plain pointer.
3422 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
3423 @opindex Wsign-promo
3424 @opindex Wno-sign-promo
3425 Warn when overload resolution chooses a promotion from unsigned or
3426 enumerated type to a signed type, over a conversion to an unsigned type of
3427 the same size.  Previous versions of G++ tried to preserve
3428 unsignedness, but the standard mandates the current behavior.
3430 @item -Wtemplates @r{(C++ and Objective-C++ only)}
3431 @opindex Wtemplates
3432 @opindex Wno-templates
3433 Warn when a primary template declaration is encountered.  Some coding
3434 rules disallow templates, and this may be used to enforce that rule.
3435 The warning is inactive inside a system header file, such as the STL, so
3436 one can still use the STL.  One may also instantiate or specialize
3437 templates.
3439 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
3440 @opindex Wmultiple-inheritance
3441 @opindex Wno-multiple-inheritance
3442 Warn when a class is defined with multiple direct base classes.  Some
3443 coding rules disallow multiple inheritance, and this may be used to
3444 enforce that rule.  The warning is inactive inside a system header file,
3445 such as the STL, so one can still use the STL.  One may also define
3446 classes that indirectly use multiple inheritance.
3448 @item -Wvirtual-inheritance
3449 @opindex Wvirtual-inheritance
3450 @opindex Wno-virtual-inheritance
3451 Warn when a class is defined with a virtual direct base class.  Some
3452 coding rules disallow multiple inheritance, and this may be used to
3453 enforce that rule.  The warning is inactive inside a system header file,
3454 such as the STL, so one can still use the STL.  One may also define
3455 classes that indirectly use virtual inheritance.
3457 @item -Wnamespaces
3458 @opindex Wnamespaces
3459 @opindex Wno-namespaces
3460 Warn when a namespace definition is opened.  Some coding rules disallow
3461 namespaces, and this may be used to enforce that rule.  The warning is
3462 inactive inside a system header file, such as the STL, so one can still
3463 use the STL.  One may also use using directives and qualified names.
3465 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
3466 @opindex Wterminate
3467 @opindex Wno-terminate
3468 Disable the warning about a throw-expression that will immediately
3469 result in a call to @code{terminate}.
3471 @item -Wno-class-conversion @r{(C++ and Objective-C++ only)}
3472 @opindex Wno-class-conversion
3473 @opindex Wclass-conversion
3474 Disable the warning about the case when a conversion function converts an
3475 object to the same type, to a base class of that type, or to void; such
3476 a conversion function will never be called.
3477 @end table
3479 @node Objective-C and Objective-C++ Dialect Options
3480 @section Options Controlling Objective-C and Objective-C++ Dialects
3482 @cindex compiler options, Objective-C and Objective-C++
3483 @cindex Objective-C and Objective-C++ options, command-line
3484 @cindex options, Objective-C and Objective-C++
3485 (NOTE: This manual does not describe the Objective-C and Objective-C++
3486 languages themselves.  @xref{Standards,,Language Standards
3487 Supported by GCC}, for references.)
3489 This section describes the command-line options that are only meaningful
3490 for Objective-C and Objective-C++ programs.  You can also use most of
3491 the language-independent GNU compiler options.
3492 For example, you might compile a file @file{some_class.m} like this:
3494 @smallexample
3495 gcc -g -fgnu-runtime -O -c some_class.m
3496 @end smallexample
3498 @noindent
3499 In this example, @option{-fgnu-runtime} is an option meant only for
3500 Objective-C and Objective-C++ programs; you can use the other options with
3501 any language supported by GCC@.
3503 Note that since Objective-C is an extension of the C language, Objective-C
3504 compilations may also use options specific to the C front-end (e.g.,
3505 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
3506 C++-specific options (e.g., @option{-Wabi}).
3508 Here is a list of options that are @emph{only} for compiling Objective-C
3509 and Objective-C++ programs:
3511 @table @gcctabopt
3512 @item -fconstant-string-class=@var{class-name}
3513 @opindex fconstant-string-class
3514 Use @var{class-name} as the name of the class to instantiate for each
3515 literal string specified with the syntax @code{@@"@dots{}"}.  The default
3516 class name is @code{NXConstantString} if the GNU runtime is being used, and
3517 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
3518 @option{-fconstant-cfstrings} option, if also present, overrides the
3519 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
3520 to be laid out as constant CoreFoundation strings.
3522 @item -fgnu-runtime
3523 @opindex fgnu-runtime
3524 Generate object code compatible with the standard GNU Objective-C
3525 runtime.  This is the default for most types of systems.
3527 @item -fnext-runtime
3528 @opindex fnext-runtime
3529 Generate output compatible with the NeXT runtime.  This is the default
3530 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
3531 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
3532 used.
3534 @item -fno-nil-receivers
3535 @opindex fno-nil-receivers
3536 @opindex fnil-receivers
3537 Assume that all Objective-C message dispatches (@code{[receiver
3538 message:arg]}) in this translation unit ensure that the receiver is
3539 not @code{nil}.  This allows for more efficient entry points in the
3540 runtime to be used.  This option is only available in conjunction with
3541 the NeXT runtime and ABI version 0 or 1.
3543 @item -fobjc-abi-version=@var{n}
3544 @opindex fobjc-abi-version
3545 Use version @var{n} of the Objective-C ABI for the selected runtime.
3546 This option is currently supported only for the NeXT runtime.  In that
3547 case, Version 0 is the traditional (32-bit) ABI without support for
3548 properties and other Objective-C 2.0 additions.  Version 1 is the
3549 traditional (32-bit) ABI with support for properties and other
3550 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
3551 nothing is specified, the default is Version 0 on 32-bit target
3552 machines, and Version 2 on 64-bit target machines.
3554 @item -fobjc-call-cxx-cdtors
3555 @opindex fobjc-call-cxx-cdtors
3556 For each Objective-C class, check if any of its instance variables is a
3557 C++ object with a non-trivial default constructor.  If so, synthesize a
3558 special @code{- (id) .cxx_construct} instance method which runs
3559 non-trivial default constructors on any such instance variables, in order,
3560 and then return @code{self}.  Similarly, check if any instance variable
3561 is a C++ object with a non-trivial destructor, and if so, synthesize a
3562 special @code{- (void) .cxx_destruct} method which runs
3563 all such default destructors, in reverse order.
3565 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
3566 methods thusly generated only operate on instance variables
3567 declared in the current Objective-C class, and not those inherited
3568 from superclasses.  It is the responsibility of the Objective-C
3569 runtime to invoke all such methods in an object's inheritance
3570 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
3571 by the runtime immediately after a new object instance is allocated;
3572 the @code{- (void) .cxx_destruct} methods are invoked immediately
3573 before the runtime deallocates an object instance.
3575 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3576 support for invoking the @code{- (id) .cxx_construct} and
3577 @code{- (void) .cxx_destruct} methods.
3579 @item -fobjc-direct-dispatch
3580 @opindex fobjc-direct-dispatch
3581 Allow fast jumps to the message dispatcher.  On Darwin this is
3582 accomplished via the comm page.
3584 @item -fobjc-exceptions
3585 @opindex fobjc-exceptions
3586 Enable syntactic support for structured exception handling in
3587 Objective-C, similar to what is offered by C++.  This option
3588 is required to use the Objective-C keywords @code{@@try},
3589 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3590 @code{@@synchronized}.  This option is available with both the GNU
3591 runtime and the NeXT runtime (but not available in conjunction with
3592 the NeXT runtime on Mac OS X 10.2 and earlier).
3594 @item -fobjc-gc
3595 @opindex fobjc-gc
3596 Enable garbage collection (GC) in Objective-C and Objective-C++
3597 programs.  This option is only available with the NeXT runtime; the
3598 GNU runtime has a different garbage collection implementation that
3599 does not require special compiler flags.
3601 @item -fobjc-nilcheck
3602 @opindex fobjc-nilcheck
3603 For the NeXT runtime with version 2 of the ABI, check for a nil
3604 receiver in method invocations before doing the actual method call.
3605 This is the default and can be disabled using
3606 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3607 checked for nil in this way no matter what this flag is set to.
3608 Currently this flag does nothing when the GNU runtime, or an older
3609 version of the NeXT runtime ABI, is used.
3611 @item -fobjc-std=objc1
3612 @opindex fobjc-std
3613 Conform to the language syntax of Objective-C 1.0, the language
3614 recognized by GCC 4.0.  This only affects the Objective-C additions to
3615 the C/C++ language; it does not affect conformance to C/C++ standards,
3616 which is controlled by the separate C/C++ dialect option flags.  When
3617 this option is used with the Objective-C or Objective-C++ compiler,
3618 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3619 This is useful if you need to make sure that your Objective-C code can
3620 be compiled with older versions of GCC@.
3622 @item -freplace-objc-classes
3623 @opindex freplace-objc-classes
3624 Emit a special marker instructing @command{ld(1)} not to statically link in
3625 the resulting object file, and allow @command{dyld(1)} to load it in at
3626 run time instead.  This is used in conjunction with the Fix-and-Continue
3627 debugging mode, where the object file in question may be recompiled and
3628 dynamically reloaded in the course of program execution, without the need
3629 to restart the program itself.  Currently, Fix-and-Continue functionality
3630 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3631 and later.
3633 @item -fzero-link
3634 @opindex fzero-link
3635 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3636 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3637 compile time) with static class references that get initialized at load time,
3638 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3639 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3640 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3641 for individual class implementations to be modified during program execution.
3642 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3643 regardless of command-line options.
3645 @item -fno-local-ivars
3646 @opindex fno-local-ivars
3647 @opindex flocal-ivars
3648 By default instance variables in Objective-C can be accessed as if
3649 they were local variables from within the methods of the class they're
3650 declared in.  This can lead to shadowing between instance variables
3651 and other variables declared either locally inside a class method or
3652 globally with the same name.  Specifying the @option{-fno-local-ivars}
3653 flag disables this behavior thus avoiding variable shadowing issues.
3655 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3656 @opindex fivar-visibility
3657 Set the default instance variable visibility to the specified option
3658 so that instance variables declared outside the scope of any access
3659 modifier directives default to the specified visibility.
3661 @item -gen-decls
3662 @opindex gen-decls
3663 Dump interface declarations for all classes seen in the source file to a
3664 file named @file{@var{sourcename}.decl}.
3666 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3667 @opindex Wassign-intercept
3668 @opindex Wno-assign-intercept
3669 Warn whenever an Objective-C assignment is being intercepted by the
3670 garbage collector.
3672 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3673 @opindex Wno-protocol
3674 @opindex Wprotocol
3675 If a class is declared to implement a protocol, a warning is issued for
3676 every method in the protocol that is not implemented by the class.  The
3677 default behavior is to issue a warning for every method not explicitly
3678 implemented in the class, even if a method implementation is inherited
3679 from the superclass.  If you use the @option{-Wno-protocol} option, then
3680 methods inherited from the superclass are considered to be implemented,
3681 and no warning is issued for them.
3683 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3684 @opindex Wselector
3685 @opindex Wno-selector
3686 Warn if multiple methods of different types for the same selector are
3687 found during compilation.  The check is performed on the list of methods
3688 in the final stage of compilation.  Additionally, a check is performed
3689 for each selector appearing in a @code{@@selector(@dots{})}
3690 expression, and a corresponding method for that selector has been found
3691 during compilation.  Because these checks scan the method table only at
3692 the end of compilation, these warnings are not produced if the final
3693 stage of compilation is not reached, for example because an error is
3694 found during compilation, or because the @option{-fsyntax-only} option is
3695 being used.
3697 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3698 @opindex Wstrict-selector-match
3699 @opindex Wno-strict-selector-match
3700 Warn if multiple methods with differing argument and/or return types are
3701 found for a given selector when attempting to send a message using this
3702 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3703 is off (which is the default behavior), the compiler omits such warnings
3704 if any differences found are confined to types that share the same size
3705 and alignment.
3707 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3708 @opindex Wundeclared-selector
3709 @opindex Wno-undeclared-selector
3710 Warn if a @code{@@selector(@dots{})} expression referring to an
3711 undeclared selector is found.  A selector is considered undeclared if no
3712 method with that name has been declared before the
3713 @code{@@selector(@dots{})} expression, either explicitly in an
3714 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3715 an @code{@@implementation} section.  This option always performs its
3716 checks as soon as a @code{@@selector(@dots{})} expression is found,
3717 while @option{-Wselector} only performs its checks in the final stage of
3718 compilation.  This also enforces the coding style convention
3719 that methods and selectors must be declared before being used.
3721 @item -print-objc-runtime-info
3722 @opindex print-objc-runtime-info
3723 Generate C header describing the largest structure that is passed by
3724 value, if any.
3726 @end table
3728 @node Diagnostic Message Formatting Options
3729 @section Options to Control Diagnostic Messages Formatting
3730 @cindex options to control diagnostics formatting
3731 @cindex diagnostic messages
3732 @cindex message formatting
3734 Traditionally, diagnostic messages have been formatted irrespective of
3735 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3736 options described below
3737 to control the formatting algorithm for diagnostic messages, 
3738 e.g.@: how many characters per line, how often source location
3739 information should be reported.  Note that some language front ends may not
3740 honor these options.
3742 @table @gcctabopt
3743 @item -fmessage-length=@var{n}
3744 @opindex fmessage-length
3745 Try to format error messages so that they fit on lines of about
3746 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3747 done; each error message appears on a single line.  This is the
3748 default for all front ends.
3750 Note - this option also affects the display of the @samp{#error} and
3751 @samp{#warning} pre-processor directives, and the @samp{deprecated}
3752 function/type/variable attribute.  It does not however affect the
3753 @samp{pragma GCC warning} and @samp{pragma GCC error} pragmas.
3755 @item -fdiagnostics-show-location=once
3756 @opindex fdiagnostics-show-location
3757 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3758 reporter to emit source location information @emph{once}; that is, in
3759 case the message is too long to fit on a single physical line and has to
3760 be wrapped, the source location won't be emitted (as prefix) again,
3761 over and over, in subsequent continuation lines.  This is the default
3762 behavior.
3764 @item -fdiagnostics-show-location=every-line
3765 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3766 messages reporter to emit the same source location information (as
3767 prefix) for physical lines that result from the process of breaking
3768 a message which is too long to fit on a single line.
3770 @item -fdiagnostics-color[=@var{WHEN}]
3771 @itemx -fno-diagnostics-color
3772 @opindex fdiagnostics-color
3773 @cindex highlight, color
3774 @vindex GCC_COLORS @r{environment variable}
3775 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3776 or @samp{auto}.  The default depends on how the compiler has been configured,
3777 it can be any of the above @var{WHEN} options or also @samp{never}
3778 if @env{GCC_COLORS} environment variable isn't present in the environment,
3779 and @samp{auto} otherwise.
3780 @samp{auto} means to use color only when the standard error is a terminal.
3781 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3782 aliases for @option{-fdiagnostics-color=always} and
3783 @option{-fdiagnostics-color=never}, respectively.
3785 The colors are defined by the environment variable @env{GCC_COLORS}.
3786 Its value is a colon-separated list of capabilities and Select Graphic
3787 Rendition (SGR) substrings. SGR commands are interpreted by the
3788 terminal or terminal emulator.  (See the section in the documentation
3789 of your text terminal for permitted values and their meanings as
3790 character attributes.)  These substring values are integers in decimal
3791 representation and can be concatenated with semicolons.
3792 Common values to concatenate include
3793 @samp{1} for bold,
3794 @samp{4} for underline,
3795 @samp{5} for blink,
3796 @samp{7} for inverse,
3797 @samp{39} for default foreground color,
3798 @samp{30} to @samp{37} for foreground colors,
3799 @samp{90} to @samp{97} for 16-color mode foreground colors,
3800 @samp{38;5;0} to @samp{38;5;255}
3801 for 88-color and 256-color modes foreground colors,
3802 @samp{49} for default background color,
3803 @samp{40} to @samp{47} for background colors,
3804 @samp{100} to @samp{107} for 16-color mode background colors,
3805 and @samp{48;5;0} to @samp{48;5;255}
3806 for 88-color and 256-color modes background colors.
3808 The default @env{GCC_COLORS} is
3809 @smallexample
3810 error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\
3811 quote=01:fixit-insert=32:fixit-delete=31:\
3812 diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32:\
3813 type-diff=01;32
3814 @end smallexample
3815 @noindent
3816 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3817 @samp{01;36} is bold cyan, @samp{32} is green, @samp{34} is blue,
3818 @samp{01} is bold, and @samp{31} is red.
3819 Setting @env{GCC_COLORS} to the empty string disables colors.
3820 Supported capabilities are as follows.
3822 @table @code
3823 @item error=
3824 @vindex error GCC_COLORS @r{capability}
3825 SGR substring for error: markers.
3827 @item warning=
3828 @vindex warning GCC_COLORS @r{capability}
3829 SGR substring for warning: markers.
3831 @item note=
3832 @vindex note GCC_COLORS @r{capability}
3833 SGR substring for note: markers.
3835 @item range1=
3836 @vindex range1 GCC_COLORS @r{capability}
3837 SGR substring for first additional range.
3839 @item range2=
3840 @vindex range2 GCC_COLORS @r{capability}
3841 SGR substring for second additional range.
3843 @item locus=
3844 @vindex locus GCC_COLORS @r{capability}
3845 SGR substring for location information, @samp{file:line} or
3846 @samp{file:line:column} etc.
3848 @item quote=
3849 @vindex quote GCC_COLORS @r{capability}
3850 SGR substring for information printed within quotes.
3852 @item fixit-insert=
3853 @vindex fixit-insert GCC_COLORS @r{capability}
3854 SGR substring for fix-it hints suggesting text to
3855 be inserted or replaced.
3857 @item fixit-delete=
3858 @vindex fixit-delete GCC_COLORS @r{capability}
3859 SGR substring for fix-it hints suggesting text to
3860 be deleted.
3862 @item diff-filename=
3863 @vindex diff-filename GCC_COLORS @r{capability}
3864 SGR substring for filename headers within generated patches.
3866 @item diff-hunk=
3867 @vindex diff-hunk GCC_COLORS @r{capability}
3868 SGR substring for the starts of hunks within generated patches.
3870 @item diff-delete=
3871 @vindex diff-delete GCC_COLORS @r{capability}
3872 SGR substring for deleted lines within generated patches.
3874 @item diff-insert=
3875 @vindex diff-insert GCC_COLORS @r{capability}
3876 SGR substring for inserted lines within generated patches.
3878 @item type-diff=
3879 @vindex type-diff GCC_COLORS @r{capability}
3880 SGR substring for highlighting mismatching types within template
3881 arguments in the C++ frontend.
3882 @end table
3884 @item -fno-diagnostics-show-option
3885 @opindex fno-diagnostics-show-option
3886 @opindex fdiagnostics-show-option
3887 By default, each diagnostic emitted includes text indicating the
3888 command-line option that directly controls the diagnostic (if such an
3889 option is known to the diagnostic machinery).  Specifying the
3890 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3892 @item -fno-diagnostics-show-caret
3893 @opindex fno-diagnostics-show-caret
3894 @opindex fdiagnostics-show-caret
3895 By default, each diagnostic emitted includes the original source line
3896 and a caret @samp{^} indicating the column.  This option suppresses this
3897 information.  The source line is truncated to @var{n} characters, if
3898 the @option{-fmessage-length=n} option is given.  When the output is done
3899 to the terminal, the width is limited to the width given by the
3900 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3902 @item -fno-diagnostics-show-labels
3903 @opindex fno-diagnostics-show-labels
3904 @opindex fdiagnostics-show-labels
3905 By default, when printing source code (via @option{-fdiagnostics-show-caret}),
3906 diagnostics can label ranges of source code with pertinent information, such
3907 as the types of expressions:
3909 @smallexample
3910     printf ("foo %s bar", long_i + long_j);
3911                  ~^       ~~~~~~~~~~~~~~~
3912                   |              |
3913                   char *         long int
3914 @end smallexample
3916 This option suppresses the printing of these labels (in the example above,
3917 the vertical bars and the ``char *'' and ``long int'' text).
3919 @item -fno-diagnostics-show-line-numbers
3920 @opindex fno-diagnostics-show-line-numbers
3921 @opindex fdiagnostics-show-line-numbers
3922 By default, when printing source code (via @option{-fdiagnostics-show-caret}),
3923 a left margin is printed, showing line numbers.  This option suppresses this
3924 left margin.
3926 @item -fdiagnostics-minimum-margin-width=@var{width}
3927 @opindex fdiagnostics-minimum-margin-width
3928 This option controls the minimum width of the left margin printed by
3929 @option{-fdiagnostics-show-line-numbers}.  It defaults to 6.
3931 @item -fdiagnostics-parseable-fixits
3932 @opindex fdiagnostics-parseable-fixits
3933 Emit fix-it hints in a machine-parseable format, suitable for consumption
3934 by IDEs.  For each fix-it, a line will be printed after the relevant
3935 diagnostic, starting with the string ``fix-it:''.  For example:
3937 @smallexample
3938 fix-it:"test.c":@{45:3-45:21@}:"gtk_widget_show_all"
3939 @end smallexample
3941 The location is expressed as a half-open range, expressed as a count of
3942 bytes, starting at byte 1 for the initial column.  In the above example,
3943 bytes 3 through 20 of line 45 of ``test.c'' are to be replaced with the
3944 given string:
3946 @smallexample
3947 00000000011111111112222222222
3948 12345678901234567890123456789
3949   gtk_widget_showall (dlg);
3950   ^^^^^^^^^^^^^^^^^^
3951   gtk_widget_show_all
3952 @end smallexample
3954 The filename and replacement string escape backslash as ``\\", tab as ``\t'',
3955 newline as ``\n'', double quotes as ``\"'', non-printable characters as octal
3956 (e.g. vertical tab as ``\013'').
3958 An empty replacement string indicates that the given range is to be removed.
3959 An empty range (e.g. ``45:3-45:3'') indicates that the string is to
3960 be inserted at the given position.
3962 @item -fdiagnostics-generate-patch
3963 @opindex fdiagnostics-generate-patch
3964 Print fix-it hints to stderr in unified diff format, after any diagnostics
3965 are printed.  For example:
3967 @smallexample
3968 --- test.c
3969 +++ test.c
3970 @@ -42,5 +42,5 @@
3972  void show_cb(GtkDialog *dlg)
3973  @{
3974 -  gtk_widget_showall(dlg);
3975 +  gtk_widget_show_all(dlg);
3976  @}
3978 @end smallexample
3980 The diff may or may not be colorized, following the same rules
3981 as for diagnostics (see @option{-fdiagnostics-color}).
3983 @item -fdiagnostics-show-template-tree
3984 @opindex fdiagnostics-show-template-tree
3986 In the C++ frontend, when printing diagnostics showing mismatching
3987 template types, such as:
3989 @smallexample
3990   could not convert 'std::map<int, std::vector<double> >()'
3991     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
3992 @end smallexample
3994 the @option{-fdiagnostics-show-template-tree} flag enables printing a
3995 tree-like structure showing the common and differing parts of the types,
3996 such as:
3998 @smallexample
3999   map<
4000     [...],
4001     vector<
4002       [double != float]>>
4003 @end smallexample
4005 The parts that differ are highlighted with color (``double'' and
4006 ``float'' in this case).
4008 @item -fno-elide-type
4009 @opindex fno-elide-type
4010 @opindex felide-type
4011 By default when the C++ frontend prints diagnostics showing mismatching
4012 template types, common parts of the types are printed as ``[...]'' to
4013 simplify the error message.  For example:
4015 @smallexample
4016   could not convert 'std::map<int, std::vector<double> >()'
4017     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
4018 @end smallexample
4020 Specifying the @option{-fno-elide-type} flag suppresses that behavior.
4021 This flag also affects the output of the
4022 @option{-fdiagnostics-show-template-tree} flag.
4024 @item -fno-show-column
4025 @opindex fno-show-column
4026 @opindex fshow-column
4027 Do not print column numbers in diagnostics.  This may be necessary if
4028 diagnostics are being scanned by a program that does not understand the
4029 column numbers, such as @command{dejagnu}.
4031 @item -fdiagnostics-format=@var{FORMAT}
4032 @opindex fdiagnostics-format
4033 Select a different format for printing diagnostics.
4034 @var{FORMAT} is @samp{text} or @samp{json}.
4035 The default is @samp{text}.
4037 The @samp{json} format consists of a top-level JSON array containing JSON
4038 objects representing the diagnostics.
4040 The JSON is emitted as one line, without formatting; the examples below
4041 have been formatted for clarity.
4043 Diagnostics can have child diagnostics.  For example, this error and note:
4045 @smallexample
4046 misleading-indentation.c:15:3: warning: this 'if' clause does not
4047   guard... [-Wmisleading-indentation]
4048    15 |   if (flag)
4049       |   ^~
4050 misleading-indentation.c:17:5: note: ...this statement, but the latter
4051   is misleadingly indented as if it were guarded by the 'if'
4052    17 |     y = 2;
4053       |     ^
4054 @end smallexample
4056 @noindent
4057 might be printed in JSON form (after formatting) like this:
4059 @smallexample
4061     @{
4062         "kind": "warning",
4063         "locations": [
4064             @{
4065                 "caret": @{
4066                     "column": 3,
4067                     "file": "misleading-indentation.c",
4068                     "line": 15
4069                 @},
4070                 "finish": @{
4071                     "column": 4,
4072                     "file": "misleading-indentation.c",
4073                     "line": 15
4074                 @}
4075             @}
4076         ],
4077         "message": "this \u2018if\u2019 clause does not guard...",
4078         "option": "-Wmisleading-indentation",
4079         "children": [
4080             @{
4081                 "kind": "note",
4082                 "locations": [
4083                     @{
4084                         "caret": @{
4085                             "column": 5,
4086                             "file": "misleading-indentation.c",
4087                             "line": 17
4088                         @}
4089                     @}
4090                 ],
4091                 "message": "...this statement, but the latter is @dots{}"
4092             @}
4093         ]
4094     @},
4095     @dots{}
4097 @end smallexample
4099 @noindent
4100 where the @code{note} is a child of the @code{warning}.
4102 A diagnostic has a @code{kind}.  If this is @code{warning}, then there is
4103 an @code{option} key describing the command-line option controlling the
4104 warning.
4106 A diagnostic can contain zero or more locations.  Each location has up
4107 to three positions within it: a @code{caret} position and optional
4108 @code{start} and @code{finish} positions.  A location can also have
4109 an optional @code{label} string.  For example, this error:
4111 @smallexample
4112 bad-binary-ops.c:64:23: error: invalid operands to binary + (have 'S' @{aka
4113    'struct s'@} and 'T' @{aka 'struct t'@})
4114    64 |   return callee_4a () + callee_4b ();
4115       |          ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
4116       |          |              |
4117       |          |              T @{aka struct t@}
4118       |          S @{aka struct s@}
4119 @end smallexample
4121 @noindent
4122 has three locations.  Its primary location is at the ``+'' token at column
4123 23.  It has two secondary locations, describing the left and right-hand sides
4124 of the expression, which have labels.  It might be printed in JSON form as:
4126 @smallexample
4127     @{
4128         "children": [],
4129         "kind": "error",
4130         "locations": [
4131             @{
4132                 "caret": @{
4133                     "column": 23, "file": "bad-binary-ops.c", "line": 64
4134                 @}
4135             @},
4136             @{
4137                 "caret": @{
4138                     "column": 10, "file": "bad-binary-ops.c", "line": 64
4139                 @},
4140                 "finish": @{
4141                     "column": 21, "file": "bad-binary-ops.c", "line": 64
4142                 @},
4143                 "label": "S @{aka struct s@}"
4144             @},
4145             @{
4146                 "caret": @{
4147                     "column": 25, "file": "bad-binary-ops.c", "line": 64
4148                 @},
4149                 "finish": @{
4150                     "column": 36, "file": "bad-binary-ops.c", "line": 64
4151                 @},
4152                 "label": "T @{aka struct t@}"
4153             @}
4154         ],
4155         "message": "invalid operands to binary + @dots{}"
4156     @}
4157 @end smallexample
4159 If a diagnostic contains fix-it hints, it has a @code{fixits} array,
4160 consisting of half-open intervals, similar to the output of
4161 @option{-fdiagnostics-parseable-fixits}.  For example, this diagnostic
4162 with a replacement fix-it hint:
4164 @smallexample
4165 demo.c:8:15: error: 'struct s' has no member named 'colour'; did you
4166   mean 'color'?
4167     8 |   return ptr->colour;
4168       |               ^~~~~~
4169       |               color
4170 @end smallexample
4172 @noindent
4173 might be printed in JSON form as:
4175 @smallexample
4176     @{
4177         "children": [],
4178         "fixits": [
4179             @{
4180                 "next": @{
4181                     "column": 21,
4182                     "file": "demo.c",
4183                     "line": 8
4184                 @},
4185                 "start": @{
4186                     "column": 15,
4187                     "file": "demo.c",
4188                     "line": 8
4189                 @},
4190                 "string": "color"
4191             @}
4192         ],
4193         "kind": "error",
4194         "locations": [
4195             @{
4196                 "caret": @{
4197                     "column": 15,
4198                     "file": "demo.c",
4199                     "line": 8
4200                 @},
4201                 "finish": @{
4202                     "column": 20,
4203                     "file": "demo.c",
4204                     "line": 8
4205                 @}
4206             @}
4207         ],
4208         "message": "\u2018struct s\u2019 has no member named @dots{}"
4209     @}
4210 @end smallexample
4212 @noindent
4213 where the fix-it hint suggests replacing the text from @code{start} up
4214 to but not including @code{next} with @code{string}'s value.  Deletions
4215 are expressed via an empty value for @code{string}, insertions by
4216 having @code{start} equal @code{next}.
4218 @end table
4220 @node Warning Options
4221 @section Options to Request or Suppress Warnings
4222 @cindex options to control warnings
4223 @cindex warning messages
4224 @cindex messages, warning
4225 @cindex suppressing warnings
4227 Warnings are diagnostic messages that report constructions that
4228 are not inherently erroneous but that are risky or suggest there
4229 may have been an error.
4231 The following language-independent options do not enable specific
4232 warnings but control the kinds of diagnostics produced by GCC@.
4234 @table @gcctabopt
4235 @cindex syntax checking
4236 @item -fsyntax-only
4237 @opindex fsyntax-only
4238 Check the code for syntax errors, but don't do anything beyond that.
4240 @item -fmax-errors=@var{n}
4241 @opindex fmax-errors
4242 Limits the maximum number of error messages to @var{n}, at which point
4243 GCC bails out rather than attempting to continue processing the source
4244 code.  If @var{n} is 0 (the default), there is no limit on the number
4245 of error messages produced.  If @option{-Wfatal-errors} is also
4246 specified, then @option{-Wfatal-errors} takes precedence over this
4247 option.
4249 @item -w
4250 @opindex w
4251 Inhibit all warning messages.
4253 @item -Werror
4254 @opindex Werror
4255 @opindex Wno-error
4256 Make all warnings into errors.
4258 @item -Werror=
4259 @opindex Werror=
4260 @opindex Wno-error=
4261 Make the specified warning into an error.  The specifier for a warning
4262 is appended; for example @option{-Werror=switch} turns the warnings
4263 controlled by @option{-Wswitch} into errors.  This switch takes a
4264 negative form, to be used to negate @option{-Werror} for specific
4265 warnings; for example @option{-Wno-error=switch} makes
4266 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
4267 is in effect.
4269 The warning message for each controllable warning includes the
4270 option that controls the warning.  That option can then be used with
4271 @option{-Werror=} and @option{-Wno-error=} as described above.
4272 (Printing of the option in the warning message can be disabled using the
4273 @option{-fno-diagnostics-show-option} flag.)
4275 Note that specifying @option{-Werror=}@var{foo} automatically implies
4276 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
4277 imply anything.
4279 @item -Wfatal-errors
4280 @opindex Wfatal-errors
4281 @opindex Wno-fatal-errors
4282 This option causes the compiler to abort compilation on the first error
4283 occurred rather than trying to keep going and printing further error
4284 messages.
4286 @end table
4288 You can request many specific warnings with options beginning with
4289 @samp{-W}, for example @option{-Wimplicit} to request warnings on
4290 implicit declarations.  Each of these specific warning options also
4291 has a negative form beginning @samp{-Wno-} to turn off warnings; for
4292 example, @option{-Wno-implicit}.  This manual lists only one of the
4293 two forms, whichever is not the default.  For further
4294 language-specific options also refer to @ref{C++ Dialect Options} and
4295 @ref{Objective-C and Objective-C++ Dialect Options}.
4297 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
4298 options, such as @option{-Wunused}, which may turn on further options,
4299 such as @option{-Wunused-value}. The combined effect of positive and
4300 negative forms is that more specific options have priority over less
4301 specific ones, independently of their position in the command-line. For
4302 options of the same specificity, the last one takes effect. Options
4303 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
4304 as if they appeared at the end of the command-line.
4306 When an unrecognized warning option is requested (e.g.,
4307 @option{-Wunknown-warning}), GCC emits a diagnostic stating
4308 that the option is not recognized.  However, if the @option{-Wno-} form
4309 is used, the behavior is slightly different: no diagnostic is
4310 produced for @option{-Wno-unknown-warning} unless other diagnostics
4311 are being produced.  This allows the use of new @option{-Wno-} options
4312 with old compilers, but if something goes wrong, the compiler
4313 warns that an unrecognized option is present.
4315 @table @gcctabopt
4316 @item -Wpedantic
4317 @itemx -pedantic
4318 @opindex pedantic
4319 @opindex Wpedantic
4320 @opindex Wno-pedantic
4321 Issue all the warnings demanded by strict ISO C and ISO C++;
4322 reject all programs that use forbidden extensions, and some other
4323 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
4324 version of the ISO C standard specified by any @option{-std} option used.
4326 Valid ISO C and ISO C++ programs should compile properly with or without
4327 this option (though a rare few require @option{-ansi} or a
4328 @option{-std} option specifying the required version of ISO C)@.  However,
4329 without this option, certain GNU extensions and traditional C and C++
4330 features are supported as well.  With this option, they are rejected.
4332 @option{-Wpedantic} does not cause warning messages for use of the
4333 alternate keywords whose names begin and end with @samp{__}.  Pedantic
4334 warnings are also disabled in the expression that follows
4335 @code{__extension__}.  However, only system header files should use
4336 these escape routes; application programs should avoid them.
4337 @xref{Alternate Keywords}.
4339 Some users try to use @option{-Wpedantic} to check programs for strict ISO
4340 C conformance.  They soon find that it does not do quite what they want:
4341 it finds some non-ISO practices, but not all---only those for which
4342 ISO C @emph{requires} a diagnostic, and some others for which
4343 diagnostics have been added.
4345 A feature to report any failure to conform to ISO C might be useful in
4346 some instances, but would require considerable additional work and would
4347 be quite different from @option{-Wpedantic}.  We don't have plans to
4348 support such a feature in the near future.
4350 Where the standard specified with @option{-std} represents a GNU
4351 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
4352 corresponding @dfn{base standard}, the version of ISO C on which the GNU
4353 extended dialect is based.  Warnings from @option{-Wpedantic} are given
4354 where they are required by the base standard.  (It does not make sense
4355 for such warnings to be given only for features not in the specified GNU
4356 C dialect, since by definition the GNU dialects of C include all
4357 features the compiler supports with the given option, and there would be
4358 nothing to warn about.)
4360 @item -pedantic-errors
4361 @opindex pedantic-errors
4362 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
4363 requires a diagnostic, in some cases where there is undefined behavior
4364 at compile-time and in some other cases that do not prevent compilation
4365 of programs that are valid according to the standard. This is not
4366 equivalent to @option{-Werror=pedantic}, since there are errors enabled
4367 by this option and not enabled by the latter and vice versa.
4369 @item -Wall
4370 @opindex Wall
4371 @opindex Wno-all
4372 This enables all the warnings about constructions that some users
4373 consider questionable, and that are easy to avoid (or modify to
4374 prevent the warning), even in conjunction with macros.  This also
4375 enables some language-specific warnings described in @ref{C++ Dialect
4376 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
4378 @option{-Wall} turns on the following warning flags:
4380 @gccoptlist{-Waddress   @gol
4381 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
4382 -Wbool-compare  @gol
4383 -Wbool-operation  @gol
4384 -Wc++11-compat  -Wc++14-compat  @gol
4385 -Wcatch-value @r{(C++ and Objective-C++ only)}  @gol
4386 -Wchar-subscripts  @gol
4387 -Wcomment  @gol
4388 -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
4389 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
4390 -Wformat   @gol
4391 -Wint-in-bool-context  @gol
4392 -Wimplicit @r{(C and Objective-C only)} @gol
4393 -Wimplicit-int @r{(C and Objective-C only)} @gol
4394 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
4395 -Winit-self @r{(only for C++)} @gol
4396 -Wlogical-not-parentheses @gol
4397 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
4398 -Wmaybe-uninitialized @gol
4399 -Wmemset-elt-size @gol
4400 -Wmemset-transposed-args @gol
4401 -Wmisleading-indentation @r{(only for C/C++)} @gol
4402 -Wmissing-attributes @gol
4403 -Wmissing-braces @r{(only for C/ObjC)} @gol
4404 -Wmultistatement-macros  @gol
4405 -Wnarrowing @r{(only for C++)}  @gol
4406 -Wnonnull  @gol
4407 -Wnonnull-compare  @gol
4408 -Wopenmp-simd @gol
4409 -Wparentheses  @gol
4410 -Wpessimizing-move @r{(only for C++)}  @gol
4411 -Wpointer-sign  @gol
4412 -Wreorder   @gol
4413 -Wrestrict   @gol
4414 -Wreturn-type  @gol
4415 -Wsequence-point  @gol
4416 -Wsign-compare @r{(only in C++)}  @gol
4417 -Wsizeof-pointer-div @gol
4418 -Wsizeof-pointer-memaccess @gol
4419 -Wstrict-aliasing  @gol
4420 -Wstrict-overflow=1  @gol
4421 -Wswitch  @gol
4422 -Wtautological-compare  @gol
4423 -Wtrigraphs  @gol
4424 -Wuninitialized  @gol
4425 -Wunknown-pragmas  @gol
4426 -Wunused-function  @gol
4427 -Wunused-label     @gol
4428 -Wunused-value     @gol
4429 -Wunused-variable  @gol
4430 -Wvolatile-register-var}
4432 Note that some warning flags are not implied by @option{-Wall}.  Some of
4433 them warn about constructions that users generally do not consider
4434 questionable, but which occasionally you might wish to check for;
4435 others warn about constructions that are necessary or hard to avoid in
4436 some cases, and there is no simple way to modify the code to suppress
4437 the warning. Some of them are enabled by @option{-Wextra} but many of
4438 them must be enabled individually.
4440 @item -Wextra
4441 @opindex W
4442 @opindex Wextra
4443 @opindex Wno-extra
4444 This enables some extra warning flags that are not enabled by
4445 @option{-Wall}. (This option used to be called @option{-W}.  The older
4446 name is still supported, but the newer name is more descriptive.)
4448 @gccoptlist{-Wclobbered  @gol
4449 -Wcast-function-type  @gol
4450 -Wdeprecated-copy @r{(C++ only)} @gol
4451 -Wempty-body  @gol
4452 -Wignored-qualifiers @gol
4453 -Wimplicit-fallthrough=3 @gol
4454 -Wmissing-field-initializers  @gol
4455 -Wmissing-parameter-type @r{(C only)}  @gol
4456 -Wold-style-declaration @r{(C only)}  @gol
4457 -Woverride-init  @gol
4458 -Wsign-compare @r{(C only)} @gol
4459 -Wredundant-move @r{(only for C++)}  @gol
4460 -Wtype-limits  @gol
4461 -Wuninitialized  @gol
4462 -Wshift-negative-value @r{(in C++03 and in C99 and newer)}  @gol
4463 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
4464 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}}
4467 The option @option{-Wextra} also prints warning messages for the
4468 following cases:
4470 @itemize @bullet
4472 @item
4473 A pointer is compared against integer zero with @code{<}, @code{<=},
4474 @code{>}, or @code{>=}.
4476 @item
4477 (C++ only) An enumerator and a non-enumerator both appear in a
4478 conditional expression.
4480 @item
4481 (C++ only) Ambiguous virtual bases.
4483 @item
4484 (C++ only) Subscripting an array that has been declared @code{register}.
4486 @item
4487 (C++ only) Taking the address of a variable that has been declared
4488 @code{register}.
4490 @item
4491 (C++ only) A base class is not initialized in the copy constructor
4492 of a derived class.
4494 @end itemize
4496 @item -Wchar-subscripts
4497 @opindex Wchar-subscripts
4498 @opindex Wno-char-subscripts
4499 Warn if an array subscript has type @code{char}.  This is a common cause
4500 of error, as programmers often forget that this type is signed on some
4501 machines.
4502 This warning is enabled by @option{-Wall}.
4504 @item -Wno-coverage-mismatch
4505 @opindex Wno-coverage-mismatch
4506 @opindex Wcoverage-mismatch
4507 Warn if feedback profiles do not match when using the
4508 @option{-fprofile-use} option.
4509 If a source file is changed between compiling with @option{-fprofile-generate}
4510 and with @option{-fprofile-use}, the files with the profile feedback can fail
4511 to match the source file and GCC cannot use the profile feedback
4512 information.  By default, this warning is enabled and is treated as an
4513 error.  @option{-Wno-coverage-mismatch} can be used to disable the
4514 warning or @option{-Wno-error=coverage-mismatch} can be used to
4515 disable the error.  Disabling the error for this warning can result in
4516 poorly optimized code and is useful only in the
4517 case of very minor changes such as bug fixes to an existing code-base.
4518 Completely disabling the warning is not recommended.
4520 @item -Wno-cpp
4521 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
4523 Suppress warning messages emitted by @code{#warning} directives.
4525 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
4526 @opindex Wdouble-promotion
4527 @opindex Wno-double-promotion
4528 Give a warning when a value of type @code{float} is implicitly
4529 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
4530 floating-point unit implement @code{float} in hardware, but emulate
4531 @code{double} in software.  On such a machine, doing computations
4532 using @code{double} values is much more expensive because of the
4533 overhead required for software emulation.
4535 It is easy to accidentally do computations with @code{double} because
4536 floating-point literals are implicitly of type @code{double}.  For
4537 example, in:
4538 @smallexample
4539 @group
4540 float area(float radius)
4542    return 3.14159 * radius * radius;
4544 @end group
4545 @end smallexample
4546 the compiler performs the entire computation with @code{double}
4547 because the floating-point literal is a @code{double}.
4549 @item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
4550 @opindex Wduplicate-decl-specifier
4551 @opindex Wno-duplicate-decl-specifier
4552 Warn if a declaration has duplicate @code{const}, @code{volatile},
4553 @code{restrict} or @code{_Atomic} specifier.  This warning is enabled by
4554 @option{-Wall}.
4556 @item -Wformat
4557 @itemx -Wformat=@var{n}
4558 @opindex Wformat
4559 @opindex Wno-format
4560 @opindex ffreestanding
4561 @opindex fno-builtin
4562 @opindex Wformat=
4563 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
4564 the arguments supplied have types appropriate to the format string
4565 specified, and that the conversions specified in the format string make
4566 sense.  This includes standard functions, and others specified by format
4567 attributes (@pxref{Function Attributes}), in the @code{printf},
4568 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
4569 not in the C standard) families (or other target-specific families).
4570 Which functions are checked without format attributes having been
4571 specified depends on the standard version selected, and such checks of
4572 functions without the attribute specified are disabled by
4573 @option{-ffreestanding} or @option{-fno-builtin}.
4575 The formats are checked against the format features supported by GNU
4576 libc version 2.2.  These include all ISO C90 and C99 features, as well
4577 as features from the Single Unix Specification and some BSD and GNU
4578 extensions.  Other library implementations may not support all these
4579 features; GCC does not support warning about features that go beyond a
4580 particular library's limitations.  However, if @option{-Wpedantic} is used
4581 with @option{-Wformat}, warnings are given about format features not
4582 in the selected standard version (but not for @code{strfmon} formats,
4583 since those are not in any version of the C standard).  @xref{C Dialect
4584 Options,,Options Controlling C Dialect}.
4586 @table @gcctabopt
4587 @item -Wformat=1
4588 @itemx -Wformat
4589 @opindex Wformat
4590 @opindex Wformat=1
4591 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
4592 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
4593 @option{-Wformat} also checks for null format arguments for several
4594 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
4595 aspects of this level of format checking can be disabled by the
4596 options: @option{-Wno-format-contains-nul},
4597 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
4598 @option{-Wformat} is enabled by @option{-Wall}.
4600 @item -Wno-format-contains-nul
4601 @opindex Wno-format-contains-nul
4602 @opindex Wformat-contains-nul
4603 If @option{-Wformat} is specified, do not warn about format strings that
4604 contain NUL bytes.
4606 @item -Wno-format-extra-args
4607 @opindex Wno-format-extra-args
4608 @opindex Wformat-extra-args
4609 If @option{-Wformat} is specified, do not warn about excess arguments to a
4610 @code{printf} or @code{scanf} format function.  The C standard specifies
4611 that such arguments are ignored.
4613 Where the unused arguments lie between used arguments that are
4614 specified with @samp{$} operand number specifications, normally
4615 warnings are still given, since the implementation could not know what
4616 type to pass to @code{va_arg} to skip the unused arguments.  However,
4617 in the case of @code{scanf} formats, this option suppresses the
4618 warning if the unused arguments are all pointers, since the Single
4619 Unix Specification says that such unused arguments are allowed.
4621 @item -Wformat-overflow
4622 @itemx -Wformat-overflow=@var{level}
4623 @opindex Wformat-overflow
4624 @opindex Wno-format-overflow
4625 Warn about calls to formatted input/output functions such as @code{sprintf}
4626 and @code{vsprintf} that might overflow the destination buffer.  When the
4627 exact number of bytes written by a format directive cannot be determined
4628 at compile-time it is estimated based on heuristics that depend on the
4629 @var{level} argument and on optimization.  While enabling optimization
4630 will in most cases improve the accuracy of the warning, it may also
4631 result in false positives.
4633 @table @gcctabopt
4634 @item -Wformat-overflow
4635 @itemx -Wformat-overflow=1
4636 @opindex Wformat-overflow
4637 @opindex Wno-format-overflow
4638 Level @var{1} of @option{-Wformat-overflow} enabled by @option{-Wformat}
4639 employs a conservative approach that warns only about calls that most
4640 likely overflow the buffer.  At this level, numeric arguments to format
4641 directives with unknown values are assumed to have the value of one, and
4642 strings of unknown length to be empty.  Numeric arguments that are known
4643 to be bounded to a subrange of their type, or string arguments whose output
4644 is bounded either by their directive's precision or by a finite set of
4645 string literals, are assumed to take on the value within the range that
4646 results in the most bytes on output.  For example, the call to @code{sprintf}
4647 below is diagnosed because even with both @var{a} and @var{b} equal to zero,
4648 the terminating NUL character (@code{'\0'}) appended by the function
4649 to the destination buffer will be written past its end.  Increasing
4650 the size of the buffer by a single byte is sufficient to avoid the
4651 warning, though it may not be sufficient to avoid the overflow.
4653 @smallexample
4654 void f (int a, int b)
4656   char buf [13];
4657   sprintf (buf, "a = %i, b = %i\n", a, b);
4659 @end smallexample
4661 @item -Wformat-overflow=2
4662 Level @var{2} warns also about calls that might overflow the destination
4663 buffer given an argument of sufficient length or magnitude.  At level
4664 @var{2}, unknown numeric arguments are assumed to have the minimum
4665 representable value for signed types with a precision greater than 1, and
4666 the maximum representable value otherwise.  Unknown string arguments whose
4667 length cannot be assumed to be bounded either by the directive's precision,
4668 or by a finite set of string literals they may evaluate to, or the character
4669 array they may point to, are assumed to be 1 character long.
4671 At level @var{2}, the call in the example above is again diagnosed, but
4672 this time because with @var{a} equal to a 32-bit @code{INT_MIN} the first
4673 @code{%i} directive will write some of its digits beyond the end of
4674 the destination buffer.  To make the call safe regardless of the values
4675 of the two variables, the size of the destination buffer must be increased
4676 to at least 34 bytes.  GCC includes the minimum size of the buffer in
4677 an informational note following the warning.
4679 An alternative to increasing the size of the destination buffer is to
4680 constrain the range of formatted values.  The maximum length of string
4681 arguments can be bounded by specifying the precision in the format
4682 directive.  When numeric arguments of format directives can be assumed
4683 to be bounded by less than the precision of their type, choosing
4684 an appropriate length modifier to the format specifier will reduce
4685 the required buffer size.  For example, if @var{a} and @var{b} in the
4686 example above can be assumed to be within the precision of
4687 the @code{short int} type then using either the @code{%hi} format
4688 directive or casting the argument to @code{short} reduces the maximum
4689 required size of the buffer to 24 bytes.
4691 @smallexample
4692 void f (int a, int b)
4694   char buf [23];
4695   sprintf (buf, "a = %hi, b = %i\n", a, (short)b);
4697 @end smallexample
4698 @end table
4700 @item -Wno-format-zero-length
4701 @opindex Wno-format-zero-length
4702 @opindex Wformat-zero-length
4703 If @option{-Wformat} is specified, do not warn about zero-length formats.
4704 The C standard specifies that zero-length formats are allowed.
4707 @item -Wformat=2
4708 @opindex Wformat=2
4709 Enable @option{-Wformat} plus additional format checks.  Currently
4710 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
4711 -Wformat-y2k}.
4713 @item -Wformat-nonliteral
4714 @opindex Wformat-nonliteral
4715 @opindex Wno-format-nonliteral
4716 If @option{-Wformat} is specified, also warn if the format string is not a
4717 string literal and so cannot be checked, unless the format function
4718 takes its format arguments as a @code{va_list}.
4720 @item -Wformat-security
4721 @opindex Wformat-security
4722 @opindex Wno-format-security
4723 If @option{-Wformat} is specified, also warn about uses of format
4724 functions that represent possible security problems.  At present, this
4725 warns about calls to @code{printf} and @code{scanf} functions where the
4726 format string is not a string literal and there are no format arguments,
4727 as in @code{printf (foo);}.  This may be a security hole if the format
4728 string came from untrusted input and contains @samp{%n}.  (This is
4729 currently a subset of what @option{-Wformat-nonliteral} warns about, but
4730 in future warnings may be added to @option{-Wformat-security} that are not
4731 included in @option{-Wformat-nonliteral}.)
4733 @item -Wformat-signedness
4734 @opindex Wformat-signedness
4735 @opindex Wno-format-signedness
4736 If @option{-Wformat} is specified, also warn if the format string
4737 requires an unsigned argument and the argument is signed and vice versa.
4739 @item -Wformat-truncation
4740 @itemx -Wformat-truncation=@var{level}
4741 @opindex Wformat-truncation
4742 @opindex Wno-format-truncation
4743 Warn about calls to formatted input/output functions such as @code{snprintf}
4744 and @code{vsnprintf} that might result in output truncation.  When the exact
4745 number of bytes written by a format directive cannot be determined at
4746 compile-time it is estimated based on heuristics that depend on
4747 the @var{level} argument and on optimization.  While enabling optimization
4748 will in most cases improve the accuracy of the warning, it may also result
4749 in false positives.  Except as noted otherwise, the option uses the same
4750 logic @option{-Wformat-overflow}.
4752 @table @gcctabopt
4753 @item -Wformat-truncation
4754 @itemx -Wformat-truncation=1
4755 @opindex Wformat-truncation
4756 @opindex Wno-format-truncation
4757 Level @var{1} of @option{-Wformat-truncation} enabled by @option{-Wformat}
4758 employs a conservative approach that warns only about calls to bounded
4759 functions whose return value is unused and that will most likely result
4760 in output truncation.
4762 @item -Wformat-truncation=2
4763 Level @var{2} warns also about calls to bounded functions whose return
4764 value is used and that might result in truncation given an argument of
4765 sufficient length or magnitude.
4766 @end table
4768 @item -Wformat-y2k
4769 @opindex Wformat-y2k
4770 @opindex Wno-format-y2k
4771 If @option{-Wformat} is specified, also warn about @code{strftime}
4772 formats that may yield only a two-digit year.
4773 @end table
4775 @item -Wnonnull
4776 @opindex Wnonnull
4777 @opindex Wno-nonnull
4778 Warn about passing a null pointer for arguments marked as
4779 requiring a non-null value by the @code{nonnull} function attribute.
4781 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
4782 can be disabled with the @option{-Wno-nonnull} option.
4784 @item -Wnonnull-compare
4785 @opindex Wnonnull-compare
4786 @opindex Wno-nonnull-compare
4787 Warn when comparing an argument marked with the @code{nonnull}
4788 function attribute against null inside the function.
4790 @option{-Wnonnull-compare} is included in @option{-Wall}.  It
4791 can be disabled with the @option{-Wno-nonnull-compare} option.
4793 @item -Wnull-dereference
4794 @opindex Wnull-dereference
4795 @opindex Wno-null-dereference
4796 Warn if the compiler detects paths that trigger erroneous or
4797 undefined behavior due to dereferencing a null pointer.  This option
4798 is only active when @option{-fdelete-null-pointer-checks} is active,
4799 which is enabled by optimizations in most targets.  The precision of
4800 the warnings depends on the optimization options used.
4802 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
4803 @opindex Winit-self
4804 @opindex Wno-init-self
4805 Warn about uninitialized variables that are initialized with themselves.
4806 Note this option can only be used with the @option{-Wuninitialized} option.
4808 For example, GCC warns about @code{i} being uninitialized in the
4809 following snippet only when @option{-Winit-self} has been specified:
4810 @smallexample
4811 @group
4812 int f()
4814   int i = i;
4815   return i;
4817 @end group
4818 @end smallexample
4820 This warning is enabled by @option{-Wall} in C++.
4822 @item -Wimplicit-int @r{(C and Objective-C only)}
4823 @opindex Wimplicit-int
4824 @opindex Wno-implicit-int
4825 Warn when a declaration does not specify a type.
4826 This warning is enabled by @option{-Wall}.
4828 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
4829 @opindex Wimplicit-function-declaration
4830 @opindex Wno-implicit-function-declaration
4831 Give a warning whenever a function is used before being declared. In
4832 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
4833 enabled by default and it is made into an error by
4834 @option{-pedantic-errors}. This warning is also enabled by
4835 @option{-Wall}.
4837 @item -Wimplicit @r{(C and Objective-C only)}
4838 @opindex Wimplicit
4839 @opindex Wno-implicit
4840 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
4841 This warning is enabled by @option{-Wall}.
4843 @item -Wimplicit-fallthrough
4844 @opindex Wimplicit-fallthrough
4845 @opindex Wno-implicit-fallthrough
4846 @option{-Wimplicit-fallthrough} is the same as @option{-Wimplicit-fallthrough=3}
4847 and @option{-Wno-implicit-fallthrough} is the same as
4848 @option{-Wimplicit-fallthrough=0}.
4850 @item -Wimplicit-fallthrough=@var{n}
4851 @opindex Wimplicit-fallthrough=
4852 Warn when a switch case falls through.  For example:
4854 @smallexample
4855 @group
4856 switch (cond)
4857   @{
4858   case 1:
4859     a = 1;
4860     break;
4861   case 2:
4862     a = 2;
4863   case 3:
4864     a = 3;
4865     break;
4866   @}
4867 @end group
4868 @end smallexample
4870 This warning does not warn when the last statement of a case cannot
4871 fall through, e.g. when there is a return statement or a call to function
4872 declared with the noreturn attribute.  @option{-Wimplicit-fallthrough=}
4873 also takes into account control flow statements, such as ifs, and only
4874 warns when appropriate.  E.g.@:
4876 @smallexample
4877 @group
4878 switch (cond)
4879   @{
4880   case 1:
4881     if (i > 3) @{
4882       bar (5);
4883       break;
4884     @} else if (i < 1) @{
4885       bar (0);
4886     @} else
4887       return;
4888   default:
4889     @dots{}
4890   @}
4891 @end group
4892 @end smallexample
4894 Since there are occasions where a switch case fall through is desirable,
4895 GCC provides an attribute, @code{__attribute__ ((fallthrough))}, that is
4896 to be used along with a null statement to suppress this warning that
4897 would normally occur:
4899 @smallexample
4900 @group
4901 switch (cond)
4902   @{
4903   case 1:
4904     bar (0);
4905     __attribute__ ((fallthrough));
4906   default:
4907     @dots{}
4908   @}
4909 @end group
4910 @end smallexample
4912 C++17 provides a standard way to suppress the @option{-Wimplicit-fallthrough}
4913 warning using @code{[[fallthrough]];} instead of the GNU attribute.  In C++11
4914 or C++14 users can use @code{[[gnu::fallthrough]];}, which is a GNU extension.
4915 Instead of these attributes, it is also possible to add a fallthrough comment
4916 to silence the warning.  The whole body of the C or C++ style comment should
4917 match the given regular expressions listed below.  The option argument @var{n}
4918 specifies what kind of comments are accepted:
4920 @itemize @bullet
4922 @item @option{-Wimplicit-fallthrough=0} disables the warning altogether.
4924 @item @option{-Wimplicit-fallthrough=1} matches @code{.*} regular
4925 expression, any comment is used as fallthrough comment.
4927 @item @option{-Wimplicit-fallthrough=2} case insensitively matches
4928 @code{.*falls?[ \t-]*thr(ough|u).*} regular expression.
4930 @item @option{-Wimplicit-fallthrough=3} case sensitively matches one of the
4931 following regular expressions:
4933 @itemize @bullet
4935 @item @code{-fallthrough}
4937 @item @code{@@fallthrough@@}
4939 @item @code{lint -fallthrough[ \t]*}
4941 @item @code{[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?@*FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?}
4943 @item @code{[ \t.!]*(Else,? |Intentional(ly)? )?@*Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4945 @item @code{[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?@*fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4947 @end itemize
4949 @item @option{-Wimplicit-fallthrough=4} case sensitively matches one of the
4950 following regular expressions:
4952 @itemize @bullet
4954 @item @code{-fallthrough}
4956 @item @code{@@fallthrough@@}
4958 @item @code{lint -fallthrough[ \t]*}
4960 @item @code{[ \t]*FALLTHR(OUGH|U)[ \t]*}
4962 @end itemize
4964 @item @option{-Wimplicit-fallthrough=5} doesn't recognize any comments as
4965 fallthrough comments, only attributes disable the warning.
4967 @end itemize
4969 The comment needs to be followed after optional whitespace and other comments
4970 by @code{case} or @code{default} keywords or by a user label that precedes some
4971 @code{case} or @code{default} label.
4973 @smallexample
4974 @group
4975 switch (cond)
4976   @{
4977   case 1:
4978     bar (0);
4979     /* FALLTHRU */
4980   default:
4981     @dots{}
4982   @}
4983 @end group
4984 @end smallexample
4986 The @option{-Wimplicit-fallthrough=3} warning is enabled by @option{-Wextra}.
4988 @item -Wif-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
4989 @opindex Wif-not-aligned
4990 @opindex Wno-if-not-aligned
4991 Control if warning triggered by the @code{warn_if_not_aligned} attribute
4992 should be issued.  This is enabled by default.
4993 Use @option{-Wno-if-not-aligned} to disable it.
4995 @item -Wignored-qualifiers @r{(C and C++ only)}
4996 @opindex Wignored-qualifiers
4997 @opindex Wno-ignored-qualifiers
4998 Warn if the return type of a function has a type qualifier
4999 such as @code{const}.  For ISO C such a type qualifier has no effect,
5000 since the value returned by a function is not an lvalue.
5001 For C++, the warning is only emitted for scalar types or @code{void}.
5002 ISO C prohibits qualified @code{void} return types on function
5003 definitions, so such return types always receive a warning
5004 even without this option.
5006 This warning is also enabled by @option{-Wextra}.
5008 @item -Wignored-attributes @r{(C and C++ only)}
5009 @opindex Wignored-attributes
5010 @opindex Wno-ignored-attributes
5011 Warn when an attribute is ignored.  This is different from the
5012 @option{-Wattributes} option in that it warns whenever the compiler decides
5013 to drop an attribute, not that the attribute is either unknown, used in a
5014 wrong place, etc.  This warning is enabled by default.
5016 @item -Wmain
5017 @opindex Wmain
5018 @opindex Wno-main
5019 Warn if the type of @code{main} is suspicious.  @code{main} should be
5020 a function with external linkage, returning int, taking either zero
5021 arguments, two, or three arguments of appropriate types.  This warning
5022 is enabled by default in C++ and is enabled by either @option{-Wall}
5023 or @option{-Wpedantic}.
5025 @item -Wmisleading-indentation @r{(C and C++ only)}
5026 @opindex Wmisleading-indentation
5027 @opindex Wno-misleading-indentation
5028 Warn when the indentation of the code does not reflect the block structure.
5029 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
5030 @code{for} clauses with a guarded statement that does not use braces,
5031 followed by an unguarded statement with the same indentation.
5033 In the following example, the call to ``bar'' is misleadingly indented as
5034 if it were guarded by the ``if'' conditional.
5036 @smallexample
5037   if (some_condition ())
5038     foo ();
5039     bar ();  /* Gotcha: this is not guarded by the "if".  */
5040 @end smallexample
5042 In the case of mixed tabs and spaces, the warning uses the
5043 @option{-ftabstop=} option to determine if the statements line up
5044 (defaulting to 8).
5046 The warning is not issued for code involving multiline preprocessor logic
5047 such as the following example.
5049 @smallexample
5050   if (flagA)
5051     foo (0);
5052 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
5053   if (flagB)
5054 #endif
5055     foo (1);
5056 @end smallexample
5058 The warning is not issued after a @code{#line} directive, since this
5059 typically indicates autogenerated code, and no assumptions can be made
5060 about the layout of the file that the directive references.
5062 This warning is enabled by @option{-Wall} in C and C++.
5064 @item -Wmissing-attributes
5065 @opindex Wmissing-attributes
5066 @opindex Wno-missing-attributes
5067 Warn when a declaration of a function is missing one or more attributes
5068 that a related function is declared with and whose absence may adversely
5069 affect the correctness or efficiency of generated code.  For example,
5070 the warning is issued for declarations of aliases that use attributes
5071 to specify less restrictive requirements than those of their targets.
5072 This typically represents a potential optimization opportunity.
5073 By contrast, the @option{-Wattribute-alias=2} option controls warnings
5074 issued when the alias is more restrictive than the target, which could
5075 lead to incorrect code generation.
5076 Attributes considered include @code{alloc_align}, @code{alloc_size},
5077 @code{cold}, @code{const}, @code{hot}, @code{leaf}, @code{malloc},
5078 @code{nonnull}, @code{noreturn}, @code{nothrow}, @code{pure},
5079 @code{returns_nonnull}, and @code{returns_twice}.
5081 In C++, the warning is issued when an explicit specialization of a primary
5082 template declared with attribute @code{alloc_align}, @code{alloc_size},
5083 @code{assume_aligned}, @code{format}, @code{format_arg}, @code{malloc},
5084 or @code{nonnull} is declared without it.  Attributes @code{deprecated},
5085 @code{error}, and @code{warning} suppress the warning.
5086 (@pxref{Function Attributes}).
5088 You can use the @code{copy} attribute to apply the same
5089 set of attributes to a declaration as that on another declaration without
5090 explicitly enumerating the attributes. This attribute can be applied
5091 to declarations of functions (@pxref{Common Function Attributes}),
5092 variables (@pxref{Common Variable Attributes}), or types
5093 (@pxref{Common Type Attributes}).
5095 @option{-Wmissing-attributes} is enabled by @option{-Wall}.
5097 For example, since the declaration of the primary function template
5098 below makes use of both attribute @code{malloc} and @code{alloc_size}
5099 the declaration of the explicit specialization of the template is
5100 diagnosed because it is missing one of the attributes.
5102 @smallexample
5103 template <class T>
5104 T* __attribute__ ((malloc, alloc_size (1)))
5105 allocate (size_t);
5107 template <>
5108 void* __attribute__ ((malloc))   // missing alloc_size
5109 allocate<void> (size_t);
5110 @end smallexample
5112 @item -Wmissing-braces
5113 @opindex Wmissing-braces
5114 @opindex Wno-missing-braces
5115 Warn if an aggregate or union initializer is not fully bracketed.  In
5116 the following example, the initializer for @code{a} is not fully
5117 bracketed, but that for @code{b} is fully bracketed.  This warning is
5118 enabled by @option{-Wall} in C.
5120 @smallexample
5121 int a[2][2] = @{ 0, 1, 2, 3 @};
5122 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
5123 @end smallexample
5125 This warning is enabled by @option{-Wall}.
5127 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
5128 @opindex Wmissing-include-dirs
5129 @opindex Wno-missing-include-dirs
5130 Warn if a user-supplied include directory does not exist.
5132 @item -Wmissing-profile
5133 @opindex Wmissing-profile
5134 @opindex Wno-missing-profile
5135 Warn if feedback profiles are missing when using the
5136 @option{-fprofile-use} option.
5137 This option diagnoses those cases where a new function or a new file is added
5138 to the user code between compiling with @option{-fprofile-generate} and with
5139 @option{-fprofile-use}, without regenerating the profiles.  In these cases, the
5140 profile feedback data files do not contain any profile feedback information for
5141 the newly added function or file respectively.  Also, in the case when profile
5142 count data (.gcda) files are removed, GCC cannot use any profile feedback
5143 information.  In all these cases, warnings are issued to inform the user that a
5144 profile generation step is due.  @option{-Wno-missing-profile} can be used to
5145 disable the warning.  Ignoring the warning can result in poorly optimized code.
5146 Completely disabling the warning is not recommended and should be done only
5147 when non-existent profile data is justified.
5149 @item -Wmultistatement-macros
5150 @opindex Wmultistatement-macros
5151 @opindex Wno-multistatement-macros
5152 Warn about unsafe multiple statement macros that appear to be guarded
5153 by a clause such as @code{if}, @code{else}, @code{for}, @code{switch}, or
5154 @code{while}, in which only the first statement is actually guarded after
5155 the macro is expanded.
5157 For example:
5159 @smallexample
5160 #define DOIT x++; y++
5161 if (c)
5162   DOIT;
5163 @end smallexample
5165 will increment @code{y} unconditionally, not just when @code{c} holds.
5166 The can usually be fixed by wrapping the macro in a do-while loop:
5167 @smallexample
5168 #define DOIT do @{ x++; y++; @} while (0)
5169 if (c)
5170   DOIT;
5171 @end smallexample
5173 This warning is enabled by @option{-Wall} in C and C++.
5175 @item -Wparentheses
5176 @opindex Wparentheses
5177 @opindex Wno-parentheses
5178 Warn if parentheses are omitted in certain contexts, such
5179 as when there is an assignment in a context where a truth value
5180 is expected, or when operators are nested whose precedence people
5181 often get confused about.
5183 Also warn if a comparison like @code{x<=y<=z} appears; this is
5184 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
5185 interpretation from that of ordinary mathematical notation.
5187 Also warn for dangerous uses of the GNU extension to
5188 @code{?:} with omitted middle operand. When the condition
5189 in the @code{?}: operator is a boolean expression, the omitted value is
5190 always 1.  Often programmers expect it to be a value computed
5191 inside the conditional expression instead.
5193 For C++ this also warns for some cases of unnecessary parentheses in
5194 declarations, which can indicate an attempt at a function call instead
5195 of a declaration:
5196 @smallexample
5198   // Declares a local variable called mymutex.
5199   std::unique_lock<std::mutex> (mymutex);
5200   // User meant std::unique_lock<std::mutex> lock (mymutex);
5202 @end smallexample
5204 This warning is enabled by @option{-Wall}.
5206 @item -Wsequence-point
5207 @opindex Wsequence-point
5208 @opindex Wno-sequence-point
5209 Warn about code that may have undefined semantics because of violations
5210 of sequence point rules in the C and C++ standards.
5212 The C and C++ standards define the order in which expressions in a C/C++
5213 program are evaluated in terms of @dfn{sequence points}, which represent
5214 a partial ordering between the execution of parts of the program: those
5215 executed before the sequence point, and those executed after it.  These
5216 occur after the evaluation of a full expression (one which is not part
5217 of a larger expression), after the evaluation of the first operand of a
5218 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
5219 function is called (but after the evaluation of its arguments and the
5220 expression denoting the called function), and in certain other places.
5221 Other than as expressed by the sequence point rules, the order of
5222 evaluation of subexpressions of an expression is not specified.  All
5223 these rules describe only a partial order rather than a total order,
5224 since, for example, if two functions are called within one expression
5225 with no sequence point between them, the order in which the functions
5226 are called is not specified.  However, the standards committee have
5227 ruled that function calls do not overlap.
5229 It is not specified when between sequence points modifications to the
5230 values of objects take effect.  Programs whose behavior depends on this
5231 have undefined behavior; the C and C++ standards specify that ``Between
5232 the previous and next sequence point an object shall have its stored
5233 value modified at most once by the evaluation of an expression.
5234 Furthermore, the prior value shall be read only to determine the value
5235 to be stored.''.  If a program breaks these rules, the results on any
5236 particular implementation are entirely unpredictable.
5238 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
5239 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
5240 diagnosed by this option, and it may give an occasional false positive
5241 result, but in general it has been found fairly effective at detecting
5242 this sort of problem in programs.
5244 The C++17 standard will define the order of evaluation of operands in
5245 more cases: in particular it requires that the right-hand side of an
5246 assignment be evaluated before the left-hand side, so the above
5247 examples are no longer undefined.  But this warning will still warn
5248 about them, to help people avoid writing code that is undefined in C
5249 and earlier revisions of C++.
5251 The standard is worded confusingly, therefore there is some debate
5252 over the precise meaning of the sequence point rules in subtle cases.
5253 Links to discussions of the problem, including proposed formal
5254 definitions, may be found on the GCC readings page, at
5255 @uref{http://gcc.gnu.org/@/readings.html}.
5257 This warning is enabled by @option{-Wall} for C and C++.
5259 @item -Wno-return-local-addr
5260 @opindex Wno-return-local-addr
5261 @opindex Wreturn-local-addr
5262 Do not warn about returning a pointer (or in C++, a reference) to a
5263 variable that goes out of scope after the function returns.
5265 @item -Wreturn-type
5266 @opindex Wreturn-type
5267 @opindex Wno-return-type
5268 Warn whenever a function is defined with a return type that defaults
5269 to @code{int}.  Also warn about any @code{return} statement with no
5270 return value in a function whose return type is not @code{void}
5271 (falling off the end of the function body is considered returning
5272 without a value).
5274 For C only, warn about a @code{return} statement with an expression in a
5275 function whose return type is @code{void}, unless the expression type is
5276 also @code{void}.  As a GNU extension, the latter case is accepted
5277 without a warning unless @option{-Wpedantic} is used.  Attempting
5278 to use the return value of a non-@code{void} function other than @code{main}
5279 that flows off the end by reaching the closing curly brace that terminates
5280 the function is undefined.
5282 Unlike in C, in C++, flowing off the end of a non-@code{void} function other
5283 than @code{main} results in undefined behavior even when the value of
5284 the function is not used.
5286 This warning is enabled by default in C++ and by @option{-Wall} otherwise.
5288 @item -Wshift-count-negative
5289 @opindex Wshift-count-negative
5290 @opindex Wno-shift-count-negative
5291 Warn if shift count is negative. This warning is enabled by default.
5293 @item -Wshift-count-overflow
5294 @opindex Wshift-count-overflow
5295 @opindex Wno-shift-count-overflow
5296 Warn if shift count >= width of type. This warning is enabled by default.
5298 @item -Wshift-negative-value
5299 @opindex Wshift-negative-value
5300 @opindex Wno-shift-negative-value
5301 Warn if left shifting a negative value.  This warning is enabled by
5302 @option{-Wextra} in C99 and C++11 modes (and newer).
5304 @item -Wshift-overflow
5305 @itemx -Wshift-overflow=@var{n}
5306 @opindex Wshift-overflow
5307 @opindex Wno-shift-overflow
5308 Warn about left shift overflows.  This warning is enabled by
5309 default in C99 and C++11 modes (and newer).
5311 @table @gcctabopt
5312 @item -Wshift-overflow=1
5313 This is the warning level of @option{-Wshift-overflow} and is enabled
5314 by default in C99 and C++11 modes (and newer).  This warning level does
5315 not warn about left-shifting 1 into the sign bit.  (However, in C, such
5316 an overflow is still rejected in contexts where an integer constant expression
5317 is required.)  No warning is emitted in C++2A mode (and newer), as signed left
5318 shifts always wrap.
5320 @item -Wshift-overflow=2
5321 This warning level also warns about left-shifting 1 into the sign bit,
5322 unless C++14 mode (or newer) is active.
5323 @end table
5325 @item -Wswitch
5326 @opindex Wswitch
5327 @opindex Wno-switch
5328 Warn whenever a @code{switch} statement has an index of enumerated type
5329 and lacks a @code{case} for one or more of the named codes of that
5330 enumeration.  (The presence of a @code{default} label prevents this
5331 warning.)  @code{case} labels outside the enumeration range also
5332 provoke warnings when this option is used (even if there is a
5333 @code{default} label).
5334 This warning is enabled by @option{-Wall}.
5336 @item -Wswitch-default
5337 @opindex Wswitch-default
5338 @opindex Wno-switch-default
5339 Warn whenever a @code{switch} statement does not have a @code{default}
5340 case.
5342 @item -Wswitch-enum
5343 @opindex Wswitch-enum
5344 @opindex Wno-switch-enum
5345 Warn whenever a @code{switch} statement has an index of enumerated type
5346 and lacks a @code{case} for one or more of the named codes of that
5347 enumeration.  @code{case} labels outside the enumeration range also
5348 provoke warnings when this option is used.  The only difference
5349 between @option{-Wswitch} and this option is that this option gives a
5350 warning about an omitted enumeration code even if there is a
5351 @code{default} label.
5353 @item -Wswitch-bool
5354 @opindex Wswitch-bool
5355 @opindex Wno-switch-bool
5356 Warn whenever a @code{switch} statement has an index of boolean type
5357 and the case values are outside the range of a boolean type.
5358 It is possible to suppress this warning by casting the controlling
5359 expression to a type other than @code{bool}.  For example:
5360 @smallexample
5361 @group
5362 switch ((int) (a == 4))
5363   @{
5364   @dots{}
5365   @}
5366 @end group
5367 @end smallexample
5368 This warning is enabled by default for C and C++ programs.
5370 @item -Wswitch-unreachable
5371 @opindex Wswitch-unreachable
5372 @opindex Wno-switch-unreachable
5373 Warn whenever a @code{switch} statement contains statements between the
5374 controlling expression and the first case label, which will never be
5375 executed.  For example:
5376 @smallexample
5377 @group
5378 switch (cond)
5379   @{
5380    i = 15;
5381   @dots{}
5382    case 5:
5383   @dots{}
5384   @}
5385 @end group
5386 @end smallexample
5387 @option{-Wswitch-unreachable} does not warn if the statement between the
5388 controlling expression and the first case label is just a declaration:
5389 @smallexample
5390 @group
5391 switch (cond)
5392   @{
5393    int i;
5394   @dots{}
5395    case 5:
5396    i = 5;
5397   @dots{}
5398   @}
5399 @end group
5400 @end smallexample
5401 This warning is enabled by default for C and C++ programs.
5403 @item -Wsync-nand @r{(C and C++ only)}
5404 @opindex Wsync-nand
5405 @opindex Wno-sync-nand
5406 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
5407 built-in functions are used.  These functions changed semantics in GCC 4.4.
5409 @item -Wunused-but-set-parameter
5410 @opindex Wunused-but-set-parameter
5411 @opindex Wno-unused-but-set-parameter
5412 Warn whenever a function parameter is assigned to, but otherwise unused
5413 (aside from its declaration).
5415 To suppress this warning use the @code{unused} attribute
5416 (@pxref{Variable Attributes}).
5418 This warning is also enabled by @option{-Wunused} together with
5419 @option{-Wextra}.
5421 @item -Wunused-but-set-variable
5422 @opindex Wunused-but-set-variable
5423 @opindex Wno-unused-but-set-variable
5424 Warn whenever a local variable is assigned to, but otherwise unused
5425 (aside from its declaration).
5426 This warning is enabled by @option{-Wall}.
5428 To suppress this warning use the @code{unused} attribute
5429 (@pxref{Variable Attributes}).
5431 This warning is also enabled by @option{-Wunused}, which is enabled
5432 by @option{-Wall}.
5434 @item -Wunused-function
5435 @opindex Wunused-function
5436 @opindex Wno-unused-function
5437 Warn whenever a static function is declared but not defined or a
5438 non-inline static function is unused.
5439 This warning is enabled by @option{-Wall}.
5441 @item -Wunused-label
5442 @opindex Wunused-label
5443 @opindex Wno-unused-label
5444 Warn whenever a label is declared but not used.
5445 This warning is enabled by @option{-Wall}.
5447 To suppress this warning use the @code{unused} attribute
5448 (@pxref{Variable Attributes}).
5450 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
5451 @opindex Wunused-local-typedefs
5452 @opindex Wno-unused-local-typedefs
5453 Warn when a typedef locally defined in a function is not used.
5454 This warning is enabled by @option{-Wall}.
5456 @item -Wunused-parameter
5457 @opindex Wunused-parameter
5458 @opindex Wno-unused-parameter
5459 Warn whenever a function parameter is unused aside from its declaration.
5461 To suppress this warning use the @code{unused} attribute
5462 (@pxref{Variable Attributes}).
5464 @item -Wno-unused-result
5465 @opindex Wunused-result
5466 @opindex Wno-unused-result
5467 Do not warn if a caller of a function marked with attribute
5468 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
5469 its return value. The default is @option{-Wunused-result}.
5471 @item -Wunused-variable
5472 @opindex Wunused-variable
5473 @opindex Wno-unused-variable
5474 Warn whenever a local or static variable is unused aside from its
5475 declaration. This option implies @option{-Wunused-const-variable=1} for C,
5476 but not for C++. This warning is enabled by @option{-Wall}.
5478 To suppress this warning use the @code{unused} attribute
5479 (@pxref{Variable Attributes}).
5481 @item -Wunused-const-variable
5482 @itemx -Wunused-const-variable=@var{n}
5483 @opindex Wunused-const-variable
5484 @opindex Wno-unused-const-variable
5485 Warn whenever a constant static variable is unused aside from its declaration.
5486 @option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
5487 for C, but not for C++. In C this declares variable storage, but in C++ this
5488 is not an error since const variables take the place of @code{#define}s.
5490 To suppress this warning use the @code{unused} attribute
5491 (@pxref{Variable Attributes}).
5493 @table @gcctabopt
5494 @item -Wunused-const-variable=1
5495 This is the warning level that is enabled by @option{-Wunused-variable} for
5496 C.  It warns only about unused static const variables defined in the main
5497 compilation unit, but not about static const variables declared in any
5498 header included.
5500 @item -Wunused-const-variable=2
5501 This warning level also warns for unused constant static variables in
5502 headers (excluding system headers).  This is the warning level of
5503 @option{-Wunused-const-variable} and must be explicitly requested since
5504 in C++ this isn't an error and in C it might be harder to clean up all
5505 headers included.
5506 @end table
5508 @item -Wunused-value
5509 @opindex Wunused-value
5510 @opindex Wno-unused-value
5511 Warn whenever a statement computes a result that is explicitly not
5512 used. To suppress this warning cast the unused expression to
5513 @code{void}. This includes an expression-statement or the left-hand
5514 side of a comma expression that contains no side effects. For example,
5515 an expression such as @code{x[i,j]} causes a warning, while
5516 @code{x[(void)i,j]} does not.
5518 This warning is enabled by @option{-Wall}.
5520 @item -Wunused
5521 @opindex Wunused
5522 @opindex Wno-unused
5523 All the above @option{-Wunused} options combined.
5525 In order to get a warning about an unused function parameter, you must
5526 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
5527 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
5529 @item -Wuninitialized
5530 @opindex Wuninitialized
5531 @opindex Wno-uninitialized
5532 Warn if an automatic variable is used without first being initialized
5533 or if a variable may be clobbered by a @code{setjmp} call. In C++,
5534 warn if a non-static reference or non-static @code{const} member
5535 appears in a class without constructors.
5537 If you want to warn about code that uses the uninitialized value of the
5538 variable in its own initializer, use the @option{-Winit-self} option.
5540 These warnings occur for individual uninitialized or clobbered
5541 elements of structure, union or array variables as well as for
5542 variables that are uninitialized or clobbered as a whole.  They do
5543 not occur for variables or elements declared @code{volatile}.  Because
5544 these warnings depend on optimization, the exact variables or elements
5545 for which there are warnings depends on the precise optimization
5546 options and version of GCC used.
5548 Note that there may be no warning about a variable that is used only
5549 to compute a value that itself is never used, because such
5550 computations may be deleted by data flow analysis before the warnings
5551 are printed.
5553 @item -Winvalid-memory-model
5554 @opindex Winvalid-memory-model
5555 @opindex Wno-invalid-memory-model
5556 Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
5557 and the C11 atomic generic functions with a memory consistency argument
5558 that is either invalid for the operation or outside the range of values
5559 of the @code{memory_order} enumeration.  For example, since the
5560 @code{__atomic_store} and @code{__atomic_store_n} built-ins are only
5561 defined for the relaxed, release, and sequentially consistent memory
5562 orders the following code is diagnosed:
5564 @smallexample
5565 void store (int *i)
5567   __atomic_store_n (i, 0, memory_order_consume);
5569 @end smallexample
5571 @option{-Winvalid-memory-model} is enabled by default.
5573 @item -Wmaybe-uninitialized
5574 @opindex Wmaybe-uninitialized
5575 @opindex Wno-maybe-uninitialized
5576 For an automatic (i.e.@: local) variable, if there exists a path from the
5577 function entry to a use of the variable that is initialized, but there exist
5578 some other paths for which the variable is not initialized, the compiler
5579 emits a warning if it cannot prove the uninitialized paths are not
5580 executed at run time.
5582 These warnings are only possible in optimizing compilation, because otherwise
5583 GCC does not keep track of the state of variables.
5585 These warnings are made optional because GCC may not be able to determine when
5586 the code is correct in spite of appearing to have an error.  Here is one
5587 example of how this can happen:
5589 @smallexample
5590 @group
5592   int x;
5593   switch (y)
5594     @{
5595     case 1: x = 1;
5596       break;
5597     case 2: x = 4;
5598       break;
5599     case 3: x = 5;
5600     @}
5601   foo (x);
5603 @end group
5604 @end smallexample
5606 @noindent
5607 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
5608 always initialized, but GCC doesn't know this. To suppress the
5609 warning, you need to provide a default case with assert(0) or
5610 similar code.
5612 @cindex @code{longjmp} warnings
5613 This option also warns when a non-volatile automatic variable might be
5614 changed by a call to @code{longjmp}.
5615 The compiler sees only the calls to @code{setjmp}.  It cannot know
5616 where @code{longjmp} will be called; in fact, a signal handler could
5617 call it at any point in the code.  As a result, you may get a warning
5618 even when there is in fact no problem because @code{longjmp} cannot
5619 in fact be called at the place that would cause a problem.
5621 Some spurious warnings can be avoided if you declare all the functions
5622 you use that never return as @code{noreturn}.  @xref{Function
5623 Attributes}.
5625 This warning is enabled by @option{-Wall} or @option{-Wextra}.
5627 @item -Wunknown-pragmas
5628 @opindex Wunknown-pragmas
5629 @opindex Wno-unknown-pragmas
5630 @cindex warning for unknown pragmas
5631 @cindex unknown pragmas, warning
5632 @cindex pragmas, warning of unknown
5633 Warn when a @code{#pragma} directive is encountered that is not understood by 
5634 GCC@.  If this command-line option is used, warnings are even issued
5635 for unknown pragmas in system header files.  This is not the case if
5636 the warnings are only enabled by the @option{-Wall} command-line option.
5638 @item -Wno-pragmas
5639 @opindex Wno-pragmas
5640 @opindex Wpragmas
5641 Do not warn about misuses of pragmas, such as incorrect parameters,
5642 invalid syntax, or conflicts between pragmas.  See also
5643 @option{-Wunknown-pragmas}.
5645 @item -Wno-prio-ctor-dtor
5646 @opindex Wno-prio-ctor-dtor
5647 @opindex Wprio-ctor-dtor
5648 Do not warn if a priority from 0 to 100 is used for constructor or destructor.
5649 The use of constructor and destructor attributes allow you to assign a
5650 priority to the constructor/destructor to control its order of execution
5651 before @code{main} is called or after it returns.  The priority values must be
5652 greater than 100 as the compiler reserves priority values between 0--100 for
5653 the implementation.
5655 @item -Wstrict-aliasing
5656 @opindex Wstrict-aliasing
5657 @opindex Wno-strict-aliasing
5658 This option is only active when @option{-fstrict-aliasing} is active.
5659 It warns about code that might break the strict aliasing rules that the
5660 compiler is using for optimization.  The warning does not catch all
5661 cases, but does attempt to catch the more common pitfalls.  It is
5662 included in @option{-Wall}.
5663 It is equivalent to @option{-Wstrict-aliasing=3}
5665 @item -Wstrict-aliasing=n
5666 @opindex Wstrict-aliasing=n
5667 This option is only active when @option{-fstrict-aliasing} is active.
5668 It warns about code that might break the strict aliasing rules that the
5669 compiler is using for optimization.
5670 Higher levels correspond to higher accuracy (fewer false positives).
5671 Higher levels also correspond to more effort, similar to the way @option{-O} 
5672 works.
5673 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
5675 Level 1: Most aggressive, quick, least accurate.
5676 Possibly useful when higher levels
5677 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
5678 false negatives.  However, it has many false positives.
5679 Warns for all pointer conversions between possibly incompatible types,
5680 even if never dereferenced.  Runs in the front end only.
5682 Level 2: Aggressive, quick, not too precise.
5683 May still have many false positives (not as many as level 1 though),
5684 and few false negatives (but possibly more than level 1).
5685 Unlike level 1, it only warns when an address is taken.  Warns about
5686 incomplete types.  Runs in the front end only.
5688 Level 3 (default for @option{-Wstrict-aliasing}):
5689 Should have very few false positives and few false
5690 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
5691 Takes care of the common pun+dereference pattern in the front end:
5692 @code{*(int*)&some_float}.
5693 If optimization is enabled, it also runs in the back end, where it deals
5694 with multiple statement cases using flow-sensitive points-to information.
5695 Only warns when the converted pointer is dereferenced.
5696 Does not warn about incomplete types.
5698 @item -Wstrict-overflow
5699 @itemx -Wstrict-overflow=@var{n}
5700 @opindex Wstrict-overflow
5701 @opindex Wno-strict-overflow
5702 This option is only active when signed overflow is undefined.
5703 It warns about cases where the compiler optimizes based on the
5704 assumption that signed overflow does not occur.  Note that it does not
5705 warn about all cases where the code might overflow: it only warns
5706 about cases where the compiler implements some optimization.  Thus
5707 this warning depends on the optimization level.
5709 An optimization that assumes that signed overflow does not occur is
5710 perfectly safe if the values of the variables involved are such that
5711 overflow never does, in fact, occur.  Therefore this warning can
5712 easily give a false positive: a warning about code that is not
5713 actually a problem.  To help focus on important issues, several
5714 warning levels are defined.  No warnings are issued for the use of
5715 undefined signed overflow when estimating how many iterations a loop
5716 requires, in particular when determining whether a loop will be
5717 executed at all.
5719 @table @gcctabopt
5720 @item -Wstrict-overflow=1
5721 Warn about cases that are both questionable and easy to avoid.  For
5722 example the compiler simplifies
5723 @code{x + 1 > x} to @code{1}.  This level of
5724 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
5725 are not, and must be explicitly requested.
5727 @item -Wstrict-overflow=2
5728 Also warn about other cases where a comparison is simplified to a
5729 constant.  For example: @code{abs (x) >= 0}.  This can only be
5730 simplified when signed integer overflow is undefined, because
5731 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
5732 zero.  @option{-Wstrict-overflow} (with no level) is the same as
5733 @option{-Wstrict-overflow=2}.
5735 @item -Wstrict-overflow=3
5736 Also warn about other cases where a comparison is simplified.  For
5737 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
5739 @item -Wstrict-overflow=4
5740 Also warn about other simplifications not covered by the above cases.
5741 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
5743 @item -Wstrict-overflow=5
5744 Also warn about cases where the compiler reduces the magnitude of a
5745 constant involved in a comparison.  For example: @code{x + 2 > y} is
5746 simplified to @code{x + 1 >= y}.  This is reported only at the
5747 highest warning level because this simplification applies to many
5748 comparisons, so this warning level gives a very large number of
5749 false positives.
5750 @end table
5752 @item -Wstringop-overflow
5753 @itemx -Wstringop-overflow=@var{type}
5754 @opindex Wstringop-overflow
5755 @opindex Wno-stringop-overflow
5756 Warn for calls to string manipulation functions such as @code{memcpy} and
5757 @code{strcpy} that are determined to overflow the destination buffer.  The
5758 optional argument is one greater than the type of Object Size Checking to
5759 perform to determine the size of the destination.  @xref{Object Size Checking}.
5760 The argument is meaningful only for functions that operate on character arrays
5761 but not for raw memory functions like @code{memcpy} which always make use
5762 of Object Size type-0.  The option also warns for calls that specify a size
5763 in excess of the largest possible object or at most @code{SIZE_MAX / 2} bytes.
5764 The option produces the best results with optimization enabled but can detect
5765 a small subset of simple buffer overflows even without optimization in
5766 calls to the GCC built-in functions like @code{__builtin_memcpy} that
5767 correspond to the standard functions.  In any case, the option warns about
5768 just a subset of buffer overflows detected by the corresponding overflow
5769 checking built-ins.  For example, the option will issue a warning for
5770 the @code{strcpy} call below because it copies at least 5 characters
5771 (the string @code{"blue"} including the terminating NUL) into the buffer
5772 of size 4.
5774 @smallexample
5775 enum Color @{ blue, purple, yellow @};
5776 const char* f (enum Color clr)
5778   static char buf [4];
5779   const char *str;
5780   switch (clr)
5781     @{
5782       case blue: str = "blue"; break;
5783       case purple: str = "purple"; break;
5784       case yellow: str = "yellow"; break;
5785     @}
5787   return strcpy (buf, str);   // warning here
5789 @end smallexample
5791 Option @option{-Wstringop-overflow=2} is enabled by default.
5793 @table @gcctabopt
5794 @item -Wstringop-overflow
5795 @itemx -Wstringop-overflow=1
5796 @opindex Wstringop-overflow
5797 @opindex Wno-stringop-overflow
5798 The @option{-Wstringop-overflow=1} option uses type-zero Object Size Checking
5799 to determine the sizes of destination objects.  This is the default setting
5800 of the option.  At this setting the option will not warn for writes past
5801 the end of subobjects of larger objects accessed by pointers unless the
5802 size of the largest surrounding object is known.  When the destination may
5803 be one of several objects it is assumed to be the largest one of them.  On
5804 Linux systems, when optimization is enabled at this setting the option warns
5805 for the same code as when the @code{_FORTIFY_SOURCE} macro is defined to
5806 a non-zero value.
5808 @item -Wstringop-overflow=2
5809 The @option{-Wstringop-overflow=2} option uses type-one Object Size Checking
5810 to determine the sizes of destination objects.  At this setting the option
5811 will warn about overflows when writing to members of the largest complete
5812 objects whose exact size is known.  It will, however, not warn for excessive
5813 writes to the same members of unknown objects referenced by pointers since
5814 they may point to arrays containing unknown numbers of elements.
5816 @item -Wstringop-overflow=3
5817 The @option{-Wstringop-overflow=3} option uses type-two Object Size Checking
5818 to determine the sizes of destination objects.  At this setting the option
5819 warns about overflowing the smallest object or data member.  This is the
5820 most restrictive setting of the option that may result in warnings for safe
5821 code.
5823 @item -Wstringop-overflow=4
5824 The @option{-Wstringop-overflow=4} option uses type-three Object Size Checking
5825 to determine the sizes of destination objects.  At this setting the option
5826 will warn about overflowing any data members, and when the destination is
5827 one of several objects it uses the size of the largest of them to decide
5828 whether to issue a warning.  Similarly to @option{-Wstringop-overflow=3} this
5829 setting of the option may result in warnings for benign code.
5830 @end table
5832 @item -Wstringop-truncation
5833 @opindex Wstringop-truncation
5834 @opindex Wno-stringop-truncation
5835 Warn for calls to bounded string manipulation functions such as @code{strncat},
5836 @code{strncpy}, and @code{stpncpy} that may either truncate the copied string
5837 or leave the destination unchanged.
5839 In the following example, the call to @code{strncat} specifies a bound that
5840 is less than the length of the source string.  As a result, the copy of
5841 the source will be truncated and so the call is diagnosed.  To avoid the
5842 warning use @code{bufsize - strlen (buf) - 1)} as the bound.
5844 @smallexample
5845 void append (char *buf, size_t bufsize)
5847   strncat (buf, ".txt", 3);
5849 @end smallexample
5851 As another example, the following call to @code{strncpy} results in copying
5852 to @code{d} just the characters preceding the terminating NUL, without
5853 appending the NUL to the end.  Assuming the result of @code{strncpy} is
5854 necessarily a NUL-terminated string is a common mistake, and so the call
5855 is diagnosed.  To avoid the warning when the result is not expected to be
5856 NUL-terminated, call @code{memcpy} instead.
5858 @smallexample
5859 void copy (char *d, const char *s)
5861   strncpy (d, s, strlen (s));
5863 @end smallexample
5865 In the following example, the call to @code{strncpy} specifies the size
5866 of the destination buffer as the bound.  If the length of the source
5867 string is equal to or greater than this size the result of the copy will
5868 not be NUL-terminated.  Therefore, the call is also diagnosed.  To avoid
5869 the warning, specify @code{sizeof buf - 1} as the bound and set the last
5870 element of the buffer to @code{NUL}.
5872 @smallexample
5873 void copy (const char *s)
5875   char buf[80];
5876   strncpy (buf, s, sizeof buf);
5877   @dots{}
5879 @end smallexample
5881 In situations where a character array is intended to store a sequence
5882 of bytes with no terminating @code{NUL} such an array may be annotated
5883 with attribute @code{nonstring} to avoid this warning.  Such arrays,
5884 however, are not suitable arguments to functions that expect
5885 @code{NUL}-terminated strings.  To help detect accidental misuses of
5886 such arrays GCC issues warnings unless it can prove that the use is
5887 safe.  @xref{Common Variable Attributes}.
5889 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}cold@r{|}malloc@r{]}
5890 @opindex Wsuggest-attribute=
5891 @opindex Wno-suggest-attribute=
5892 Warn for cases where adding an attribute may be beneficial. The
5893 attributes currently supported are listed below.
5895 @table @gcctabopt
5896 @item -Wsuggest-attribute=pure
5897 @itemx -Wsuggest-attribute=const
5898 @itemx -Wsuggest-attribute=noreturn
5899 @itemx -Wmissing-noreturn
5900 @itemx -Wsuggest-attribute=malloc
5901 @opindex Wsuggest-attribute=pure
5902 @opindex Wno-suggest-attribute=pure
5903 @opindex Wsuggest-attribute=const
5904 @opindex Wno-suggest-attribute=const
5905 @opindex Wsuggest-attribute=noreturn
5906 @opindex Wno-suggest-attribute=noreturn
5907 @opindex Wmissing-noreturn
5908 @opindex Wno-missing-noreturn
5909 @opindex Wsuggest-attribute=malloc
5910 @opindex Wno-suggest-attribute=malloc
5912 Warn about functions that might be candidates for attributes
5913 @code{pure}, @code{const} or @code{noreturn} or @code{malloc}. The compiler
5914 only warns for functions visible in other compilation units or (in the case of
5915 @code{pure} and @code{const}) if it cannot prove that the function returns
5916 normally. A function returns normally if it doesn't contain an infinite loop or
5917 return abnormally by throwing, calling @code{abort} or trapping.  This analysis
5918 requires option @option{-fipa-pure-const}, which is enabled by default at
5919 @option{-O} and higher.  Higher optimization levels improve the accuracy
5920 of the analysis.
5922 @item -Wsuggest-attribute=format
5923 @itemx -Wmissing-format-attribute
5924 @opindex Wsuggest-attribute=format
5925 @opindex Wmissing-format-attribute
5926 @opindex Wno-suggest-attribute=format
5927 @opindex Wno-missing-format-attribute
5928 @opindex Wformat
5929 @opindex Wno-format
5931 Warn about function pointers that might be candidates for @code{format}
5932 attributes.  Note these are only possible candidates, not absolute ones.
5933 GCC guesses that function pointers with @code{format} attributes that
5934 are used in assignment, initialization, parameter passing or return
5935 statements should have a corresponding @code{format} attribute in the
5936 resulting type.  I.e.@: the left-hand side of the assignment or
5937 initialization, the type of the parameter variable, or the return type
5938 of the containing function respectively should also have a @code{format}
5939 attribute to avoid the warning.
5941 GCC also warns about function definitions that might be
5942 candidates for @code{format} attributes.  Again, these are only
5943 possible candidates.  GCC guesses that @code{format} attributes
5944 might be appropriate for any function that calls a function like
5945 @code{vprintf} or @code{vscanf}, but this might not always be the
5946 case, and some functions for which @code{format} attributes are
5947 appropriate may not be detected.
5949 @item -Wsuggest-attribute=cold
5950 @opindex Wsuggest-attribute=cold
5951 @opindex Wno-suggest-attribute=cold
5953 Warn about functions that might be candidates for @code{cold} attribute.  This
5954 is based on static detection and generally will only warn about functions which
5955 always leads to a call to another @code{cold} function such as wrappers of
5956 C++ @code{throw} or fatal error reporting functions leading to @code{abort}.
5957 @end table
5959 @item -Wsuggest-final-types
5960 @opindex Wno-suggest-final-types
5961 @opindex Wsuggest-final-types
5962 Warn about types with virtual methods where code quality would be improved
5963 if the type were declared with the C++11 @code{final} specifier, 
5964 or, if possible,
5965 declared in an anonymous namespace. This allows GCC to more aggressively
5966 devirtualize the polymorphic calls. This warning is more effective with link
5967 time optimization, where the information about the class hierarchy graph is
5968 more complete.
5970 @item -Wsuggest-final-methods
5971 @opindex Wno-suggest-final-methods
5972 @opindex Wsuggest-final-methods
5973 Warn about virtual methods where code quality would be improved if the method
5974 were declared with the C++11 @code{final} specifier, 
5975 or, if possible, its type were
5976 declared in an anonymous namespace or with the @code{final} specifier.
5977 This warning is
5978 more effective with link-time optimization, where the information about the
5979 class hierarchy graph is more complete. It is recommended to first consider
5980 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
5981 annotations.
5983 @item -Wsuggest-override
5984 Warn about overriding virtual functions that are not marked with the override
5985 keyword.
5987 @item -Walloc-zero
5988 @opindex Wno-alloc-zero
5989 @opindex Walloc-zero
5990 Warn about calls to allocation functions decorated with attribute
5991 @code{alloc_size} that specify zero bytes, including those to the built-in
5992 forms of the functions @code{aligned_alloc}, @code{alloca}, @code{calloc},
5993 @code{malloc}, and @code{realloc}.  Because the behavior of these functions
5994 when called with a zero size differs among implementations (and in the case
5995 of @code{realloc} has been deprecated) relying on it may result in subtle
5996 portability bugs and should be avoided.
5998 @item -Walloc-size-larger-than=@var{byte-size}
5999 @opindex Walloc-size-larger-than=
6000 @opindex Wno-alloc-size-larger-than
6001 Warn about calls to functions decorated with attribute @code{alloc_size}
6002 that attempt to allocate objects larger than the specified number of bytes,
6003 or where the result of the size computation in an integer type with infinite
6004 precision would exceed the value of @samp{PTRDIFF_MAX} on the target.
6005 @option{-Walloc-size-larger-than=}@samp{PTRDIFF_MAX} is enabled by default.
6006 Warnings controlled by the option can be disabled either by specifying
6007 @var{byte-size} of @samp{SIZE_MAX} or more or by
6008 @option{-Wno-alloc-size-larger-than}.
6009 @xref{Function Attributes}.
6011 @item -Wno-alloc-size-larger-than
6012 @opindex Wno-alloc-size-larger-than
6013 Disable @option{-Walloc-size-larger-than=} warnings.  The option is
6014 equivalent to @option{-Walloc-size-larger-than=}@samp{SIZE_MAX} or
6015 larger.
6017 @item -Walloca
6018 @opindex Wno-alloca
6019 @opindex Walloca
6020 This option warns on all uses of @code{alloca} in the source.
6022 @item -Walloca-larger-than=@var{byte-size}
6023 @opindex Walloca-larger-than=
6024 @opindex Wno-alloca-larger-than
6025 This option warns on calls to @code{alloca} with an integer argument whose
6026 value is either zero, or that is not bounded by a controlling predicate
6027 that limits its value to at most @var{byte-size}.  It also warns for calls
6028 to @code{alloca} where the bound value is unknown.  Arguments of non-integer
6029 types are considered unbounded even if they appear to be constrained to
6030 the expected range.
6032 For example, a bounded case of @code{alloca} could be:
6034 @smallexample
6035 void func (size_t n)
6037   void *p;
6038   if (n <= 1000)
6039     p = alloca (n);
6040   else
6041     p = malloc (n);
6042   f (p);
6044 @end smallexample
6046 In the above example, passing @code{-Walloca-larger-than=1000} would not
6047 issue a warning because the call to @code{alloca} is known to be at most
6048 1000 bytes.  However, if @code{-Walloca-larger-than=500} were passed,
6049 the compiler would emit a warning.
6051 Unbounded uses, on the other hand, are uses of @code{alloca} with no
6052 controlling predicate constraining its integer argument.  For example:
6054 @smallexample
6055 void func ()
6057   void *p = alloca (n);
6058   f (p);
6060 @end smallexample
6062 If @code{-Walloca-larger-than=500} were passed, the above would trigger
6063 a warning, but this time because of the lack of bounds checking.
6065 Note, that even seemingly correct code involving signed integers could
6066 cause a warning:
6068 @smallexample
6069 void func (signed int n)
6071   if (n < 500)
6072     @{
6073       p = alloca (n);
6074       f (p);
6075     @}
6077 @end smallexample
6079 In the above example, @var{n} could be negative, causing a larger than
6080 expected argument to be implicitly cast into the @code{alloca} call.
6082 This option also warns when @code{alloca} is used in a loop.
6084 @option{-Walloca-larger-than=}@samp{PTRDIFF_MAX} is enabled by default
6085 but is usually only effective  when @option{-ftree-vrp} is active (default
6086 for @option{-O2} and above).
6088 See also @option{-Wvla-larger-than=}@samp{byte-size}.
6090 @item -Wno-alloca-larger-than
6091 @opindex Wno-alloca-larger-than
6092 Disable @option{-Walloca-larger-than=} warnings.  The option is
6093 equivalent to @option{-Walloca-larger-than=}@samp{SIZE_MAX} or larger.
6095 @item -Warray-bounds
6096 @itemx -Warray-bounds=@var{n}
6097 @opindex Wno-array-bounds
6098 @opindex Warray-bounds
6099 This option is only active when @option{-ftree-vrp} is active
6100 (default for @option{-O2} and above). It warns about subscripts to arrays
6101 that are always out of bounds. This warning is enabled by @option{-Wall}.
6103 @table @gcctabopt
6104 @item -Warray-bounds=1
6105 This is the warning level of @option{-Warray-bounds} and is enabled
6106 by @option{-Wall}; higher levels are not, and must be explicitly requested.
6108 @item -Warray-bounds=2
6109 This warning level also warns about out of bounds access for
6110 arrays at the end of a struct and for arrays accessed through
6111 pointers. This warning level may give a larger number of
6112 false positives and is deactivated by default.
6113 @end table
6115 @item -Wattribute-alias=@var{n}
6116 @itemx -Wno-attribute-alias
6117 @opindex -Wattribute-alias
6118 @opindex -Wno-attribute-alias
6119 Warn about declarations using the @code{alias} and similar attributes whose
6120 target is incompatible with the type of the alias.
6121 @xref{Function Attributes,,Declaring Attributes of Functions}.
6123 @table @gcctabopt
6124 @item -Wattribute-alias=1
6125 The default warning level of the @option{-Wattribute-alias} option diagnoses
6126 incompatibilities between the type of the alias declaration and that of its
6127 target.  Such incompatibilities are typically indicative of bugs.
6129 @item -Wattribute-alias=2
6131 At this level @option{-Wattribute-alias} also diagnoses cases where
6132 the attributes of the alias declaration are more restrictive than the
6133 attributes applied to its target.  These mismatches can potentially
6134 result in incorrect code generation.  In other cases they may be
6135 benign and could be resolved simply by adding the missing attribute to
6136 the target.  For comparison, see the @option{-Wmissing-attributes}
6137 option, which controls diagnostics when the alias declaration is less
6138 restrictive than the target, rather than more restrictive.
6140 Attributes considered include @code{alloc_align}, @code{alloc_size},
6141 @code{cold}, @code{const}, @code{hot}, @code{leaf}, @code{malloc},
6142 @code{nonnull}, @code{noreturn}, @code{nothrow}, @code{pure},
6143 @code{returns_nonnull}, and @code{returns_twice}.
6144 @end table
6146 @option{-Wattribute-alias} is equivalent to @option{-Wattribute-alias=1}.
6147 This is the default.  You can disable these warnings with either
6148 @option{-Wno-attribute-alias} or @option{-Wattribute-alias=0}.
6150 @item -Wbool-compare
6151 @opindex Wno-bool-compare
6152 @opindex Wbool-compare
6153 Warn about boolean expression compared with an integer value different from
6154 @code{true}/@code{false}.  For instance, the following comparison is
6155 always false:
6156 @smallexample
6157 int n = 5;
6158 @dots{}
6159 if ((n > 1) == 2) @{ @dots{} @}
6160 @end smallexample
6161 This warning is enabled by @option{-Wall}.
6163 @item -Wbool-operation
6164 @opindex Wno-bool-operation
6165 @opindex Wbool-operation
6166 Warn about suspicious operations on expressions of a boolean type.  For
6167 instance, bitwise negation of a boolean is very likely a bug in the program.
6168 For C, this warning also warns about incrementing or decrementing a boolean,
6169 which rarely makes sense.  (In C++, decrementing a boolean is always invalid.
6170 Incrementing a boolean is invalid in C++17, and deprecated otherwise.)
6172 This warning is enabled by @option{-Wall}.
6174 @item -Wduplicated-branches
6175 @opindex Wno-duplicated-branches
6176 @opindex Wduplicated-branches
6177 Warn when an if-else has identical branches.  This warning detects cases like
6178 @smallexample
6179 if (p != NULL)
6180   return 0;
6181 else
6182   return 0;
6183 @end smallexample
6184 It doesn't warn when both branches contain just a null statement.  This warning
6185 also warn for conditional operators:
6186 @smallexample
6187   int i = x ? *p : *p;
6188 @end smallexample
6190 @item -Wduplicated-cond
6191 @opindex Wno-duplicated-cond
6192 @opindex Wduplicated-cond
6193 Warn about duplicated conditions in an if-else-if chain.  For instance,
6194 warn for the following code:
6195 @smallexample
6196 if (p->q != NULL) @{ @dots{} @}
6197 else if (p->q != NULL) @{ @dots{} @}
6198 @end smallexample
6200 @item -Wframe-address
6201 @opindex Wno-frame-address
6202 @opindex Wframe-address
6203 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
6204 is called with an argument greater than 0.  Such calls may return indeterminate
6205 values or crash the program.  The warning is included in @option{-Wall}.
6207 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
6208 @opindex Wno-discarded-qualifiers
6209 @opindex Wdiscarded-qualifiers
6210 Do not warn if type qualifiers on pointers are being discarded.
6211 Typically, the compiler warns if a @code{const char *} variable is
6212 passed to a function that takes a @code{char *} parameter.  This option
6213 can be used to suppress such a warning.
6215 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
6216 @opindex Wno-discarded-array-qualifiers
6217 @opindex Wdiscarded-array-qualifiers
6218 Do not warn if type qualifiers on arrays which are pointer targets
6219 are being discarded. Typically, the compiler warns if a
6220 @code{const int (*)[]} variable is passed to a function that
6221 takes a @code{int (*)[]} parameter.  This option can be used to
6222 suppress such a warning.
6224 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
6225 @opindex Wno-incompatible-pointer-types
6226 @opindex Wincompatible-pointer-types
6227 Do not warn when there is a conversion between pointers that have incompatible
6228 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
6229 which warns for pointer argument passing or assignment with different
6230 signedness.
6232 @item -Wno-int-conversion @r{(C and Objective-C only)}
6233 @opindex Wno-int-conversion
6234 @opindex Wint-conversion
6235 Do not warn about incompatible integer to pointer and pointer to integer
6236 conversions.  This warning is about implicit conversions; for explicit
6237 conversions the warnings @option{-Wno-int-to-pointer-cast} and
6238 @option{-Wno-pointer-to-int-cast} may be used.
6240 @item -Wno-div-by-zero
6241 @opindex Wno-div-by-zero
6242 @opindex Wdiv-by-zero
6243 Do not warn about compile-time integer division by zero.  Floating-point
6244 division by zero is not warned about, as it can be a legitimate way of
6245 obtaining infinities and NaNs.
6247 @item -Wsystem-headers
6248 @opindex Wsystem-headers
6249 @opindex Wno-system-headers
6250 @cindex warnings from system headers
6251 @cindex system headers, warnings from
6252 Print warning messages for constructs found in system header files.
6253 Warnings from system headers are normally suppressed, on the assumption
6254 that they usually do not indicate real problems and would only make the
6255 compiler output harder to read.  Using this command-line option tells
6256 GCC to emit warnings from system headers as if they occurred in user
6257 code.  However, note that using @option{-Wall} in conjunction with this
6258 option does @emph{not} warn about unknown pragmas in system
6259 headers---for that, @option{-Wunknown-pragmas} must also be used.
6261 @item -Wtautological-compare
6262 @opindex Wtautological-compare
6263 @opindex Wno-tautological-compare
6264 Warn if a self-comparison always evaluates to true or false.  This
6265 warning detects various mistakes such as:
6266 @smallexample
6267 int i = 1;
6268 @dots{}
6269 if (i > i) @{ @dots{} @}
6270 @end smallexample
6272 This warning also warns about bitwise comparisons that always evaluate
6273 to true or false, for instance:
6274 @smallexample
6275 if ((a & 16) == 10) @{ @dots{} @}
6276 @end smallexample
6277 will always be false.
6279 This warning is enabled by @option{-Wall}.
6281 @item -Wtrampolines
6282 @opindex Wtrampolines
6283 @opindex Wno-trampolines
6284 Warn about trampolines generated for pointers to nested functions.
6285 A trampoline is a small piece of data or code that is created at run
6286 time on the stack when the address of a nested function is taken, and is
6287 used to call the nested function indirectly.  For some targets, it is
6288 made up of data only and thus requires no special treatment.  But, for
6289 most targets, it is made up of code and thus requires the stack to be
6290 made executable in order for the program to work properly.
6292 @item -Wfloat-equal
6293 @opindex Wfloat-equal
6294 @opindex Wno-float-equal
6295 Warn if floating-point values are used in equality comparisons.
6297 The idea behind this is that sometimes it is convenient (for the
6298 programmer) to consider floating-point values as approximations to
6299 infinitely precise real numbers.  If you are doing this, then you need
6300 to compute (by analyzing the code, or in some other way) the maximum or
6301 likely maximum error that the computation introduces, and allow for it
6302 when performing comparisons (and when producing output, but that's a
6303 different problem).  In particular, instead of testing for equality, you
6304 should check to see whether the two values have ranges that overlap; and
6305 this is done with the relational operators, so equality comparisons are
6306 probably mistaken.
6308 @item -Wtraditional @r{(C and Objective-C only)}
6309 @opindex Wtraditional
6310 @opindex Wno-traditional
6311 Warn about certain constructs that behave differently in traditional and
6312 ISO C@.  Also warn about ISO C constructs that have no traditional C
6313 equivalent, and/or problematic constructs that should be avoided.
6315 @itemize @bullet
6316 @item
6317 Macro parameters that appear within string literals in the macro body.
6318 In traditional C macro replacement takes place within string literals,
6319 but in ISO C it does not.
6321 @item
6322 In traditional C, some preprocessor directives did not exist.
6323 Traditional preprocessors only considered a line to be a directive
6324 if the @samp{#} appeared in column 1 on the line.  Therefore
6325 @option{-Wtraditional} warns about directives that traditional C
6326 understands but ignores because the @samp{#} does not appear as the
6327 first character on the line.  It also suggests you hide directives like
6328 @code{#pragma} not understood by traditional C by indenting them.  Some
6329 traditional implementations do not recognize @code{#elif}, so this option
6330 suggests avoiding it altogether.
6332 @item
6333 A function-like macro that appears without arguments.
6335 @item
6336 The unary plus operator.
6338 @item
6339 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
6340 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
6341 constants.)  Note, these suffixes appear in macros defined in the system
6342 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
6343 Use of these macros in user code might normally lead to spurious
6344 warnings, however GCC's integrated preprocessor has enough context to
6345 avoid warning in these cases.
6347 @item
6348 A function declared external in one block and then used after the end of
6349 the block.
6351 @item
6352 A @code{switch} statement has an operand of type @code{long}.
6354 @item
6355 A non-@code{static} function declaration follows a @code{static} one.
6356 This construct is not accepted by some traditional C compilers.
6358 @item
6359 The ISO type of an integer constant has a different width or
6360 signedness from its traditional type.  This warning is only issued if
6361 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
6362 typically represent bit patterns, are not warned about.
6364 @item
6365 Usage of ISO string concatenation is detected.
6367 @item
6368 Initialization of automatic aggregates.
6370 @item
6371 Identifier conflicts with labels.  Traditional C lacks a separate
6372 namespace for labels.
6374 @item
6375 Initialization of unions.  If the initializer is zero, the warning is
6376 omitted.  This is done under the assumption that the zero initializer in
6377 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
6378 initializer warnings and relies on default initialization to zero in the
6379 traditional C case.
6381 @item
6382 Conversions by prototypes between fixed/floating-point values and vice
6383 versa.  The absence of these prototypes when compiling with traditional
6384 C causes serious problems.  This is a subset of the possible
6385 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
6387 @item
6388 Use of ISO C style function definitions.  This warning intentionally is
6389 @emph{not} issued for prototype declarations or variadic functions
6390 because these ISO C features appear in your code when using
6391 libiberty's traditional C compatibility macros, @code{PARAMS} and
6392 @code{VPARAMS}.  This warning is also bypassed for nested functions
6393 because that feature is already a GCC extension and thus not relevant to
6394 traditional C compatibility.
6395 @end itemize
6397 @item -Wtraditional-conversion @r{(C and Objective-C only)}
6398 @opindex Wtraditional-conversion
6399 @opindex Wno-traditional-conversion
6400 Warn if a prototype causes a type conversion that is different from what
6401 would happen to the same argument in the absence of a prototype.  This
6402 includes conversions of fixed point to floating and vice versa, and
6403 conversions changing the width or signedness of a fixed-point argument
6404 except when the same as the default promotion.
6406 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
6407 @opindex Wdeclaration-after-statement
6408 @opindex Wno-declaration-after-statement
6409 Warn when a declaration is found after a statement in a block.  This
6410 construct, known from C++, was introduced with ISO C99 and is by default
6411 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
6413 @item -Wshadow
6414 @opindex Wshadow
6415 @opindex Wno-shadow
6416 Warn whenever a local variable or type declaration shadows another
6417 variable, parameter, type, class member (in C++), or instance variable
6418 (in Objective-C) or whenever a built-in function is shadowed. Note
6419 that in C++, the compiler warns if a local variable shadows an
6420 explicit typedef, but not if it shadows a struct/class/enum.
6421 Same as @option{-Wshadow=global}.
6423 @item -Wno-shadow-ivar @r{(Objective-C only)}
6424 @opindex Wno-shadow-ivar
6425 @opindex Wshadow-ivar
6426 Do not warn whenever a local variable shadows an instance variable in an
6427 Objective-C method.
6429 @item -Wshadow=global
6430 @opindex Wshadow=local
6431 The default for @option{-Wshadow}. Warns for any (global) shadowing.
6433 @item -Wshadow=local
6434 @opindex Wshadow=local
6435 Warn when a local variable shadows another local variable or parameter.
6436 This warning is enabled by @option{-Wshadow=global}.
6438 @item -Wshadow=compatible-local
6439 @opindex Wshadow=compatible-local
6440 Warn when a local variable shadows another local variable or parameter
6441 whose type is compatible with that of the shadowing variable. In C++,
6442 type compatibility here means the type of the shadowing variable can be
6443 converted to that of the shadowed variable. The creation of this flag
6444 (in addition to @option{-Wshadow=local}) is based on the idea that when
6445 a local variable shadows another one of incompatible type, it is most
6446 likely intentional, not a bug or typo, as shown in the following example:
6448 @smallexample
6449 @group
6450 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
6452   for (int i = 0; i < N; ++i)
6453   @{
6454     ...
6455   @}
6456   ...
6458 @end group
6459 @end smallexample
6461 Since the two variable @code{i} in the example above have incompatible types,
6462 enabling only @option{-Wshadow=compatible-local} will not emit a warning.
6463 Because their types are incompatible, if a programmer accidentally uses one
6464 in place of the other, type checking will catch that and emit an error or
6465 warning. So not warning (about shadowing) in this case will not lead to
6466 undetected bugs. Use of this flag instead of @option{-Wshadow=local} can
6467 possibly reduce the number of warnings triggered by intentional shadowing.
6469 This warning is enabled by @option{-Wshadow=local}.
6471 @item -Wlarger-than=@var{byte-size}
6472 @opindex Wlarger-than=
6473 @opindex Wlarger-than-@var{byte-size}
6474 Warn whenever an object is defined whose size exceeds @var{byte-size}.
6475 @option{-Wlarger-than=}@samp{PTRDIFF_MAX} is enabled by default.
6476 Warnings controlled by the option can be disabled either by specifying
6477 @var{byte-size} of @samp{SIZE_MAX} or more or by
6478 @option{-Wno-larger-than}.
6480 @item -Wno-larger-than
6481 @opindex Wno-larger-than
6482 Disable @option{-Wlarger-than=} warnings.  The option is equivalent
6483 to @option{-Wlarger-than=}@samp{SIZE_MAX} or larger.
6485 @item -Wframe-larger-than=@var{byte-size}
6486 @opindex Wframe-larger-than=
6487 @opindex Wno-frame-larger-than
6488 Warn if the size of a function frame exceeds @var{byte-size}.
6489 The computation done to determine the stack frame size is approximate
6490 and not conservative.
6491 The actual requirements may be somewhat greater than @var{byte-size}
6492 even if you do not get a warning.  In addition, any space allocated
6493 via @code{alloca}, variable-length arrays, or related constructs
6494 is not included by the compiler when determining
6495 whether or not to issue a warning.
6496 @option{-Wframe-larger-than=}@samp{PTRDIFF_MAX} is enabled by default.
6497 Warnings controlled by the option can be disabled either by specifying
6498 @var{byte-size} of @samp{SIZE_MAX} or more or by
6499 @option{-Wno-frame-larger-than}.
6501 @item -Wno-frame-larger-than
6502 @opindex Wno-frame-larger-than
6503 Disable @option{-Wframe-larger-than=} warnings.  The option is equivalent
6504 to @option{-Wframe-larger-than=}@samp{SIZE_MAX} or larger.
6506 @item -Wno-free-nonheap-object
6507 @opindex Wno-free-nonheap-object
6508 @opindex Wfree-nonheap-object
6509 Do not warn when attempting to free an object that was not allocated
6510 on the heap.
6512 @item -Wstack-usage=@var{byte-size}
6513 @opindex Wstack-usage
6514 @opindex Wno-stack-usage
6515 Warn if the stack usage of a function might exceed @var{byte-size}.
6516 The computation done to determine the stack usage is conservative.
6517 Any space allocated via @code{alloca}, variable-length arrays, or related
6518 constructs is included by the compiler when determining whether or not to
6519 issue a warning.
6521 The message is in keeping with the output of @option{-fstack-usage}.
6523 @itemize
6524 @item
6525 If the stack usage is fully static but exceeds the specified amount, it's:
6527 @smallexample
6528   warning: stack usage is 1120 bytes
6529 @end smallexample
6530 @item
6531 If the stack usage is (partly) dynamic but bounded, it's:
6533 @smallexample
6534   warning: stack usage might be 1648 bytes
6535 @end smallexample
6536 @item
6537 If the stack usage is (partly) dynamic and not bounded, it's:
6539 @smallexample
6540   warning: stack usage might be unbounded
6541 @end smallexample
6542 @end itemize
6544 @option{-Wstack-usage=}@samp{PTRDIFF_MAX} is enabled by default.
6545 Warnings controlled by the option can be disabled either by specifying
6546 @var{byte-size} of @samp{SIZE_MAX} or more or by
6547 @option{-Wno-stack-usage}.
6549 @item -Wno-stack-usage
6550 @opindex Wno-stack-usage
6551 Disable @option{-Wstack-usage=} warnings.  The option is equivalent
6552 to @option{-Wstack-usage=}@samp{SIZE_MAX} or larger.
6554 @item -Wunsafe-loop-optimizations
6555 @opindex Wunsafe-loop-optimizations
6556 @opindex Wno-unsafe-loop-optimizations
6557 Warn if the loop cannot be optimized because the compiler cannot
6558 assume anything on the bounds of the loop indices.  With
6559 @option{-funsafe-loop-optimizations} warn if the compiler makes
6560 such assumptions.
6562 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
6563 @opindex Wno-pedantic-ms-format
6564 @opindex Wpedantic-ms-format
6565 When used in combination with @option{-Wformat}
6566 and @option{-pedantic} without GNU extensions, this option
6567 disables the warnings about non-ISO @code{printf} / @code{scanf} format
6568 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
6569 which depend on the MS runtime.
6571 @item -Waligned-new
6572 @opindex Waligned-new
6573 @opindex Wno-aligned-new
6574 Warn about a new-expression of a type that requires greater alignment
6575 than the @code{alignof(std::max_align_t)} but uses an allocation
6576 function without an explicit alignment parameter. This option is
6577 enabled by @option{-Wall}.
6579 Normally this only warns about global allocation functions, but
6580 @option{-Waligned-new=all} also warns about class member allocation
6581 functions.
6583 @item -Wplacement-new
6584 @itemx -Wplacement-new=@var{n}
6585 @opindex Wplacement-new
6586 @opindex Wno-placement-new
6587 Warn about placement new expressions with undefined behavior, such as
6588 constructing an object in a buffer that is smaller than the type of
6589 the object.  For example, the placement new expression below is diagnosed
6590 because it attempts to construct an array of 64 integers in a buffer only
6591 64 bytes large.
6592 @smallexample
6593 char buf [64];
6594 new (buf) int[64];
6595 @end smallexample
6596 This warning is enabled by default.
6598 @table @gcctabopt
6599 @item -Wplacement-new=1
6600 This is the default warning level of @option{-Wplacement-new}.  At this
6601 level the warning is not issued for some strictly undefined constructs that
6602 GCC allows as extensions for compatibility with legacy code.  For example,
6603 the following @code{new} expression is not diagnosed at this level even
6604 though it has undefined behavior according to the C++ standard because
6605 it writes past the end of the one-element array.
6606 @smallexample
6607 struct S @{ int n, a[1]; @};
6608 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
6609 new (s->a)int [32]();
6610 @end smallexample
6612 @item -Wplacement-new=2
6613 At this level, in addition to diagnosing all the same constructs as at level
6614 1, a diagnostic is also issued for placement new expressions that construct
6615 an object in the last member of structure whose type is an array of a single
6616 element and whose size is less than the size of the object being constructed.
6617 While the previous example would be diagnosed, the following construct makes
6618 use of the flexible member array extension to avoid the warning at level 2.
6619 @smallexample
6620 struct S @{ int n, a[]; @};
6621 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
6622 new (s->a)int [32]();
6623 @end smallexample
6625 @end table
6627 @item -Wpointer-arith
6628 @opindex Wpointer-arith
6629 @opindex Wno-pointer-arith
6630 Warn about anything that depends on the ``size of'' a function type or
6631 of @code{void}.  GNU C assigns these types a size of 1, for
6632 convenience in calculations with @code{void *} pointers and pointers
6633 to functions.  In C++, warn also when an arithmetic operation involves
6634 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
6636 @item -Wpointer-compare
6637 @opindex Wpointer-compare
6638 @opindex Wno-pointer-compare
6639 Warn if a pointer is compared with a zero character constant.  This usually
6640 means that the pointer was meant to be dereferenced.  For example:
6642 @smallexample
6643 const char *p = foo ();
6644 if (p == '\0')
6645   return 42;
6646 @end smallexample
6648 Note that the code above is invalid in C++11.
6650 This warning is enabled by default.
6652 @item -Wtype-limits
6653 @opindex Wtype-limits
6654 @opindex Wno-type-limits
6655 Warn if a comparison is always true or always false due to the limited
6656 range of the data type, but do not warn for constant expressions.  For
6657 example, warn if an unsigned variable is compared against zero with
6658 @code{<} or @code{>=}.  This warning is also enabled by
6659 @option{-Wextra}.
6661 @item -Wabsolute-value @r{(C and Objective-C only)}
6662 @opindex Wabsolute-value
6663 @opindex Wno-absolute-value
6664 Warn for calls to standard functions that compute the absolute value
6665 of an argument when a more appropriate standard function is available.
6666 For example, calling @code{abs(3.14)} triggers the warning because the
6667 appropriate function to call to compute the absolute value of a double
6668 argument is @code{fabs}.  The option also triggers warnings when the
6669 argument in a call to such a function has an unsigned type.  This
6670 warning can be suppressed with an explicit type cast and it is also
6671 enabled by @option{-Wextra}.
6673 @include cppwarnopts.texi
6675 @item -Wbad-function-cast @r{(C and Objective-C only)}
6676 @opindex Wbad-function-cast
6677 @opindex Wno-bad-function-cast
6678 Warn when a function call is cast to a non-matching type.
6679 For example, warn if a call to a function returning an integer type 
6680 is cast to a pointer type.
6682 @item -Wc90-c99-compat @r{(C and Objective-C only)}
6683 @opindex Wc90-c99-compat
6684 @opindex Wno-c90-c99-compat
6685 Warn about features not present in ISO C90, but present in ISO C99.
6686 For instance, warn about use of variable length arrays, @code{long long}
6687 type, @code{bool} type, compound literals, designated initializers, and so
6688 on.  This option is independent of the standards mode.  Warnings are disabled
6689 in the expression that follows @code{__extension__}.
6691 @item -Wc99-c11-compat @r{(C and Objective-C only)}
6692 @opindex Wc99-c11-compat
6693 @opindex Wno-c99-c11-compat
6694 Warn about features not present in ISO C99, but present in ISO C11.
6695 For instance, warn about use of anonymous structures and unions,
6696 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
6697 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
6698 and so on.  This option is independent of the standards mode.  Warnings are
6699 disabled in the expression that follows @code{__extension__}.
6701 @item -Wc++-compat @r{(C and Objective-C only)}
6702 @opindex Wc++-compat
6703 @opindex Wno-c++-compat
6704 Warn about ISO C constructs that are outside of the common subset of
6705 ISO C and ISO C++, e.g.@: request for implicit conversion from
6706 @code{void *} to a pointer to non-@code{void} type.
6708 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
6709 @opindex Wc++11-compat
6710 @opindex Wno-c++11-compat
6711 Warn about C++ constructs whose meaning differs between ISO C++ 1998
6712 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
6713 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
6714 enabled by @option{-Wall}.
6716 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
6717 @opindex Wc++14-compat
6718 @opindex Wno-c++14-compat
6719 Warn about C++ constructs whose meaning differs between ISO C++ 2011
6720 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
6722 @item -Wc++17-compat @r{(C++ and Objective-C++ only)}
6723 @opindex Wc++17-compat
6724 @opindex Wno-c++17-compat
6725 Warn about C++ constructs whose meaning differs between ISO C++ 2014
6726 and ISO C++ 2017.  This warning is enabled by @option{-Wall}.
6728 @item -Wcast-qual
6729 @opindex Wcast-qual
6730 @opindex Wno-cast-qual
6731 Warn whenever a pointer is cast so as to remove a type qualifier from
6732 the target type.  For example, warn if a @code{const char *} is cast
6733 to an ordinary @code{char *}.
6735 Also warn when making a cast that introduces a type qualifier in an
6736 unsafe way.  For example, casting @code{char **} to @code{const char **}
6737 is unsafe, as in this example:
6739 @smallexample
6740   /* p is char ** value.  */
6741   const char **q = (const char **) p;
6742   /* Assignment of readonly string to const char * is OK.  */
6743   *q = "string";
6744   /* Now char** pointer points to read-only memory.  */
6745   **p = 'b';
6746 @end smallexample
6748 @item -Wcast-align
6749 @opindex Wcast-align
6750 @opindex Wno-cast-align
6751 Warn whenever a pointer is cast such that the required alignment of the
6752 target is increased.  For example, warn if a @code{char *} is cast to
6753 an @code{int *} on machines where integers can only be accessed at
6754 two- or four-byte boundaries.
6756 @item -Wcast-align=strict
6757 @opindex Wcast-align=strict
6758 Warn whenever a pointer is cast such that the required alignment of the
6759 target is increased.  For example, warn if a @code{char *} is cast to
6760 an @code{int *} regardless of the target machine.
6762 @item -Wcast-function-type
6763 @opindex Wcast-function-type
6764 @opindex Wno-cast-function-type
6765 Warn when a function pointer is cast to an incompatible function pointer.
6766 In a cast involving function types with a variable argument list only
6767 the types of initial arguments that are provided are considered.
6768 Any parameter of pointer-type matches any other pointer-type.  Any benign
6769 differences in integral types are ignored, like @code{int} vs.@: @code{long}
6770 on ILP32 targets.  Likewise type qualifiers are ignored.  The function
6771 type @code{void (*) (void)} is special and matches everything, which can
6772 be used to suppress this warning.
6773 In a cast involving pointer to member types this warning warns whenever
6774 the type cast is changing the pointer to member type.
6775 This warning is enabled by @option{-Wextra}.
6777 @item -Wwrite-strings
6778 @opindex Wwrite-strings
6779 @opindex Wno-write-strings
6780 When compiling C, give string constants the type @code{const
6781 char[@var{length}]} so that copying the address of one into a
6782 non-@code{const} @code{char *} pointer produces a warning.  These
6783 warnings help you find at compile time code that can try to write
6784 into a string constant, but only if you have been very careful about
6785 using @code{const} in declarations and prototypes.  Otherwise, it is
6786 just a nuisance. This is why we did not make @option{-Wall} request
6787 these warnings.
6789 When compiling C++, warn about the deprecated conversion from string
6790 literals to @code{char *}.  This warning is enabled by default for C++
6791 programs.
6793 @item -Wcatch-value
6794 @itemx -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)}
6795 @opindex Wcatch-value
6796 @opindex Wno-catch-value
6797 Warn about catch handlers that do not catch via reference.
6798 With @option{-Wcatch-value=1} (or @option{-Wcatch-value} for short)
6799 warn about polymorphic class types that are caught by value.
6800 With @option{-Wcatch-value=2} warn about all class types that are caught
6801 by value. With @option{-Wcatch-value=3} warn about all types that are
6802 not caught by reference. @option{-Wcatch-value} is enabled by @option{-Wall}.
6804 @item -Wclobbered
6805 @opindex Wclobbered
6806 @opindex Wno-clobbered
6807 Warn for variables that might be changed by @code{longjmp} or
6808 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
6810 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
6811 @opindex Wconditionally-supported
6812 @opindex Wno-conditionally-supported
6813 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
6815 @item -Wconversion
6816 @opindex Wconversion
6817 @opindex Wno-conversion
6818 Warn for implicit conversions that may alter a value. This includes
6819 conversions between real and integer, like @code{abs (x)} when
6820 @code{x} is @code{double}; conversions between signed and unsigned,
6821 like @code{unsigned ui = -1}; and conversions to smaller types, like
6822 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
6823 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
6824 changed by the conversion like in @code{abs (2.0)}.  Warnings about
6825 conversions between signed and unsigned integers can be disabled by
6826 using @option{-Wno-sign-conversion}.
6828 For C++, also warn for confusing overload resolution for user-defined
6829 conversions; and conversions that never use a type conversion
6830 operator: conversions to @code{void}, the same type, a base class or a
6831 reference to them. Warnings about conversions between signed and
6832 unsigned integers are disabled by default in C++ unless
6833 @option{-Wsign-conversion} is explicitly enabled.
6835 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
6836 @opindex Wconversion-null
6837 @opindex Wno-conversion-null
6838 Do not warn for conversions between @code{NULL} and non-pointer
6839 types. @option{-Wconversion-null} is enabled by default.
6841 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
6842 @opindex Wzero-as-null-pointer-constant
6843 @opindex Wno-zero-as-null-pointer-constant
6844 Warn when a literal @samp{0} is used as null pointer constant.  This can
6845 be useful to facilitate the conversion to @code{nullptr} in C++11.
6847 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
6848 @opindex Wsubobject-linkage
6849 @opindex Wno-subobject-linkage
6850 Warn if a class type has a base or a field whose type uses the anonymous
6851 namespace or depends on a type with no linkage.  If a type A depends on
6852 a type B with no or internal linkage, defining it in multiple
6853 translation units would be an ODR violation because the meaning of B
6854 is different in each translation unit.  If A only appears in a single
6855 translation unit, the best way to silence the warning is to give it
6856 internal linkage by putting it in an anonymous namespace as well.  The
6857 compiler doesn't give this warning for types defined in the main .C
6858 file, as those are unlikely to have multiple definitions.
6859 @option{-Wsubobject-linkage} is enabled by default.
6861 @item -Wdangling-else
6862 @opindex Wdangling-else
6863 @opindex Wno-dangling-else
6864 Warn about constructions where there may be confusion to which
6865 @code{if} statement an @code{else} branch belongs.  Here is an example of
6866 such a case:
6868 @smallexample
6869 @group
6871   if (a)
6872     if (b)
6873       foo ();
6874   else
6875     bar ();
6877 @end group
6878 @end smallexample
6880 In C/C++, every @code{else} branch belongs to the innermost possible
6881 @code{if} statement, which in this example is @code{if (b)}.  This is
6882 often not what the programmer expected, as illustrated in the above
6883 example by indentation the programmer chose.  When there is the
6884 potential for this confusion, GCC issues a warning when this flag
6885 is specified.  To eliminate the warning, add explicit braces around
6886 the innermost @code{if} statement so there is no way the @code{else}
6887 can belong to the enclosing @code{if}.  The resulting code
6888 looks like this:
6890 @smallexample
6891 @group
6893   if (a)
6894     @{
6895       if (b)
6896         foo ();
6897       else
6898         bar ();
6899     @}
6901 @end group
6902 @end smallexample
6904 This warning is enabled by @option{-Wparentheses}.
6906 @item -Wdate-time
6907 @opindex Wdate-time
6908 @opindex Wno-date-time
6909 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
6910 are encountered as they might prevent bit-wise-identical reproducible
6911 compilations.
6913 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
6914 @opindex Wdelete-incomplete
6915 @opindex Wno-delete-incomplete
6916 Warn when deleting a pointer to incomplete type, which may cause
6917 undefined behavior at runtime.  This warning is enabled by default.
6919 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
6920 @opindex Wuseless-cast
6921 @opindex Wno-useless-cast
6922 Warn when an expression is casted to its own type.
6924 @item -Wempty-body
6925 @opindex Wempty-body
6926 @opindex Wno-empty-body
6927 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
6928 while} statement.  This warning is also enabled by @option{-Wextra}.
6930 @item -Wenum-compare
6931 @opindex Wenum-compare
6932 @opindex Wno-enum-compare
6933 Warn about a comparison between values of different enumerated types.
6934 In C++ enumerated type mismatches in conditional expressions are also
6935 diagnosed and the warning is enabled by default.  In C this warning is 
6936 enabled by @option{-Wall}.
6938 @item -Wextra-semi @r{(C++, Objective-C++ only)}
6939 @opindex Wextra-semi
6940 @opindex Wno-extra-semi
6941 Warn about redundant semicolon after in-class function definition.
6943 @item -Wjump-misses-init @r{(C, Objective-C only)}
6944 @opindex Wjump-misses-init
6945 @opindex Wno-jump-misses-init
6946 Warn if a @code{goto} statement or a @code{switch} statement jumps
6947 forward across the initialization of a variable, or jumps backward to a
6948 label after the variable has been initialized.  This only warns about
6949 variables that are initialized when they are declared.  This warning is
6950 only supported for C and Objective-C; in C++ this sort of branch is an
6951 error in any case.
6953 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
6954 can be disabled with the @option{-Wno-jump-misses-init} option.
6956 @item -Wsign-compare
6957 @opindex Wsign-compare
6958 @opindex Wno-sign-compare
6959 @cindex warning for comparison of signed and unsigned values
6960 @cindex comparison of signed and unsigned values, warning
6961 @cindex signed and unsigned values, comparison warning
6962 Warn when a comparison between signed and unsigned values could produce
6963 an incorrect result when the signed value is converted to unsigned.
6964 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
6965 also enabled by @option{-Wextra}.
6967 @item -Wsign-conversion
6968 @opindex Wsign-conversion
6969 @opindex Wno-sign-conversion
6970 Warn for implicit conversions that may change the sign of an integer
6971 value, like assigning a signed integer expression to an unsigned
6972 integer variable. An explicit cast silences the warning. In C, this
6973 option is enabled also by @option{-Wconversion}.
6975 @item -Wfloat-conversion
6976 @opindex Wfloat-conversion
6977 @opindex Wno-float-conversion
6978 Warn for implicit conversions that reduce the precision of a real value.
6979 This includes conversions from real to integer, and from higher precision
6980 real to lower precision real values.  This option is also enabled by
6981 @option{-Wconversion}.
6983 @item -Wno-scalar-storage-order
6984 @opindex Wno-scalar-storage-order
6985 @opindex Wscalar-storage-order
6986 Do not warn on suspicious constructs involving reverse scalar storage order.
6988 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
6989 @opindex Wsized-deallocation
6990 @opindex Wno-sized-deallocation
6991 Warn about a definition of an unsized deallocation function
6992 @smallexample
6993 void operator delete (void *) noexcept;
6994 void operator delete[] (void *) noexcept;
6995 @end smallexample
6996 without a definition of the corresponding sized deallocation function
6997 @smallexample
6998 void operator delete (void *, std::size_t) noexcept;
6999 void operator delete[] (void *, std::size_t) noexcept;
7000 @end smallexample
7001 or vice versa.  Enabled by @option{-Wextra} along with
7002 @option{-fsized-deallocation}.
7004 @item -Wsizeof-pointer-div
7005 @opindex Wsizeof-pointer-div
7006 @opindex Wno-sizeof-pointer-div
7007 Warn for suspicious divisions of two sizeof expressions that divide
7008 the pointer size by the element size, which is the usual way to compute
7009 the array size but won't work out correctly with pointers.  This warning
7010 warns e.g.@: about @code{sizeof (ptr) / sizeof (ptr[0])} if @code{ptr} is
7011 not an array, but a pointer.  This warning is enabled by @option{-Wall}.
7013 @item -Wsizeof-pointer-memaccess
7014 @opindex Wsizeof-pointer-memaccess
7015 @opindex Wno-sizeof-pointer-memaccess
7016 Warn for suspicious length parameters to certain string and memory built-in
7017 functions if the argument uses @code{sizeof}.  This warning triggers for
7018 example for @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not
7019 an array, but a pointer, and suggests a possible fix, or about
7020 @code{memcpy (&foo, ptr, sizeof (&foo));}.  @option{-Wsizeof-pointer-memaccess}
7021 also warns about calls to bounded string copy functions like @code{strncat}
7022 or @code{strncpy} that specify as the bound a @code{sizeof} expression of
7023 the source array.  For example, in the following function the call to
7024 @code{strncat} specifies the size of the source string as the bound.  That
7025 is almost certainly a mistake and so the call is diagnosed.
7026 @smallexample
7027 void make_file (const char *name)
7029   char path[PATH_MAX];
7030   strncpy (path, name, sizeof path - 1);
7031   strncat (path, ".text", sizeof ".text");
7032   @dots{}
7034 @end smallexample
7036 The @option{-Wsizeof-pointer-memaccess} option is enabled by @option{-Wall}.
7038 @item -Wsizeof-array-argument
7039 @opindex Wsizeof-array-argument
7040 @opindex Wno-sizeof-array-argument
7041 Warn when the @code{sizeof} operator is applied to a parameter that is
7042 declared as an array in a function definition.  This warning is enabled by
7043 default for C and C++ programs.
7045 @item -Wmemset-elt-size
7046 @opindex Wmemset-elt-size
7047 @opindex Wno-memset-elt-size
7048 Warn for suspicious calls to the @code{memset} built-in function, if the
7049 first argument references an array, and the third argument is a number
7050 equal to the number of elements, but not equal to the size of the array
7051 in memory.  This indicates that the user has omitted a multiplication by
7052 the element size.  This warning is enabled by @option{-Wall}.
7054 @item -Wmemset-transposed-args
7055 @opindex Wmemset-transposed-args
7056 @opindex Wno-memset-transposed-args
7057 Warn for suspicious calls to the @code{memset} built-in function where
7058 the second argument is not zero and the third argument is zero.  For
7059 example, the call @code{memset (buf, sizeof buf, 0)} is diagnosed because
7060 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostic
7061 is only emitted if the third argument is a literal zero.  Otherwise, if
7062 it is an expression that is folded to zero, or a cast of zero to some
7063 type, it is far less likely that the arguments have been mistakenly
7064 transposed and no warning is emitted.  This warning is enabled
7065 by @option{-Wall}.
7067 @item -Waddress
7068 @opindex Waddress
7069 @opindex Wno-address
7070 Warn about suspicious uses of memory addresses. These include using
7071 the address of a function in a conditional expression, such as
7072 @code{void func(void); if (func)}, and comparisons against the memory
7073 address of a string literal, such as @code{if (x == "abc")}.  Such
7074 uses typically indicate a programmer error: the address of a function
7075 always evaluates to true, so their use in a conditional usually
7076 indicate that the programmer forgot the parentheses in a function
7077 call; and comparisons against string literals result in unspecified
7078 behavior and are not portable in C, so they usually indicate that the
7079 programmer intended to use @code{strcmp}.  This warning is enabled by
7080 @option{-Wall}.
7082 @item -Waddress-of-packed-member
7083 @opindex Waddress-of-packed-member
7084 @opindex Wno-address-of-packed-member
7085 Warn when the address of packed member of struct or union is taken,
7086 which usually results in an unaligned pointer value.  This is
7087 enabled by default.
7089 @item -Wlogical-op
7090 @opindex Wlogical-op
7091 @opindex Wno-logical-op
7092 Warn about suspicious uses of logical operators in expressions.
7093 This includes using logical operators in contexts where a
7094 bit-wise operator is likely to be expected.  Also warns when
7095 the operands of a logical operator are the same:
7096 @smallexample
7097 extern int a;
7098 if (a < 0 && a < 0) @{ @dots{} @}
7099 @end smallexample
7101 @item -Wlogical-not-parentheses
7102 @opindex Wlogical-not-parentheses
7103 @opindex Wno-logical-not-parentheses
7104 Warn about logical not used on the left hand side operand of a comparison.
7105 This option does not warn if the right operand is considered to be a boolean
7106 expression.  Its purpose is to detect suspicious code like the following:
7107 @smallexample
7108 int a;
7109 @dots{}
7110 if (!a > 1) @{ @dots{} @}
7111 @end smallexample
7113 It is possible to suppress the warning by wrapping the LHS into
7114 parentheses:
7115 @smallexample
7116 if ((!a) > 1) @{ @dots{} @}
7117 @end smallexample
7119 This warning is enabled by @option{-Wall}.
7121 @item -Waggregate-return
7122 @opindex Waggregate-return
7123 @opindex Wno-aggregate-return
7124 Warn if any functions that return structures or unions are defined or
7125 called.  (In languages where you can return an array, this also elicits
7126 a warning.)
7128 @item -Wno-aggressive-loop-optimizations
7129 @opindex Wno-aggressive-loop-optimizations
7130 @opindex Waggressive-loop-optimizations
7131 Warn if in a loop with constant number of iterations the compiler detects
7132 undefined behavior in some statement during one or more of the iterations.
7134 @item -Wno-attributes
7135 @opindex Wno-attributes
7136 @opindex Wattributes
7137 Do not warn if an unexpected @code{__attribute__} is used, such as
7138 unrecognized attributes, function attributes applied to variables,
7139 etc.  This does not stop errors for incorrect use of supported
7140 attributes.
7142 @item -Wno-builtin-declaration-mismatch
7143 @opindex Wno-builtin-declaration-mismatch
7144 @opindex Wbuiltin-declaration-mismatch
7145 Warn if a built-in function is declared with an incompatible signature
7146 or as a non-function, or when a built-in function declared with a type
7147 that does not include a prototype is called with arguments whose promoted
7148 types do not match those expected by the function.  When @option{-Wextra}
7149 is specified, also warn when a built-in function that takes arguments is
7150 declared without a prototype.  The @option{-Wno-builtin-declaration-mismatch}
7151 warning is enabled by default.  To avoid the warning include the appropriate
7152 header to bring the prototypes of built-in functions into scope.
7154 For example, the call to @code{memset} below is diagnosed by the warning
7155 because the function expects a value of type @code{size_t} as its argument
7156 but the type of @code{32} is @code{int}.  With @option{-Wextra},
7157 the declaration of the function is diagnosed as well.
7158 @smallexample
7159 extern void* memset ();
7160 void f (void *d)
7162   memset (d, '\0', 32);
7164 @end smallexample
7166 @item -Wno-builtin-macro-redefined
7167 @opindex Wno-builtin-macro-redefined
7168 @opindex Wbuiltin-macro-redefined
7169 Do not warn if certain built-in macros are redefined.  This suppresses
7170 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
7171 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
7173 @item -Wstrict-prototypes @r{(C and Objective-C only)}
7174 @opindex Wstrict-prototypes
7175 @opindex Wno-strict-prototypes
7176 Warn if a function is declared or defined without specifying the
7177 argument types.  (An old-style function definition is permitted without
7178 a warning if preceded by a declaration that specifies the argument
7179 types.)
7181 @item -Wold-style-declaration @r{(C and Objective-C only)}
7182 @opindex Wold-style-declaration
7183 @opindex Wno-old-style-declaration
7184 Warn for obsolescent usages, according to the C Standard, in a
7185 declaration. For example, warn if storage-class specifiers like
7186 @code{static} are not the first things in a declaration.  This warning
7187 is also enabled by @option{-Wextra}.
7189 @item -Wold-style-definition @r{(C and Objective-C only)}
7190 @opindex Wold-style-definition
7191 @opindex Wno-old-style-definition
7192 Warn if an old-style function definition is used.  A warning is given
7193 even if there is a previous prototype.
7195 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
7196 @opindex Wmissing-parameter-type
7197 @opindex Wno-missing-parameter-type
7198 A function parameter is declared without a type specifier in K&R-style
7199 functions:
7201 @smallexample
7202 void foo(bar) @{ @}
7203 @end smallexample
7205 This warning is also enabled by @option{-Wextra}.
7207 @item -Wmissing-prototypes @r{(C and Objective-C only)}
7208 @opindex Wmissing-prototypes
7209 @opindex Wno-missing-prototypes
7210 Warn if a global function is defined without a previous prototype
7211 declaration.  This warning is issued even if the definition itself
7212 provides a prototype.  Use this option to detect global functions
7213 that do not have a matching prototype declaration in a header file.
7214 This option is not valid for C++ because all function declarations
7215 provide prototypes and a non-matching declaration declares an
7216 overload rather than conflict with an earlier declaration.
7217 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
7219 @item -Wmissing-declarations
7220 @opindex Wmissing-declarations
7221 @opindex Wno-missing-declarations
7222 Warn if a global function is defined without a previous declaration.
7223 Do so even if the definition itself provides a prototype.
7224 Use this option to detect global functions that are not declared in
7225 header files.  In C, no warnings are issued for functions with previous
7226 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
7227 missing prototypes.  In C++, no warnings are issued for function templates,
7228 or for inline functions, or for functions in anonymous namespaces.
7230 @item -Wmissing-field-initializers
7231 @opindex Wmissing-field-initializers
7232 @opindex Wno-missing-field-initializers
7233 @opindex W
7234 @opindex Wextra
7235 @opindex Wno-extra
7236 Warn if a structure's initializer has some fields missing.  For
7237 example, the following code causes such a warning, because
7238 @code{x.h} is implicitly zero:
7240 @smallexample
7241 struct s @{ int f, g, h; @};
7242 struct s x = @{ 3, 4 @};
7243 @end smallexample
7245 This option does not warn about designated initializers, so the following
7246 modification does not trigger a warning:
7248 @smallexample
7249 struct s @{ int f, g, h; @};
7250 struct s x = @{ .f = 3, .g = 4 @};
7251 @end smallexample
7253 In C this option does not warn about the universal zero initializer
7254 @samp{@{ 0 @}}:
7256 @smallexample
7257 struct s @{ int f, g, h; @};
7258 struct s x = @{ 0 @};
7259 @end smallexample
7261 Likewise, in C++ this option does not warn about the empty @{ @}
7262 initializer, for example:
7264 @smallexample
7265 struct s @{ int f, g, h; @};
7266 s x = @{ @};
7267 @end smallexample
7269 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
7270 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
7272 @item -Wno-multichar
7273 @opindex Wno-multichar
7274 @opindex Wmultichar
7275 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
7276 Usually they indicate a typo in the user's code, as they have
7277 implementation-defined values, and should not be used in portable code.
7279 @item -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]}
7280 @opindex Wnormalized=
7281 @opindex Wnormalized
7282 @opindex Wno-normalized
7283 @cindex NFC
7284 @cindex NFKC
7285 @cindex character set, input normalization
7286 In ISO C and ISO C++, two identifiers are different if they are
7287 different sequences of characters.  However, sometimes when characters
7288 outside the basic ASCII character set are used, you can have two
7289 different character sequences that look the same.  To avoid confusion,
7290 the ISO 10646 standard sets out some @dfn{normalization rules} which
7291 when applied ensure that two sequences that look the same are turned into
7292 the same sequence.  GCC can warn you if you are using identifiers that
7293 have not been normalized; this option controls that warning.
7295 There are four levels of warning supported by GCC@.  The default is
7296 @option{-Wnormalized=nfc}, which warns about any identifier that is
7297 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
7298 recommended form for most uses.  It is equivalent to
7299 @option{-Wnormalized}.
7301 Unfortunately, there are some characters allowed in identifiers by
7302 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
7303 identifiers.  That is, there's no way to use these symbols in portable
7304 ISO C or C++ and have all your identifiers in NFC@.
7305 @option{-Wnormalized=id} suppresses the warning for these characters.
7306 It is hoped that future versions of the standards involved will correct
7307 this, which is why this option is not the default.
7309 You can switch the warning off for all characters by writing
7310 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
7311 only do this if you are using some other normalization scheme (like
7312 ``D''), because otherwise you can easily create bugs that are
7313 literally impossible to see.
7315 Some characters in ISO 10646 have distinct meanings but look identical
7316 in some fonts or display methodologies, especially once formatting has
7317 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
7318 LETTER N'', displays just like a regular @code{n} that has been
7319 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
7320 normalization scheme to convert all these into a standard form as
7321 well, and GCC warns if your code is not in NFKC if you use
7322 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
7323 about every identifier that contains the letter O because it might be
7324 confused with the digit 0, and so is not the default, but may be
7325 useful as a local coding convention if the programming environment 
7326 cannot be fixed to display these characters distinctly.
7328 @item -Wno-attribute-warning
7329 @opindex Wno-attribute-warning
7330 @opindex Wattribute-warning
7331 Do not warn about usage of functions (@pxref{Function Attributes})
7332 declared with @code{warning} attribute.  By default, this warning is
7333 enabled.  @option{-Wno-attribute-warning} can be used to disable the
7334 warning or @option{-Wno-error=attribute-warning} can be used to
7335 disable the error when compiled with @option{-Werror} flag.
7337 @item -Wno-deprecated
7338 @opindex Wno-deprecated
7339 @opindex Wdeprecated
7340 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
7342 @item -Wno-deprecated-declarations
7343 @opindex Wno-deprecated-declarations
7344 @opindex Wdeprecated-declarations
7345 Do not warn about uses of functions (@pxref{Function Attributes}),
7346 variables (@pxref{Variable Attributes}), and types (@pxref{Type
7347 Attributes}) marked as deprecated by using the @code{deprecated}
7348 attribute.
7350 @item -Wno-overflow
7351 @opindex Wno-overflow
7352 @opindex Woverflow
7353 Do not warn about compile-time overflow in constant expressions.
7355 @item -Wno-odr
7356 @opindex Wno-odr
7357 @opindex Wodr
7358 Warn about One Definition Rule violations during link-time optimization.
7359 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
7361 @item -Wopenmp-simd
7362 @opindex Wopenmp-simd
7363 @opindex Wno-openmp-simd
7364 Warn if the vectorizer cost model overrides the OpenMP
7365 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
7366 option can be used to relax the cost model.
7368 @item -Woverride-init @r{(C and Objective-C only)}
7369 @opindex Woverride-init
7370 @opindex Wno-override-init
7371 @opindex W
7372 @opindex Wextra
7373 @opindex Wno-extra
7374 Warn if an initialized field without side effects is overridden when
7375 using designated initializers (@pxref{Designated Inits, , Designated
7376 Initializers}).
7378 This warning is included in @option{-Wextra}.  To get other
7379 @option{-Wextra} warnings without this one, use @option{-Wextra
7380 -Wno-override-init}.
7382 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
7383 @opindex Woverride-init-side-effects
7384 @opindex Wno-override-init-side-effects
7385 Warn if an initialized field with side effects is overridden when
7386 using designated initializers (@pxref{Designated Inits, , Designated
7387 Initializers}).  This warning is enabled by default.
7389 @item -Wpacked
7390 @opindex Wpacked
7391 @opindex Wno-packed
7392 Warn if a structure is given the packed attribute, but the packed
7393 attribute has no effect on the layout or size of the structure.
7394 Such structures may be mis-aligned for little benefit.  For
7395 instance, in this code, the variable @code{f.x} in @code{struct bar}
7396 is misaligned even though @code{struct bar} does not itself
7397 have the packed attribute:
7399 @smallexample
7400 @group
7401 struct foo @{
7402   int x;
7403   char a, b, c, d;
7404 @} __attribute__((packed));
7405 struct bar @{
7406   char z;
7407   struct foo f;
7409 @end group
7410 @end smallexample
7412 @item -Wpacked-bitfield-compat
7413 @opindex Wpacked-bitfield-compat
7414 @opindex Wno-packed-bitfield-compat
7415 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
7416 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
7417 the change can lead to differences in the structure layout.  GCC
7418 informs you when the offset of such a field has changed in GCC 4.4.
7419 For example there is no longer a 4-bit padding between field @code{a}
7420 and @code{b} in this structure:
7422 @smallexample
7423 struct foo
7425   char a:4;
7426   char b:8;
7427 @} __attribute__ ((packed));
7428 @end smallexample
7430 This warning is enabled by default.  Use
7431 @option{-Wno-packed-bitfield-compat} to disable this warning.
7433 @item -Wpacked-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
7434 @opindex Wpacked-not-aligned
7435 @opindex Wno-packed-not-aligned
7436 Warn if a structure field with explicitly specified alignment in a
7437 packed struct or union is misaligned.  For example, a warning will
7438 be issued on @code{struct S}, like, @code{warning: alignment 1 of
7439 'struct S' is less than 8}, in this code:
7441 @smallexample
7442 @group
7443 struct __attribute__ ((aligned (8))) S8 @{ char a[8]; @};
7444 struct __attribute__ ((packed)) S @{
7445   struct S8 s8;
7447 @end group
7448 @end smallexample
7450 This warning is enabled by @option{-Wall}.
7452 @item -Wpadded
7453 @opindex Wpadded
7454 @opindex Wno-padded
7455 Warn if padding is included in a structure, either to align an element
7456 of the structure or to align the whole structure.  Sometimes when this
7457 happens it is possible to rearrange the fields of the structure to
7458 reduce the padding and so make the structure smaller.
7460 @item -Wredundant-decls
7461 @opindex Wredundant-decls
7462 @opindex Wno-redundant-decls
7463 Warn if anything is declared more than once in the same scope, even in
7464 cases where multiple declaration is valid and changes nothing.
7466 @item -Wno-restrict
7467 @opindex Wrestrict
7468 @opindex Wno-restrict
7469 Warn when an object referenced by a @code{restrict}-qualified parameter
7470 (or, in C++, a @code{__restrict}-qualified parameter) is aliased by another
7471 argument, or when copies between such objects overlap.  For example,
7472 the call to the @code{strcpy} function below attempts to truncate the string
7473 by replacing its initial characters with the last four.  However, because
7474 the call writes the terminating NUL into @code{a[4]}, the copies overlap and
7475 the call is diagnosed.
7477 @smallexample
7478 void foo (void)
7480   char a[] = "abcd1234";
7481   strcpy (a, a + 4);
7482   @dots{}
7484 @end smallexample
7485 The @option{-Wrestrict} option detects some instances of simple overlap
7486 even without optimization but works best at @option{-O2} and above.  It
7487 is included in @option{-Wall}.
7489 @item -Wnested-externs @r{(C and Objective-C only)}
7490 @opindex Wnested-externs
7491 @opindex Wno-nested-externs
7492 Warn if an @code{extern} declaration is encountered within a function.
7494 @item -Wno-inherited-variadic-ctor
7495 @opindex Winherited-variadic-ctor
7496 @opindex Wno-inherited-variadic-ctor
7497 Suppress warnings about use of C++11 inheriting constructors when the
7498 base class inherited from has a C variadic constructor; the warning is
7499 on by default because the ellipsis is not inherited.
7501 @item -Winline
7502 @opindex Winline
7503 @opindex Wno-inline
7504 Warn if a function that is declared as inline cannot be inlined.
7505 Even with this option, the compiler does not warn about failures to
7506 inline functions declared in system headers.
7508 The compiler uses a variety of heuristics to determine whether or not
7509 to inline a function.  For example, the compiler takes into account
7510 the size of the function being inlined and the amount of inlining
7511 that has already been done in the current function.  Therefore,
7512 seemingly insignificant changes in the source program can cause the
7513 warnings produced by @option{-Winline} to appear or disappear.
7515 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
7516 @opindex Wno-invalid-offsetof
7517 @opindex Winvalid-offsetof
7518 Suppress warnings from applying the @code{offsetof} macro to a non-POD
7519 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
7520 to a non-standard-layout type is undefined.  In existing C++ implementations,
7521 however, @code{offsetof} typically gives meaningful results.
7522 This flag is for users who are aware that they are
7523 writing nonportable code and who have deliberately chosen to ignore the
7524 warning about it.
7526 The restrictions on @code{offsetof} may be relaxed in a future version
7527 of the C++ standard.
7529 @item -Wint-in-bool-context
7530 @opindex Wint-in-bool-context
7531 @opindex Wno-int-in-bool-context
7532 Warn for suspicious use of integer values where boolean values are expected,
7533 such as conditional expressions (?:) using non-boolean integer constants in
7534 boolean context, like @code{if (a <= b ? 2 : 3)}.  Or left shifting of signed
7535 integers in boolean context, like @code{for (a = 0; 1 << a; a++);}.  Likewise
7536 for all kinds of multiplications regardless of the data type.
7537 This warning is enabled by @option{-Wall}.
7539 @item -Wno-int-to-pointer-cast
7540 @opindex Wno-int-to-pointer-cast
7541 @opindex Wint-to-pointer-cast
7542 Suppress warnings from casts to pointer type of an integer of a
7543 different size. In C++, casting to a pointer type of smaller size is
7544 an error. @option{Wint-to-pointer-cast} is enabled by default.
7547 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
7548 @opindex Wno-pointer-to-int-cast
7549 @opindex Wpointer-to-int-cast
7550 Suppress warnings from casts from a pointer to an integer type of a
7551 different size.
7553 @item -Winvalid-pch
7554 @opindex Winvalid-pch
7555 @opindex Wno-invalid-pch
7556 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
7557 the search path but cannot be used.
7559 @item -Wlong-long
7560 @opindex Wlong-long
7561 @opindex Wno-long-long
7562 Warn if @code{long long} type is used.  This is enabled by either
7563 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
7564 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
7566 @item -Wvariadic-macros
7567 @opindex Wvariadic-macros
7568 @opindex Wno-variadic-macros
7569 Warn if variadic macros are used in ISO C90 mode, or if the GNU
7570 alternate syntax is used in ISO C99 mode.  This is enabled by either
7571 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
7572 messages, use @option{-Wno-variadic-macros}.
7574 @item -Wvarargs
7575 @opindex Wvarargs
7576 @opindex Wno-varargs
7577 Warn upon questionable usage of the macros used to handle variable
7578 arguments like @code{va_start}.  This is default.  To inhibit the
7579 warning messages, use @option{-Wno-varargs}.
7581 @item -Wvector-operation-performance
7582 @opindex Wvector-operation-performance
7583 @opindex Wno-vector-operation-performance
7584 Warn if vector operation is not implemented via SIMD capabilities of the
7585 architecture.  Mainly useful for the performance tuning.
7586 Vector operation can be implemented @code{piecewise}, which means that the
7587 scalar operation is performed on every vector element; 
7588 @code{in parallel}, which means that the vector operation is implemented
7589 using scalars of wider type, which normally is more performance efficient;
7590 and @code{as a single scalar}, which means that vector fits into a
7591 scalar type.
7593 @item -Wno-virtual-move-assign
7594 @opindex Wvirtual-move-assign
7595 @opindex Wno-virtual-move-assign
7596 Suppress warnings about inheriting from a virtual base with a
7597 non-trivial C++11 move assignment operator.  This is dangerous because
7598 if the virtual base is reachable along more than one path, it is
7599 moved multiple times, which can mean both objects end up in the
7600 moved-from state.  If the move assignment operator is written to avoid
7601 moving from a moved-from object, this warning can be disabled.
7603 @item -Wvla
7604 @opindex Wvla
7605 @opindex Wno-vla
7606 Warn if a variable-length array is used in the code.
7607 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
7608 the variable-length array.
7610 @item -Wvla-larger-than=@var{byte-size}
7611 @opindex Wvla-larger-than=
7612 @opindex Wno-vla-larger-than
7613 If this option is used, the compiler will warn for declarations of
7614 variable-length arrays whose size is either unbounded, or bounded
7615 by an argument that allows the array size to exceed @var{byte-size}
7616 bytes.  This is similar to how @option{-Walloca-larger-than=}@var{byte-size}
7617 works, but with variable-length arrays.
7619 Note that GCC may optimize small variable-length arrays of a known
7620 value into plain arrays, so this warning may not get triggered for
7621 such arrays.
7623 @option{-Wvla-larger-than=}@samp{PTRDIFF_MAX} is enabled by default but
7624 is typically only effective when @option{-ftree-vrp} is active (default
7625 for @option{-O2} and above).
7627 See also @option{-Walloca-larger-than=@var{byte-size}}.
7629 @item -Wno-vla-larger-than
7630 @opindex Wno-vla-larger-than
7631 Disable @option{-Wvla-larger-than=} warnings.  The option is equivalent
7632 to @option{-Wvla-larger-than=}@samp{SIZE_MAX} or larger.
7634 @item -Wvolatile-register-var
7635 @opindex Wvolatile-register-var
7636 @opindex Wno-volatile-register-var
7637 Warn if a register variable is declared volatile.  The volatile
7638 modifier does not inhibit all optimizations that may eliminate reads
7639 and/or writes to register variables.  This warning is enabled by
7640 @option{-Wall}.
7642 @item -Wdisabled-optimization
7643 @opindex Wdisabled-optimization
7644 @opindex Wno-disabled-optimization
7645 Warn if a requested optimization pass is disabled.  This warning does
7646 not generally indicate that there is anything wrong with your code; it
7647 merely indicates that GCC's optimizers are unable to handle the code
7648 effectively.  Often, the problem is that your code is too big or too
7649 complex; GCC refuses to optimize programs when the optimization
7650 itself is likely to take inordinate amounts of time.
7652 @item -Wpointer-sign @r{(C and Objective-C only)}
7653 @opindex Wpointer-sign
7654 @opindex Wno-pointer-sign
7655 Warn for pointer argument passing or assignment with different signedness.
7656 This option is only supported for C and Objective-C@.  It is implied by
7657 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
7658 @option{-Wno-pointer-sign}.
7660 @item -Wstack-protector
7661 @opindex Wstack-protector
7662 @opindex Wno-stack-protector
7663 This option is only active when @option{-fstack-protector} is active.  It
7664 warns about functions that are not protected against stack smashing.
7666 @item -Woverlength-strings
7667 @opindex Woverlength-strings
7668 @opindex Wno-overlength-strings
7669 Warn about string constants that are longer than the ``minimum
7670 maximum'' length specified in the C standard.  Modern compilers
7671 generally allow string constants that are much longer than the
7672 standard's minimum limit, but very portable programs should avoid
7673 using longer strings.
7675 The limit applies @emph{after} string constant concatenation, and does
7676 not count the trailing NUL@.  In C90, the limit was 509 characters; in
7677 C99, it was raised to 4095.  C++98 does not specify a normative
7678 minimum maximum, so we do not diagnose overlength strings in C++@.
7680 This option is implied by @option{-Wpedantic}, and can be disabled with
7681 @option{-Wno-overlength-strings}.
7683 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
7684 @opindex Wunsuffixed-float-constants
7685 @opindex Wno-unsuffixed-float-constants
7687 Issue a warning for any floating constant that does not have
7688 a suffix.  When used together with @option{-Wsystem-headers} it
7689 warns about such constants in system header files.  This can be useful
7690 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
7691 from the decimal floating-point extension to C99.
7693 @item -Wno-designated-init @r{(C and Objective-C only)}
7694 Suppress warnings when a positional initializer is used to initialize
7695 a structure that has been marked with the @code{designated_init}
7696 attribute.
7698 @item -Whsa
7699 Issue a warning when HSAIL cannot be emitted for the compiled function or
7700 OpenMP construct.
7702 @end table
7704 @node Debugging Options
7705 @section Options for Debugging Your Program
7706 @cindex options, debugging
7707 @cindex debugging information options
7709 To tell GCC to emit extra information for use by a debugger, in almost 
7710 all cases you need only to add @option{-g} to your other options.
7712 GCC allows you to use @option{-g} with
7713 @option{-O}.  The shortcuts taken by optimized code may occasionally
7714 be surprising: some variables you declared may not exist
7715 at all; flow of control may briefly move where you did not expect it;
7716 some statements may not be executed because they compute constant
7717 results or their values are already at hand; some statements may
7718 execute in different places because they have been moved out of loops.
7719 Nevertheless it is possible to debug optimized output.  This makes
7720 it reasonable to use the optimizer for programs that might have bugs.
7722 If you are not using some other optimization option, consider
7723 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
7724 With no @option{-O} option at all, some compiler passes that collect
7725 information useful for debugging do not run at all, so that
7726 @option{-Og} may result in a better debugging experience.
7728 @table @gcctabopt
7729 @item -g
7730 @opindex g
7731 Produce debugging information in the operating system's native format
7732 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
7733 information.
7735 On most systems that use stabs format, @option{-g} enables use of extra
7736 debugging information that only GDB can use; this extra information
7737 makes debugging work better in GDB but probably makes other debuggers
7738 crash or
7739 refuse to read the program.  If you want to control for certain whether
7740 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
7741 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
7743 @item -ggdb
7744 @opindex ggdb
7745 Produce debugging information for use by GDB@.  This means to use the
7746 most expressive format available (DWARF, stabs, or the native format
7747 if neither of those are supported), including GDB extensions if at all
7748 possible.
7750 @item -gdwarf
7751 @itemx -gdwarf-@var{version}
7752 @opindex gdwarf
7753 Produce debugging information in DWARF format (if that is supported).
7754 The value of @var{version} may be either 2, 3, 4 or 5; the default version
7755 for most targets is 4.  DWARF Version 5 is only experimental.
7757 Note that with DWARF Version 2, some ports require and always
7758 use some non-conflicting DWARF 3 extensions in the unwind tables.
7760 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
7761 for maximum benefit.
7763 GCC no longer supports DWARF Version 1, which is substantially
7764 different than Version 2 and later.  For historical reasons, some
7765 other DWARF-related options such as
7766 @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
7767 in their names, but apply to all currently-supported versions of DWARF.
7769 @item -gstabs
7770 @opindex gstabs
7771 Produce debugging information in stabs format (if that is supported),
7772 without GDB extensions.  This is the format used by DBX on most BSD
7773 systems.  On MIPS, Alpha and System V Release 4 systems this option
7774 produces stabs debugging output that is not understood by DBX@.
7775 On System V Release 4 systems this option requires the GNU assembler.
7777 @item -gstabs+
7778 @opindex gstabs+
7779 Produce debugging information in stabs format (if that is supported),
7780 using GNU extensions understood only by the GNU debugger (GDB)@.  The
7781 use of these extensions is likely to make other debuggers crash or
7782 refuse to read the program.
7784 @item -gxcoff
7785 @opindex gxcoff
7786 Produce debugging information in XCOFF format (if that is supported).
7787 This is the format used by the DBX debugger on IBM RS/6000 systems.
7789 @item -gxcoff+
7790 @opindex gxcoff+
7791 Produce debugging information in XCOFF format (if that is supported),
7792 using GNU extensions understood only by the GNU debugger (GDB)@.  The
7793 use of these extensions is likely to make other debuggers crash or
7794 refuse to read the program, and may cause assemblers other than the GNU
7795 assembler (GAS) to fail with an error.
7797 @item -gvms
7798 @opindex gvms
7799 Produce debugging information in Alpha/VMS debug format (if that is
7800 supported).  This is the format used by DEBUG on Alpha/VMS systems.
7802 @item -g@var{level}
7803 @itemx -ggdb@var{level}
7804 @itemx -gstabs@var{level}
7805 @itemx -gxcoff@var{level}
7806 @itemx -gvms@var{level}
7807 Request debugging information and also use @var{level} to specify how
7808 much information.  The default level is 2.
7810 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
7811 @option{-g}.
7813 Level 1 produces minimal information, enough for making backtraces in
7814 parts of the program that you don't plan to debug.  This includes
7815 descriptions of functions and external variables, and line number
7816 tables, but no information about local variables.
7818 Level 3 includes extra information, such as all the macro definitions
7819 present in the program.  Some debuggers support macro expansion when
7820 you use @option{-g3}.
7822 If you use multiple @option{-g} options, with or without level numbers,
7823 the last such option is the one that is effective.
7825 @option{-gdwarf} does not accept a concatenated debug level, to avoid
7826 confusion with @option{-gdwarf-@var{level}}.
7827 Instead use an additional @option{-g@var{level}} option to change the
7828 debug level for DWARF.
7830 @item -feliminate-unused-debug-symbols
7831 @opindex feliminate-unused-debug-symbols
7832 Produce debugging information in stabs format (if that is supported),
7833 for only symbols that are actually used.
7835 @item -femit-class-debug-always
7836 @opindex femit-class-debug-always
7837 Instead of emitting debugging information for a C++ class in only one
7838 object file, emit it in all object files using the class.  This option
7839 should be used only with debuggers that are unable to handle the way GCC
7840 normally emits debugging information for classes because using this
7841 option increases the size of debugging information by as much as a
7842 factor of two.
7844 @item -fno-merge-debug-strings
7845 @opindex fmerge-debug-strings
7846 @opindex fno-merge-debug-strings
7847 Direct the linker to not merge together strings in the debugging
7848 information that are identical in different object files.  Merging is
7849 not supported by all assemblers or linkers.  Merging decreases the size
7850 of the debug information in the output file at the cost of increasing
7851 link processing time.  Merging is enabled by default.
7853 @item -fdebug-prefix-map=@var{old}=@var{new}
7854 @opindex fdebug-prefix-map
7855 When compiling files residing in directory @file{@var{old}}, record
7856 debugging information describing them as if the files resided in
7857 directory @file{@var{new}} instead.  This can be used to replace a
7858 build-time path with an install-time path in the debug info.  It can
7859 also be used to change an absolute path to a relative path by using
7860 @file{.} for @var{new}.  This can give more reproducible builds, which
7861 are location independent, but may require an extra command to tell GDB
7862 where to find the source files. See also @option{-ffile-prefix-map}.
7864 @item -fvar-tracking
7865 @opindex fvar-tracking
7866 Run variable tracking pass.  It computes where variables are stored at each
7867 position in code.  Better debugging information is then generated
7868 (if the debugging information format supports this information).
7870 It is enabled by default when compiling with optimization (@option{-Os},
7871 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
7872 the debug info format supports it.
7874 @item -fvar-tracking-assignments
7875 @opindex fvar-tracking-assignments
7876 @opindex fno-var-tracking-assignments
7877 Annotate assignments to user variables early in the compilation and
7878 attempt to carry the annotations over throughout the compilation all the
7879 way to the end, in an attempt to improve debug information while
7880 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
7882 It can be enabled even if var-tracking is disabled, in which case
7883 annotations are created and maintained, but discarded at the end.
7884 By default, this flag is enabled together with @option{-fvar-tracking},
7885 except when selective scheduling is enabled.
7887 @item -gsplit-dwarf
7888 @opindex gsplit-dwarf
7889 Separate as much DWARF debugging information as possible into a
7890 separate output file with the extension @file{.dwo}.  This option allows
7891 the build system to avoid linking files with debug information.  To
7892 be useful, this option requires a debugger capable of reading @file{.dwo}
7893 files.
7895 @item -gdescribe-dies
7896 @opindex gdescribe-dies
7897 Add description attributes to some DWARF DIEs that have no name attribute,
7898 such as artificial variables, external references and call site
7899 parameter DIEs.
7901 @item -gpubnames
7902 @opindex gpubnames
7903 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
7905 @item -ggnu-pubnames
7906 @opindex ggnu-pubnames
7907 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
7908 suitable for conversion into a GDB@ index.  This option is only useful
7909 with a linker that can produce GDB@ index version 7.
7911 @item -fdebug-types-section
7912 @opindex fdebug-types-section
7913 @opindex fno-debug-types-section
7914 When using DWARF Version 4 or higher, type DIEs can be put into
7915 their own @code{.debug_types} section instead of making them part of the
7916 @code{.debug_info} section.  It is more efficient to put them in a separate
7917 comdat section since the linker can then remove duplicates.
7918 But not all DWARF consumers support @code{.debug_types} sections yet
7919 and on some objects @code{.debug_types} produces larger instead of smaller
7920 debugging information.
7922 @item -grecord-gcc-switches
7923 @itemx -gno-record-gcc-switches
7924 @opindex grecord-gcc-switches
7925 @opindex gno-record-gcc-switches
7926 This switch causes the command-line options used to invoke the
7927 compiler that may affect code generation to be appended to the
7928 DW_AT_producer attribute in DWARF debugging information.  The options
7929 are concatenated with spaces separating them from each other and from
7930 the compiler version.  
7931 It is enabled by default.
7932 See also @option{-frecord-gcc-switches} for another
7933 way of storing compiler options into the object file.  
7935 @item -gstrict-dwarf
7936 @opindex gstrict-dwarf
7937 Disallow using extensions of later DWARF standard version than selected
7938 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
7939 DWARF extensions from later standard versions is allowed.
7941 @item -gno-strict-dwarf
7942 @opindex gno-strict-dwarf
7943 Allow using extensions of later DWARF standard version than selected with
7944 @option{-gdwarf-@var{version}}.
7946 @item -gas-loc-support
7947 @opindex gas-loc-support
7948 Inform the compiler that the assembler supports @code{.loc} directives.
7949 It may then use them for the assembler to generate DWARF2+ line number
7950 tables.
7952 This is generally desirable, because assembler-generated line-number
7953 tables are a lot more compact than those the compiler can generate
7954 itself.
7956 This option will be enabled by default if, at GCC configure time, the
7957 assembler was found to support such directives.
7959 @item -gno-as-loc-support
7960 @opindex gno-as-loc-support
7961 Force GCC to generate DWARF2+ line number tables internally, if DWARF2+
7962 line number tables are to be generated.
7964 @item -gas-locview-support
7965 @opindex gas-locview-support
7966 Inform the compiler that the assembler supports @code{view} assignment
7967 and reset assertion checking in @code{.loc} directives.
7969 This option will be enabled by default if, at GCC configure time, the
7970 assembler was found to support them.
7972 @item -gno-as-locview-support
7973 Force GCC to assign view numbers internally, if
7974 @option{-gvariable-location-views} are explicitly requested.
7976 @item -gcolumn-info
7977 @itemx -gno-column-info
7978 @opindex gcolumn-info
7979 @opindex gno-column-info
7980 Emit location column information into DWARF debugging information, rather
7981 than just file and line.
7982 This option is enabled by default.
7984 @item -gstatement-frontiers
7985 @itemx -gno-statement-frontiers
7986 @opindex gstatement-frontiers
7987 @opindex gno-statement-frontiers
7988 This option causes GCC to create markers in the internal representation
7989 at the beginning of statements, and to keep them roughly in place
7990 throughout compilation, using them to guide the output of @code{is_stmt}
7991 markers in the line number table.  This is enabled by default when
7992 compiling with optimization (@option{-Os}, @option{-O}, @option{-O2},
7993 @dots{}), and outputting DWARF 2 debug information at the normal level.
7995 @item -gvariable-location-views
7996 @itemx -gvariable-location-views=incompat5
7997 @itemx -gno-variable-location-views
7998 @opindex gvariable-location-views
7999 @opindex gvariable-location-views=incompat5
8000 @opindex gno-variable-location-views
8001 Augment variable location lists with progressive view numbers implied
8002 from the line number table.  This enables debug information consumers to
8003 inspect state at certain points of the program, even if no instructions
8004 associated with the corresponding source locations are present at that
8005 point.  If the assembler lacks support for view numbers in line number
8006 tables, this will cause the compiler to emit the line number table,
8007 which generally makes them somewhat less compact.  The augmented line
8008 number tables and location lists are fully backward-compatible, so they
8009 can be consumed by debug information consumers that are not aware of
8010 these augmentations, but they won't derive any benefit from them either.
8012 This is enabled by default when outputting DWARF 2 debug information at
8013 the normal level, as long as there is assembler support,
8014 @option{-fvar-tracking-assignments} is enabled and
8015 @option{-gstrict-dwarf} is not.  When assembler support is not
8016 available, this may still be enabled, but it will force GCC to output
8017 internal line number tables, and if
8018 @option{-ginternal-reset-location-views} is not enabled, that will most
8019 certainly lead to silently mismatching location views.
8021 There is a proposed representation for view numbers that is not backward
8022 compatible with the location list format introduced in DWARF 5, that can
8023 be enabled with @option{-gvariable-location-views=incompat5}.  This
8024 option may be removed in the future, is only provided as a reference
8025 implementation of the proposed representation.  Debug information
8026 consumers are not expected to support this extended format, and they
8027 would be rendered unable to decode location lists using it.
8029 @item -ginternal-reset-location-views
8030 @itemx -gnointernal-reset-location-views
8031 @opindex ginternal-reset-location-views
8032 @opindex gno-internal-reset-location-views
8033 Attempt to determine location views that can be omitted from location
8034 view lists.  This requires the compiler to have very accurate insn
8035 length estimates, which isn't always the case, and it may cause
8036 incorrect view lists to be generated silently when using an assembler
8037 that does not support location view lists.  The GNU assembler will flag
8038 any such error as a @code{view number mismatch}.  This is only enabled
8039 on ports that define a reliable estimation function.
8041 @item -ginline-points
8042 @itemx -gno-inline-points
8043 @opindex ginline-points
8044 @opindex gno-inline-points
8045 Generate extended debug information for inlined functions.  Location
8046 view tracking markers are inserted at inlined entry points, so that
8047 address and view numbers can be computed and output in debug
8048 information.  This can be enabled independently of location views, in
8049 which case the view numbers won't be output, but it can only be enabled
8050 along with statement frontiers, and it is only enabled by default if
8051 location views are enabled.
8053 @item -gz@r{[}=@var{type}@r{]}
8054 @opindex gz
8055 Produce compressed debug sections in DWARF format, if that is supported.
8056 If @var{type} is not given, the default type depends on the capabilities
8057 of the assembler and linker used.  @var{type} may be one of
8058 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
8059 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
8060 compression in traditional GNU format).  If the linker doesn't support
8061 writing compressed debug sections, the option is rejected.  Otherwise,
8062 if the assembler does not support them, @option{-gz} is silently ignored
8063 when producing object files.
8065 @item -femit-struct-debug-baseonly
8066 @opindex femit-struct-debug-baseonly
8067 Emit debug information for struct-like types
8068 only when the base name of the compilation source file
8069 matches the base name of file in which the struct is defined.
8071 This option substantially reduces the size of debugging information,
8072 but at significant potential loss in type information to the debugger.
8073 See @option{-femit-struct-debug-reduced} for a less aggressive option.
8074 See @option{-femit-struct-debug-detailed} for more detailed control.
8076 This option works only with DWARF debug output.
8078 @item -femit-struct-debug-reduced
8079 @opindex femit-struct-debug-reduced
8080 Emit debug information for struct-like types
8081 only when the base name of the compilation source file
8082 matches the base name of file in which the type is defined,
8083 unless the struct is a template or defined in a system header.
8085 This option significantly reduces the size of debugging information,
8086 with some potential loss in type information to the debugger.
8087 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
8088 See @option{-femit-struct-debug-detailed} for more detailed control.
8090 This option works only with DWARF debug output.
8092 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
8093 @opindex femit-struct-debug-detailed
8094 Specify the struct-like types
8095 for which the compiler generates debug information.
8096 The intent is to reduce duplicate struct debug information
8097 between different object files within the same program.
8099 This option is a detailed version of
8100 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
8101 which serves for most needs.
8103 A specification has the syntax@*
8104 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
8106 The optional first word limits the specification to
8107 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
8108 A struct type is used directly when it is the type of a variable, member.
8109 Indirect uses arise through pointers to structs.
8110 That is, when use of an incomplete struct is valid, the use is indirect.
8111 An example is
8112 @samp{struct one direct; struct two * indirect;}.
8114 The optional second word limits the specification to
8115 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
8116 Generic structs are a bit complicated to explain.
8117 For C++, these are non-explicit specializations of template classes,
8118 or non-template classes within the above.
8119 Other programming languages have generics,
8120 but @option{-femit-struct-debug-detailed} does not yet implement them.
8122 The third word specifies the source files for those
8123 structs for which the compiler should emit debug information.
8124 The values @samp{none} and @samp{any} have the normal meaning.
8125 The value @samp{base} means that
8126 the base of name of the file in which the type declaration appears
8127 must match the base of the name of the main compilation file.
8128 In practice, this means that when compiling @file{foo.c}, debug information
8129 is generated for types declared in that file and @file{foo.h},
8130 but not other header files.
8131 The value @samp{sys} means those types satisfying @samp{base}
8132 or declared in system or compiler headers.
8134 You may need to experiment to determine the best settings for your application.
8136 The default is @option{-femit-struct-debug-detailed=all}.
8138 This option works only with DWARF debug output.
8140 @item -fno-dwarf2-cfi-asm
8141 @opindex fdwarf2-cfi-asm
8142 @opindex fno-dwarf2-cfi-asm
8143 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
8144 instead of using GAS @code{.cfi_*} directives.
8146 @item -fno-eliminate-unused-debug-types
8147 @opindex feliminate-unused-debug-types
8148 @opindex fno-eliminate-unused-debug-types
8149 Normally, when producing DWARF output, GCC avoids producing debug symbol 
8150 output for types that are nowhere used in the source file being compiled.
8151 Sometimes it is useful to have GCC emit debugging
8152 information for all types declared in a compilation
8153 unit, regardless of whether or not they are actually used
8154 in that compilation unit, for example 
8155 if, in the debugger, you want to cast a value to a type that is
8156 not actually used in your program (but is declared).  More often,
8157 however, this results in a significant amount of wasted space.
8158 @end table
8160 @node Optimize Options
8161 @section Options That Control Optimization
8162 @cindex optimize options
8163 @cindex options, optimization
8165 These options control various sorts of optimizations.
8167 Without any optimization option, the compiler's goal is to reduce the
8168 cost of compilation and to make debugging produce the expected
8169 results.  Statements are independent: if you stop the program with a
8170 breakpoint between statements, you can then assign a new value to any
8171 variable or change the program counter to any other statement in the
8172 function and get exactly the results you expect from the source
8173 code.
8175 Turning on optimization flags makes the compiler attempt to improve
8176 the performance and/or code size at the expense of compilation time
8177 and possibly the ability to debug the program.
8179 The compiler performs optimization based on the knowledge it has of the
8180 program.  Compiling multiple files at once to a single output file mode allows
8181 the compiler to use information gained from all of the files when compiling
8182 each of them.
8184 Not all optimizations are controlled directly by a flag.  Only
8185 optimizations that have a flag are listed in this section.
8187 Most optimizations are completely disabled at @option{-O0} or if an
8188 @option{-O} level is not set on the command line, even if individual
8189 optimization flags are specified.  Similarly, @option{-Og} suppresses
8190 many optimization passes.
8192 Depending on the target and how GCC was configured, a slightly different
8193 set of optimizations may be enabled at each @option{-O} level than
8194 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
8195 to find out the exact set of optimizations that are enabled at each level.
8196 @xref{Overall Options}, for examples.
8198 @table @gcctabopt
8199 @item -O
8200 @itemx -O1
8201 @opindex O
8202 @opindex O1
8203 Optimize.  Optimizing compilation takes somewhat more time, and a lot
8204 more memory for a large function.
8206 With @option{-O}, the compiler tries to reduce code size and execution
8207 time, without performing any optimizations that take a great deal of
8208 compilation time.
8210 @c Note that in addition to the default_options_table list in opts.c,
8211 @c several optimization flags default to true but control optimization
8212 @c passes that are explicitly disabled at -O0.
8214 @option{-O} turns on the following optimization flags:
8216 @c Please keep the following list alphabetized.
8217 @gccoptlist{-fauto-inc-dec @gol
8218 -fbranch-count-reg @gol
8219 -fcombine-stack-adjustments @gol
8220 -fcompare-elim @gol
8221 -fcprop-registers @gol
8222 -fdce @gol
8223 -fdefer-pop @gol
8224 -fdelayed-branch @gol
8225 -fdse @gol
8226 -fforward-propagate @gol
8227 -fguess-branch-probability @gol
8228 -fif-conversion @gol
8229 -fif-conversion2 @gol
8230 -finline-functions-called-once @gol
8231 -fipa-profile @gol
8232 -fipa-pure-const @gol
8233 -fipa-reference @gol
8234 -fipa-reference-addressable @gol
8235 -fmerge-constants @gol
8236 -fmove-loop-invariants @gol
8237 -fomit-frame-pointer @gol
8238 -freorder-blocks @gol
8239 -fshrink-wrap @gol
8240 -fshrink-wrap-separate @gol
8241 -fsplit-wide-types @gol
8242 -fssa-backprop @gol
8243 -fssa-phiopt @gol
8244 -ftree-bit-ccp @gol
8245 -ftree-ccp @gol
8246 -ftree-ch @gol
8247 -ftree-coalesce-vars @gol
8248 -ftree-copy-prop @gol
8249 -ftree-dce @gol
8250 -ftree-dominator-opts @gol
8251 -ftree-dse @gol
8252 -ftree-forwprop @gol
8253 -ftree-fre @gol
8254 -ftree-phiprop @gol
8255 -ftree-pta @gol
8256 -ftree-scev-cprop @gol
8257 -ftree-sink @gol
8258 -ftree-slsr @gol
8259 -ftree-sra @gol
8260 -ftree-ter @gol
8261 -funit-at-a-time}
8263 @item -O2
8264 @opindex O2
8265 Optimize even more.  GCC performs nearly all supported optimizations
8266 that do not involve a space-speed tradeoff.
8267 As compared to @option{-O}, this option increases both compilation time
8268 and the performance of the generated code.
8270 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
8271 also turns on the following optimization flags:
8273 @c Please keep the following list alphabetized!
8274 @gccoptlist{-falign-functions  -falign-jumps @gol
8275 -falign-labels  -falign-loops @gol
8276 -fcaller-saves @gol
8277 -fcode-hoisting @gol
8278 -fcrossjumping @gol
8279 -fcse-follow-jumps  -fcse-skip-blocks @gol
8280 -fdelete-null-pointer-checks @gol
8281 -fdevirtualize  -fdevirtualize-speculatively @gol
8282 -fexpensive-optimizations @gol
8283 -fgcse  -fgcse-lm  @gol
8284 -fhoist-adjacent-loads @gol
8285 -finline-small-functions @gol
8286 -findirect-inlining @gol
8287 -fipa-bit-cp  -fipa-cp  -fipa-icf @gol
8288 -fipa-ra  -fipa-sra  -fipa-vrp @gol
8289 -fisolate-erroneous-paths-dereference @gol
8290 -flra-remat @gol
8291 -foptimize-sibling-calls @gol
8292 -foptimize-strlen @gol
8293 -fpartial-inlining @gol
8294 -fpeephole2 @gol
8295 -freorder-blocks-algorithm=stc @gol
8296 -freorder-blocks-and-partition  -freorder-functions @gol
8297 -frerun-cse-after-loop  @gol
8298 -fschedule-insns  -fschedule-insns2 @gol
8299 -fsched-interblock  -fsched-spec @gol
8300 -fstore-merging @gol
8301 -fstrict-aliasing @gol
8302 -fthread-jumps @gol
8303 -ftree-builtin-call-dce @gol
8304 -ftree-pre @gol
8305 -ftree-switch-conversion  -ftree-tail-merge @gol
8306 -ftree-vrp}
8308 Please note the warning under @option{-fgcse} about
8309 invoking @option{-O2} on programs that use computed gotos.
8311 @item -O3
8312 @opindex O3
8313 Optimize yet more.  @option{-O3} turns on all optimizations specified
8314 by @option{-O2} and also turns on the following optimization flags:
8316 @c Please keep the following list alphabetized!
8317 @gccoptlist{-fgcse-after-reload @gol
8318 -finline-functions @gol
8319 -fipa-cp-clone
8320 -floop-interchange @gol
8321 -floop-unroll-and-jam @gol
8322 -fpeel-loops @gol
8323 -fpredictive-commoning @gol
8324 -fsplit-paths @gol
8325 -ftree-loop-distribute-patterns @gol
8326 -ftree-loop-distribution @gol
8327 -ftree-loop-vectorize @gol
8328 -ftree-partial-pre @gol
8329 -ftree-slp-vectorize @gol
8330 -funswitch-loops @gol
8331 -fvect-cost-model @gol
8332 -fversion-loops-for-strides}
8334 @item -O0
8335 @opindex O0
8336 Reduce compilation time and make debugging produce the expected
8337 results.  This is the default.
8339 @item -Os
8340 @opindex Os
8341 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations 
8342 except those that often increase code size:
8344 @gccoptlist{-falign-functions  -falign-jumps @gol
8345 -falign-labels  -falign-loops @gol
8346 -fprefetch-loop-arrays  -freorder-blocks-algorithm=stc}
8348 It also enables @option{-finline-functions}, causes the compiler to tune for
8349 code size rather than execution speed, and performs further optimizations
8350 designed to reduce code size.
8352 @item -Ofast
8353 @opindex Ofast
8354 Disregard strict standards compliance.  @option{-Ofast} enables all
8355 @option{-O3} optimizations.  It also enables optimizations that are not
8356 valid for all standard-compliant programs.
8357 It turns on @option{-ffast-math} and the Fortran-specific
8358 @option{-fstack-arrays}, unless @option{-fmax-stack-var-size} is
8359 specified, and @option{-fno-protect-parens}.
8361 @item -Og
8362 @opindex Og
8363 Optimize debugging experience.  @option{-Og} should be the optimization
8364 level of choice for the standard edit-compile-debug cycle, offering
8365 a reasonable level of optimization while maintaining fast compilation
8366 and a good debugging experience.  It is a better choice than @option{-O0}
8367 for producing debuggable code because some compiler passes
8368 that collect debug information are disabled at @option{-O0}.
8370 Like @option{-O0}, @option{-Og} completely disables a number of 
8371 optimization passes so that individual options controlling them have
8372 no effect.  Otherwise @option{-Og} enables all @option{-O1} 
8373 optimization flags except for those that may interfere with debugging:
8375 @gccoptlist{-fbranch-count-reg  -fdelayed-branch @gol
8376 -fif-conversion  -fif-conversion2  @gol
8377 -finline-functions-called-once @gol
8378 -fmove-loop-invariants  -fssa-phiopt @gol
8379 -ftree-bit-ccp  -ftree-pta  -ftree-sra}
8381 @end table
8383 If you use multiple @option{-O} options, with or without level numbers,
8384 the last such option is the one that is effective.
8386 Options of the form @option{-f@var{flag}} specify machine-independent
8387 flags.  Most flags have both positive and negative forms; the negative
8388 form of @option{-ffoo} is @option{-fno-foo}.  In the table
8389 below, only one of the forms is listed---the one you typically 
8390 use.  You can figure out the other form by either removing @samp{no-}
8391 or adding it.
8393 The following options control specific optimizations.  They are either
8394 activated by @option{-O} options or are related to ones that are.  You
8395 can use the following flags in the rare cases when ``fine-tuning'' of
8396 optimizations to be performed is desired.
8398 @table @gcctabopt
8399 @item -fno-defer-pop
8400 @opindex fno-defer-pop
8401 @opindex fdefer-pop
8402 For machines that must pop arguments after a function call, always pop 
8403 the arguments as soon as each function returns.  
8404 At levels @option{-O1} and higher, @option{-fdefer-pop} is the default;
8405 this allows the compiler to let arguments accumulate on the stack for several
8406 function calls and pop them all at once.
8408 @item -fforward-propagate
8409 @opindex fforward-propagate
8410 Perform a forward propagation pass on RTL@.  The pass tries to combine two
8411 instructions and checks if the result can be simplified.  If loop unrolling
8412 is active, two passes are performed and the second is scheduled after
8413 loop unrolling.
8415 This option is enabled by default at optimization levels @option{-O},
8416 @option{-O2}, @option{-O3}, @option{-Os}.
8418 @item -ffp-contract=@var{style}
8419 @opindex ffp-contract
8420 @option{-ffp-contract=off} disables floating-point expression contraction.
8421 @option{-ffp-contract=fast} enables floating-point expression contraction
8422 such as forming of fused multiply-add operations if the target has
8423 native support for them.
8424 @option{-ffp-contract=on} enables floating-point expression contraction
8425 if allowed by the language standard.  This is currently not implemented
8426 and treated equal to @option{-ffp-contract=off}.
8428 The default is @option{-ffp-contract=fast}.
8430 @item -fomit-frame-pointer
8431 @opindex fomit-frame-pointer
8432 Omit the frame pointer in functions that don't need one.  This avoids the
8433 instructions to save, set up and restore the frame pointer; on many targets
8434 it also makes an extra register available.
8436 On some targets this flag has no effect because the standard calling sequence
8437 always uses a frame pointer, so it cannot be omitted.
8439 Note that @option{-fno-omit-frame-pointer} doesn't guarantee the frame pointer
8440 is used in all functions.  Several targets always omit the frame pointer in
8441 leaf functions.
8443 Enabled by default at @option{-O} and higher.
8445 @item -foptimize-sibling-calls
8446 @opindex foptimize-sibling-calls
8447 Optimize sibling and tail recursive calls.
8449 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8451 @item -foptimize-strlen
8452 @opindex foptimize-strlen
8453 Optimize various standard C string functions (e.g.@: @code{strlen},
8454 @code{strchr} or @code{strcpy}) and
8455 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
8457 Enabled at levels @option{-O2}, @option{-O3}.
8459 @item -fno-inline
8460 @opindex fno-inline
8461 @opindex finline
8462 Do not expand any functions inline apart from those marked with
8463 the @code{always_inline} attribute.  This is the default when not
8464 optimizing.
8466 Single functions can be exempted from inlining by marking them
8467 with the @code{noinline} attribute.
8469 @item -finline-small-functions
8470 @opindex finline-small-functions
8471 Integrate functions into their callers when their body is smaller than expected
8472 function call code (so overall size of program gets smaller).  The compiler
8473 heuristically decides which functions are simple enough to be worth integrating
8474 in this way.  This inlining applies to all functions, even those not declared
8475 inline.
8477 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8479 @item -findirect-inlining
8480 @opindex findirect-inlining
8481 Inline also indirect calls that are discovered to be known at compile
8482 time thanks to previous inlining.  This option has any effect only
8483 when inlining itself is turned on by the @option{-finline-functions}
8484 or @option{-finline-small-functions} options.
8486 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8488 @item -finline-functions
8489 @opindex finline-functions
8490 Consider all functions for inlining, even if they are not declared inline.
8491 The compiler heuristically decides which functions are worth integrating
8492 in this way.
8494 If all calls to a given function are integrated, and the function is
8495 declared @code{static}, then the function is normally not output as
8496 assembler code in its own right.
8498 Enabled at levels @option{-O3}, @option{-Os}.  Also enabled
8499 by @option{-fprofile-use} and @option{-fauto-profile}.
8501 @item -finline-functions-called-once
8502 @opindex finline-functions-called-once
8503 Consider all @code{static} functions called once for inlining into their
8504 caller even if they are not marked @code{inline}.  If a call to a given
8505 function is integrated, then the function is not output as assembler code
8506 in its own right.
8508 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os},
8509 but not @option{-Og}.
8511 @item -fearly-inlining
8512 @opindex fearly-inlining
8513 Inline functions marked by @code{always_inline} and functions whose body seems
8514 smaller than the function call overhead early before doing
8515 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
8516 makes profiling significantly cheaper and usually inlining faster on programs
8517 having large chains of nested wrapper functions.
8519 Enabled by default.
8521 @item -fipa-sra
8522 @opindex fipa-sra
8523 Perform interprocedural scalar replacement of aggregates, removal of
8524 unused parameters and replacement of parameters passed by reference
8525 by parameters passed by value.
8527 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
8529 @item -finline-limit=@var{n}
8530 @opindex finline-limit
8531 By default, GCC limits the size of functions that can be inlined.  This flag
8532 allows coarse control of this limit.  @var{n} is the size of functions that
8533 can be inlined in number of pseudo instructions.
8535 Inlining is actually controlled by a number of parameters, which may be
8536 specified individually by using @option{--param @var{name}=@var{value}}.
8537 The @option{-finline-limit=@var{n}} option sets some of these parameters
8538 as follows:
8540 @table @gcctabopt
8541 @item max-inline-insns-single
8542 is set to @var{n}/2.
8543 @item max-inline-insns-auto
8544 is set to @var{n}/2.
8545 @end table
8547 See below for a documentation of the individual
8548 parameters controlling inlining and for the defaults of these parameters.
8550 @emph{Note:} there may be no value to @option{-finline-limit} that results
8551 in default behavior.
8553 @emph{Note:} pseudo instruction represents, in this particular context, an
8554 abstract measurement of function's size.  In no way does it represent a count
8555 of assembly instructions and as such its exact meaning might change from one
8556 release to an another.
8558 @item -fno-keep-inline-dllexport
8559 @opindex fno-keep-inline-dllexport
8560 @opindex fkeep-inline-dllexport
8561 This is a more fine-grained version of @option{-fkeep-inline-functions},
8562 which applies only to functions that are declared using the @code{dllexport}
8563 attribute or declspec.  @xref{Function Attributes,,Declaring Attributes of
8564 Functions}.
8566 @item -fkeep-inline-functions
8567 @opindex fkeep-inline-functions
8568 In C, emit @code{static} functions that are declared @code{inline}
8569 into the object file, even if the function has been inlined into all
8570 of its callers.  This switch does not affect functions using the
8571 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
8572 inline functions into the object file.
8574 @item -fkeep-static-functions
8575 @opindex fkeep-static-functions
8576 Emit @code{static} functions into the object file, even if the function
8577 is never used.
8579 @item -fkeep-static-consts
8580 @opindex fkeep-static-consts
8581 Emit variables declared @code{static const} when optimization isn't turned
8582 on, even if the variables aren't referenced.
8584 GCC enables this option by default.  If you want to force the compiler to
8585 check if a variable is referenced, regardless of whether or not
8586 optimization is turned on, use the @option{-fno-keep-static-consts} option.
8588 @item -fmerge-constants
8589 @opindex fmerge-constants
8590 Attempt to merge identical constants (string constants and floating-point
8591 constants) across compilation units.
8593 This option is the default for optimized compilation if the assembler and
8594 linker support it.  Use @option{-fno-merge-constants} to inhibit this
8595 behavior.
8597 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8599 @item -fmerge-all-constants
8600 @opindex fmerge-all-constants
8601 Attempt to merge identical constants and identical variables.
8603 This option implies @option{-fmerge-constants}.  In addition to
8604 @option{-fmerge-constants} this considers e.g.@: even constant initialized
8605 arrays or initialized constant variables with integral or floating-point
8606 types.  Languages like C or C++ require each variable, including multiple
8607 instances of the same variable in recursive calls, to have distinct locations,
8608 so using this option results in non-conforming
8609 behavior.
8611 @item -fmodulo-sched
8612 @opindex fmodulo-sched
8613 Perform swing modulo scheduling immediately before the first scheduling
8614 pass.  This pass looks at innermost loops and reorders their
8615 instructions by overlapping different iterations.
8617 @item -fmodulo-sched-allow-regmoves
8618 @opindex fmodulo-sched-allow-regmoves
8619 Perform more aggressive SMS-based modulo scheduling with register moves
8620 allowed.  By setting this flag certain anti-dependences edges are
8621 deleted, which triggers the generation of reg-moves based on the
8622 life-range analysis.  This option is effective only with
8623 @option{-fmodulo-sched} enabled.
8625 @item -fno-branch-count-reg
8626 @opindex fno-branch-count-reg
8627 @opindex fbranch-count-reg
8628 Disable the optimization pass that scans for opportunities to use 
8629 ``decrement and branch'' instructions on a count register instead of
8630 instruction sequences that decrement a register, compare it against zero, and
8631 then branch based upon the result.  This option is only meaningful on
8632 architectures that support such instructions, which include x86, PowerPC,
8633 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
8634 doesn't remove the decrement and branch instructions from the generated
8635 instruction stream introduced by other optimization passes.
8637 The default is @option{-fbranch-count-reg} at @option{-O1} and higher,
8638 except for @option{-Og}.
8640 @item -fno-function-cse
8641 @opindex fno-function-cse
8642 @opindex ffunction-cse
8643 Do not put function addresses in registers; make each instruction that
8644 calls a constant function contain the function's address explicitly.
8646 This option results in less efficient code, but some strange hacks
8647 that alter the assembler output may be confused by the optimizations
8648 performed when this option is not used.
8650 The default is @option{-ffunction-cse}
8652 @item -fno-zero-initialized-in-bss
8653 @opindex fno-zero-initialized-in-bss
8654 @opindex fzero-initialized-in-bss
8655 If the target supports a BSS section, GCC by default puts variables that
8656 are initialized to zero into BSS@.  This can save space in the resulting
8657 code.
8659 This option turns off this behavior because some programs explicitly
8660 rely on variables going to the data section---e.g., so that the
8661 resulting executable can find the beginning of that section and/or make
8662 assumptions based on that.
8664 The default is @option{-fzero-initialized-in-bss}.
8666 @item -fthread-jumps
8667 @opindex fthread-jumps
8668 Perform optimizations that check to see if a jump branches to a
8669 location where another comparison subsumed by the first is found.  If
8670 so, the first branch is redirected to either the destination of the
8671 second branch or a point immediately following it, depending on whether
8672 the condition is known to be true or false.
8674 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8676 @item -fsplit-wide-types
8677 @opindex fsplit-wide-types
8678 When using a type that occupies multiple registers, such as @code{long
8679 long} on a 32-bit system, split the registers apart and allocate them
8680 independently.  This normally generates better code for those types,
8681 but may make debugging more difficult.
8683 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
8684 @option{-Os}.
8686 @item -fcse-follow-jumps
8687 @opindex fcse-follow-jumps
8688 In common subexpression elimination (CSE), scan through jump instructions
8689 when the target of the jump is not reached by any other path.  For
8690 example, when CSE encounters an @code{if} statement with an
8691 @code{else} clause, CSE follows the jump when the condition
8692 tested is false.
8694 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8696 @item -fcse-skip-blocks
8697 @opindex fcse-skip-blocks
8698 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
8699 follow jumps that conditionally skip over blocks.  When CSE
8700 encounters a simple @code{if} statement with no else clause,
8701 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
8702 body of the @code{if}.
8704 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8706 @item -frerun-cse-after-loop
8707 @opindex frerun-cse-after-loop
8708 Re-run common subexpression elimination after loop optimizations are
8709 performed.
8711 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8713 @item -fgcse
8714 @opindex fgcse
8715 Perform a global common subexpression elimination pass.
8716 This pass also performs global constant and copy propagation.
8718 @emph{Note:} When compiling a program using computed gotos, a GCC
8719 extension, you may get better run-time performance if you disable
8720 the global common subexpression elimination pass by adding
8721 @option{-fno-gcse} to the command line.
8723 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8725 @item -fgcse-lm
8726 @opindex fgcse-lm
8727 When @option{-fgcse-lm} is enabled, global common subexpression elimination
8728 attempts to move loads that are only killed by stores into themselves.  This
8729 allows a loop containing a load/store sequence to be changed to a load outside
8730 the loop, and a copy/store within the loop.
8732 Enabled by default when @option{-fgcse} is enabled.
8734 @item -fgcse-sm
8735 @opindex fgcse-sm
8736 When @option{-fgcse-sm} is enabled, a store motion pass is run after
8737 global common subexpression elimination.  This pass attempts to move
8738 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
8739 loops containing a load/store sequence can be changed to a load before
8740 the loop and a store after the loop.
8742 Not enabled at any optimization level.
8744 @item -fgcse-las
8745 @opindex fgcse-las
8746 When @option{-fgcse-las} is enabled, the global common subexpression
8747 elimination pass eliminates redundant loads that come after stores to the
8748 same memory location (both partial and full redundancies).
8750 Not enabled at any optimization level.
8752 @item -fgcse-after-reload
8753 @opindex fgcse-after-reload
8754 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
8755 pass is performed after reload.  The purpose of this pass is to clean up
8756 redundant spilling.
8758 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
8760 @item -faggressive-loop-optimizations
8761 @opindex faggressive-loop-optimizations
8762 This option tells the loop optimizer to use language constraints to
8763 derive bounds for the number of iterations of a loop.  This assumes that
8764 loop code does not invoke undefined behavior by for example causing signed
8765 integer overflows or out-of-bound array accesses.  The bounds for the
8766 number of iterations of a loop are used to guide loop unrolling and peeling
8767 and loop exit test optimizations.
8768 This option is enabled by default.
8770 @item -funconstrained-commons
8771 @opindex funconstrained-commons
8772 This option tells the compiler that variables declared in common blocks
8773 (e.g.@: Fortran) may later be overridden with longer trailing arrays. This
8774 prevents certain optimizations that depend on knowing the array bounds.
8776 @item -fcrossjumping
8777 @opindex fcrossjumping
8778 Perform cross-jumping transformation.
8779 This transformation unifies equivalent code and saves code size.  The
8780 resulting code may or may not perform better than without cross-jumping.
8782 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8784 @item -fauto-inc-dec
8785 @opindex fauto-inc-dec
8786 Combine increments or decrements of addresses with memory accesses.
8787 This pass is always skipped on architectures that do not have
8788 instructions to support this.  Enabled by default at @option{-O} and
8789 higher on architectures that support this.
8791 @item -fdce
8792 @opindex fdce
8793 Perform dead code elimination (DCE) on RTL@.
8794 Enabled by default at @option{-O} and higher.
8796 @item -fdse
8797 @opindex fdse
8798 Perform dead store elimination (DSE) on RTL@.
8799 Enabled by default at @option{-O} and higher.
8801 @item -fif-conversion
8802 @opindex fif-conversion
8803 Attempt to transform conditional jumps into branch-less equivalents.  This
8804 includes use of conditional moves, min, max, set flags and abs instructions, and
8805 some tricks doable by standard arithmetics.  The use of conditional execution
8806 on chips where it is available is controlled by @option{-fif-conversion2}.
8808 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}, but
8809 not with @option{-Og}.
8811 @item -fif-conversion2
8812 @opindex fif-conversion2
8813 Use conditional execution (where available) to transform conditional jumps into
8814 branch-less equivalents.
8816 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}, but
8817 not with @option{-Og}.
8819 @item -fdeclone-ctor-dtor
8820 @opindex fdeclone-ctor-dtor
8821 The C++ ABI requires multiple entry points for constructors and
8822 destructors: one for a base subobject, one for a complete object, and
8823 one for a virtual destructor that calls operator delete afterwards.
8824 For a hierarchy with virtual bases, the base and complete variants are
8825 clones, which means two copies of the function.  With this option, the
8826 base and complete variants are changed to be thunks that call a common
8827 implementation.
8829 Enabled by @option{-Os}.
8831 @item -fdelete-null-pointer-checks
8832 @opindex fdelete-null-pointer-checks
8833 Assume that programs cannot safely dereference null pointers, and that
8834 no code or data element resides at address zero.
8835 This option enables simple constant
8836 folding optimizations at all optimization levels.  In addition, other
8837 optimization passes in GCC use this flag to control global dataflow
8838 analyses that eliminate useless checks for null pointers; these assume
8839 that a memory access to address zero always results in a trap, so
8840 that if a pointer is checked after it has already been dereferenced,
8841 it cannot be null.
8843 Note however that in some environments this assumption is not true.
8844 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
8845 for programs that depend on that behavior.
8847 This option is enabled by default on most targets.  On Nios II ELF, it
8848 defaults to off.  On AVR, CR16, and MSP430, this option is completely disabled.
8850 Passes that use the dataflow information
8851 are enabled independently at different optimization levels.
8853 @item -fdevirtualize
8854 @opindex fdevirtualize
8855 Attempt to convert calls to virtual functions to direct calls.  This
8856 is done both within a procedure and interprocedurally as part of
8857 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
8858 propagation (@option{-fipa-cp}).
8859 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8861 @item -fdevirtualize-speculatively
8862 @opindex fdevirtualize-speculatively
8863 Attempt to convert calls to virtual functions to speculative direct calls.
8864 Based on the analysis of the type inheritance graph, determine for a given call
8865 the set of likely targets. If the set is small, preferably of size 1, change
8866 the call into a conditional deciding between direct and indirect calls.  The
8867 speculative calls enable more optimizations, such as inlining.  When they seem
8868 useless after further optimization, they are converted back into original form.
8870 @item -fdevirtualize-at-ltrans
8871 @opindex fdevirtualize-at-ltrans
8872 Stream extra information needed for aggressive devirtualization when running
8873 the link-time optimizer in local transformation mode.  
8874 This option enables more devirtualization but
8875 significantly increases the size of streamed data. For this reason it is
8876 disabled by default.
8878 @item -fexpensive-optimizations
8879 @opindex fexpensive-optimizations
8880 Perform a number of minor optimizations that are relatively expensive.
8882 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8884 @item -free
8885 @opindex free
8886 Attempt to remove redundant extension instructions.  This is especially
8887 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
8888 registers after writing to their lower 32-bit half.
8890 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
8891 @option{-O3}, @option{-Os}.
8893 @item -fno-lifetime-dse
8894 @opindex fno-lifetime-dse
8895 @opindex flifetime-dse
8896 In C++ the value of an object is only affected by changes within its
8897 lifetime: when the constructor begins, the object has an indeterminate
8898 value, and any changes during the lifetime of the object are dead when
8899 the object is destroyed.  Normally dead store elimination will take
8900 advantage of this; if your code relies on the value of the object
8901 storage persisting beyond the lifetime of the object, you can use this
8902 flag to disable this optimization.  To preserve stores before the
8903 constructor starts (e.g.@: because your operator new clears the object
8904 storage) but still treat the object as dead after the destructor you,
8905 can use @option{-flifetime-dse=1}.  The default behavior can be
8906 explicitly selected with @option{-flifetime-dse=2}.
8907 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
8909 @item -flive-range-shrinkage
8910 @opindex flive-range-shrinkage
8911 Attempt to decrease register pressure through register live range
8912 shrinkage.  This is helpful for fast processors with small or moderate
8913 size register sets.
8915 @item -fira-algorithm=@var{algorithm}
8916 @opindex fira-algorithm
8917 Use the specified coloring algorithm for the integrated register
8918 allocator.  The @var{algorithm} argument can be @samp{priority}, which
8919 specifies Chow's priority coloring, or @samp{CB}, which specifies
8920 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
8921 for all architectures, but for those targets that do support it, it is
8922 the default because it generates better code.
8924 @item -fira-region=@var{region}
8925 @opindex fira-region
8926 Use specified regions for the integrated register allocator.  The
8927 @var{region} argument should be one of the following:
8929 @table @samp
8931 @item all
8932 Use all loops as register allocation regions.
8933 This can give the best results for machines with a small and/or
8934 irregular register set.
8936 @item mixed
8937 Use all loops except for loops with small register pressure 
8938 as the regions.  This value usually gives
8939 the best results in most cases and for most architectures,
8940 and is enabled by default when compiling with optimization for speed
8941 (@option{-O}, @option{-O2}, @dots{}).
8943 @item one
8944 Use all functions as a single region.  
8945 This typically results in the smallest code size, and is enabled by default for
8946 @option{-Os} or @option{-O0}.
8948 @end table
8950 @item -fira-hoist-pressure
8951 @opindex fira-hoist-pressure
8952 Use IRA to evaluate register pressure in the code hoisting pass for
8953 decisions to hoist expressions.  This option usually results in smaller
8954 code, but it can slow the compiler down.
8956 This option is enabled at level @option{-Os} for all targets.
8958 @item -fira-loop-pressure
8959 @opindex fira-loop-pressure
8960 Use IRA to evaluate register pressure in loops for decisions to move
8961 loop invariants.  This option usually results in generation
8962 of faster and smaller code on machines with large register files (>= 32
8963 registers), but it can slow the compiler down.
8965 This option is enabled at level @option{-O3} for some targets.
8967 @item -fno-ira-share-save-slots
8968 @opindex fno-ira-share-save-slots
8969 @opindex fira-share-save-slots
8970 Disable sharing of stack slots used for saving call-used hard
8971 registers living through a call.  Each hard register gets a
8972 separate stack slot, and as a result function stack frames are
8973 larger.
8975 @item -fno-ira-share-spill-slots
8976 @opindex fno-ira-share-spill-slots
8977 @opindex fira-share-spill-slots
8978 Disable sharing of stack slots allocated for pseudo-registers.  Each
8979 pseudo-register that does not get a hard register gets a separate
8980 stack slot, and as a result function stack frames are larger.
8982 @item -flra-remat
8983 @opindex flra-remat
8984 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
8985 values of spilled pseudos, LRA tries to rematerialize (recalculate)
8986 values if it is profitable.
8988 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8990 @item -fdelayed-branch
8991 @opindex fdelayed-branch
8992 If supported for the target machine, attempt to reorder instructions
8993 to exploit instruction slots available after delayed branch
8994 instructions.
8996 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os},
8997 but not at @option{-Og}.
8999 @item -fschedule-insns
9000 @opindex fschedule-insns
9001 If supported for the target machine, attempt to reorder instructions to
9002 eliminate execution stalls due to required data being unavailable.  This
9003 helps machines that have slow floating point or memory load instructions
9004 by allowing other instructions to be issued until the result of the load
9005 or floating-point instruction is required.
9007 Enabled at levels @option{-O2}, @option{-O3}.
9009 @item -fschedule-insns2
9010 @opindex fschedule-insns2
9011 Similar to @option{-fschedule-insns}, but requests an additional pass of
9012 instruction scheduling after register allocation has been done.  This is
9013 especially useful on machines with a relatively small number of
9014 registers and where memory load instructions take more than one cycle.
9016 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9018 @item -fno-sched-interblock
9019 @opindex fno-sched-interblock
9020 @opindex fsched-interblock
9021 Disable instruction scheduling across basic blocks, which
9022 is normally enabled when scheduling before register allocation, i.e.@:
9023 with @option{-fschedule-insns} or at @option{-O2} or higher.
9025 @item -fno-sched-spec
9026 @opindex fno-sched-spec
9027 @opindex fsched-spec
9028 Disable speculative motion of non-load instructions, which
9029 is normally enabled when scheduling before register allocation, i.e.@:
9030 with @option{-fschedule-insns} or at @option{-O2} or higher.
9032 @item -fsched-pressure
9033 @opindex fsched-pressure
9034 Enable register pressure sensitive insn scheduling before register
9035 allocation.  This only makes sense when scheduling before register
9036 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
9037 @option{-O2} or higher.  Usage of this option can improve the
9038 generated code and decrease its size by preventing register pressure
9039 increase above the number of available hard registers and subsequent
9040 spills in register allocation.
9042 @item -fsched-spec-load
9043 @opindex fsched-spec-load
9044 Allow speculative motion of some load instructions.  This only makes
9045 sense when scheduling before register allocation, i.e.@: with
9046 @option{-fschedule-insns} or at @option{-O2} or higher.
9048 @item -fsched-spec-load-dangerous
9049 @opindex fsched-spec-load-dangerous
9050 Allow speculative motion of more load instructions.  This only makes
9051 sense when scheduling before register allocation, i.e.@: with
9052 @option{-fschedule-insns} or at @option{-O2} or higher.
9054 @item -fsched-stalled-insns
9055 @itemx -fsched-stalled-insns=@var{n}
9056 @opindex fsched-stalled-insns
9057 Define how many insns (if any) can be moved prematurely from the queue
9058 of stalled insns into the ready list during the second scheduling pass.
9059 @option{-fno-sched-stalled-insns} means that no insns are moved
9060 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
9061 on how many queued insns can be moved prematurely.
9062 @option{-fsched-stalled-insns} without a value is equivalent to
9063 @option{-fsched-stalled-insns=1}.
9065 @item -fsched-stalled-insns-dep
9066 @itemx -fsched-stalled-insns-dep=@var{n}
9067 @opindex fsched-stalled-insns-dep
9068 Define how many insn groups (cycles) are examined for a dependency
9069 on a stalled insn that is a candidate for premature removal from the queue
9070 of stalled insns.  This has an effect only during the second scheduling pass,
9071 and only if @option{-fsched-stalled-insns} is used.
9072 @option{-fno-sched-stalled-insns-dep} is equivalent to
9073 @option{-fsched-stalled-insns-dep=0}.
9074 @option{-fsched-stalled-insns-dep} without a value is equivalent to
9075 @option{-fsched-stalled-insns-dep=1}.
9077 @item -fsched2-use-superblocks
9078 @opindex fsched2-use-superblocks
9079 When scheduling after register allocation, use superblock scheduling.
9080 This allows motion across basic block boundaries,
9081 resulting in faster schedules.  This option is experimental, as not all machine
9082 descriptions used by GCC model the CPU closely enough to avoid unreliable
9083 results from the algorithm.
9085 This only makes sense when scheduling after register allocation, i.e.@: with
9086 @option{-fschedule-insns2} or at @option{-O2} or higher.
9088 @item -fsched-group-heuristic
9089 @opindex fsched-group-heuristic
9090 Enable the group heuristic in the scheduler.  This heuristic favors
9091 the instruction that belongs to a schedule group.  This is enabled
9092 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
9093 or @option{-fschedule-insns2} or at @option{-O2} or higher.
9095 @item -fsched-critical-path-heuristic
9096 @opindex fsched-critical-path-heuristic
9097 Enable the critical-path heuristic in the scheduler.  This heuristic favors
9098 instructions on the critical path.  This is enabled by default when
9099 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
9100 or @option{-fschedule-insns2} or at @option{-O2} or higher.
9102 @item -fsched-spec-insn-heuristic
9103 @opindex fsched-spec-insn-heuristic
9104 Enable the speculative instruction heuristic in the scheduler.  This
9105 heuristic favors speculative instructions with greater dependency weakness.
9106 This is enabled by default when scheduling is enabled, i.e.@:
9107 with @option{-fschedule-insns} or @option{-fschedule-insns2}
9108 or at @option{-O2} or higher.
9110 @item -fsched-rank-heuristic
9111 @opindex fsched-rank-heuristic
9112 Enable the rank heuristic in the scheduler.  This heuristic favors
9113 the instruction belonging to a basic block with greater size or frequency.
9114 This is enabled by default when scheduling is enabled, i.e.@:
9115 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
9116 at @option{-O2} or higher.
9118 @item -fsched-last-insn-heuristic
9119 @opindex fsched-last-insn-heuristic
9120 Enable the last-instruction heuristic in the scheduler.  This heuristic
9121 favors the instruction that is less dependent on the last instruction
9122 scheduled.  This is enabled by default when scheduling is enabled,
9123 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
9124 at @option{-O2} or higher.
9126 @item -fsched-dep-count-heuristic
9127 @opindex fsched-dep-count-heuristic
9128 Enable the dependent-count heuristic in the scheduler.  This heuristic
9129 favors the instruction that has more instructions depending on it.
9130 This is enabled by default when scheduling is enabled, i.e.@:
9131 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
9132 at @option{-O2} or higher.
9134 @item -freschedule-modulo-scheduled-loops
9135 @opindex freschedule-modulo-scheduled-loops
9136 Modulo scheduling is performed before traditional scheduling.  If a loop
9137 is modulo scheduled, later scheduling passes may change its schedule.  
9138 Use this option to control that behavior.
9140 @item -fselective-scheduling
9141 @opindex fselective-scheduling
9142 Schedule instructions using selective scheduling algorithm.  Selective
9143 scheduling runs instead of the first scheduler pass.
9145 @item -fselective-scheduling2
9146 @opindex fselective-scheduling2
9147 Schedule instructions using selective scheduling algorithm.  Selective
9148 scheduling runs instead of the second scheduler pass.
9150 @item -fsel-sched-pipelining
9151 @opindex fsel-sched-pipelining
9152 Enable software pipelining of innermost loops during selective scheduling.
9153 This option has no effect unless one of @option{-fselective-scheduling} or
9154 @option{-fselective-scheduling2} is turned on.
9156 @item -fsel-sched-pipelining-outer-loops
9157 @opindex fsel-sched-pipelining-outer-loops
9158 When pipelining loops during selective scheduling, also pipeline outer loops.
9159 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
9161 @item -fsemantic-interposition
9162 @opindex fsemantic-interposition
9163 Some object formats, like ELF, allow interposing of symbols by the 
9164 dynamic linker.
9165 This means that for symbols exported from the DSO, the compiler cannot perform
9166 interprocedural propagation, inlining and other optimizations in anticipation
9167 that the function or variable in question may change. While this feature is
9168 useful, for example, to rewrite memory allocation functions by a debugging
9169 implementation, it is expensive in the terms of code quality.
9170 With @option{-fno-semantic-interposition} the compiler assumes that 
9171 if interposition happens for functions the overwriting function will have 
9172 precisely the same semantics (and side effects). 
9173 Similarly if interposition happens
9174 for variables, the constructor of the variable will be the same. The flag
9175 has no effect for functions explicitly declared inline 
9176 (where it is never allowed for interposition to change semantics) 
9177 and for symbols explicitly declared weak.
9179 @item -fshrink-wrap
9180 @opindex fshrink-wrap
9181 Emit function prologues only before parts of the function that need it,
9182 rather than at the top of the function.  This flag is enabled by default at
9183 @option{-O} and higher.
9185 @item -fshrink-wrap-separate
9186 @opindex fshrink-wrap-separate
9187 Shrink-wrap separate parts of the prologue and epilogue separately, so that
9188 those parts are only executed when needed.
9189 This option is on by default, but has no effect unless @option{-fshrink-wrap}
9190 is also turned on and the target supports this.
9192 @item -fcaller-saves
9193 @opindex fcaller-saves
9194 Enable allocation of values to registers that are clobbered by
9195 function calls, by emitting extra instructions to save and restore the
9196 registers around such calls.  Such allocation is done only when it
9197 seems to result in better code.
9199 This option is always enabled by default on certain machines, usually
9200 those which have no call-preserved registers to use instead.
9202 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9204 @item -fcombine-stack-adjustments
9205 @opindex fcombine-stack-adjustments
9206 Tracks stack adjustments (pushes and pops) and stack memory references
9207 and then tries to find ways to combine them.
9209 Enabled by default at @option{-O1} and higher.
9211 @item -fipa-ra
9212 @opindex fipa-ra
9213 Use caller save registers for allocation if those registers are not used by
9214 any called function.  In that case it is not necessary to save and restore
9215 them around calls.  This is only possible if called functions are part of
9216 same compilation unit as current function and they are compiled before it.
9218 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}, however the option
9219 is disabled if generated code will be instrumented for profiling
9220 (@option{-p}, or @option{-pg}) or if callee's register usage cannot be known
9221 exactly (this happens on targets that do not expose prologues
9222 and epilogues in RTL).
9224 @item -fconserve-stack
9225 @opindex fconserve-stack
9226 Attempt to minimize stack usage.  The compiler attempts to use less
9227 stack space, even if that makes the program slower.  This option
9228 implies setting the @option{large-stack-frame} parameter to 100
9229 and the @option{large-stack-frame-growth} parameter to 400.
9231 @item -ftree-reassoc
9232 @opindex ftree-reassoc
9233 Perform reassociation on trees.  This flag is enabled by default
9234 at @option{-O} and higher.
9236 @item -fcode-hoisting
9237 @opindex fcode-hoisting
9238 Perform code hoisting.  Code hoisting tries to move the
9239 evaluation of expressions executed on all paths to the function exit
9240 as early as possible.  This is especially useful as a code size
9241 optimization, but it often helps for code speed as well.
9242 This flag is enabled by default at @option{-O2} and higher.
9244 @item -ftree-pre
9245 @opindex ftree-pre
9246 Perform partial redundancy elimination (PRE) on trees.  This flag is
9247 enabled by default at @option{-O2} and @option{-O3}.
9249 @item -ftree-partial-pre
9250 @opindex ftree-partial-pre
9251 Make partial redundancy elimination (PRE) more aggressive.  This flag is
9252 enabled by default at @option{-O3}.
9254 @item -ftree-forwprop
9255 @opindex ftree-forwprop
9256 Perform forward propagation on trees.  This flag is enabled by default
9257 at @option{-O} and higher.
9259 @item -ftree-fre
9260 @opindex ftree-fre
9261 Perform full redundancy elimination (FRE) on trees.  The difference
9262 between FRE and PRE is that FRE only considers expressions
9263 that are computed on all paths leading to the redundant computation.
9264 This analysis is faster than PRE, though it exposes fewer redundancies.
9265 This flag is enabled by default at @option{-O} and higher.
9267 @item -ftree-phiprop
9268 @opindex ftree-phiprop
9269 Perform hoisting of loads from conditional pointers on trees.  This
9270 pass is enabled by default at @option{-O} and higher.
9272 @item -fhoist-adjacent-loads
9273 @opindex fhoist-adjacent-loads
9274 Speculatively hoist loads from both branches of an if-then-else if the
9275 loads are from adjacent locations in the same structure and the target
9276 architecture has a conditional move instruction.  This flag is enabled
9277 by default at @option{-O2} and higher.
9279 @item -ftree-copy-prop
9280 @opindex ftree-copy-prop
9281 Perform copy propagation on trees.  This pass eliminates unnecessary
9282 copy operations.  This flag is enabled by default at @option{-O} and
9283 higher.
9285 @item -fipa-pure-const
9286 @opindex fipa-pure-const
9287 Discover which functions are pure or constant.
9288 Enabled by default at @option{-O} and higher.
9290 @item -fipa-reference
9291 @opindex fipa-reference
9292 Discover which static variables do not escape the
9293 compilation unit.
9294 Enabled by default at @option{-O} and higher.
9296 @item -fipa-reference-addressable
9297 @opindex fipa-reference-addressable
9298 Discover read-only, write-only and non-addressable static variables.
9299 Enabled by default at @option{-O} and higher.
9301 @item -fipa-stack-alignment
9302 @opindex fipa-stack-alignment
9303 Reduce stack alignment on call sites if possible.
9304 Enabled by default.
9306 @item -fipa-pta
9307 @opindex fipa-pta
9308 Perform interprocedural pointer analysis and interprocedural modification
9309 and reference analysis.  This option can cause excessive memory and
9310 compile-time usage on large compilation units.  It is not enabled by
9311 default at any optimization level.
9313 @item -fipa-profile
9314 @opindex fipa-profile
9315 Perform interprocedural profile propagation.  The functions called only from
9316 cold functions are marked as cold. Also functions executed once (such as
9317 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
9318 functions and loop less parts of functions executed once are then optimized for
9319 size.
9320 Enabled by default at @option{-O} and higher.
9322 @item -fipa-cp
9323 @opindex fipa-cp
9324 Perform interprocedural constant propagation.
9325 This optimization analyzes the program to determine when values passed
9326 to functions are constants and then optimizes accordingly.
9327 This optimization can substantially increase performance
9328 if the application has constants passed to functions.
9329 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
9330 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
9332 @item -fipa-cp-clone
9333 @opindex fipa-cp-clone
9334 Perform function cloning to make interprocedural constant propagation stronger.
9335 When enabled, interprocedural constant propagation performs function cloning
9336 when externally visible function can be called with constant arguments.
9337 Because this optimization can create multiple copies of functions,
9338 it may significantly increase code size
9339 (see @option{--param ipcp-unit-growth=@var{value}}).
9340 This flag is enabled by default at @option{-O3}.
9341 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
9343 @item -fipa-bit-cp
9344 @opindex fipa-bit-cp
9345 When enabled, perform interprocedural bitwise constant
9346 propagation. This flag is enabled by default at @option{-O2} and
9347 by @option{-fprofile-use} and @option{-fauto-profile}.
9348 It requires that @option{-fipa-cp} is enabled.  
9350 @item -fipa-vrp
9351 @opindex fipa-vrp
9352 When enabled, perform interprocedural propagation of value
9353 ranges. This flag is enabled by default at @option{-O2}. It requires
9354 that @option{-fipa-cp} is enabled.
9356 @item -fipa-icf
9357 @opindex fipa-icf
9358 Perform Identical Code Folding for functions and read-only variables.
9359 The optimization reduces code size and may disturb unwind stacks by replacing
9360 a function by equivalent one with a different name. The optimization works
9361 more effectively with link-time optimization enabled.
9363 Although the behavior is similar to the Gold Linker's ICF optimization, GCC ICF
9364 works on different levels and thus the optimizations are not same - there are
9365 equivalences that are found only by GCC and equivalences found only by Gold.
9367 This flag is enabled by default at @option{-O2} and @option{-Os}.
9369 @item -flive-patching=@var{level}
9370 @opindex flive-patching
9371 Control GCC's optimizations to produce output suitable for live-patching.
9373 If the compiler's optimization uses a function's body or information extracted
9374 from its body to optimize/change another function, the latter is called an
9375 impacted function of the former.  If a function is patched, its impacted
9376 functions should be patched too.
9378 The impacted functions are determined by the compiler's interprocedural
9379 optimizations.  For example, a caller is impacted when inlining a function
9380 into its caller,
9381 cloning a function and changing its caller to call this new clone,
9382 or extracting a function's pureness/constness information to optimize
9383 its direct or indirect callers, etc.
9385 Usually, the more IPA optimizations enabled, the larger the number of
9386 impacted functions for each function.  In order to control the number of
9387 impacted functions and more easily compute the list of impacted function,
9388 IPA optimizations can be partially enabled at two different levels.
9390 The @var{level} argument should be one of the following:
9392 @table @samp
9394 @item inline-clone
9396 Only enable inlining and cloning optimizations, which includes inlining,
9397 cloning, interprocedural scalar replacement of aggregates and partial inlining.
9398 As a result, when patching a function, all its callers and its clones'
9399 callers are impacted, therefore need to be patched as well.
9401 @option{-flive-patching=inline-clone} disables the following optimization flags:
9402 @gccoptlist{-fwhole-program  -fipa-pta  -fipa-reference  -fipa-ra @gol
9403 -fipa-icf  -fipa-icf-functions  -fipa-icf-variables @gol
9404 -fipa-bit-cp  -fipa-vrp  -fipa-pure-const  -fipa-reference-addressable @gol
9405 -fipa-stack-alignment}
9407 @item inline-only-static
9409 Only enable inlining of static functions.
9410 As a result, when patching a static function, all its callers are impacted
9411 and so need to be patched as well.
9413 In addition to all the flags that @option{-flive-patching=inline-clone}
9414 disables,
9415 @option{-flive-patching=inline-only-static} disables the following additional
9416 optimization flags:
9417 @gccoptlist{-fipa-cp-clone  -fipa-sra  -fpartial-inlining  -fipa-cp}
9419 @end table
9421 When @option{-flive-patching} is specified without any value, the default value
9422 is @var{inline-clone}.
9424 This flag is disabled by default.
9426 Note that @option{-flive-patching} is not supported with link-time optimization
9427 (@option{-flto}).
9429 @item -fisolate-erroneous-paths-dereference
9430 @opindex fisolate-erroneous-paths-dereference
9431 Detect paths that trigger erroneous or undefined behavior due to
9432 dereferencing a null pointer.  Isolate those paths from the main control
9433 flow and turn the statement with erroneous or undefined behavior into a trap.
9434 This flag is enabled by default at @option{-O2} and higher and depends on
9435 @option{-fdelete-null-pointer-checks} also being enabled.
9437 @item -fisolate-erroneous-paths-attribute
9438 @opindex fisolate-erroneous-paths-attribute
9439 Detect paths that trigger erroneous or undefined behavior due to a null value
9440 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
9441 attribute.  Isolate those paths from the main control flow and turn the
9442 statement with erroneous or undefined behavior into a trap.  This is not
9443 currently enabled, but may be enabled by @option{-O2} in the future.
9445 @item -ftree-sink
9446 @opindex ftree-sink
9447 Perform forward store motion on trees.  This flag is
9448 enabled by default at @option{-O} and higher.
9450 @item -ftree-bit-ccp
9451 @opindex ftree-bit-ccp
9452 Perform sparse conditional bit constant propagation on trees and propagate
9453 pointer alignment information.
9454 This pass only operates on local scalar variables and is enabled by default
9455 at @option{-O1} and higher, except for @option{-Og}.
9456 It requires that @option{-ftree-ccp} is enabled.
9458 @item -ftree-ccp
9459 @opindex ftree-ccp
9460 Perform sparse conditional constant propagation (CCP) on trees.  This
9461 pass only operates on local scalar variables and is enabled by default
9462 at @option{-O} and higher.
9464 @item -fssa-backprop
9465 @opindex fssa-backprop
9466 Propagate information about uses of a value up the definition chain
9467 in order to simplify the definitions.  For example, this pass strips
9468 sign operations if the sign of a value never matters.  The flag is
9469 enabled by default at @option{-O} and higher.
9471 @item -fssa-phiopt
9472 @opindex fssa-phiopt
9473 Perform pattern matching on SSA PHI nodes to optimize conditional
9474 code.  This pass is enabled by default at @option{-O1} and higher,
9475 except for @option{-Og}.
9477 @item -ftree-switch-conversion
9478 @opindex ftree-switch-conversion
9479 Perform conversion of simple initializations in a switch to
9480 initializations from a scalar array.  This flag is enabled by default
9481 at @option{-O2} and higher.
9483 @item -ftree-tail-merge
9484 @opindex ftree-tail-merge
9485 Look for identical code sequences.  When found, replace one with a jump to the
9486 other.  This optimization is known as tail merging or cross jumping.  This flag
9487 is enabled by default at @option{-O2} and higher.  The compilation time
9488 in this pass can
9489 be limited using @option{max-tail-merge-comparisons} parameter and
9490 @option{max-tail-merge-iterations} parameter.
9492 @item -ftree-dce
9493 @opindex ftree-dce
9494 Perform dead code elimination (DCE) on trees.  This flag is enabled by
9495 default at @option{-O} and higher.
9497 @item -ftree-builtin-call-dce
9498 @opindex ftree-builtin-call-dce
9499 Perform conditional dead code elimination (DCE) for calls to built-in functions
9500 that may set @code{errno} but are otherwise free of side effects.  This flag is
9501 enabled by default at @option{-O2} and higher if @option{-Os} is not also
9502 specified.
9504 @item -ftree-dominator-opts
9505 @opindex ftree-dominator-opts
9506 Perform a variety of simple scalar cleanups (constant/copy
9507 propagation, redundancy elimination, range propagation and expression
9508 simplification) based on a dominator tree traversal.  This also
9509 performs jump threading (to reduce jumps to jumps). This flag is
9510 enabled by default at @option{-O} and higher.
9512 @item -ftree-dse
9513 @opindex ftree-dse
9514 Perform dead store elimination (DSE) on trees.  A dead store is a store into
9515 a memory location that is later overwritten by another store without
9516 any intervening loads.  In this case the earlier store can be deleted.  This
9517 flag is enabled by default at @option{-O} and higher.
9519 @item -ftree-ch
9520 @opindex ftree-ch
9521 Perform loop header copying on trees.  This is beneficial since it increases
9522 effectiveness of code motion optimizations.  It also saves one jump.  This flag
9523 is enabled by default at @option{-O} and higher.  It is not enabled
9524 for @option{-Os}, since it usually increases code size.
9526 @item -ftree-loop-optimize
9527 @opindex ftree-loop-optimize
9528 Perform loop optimizations on trees.  This flag is enabled by default
9529 at @option{-O} and higher.
9531 @item -ftree-loop-linear
9532 @itemx -floop-strip-mine
9533 @itemx -floop-block
9534 @opindex ftree-loop-linear
9535 @opindex floop-strip-mine
9536 @opindex floop-block
9537 Perform loop nest optimizations.  Same as
9538 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
9539 to be configured with @option{--with-isl} to enable the Graphite loop
9540 transformation infrastructure.
9542 @item -fgraphite-identity
9543 @opindex fgraphite-identity
9544 Enable the identity transformation for graphite.  For every SCoP we generate
9545 the polyhedral representation and transform it back to gimple.  Using
9546 @option{-fgraphite-identity} we can check the costs or benefits of the
9547 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
9548 are also performed by the code generator isl, like index splitting and
9549 dead code elimination in loops.
9551 @item -floop-nest-optimize
9552 @opindex floop-nest-optimize
9553 Enable the isl based loop nest optimizer.  This is a generic loop nest
9554 optimizer based on the Pluto optimization algorithms.  It calculates a loop
9555 structure optimized for data-locality and parallelism.  This option
9556 is experimental.
9558 @item -floop-parallelize-all
9559 @opindex floop-parallelize-all
9560 Use the Graphite data dependence analysis to identify loops that can
9561 be parallelized.  Parallelize all the loops that can be analyzed to
9562 not contain loop carried dependences without checking that it is
9563 profitable to parallelize the loops.
9565 @item -ftree-coalesce-vars
9566 @opindex ftree-coalesce-vars
9567 While transforming the program out of the SSA representation, attempt to
9568 reduce copying by coalescing versions of different user-defined
9569 variables, instead of just compiler temporaries.  This may severely
9570 limit the ability to debug an optimized program compiled with
9571 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
9572 prevents SSA coalescing of user variables.  This option is enabled by
9573 default if optimization is enabled, and it does very little otherwise.
9575 @item -ftree-loop-if-convert
9576 @opindex ftree-loop-if-convert
9577 Attempt to transform conditional jumps in the innermost loops to
9578 branch-less equivalents.  The intent is to remove control-flow from
9579 the innermost loops in order to improve the ability of the
9580 vectorization pass to handle these loops.  This is enabled by default
9581 if vectorization is enabled.
9583 @item -ftree-loop-distribution
9584 @opindex ftree-loop-distribution
9585 Perform loop distribution.  This flag can improve cache performance on
9586 big loop bodies and allow further loop optimizations, like
9587 parallelization or vectorization, to take place.  For example, the loop
9588 @smallexample
9589 DO I = 1, N
9590   A(I) = B(I) + C
9591   D(I) = E(I) * F
9592 ENDDO
9593 @end smallexample
9594 is transformed to
9595 @smallexample
9596 DO I = 1, N
9597    A(I) = B(I) + C
9598 ENDDO
9599 DO I = 1, N
9600    D(I) = E(I) * F
9601 ENDDO
9602 @end smallexample
9603 This flag is enabled by default at @option{-O3}.
9604 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
9606 @item -ftree-loop-distribute-patterns
9607 @opindex ftree-loop-distribute-patterns
9608 Perform loop distribution of patterns that can be code generated with
9609 calls to a library.  This flag is enabled by default at @option{-O3}, and
9610 by @option{-fprofile-use} and @option{-fauto-profile}.
9612 This pass distributes the initialization loops and generates a call to
9613 memset zero.  For example, the loop
9614 @smallexample
9615 DO I = 1, N
9616   A(I) = 0
9617   B(I) = A(I) + I
9618 ENDDO
9619 @end smallexample
9620 is transformed to
9621 @smallexample
9622 DO I = 1, N
9623    A(I) = 0
9624 ENDDO
9625 DO I = 1, N
9626    B(I) = A(I) + I
9627 ENDDO
9628 @end smallexample
9629 and the initialization loop is transformed into a call to memset zero.
9630 This flag is enabled by default at @option{-O3}.
9631 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
9633 @item -floop-interchange
9634 @opindex floop-interchange
9635 Perform loop interchange outside of graphite.  This flag can improve cache
9636 performance on loop nest and allow further loop optimizations, like
9637 vectorization, to take place.  For example, the loop
9638 @smallexample
9639 for (int i = 0; i < N; i++)
9640   for (int j = 0; j < N; j++)
9641     for (int k = 0; k < N; k++)
9642       c[i][j] = c[i][j] + a[i][k]*b[k][j];
9643 @end smallexample
9644 is transformed to
9645 @smallexample
9646 for (int i = 0; i < N; i++)
9647   for (int k = 0; k < N; k++)
9648     for (int j = 0; j < N; j++)
9649       c[i][j] = c[i][j] + a[i][k]*b[k][j];
9650 @end smallexample
9651 This flag is enabled by default at @option{-O3}.
9652 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
9654 @item -floop-unroll-and-jam
9655 @opindex floop-unroll-and-jam
9656 Apply unroll and jam transformations on feasible loops.  In a loop
9657 nest this unrolls the outer loop by some factor and fuses the resulting
9658 multiple inner loops.  This flag is enabled by default at @option{-O3}.
9659 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
9661 @item -ftree-loop-im
9662 @opindex ftree-loop-im
9663 Perform loop invariant motion on trees.  This pass moves only invariants that
9664 are hard to handle at RTL level (function calls, operations that expand to
9665 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
9666 operands of conditions that are invariant out of the loop, so that we can use
9667 just trivial invariantness analysis in loop unswitching.  The pass also includes
9668 store motion.
9670 @item -ftree-loop-ivcanon
9671 @opindex ftree-loop-ivcanon
9672 Create a canonical counter for number of iterations in loops for which
9673 determining number of iterations requires complicated analysis.  Later
9674 optimizations then may determine the number easily.  Useful especially
9675 in connection with unrolling.
9677 @item -ftree-scev-cprop
9678 @opindex ftree-scev-cprop
9679 Perform final value replacement.  If a variable is modified in a loop
9680 in such a way that its value when exiting the loop can be determined using
9681 only its initial value and the number of loop iterations, replace uses of
9682 the final value by such a computation, provided it is sufficiently cheap.
9683 This reduces data dependencies and may allow further simplifications.
9684 Enabled by default at @option{-O} and higher.
9686 @item -fivopts
9687 @opindex fivopts
9688 Perform induction variable optimizations (strength reduction, induction
9689 variable merging and induction variable elimination) on trees.
9691 @item -ftree-parallelize-loops=n
9692 @opindex ftree-parallelize-loops
9693 Parallelize loops, i.e., split their iteration space to run in n threads.
9694 This is only possible for loops whose iterations are independent
9695 and can be arbitrarily reordered.  The optimization is only
9696 profitable on multiprocessor machines, for loops that are CPU-intensive,
9697 rather than constrained e.g.@: by memory bandwidth.  This option
9698 implies @option{-pthread}, and thus is only supported on targets
9699 that have support for @option{-pthread}.
9701 @item -ftree-pta
9702 @opindex ftree-pta
9703 Perform function-local points-to analysis on trees.  This flag is
9704 enabled by default at @option{-O1} and higher, except for @option{-Og}.
9706 @item -ftree-sra
9707 @opindex ftree-sra
9708 Perform scalar replacement of aggregates.  This pass replaces structure
9709 references with scalars to prevent committing structures to memory too
9710 early.  This flag is enabled by default at @option{-O1} and higher,
9711 except for @option{-Og}.
9713 @item -fstore-merging
9714 @opindex fstore-merging
9715 Perform merging of narrow stores to consecutive memory addresses.  This pass
9716 merges contiguous stores of immediate values narrower than a word into fewer
9717 wider stores to reduce the number of instructions.  This is enabled by default
9718 at @option{-O2} and higher as well as @option{-Os}.
9720 @item -ftree-ter
9721 @opindex ftree-ter
9722 Perform temporary expression replacement during the SSA->normal phase.  Single
9723 use/single def temporaries are replaced at their use location with their
9724 defining expression.  This results in non-GIMPLE code, but gives the expanders
9725 much more complex trees to work on resulting in better RTL generation.  This is
9726 enabled by default at @option{-O} and higher.
9728 @item -ftree-slsr
9729 @opindex ftree-slsr
9730 Perform straight-line strength reduction on trees.  This recognizes related
9731 expressions involving multiplications and replaces them by less expensive
9732 calculations when possible.  This is enabled by default at @option{-O} and
9733 higher.
9735 @item -ftree-vectorize
9736 @opindex ftree-vectorize
9737 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
9738 and @option{-ftree-slp-vectorize} if not explicitly specified.
9740 @item -ftree-loop-vectorize
9741 @opindex ftree-loop-vectorize
9742 Perform loop vectorization on trees. This flag is enabled by default at
9743 @option{-O3} and by @option{-ftree-vectorize}, @option{-fprofile-use},
9744 and @option{-fauto-profile}.
9746 @item -ftree-slp-vectorize
9747 @opindex ftree-slp-vectorize
9748 Perform basic block vectorization on trees. This flag is enabled by default at
9749 @option{-O3} and by @option{-ftree-vectorize}, @option{-fprofile-use},
9750 and @option{-fauto-profile}.
9752 @item -fvect-cost-model=@var{model}
9753 @opindex fvect-cost-model
9754 Alter the cost model used for vectorization.  The @var{model} argument
9755 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
9756 With the @samp{unlimited} model the vectorized code-path is assumed
9757 to be profitable while with the @samp{dynamic} model a runtime check
9758 guards the vectorized code-path to enable it only for iteration
9759 counts that will likely execute faster than when executing the original
9760 scalar loop.  The @samp{cheap} model disables vectorization of
9761 loops where doing so would be cost prohibitive for example due to
9762 required runtime checks for data dependence or alignment but otherwise
9763 is equal to the @samp{dynamic} model.
9764 The default cost model depends on other optimization flags and is
9765 either @samp{dynamic} or @samp{cheap}.
9767 @item -fsimd-cost-model=@var{model}
9768 @opindex fsimd-cost-model
9769 Alter the cost model used for vectorization of loops marked with the OpenMP
9770 simd directive.  The @var{model} argument should be one of
9771 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
9772 have the same meaning as described in @option{-fvect-cost-model} and by
9773 default a cost model defined with @option{-fvect-cost-model} is used.
9775 @item -ftree-vrp
9776 @opindex ftree-vrp
9777 Perform Value Range Propagation on trees.  This is similar to the
9778 constant propagation pass, but instead of values, ranges of values are
9779 propagated.  This allows the optimizers to remove unnecessary range
9780 checks like array bound checks and null pointer checks.  This is
9781 enabled by default at @option{-O2} and higher.  Null pointer check
9782 elimination is only done if @option{-fdelete-null-pointer-checks} is
9783 enabled.
9785 @item -fsplit-paths
9786 @opindex fsplit-paths
9787 Split paths leading to loop backedges.  This can improve dead code
9788 elimination and common subexpression elimination.  This is enabled by
9789 default at @option{-O3} and above.
9791 @item -fsplit-ivs-in-unroller
9792 @opindex fsplit-ivs-in-unroller
9793 Enables expression of values of induction variables in later iterations
9794 of the unrolled loop using the value in the first iteration.  This breaks
9795 long dependency chains, thus improving efficiency of the scheduling passes.
9797 A combination of @option{-fweb} and CSE is often sufficient to obtain the
9798 same effect.  However, that is not reliable in cases where the loop body
9799 is more complicated than a single basic block.  It also does not work at all
9800 on some architectures due to restrictions in the CSE pass.
9802 This optimization is enabled by default.
9804 @item -fvariable-expansion-in-unroller
9805 @opindex fvariable-expansion-in-unroller
9806 With this option, the compiler creates multiple copies of some
9807 local variables when unrolling a loop, which can result in superior code.
9809 @item -fpartial-inlining
9810 @opindex fpartial-inlining
9811 Inline parts of functions.  This option has any effect only
9812 when inlining itself is turned on by the @option{-finline-functions}
9813 or @option{-finline-small-functions} options.
9815 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9817 @item -fpredictive-commoning
9818 @opindex fpredictive-commoning
9819 Perform predictive commoning optimization, i.e., reusing computations
9820 (especially memory loads and stores) performed in previous
9821 iterations of loops.
9823 This option is enabled at level @option{-O3}.
9824 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
9826 @item -fprefetch-loop-arrays
9827 @opindex fprefetch-loop-arrays
9828 If supported by the target machine, generate instructions to prefetch
9829 memory to improve the performance of loops that access large arrays.
9831 This option may generate better or worse code; results are highly
9832 dependent on the structure of loops within the source code.
9834 Disabled at level @option{-Os}.
9836 @item -fno-printf-return-value
9837 @opindex fno-printf-return-value
9838 @opindex fprintf-return-value
9839 Do not substitute constants for known return value of formatted output
9840 functions such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and
9841 @code{vsnprintf} (but not @code{printf} of @code{fprintf}).  This
9842 transformation allows GCC to optimize or even eliminate branches based
9843 on the known return value of these functions called with arguments that
9844 are either constant, or whose values are known to be in a range that
9845 makes determining the exact return value possible.  For example, when
9846 @option{-fprintf-return-value} is in effect, both the branch and the
9847 body of the @code{if} statement (but not the call to @code{snprint})
9848 can be optimized away when @code{i} is a 32-bit or smaller integer
9849 because the return value is guaranteed to be at most 8.
9851 @smallexample
9852 char buf[9];
9853 if (snprintf (buf, "%08x", i) >= sizeof buf)
9854   @dots{}
9855 @end smallexample
9857 The @option{-fprintf-return-value} option relies on other optimizations
9858 and yields best results with @option{-O2} and above.  It works in tandem
9859 with the @option{-Wformat-overflow} and @option{-Wformat-truncation}
9860 options.  The @option{-fprintf-return-value} option is enabled by default.
9862 @item -fno-peephole
9863 @itemx -fno-peephole2
9864 @opindex fno-peephole
9865 @opindex fpeephole
9866 @opindex fno-peephole2
9867 @opindex fpeephole2
9868 Disable any machine-specific peephole optimizations.  The difference
9869 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
9870 are implemented in the compiler; some targets use one, some use the
9871 other, a few use both.
9873 @option{-fpeephole} is enabled by default.
9874 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9876 @item -fno-guess-branch-probability
9877 @opindex fno-guess-branch-probability
9878 @opindex fguess-branch-probability
9879 Do not guess branch probabilities using heuristics.
9881 GCC uses heuristics to guess branch probabilities if they are
9882 not provided by profiling feedback (@option{-fprofile-arcs}).  These
9883 heuristics are based on the control flow graph.  If some branch probabilities
9884 are specified by @code{__builtin_expect}, then the heuristics are
9885 used to guess branch probabilities for the rest of the control flow graph,
9886 taking the @code{__builtin_expect} info into account.  The interactions
9887 between the heuristics and @code{__builtin_expect} can be complex, and in
9888 some cases, it may be useful to disable the heuristics so that the effects
9889 of @code{__builtin_expect} are easier to understand.
9891 It is also possible to specify expected probability of the expression
9892 with @code{__builtin_expect_with_probability} built-in function.
9894 The default is @option{-fguess-branch-probability} at levels
9895 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9897 @item -freorder-blocks
9898 @opindex freorder-blocks
9899 Reorder basic blocks in the compiled function in order to reduce number of
9900 taken branches and improve code locality.
9902 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9904 @item -freorder-blocks-algorithm=@var{algorithm}
9905 @opindex freorder-blocks-algorithm
9906 Use the specified algorithm for basic block reordering.  The
9907 @var{algorithm} argument can be @samp{simple}, which does not increase
9908 code size (except sometimes due to secondary effects like alignment),
9909 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
9910 put all often executed code together, minimizing the number of branches
9911 executed by making extra copies of code.
9913 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
9914 @samp{stc} at levels @option{-O2}, @option{-O3}.
9916 @item -freorder-blocks-and-partition
9917 @opindex freorder-blocks-and-partition
9918 In addition to reordering basic blocks in the compiled function, in order
9919 to reduce number of taken branches, partitions hot and cold basic blocks
9920 into separate sections of the assembly and @file{.o} files, to improve
9921 paging and cache locality performance.
9923 This optimization is automatically turned off in the presence of
9924 exception handling or unwind tables (on targets using setjump/longjump or target specific scheme), for linkonce sections, for functions with a user-defined
9925 section attribute and on any architecture that does not support named
9926 sections.  When @option{-fsplit-stack} is used this option is not
9927 enabled by default (to avoid linker errors), but may be enabled
9928 explicitly (if using a working linker).
9930 Enabled for x86 at levels @option{-O2}, @option{-O3}, @option{-Os}.
9932 @item -freorder-functions
9933 @opindex freorder-functions
9934 Reorder functions in the object file in order to
9935 improve code locality.  This is implemented by using special
9936 subsections @code{.text.hot} for most frequently executed functions and
9937 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
9938 the linker so object file format must support named sections and linker must
9939 place them in a reasonable way.
9941 This option isn't effective unless you either provide profile feedback
9942 (see @option{-fprofile-arcs} for details) or manually annotate functions with 
9943 @code{hot} or @code{cold} attributes (@pxref{Common Function Attributes}).
9945 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9947 @item -fstrict-aliasing
9948 @opindex fstrict-aliasing
9949 Allow the compiler to assume the strictest aliasing rules applicable to
9950 the language being compiled.  For C (and C++), this activates
9951 optimizations based on the type of expressions.  In particular, an
9952 object of one type is assumed never to reside at the same address as an
9953 object of a different type, unless the types are almost the same.  For
9954 example, an @code{unsigned int} can alias an @code{int}, but not a
9955 @code{void*} or a @code{double}.  A character type may alias any other
9956 type.
9958 @anchor{Type-punning}Pay special attention to code like this:
9959 @smallexample
9960 union a_union @{
9961   int i;
9962   double d;
9965 int f() @{
9966   union a_union t;
9967   t.d = 3.0;
9968   return t.i;
9970 @end smallexample
9971 The practice of reading from a different union member than the one most
9972 recently written to (called ``type-punning'') is common.  Even with
9973 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
9974 is accessed through the union type.  So, the code above works as
9975 expected.  @xref{Structures unions enumerations and bit-fields
9976 implementation}.  However, this code might not:
9977 @smallexample
9978 int f() @{
9979   union a_union t;
9980   int* ip;
9981   t.d = 3.0;
9982   ip = &t.i;
9983   return *ip;
9985 @end smallexample
9987 Similarly, access by taking the address, casting the resulting pointer
9988 and dereferencing the result has undefined behavior, even if the cast
9989 uses a union type, e.g.:
9990 @smallexample
9991 int f() @{
9992   double d = 3.0;
9993   return ((union a_union *) &d)->i;
9995 @end smallexample
9997 The @option{-fstrict-aliasing} option is enabled at levels
9998 @option{-O2}, @option{-O3}, @option{-Os}.
10000 @item -falign-functions
10001 @itemx -falign-functions=@var{n}
10002 @itemx -falign-functions=@var{n}:@var{m}
10003 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}
10004 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}:@var{m2}
10005 @opindex falign-functions
10006 Align the start of functions to the next power-of-two greater than
10007 @var{n}, skipping up to @var{m}-1 bytes.  This ensures that at least
10008 the first @var{m} bytes of the function can be fetched by the CPU
10009 without crossing an @var{n}-byte alignment boundary.
10011 If @var{m} is not specified, it defaults to @var{n}.
10013 Examples: @option{-falign-functions=32} aligns functions to the next
10014 32-byte boundary, @option{-falign-functions=24} aligns to the next
10015 32-byte boundary only if this can be done by skipping 23 bytes or less,
10016 @option{-falign-functions=32:7} aligns to the next
10017 32-byte boundary only if this can be done by skipping 6 bytes or less.
10019 The second pair of @var{n2}:@var{m2} values allows you to specify
10020 a secondary alignment: @option{-falign-functions=64:7:32:3} aligns to
10021 the next 64-byte boundary if this can be done by skipping 6 bytes or less,
10022 otherwise aligns to the next 32-byte boundary if this can be done
10023 by skipping 2 bytes or less.
10024 If @var{m2} is not specified, it defaults to @var{n2}.
10026 Some assemblers only support this flag when @var{n} is a power of two;
10027 in that case, it is rounded up.
10029 @option{-fno-align-functions} and @option{-falign-functions=1} are
10030 equivalent and mean that functions are not aligned.
10032 If @var{n} is not specified or is zero, use a machine-dependent default.
10033 The maximum allowed @var{n} option value is 65536.
10035 Enabled at levels @option{-O2}, @option{-O3}.
10037 @item -flimit-function-alignment
10038 If this option is enabled, the compiler tries to avoid unnecessarily
10039 overaligning functions. It attempts to instruct the assembler to align
10040 by the amount specified by @option{-falign-functions}, but not to
10041 skip more bytes than the size of the function.
10043 @item -falign-labels
10044 @itemx -falign-labels=@var{n}
10045 @itemx -falign-labels=@var{n}:@var{m}
10046 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}
10047 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}:@var{m2}
10048 @opindex falign-labels
10049 Align all branch targets to a power-of-two boundary.
10051 Parameters of this option are analogous to the @option{-falign-functions} option.
10052 @option{-fno-align-labels} and @option{-falign-labels=1} are
10053 equivalent and mean that labels are not aligned.
10055 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
10056 are greater than this value, then their values are used instead.
10058 If @var{n} is not specified or is zero, use a machine-dependent default
10059 which is very likely to be @samp{1}, meaning no alignment.
10060 The maximum allowed @var{n} option value is 65536.
10062 Enabled at levels @option{-O2}, @option{-O3}.
10064 @item -falign-loops
10065 @itemx -falign-loops=@var{n}
10066 @itemx -falign-loops=@var{n}:@var{m}
10067 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}
10068 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}:@var{m2}
10069 @opindex falign-loops
10070 Align loops to a power-of-two boundary.  If the loops are executed
10071 many times, this makes up for any execution of the dummy padding
10072 instructions.
10074 Parameters of this option are analogous to the @option{-falign-functions} option.
10075 @option{-fno-align-loops} and @option{-falign-loops=1} are
10076 equivalent and mean that loops are not aligned.
10077 The maximum allowed @var{n} option value is 65536.
10079 If @var{n} is not specified or is zero, use a machine-dependent default.
10081 Enabled at levels @option{-O2}, @option{-O3}.
10083 @item -falign-jumps
10084 @itemx -falign-jumps=@var{n}
10085 @itemx -falign-jumps=@var{n}:@var{m}
10086 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}
10087 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}:@var{m2}
10088 @opindex falign-jumps
10089 Align branch targets to a power-of-two boundary, for branch targets
10090 where the targets can only be reached by jumping.  In this case,
10091 no dummy operations need be executed.
10093 Parameters of this option are analogous to the @option{-falign-functions} option.
10094 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
10095 equivalent and mean that loops are not aligned.
10097 If @var{n} is not specified or is zero, use a machine-dependent default.
10098 The maximum allowed @var{n} option value is 65536.
10100 Enabled at levels @option{-O2}, @option{-O3}.
10102 @item -funit-at-a-time
10103 @opindex funit-at-a-time
10104 This option is left for compatibility reasons. @option{-funit-at-a-time}
10105 has no effect, while @option{-fno-unit-at-a-time} implies
10106 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
10108 Enabled by default.
10110 @item -fno-toplevel-reorder
10111 @opindex fno-toplevel-reorder
10112 @opindex ftoplevel-reorder
10113 Do not reorder top-level functions, variables, and @code{asm}
10114 statements.  Output them in the same order that they appear in the
10115 input file.  When this option is used, unreferenced static variables
10116 are not removed.  This option is intended to support existing code
10117 that relies on a particular ordering.  For new code, it is better to
10118 use attributes when possible.
10120 @option{-ftoplevel-reorder} is the default at @option{-O1} and higher, and
10121 also at @option{-O0} if @option{-fsection-anchors} is explicitly requested.
10122 Additionally @option{-fno-toplevel-reorder} implies
10123 @option{-fno-section-anchors}.
10125 @item -fweb
10126 @opindex fweb
10127 Constructs webs as commonly used for register allocation purposes and assign
10128 each web individual pseudo register.  This allows the register allocation pass
10129 to operate on pseudos directly, but also strengthens several other optimization
10130 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
10131 however, make debugging impossible, since variables no longer stay in a
10132 ``home register''.
10134 Enabled by default with @option{-funroll-loops}.
10136 @item -fwhole-program
10137 @opindex fwhole-program
10138 Assume that the current compilation unit represents the whole program being
10139 compiled.  All public functions and variables with the exception of @code{main}
10140 and those merged by attribute @code{externally_visible} become static functions
10141 and in effect are optimized more aggressively by interprocedural optimizers.
10143 This option should not be used in combination with @option{-flto}.
10144 Instead relying on a linker plugin should provide safer and more precise
10145 information.
10147 @item -flto[=@var{n}]
10148 @opindex flto
10149 This option runs the standard link-time optimizer.  When invoked
10150 with source code, it generates GIMPLE (one of GCC's internal
10151 representations) and writes it to special ELF sections in the object
10152 file.  When the object files are linked together, all the function
10153 bodies are read from these ELF sections and instantiated as if they
10154 had been part of the same translation unit.
10156 To use the link-time optimizer, @option{-flto} and optimization
10157 options should be specified at compile time and during the final link.
10158 It is recommended that you compile all the files participating in the
10159 same link with the same options and also specify those options at
10160 link time.  
10161 For example:
10163 @smallexample
10164 gcc -c -O2 -flto foo.c
10165 gcc -c -O2 -flto bar.c
10166 gcc -o myprog -flto -O2 foo.o bar.o
10167 @end smallexample
10169 The first two invocations to GCC save a bytecode representation
10170 of GIMPLE into special ELF sections inside @file{foo.o} and
10171 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
10172 @file{foo.o} and @file{bar.o}, merges the two files into a single
10173 internal image, and compiles the result as usual.  Since both
10174 @file{foo.o} and @file{bar.o} are merged into a single image, this
10175 causes all the interprocedural analyses and optimizations in GCC to
10176 work across the two files as if they were a single one.  This means,
10177 for example, that the inliner is able to inline functions in
10178 @file{bar.o} into functions in @file{foo.o} and vice-versa.
10180 Another (simpler) way to enable link-time optimization is:
10182 @smallexample
10183 gcc -o myprog -flto -O2 foo.c bar.c
10184 @end smallexample
10186 The above generates bytecode for @file{foo.c} and @file{bar.c},
10187 merges them together into a single GIMPLE representation and optimizes
10188 them as usual to produce @file{myprog}.
10190 The important thing to keep in mind is that to enable link-time
10191 optimizations you need to use the GCC driver to perform the link step.
10192 GCC automatically performs link-time optimization if any of the
10193 objects involved were compiled with the @option{-flto} command-line option.  
10194 You can always override
10195 the automatic decision to do link-time optimization
10196 by passing @option{-fno-lto} to the link command.
10198 To make whole program optimization effective, it is necessary to make
10199 certain whole program assumptions.  The compiler needs to know
10200 what functions and variables can be accessed by libraries and runtime
10201 outside of the link-time optimized unit.  When supported by the linker,
10202 the linker plugin (see @option{-fuse-linker-plugin}) passes information
10203 to the compiler about used and externally visible symbols.  When
10204 the linker plugin is not available, @option{-fwhole-program} should be
10205 used to allow the compiler to make these assumptions, which leads
10206 to more aggressive optimization decisions.
10208 When a file is compiled with @option{-flto} without
10209 @option{-fuse-linker-plugin}, the generated object file is larger than
10210 a regular object file because it contains GIMPLE bytecodes and the usual
10211 final code (see @option{-ffat-lto-objects}.  This means that
10212 object files with LTO information can be linked as normal object
10213 files; if @option{-fno-lto} is passed to the linker, no
10214 interprocedural optimizations are applied.  Note that when
10215 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
10216 but you cannot perform a regular, non-LTO link on them.
10218 When producing the final binary, GCC only
10219 applies link-time optimizations to those files that contain bytecode.
10220 Therefore, you can mix and match object files and libraries with
10221 GIMPLE bytecodes and final object code.  GCC automatically selects
10222 which files to optimize in LTO mode and which files to link without
10223 further processing.
10225 Generally, options specified at link time override those
10226 specified at compile time, although in some cases GCC attempts to infer
10227 link-time options from the settings used to compile the input files.
10229 If you do not specify an optimization level option @option{-O} at
10230 link time, then GCC uses the highest optimization level 
10231 used when compiling the object files.  Note that it is generally 
10232 ineffective to specify an optimization level option only at link time and 
10233 not at compile time, for two reasons.  First, compiling without 
10234 optimization suppresses compiler passes that gather information 
10235 needed for effective optimization at link time.  Second, some early
10236 optimization passes can be performed only at compile time and 
10237 not at link time.
10239 There are some code generation flags preserved by GCC when
10240 generating bytecodes, as they need to be used during the final link.
10241 Currently, the following options and their settings are taken from
10242 the first object file that explicitly specifies them: 
10243 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
10244 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
10245 and all the @option{-m} target flags.
10247 Certain ABI-changing flags are required to match in all compilation units,
10248 and trying to override this at link time with a conflicting value
10249 is ignored.  This includes options such as @option{-freg-struct-return}
10250 and @option{-fpcc-struct-return}. 
10252 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
10253 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
10254 are passed through to the link stage and merged conservatively for
10255 conflicting translation units.  Specifically
10256 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
10257 precedence; and for example @option{-ffp-contract=off} takes precedence
10258 over @option{-ffp-contract=fast}.  You can override them at link time.
10260 If LTO encounters objects with C linkage declared with incompatible
10261 types in separate translation units to be linked together (undefined
10262 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
10263 issued.  The behavior is still undefined at run time.  Similar
10264 diagnostics may be raised for other languages.
10266 Another feature of LTO is that it is possible to apply interprocedural
10267 optimizations on files written in different languages:
10269 @smallexample
10270 gcc -c -flto foo.c
10271 g++ -c -flto bar.cc
10272 gfortran -c -flto baz.f90
10273 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
10274 @end smallexample
10276 Notice that the final link is done with @command{g++} to get the C++
10277 runtime libraries and @option{-lgfortran} is added to get the Fortran
10278 runtime libraries.  In general, when mixing languages in LTO mode, you
10279 should use the same link command options as when mixing languages in a
10280 regular (non-LTO) compilation.
10282 If object files containing GIMPLE bytecode are stored in a library archive, say
10283 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
10284 are using a linker with plugin support.  To create static libraries suitable
10285 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
10286 and @command{ranlib}; 
10287 to show the symbols of object files with GIMPLE bytecode, use
10288 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
10289 and @command{nm} have been compiled with plugin support.  At link time, use the
10290 flag @option{-fuse-linker-plugin} to ensure that the library participates in
10291 the LTO optimization process:
10293 @smallexample
10294 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
10295 @end smallexample
10297 With the linker plugin enabled, the linker extracts the needed
10298 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
10299 to make them part of the aggregated GIMPLE image to be optimized.
10301 If you are not using a linker with plugin support and/or do not
10302 enable the linker plugin, then the objects inside @file{libfoo.a}
10303 are extracted and linked as usual, but they do not participate
10304 in the LTO optimization process.  In order to make a static library suitable
10305 for both LTO optimization and usual linkage, compile its object files with
10306 @option{-flto} @option{-ffat-lto-objects}.
10308 Link-time optimizations do not require the presence of the whole program to
10309 operate.  If the program does not require any symbols to be exported, it is
10310 possible to combine @option{-flto} and @option{-fwhole-program} to allow
10311 the interprocedural optimizers to use more aggressive assumptions which may
10312 lead to improved optimization opportunities.
10313 Use of @option{-fwhole-program} is not needed when linker plugin is
10314 active (see @option{-fuse-linker-plugin}).
10316 The current implementation of LTO makes no
10317 attempt to generate bytecode that is portable between different
10318 types of hosts.  The bytecode files are versioned and there is a
10319 strict version check, so bytecode files generated in one version of
10320 GCC do not work with an older or newer version of GCC.
10322 Link-time optimization does not work well with generation of debugging
10323 information on systems other than those using a combination of ELF and
10324 DWARF.
10326 If you specify the optional @var{n}, the optimization and code
10327 generation done at link time is executed in parallel using @var{n}
10328 parallel jobs by utilizing an installed @command{make} program.  The
10329 environment variable @env{MAKE} may be used to override the program
10330 used.  The default value for @var{n} is 1.
10332 You can also specify @option{-flto=jobserver} to use GNU make's
10333 job server mode to determine the number of parallel jobs. This
10334 is useful when the Makefile calling GCC is already executing in parallel.
10335 You must prepend a @samp{+} to the command recipe in the parent Makefile
10336 for this to work.  This option likely only works if @env{MAKE} is
10337 GNU make.
10339 @item -flto-partition=@var{alg}
10340 @opindex flto-partition
10341 Specify the partitioning algorithm used by the link-time optimizer.
10342 The value is either @samp{1to1} to specify a partitioning mirroring
10343 the original source files or @samp{balanced} to specify partitioning
10344 into equally sized chunks (whenever possible) or @samp{max} to create
10345 new partition for every symbol where possible.  Specifying @samp{none}
10346 as an algorithm disables partitioning and streaming completely. 
10347 The default value is @samp{balanced}. While @samp{1to1} can be used
10348 as an workaround for various code ordering issues, the @samp{max}
10349 partitioning is intended for internal testing only.
10350 The value @samp{one} specifies that exactly one partition should be
10351 used while the value @samp{none} bypasses partitioning and executes
10352 the link-time optimization step directly from the WPA phase.
10354 @item -flto-odr-type-merging
10355 @opindex flto-odr-type-merging
10356 Enable streaming of mangled types names of C++ types and their unification
10357 at link time.  This increases size of LTO object files, but enables
10358 diagnostics about One Definition Rule violations.
10360 @item -flto-compression-level=@var{n}
10361 @opindex flto-compression-level
10362 This option specifies the level of compression used for intermediate
10363 language written to LTO object files, and is only meaningful in
10364 conjunction with LTO mode (@option{-flto}).  Valid
10365 values are 0 (no compression) to 9 (maximum compression).  Values
10366 outside this range are clamped to either 0 or 9.  If the option is not
10367 given, a default balanced compression setting is used.
10369 @item -fuse-linker-plugin
10370 @opindex fuse-linker-plugin
10371 Enables the use of a linker plugin during link-time optimization.  This
10372 option relies on plugin support in the linker, which is available in gold
10373 or in GNU ld 2.21 or newer.
10375 This option enables the extraction of object files with GIMPLE bytecode out
10376 of library archives. This improves the quality of optimization by exposing
10377 more code to the link-time optimizer.  This information specifies what
10378 symbols can be accessed externally (by non-LTO object or during dynamic
10379 linking).  Resulting code quality improvements on binaries (and shared
10380 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
10381 See @option{-flto} for a description of the effect of this flag and how to
10382 use it.
10384 This option is enabled by default when LTO support in GCC is enabled
10385 and GCC was configured for use with
10386 a linker supporting plugins (GNU ld 2.21 or newer or gold).
10388 @item -ffat-lto-objects
10389 @opindex ffat-lto-objects
10390 Fat LTO objects are object files that contain both the intermediate language
10391 and the object code. This makes them usable for both LTO linking and normal
10392 linking. This option is effective only when compiling with @option{-flto}
10393 and is ignored at link time.
10395 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
10396 requires the complete toolchain to be aware of LTO. It requires a linker with
10397 linker plugin support for basic functionality.  Additionally,
10398 @command{nm}, @command{ar} and @command{ranlib}
10399 need to support linker plugins to allow a full-featured build environment
10400 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
10401 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
10402 to these tools. With non fat LTO makefiles need to be modified to use them.
10404 Note that modern binutils provide plugin auto-load mechanism.
10405 Installing the linker plugin into @file{$libdir/bfd-plugins} has the same
10406 effect as usage of the command wrappers (@command{gcc-ar}, @command{gcc-nm} and
10407 @command{gcc-ranlib}).
10409 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
10410 support.
10412 @item -fcompare-elim
10413 @opindex fcompare-elim
10414 After register allocation and post-register allocation instruction splitting,
10415 identify arithmetic instructions that compute processor flags similar to a
10416 comparison operation based on that arithmetic.  If possible, eliminate the
10417 explicit comparison operation.
10419 This pass only applies to certain targets that cannot explicitly represent
10420 the comparison operation before register allocation is complete.
10422 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
10424 @item -fcprop-registers
10425 @opindex fcprop-registers
10426 After register allocation and post-register allocation instruction splitting,
10427 perform a copy-propagation pass to try to reduce scheduling dependencies
10428 and occasionally eliminate the copy.
10430 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
10432 @item -fprofile-correction
10433 @opindex fprofile-correction
10434 Profiles collected using an instrumented binary for multi-threaded programs may
10435 be inconsistent due to missed counter updates. When this option is specified,
10436 GCC uses heuristics to correct or smooth out such inconsistencies. By
10437 default, GCC emits an error message when an inconsistent profile is detected.
10439 This option is enabled by @option{-fauto-profile}.
10441 @item -fprofile-use
10442 @itemx -fprofile-use=@var{path}
10443 @opindex fprofile-use
10444 Enable profile feedback-directed optimizations, 
10445 and the following optimizations, many of which
10446 are generally profitable only with profile feedback available:
10448 @gccoptlist{-fbranch-probabilities  -fprofile-values @gol
10449 -funroll-loops  -fpeel-loops  -ftracer  -fvpt @gol
10450 -finline-functions  -fipa-cp  -fipa-cp-clone  -fipa-bit-cp @gol
10451 -fpredictive-commoning  -fsplit-loops  -funswitch-loops @gol
10452 -fgcse-after-reload  -ftree-loop-vectorize  -ftree-slp-vectorize @gol
10453 -fvect-cost-model=dynamic  -ftree-loop-distribute-patterns @gol
10454 -fprofile-reorder-functions}
10456 Before you can use this option, you must first generate profiling information.
10457 @xref{Instrumentation Options}, for information about the
10458 @option{-fprofile-generate} option.
10460 By default, GCC emits an error message if the feedback profiles do not
10461 match the source code.  This error can be turned into a warning by using
10462 @option{-Wno-error=coverage-mismatch}.  Note this may result in poorly
10463 optimized code.  Additionally, by default, GCC also emits a warning message if
10464 the feedback profiles do not exist (see @option{-Wmissing-profile}).
10466 If @var{path} is specified, GCC looks at the @var{path} to find
10467 the profile feedback data files. See @option{-fprofile-dir}.
10469 @item -fauto-profile
10470 @itemx -fauto-profile=@var{path}
10471 @opindex fauto-profile
10472 Enable sampling-based feedback-directed optimizations, 
10473 and the following optimizations,
10474 many of which are generally profitable only with profile feedback available:
10476 @gccoptlist{-fbranch-probabilities  -fprofile-values @gol
10477 -funroll-loops  -fpeel-loops  -ftracer  -fvpt @gol
10478 -finline-functions  -fipa-cp  -fipa-cp-clone  -fipa-bit-cp @gol
10479 -fpredictive-commoning  -fsplit-loops  -funswitch-loops @gol
10480 -fgcse-after-reload  -ftree-loop-vectorize  -ftree-slp-vectorize @gol
10481 -fvect-cost-model=dynamic  -ftree-loop-distribute-patterns @gol
10482 -fprofile-correction}
10484 @var{path} is the name of a file containing AutoFDO profile information.
10485 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
10487 Producing an AutoFDO profile data file requires running your program
10488 with the @command{perf} utility on a supported GNU/Linux target system.
10489 For more information, see @uref{https://perf.wiki.kernel.org/}.
10491 E.g.
10492 @smallexample
10493 perf record -e br_inst_retired:near_taken -b -o perf.data \
10494     -- your_program
10495 @end smallexample
10497 Then use the @command{create_gcov} tool to convert the raw profile data
10498 to a format that can be used by GCC.@  You must also supply the 
10499 unstripped binary for your program to this tool.  
10500 See @uref{https://github.com/google/autofdo}.
10502 E.g.
10503 @smallexample
10504 create_gcov --binary=your_program.unstripped --profile=perf.data \
10505     --gcov=profile.afdo
10506 @end smallexample
10507 @end table
10509 The following options control compiler behavior regarding floating-point 
10510 arithmetic.  These options trade off between speed and
10511 correctness.  All must be specifically enabled.
10513 @table @gcctabopt
10514 @item -ffloat-store
10515 @opindex ffloat-store
10516 Do not store floating-point variables in registers, and inhibit other
10517 options that might change whether a floating-point value is taken from a
10518 register or memory.
10520 @cindex floating-point precision
10521 This option prevents undesirable excess precision on machines such as
10522 the 68000 where the floating registers (of the 68881) keep more
10523 precision than a @code{double} is supposed to have.  Similarly for the
10524 x86 architecture.  For most programs, the excess precision does only
10525 good, but a few programs rely on the precise definition of IEEE floating
10526 point.  Use @option{-ffloat-store} for such programs, after modifying
10527 them to store all pertinent intermediate computations into variables.
10529 @item -fexcess-precision=@var{style}
10530 @opindex fexcess-precision
10531 This option allows further control over excess precision on machines
10532 where floating-point operations occur in a format with more precision or
10533 range than the IEEE standard and interchange floating-point types.  By
10534 default, @option{-fexcess-precision=fast} is in effect; this means that
10535 operations may be carried out in a wider precision than the types specified
10536 in the source if that would result in faster code, and it is unpredictable
10537 when rounding to the types specified in the source code takes place.
10538 When compiling C, if @option{-fexcess-precision=standard} is specified then
10539 excess precision follows the rules specified in ISO C99; in particular,
10540 both casts and assignments cause values to be rounded to their
10541 semantic types (whereas @option{-ffloat-store} only affects
10542 assignments).  This option is enabled by default for C if a strict
10543 conformance option such as @option{-std=c99} is used.
10544 @option{-ffast-math} enables @option{-fexcess-precision=fast} by default
10545 regardless of whether a strict conformance option is used.
10547 @opindex mfpmath
10548 @option{-fexcess-precision=standard} is not implemented for languages
10549 other than C.  On the x86, it has no effect if @option{-mfpmath=sse}
10550 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
10551 semantics apply without excess precision, and in the latter, rounding
10552 is unpredictable.
10554 @item -ffast-math
10555 @opindex ffast-math
10556 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
10557 @option{-ffinite-math-only}, @option{-fno-rounding-math},
10558 @option{-fno-signaling-nans}, @option{-fcx-limited-range} and
10559 @option{-fexcess-precision=fast}.
10561 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
10563 This option is not turned on by any @option{-O} option besides
10564 @option{-Ofast} since it can result in incorrect output for programs
10565 that depend on an exact implementation of IEEE or ISO rules/specifications
10566 for math functions. It may, however, yield faster code for programs
10567 that do not require the guarantees of these specifications.
10569 @item -fno-math-errno
10570 @opindex fno-math-errno
10571 @opindex fmath-errno
10572 Do not set @code{errno} after calling math functions that are executed
10573 with a single instruction, e.g., @code{sqrt}.  A program that relies on
10574 IEEE exceptions for math error handling may want to use this flag
10575 for speed while maintaining IEEE arithmetic compatibility.
10577 This option is not turned on by any @option{-O} option since
10578 it can result in incorrect output for programs that depend on
10579 an exact implementation of IEEE or ISO rules/specifications for
10580 math functions. It may, however, yield faster code for programs
10581 that do not require the guarantees of these specifications.
10583 The default is @option{-fmath-errno}.
10585 On Darwin systems, the math library never sets @code{errno}.  There is
10586 therefore no reason for the compiler to consider the possibility that
10587 it might, and @option{-fno-math-errno} is the default.
10589 @item -funsafe-math-optimizations
10590 @opindex funsafe-math-optimizations
10592 Allow optimizations for floating-point arithmetic that (a) assume
10593 that arguments and results are valid and (b) may violate IEEE or
10594 ANSI standards.  When used at link time, it may include libraries
10595 or startup files that change the default FPU control word or other
10596 similar optimizations.
10598 This option is not turned on by any @option{-O} option since
10599 it can result in incorrect output for programs that depend on
10600 an exact implementation of IEEE or ISO rules/specifications for
10601 math functions. It may, however, yield faster code for programs
10602 that do not require the guarantees of these specifications.
10603 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
10604 @option{-fassociative-math} and @option{-freciprocal-math}.
10606 The default is @option{-fno-unsafe-math-optimizations}.
10608 @item -fassociative-math
10609 @opindex fassociative-math
10611 Allow re-association of operands in series of floating-point operations.
10612 This violates the ISO C and C++ language standard by possibly changing
10613 computation result.  NOTE: re-ordering may change the sign of zero as
10614 well as ignore NaNs and inhibit or create underflow or overflow (and
10615 thus cannot be used on code that relies on rounding behavior like
10616 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
10617 and thus may not be used when ordered comparisons are required.
10618 This option requires that both @option{-fno-signed-zeros} and
10619 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
10620 much sense with @option{-frounding-math}. For Fortran the option
10621 is automatically enabled when both @option{-fno-signed-zeros} and
10622 @option{-fno-trapping-math} are in effect.
10624 The default is @option{-fno-associative-math}.
10626 @item -freciprocal-math
10627 @opindex freciprocal-math
10629 Allow the reciprocal of a value to be used instead of dividing by
10630 the value if this enables optimizations.  For example @code{x / y}
10631 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
10632 is subject to common subexpression elimination.  Note that this loses
10633 precision and increases the number of flops operating on the value.
10635 The default is @option{-fno-reciprocal-math}.
10637 @item -ffinite-math-only
10638 @opindex ffinite-math-only
10639 Allow optimizations for floating-point arithmetic that assume
10640 that arguments and results are not NaNs or +-Infs.
10642 This option is not turned on by any @option{-O} option since
10643 it can result in incorrect output for programs that depend on
10644 an exact implementation of IEEE or ISO rules/specifications for
10645 math functions. It may, however, yield faster code for programs
10646 that do not require the guarantees of these specifications.
10648 The default is @option{-fno-finite-math-only}.
10650 @item -fno-signed-zeros
10651 @opindex fno-signed-zeros
10652 @opindex fsigned-zeros
10653 Allow optimizations for floating-point arithmetic that ignore the
10654 signedness of zero.  IEEE arithmetic specifies the behavior of
10655 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
10656 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
10657 This option implies that the sign of a zero result isn't significant.
10659 The default is @option{-fsigned-zeros}.
10661 @item -fno-trapping-math
10662 @opindex fno-trapping-math
10663 @opindex ftrapping-math
10664 Compile code assuming that floating-point operations cannot generate
10665 user-visible traps.  These traps include division by zero, overflow,
10666 underflow, inexact result and invalid operation.  This option requires
10667 that @option{-fno-signaling-nans} be in effect.  Setting this option may
10668 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
10670 This option should never be turned on by any @option{-O} option since
10671 it can result in incorrect output for programs that depend on
10672 an exact implementation of IEEE or ISO rules/specifications for
10673 math functions.
10675 The default is @option{-ftrapping-math}.
10677 @item -frounding-math
10678 @opindex frounding-math
10679 Disable transformations and optimizations that assume default floating-point
10680 rounding behavior.  This is round-to-zero for all floating point
10681 to integer conversions, and round-to-nearest for all other arithmetic
10682 truncations.  This option should be specified for programs that change
10683 the FP rounding mode dynamically, or that may be executed with a
10684 non-default rounding mode.  This option disables constant folding of
10685 floating-point expressions at compile time (which may be affected by
10686 rounding mode) and arithmetic transformations that are unsafe in the
10687 presence of sign-dependent rounding modes.
10689 The default is @option{-fno-rounding-math}.
10691 This option is experimental and does not currently guarantee to
10692 disable all GCC optimizations that are affected by rounding mode.
10693 Future versions of GCC may provide finer control of this setting
10694 using C99's @code{FENV_ACCESS} pragma.  This command-line option
10695 will be used to specify the default state for @code{FENV_ACCESS}.
10697 @item -fsignaling-nans
10698 @opindex fsignaling-nans
10699 Compile code assuming that IEEE signaling NaNs may generate user-visible
10700 traps during floating-point operations.  Setting this option disables
10701 optimizations that may change the number of exceptions visible with
10702 signaling NaNs.  This option implies @option{-ftrapping-math}.
10704 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
10705 be defined.
10707 The default is @option{-fno-signaling-nans}.
10709 This option is experimental and does not currently guarantee to
10710 disable all GCC optimizations that affect signaling NaN behavior.
10712 @item -fno-fp-int-builtin-inexact
10713 @opindex fno-fp-int-builtin-inexact
10714 @opindex ffp-int-builtin-inexact
10715 Do not allow the built-in functions @code{ceil}, @code{floor},
10716 @code{round} and @code{trunc}, and their @code{float} and @code{long
10717 double} variants, to generate code that raises the ``inexact''
10718 floating-point exception for noninteger arguments.  ISO C99 and C11
10719 allow these functions to raise the ``inexact'' exception, but ISO/IEC
10720 TS 18661-1:2014, the C bindings to IEEE 754-2008, does not allow these
10721 functions to do so.
10723 The default is @option{-ffp-int-builtin-inexact}, allowing the
10724 exception to be raised.  This option does nothing unless
10725 @option{-ftrapping-math} is in effect.
10727 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
10728 generate a call to a library function then the ``inexact'' exception
10729 may be raised if the library implementation does not follow TS 18661.
10731 @item -fsingle-precision-constant
10732 @opindex fsingle-precision-constant
10733 Treat floating-point constants as single precision instead of
10734 implicitly converting them to double-precision constants.
10736 @item -fcx-limited-range
10737 @opindex fcx-limited-range
10738 When enabled, this option states that a range reduction step is not
10739 needed when performing complex division.  Also, there is no checking
10740 whether the result of a complex multiplication or division is @code{NaN
10741 + I*NaN}, with an attempt to rescue the situation in that case.  The
10742 default is @option{-fno-cx-limited-range}, but is enabled by
10743 @option{-ffast-math}.
10745 This option controls the default setting of the ISO C99
10746 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
10747 all languages.
10749 @item -fcx-fortran-rules
10750 @opindex fcx-fortran-rules
10751 Complex multiplication and division follow Fortran rules.  Range
10752 reduction is done as part of complex division, but there is no checking
10753 whether the result of a complex multiplication or division is @code{NaN
10754 + I*NaN}, with an attempt to rescue the situation in that case.
10756 The default is @option{-fno-cx-fortran-rules}.
10758 @end table
10760 The following options control optimizations that may improve
10761 performance, but are not enabled by any @option{-O} options.  This
10762 section includes experimental options that may produce broken code.
10764 @table @gcctabopt
10765 @item -fbranch-probabilities
10766 @opindex fbranch-probabilities
10767 After running a program compiled with @option{-fprofile-arcs}
10768 (@pxref{Instrumentation Options}),
10769 you can compile it a second time using
10770 @option{-fbranch-probabilities}, to improve optimizations based on
10771 the number of times each branch was taken.  When a program
10772 compiled with @option{-fprofile-arcs} exits, it saves arc execution
10773 counts to a file called @file{@var{sourcename}.gcda} for each source
10774 file.  The information in this data file is very dependent on the
10775 structure of the generated code, so you must use the same source code
10776 and the same optimization options for both compilations.
10778 With @option{-fbranch-probabilities}, GCC puts a
10779 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
10780 These can be used to improve optimization.  Currently, they are only
10781 used in one place: in @file{reorg.c}, instead of guessing which path a
10782 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
10783 exactly determine which path is taken more often.
10785 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10787 @item -fprofile-values
10788 @opindex fprofile-values
10789 If combined with @option{-fprofile-arcs}, it adds code so that some
10790 data about values of expressions in the program is gathered.
10792 With @option{-fbranch-probabilities}, it reads back the data gathered
10793 from profiling values of expressions for usage in optimizations.
10795 Enabled by @option{-fprofile-generate}, @option{-fprofile-use}, and
10796 @option{-fauto-profile}.
10798 @item -fprofile-reorder-functions
10799 @opindex fprofile-reorder-functions
10800 Function reordering based on profile instrumentation collects
10801 first time of execution of a function and orders these functions
10802 in ascending order.
10804 Enabled with @option{-fprofile-use}.
10806 @item -fvpt
10807 @opindex fvpt
10808 If combined with @option{-fprofile-arcs}, this option instructs the compiler
10809 to add code to gather information about values of expressions.
10811 With @option{-fbranch-probabilities}, it reads back the data gathered
10812 and actually performs the optimizations based on them.
10813 Currently the optimizations include specialization of division operations
10814 using the knowledge about the value of the denominator.
10816 Enabled with @option{-fprofile-use} and @option{-fauto-profile}.
10818 @item -frename-registers
10819 @opindex frename-registers
10820 Attempt to avoid false dependencies in scheduled code by making use
10821 of registers left over after register allocation.  This optimization
10822 most benefits processors with lots of registers.  Depending on the
10823 debug information format adopted by the target, however, it can
10824 make debugging impossible, since variables no longer stay in
10825 a ``home register''.
10827 Enabled by default with @option{-funroll-loops}.
10829 @item -fschedule-fusion
10830 @opindex fschedule-fusion
10831 Performs a target dependent pass over the instruction stream to schedule
10832 instructions of same type together because target machine can execute them
10833 more efficiently if they are adjacent to each other in the instruction flow.
10835 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10837 @item -ftracer
10838 @opindex ftracer
10839 Perform tail duplication to enlarge superblock size.  This transformation
10840 simplifies the control flow of the function allowing other optimizations to do
10841 a better job.
10843 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10845 @item -funroll-loops
10846 @opindex funroll-loops
10847 Unroll loops whose number of iterations can be determined at compile time or
10848 upon entry to the loop.  @option{-funroll-loops} implies
10849 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
10850 It also turns on complete loop peeling (i.e.@: complete removal of loops with
10851 a small constant number of iterations).  This option makes code larger, and may
10852 or may not make it run faster.
10854 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10856 @item -funroll-all-loops
10857 @opindex funroll-all-loops
10858 Unroll all loops, even if their number of iterations is uncertain when
10859 the loop is entered.  This usually makes programs run more slowly.
10860 @option{-funroll-all-loops} implies the same options as
10861 @option{-funroll-loops}.
10863 @item -fpeel-loops
10864 @opindex fpeel-loops
10865 Peels loops for which there is enough information that they do not
10866 roll much (from profile feedback or static analysis).  It also turns on
10867 complete loop peeling (i.e.@: complete removal of loops with small constant
10868 number of iterations).
10870 Enabled by @option{-O3}, @option{-fprofile-use}, and @option{-fauto-profile}.
10872 @item -fmove-loop-invariants
10873 @opindex fmove-loop-invariants
10874 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
10875 at level @option{-O1} and higher, except for @option{-Og}.
10877 @item -fsplit-loops
10878 @opindex fsplit-loops
10879 Split a loop into two if it contains a condition that's always true
10880 for one side of the iteration space and false for the other.
10882 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10884 @item -funswitch-loops
10885 @opindex funswitch-loops
10886 Move branches with loop invariant conditions out of the loop, with duplicates
10887 of the loop on both branches (modified according to result of the condition).
10889 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10891 @item -fversion-loops-for-strides
10892 @opindex fversion-loops-for-strides
10893 If a loop iterates over an array with a variable stride, create another
10894 version of the loop that assumes the stride is always one.  For example:
10896 @smallexample
10897 for (int i = 0; i < n; ++i)
10898   x[i * stride] = @dots{};
10899 @end smallexample
10901 becomes:
10903 @smallexample
10904 if (stride == 1)
10905   for (int i = 0; i < n; ++i)
10906     x[i] = @dots{};
10907 else
10908   for (int i = 0; i < n; ++i)
10909     x[i * stride] = @dots{};
10910 @end smallexample
10912 This is particularly useful for assumed-shape arrays in Fortran where
10913 (for example) it allows better vectorization assuming contiguous accesses.
10914 This flag is enabled by default at @option{-O3}.
10915 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10917 @item -ffunction-sections
10918 @itemx -fdata-sections
10919 @opindex ffunction-sections
10920 @opindex fdata-sections
10921 Place each function or data item into its own section in the output
10922 file if the target supports arbitrary sections.  The name of the
10923 function or the name of the data item determines the section's name
10924 in the output file.
10926 Use these options on systems where the linker can perform optimizations to
10927 improve locality of reference in the instruction space.  Most systems using the
10928 ELF object format have linkers with such optimizations.  On AIX, the linker
10929 rearranges sections (CSECTs) based on the call graph.  The performance impact
10930 varies.
10932 Together with a linker garbage collection (linker @option{--gc-sections}
10933 option) these options may lead to smaller statically-linked executables (after
10934 stripping).
10936 On ELF/DWARF systems these options do not degenerate the quality of the debug
10937 information.  There could be issues with other object files/debug info formats.
10939 Only use these options when there are significant benefits from doing so.  When
10940 you specify these options, the assembler and linker create larger object and
10941 executable files and are also slower.  These options affect code generation.
10942 They prevent optimizations by the compiler and assembler using relative
10943 locations inside a translation unit since the locations are unknown until
10944 link time.  An example of such an optimization is relaxing calls to short call
10945 instructions.
10947 @item -fbranch-target-load-optimize
10948 @opindex fbranch-target-load-optimize
10949 Perform branch target register load optimization before prologue / epilogue
10950 threading.
10951 The use of target registers can typically be exposed only during reload,
10952 thus hoisting loads out of loops and doing inter-block scheduling needs
10953 a separate optimization pass.
10955 @item -fbranch-target-load-optimize2
10956 @opindex fbranch-target-load-optimize2
10957 Perform branch target register load optimization after prologue / epilogue
10958 threading.
10960 @item -fbtr-bb-exclusive
10961 @opindex fbtr-bb-exclusive
10962 When performing branch target register load optimization, don't reuse
10963 branch target registers within any basic block.
10965 @item -fstdarg-opt
10966 @opindex fstdarg-opt
10967 Optimize the prologue of variadic argument functions with respect to usage of
10968 those arguments.
10970 @item -fsection-anchors
10971 @opindex fsection-anchors
10972 Try to reduce the number of symbolic address calculations by using
10973 shared ``anchor'' symbols to address nearby objects.  This transformation
10974 can help to reduce the number of GOT entries and GOT accesses on some
10975 targets.
10977 For example, the implementation of the following function @code{foo}:
10979 @smallexample
10980 static int a, b, c;
10981 int foo (void) @{ return a + b + c; @}
10982 @end smallexample
10984 @noindent
10985 usually calculates the addresses of all three variables, but if you
10986 compile it with @option{-fsection-anchors}, it accesses the variables
10987 from a common anchor point instead.  The effect is similar to the
10988 following pseudocode (which isn't valid C):
10990 @smallexample
10991 int foo (void)
10993   register int *xr = &x;
10994   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
10996 @end smallexample
10998 Not all targets support this option.
11000 @item --param @var{name}=@var{value}
11001 @opindex param
11002 In some places, GCC uses various constants to control the amount of
11003 optimization that is done.  For example, GCC does not inline functions
11004 that contain more than a certain number of instructions.  You can
11005 control some of these constants on the command line using the
11006 @option{--param} option.
11008 The names of specific parameters, and the meaning of the values, are
11009 tied to the internals of the compiler, and are subject to change
11010 without notice in future releases.
11012 In order to get minimal, maximal and default value of a parameter,
11013 one can use @option{--help=param -Q} options.
11015 In each case, the @var{value} is an integer.  The allowable choices for
11016 @var{name} are:
11018 @table @gcctabopt
11019 @item predictable-branch-outcome
11020 When branch is predicted to be taken with probability lower than this threshold
11021 (in percent), then it is considered well predictable.
11023 @item max-rtl-if-conversion-insns
11024 RTL if-conversion tries to remove conditional branches around a block and
11025 replace them with conditionally executed instructions.  This parameter
11026 gives the maximum number of instructions in a block which should be
11027 considered for if-conversion.  The compiler will
11028 also use other heuristics to decide whether if-conversion is likely to be
11029 profitable.
11031 @item max-rtl-if-conversion-predictable-cost
11032 @itemx max-rtl-if-conversion-unpredictable-cost
11033 RTL if-conversion will try to remove conditional branches around a block
11034 and replace them with conditionally executed instructions.  These parameters
11035 give the maximum permissible cost for the sequence that would be generated
11036 by if-conversion depending on whether the branch is statically determined
11037 to be predictable or not.  The units for this parameter are the same as
11038 those for the GCC internal seq_cost metric.  The compiler will try to
11039 provide a reasonable default for this parameter using the BRANCH_COST
11040 target macro.
11042 @item max-crossjump-edges
11043 The maximum number of incoming edges to consider for cross-jumping.
11044 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
11045 the number of edges incoming to each block.  Increasing values mean
11046 more aggressive optimization, making the compilation time increase with
11047 probably small improvement in executable size.
11049 @item min-crossjump-insns
11050 The minimum number of instructions that must be matched at the end
11051 of two blocks before cross-jumping is performed on them.  This
11052 value is ignored in the case where all instructions in the block being
11053 cross-jumped from are matched.
11055 @item max-grow-copy-bb-insns
11056 The maximum code size expansion factor when copying basic blocks
11057 instead of jumping.  The expansion is relative to a jump instruction.
11059 @item max-goto-duplication-insns
11060 The maximum number of instructions to duplicate to a block that jumps
11061 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
11062 passes, GCC factors computed gotos early in the compilation process,
11063 and unfactors them as late as possible.  Only computed jumps at the
11064 end of a basic blocks with no more than max-goto-duplication-insns are
11065 unfactored.
11067 @item max-delay-slot-insn-search
11068 The maximum number of instructions to consider when looking for an
11069 instruction to fill a delay slot.  If more than this arbitrary number of
11070 instructions are searched, the time savings from filling the delay slot
11071 are minimal, so stop searching.  Increasing values mean more
11072 aggressive optimization, making the compilation time increase with probably
11073 small improvement in execution time.
11075 @item max-delay-slot-live-search
11076 When trying to fill delay slots, the maximum number of instructions to
11077 consider when searching for a block with valid live register
11078 information.  Increasing this arbitrarily chosen value means more
11079 aggressive optimization, increasing the compilation time.  This parameter
11080 should be removed when the delay slot code is rewritten to maintain the
11081 control-flow graph.
11083 @item max-gcse-memory
11084 The approximate maximum amount of memory that can be allocated in
11085 order to perform the global common subexpression elimination
11086 optimization.  If more memory than specified is required, the
11087 optimization is not done.
11089 @item max-gcse-insertion-ratio
11090 If the ratio of expression insertions to deletions is larger than this value
11091 for any expression, then RTL PRE inserts or removes the expression and thus
11092 leaves partially redundant computations in the instruction stream.
11094 @item max-pending-list-length
11095 The maximum number of pending dependencies scheduling allows
11096 before flushing the current state and starting over.  Large functions
11097 with few branches or calls can create excessively large lists which
11098 needlessly consume memory and resources.
11100 @item max-modulo-backtrack-attempts
11101 The maximum number of backtrack attempts the scheduler should make
11102 when modulo scheduling a loop.  Larger values can exponentially increase
11103 compilation time.
11105 @item max-inline-insns-single
11106 Several parameters control the tree inliner used in GCC@.
11107 This number sets the maximum number of instructions (counted in GCC's
11108 internal representation) in a single function that the tree inliner
11109 considers for inlining.  This only affects functions declared
11110 inline and methods implemented in a class declaration (C++).
11112 @item max-inline-insns-auto
11113 When you use @option{-finline-functions} (included in @option{-O3}),
11114 a lot of functions that would otherwise not be considered for inlining
11115 by the compiler are investigated.  To those functions, a different
11116 (more restrictive) limit compared to functions declared inline can
11117 be applied.
11119 @item max-inline-insns-small
11120 This is bound applied to calls which are considered relevant with
11121 @option{-finline-small-functions}.
11123 @item max-inline-insns-size
11124 This is bound applied to calls which are optimized for size. Small growth
11125 may be desirable to anticipate optimization oppurtunities exposed by inlining.
11127 @item uninlined-function-insns
11128 Number of instructions accounted by inliner for function overhead such as
11129 function prologue and epilogue.
11131 @item uninlined-function-time
11132 Extra time accounted by inliner for function overhead such as time needed to
11133 execute function prologue and epilogue
11135 @item uninlined-thunk-insns
11136 @item uninlined-thunk-time
11137 Same as @option{--param uninlined-function-insns} and
11138 @option{--param uninlined-function-time} but applied to function thunks
11140 @item inline-min-speedup
11141 When estimated performance improvement of caller + callee runtime exceeds this
11142 threshold (in percent), the function can be inlined regardless of the limit on
11143 @option{--param max-inline-insns-single} and @option{--param
11144 max-inline-insns-auto}.
11146 @item large-function-insns
11147 The limit specifying really large functions.  For functions larger than this
11148 limit after inlining, inlining is constrained by
11149 @option{--param large-function-growth}.  This parameter is useful primarily
11150 to avoid extreme compilation time caused by non-linear algorithms used by the
11151 back end.
11153 @item large-function-growth
11154 Specifies maximal growth of large function caused by inlining in percents.
11155 For example, parameter value 100 limits large function growth to 2.0 times
11156 the original size.
11158 @item large-unit-insns
11159 The limit specifying large translation unit.  Growth caused by inlining of
11160 units larger than this limit is limited by @option{--param inline-unit-growth}.
11161 For small units this might be too tight.
11162 For example, consider a unit consisting of function A
11163 that is inline and B that just calls A three times.  If B is small relative to
11164 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
11165 large units consisting of small inlineable functions, however, the overall unit
11166 growth limit is needed to avoid exponential explosion of code size.  Thus for
11167 smaller units, the size is increased to @option{--param large-unit-insns}
11168 before applying @option{--param inline-unit-growth}.
11170 @item inline-unit-growth
11171 Specifies maximal overall growth of the compilation unit caused by inlining.
11172 For example, parameter value 20 limits unit growth to 1.2 times the original
11173 size. Cold functions (either marked cold via an attribute or by profile
11174 feedback) are not accounted into the unit size.
11176 @item ipcp-unit-growth
11177 Specifies maximal overall growth of the compilation unit caused by
11178 interprocedural constant propagation.  For example, parameter value 10 limits
11179 unit growth to 1.1 times the original size.
11181 @item large-stack-frame
11182 The limit specifying large stack frames.  While inlining the algorithm is trying
11183 to not grow past this limit too much.
11185 @item large-stack-frame-growth
11186 Specifies maximal growth of large stack frames caused by inlining in percents.
11187 For example, parameter value 1000 limits large stack frame growth to 11 times
11188 the original size.
11190 @item max-inline-insns-recursive
11191 @itemx max-inline-insns-recursive-auto
11192 Specifies the maximum number of instructions an out-of-line copy of a
11193 self-recursive inline
11194 function can grow into by performing recursive inlining.
11196 @option{--param max-inline-insns-recursive} applies to functions
11197 declared inline.
11198 For functions not declared inline, recursive inlining
11199 happens only when @option{-finline-functions} (included in @option{-O3}) is
11200 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.
11202 @item max-inline-recursive-depth
11203 @itemx max-inline-recursive-depth-auto
11204 Specifies the maximum recursion depth used for recursive inlining.
11206 @option{--param max-inline-recursive-depth} applies to functions
11207 declared inline.  For functions not declared inline, recursive inlining
11208 happens only when @option{-finline-functions} (included in @option{-O3}) is
11209 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.
11211 @item min-inline-recursive-probability
11212 Recursive inlining is profitable only for function having deep recursion
11213 in average and can hurt for function having little recursion depth by
11214 increasing the prologue size or complexity of function body to other
11215 optimizers.
11217 When profile feedback is available (see @option{-fprofile-generate}) the actual
11218 recursion depth can be guessed from the probability that function recurses
11219 via a given call expression.  This parameter limits inlining only to call
11220 expressions whose probability exceeds the given threshold (in percents).
11222 @item early-inlining-insns
11223 Specify growth that the early inliner can make.  In effect it increases
11224 the amount of inlining for code having a large abstraction penalty.
11226 @item max-early-inliner-iterations
11227 Limit of iterations of the early inliner.  This basically bounds
11228 the number of nested indirect calls the early inliner can resolve.
11229 Deeper chains are still handled by late inlining.
11231 @item comdat-sharing-probability
11232 Probability (in percent) that C++ inline function with comdat visibility
11233 are shared across multiple compilation units.
11235 @item profile-func-internal-id
11236 A parameter to control whether to use function internal id in profile
11237 database lookup. If the value is 0, the compiler uses an id that
11238 is based on function assembler name and filename, which makes old profile
11239 data more tolerant to source changes such as function reordering etc.
11241 @item min-vect-loop-bound
11242 The minimum number of iterations under which loops are not vectorized
11243 when @option{-ftree-vectorize} is used.  The number of iterations after
11244 vectorization needs to be greater than the value specified by this option
11245 to allow vectorization.
11247 @item gcse-cost-distance-ratio
11248 Scaling factor in calculation of maximum distance an expression
11249 can be moved by GCSE optimizations.  This is currently supported only in the
11250 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
11251 is with simple expressions, i.e., the expressions that have cost
11252 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
11253 hoisting of simple expressions.
11255 @item gcse-unrestricted-cost
11256 Cost, roughly measured as the cost of a single typical machine
11257 instruction, at which GCSE optimizations do not constrain
11258 the distance an expression can travel.  This is currently
11259 supported only in the code hoisting pass.  The lesser the cost,
11260 the more aggressive code hoisting is.  Specifying 0 
11261 allows all expressions to travel unrestricted distances.
11263 @item max-hoist-depth
11264 The depth of search in the dominator tree for expressions to hoist.
11265 This is used to avoid quadratic behavior in hoisting algorithm.
11266 The value of 0 does not limit on the search, but may slow down compilation
11267 of huge functions.
11269 @item max-tail-merge-comparisons
11270 The maximum amount of similar bbs to compare a bb with.  This is used to
11271 avoid quadratic behavior in tree tail merging.
11273 @item max-tail-merge-iterations
11274 The maximum amount of iterations of the pass over the function.  This is used to
11275 limit compilation time in tree tail merging.
11277 @item store-merging-allow-unaligned
11278 Allow the store merging pass to introduce unaligned stores if it is legal to
11279 do so.
11281 @item max-stores-to-merge
11282 The maximum number of stores to attempt to merge into wider stores in the store
11283 merging pass.
11285 @item max-unrolled-insns
11286 The maximum number of instructions that a loop may have to be unrolled.
11287 If a loop is unrolled, this parameter also determines how many times
11288 the loop code is unrolled.
11290 @item max-average-unrolled-insns
11291 The maximum number of instructions biased by probabilities of their execution
11292 that a loop may have to be unrolled.  If a loop is unrolled,
11293 this parameter also determines how many times the loop code is unrolled.
11295 @item max-unroll-times
11296 The maximum number of unrollings of a single loop.
11298 @item max-peeled-insns
11299 The maximum number of instructions that a loop may have to be peeled.
11300 If a loop is peeled, this parameter also determines how many times
11301 the loop code is peeled.
11303 @item max-peel-times
11304 The maximum number of peelings of a single loop.
11306 @item max-peel-branches
11307 The maximum number of branches on the hot path through the peeled sequence.
11309 @item max-completely-peeled-insns
11310 The maximum number of insns of a completely peeled loop.
11312 @item max-completely-peel-times
11313 The maximum number of iterations of a loop to be suitable for complete peeling.
11315 @item max-completely-peel-loop-nest-depth
11316 The maximum depth of a loop nest suitable for complete peeling.
11318 @item max-unswitch-insns
11319 The maximum number of insns of an unswitched loop.
11321 @item max-unswitch-level
11322 The maximum number of branches unswitched in a single loop.
11324 @item lim-expensive
11325 The minimum cost of an expensive expression in the loop invariant motion.
11327 @item iv-consider-all-candidates-bound
11328 Bound on number of candidates for induction variables, below which
11329 all candidates are considered for each use in induction variable
11330 optimizations.  If there are more candidates than this,
11331 only the most relevant ones are considered to avoid quadratic time complexity.
11333 @item iv-max-considered-uses
11334 The induction variable optimizations give up on loops that contain more
11335 induction variable uses.
11337 @item iv-always-prune-cand-set-bound
11338 If the number of candidates in the set is smaller than this value,
11339 always try to remove unnecessary ivs from the set
11340 when adding a new one.
11342 @item avg-loop-niter
11343 Average number of iterations of a loop.
11345 @item dse-max-object-size
11346 Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
11347 Larger values may result in larger compilation times.
11349 @item dse-max-alias-queries-per-store
11350 Maximum number of queries into the alias oracle per store.
11351 Larger values result in larger compilation times and may result in more
11352 removed dead stores.
11354 @item scev-max-expr-size
11355 Bound on size of expressions used in the scalar evolutions analyzer.
11356 Large expressions slow the analyzer.
11358 @item scev-max-expr-complexity
11359 Bound on the complexity of the expressions in the scalar evolutions analyzer.
11360 Complex expressions slow the analyzer.
11362 @item max-tree-if-conversion-phi-args
11363 Maximum number of arguments in a PHI supported by TREE if conversion
11364 unless the loop is marked with simd pragma.
11366 @item vect-max-version-for-alignment-checks
11367 The maximum number of run-time checks that can be performed when
11368 doing loop versioning for alignment in the vectorizer.
11370 @item vect-max-version-for-alias-checks
11371 The maximum number of run-time checks that can be performed when
11372 doing loop versioning for alias in the vectorizer.
11374 @item vect-max-peeling-for-alignment
11375 The maximum number of loop peels to enhance access alignment
11376 for vectorizer. Value -1 means no limit.
11378 @item max-iterations-to-track
11379 The maximum number of iterations of a loop the brute-force algorithm
11380 for analysis of the number of iterations of the loop tries to evaluate.
11382 @item hot-bb-count-ws-permille
11383 A basic block profile count is considered hot if it contributes to 
11384 the given permillage (i.e.@: 0...1000) of the entire profiled execution.
11386 @item hot-bb-frequency-fraction
11387 Select fraction of the entry block frequency of executions of basic block in
11388 function given basic block needs to have to be considered hot.
11390 @item max-predicted-iterations
11391 The maximum number of loop iterations we predict statically.  This is useful
11392 in cases where a function contains a single loop with known bound and
11393 another loop with unknown bound.
11394 The known number of iterations is predicted correctly, while
11395 the unknown number of iterations average to roughly 10.  This means that the
11396 loop without bounds appears artificially cold relative to the other one.
11398 @item builtin-expect-probability
11399 Control the probability of the expression having the specified value. This
11400 parameter takes a percentage (i.e.@: 0 ... 100) as input.
11402 @item builtin-string-cmp-inline-length
11403 The maximum length of a constant string for a builtin string cmp call 
11404 eligible for inlining.
11406 @item align-threshold
11408 Select fraction of the maximal frequency of executions of a basic block in
11409 a function to align the basic block.
11411 @item align-loop-iterations
11413 A loop expected to iterate at least the selected number of iterations is
11414 aligned.
11416 @item tracer-dynamic-coverage
11417 @itemx tracer-dynamic-coverage-feedback
11419 This value is used to limit superblock formation once the given percentage of
11420 executed instructions is covered.  This limits unnecessary code size
11421 expansion.
11423 The @option{tracer-dynamic-coverage-feedback} parameter
11424 is used only when profile
11425 feedback is available.  The real profiles (as opposed to statically estimated
11426 ones) are much less balanced allowing the threshold to be larger value.
11428 @item tracer-max-code-growth
11429 Stop tail duplication once code growth has reached given percentage.  This is
11430 a rather artificial limit, as most of the duplicates are eliminated later in
11431 cross jumping, so it may be set to much higher values than is the desired code
11432 growth.
11434 @item tracer-min-branch-ratio
11436 Stop reverse growth when the reverse probability of best edge is less than this
11437 threshold (in percent).
11439 @item tracer-min-branch-probability
11440 @itemx tracer-min-branch-probability-feedback
11442 Stop forward growth if the best edge has probability lower than this
11443 threshold.
11445 Similarly to @option{tracer-dynamic-coverage} two parameters are
11446 provided.  @option{tracer-min-branch-probability-feedback} is used for
11447 compilation with profile feedback and @option{tracer-min-branch-probability}
11448 compilation without.  The value for compilation with profile feedback
11449 needs to be more conservative (higher) in order to make tracer
11450 effective.
11452 @item stack-clash-protection-guard-size
11453 Specify the size of the operating system provided stack guard as
11454 2 raised to @var{num} bytes.  Higher values may reduce the
11455 number of explicit probes, but a value larger than the operating system
11456 provided guard will leave code vulnerable to stack clash style attacks.
11458 @item stack-clash-protection-probe-interval
11459 Stack clash protection involves probing stack space as it is allocated.  This
11460 param controls the maximum distance between probes into the stack as 2 raised
11461 to @var{num} bytes.  Higher values may reduce the number of explicit probes, but a value
11462 larger than the operating system provided guard will leave code vulnerable to
11463 stack clash style attacks.
11465 @item max-cse-path-length
11467 The maximum number of basic blocks on path that CSE considers.
11469 @item max-cse-insns
11470 The maximum number of instructions CSE processes before flushing.
11472 @item ggc-min-expand
11474 GCC uses a garbage collector to manage its own memory allocation.  This
11475 parameter specifies the minimum percentage by which the garbage
11476 collector's heap should be allowed to expand between collections.
11477 Tuning this may improve compilation speed; it has no effect on code
11478 generation.
11480 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
11481 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
11482 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
11483 GCC is not able to calculate RAM on a particular platform, the lower
11484 bound of 30% is used.  Setting this parameter and
11485 @option{ggc-min-heapsize} to zero causes a full collection to occur at
11486 every opportunity.  This is extremely slow, but can be useful for
11487 debugging.
11489 @item ggc-min-heapsize
11491 Minimum size of the garbage collector's heap before it begins bothering
11492 to collect garbage.  The first collection occurs after the heap expands
11493 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
11494 tuning this may improve compilation speed, and has no effect on code
11495 generation.
11497 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
11498 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
11499 with a lower bound of 4096 (four megabytes) and an upper bound of
11500 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
11501 particular platform, the lower bound is used.  Setting this parameter
11502 very large effectively disables garbage collection.  Setting this
11503 parameter and @option{ggc-min-expand} to zero causes a full collection
11504 to occur at every opportunity.
11506 @item max-reload-search-insns
11507 The maximum number of instruction reload should look backward for equivalent
11508 register.  Increasing values mean more aggressive optimization, making the
11509 compilation time increase with probably slightly better performance.
11511 @item max-cselib-memory-locations
11512 The maximum number of memory locations cselib should take into account.
11513 Increasing values mean more aggressive optimization, making the compilation time
11514 increase with probably slightly better performance.
11516 @item max-sched-ready-insns
11517 The maximum number of instructions ready to be issued the scheduler should
11518 consider at any given time during the first scheduling pass.  Increasing
11519 values mean more thorough searches, making the compilation time increase
11520 with probably little benefit.
11522 @item max-sched-region-blocks
11523 The maximum number of blocks in a region to be considered for
11524 interblock scheduling.
11526 @item max-pipeline-region-blocks
11527 The maximum number of blocks in a region to be considered for
11528 pipelining in the selective scheduler.
11530 @item max-sched-region-insns
11531 The maximum number of insns in a region to be considered for
11532 interblock scheduling.
11534 @item max-pipeline-region-insns
11535 The maximum number of insns in a region to be considered for
11536 pipelining in the selective scheduler.
11538 @item min-spec-prob
11539 The minimum probability (in percents) of reaching a source block
11540 for interblock speculative scheduling.
11542 @item max-sched-extend-regions-iters
11543 The maximum number of iterations through CFG to extend regions.
11544 A value of 0 disables region extensions.
11546 @item max-sched-insn-conflict-delay
11547 The maximum conflict delay for an insn to be considered for speculative motion.
11549 @item sched-spec-prob-cutoff
11550 The minimal probability of speculation success (in percents), so that
11551 speculative insns are scheduled.
11553 @item sched-state-edge-prob-cutoff
11554 The minimum probability an edge must have for the scheduler to save its
11555 state across it.
11557 @item sched-mem-true-dep-cost
11558 Minimal distance (in CPU cycles) between store and load targeting same
11559 memory locations.
11561 @item selsched-max-lookahead
11562 The maximum size of the lookahead window of selective scheduling.  It is a
11563 depth of search for available instructions.
11565 @item selsched-max-sched-times
11566 The maximum number of times that an instruction is scheduled during
11567 selective scheduling.  This is the limit on the number of iterations
11568 through which the instruction may be pipelined.
11570 @item selsched-insns-to-rename
11571 The maximum number of best instructions in the ready list that are considered
11572 for renaming in the selective scheduler.
11574 @item sms-min-sc
11575 The minimum value of stage count that swing modulo scheduler
11576 generates.
11578 @item max-last-value-rtl
11579 The maximum size measured as number of RTLs that can be recorded in an expression
11580 in combiner for a pseudo register as last known value of that register.
11582 @item max-combine-insns
11583 The maximum number of instructions the RTL combiner tries to combine.
11585 @item integer-share-limit
11586 Small integer constants can use a shared data structure, reducing the
11587 compiler's memory usage and increasing its speed.  This sets the maximum
11588 value of a shared integer constant.
11590 @item ssp-buffer-size
11591 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
11592 protection when @option{-fstack-protection} is used.
11594 @item min-size-for-stack-sharing
11595 The minimum size of variables taking part in stack slot sharing when not
11596 optimizing.
11598 @item max-jump-thread-duplication-stmts
11599 Maximum number of statements allowed in a block that needs to be
11600 duplicated when threading jumps.
11602 @item max-fields-for-field-sensitive
11603 Maximum number of fields in a structure treated in
11604 a field sensitive manner during pointer analysis.
11606 @item prefetch-latency
11607 Estimate on average number of instructions that are executed before
11608 prefetch finishes.  The distance prefetched ahead is proportional
11609 to this constant.  Increasing this number may also lead to less
11610 streams being prefetched (see @option{simultaneous-prefetches}).
11612 @item simultaneous-prefetches
11613 Maximum number of prefetches that can run at the same time.
11615 @item l1-cache-line-size
11616 The size of cache line in L1 data cache, in bytes.
11618 @item l1-cache-size
11619 The size of L1 data cache, in kilobytes.
11621 @item l2-cache-size
11622 The size of L2 data cache, in kilobytes.
11624 @item prefetch-dynamic-strides
11625 Whether the loop array prefetch pass should issue software prefetch hints
11626 for strides that are non-constant.  In some cases this may be
11627 beneficial, though the fact the stride is non-constant may make it
11628 hard to predict when there is clear benefit to issuing these hints.
11630 Set to 1 if the prefetch hints should be issued for non-constant
11631 strides.  Set to 0 if prefetch hints should be issued only for strides that
11632 are known to be constant and below @option{prefetch-minimum-stride}.
11634 @item prefetch-minimum-stride
11635 Minimum constant stride, in bytes, to start using prefetch hints for.  If
11636 the stride is less than this threshold, prefetch hints will not be issued.
11638 This setting is useful for processors that have hardware prefetchers, in
11639 which case there may be conflicts between the hardware prefetchers and
11640 the software prefetchers.  If the hardware prefetchers have a maximum
11641 stride they can handle, it should be used here to improve the use of
11642 software prefetchers.
11644 A value of -1 means we don't have a threshold and therefore
11645 prefetch hints can be issued for any constant stride.
11647 This setting is only useful for strides that are known and constant.
11649 @item loop-interchange-max-num-stmts
11650 The maximum number of stmts in a loop to be interchanged.
11652 @item loop-interchange-stride-ratio
11653 The minimum ratio between stride of two loops for interchange to be profitable.
11655 @item min-insn-to-prefetch-ratio
11656 The minimum ratio between the number of instructions and the
11657 number of prefetches to enable prefetching in a loop.
11659 @item prefetch-min-insn-to-mem-ratio
11660 The minimum ratio between the number of instructions and the
11661 number of memory references to enable prefetching in a loop.
11663 @item use-canonical-types
11664 Whether the compiler should use the ``canonical'' type system.
11665 Should always be 1, which uses a more efficient internal
11666 mechanism for comparing types in C++ and Objective-C++.  However, if
11667 bugs in the canonical type system are causing compilation failures,
11668 set this value to 0 to disable canonical types.
11670 @item switch-conversion-max-branch-ratio
11671 Switch initialization conversion refuses to create arrays that are
11672 bigger than @option{switch-conversion-max-branch-ratio} times the number of
11673 branches in the switch.
11675 @item max-partial-antic-length
11676 Maximum length of the partial antic set computed during the tree
11677 partial redundancy elimination optimization (@option{-ftree-pre}) when
11678 optimizing at @option{-O3} and above.  For some sorts of source code
11679 the enhanced partial redundancy elimination optimization can run away,
11680 consuming all of the memory available on the host machine.  This
11681 parameter sets a limit on the length of the sets that are computed,
11682 which prevents the runaway behavior.  Setting a value of 0 for
11683 this parameter allows an unlimited set length.
11685 @item rpo-vn-max-loop-depth
11686 Maximum loop depth that is value-numbered optimistically.
11687 When the limit hits the innermost
11688 @var{rpo-vn-max-loop-depth} loops and the outermost loop in the
11689 loop nest are value-numbered optimistically and the remaining ones not.
11691 @item sccvn-max-alias-queries-per-access
11692 Maximum number of alias-oracle queries we perform when looking for
11693 redundancies for loads and stores.  If this limit is hit the search
11694 is aborted and the load or store is not considered redundant.  The
11695 number of queries is algorithmically limited to the number of
11696 stores on all paths from the load to the function entry.
11698 @item ira-max-loops-num
11699 IRA uses regional register allocation by default.  If a function
11700 contains more loops than the number given by this parameter, only at most
11701 the given number of the most frequently-executed loops form regions
11702 for regional register allocation.
11704 @item ira-max-conflict-table-size 
11705 Although IRA uses a sophisticated algorithm to compress the conflict
11706 table, the table can still require excessive amounts of memory for
11707 huge functions.  If the conflict table for a function could be more
11708 than the size in MB given by this parameter, the register allocator
11709 instead uses a faster, simpler, and lower-quality
11710 algorithm that does not require building a pseudo-register conflict table.  
11712 @item ira-loop-reserved-regs
11713 IRA can be used to evaluate more accurate register pressure in loops
11714 for decisions to move loop invariants (see @option{-O3}).  The number
11715 of available registers reserved for some other purposes is given
11716 by this parameter.  Default of the parameter
11717 is the best found from numerous experiments.
11719 @item lra-inheritance-ebb-probability-cutoff
11720 LRA tries to reuse values reloaded in registers in subsequent insns.
11721 This optimization is called inheritance.  EBB is used as a region to
11722 do this optimization.  The parameter defines a minimal fall-through
11723 edge probability in percentage used to add BB to inheritance EBB in
11724 LRA.  The default value was chosen
11725 from numerous runs of SPEC2000 on x86-64.
11727 @item loop-invariant-max-bbs-in-loop
11728 Loop invariant motion can be very expensive, both in compilation time and
11729 in amount of needed compile-time memory, with very large loops.  Loops
11730 with more basic blocks than this parameter won't have loop invariant
11731 motion optimization performed on them.
11733 @item loop-max-datarefs-for-datadeps
11734 Building data dependencies is expensive for very large loops.  This
11735 parameter limits the number of data references in loops that are
11736 considered for data dependence analysis.  These large loops are no
11737 handled by the optimizations using loop data dependencies.
11739 @item max-vartrack-size
11740 Sets a maximum number of hash table slots to use during variable
11741 tracking dataflow analysis of any function.  If this limit is exceeded
11742 with variable tracking at assignments enabled, analysis for that
11743 function is retried without it, after removing all debug insns from
11744 the function.  If the limit is exceeded even without debug insns, var
11745 tracking analysis is completely disabled for the function.  Setting
11746 the parameter to zero makes it unlimited.
11748 @item max-vartrack-expr-depth
11749 Sets a maximum number of recursion levels when attempting to map
11750 variable names or debug temporaries to value expressions.  This trades
11751 compilation time for more complete debug information.  If this is set too
11752 low, value expressions that are available and could be represented in
11753 debug information may end up not being used; setting this higher may
11754 enable the compiler to find more complex debug expressions, but compile
11755 time and memory use may grow.
11757 @item max-debug-marker-count
11758 Sets a threshold on the number of debug markers (e.g.@: begin stmt
11759 markers) to avoid complexity explosion at inlining or expanding to RTL.
11760 If a function has more such gimple stmts than the set limit, such stmts
11761 will be dropped from the inlined copy of a function, and from its RTL
11762 expansion.
11764 @item min-nondebug-insn-uid
11765 Use uids starting at this parameter for nondebug insns.  The range below
11766 the parameter is reserved exclusively for debug insns created by
11767 @option{-fvar-tracking-assignments}, but debug insns may get
11768 (non-overlapping) uids above it if the reserved range is exhausted.
11770 @item ipa-sra-ptr-growth-factor
11771 IPA-SRA replaces a pointer to an aggregate with one or more new
11772 parameters only when their cumulative size is less or equal to
11773 @option{ipa-sra-ptr-growth-factor} times the size of the original
11774 pointer parameter.
11776 @item sra-max-scalarization-size-Ospeed
11777 @itemx sra-max-scalarization-size-Osize
11778 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
11779 replace scalar parts of aggregates with uses of independent scalar
11780 variables.  These parameters control the maximum size, in storage units,
11781 of aggregate which is considered for replacement when compiling for
11782 speed
11783 (@option{sra-max-scalarization-size-Ospeed}) or size
11784 (@option{sra-max-scalarization-size-Osize}) respectively.
11786 @item tm-max-aggregate-size
11787 When making copies of thread-local variables in a transaction, this
11788 parameter specifies the size in bytes after which variables are
11789 saved with the logging functions as opposed to save/restore code
11790 sequence pairs.  This option only applies when using
11791 @option{-fgnu-tm}.
11793 @item graphite-max-nb-scop-params
11794 To avoid exponential effects in the Graphite loop transforms, the
11795 number of parameters in a Static Control Part (SCoP) is bounded.
11796 A value of zero can be used to lift
11797 the bound.  A variable whose value is unknown at compilation time and
11798 defined outside a SCoP is a parameter of the SCoP.
11800 @item loop-block-tile-size
11801 Loop blocking or strip mining transforms, enabled with
11802 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
11803 loop in the loop nest by a given number of iterations.  The strip
11804 length can be changed using the @option{loop-block-tile-size}
11805 parameter.
11807 @item ipa-cp-value-list-size
11808 IPA-CP attempts to track all possible values and types passed to a function's
11809 parameter in order to propagate them and perform devirtualization.
11810 @option{ipa-cp-value-list-size} is the maximum number of values and types it
11811 stores per one formal parameter of a function.
11813 @item ipa-cp-eval-threshold
11814 IPA-CP calculates its own score of cloning profitability heuristics
11815 and performs those cloning opportunities with scores that exceed
11816 @option{ipa-cp-eval-threshold}.
11818 @item ipa-cp-recursion-penalty
11819 Percentage penalty the recursive functions will receive when they
11820 are evaluated for cloning.
11822 @item ipa-cp-single-call-penalty
11823 Percentage penalty functions containing a single call to another
11824 function will receive when they are evaluated for cloning.
11826 @item ipa-max-agg-items
11827 IPA-CP is also capable to propagate a number of scalar values passed
11828 in an aggregate. @option{ipa-max-agg-items} controls the maximum
11829 number of such values per one parameter.
11831 @item ipa-cp-loop-hint-bonus
11832 When IPA-CP determines that a cloning candidate would make the number
11833 of iterations of a loop known, it adds a bonus of
11834 @option{ipa-cp-loop-hint-bonus} to the profitability score of
11835 the candidate.
11837 @item ipa-cp-array-index-hint-bonus
11838 When IPA-CP determines that a cloning candidate would make the index of
11839 an array access known, it adds a bonus of
11840 @option{ipa-cp-array-index-hint-bonus} to the profitability
11841 score of the candidate.
11843 @item ipa-max-aa-steps
11844 During its analysis of function bodies, IPA-CP employs alias analysis
11845 in order to track values pointed to by function parameters.  In order
11846 not spend too much time analyzing huge functions, it gives up and
11847 consider all memory clobbered after examining
11848 @option{ipa-max-aa-steps} statements modifying memory.
11850 @item lto-partitions
11851 Specify desired number of partitions produced during WHOPR compilation.
11852 The number of partitions should exceed the number of CPUs used for compilation.
11854 @item lto-min-partition
11855 Size of minimal partition for WHOPR (in estimated instructions).
11856 This prevents expenses of splitting very small programs into too many
11857 partitions.
11859 @item lto-max-partition
11860 Size of max partition for WHOPR (in estimated instructions).
11861 to provide an upper bound for individual size of partition.
11862 Meant to be used only with balanced partitioning.
11864 @item lto-max-streaming-parallelism
11865 Maximal number of parallel processes used for LTO streaming.
11867 @item cxx-max-namespaces-for-diagnostic-help
11868 The maximum number of namespaces to consult for suggestions when C++
11869 name lookup fails for an identifier.
11871 @item sink-frequency-threshold
11872 The maximum relative execution frequency (in percents) of the target block
11873 relative to a statement's original block to allow statement sinking of a
11874 statement.  Larger numbers result in more aggressive statement sinking.
11875 A small positive adjustment is applied for
11876 statements with memory operands as those are even more profitable so sink.
11878 @item max-stores-to-sink
11879 The maximum number of conditional store pairs that can be sunk.  Set to 0
11880 if either vectorization (@option{-ftree-vectorize}) or if-conversion
11881 (@option{-ftree-loop-if-convert}) is disabled.
11883 @item allow-store-data-races
11884 Allow optimizers to introduce new data races on stores.
11885 Set to 1 to allow, otherwise to 0.
11887 @item case-values-threshold
11888 The smallest number of different values for which it is best to use a
11889 jump-table instead of a tree of conditional branches.  If the value is
11890 0, use the default for the machine.
11892 @item jump-table-max-growth-ratio-for-size
11893 The maximum code size growth ratio when expanding
11894 into a jump table (in percent).  The parameter is used when
11895 optimizing for size.
11897 @item jump-table-max-growth-ratio-for-speed
11898 The maximum code size growth ratio when expanding
11899 into a jump table (in percent).  The parameter is used when
11900 optimizing for speed.
11902 @item tree-reassoc-width
11903 Set the maximum number of instructions executed in parallel in
11904 reassociated tree. This parameter overrides target dependent
11905 heuristics used by default if has non zero value.
11907 @item sched-pressure-algorithm
11908 Choose between the two available implementations of
11909 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
11910 and is the more likely to prevent instructions from being reordered.
11911 Algorithm 2 was designed to be a compromise between the relatively
11912 conservative approach taken by algorithm 1 and the rather aggressive
11913 approach taken by the default scheduler.  It relies more heavily on
11914 having a regular register file and accurate register pressure classes.
11915 See @file{haifa-sched.c} in the GCC sources for more details.
11917 The default choice depends on the target.
11919 @item max-slsr-cand-scan
11920 Set the maximum number of existing candidates that are considered when
11921 seeking a basis for a new straight-line strength reduction candidate.
11923 @item asan-globals
11924 Enable buffer overflow detection for global objects.  This kind
11925 of protection is enabled by default if you are using
11926 @option{-fsanitize=address} option.
11927 To disable global objects protection use @option{--param asan-globals=0}.
11929 @item asan-stack
11930 Enable buffer overflow detection for stack objects.  This kind of
11931 protection is enabled by default when using @option{-fsanitize=address}.
11932 To disable stack protection use @option{--param asan-stack=0} option.
11934 @item asan-instrument-reads
11935 Enable buffer overflow detection for memory reads.  This kind of
11936 protection is enabled by default when using @option{-fsanitize=address}.
11937 To disable memory reads protection use
11938 @option{--param asan-instrument-reads=0}.
11940 @item asan-instrument-writes
11941 Enable buffer overflow detection for memory writes.  This kind of
11942 protection is enabled by default when using @option{-fsanitize=address}.
11943 To disable memory writes protection use
11944 @option{--param asan-instrument-writes=0} option.
11946 @item asan-memintrin
11947 Enable detection for built-in functions.  This kind of protection
11948 is enabled by default when using @option{-fsanitize=address}.
11949 To disable built-in functions protection use
11950 @option{--param asan-memintrin=0}.
11952 @item asan-use-after-return
11953 Enable detection of use-after-return.  This kind of protection
11954 is enabled by default when using the @option{-fsanitize=address} option.
11955 To disable it use @option{--param asan-use-after-return=0}.
11957 Note: By default the check is disabled at run time.  To enable it,
11958 add @code{detect_stack_use_after_return=1} to the environment variable
11959 @env{ASAN_OPTIONS}.
11961 @item asan-instrumentation-with-call-threshold
11962 If number of memory accesses in function being instrumented
11963 is greater or equal to this number, use callbacks instead of inline checks.
11964 E.g. to disable inline code use
11965 @option{--param asan-instrumentation-with-call-threshold=0}.
11967 @item use-after-scope-direct-emission-threshold
11968 If the size of a local variable in bytes is smaller or equal to this
11969 number, directly poison (or unpoison) shadow memory instead of using
11970 run-time callbacks.
11972 @item max-fsm-thread-path-insns
11973 Maximum number of instructions to copy when duplicating blocks on a
11974 finite state automaton jump thread path.
11976 @item max-fsm-thread-length
11977 Maximum number of basic blocks on a finite state automaton jump thread
11978 path.
11980 @item max-fsm-thread-paths
11981 Maximum number of new jump thread paths to create for a finite state
11982 automaton.
11984 @item parloops-chunk-size
11985 Chunk size of omp schedule for loops parallelized by parloops.
11987 @item parloops-schedule
11988 Schedule type of omp schedule for loops parallelized by parloops (static,
11989 dynamic, guided, auto, runtime).
11991 @item parloops-min-per-thread
11992 The minimum number of iterations per thread of an innermost parallelized
11993 loop for which the parallelized variant is preferred over the single threaded
11994 one.  Note that for a parallelized loop nest the
11995 minimum number of iterations of the outermost loop per thread is two.
11997 @item max-ssa-name-query-depth
11998 Maximum depth of recursion when querying properties of SSA names in things
11999 like fold routines.  One level of recursion corresponds to following a
12000 use-def chain.
12002 @item hsa-gen-debug-stores
12003 Enable emission of special debug stores within HSA kernels which are
12004 then read and reported by libgomp plugin.  Generation of these stores
12005 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
12006 enable it.
12008 @item max-speculative-devirt-maydefs
12009 The maximum number of may-defs we analyze when looking for a must-def
12010 specifying the dynamic type of an object that invokes a virtual call
12011 we may be able to devirtualize speculatively.
12013 @item max-vrp-switch-assertions
12014 The maximum number of assertions to add along the default edge of a switch
12015 statement during VRP.
12017 @item unroll-jam-min-percent
12018 The minimum percentage of memory references that must be optimized
12019 away for the unroll-and-jam transformation to be considered profitable.
12021 @item unroll-jam-max-unroll
12022 The maximum number of times the outer loop should be unrolled by
12023 the unroll-and-jam transformation.
12025 @item max-rtl-if-conversion-unpredictable-cost
12026 Maximum permissible cost for the sequence that would be generated
12027 by the RTL if-conversion pass for a branch that is considered unpredictable.
12029 @item max-variable-expansions-in-unroller
12030 If @option{-fvariable-expansion-in-unroller} is used, the maximum number
12031 of times that an individual variable will be expanded during loop unrolling.
12033 @item tracer-min-branch-probability-feedback
12034 Stop forward growth if the probability of best edge is less than
12035 this threshold (in percent). Used when profile feedback is available.
12037 @item partial-inlining-entry-probability
12038 Maximum probability of the entry BB of split region
12039 (in percent relative to entry BB of the function)
12040 to make partial inlining happen.
12042 @item max-tracked-strlens
12043 Maximum number of strings for which strlen optimization pass will
12044 track string lengths.
12046 @item gcse-after-reload-partial-fraction
12047 The threshold ratio for performing partial redundancy
12048 elimination after reload.
12050 @item gcse-after-reload-critical-fraction
12051 The threshold ratio of critical edges execution count that
12052 permit performing redundancy elimination after reload.
12054 @item max-loop-header-insns
12055 The maximum number of insns in loop header duplicated
12056 by the copy loop headers pass.
12058 @item vect-epilogues-nomask
12059 Enable loop epilogue vectorization using smaller vector size.
12061 @item slp-max-insns-in-bb
12062 Maximum number of instructions in basic block to be
12063 considered for SLP vectorization.
12065 @item avoid-fma-max-bits
12066 Maximum number of bits for which we avoid creating FMAs.
12068 @item sms-loop-average-count-threshold
12069 A threshold on the average loop count considered by the swing modulo scheduler.
12071 @item sms-dfa-history
12072 The number of cycles the swing modulo scheduler considers when checking
12073 conflicts using DFA.
12075 @item hot-bb-count-fraction
12076 Select fraction of the maximal count of repetitions of basic block
12077 in program given basic block needs
12078 to have to be considered hot (used in non-LTO mode)
12080 @item max-inline-insns-recursive-auto
12081 The maximum number of instructions non-inline function
12082 can grow to via recursive inlining.
12084 @item graphite-allow-codegen-errors
12085 Whether codegen errors should be ICEs when @option{-fchecking}.
12087 @item sms-max-ii-factor
12088 A factor for tuning the upper bound that swing modulo scheduler
12089 uses for scheduling a loop.
12091 @item lra-max-considered-reload-pseudos
12092 The max number of reload pseudos which are considered during
12093 spilling a non-reload pseudo.
12095 @item max-pow-sqrt-depth
12096 Maximum depth of sqrt chains to use when synthesizing exponentiation
12097 by a real constant.
12099 @item max-dse-active-local-stores
12100 Maximum number of active local stores in RTL dead store elimination.
12102 @item asan-instrument-allocas
12103 Enable asan allocas/VLAs protection.
12105 @item max-iterations-computation-cost
12106 Bound on the cost of an expression to compute the number of iterations.
12108 @item max-isl-operations
12109 Maximum number of isl operations, 0 means unlimited.
12111 @item graphite-max-arrays-per-scop
12112 Maximum number of arrays per scop.
12114 @item max-vartrack-reverse-op-size
12115 Max. size of loc list for which reverse ops should be added.
12117 @item unlikely-bb-count-fraction
12118 The minimum fraction of profile runs a given basic block execution count
12119 must be not to be considered unlikely.
12121 @item tracer-dynamic-coverage-feedback
12122 The percentage of function, weighted by execution frequency,
12123 that must be covered by trace formation.
12124 Used when profile feedback is available.
12126 @item max-inline-recursive-depth-auto
12127 The maximum depth of recursive inlining for non-inline functions.
12129 @item fsm-scale-path-stmts
12130 Scale factor to apply to the number of statements in a threading path
12131 when comparing to the number of (scaled) blocks.
12133 @item fsm-maximum-phi-arguments
12134 Maximum number of arguments a PHI may have before the FSM threader
12135 will not try to thread through its block.
12137 @item uninit-control-dep-attempts
12138 Maximum number of nested calls to search for control dependencies
12139 during uninitialized variable analysis.
12141 @item indir-call-topn-profile
12142 Track top N target addresses in indirect-call profile.
12144 @item max-once-peeled-insns
12145 The maximum number of insns of a peeled loop that rolls only once.
12147 @item sra-max-scalarization-size-Osize
12148 Maximum size, in storage units, of an aggregate
12149 which should be considered for scalarization when compiling for size.
12151 @item fsm-scale-path-blocks
12152 Scale factor to apply to the number of blocks in a threading path
12153 when comparing to the number of (scaled) statements.
12155 @item sched-autopref-queue-depth
12156 Hardware autoprefetcher scheduler model control flag.
12157 Number of lookahead cycles the model looks into; at '
12158 ' only enable instruction sorting heuristic.
12160 @item loop-versioning-max-inner-insns
12161 The maximum number of instructions that an inner loop can have
12162 before the loop versioning pass considers it too big to copy.
12164 @item loop-versioning-max-outer-insns
12165 The maximum number of instructions that an outer loop can have
12166 before the loop versioning pass considers it too big to copy,
12167 discounting any instructions in inner loops that directly benefit
12168 from versioning.
12170 @end table
12171 @end table
12173 @node Instrumentation Options
12174 @section Program Instrumentation Options
12175 @cindex instrumentation options
12176 @cindex program instrumentation options
12177 @cindex run-time error checking options
12178 @cindex profiling options
12179 @cindex options, program instrumentation
12180 @cindex options, run-time error checking
12181 @cindex options, profiling
12183 GCC supports a number of command-line options that control adding
12184 run-time instrumentation to the code it normally generates.  
12185 For example, one purpose of instrumentation is collect profiling
12186 statistics for use in finding program hot spots, code coverage
12187 analysis, or profile-guided optimizations.
12188 Another class of program instrumentation is adding run-time checking 
12189 to detect programming errors like invalid pointer
12190 dereferences or out-of-bounds array accesses, as well as deliberately
12191 hostile attacks such as stack smashing or C++ vtable hijacking.
12192 There is also a general hook which can be used to implement other
12193 forms of tracing or function-level instrumentation for debug or
12194 program analysis purposes.
12196 @table @gcctabopt
12197 @cindex @command{prof}
12198 @cindex @command{gprof}
12199 @item -p
12200 @itemx -pg
12201 @opindex p
12202 @opindex pg
12203 Generate extra code to write profile information suitable for the
12204 analysis program @command{prof} (for @option{-p}) or @command{gprof}
12205 (for @option{-pg}).  You must use this option when compiling
12206 the source files you want data about, and you must also use it when
12207 linking.
12209 You can use the function attribute @code{no_instrument_function} to
12210 suppress profiling of individual functions when compiling with these options.
12211 @xref{Common Function Attributes}.
12213 @item -fprofile-arcs
12214 @opindex fprofile-arcs
12215 Add code so that program flow @dfn{arcs} are instrumented.  During
12216 execution the program records how many times each branch and call is
12217 executed and how many times it is taken or returns.  On targets that support
12218 constructors with priority support, profiling properly handles constructors,
12219 destructors and C++ constructors (and destructors) of classes which are used
12220 as a type of a global variable.
12222 When the compiled
12223 program exits it saves this data to a file called
12224 @file{@var{auxname}.gcda} for each source file.  The data may be used for
12225 profile-directed optimizations (@option{-fbranch-probabilities}), or for
12226 test coverage analysis (@option{-ftest-coverage}).  Each object file's
12227 @var{auxname} is generated from the name of the output file, if
12228 explicitly specified and it is not the final executable, otherwise it is
12229 the basename of the source file.  In both cases any suffix is removed
12230 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
12231 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
12232 @xref{Cross-profiling}.
12234 @cindex @command{gcov}
12235 @item --coverage
12236 @opindex coverage
12238 This option is used to compile and link code instrumented for coverage
12239 analysis.  The option is a synonym for @option{-fprofile-arcs}
12240 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
12241 linking).  See the documentation for those options for more details.
12243 @itemize
12245 @item
12246 Compile the source files with @option{-fprofile-arcs} plus optimization
12247 and code generation options.  For test coverage analysis, use the
12248 additional @option{-ftest-coverage} option.  You do not need to profile
12249 every source file in a program.
12251 @item
12252 Compile the source files additionally with @option{-fprofile-abs-path}
12253 to create absolute path names in the @file{.gcno} files.  This allows
12254 @command{gcov} to find the correct sources in projects where compilations
12255 occur with different working directories.
12257 @item
12258 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
12259 (the latter implies the former).
12261 @item
12262 Run the program on a representative workload to generate the arc profile
12263 information.  This may be repeated any number of times.  You can run
12264 concurrent instances of your program, and provided that the file system
12265 supports locking, the data files will be correctly updated.  Unless
12266 a strict ISO C dialect option is in effect, @code{fork} calls are
12267 detected and correctly handled without double counting.
12269 @item
12270 For profile-directed optimizations, compile the source files again with
12271 the same optimization and code generation options plus
12272 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
12273 Control Optimization}).
12275 @item
12276 For test coverage analysis, use @command{gcov} to produce human readable
12277 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
12278 @command{gcov} documentation for further information.
12280 @end itemize
12282 With @option{-fprofile-arcs}, for each function of your program GCC
12283 creates a program flow graph, then finds a spanning tree for the graph.
12284 Only arcs that are not on the spanning tree have to be instrumented: the
12285 compiler adds code to count the number of times that these arcs are
12286 executed.  When an arc is the only exit or only entrance to a block, the
12287 instrumentation code can be added to the block; otherwise, a new basic
12288 block must be created to hold the instrumentation code.
12290 @need 2000
12291 @item -ftest-coverage
12292 @opindex ftest-coverage
12293 Produce a notes file that the @command{gcov} code-coverage utility
12294 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
12295 show program coverage.  Each source file's note file is called
12296 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
12297 above for a description of @var{auxname} and instructions on how to
12298 generate test coverage data.  Coverage data matches the source files
12299 more closely if you do not optimize.
12301 @item -fprofile-abs-path
12302 @opindex fprofile-abs-path
12303 Automatically convert relative source file names to absolute path names
12304 in the @file{.gcno} files.  This allows @command{gcov} to find the correct
12305 sources in projects where compilations occur with different working
12306 directories.
12308 @item -fprofile-dir=@var{path}
12309 @opindex fprofile-dir
12311 Set the directory to search for the profile data files in to @var{path}.
12312 This option affects only the profile data generated by
12313 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
12314 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
12315 and its related options.  Both absolute and relative paths can be used.
12316 By default, GCC uses the current directory as @var{path}, thus the
12317 profile data file appears in the same directory as the object file.
12318 In order to prevent the file name clashing, if the object file name is
12319 not an absolute path, we mangle the absolute path of the
12320 @file{@var{sourcename}.gcda} file and use it as the file name of a
12321 @file{.gcda} file.
12323 When an executable is run in a massive parallel environment, it is recommended
12324 to save profile to different folders.  That can be done with variables
12325 in @var{path} that are exported during run-time:
12327 @table @gcctabopt
12329 @item %p
12330 process ID.
12332 @item %q@{VAR@}
12333 value of environment variable @var{VAR}
12335 @end table
12337 @item -fprofile-generate
12338 @itemx -fprofile-generate=@var{path}
12339 @opindex fprofile-generate
12341 Enable options usually used for instrumenting application to produce
12342 profile useful for later recompilation with profile feedback based
12343 optimization.  You must use @option{-fprofile-generate} both when
12344 compiling and when linking your program.
12346 The following options are enabled:
12347 @option{-fprofile-arcs}, @option{-fprofile-values},
12348 @option{-finline-functions}, and @option{-fipa-bit-cp}.
12350 If @var{path} is specified, GCC looks at the @var{path} to find
12351 the profile feedback data files. See @option{-fprofile-dir}.
12353 To optimize the program based on the collected profile information, use
12354 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
12356 @item -fprofile-update=@var{method}
12357 @opindex fprofile-update
12359 Alter the update method for an application instrumented for profile
12360 feedback based optimization.  The @var{method} argument should be one of
12361 @samp{single}, @samp{atomic} or @samp{prefer-atomic}.
12362 The first one is useful for single-threaded applications,
12363 while the second one prevents profile corruption by emitting thread-safe code.
12365 @strong{Warning:} When an application does not properly join all threads
12366 (or creates an detached thread), a profile file can be still corrupted.
12368 Using @samp{prefer-atomic} would be transformed either to @samp{atomic},
12369 when supported by a target, or to @samp{single} otherwise.  The GCC driver
12370 automatically selects @samp{prefer-atomic} when @option{-pthread}
12371 is present in the command line.
12373 @item -fprofile-filter-files=@var{regex}
12374 @opindex fprofile-filter-files
12376 Instrument only functions from files where names match
12377 any regular expression (separated by a semi-colon).
12379 For example, @option{-fprofile-filter-files=main.c;module.*.c} will instrument
12380 only @file{main.c} and all C files starting with 'module'.
12382 @item -fprofile-exclude-files=@var{regex}
12383 @opindex fprofile-exclude-files
12385 Instrument only functions from files where names do not match
12386 all the regular expressions (separated by a semi-colon).
12388 For example, @option{-fprofile-exclude-files=/usr/*} will prevent instrumentation
12389 of all files that are located in @file{/usr/} folder.
12391 @item -fsanitize=address
12392 @opindex fsanitize=address
12393 Enable AddressSanitizer, a fast memory error detector.
12394 Memory access instructions are instrumented to detect
12395 out-of-bounds and use-after-free bugs.
12396 The option enables @option{-fsanitize-address-use-after-scope}.
12397 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
12398 more details.  The run-time behavior can be influenced using the
12399 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
12400 the available options are shown at startup of the instrumented program.  See
12401 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
12402 for a list of supported options.
12403 The option cannot be combined with @option{-fsanitize=thread}.
12405 @item -fsanitize=kernel-address
12406 @opindex fsanitize=kernel-address
12407 Enable AddressSanitizer for Linux kernel.
12408 See @uref{https://github.com/google/kasan/wiki} for more details.
12410 @item -fsanitize=pointer-compare
12411 @opindex fsanitize=pointer-compare
12412 Instrument comparison operation (<, <=, >, >=) with pointer operands.
12413 The option must be combined with either @option{-fsanitize=kernel-address} or
12414 @option{-fsanitize=address}
12415 The option cannot be combined with @option{-fsanitize=thread}.
12416 Note: By default the check is disabled at run time.  To enable it,
12417 add @code{detect_invalid_pointer_pairs=2} to the environment variable
12418 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
12419 invalid operation only when both pointers are non-null.
12421 @item -fsanitize=pointer-subtract
12422 @opindex fsanitize=pointer-subtract
12423 Instrument subtraction with pointer operands.
12424 The option must be combined with either @option{-fsanitize=kernel-address} or
12425 @option{-fsanitize=address}
12426 The option cannot be combined with @option{-fsanitize=thread}.
12427 Note: By default the check is disabled at run time.  To enable it,
12428 add @code{detect_invalid_pointer_pairs=2} to the environment variable
12429 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
12430 invalid operation only when both pointers are non-null.
12432 @item -fsanitize=thread
12433 @opindex fsanitize=thread
12434 Enable ThreadSanitizer, a fast data race detector.
12435 Memory access instructions are instrumented to detect
12436 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
12437 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
12438 environment variable; see
12439 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
12440 supported options.
12441 The option cannot be combined with @option{-fsanitize=address},
12442 @option{-fsanitize=leak}.
12444 Note that sanitized atomic builtins cannot throw exceptions when
12445 operating on invalid memory addresses with non-call exceptions
12446 (@option{-fnon-call-exceptions}).
12448 @item -fsanitize=leak
12449 @opindex fsanitize=leak
12450 Enable LeakSanitizer, a memory leak detector.
12451 This option only matters for linking of executables and
12452 the executable is linked against a library that overrides @code{malloc}
12453 and other allocator functions.  See
12454 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
12455 details.  The run-time behavior can be influenced using the
12456 @env{LSAN_OPTIONS} environment variable.
12457 The option cannot be combined with @option{-fsanitize=thread}.
12459 @item -fsanitize=undefined
12460 @opindex fsanitize=undefined
12461 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
12462 Various computations are instrumented to detect undefined behavior
12463 at runtime.  Current suboptions are:
12465 @table @gcctabopt
12467 @item -fsanitize=shift
12468 @opindex fsanitize=shift
12469 This option enables checking that the result of a shift operation is
12470 not undefined.  Note that what exactly is considered undefined differs
12471 slightly between C and C++, as well as between ISO C90 and C99, etc.
12472 This option has two suboptions, @option{-fsanitize=shift-base} and
12473 @option{-fsanitize=shift-exponent}.
12475 @item -fsanitize=shift-exponent
12476 @opindex fsanitize=shift-exponent
12477 This option enables checking that the second argument of a shift operation
12478 is not negative and is smaller than the precision of the promoted first
12479 argument.
12481 @item -fsanitize=shift-base
12482 @opindex fsanitize=shift-base
12483 If the second argument of a shift operation is within range, check that the
12484 result of a shift operation is not undefined.  Note that what exactly is
12485 considered undefined differs slightly between C and C++, as well as between
12486 ISO C90 and C99, etc.
12488 @item -fsanitize=integer-divide-by-zero
12489 @opindex fsanitize=integer-divide-by-zero
12490 Detect integer division by zero as well as @code{INT_MIN / -1} division.
12492 @item -fsanitize=unreachable
12493 @opindex fsanitize=unreachable
12494 With this option, the compiler turns the @code{__builtin_unreachable}
12495 call into a diagnostics message call instead.  When reaching the
12496 @code{__builtin_unreachable} call, the behavior is undefined.
12498 @item -fsanitize=vla-bound
12499 @opindex fsanitize=vla-bound
12500 This option instructs the compiler to check that the size of a variable
12501 length array is positive.
12503 @item -fsanitize=null
12504 @opindex fsanitize=null
12505 This option enables pointer checking.  Particularly, the application
12506 built with this option turned on will issue an error message when it
12507 tries to dereference a NULL pointer, or if a reference (possibly an
12508 rvalue reference) is bound to a NULL pointer, or if a method is invoked
12509 on an object pointed by a NULL pointer.
12511 @item -fsanitize=return
12512 @opindex fsanitize=return
12513 This option enables return statement checking.  Programs
12514 built with this option turned on will issue an error message
12515 when the end of a non-void function is reached without actually
12516 returning a value.  This option works in C++ only.
12518 @item -fsanitize=signed-integer-overflow
12519 @opindex fsanitize=signed-integer-overflow
12520 This option enables signed integer overflow checking.  We check that
12521 the result of @code{+}, @code{*}, and both unary and binary @code{-}
12522 does not overflow in the signed arithmetics.  Note, integer promotion
12523 rules must be taken into account.  That is, the following is not an
12524 overflow:
12525 @smallexample
12526 signed char a = SCHAR_MAX;
12527 a++;
12528 @end smallexample
12530 @item -fsanitize=bounds
12531 @opindex fsanitize=bounds
12532 This option enables instrumentation of array bounds.  Various out of bounds
12533 accesses are detected.  Flexible array members, flexible array member-like
12534 arrays, and initializers of variables with static storage are not instrumented.
12536 @item -fsanitize=bounds-strict
12537 @opindex fsanitize=bounds-strict
12538 This option enables strict instrumentation of array bounds.  Most out of bounds
12539 accesses are detected, including flexible array members and flexible array
12540 member-like arrays.  Initializers of variables with static storage are not
12541 instrumented.
12543 @item -fsanitize=alignment
12544 @opindex fsanitize=alignment
12546 This option enables checking of alignment of pointers when they are
12547 dereferenced, or when a reference is bound to insufficiently aligned target,
12548 or when a method or constructor is invoked on insufficiently aligned object.
12550 @item -fsanitize=object-size
12551 @opindex fsanitize=object-size
12552 This option enables instrumentation of memory references using the
12553 @code{__builtin_object_size} function.  Various out of bounds pointer
12554 accesses are detected.
12556 @item -fsanitize=float-divide-by-zero
12557 @opindex fsanitize=float-divide-by-zero
12558 Detect floating-point division by zero.  Unlike other similar options,
12559 @option{-fsanitize=float-divide-by-zero} is not enabled by
12560 @option{-fsanitize=undefined}, since floating-point division by zero can
12561 be a legitimate way of obtaining infinities and NaNs.
12563 @item -fsanitize=float-cast-overflow
12564 @opindex fsanitize=float-cast-overflow
12565 This option enables floating-point type to integer conversion checking.
12566 We check that the result of the conversion does not overflow.
12567 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
12568 not enabled by @option{-fsanitize=undefined}.
12569 This option does not work well with @code{FE_INVALID} exceptions enabled.
12571 @item -fsanitize=nonnull-attribute
12572 @opindex fsanitize=nonnull-attribute
12574 This option enables instrumentation of calls, checking whether null values
12575 are not passed to arguments marked as requiring a non-null value by the
12576 @code{nonnull} function attribute.
12578 @item -fsanitize=returns-nonnull-attribute
12579 @opindex fsanitize=returns-nonnull-attribute
12581 This option enables instrumentation of return statements in functions
12582 marked with @code{returns_nonnull} function attribute, to detect returning
12583 of null values from such functions.
12585 @item -fsanitize=bool
12586 @opindex fsanitize=bool
12588 This option enables instrumentation of loads from bool.  If a value other
12589 than 0/1 is loaded, a run-time error is issued.
12591 @item -fsanitize=enum
12592 @opindex fsanitize=enum
12594 This option enables instrumentation of loads from an enum type.  If
12595 a value outside the range of values for the enum type is loaded,
12596 a run-time error is issued.
12598 @item -fsanitize=vptr
12599 @opindex fsanitize=vptr
12601 This option enables instrumentation of C++ member function calls, member
12602 accesses and some conversions between pointers to base and derived classes,
12603 to verify the referenced object has the correct dynamic type.
12605 @item -fsanitize=pointer-overflow
12606 @opindex fsanitize=pointer-overflow
12608 This option enables instrumentation of pointer arithmetics.  If the pointer
12609 arithmetics overflows, a run-time error is issued.
12611 @item -fsanitize=builtin
12612 @opindex fsanitize=builtin
12614 This option enables instrumentation of arguments to selected builtin
12615 functions.  If an invalid value is passed to such arguments, a run-time
12616 error is issued.  E.g.@ passing 0 as the argument to @code{__builtin_ctz}
12617 or @code{__builtin_clz} invokes undefined behavior and is diagnosed
12618 by this option.
12620 @end table
12622 While @option{-ftrapv} causes traps for signed overflows to be emitted,
12623 @option{-fsanitize=undefined} gives a diagnostic message.
12624 This currently works only for the C family of languages.
12626 @item -fno-sanitize=all
12627 @opindex fno-sanitize=all
12629 This option disables all previously enabled sanitizers.
12630 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
12631 together.
12633 @item -fasan-shadow-offset=@var{number}
12634 @opindex fasan-shadow-offset
12635 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
12636 It is useful for experimenting with different shadow memory layouts in
12637 Kernel AddressSanitizer.
12639 @item -fsanitize-sections=@var{s1},@var{s2},...
12640 @opindex fsanitize-sections
12641 Sanitize global variables in selected user-defined sections.  @var{si} may
12642 contain wildcards.
12644 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
12645 @opindex fsanitize-recover
12646 @opindex fno-sanitize-recover
12647 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
12648 mentioned in comma-separated list of @var{opts}.  Enabling this option
12649 for a sanitizer component causes it to attempt to continue
12650 running the program as if no error happened.  This means multiple
12651 runtime errors can be reported in a single program run, and the exit
12652 code of the program may indicate success even when errors
12653 have been reported.  The @option{-fno-sanitize-recover=} option
12654 can be used to alter
12655 this behavior: only the first detected error is reported
12656 and program then exits with a non-zero exit code.
12658 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
12659 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
12660 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
12661 @option{-fsanitize=bounds-strict},
12662 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
12663 For these sanitizers error recovery is turned on by default,
12664 except @option{-fsanitize=address}, for which this feature is experimental.
12665 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
12666 accepted, the former enables recovery for all sanitizers that support it,
12667 the latter disables recovery for all sanitizers that support it.
12669 Even if a recovery mode is turned on the compiler side, it needs to be also
12670 enabled on the runtime library side, otherwise the failures are still fatal.
12671 The runtime library defaults to @code{halt_on_error=0} for
12672 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
12673 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
12674 setting the @code{halt_on_error} flag in the corresponding environment variable.
12676 Syntax without an explicit @var{opts} parameter is deprecated.  It is
12677 equivalent to specifying an @var{opts} list of:
12679 @smallexample
12680 undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
12681 @end smallexample
12683 @item -fsanitize-address-use-after-scope
12684 @opindex fsanitize-address-use-after-scope
12685 Enable sanitization of local variables to detect use-after-scope bugs.
12686 The option sets @option{-fstack-reuse} to @samp{none}.
12688 @item -fsanitize-undefined-trap-on-error
12689 @opindex fsanitize-undefined-trap-on-error
12690 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
12691 report undefined behavior using @code{__builtin_trap} rather than
12692 a @code{libubsan} library routine.  The advantage of this is that the
12693 @code{libubsan} library is not needed and is not linked in, so this
12694 is usable even in freestanding environments.
12696 @item -fsanitize-coverage=trace-pc
12697 @opindex fsanitize-coverage=trace-pc
12698 Enable coverage-guided fuzzing code instrumentation.
12699 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
12701 @item -fsanitize-coverage=trace-cmp
12702 @opindex fsanitize-coverage=trace-cmp
12703 Enable dataflow guided fuzzing code instrumentation.
12704 Inserts a call to @code{__sanitizer_cov_trace_cmp1},
12705 @code{__sanitizer_cov_trace_cmp2}, @code{__sanitizer_cov_trace_cmp4} or
12706 @code{__sanitizer_cov_trace_cmp8} for integral comparison with both operands
12707 variable or @code{__sanitizer_cov_trace_const_cmp1},
12708 @code{__sanitizer_cov_trace_const_cmp2},
12709 @code{__sanitizer_cov_trace_const_cmp4} or
12710 @code{__sanitizer_cov_trace_const_cmp8} for integral comparison with one
12711 operand constant, @code{__sanitizer_cov_trace_cmpf} or
12712 @code{__sanitizer_cov_trace_cmpd} for float or double comparisons and
12713 @code{__sanitizer_cov_trace_switch} for switch statements.
12715 @item -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]}
12716 @opindex fcf-protection
12717 Enable code instrumentation of control-flow transfers to increase
12718 program security by checking that target addresses of control-flow
12719 transfer instructions (such as indirect function call, function return,
12720 indirect jump) are valid.  This prevents diverting the flow of control
12721 to an unexpected target.  This is intended to protect against such
12722 threats as Return-oriented Programming (ROP), and similarly
12723 call/jmp-oriented programming (COP/JOP).
12725 The value @code{branch} tells the compiler to implement checking of
12726 validity of control-flow transfer at the point of indirect branch
12727 instructions, i.e.@: call/jmp instructions.  The value @code{return}
12728 implements checking of validity at the point of returning from a
12729 function.  The value @code{full} is an alias for specifying both
12730 @code{branch} and @code{return}. The value @code{none} turns off
12731 instrumentation.
12733 The macro @code{__CET__} is defined when @option{-fcf-protection} is
12734 used.  The first bit of @code{__CET__} is set to 1 for the value
12735 @code{branch} and the second bit of @code{__CET__} is set to 1 for
12736 the @code{return}.
12738 You can also use the @code{nocf_check} attribute to identify
12739 which functions and calls should be skipped from instrumentation
12740 (@pxref{Function Attributes}).
12742 Currently the x86 GNU/Linux target provides an implementation based
12743 on Intel Control-flow Enforcement Technology (CET).
12745 @item -fstack-protector
12746 @opindex fstack-protector
12747 Emit extra code to check for buffer overflows, such as stack smashing
12748 attacks.  This is done by adding a guard variable to functions with
12749 vulnerable objects.  This includes functions that call @code{alloca}, and
12750 functions with buffers larger than 8 bytes.  The guards are initialized
12751 when a function is entered and then checked when the function exits.
12752 If a guard check fails, an error message is printed and the program exits.
12754 @item -fstack-protector-all
12755 @opindex fstack-protector-all
12756 Like @option{-fstack-protector} except that all functions are protected.
12758 @item -fstack-protector-strong
12759 @opindex fstack-protector-strong
12760 Like @option{-fstack-protector} but includes additional functions to
12761 be protected --- those that have local array definitions, or have
12762 references to local frame addresses.
12764 @item -fstack-protector-explicit
12765 @opindex fstack-protector-explicit
12766 Like @option{-fstack-protector} but only protects those functions which
12767 have the @code{stack_protect} attribute.
12769 @item -fstack-check
12770 @opindex fstack-check
12771 Generate code to verify that you do not go beyond the boundary of the
12772 stack.  You should specify this flag if you are running in an
12773 environment with multiple threads, but you only rarely need to specify it in
12774 a single-threaded environment since stack overflow is automatically
12775 detected on nearly all systems if there is only one stack.
12777 Note that this switch does not actually cause checking to be done; the
12778 operating system or the language runtime must do that.  The switch causes
12779 generation of code to ensure that they see the stack being extended.
12781 You can additionally specify a string parameter: @samp{no} means no
12782 checking, @samp{generic} means force the use of old-style checking,
12783 @samp{specific} means use the best checking method and is equivalent
12784 to bare @option{-fstack-check}.
12786 Old-style checking is a generic mechanism that requires no specific
12787 target support in the compiler but comes with the following drawbacks:
12789 @enumerate
12790 @item
12791 Modified allocation strategy for large objects: they are always
12792 allocated dynamically if their size exceeds a fixed threshold.  Note this
12793 may change the semantics of some code.
12795 @item
12796 Fixed limit on the size of the static frame of functions: when it is
12797 topped by a particular function, stack checking is not reliable and
12798 a warning is issued by the compiler.
12800 @item
12801 Inefficiency: because of both the modified allocation strategy and the
12802 generic implementation, code performance is hampered.
12803 @end enumerate
12805 Note that old-style stack checking is also the fallback method for
12806 @samp{specific} if no target support has been added in the compiler.
12808 @samp{-fstack-check=} is designed for Ada's needs to detect infinite recursion
12809 and stack overflows.  @samp{specific} is an excellent choice when compiling
12810 Ada code.  It is not generally sufficient to protect against stack-clash
12811 attacks.  To protect against those you want @samp{-fstack-clash-protection}.
12813 @item -fstack-clash-protection
12814 @opindex fstack-clash-protection
12815 Generate code to prevent stack clash style attacks.  When this option is
12816 enabled, the compiler will only allocate one page of stack space at a time
12817 and each page is accessed immediately after allocation.  Thus, it prevents
12818 allocations from jumping over any stack guard page provided by the
12819 operating system.
12821 Most targets do not fully support stack clash protection.  However, on
12822 those targets @option{-fstack-clash-protection} will protect dynamic stack
12823 allocations.  @option{-fstack-clash-protection} may also provide limited
12824 protection for static stack allocations if the target supports
12825 @option{-fstack-check=specific}.
12827 @item -fstack-limit-register=@var{reg}
12828 @itemx -fstack-limit-symbol=@var{sym}
12829 @itemx -fno-stack-limit
12830 @opindex fstack-limit-register
12831 @opindex fstack-limit-symbol
12832 @opindex fno-stack-limit
12833 Generate code to ensure that the stack does not grow beyond a certain value,
12834 either the value of a register or the address of a symbol.  If a larger
12835 stack is required, a signal is raised at run time.  For most targets,
12836 the signal is raised before the stack overruns the boundary, so
12837 it is possible to catch the signal without taking special precautions.
12839 For instance, if the stack starts at absolute address @samp{0x80000000}
12840 and grows downwards, you can use the flags
12841 @option{-fstack-limit-symbol=__stack_limit} and
12842 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
12843 of 128KB@.  Note that this may only work with the GNU linker.
12845 You can locally override stack limit checking by using the
12846 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
12848 @item -fsplit-stack
12849 @opindex fsplit-stack
12850 Generate code to automatically split the stack before it overflows.
12851 The resulting program has a discontiguous stack which can only
12852 overflow if the program is unable to allocate any more memory.  This
12853 is most useful when running threaded programs, as it is no longer
12854 necessary to calculate a good stack size to use for each thread.  This
12855 is currently only implemented for the x86 targets running
12856 GNU/Linux.
12858 When code compiled with @option{-fsplit-stack} calls code compiled
12859 without @option{-fsplit-stack}, there may not be much stack space
12860 available for the latter code to run.  If compiling all code,
12861 including library code, with @option{-fsplit-stack} is not an option,
12862 then the linker can fix up these calls so that the code compiled
12863 without @option{-fsplit-stack} always has a large stack.  Support for
12864 this is implemented in the gold linker in GNU binutils release 2.21
12865 and later.
12867 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
12868 @opindex fvtable-verify
12869 This option is only available when compiling C++ code.
12870 It turns on (or off, if using @option{-fvtable-verify=none}) the security
12871 feature that verifies at run time, for every virtual call, that
12872 the vtable pointer through which the call is made is valid for the type of
12873 the object, and has not been corrupted or overwritten.  If an invalid vtable
12874 pointer is detected at run time, an error is reported and execution of the
12875 program is immediately halted.
12877 This option causes run-time data structures to be built at program startup,
12878 which are used for verifying the vtable pointers.  
12879 The options @samp{std} and @samp{preinit}
12880 control the timing of when these data structures are built.  In both cases the
12881 data structures are built before execution reaches @code{main}.  Using
12882 @option{-fvtable-verify=std} causes the data structures to be built after
12883 shared libraries have been loaded and initialized.
12884 @option{-fvtable-verify=preinit} causes them to be built before shared
12885 libraries have been loaded and initialized.
12887 If this option appears multiple times in the command line with different
12888 values specified, @samp{none} takes highest priority over both @samp{std} and
12889 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
12891 @item -fvtv-debug
12892 @opindex fvtv-debug
12893 When used in conjunction with @option{-fvtable-verify=std} or 
12894 @option{-fvtable-verify=preinit}, causes debug versions of the 
12895 runtime functions for the vtable verification feature to be called.  
12896 This flag also causes the compiler to log information about which 
12897 vtable pointers it finds for each class.
12898 This information is written to a file named @file{vtv_set_ptr_data.log} 
12899 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
12900 if that is defined or the current working directory otherwise.
12902 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
12903 file, be sure to delete any existing one.
12905 @item -fvtv-counts
12906 @opindex fvtv-counts
12907 This is a debugging flag.  When used in conjunction with
12908 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
12909 causes the compiler to keep track of the total number of virtual calls
12910 it encounters and the number of verifications it inserts.  It also
12911 counts the number of calls to certain run-time library functions
12912 that it inserts and logs this information for each compilation unit.
12913 The compiler writes this information to a file named
12914 @file{vtv_count_data.log} in the directory named by the environment
12915 variable @env{VTV_LOGS_DIR} if that is defined or the current working
12916 directory otherwise.  It also counts the size of the vtable pointer sets
12917 for each class, and writes this information to @file{vtv_class_set_sizes.log}
12918 in the same directory.
12920 Note:  This feature @emph{appends} data to the log files.  To get fresh log
12921 files, be sure to delete any existing ones.
12923 @item -finstrument-functions
12924 @opindex finstrument-functions
12925 Generate instrumentation calls for entry and exit to functions.  Just
12926 after function entry and just before function exit, the following
12927 profiling functions are called with the address of the current
12928 function and its call site.  (On some platforms,
12929 @code{__builtin_return_address} does not work beyond the current
12930 function, so the call site information may not be available to the
12931 profiling functions otherwise.)
12933 @smallexample
12934 void __cyg_profile_func_enter (void *this_fn,
12935                                void *call_site);
12936 void __cyg_profile_func_exit  (void *this_fn,
12937                                void *call_site);
12938 @end smallexample
12940 The first argument is the address of the start of the current function,
12941 which may be looked up exactly in the symbol table.
12943 This instrumentation is also done for functions expanded inline in other
12944 functions.  The profiling calls indicate where, conceptually, the
12945 inline function is entered and exited.  This means that addressable
12946 versions of such functions must be available.  If all your uses of a
12947 function are expanded inline, this may mean an additional expansion of
12948 code size.  If you use @code{extern inline} in your C code, an
12949 addressable version of such functions must be provided.  (This is
12950 normally the case anyway, but if you get lucky and the optimizer always
12951 expands the functions inline, you might have gotten away without
12952 providing static copies.)
12954 A function may be given the attribute @code{no_instrument_function}, in
12955 which case this instrumentation is not done.  This can be used, for
12956 example, for the profiling functions listed above, high-priority
12957 interrupt routines, and any functions from which the profiling functions
12958 cannot safely be called (perhaps signal handlers, if the profiling
12959 routines generate output or allocate memory).
12960 @xref{Common Function Attributes}.
12962 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
12963 @opindex finstrument-functions-exclude-file-list
12965 Set the list of functions that are excluded from instrumentation (see
12966 the description of @option{-finstrument-functions}).  If the file that
12967 contains a function definition matches with one of @var{file}, then
12968 that function is not instrumented.  The match is done on substrings:
12969 if the @var{file} parameter is a substring of the file name, it is
12970 considered to be a match.
12972 For example:
12974 @smallexample
12975 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
12976 @end smallexample
12978 @noindent
12979 excludes any inline function defined in files whose pathnames
12980 contain @file{/bits/stl} or @file{include/sys}.
12982 If, for some reason, you want to include letter @samp{,} in one of
12983 @var{sym}, write @samp{\,}. For example,
12984 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
12985 (note the single quote surrounding the option).
12987 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
12988 @opindex finstrument-functions-exclude-function-list
12990 This is similar to @option{-finstrument-functions-exclude-file-list},
12991 but this option sets the list of function names to be excluded from
12992 instrumentation.  The function name to be matched is its user-visible
12993 name, such as @code{vector<int> blah(const vector<int> &)}, not the
12994 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
12995 match is done on substrings: if the @var{sym} parameter is a substring
12996 of the function name, it is considered to be a match.  For C99 and C++
12997 extended identifiers, the function name must be given in UTF-8, not
12998 using universal character names.
13000 @item -fpatchable-function-entry=@var{N}[,@var{M}]
13001 @opindex fpatchable-function-entry
13002 Generate @var{N} NOPs right at the beginning
13003 of each function, with the function entry point before the @var{M}th NOP.
13004 If @var{M} is omitted, it defaults to @code{0} so the
13005 function entry points to the address just at the first NOP.
13006 The NOP instructions reserve extra space which can be used to patch in
13007 any desired instrumentation at run time, provided that the code segment
13008 is writable.  The amount of space is controllable indirectly via
13009 the number of NOPs; the NOP instruction used corresponds to the instruction
13010 emitted by the internal GCC back-end interface @code{gen_nop}.  This behavior
13011 is target-specific and may also depend on the architecture variant and/or
13012 other compilation options.
13014 For run-time identification, the starting addresses of these areas,
13015 which correspond to their respective function entries minus @var{M},
13016 are additionally collected in the @code{__patchable_function_entries}
13017 section of the resulting binary.
13019 Note that the value of @code{__attribute__ ((patchable_function_entry
13020 (N,M)))} takes precedence over command-line option
13021 @option{-fpatchable-function-entry=N,M}.  This can be used to increase
13022 the area size or to remove it completely on a single function.
13023 If @code{N=0}, no pad location is recorded.
13025 The NOP instructions are inserted at---and maybe before, depending on
13026 @var{M}---the function entry address, even before the prologue.
13028 @end table
13031 @node Preprocessor Options
13032 @section Options Controlling the Preprocessor
13033 @cindex preprocessor options
13034 @cindex options, preprocessor
13036 These options control the C preprocessor, which is run on each C source
13037 file before actual compilation.
13039 If you use the @option{-E} option, nothing is done except preprocessing.
13040 Some of these options make sense only together with @option{-E} because
13041 they cause the preprocessor output to be unsuitable for actual
13042 compilation.
13044 In addition to the options listed here, there are a number of options 
13045 to control search paths for include files documented in 
13046 @ref{Directory Options}.  
13047 Options to control preprocessor diagnostics are listed in 
13048 @ref{Warning Options}.
13050 @table @gcctabopt
13051 @include cppopts.texi
13053 @item -Wp,@var{option}
13054 @opindex Wp
13055 You can use @option{-Wp,@var{option}} to bypass the compiler driver
13056 and pass @var{option} directly through to the preprocessor.  If
13057 @var{option} contains commas, it is split into multiple options at the
13058 commas.  However, many options are modified, translated or interpreted
13059 by the compiler driver before being passed to the preprocessor, and
13060 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
13061 interface is undocumented and subject to change, so whenever possible
13062 you should avoid using @option{-Wp} and let the driver handle the
13063 options instead.
13065 @item -Xpreprocessor @var{option}
13066 @opindex Xpreprocessor
13067 Pass @var{option} as an option to the preprocessor.  You can use this to
13068 supply system-specific preprocessor options that GCC does not 
13069 recognize.
13071 If you want to pass an option that takes an argument, you must use
13072 @option{-Xpreprocessor} twice, once for the option and once for the argument.
13074 @item -no-integrated-cpp
13075 @opindex no-integrated-cpp
13076 Perform preprocessing as a separate pass before compilation.
13077 By default, GCC performs preprocessing as an integrated part of
13078 input tokenization and parsing.
13079 If this option is provided, the appropriate language front end
13080 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
13081 and Objective-C, respectively) is instead invoked twice,
13082 once for preprocessing only and once for actual compilation
13083 of the preprocessed input.
13084 This option may be useful in conjunction with the @option{-B} or
13085 @option{-wrapper} options to specify an alternate preprocessor or
13086 perform additional processing of the program source between
13087 normal preprocessing and compilation.
13089 @end table
13091 @node Assembler Options
13092 @section Passing Options to the Assembler
13094 @c prevent bad page break with this line
13095 You can pass options to the assembler.
13097 @table @gcctabopt
13098 @item -Wa,@var{option}
13099 @opindex Wa
13100 Pass @var{option} as an option to the assembler.  If @var{option}
13101 contains commas, it is split into multiple options at the commas.
13103 @item -Xassembler @var{option}
13104 @opindex Xassembler
13105 Pass @var{option} as an option to the assembler.  You can use this to
13106 supply system-specific assembler options that GCC does not
13107 recognize.
13109 If you want to pass an option that takes an argument, you must use
13110 @option{-Xassembler} twice, once for the option and once for the argument.
13112 @end table
13114 @node Link Options
13115 @section Options for Linking
13116 @cindex link options
13117 @cindex options, linking
13119 These options come into play when the compiler links object files into
13120 an executable output file.  They are meaningless if the compiler is
13121 not doing a link step.
13123 @table @gcctabopt
13124 @cindex file names
13125 @item @var{object-file-name}
13126 A file name that does not end in a special recognized suffix is
13127 considered to name an object file or library.  (Object files are
13128 distinguished from libraries by the linker according to the file
13129 contents.)  If linking is done, these object files are used as input
13130 to the linker.
13132 @item -c
13133 @itemx -S
13134 @itemx -E
13135 @opindex c
13136 @opindex S
13137 @opindex E
13138 If any of these options is used, then the linker is not run, and
13139 object file names should not be used as arguments.  @xref{Overall
13140 Options}.
13142 @item -flinker-output=@var{type}
13143 @opindex flinker-output
13144 This option controls the code generation of the link time optimizer.  By
13145 default the linker output is determined by the linker plugin automatically. For
13146 debugging the compiler and in the case of incremental linking to non-lto object
13147 file is desired, it may be useful to control the type manually.
13149 If @var{type} is @samp{exec} the code generation is configured to produce static
13150 binary. In this case @option{-fpic} and @option{-fpie} are both disabled.
13152 If @var{type} is @samp{dyn} the code generation is configured to produce shared
13153 library. In this case @option{-fpic} or @option{-fPIC} is preserved, but not
13154 enabled automatically.  This makes it possible to build shared libraries without
13155 position independent code on architectures this is possible, i.e.@: on x86.
13157 If @var{type} is @samp{pie} the code generation is configured to produce
13158 @option{-fpie} executable. This result in similar optimizations as @samp{exec}
13159 except that @option{-fpie} is not disabled if specified at compilation time.
13161 If @var{type} is @samp{rel} the compiler assumes that incremental linking is
13162 done.  The sections containing intermediate code for link-time optimization are
13163 merged, pre-optimized, and output to the resulting object file. In addition, if
13164 @option{-ffat-lto-objects} is specified the binary code is produced for future
13165 non-lto linking. The object file produced by incremental linking will be smaller
13166 than a static library produced from the same object files.  At link-time the
13167 result of incremental linking will also load faster to compiler than a static
13168 library assuming that majority of objects in the library are used.
13170 Finally @samp{nolto-rel} configure compiler to for incremental linking where
13171 code generation is forced, final binary is produced and the intermediate code
13172 for later link-time optimization is stripped. When multiple object files are
13173 linked together the resulting code will be optimized better than with link time
13174 optimizations disabled (for example, the cross-module inlining will happen),
13175 most of benefits of whole program optimizations are however lost. 
13177 During the incremental link (by @option{-r}) the linker plugin will default to
13178 @option{rel}. With current interfaces to GNU Binutils it is however not
13179 possible to link incrementally LTO objects and non-LTO objects into a single
13180 mixed object file.  In the case any of object files in incremental link cannot
13181 be used for link-time optimization the linker plugin will output warning and
13182 use @samp{nolto-rel}. To maintain the whole program optimization it is
13183 recommended to link such objects into static library instead. Alternatively it
13184 is possible to use H.J. Lu's binutils with support for mixed objects.
13186 @item -fuse-ld=bfd
13187 @opindex fuse-ld=bfd
13188 Use the @command{bfd} linker instead of the default linker.
13190 @item -fuse-ld=gold
13191 @opindex fuse-ld=gold
13192 Use the @command{gold} linker instead of the default linker.
13194 @item -fuse-ld=lld
13195 @opindex fuse-ld=lld
13196 Use the LLVM @command{lld} linker instead of the default linker.
13198 @cindex Libraries
13199 @item -l@var{library}
13200 @itemx -l @var{library}
13201 @opindex l
13202 Search the library named @var{library} when linking.  (The second
13203 alternative with the library as a separate argument is only for
13204 POSIX compliance and is not recommended.)
13206 The @option{-l} option is passed directly to the linker by GCC.  Refer
13207 to your linker documentation for exact details.  The general
13208 description below applies to the GNU linker.  
13210 The linker searches a standard list of directories for the library.
13211 The directories searched include several standard system directories
13212 plus any that you specify with @option{-L}.
13214 Static libraries are archives of object files, and have file names
13215 like @file{lib@var{library}.a}.  Some targets also support shared
13216 libraries, which typically have names like @file{lib@var{library}.so}.
13217 If both static and shared libraries are found, the linker gives
13218 preference to linking with the shared library unless the
13219 @option{-static} option is used.
13221 It makes a difference where in the command you write this option; the
13222 linker searches and processes libraries and object files in the order they
13223 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
13224 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
13225 to functions in @samp{z}, those functions may not be loaded.
13227 @item -lobjc
13228 @opindex lobjc
13229 You need this special case of the @option{-l} option in order to
13230 link an Objective-C or Objective-C++ program.
13232 @item -nostartfiles
13233 @opindex nostartfiles
13234 Do not use the standard system startup files when linking.
13235 The standard system libraries are used normally, unless @option{-nostdlib},
13236 @option{-nolibc}, or @option{-nodefaultlibs} is used.
13238 @item -nodefaultlibs
13239 @opindex nodefaultlibs
13240 Do not use the standard system libraries when linking.
13241 Only the libraries you specify are passed to the linker, and options
13242 specifying linkage of the system libraries, such as @option{-static-libgcc}
13243 or @option{-shared-libgcc}, are ignored.  
13244 The standard startup files are used normally, unless @option{-nostartfiles}
13245 is used.  
13247 The compiler may generate calls to @code{memcmp},
13248 @code{memset}, @code{memcpy} and @code{memmove}.
13249 These entries are usually resolved by entries in
13250 libc.  These entry points should be supplied through some other
13251 mechanism when this option is specified.
13253 @item -nolibc
13254 @opindex nolibc
13255 Do not use the C library or system libraries tightly coupled with it when
13256 linking.  Still link with the startup files, @file{libgcc} or toolchain
13257 provided language support libraries such as @file{libgnat}, @file{libgfortran}
13258 or @file{libstdc++} unless options preventing their inclusion are used as
13259 well.  This typically removes @option{-lc} from the link command line, as well
13260 as system libraries that normally go with it and become meaningless when
13261 absence of a C library is assumed, for example @option{-lpthread} or
13262 @option{-lm} in some configurations.  This is intended for bare-board
13263 targets when there is indeed no C library available.
13265 @item -nostdlib
13266 @opindex nostdlib
13267 Do not use the standard system startup files or libraries when linking.
13268 No startup files and only the libraries you specify are passed to
13269 the linker, and options specifying linkage of the system libraries, such as
13270 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
13272 The compiler may generate calls to @code{memcmp}, @code{memset},
13273 @code{memcpy} and @code{memmove}.
13274 These entries are usually resolved by entries in
13275 libc.  These entry points should be supplied through some other
13276 mechanism when this option is specified.
13278 @cindex @option{-lgcc}, use with @option{-nostdlib}
13279 @cindex @option{-nostdlib} and unresolved references
13280 @cindex unresolved references and @option{-nostdlib}
13281 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
13282 @cindex @option{-nodefaultlibs} and unresolved references
13283 @cindex unresolved references and @option{-nodefaultlibs}
13284 One of the standard libraries bypassed by @option{-nostdlib} and
13285 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
13286 which GCC uses to overcome shortcomings of particular machines, or special
13287 needs for some languages.
13288 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
13289 Collection (GCC) Internals},
13290 for more discussion of @file{libgcc.a}.)
13291 In most cases, you need @file{libgcc.a} even when you want to avoid
13292 other standard libraries.  In other words, when you specify @option{-nostdlib}
13293 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
13294 This ensures that you have no unresolved references to internal GCC
13295 library subroutines.
13296 (An example of such an internal subroutine is @code{__main}, used to ensure C++
13297 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
13298 GNU Compiler Collection (GCC) Internals}.)
13300 @item -e @var{entry}
13301 @itemx --entry=@var{entry}
13302 @opindex e
13303 @opindex entry
13305 Specify that the program entry point is @var{entry}.  The argument is
13306 interpreted by the linker; the GNU linker accepts either a symbol name
13307 or an address.
13309 @item -pie
13310 @opindex pie
13311 Produce a dynamically linked position independent executable on targets
13312 that support it.  For predictable results, you must also specify the same
13313 set of options used for compilation (@option{-fpie}, @option{-fPIE},
13314 or model suboptions) when you specify this linker option.
13316 @item -no-pie
13317 @opindex no-pie
13318 Don't produce a dynamically linked position independent executable.
13320 @item -static-pie
13321 @opindex static-pie
13322 Produce a static position independent executable on targets that support
13323 it.  A static position independent executable is similar to a static
13324 executable, but can be loaded at any address without a dynamic linker.
13325 For predictable results, you must also specify the same set of options
13326 used for compilation (@option{-fpie}, @option{-fPIE}, or model
13327 suboptions) when you specify this linker option.
13329 @item -pthread
13330 @opindex pthread
13331 Link with the POSIX threads library.  This option is supported on 
13332 GNU/Linux targets, most other Unix derivatives, and also on 
13333 x86 Cygwin and MinGW targets.  On some targets this option also sets 
13334 flags for the preprocessor, so it should be used consistently for both
13335 compilation and linking.
13337 @item -r
13338 @opindex r
13339 Produce a relocatable object as output.  This is also known as partial
13340 linking.
13342 @item -rdynamic
13343 @opindex rdynamic
13344 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
13345 that support it. This instructs the linker to add all symbols, not
13346 only used ones, to the dynamic symbol table. This option is needed
13347 for some uses of @code{dlopen} or to allow obtaining backtraces
13348 from within a program.
13350 @item -s
13351 @opindex s
13352 Remove all symbol table and relocation information from the executable.
13354 @item -static
13355 @opindex static
13356 On systems that support dynamic linking, this overrides @option{-pie}
13357 and prevents linking with the shared libraries.  On other systems, this
13358 option has no effect.
13360 @item -shared
13361 @opindex shared
13362 Produce a shared object which can then be linked with other objects to
13363 form an executable.  Not all systems support this option.  For predictable
13364 results, you must also specify the same set of options used for compilation
13365 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
13366 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
13367 needs to build supplementary stub code for constructors to work.  On
13368 multi-libbed systems, @samp{gcc -shared} must select the correct support
13369 libraries to link against.  Failing to supply the correct flags may lead
13370 to subtle defects.  Supplying them in cases where they are not necessary
13371 is innocuous.}
13373 @item -shared-libgcc
13374 @itemx -static-libgcc
13375 @opindex shared-libgcc
13376 @opindex static-libgcc
13377 On systems that provide @file{libgcc} as a shared library, these options
13378 force the use of either the shared or static version, respectively.
13379 If no shared version of @file{libgcc} was built when the compiler was
13380 configured, these options have no effect.
13382 There are several situations in which an application should use the
13383 shared @file{libgcc} instead of the static version.  The most common
13384 of these is when the application wishes to throw and catch exceptions
13385 across different shared libraries.  In that case, each of the libraries
13386 as well as the application itself should use the shared @file{libgcc}.
13388 Therefore, the G++ driver automatically adds @option{-shared-libgcc}
13389 whenever you build a shared library or a main executable, because C++
13390 programs typically use exceptions, so this is the right thing to do.
13392 If, instead, you use the GCC driver to create shared libraries, you may
13393 find that they are not always linked with the shared @file{libgcc}.
13394 If GCC finds, at its configuration time, that you have a non-GNU linker
13395 or a GNU linker that does not support option @option{--eh-frame-hdr},
13396 it links the shared version of @file{libgcc} into shared libraries
13397 by default.  Otherwise, it takes advantage of the linker and optimizes
13398 away the linking with the shared version of @file{libgcc}, linking with
13399 the static version of libgcc by default.  This allows exceptions to
13400 propagate through such shared libraries, without incurring relocation
13401 costs at library load time.
13403 However, if a library or main executable is supposed to throw or catch
13404 exceptions, you must link it using the G++ driver, or using the option
13405 @option{-shared-libgcc}, such that it is linked with the shared
13406 @file{libgcc}.
13408 @item -static-libasan
13409 @opindex static-libasan
13410 When the @option{-fsanitize=address} option is used to link a program,
13411 the GCC driver automatically links against @option{libasan}.  If
13412 @file{libasan} is available as a shared library, and the @option{-static}
13413 option is not used, then this links against the shared version of
13414 @file{libasan}.  The @option{-static-libasan} option directs the GCC
13415 driver to link @file{libasan} statically, without necessarily linking
13416 other libraries statically.
13418 @item -static-libtsan
13419 @opindex static-libtsan
13420 When the @option{-fsanitize=thread} option is used to link a program,
13421 the GCC driver automatically links against @option{libtsan}.  If
13422 @file{libtsan} is available as a shared library, and the @option{-static}
13423 option is not used, then this links against the shared version of
13424 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
13425 driver to link @file{libtsan} statically, without necessarily linking
13426 other libraries statically.
13428 @item -static-liblsan
13429 @opindex static-liblsan
13430 When the @option{-fsanitize=leak} option is used to link a program,
13431 the GCC driver automatically links against @option{liblsan}.  If
13432 @file{liblsan} is available as a shared library, and the @option{-static}
13433 option is not used, then this links against the shared version of
13434 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
13435 driver to link @file{liblsan} statically, without necessarily linking
13436 other libraries statically.
13438 @item -static-libubsan
13439 @opindex static-libubsan
13440 When the @option{-fsanitize=undefined} option is used to link a program,
13441 the GCC driver automatically links against @option{libubsan}.  If
13442 @file{libubsan} is available as a shared library, and the @option{-static}
13443 option is not used, then this links against the shared version of
13444 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
13445 driver to link @file{libubsan} statically, without necessarily linking
13446 other libraries statically.
13448 @item -static-libstdc++
13449 @opindex static-libstdc++
13450 When the @command{g++} program is used to link a C++ program, it
13451 normally automatically links against @option{libstdc++}.  If
13452 @file{libstdc++} is available as a shared library, and the
13453 @option{-static} option is not used, then this links against the
13454 shared version of @file{libstdc++}.  That is normally fine.  However, it
13455 is sometimes useful to freeze the version of @file{libstdc++} used by
13456 the program without going all the way to a fully static link.  The
13457 @option{-static-libstdc++} option directs the @command{g++} driver to
13458 link @file{libstdc++} statically, without necessarily linking other
13459 libraries statically.
13461 @item -symbolic
13462 @opindex symbolic
13463 Bind references to global symbols when building a shared object.  Warn
13464 about any unresolved references (unless overridden by the link editor
13465 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
13466 this option.
13468 @item -T @var{script}
13469 @opindex T
13470 @cindex linker script
13471 Use @var{script} as the linker script.  This option is supported by most
13472 systems using the GNU linker.  On some targets, such as bare-board
13473 targets without an operating system, the @option{-T} option may be required
13474 when linking to avoid references to undefined symbols.
13476 @item -Xlinker @var{option}
13477 @opindex Xlinker
13478 Pass @var{option} as an option to the linker.  You can use this to
13479 supply system-specific linker options that GCC does not recognize.
13481 If you want to pass an option that takes a separate argument, you must use
13482 @option{-Xlinker} twice, once for the option and once for the argument.
13483 For example, to pass @option{-assert definitions}, you must write
13484 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
13485 @option{-Xlinker "-assert definitions"}, because this passes the entire
13486 string as a single argument, which is not what the linker expects.
13488 When using the GNU linker, it is usually more convenient to pass
13489 arguments to linker options using the @option{@var{option}=@var{value}}
13490 syntax than as separate arguments.  For example, you can specify
13491 @option{-Xlinker -Map=output.map} rather than
13492 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
13493 this syntax for command-line options.
13495 @item -Wl,@var{option}
13496 @opindex Wl
13497 Pass @var{option} as an option to the linker.  If @var{option} contains
13498 commas, it is split into multiple options at the commas.  You can use this
13499 syntax to pass an argument to the option.
13500 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
13501 linker.  When using the GNU linker, you can also get the same effect with
13502 @option{-Wl,-Map=output.map}.
13504 @item -u @var{symbol}
13505 @opindex u
13506 Pretend the symbol @var{symbol} is undefined, to force linking of
13507 library modules to define it.  You can use @option{-u} multiple times with
13508 different symbols to force loading of additional library modules.
13510 @item -z @var{keyword}
13511 @opindex z
13512 @option{-z} is passed directly on to the linker along with the keyword
13513 @var{keyword}. See the section in the documentation of your linker for
13514 permitted values and their meanings.
13515 @end table
13517 @node Directory Options
13518 @section Options for Directory Search
13519 @cindex directory options
13520 @cindex options, directory search
13521 @cindex search path
13523 These options specify directories to search for header files, for
13524 libraries and for parts of the compiler:
13526 @table @gcctabopt
13527 @include cppdiropts.texi
13529 @item -iplugindir=@var{dir}
13530 @opindex iplugindir=
13531 Set the directory to search for plugins that are passed
13532 by @option{-fplugin=@var{name}} instead of
13533 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
13534 to be used by the user, but only passed by the driver.
13536 @item -L@var{dir}
13537 @opindex L
13538 Add directory @var{dir} to the list of directories to be searched
13539 for @option{-l}.
13541 @item -B@var{prefix}
13542 @opindex B
13543 This option specifies where to find the executables, libraries,
13544 include files, and data files of the compiler itself.
13546 The compiler driver program runs one or more of the subprograms
13547 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
13548 @var{prefix} as a prefix for each program it tries to run, both with and
13549 without @samp{@var{machine}/@var{version}/} for the corresponding target
13550 machine and compiler version.
13552 For each subprogram to be run, the compiler driver first tries the
13553 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
13554 is not specified, the driver tries two standard prefixes, 
13555 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
13556 those results in a file name that is found, the unmodified program
13557 name is searched for using the directories specified in your
13558 @env{PATH} environment variable.
13560 The compiler checks to see if the path provided by @option{-B}
13561 refers to a directory, and if necessary it adds a directory
13562 separator character at the end of the path.
13564 @option{-B} prefixes that effectively specify directory names also apply
13565 to libraries in the linker, because the compiler translates these
13566 options into @option{-L} options for the linker.  They also apply to
13567 include files in the preprocessor, because the compiler translates these
13568 options into @option{-isystem} options for the preprocessor.  In this case,
13569 the compiler appends @samp{include} to the prefix.
13571 The runtime support file @file{libgcc.a} can also be searched for using
13572 the @option{-B} prefix, if needed.  If it is not found there, the two
13573 standard prefixes above are tried, and that is all.  The file is left
13574 out of the link if it is not found by those means.
13576 Another way to specify a prefix much like the @option{-B} prefix is to use
13577 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
13578 Variables}.
13580 As a special kludge, if the path provided by @option{-B} is
13581 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
13582 9, then it is replaced by @file{[dir/]include}.  This is to help
13583 with boot-strapping the compiler.
13585 @item -no-canonical-prefixes
13586 @opindex no-canonical-prefixes
13587 Do not expand any symbolic links, resolve references to @samp{/../}
13588 or @samp{/./}, or make the path absolute when generating a relative
13589 prefix.
13591 @item --sysroot=@var{dir}
13592 @opindex sysroot
13593 Use @var{dir} as the logical root directory for headers and libraries.
13594 For example, if the compiler normally searches for headers in
13595 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
13596 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
13598 If you use both this option and the @option{-isysroot} option, then
13599 the @option{--sysroot} option applies to libraries, but the
13600 @option{-isysroot} option applies to header files.
13602 The GNU linker (beginning with version 2.16) has the necessary support
13603 for this option.  If your linker does not support this option, the
13604 header file aspect of @option{--sysroot} still works, but the
13605 library aspect does not.
13607 @item --no-sysroot-suffix
13608 @opindex no-sysroot-suffix
13609 For some targets, a suffix is added to the root directory specified
13610 with @option{--sysroot}, depending on the other options used, so that
13611 headers may for example be found in
13612 @file{@var{dir}/@var{suffix}/usr/include} instead of
13613 @file{@var{dir}/usr/include}.  This option disables the addition of
13614 such a suffix.
13616 @end table
13618 @node Code Gen Options
13619 @section Options for Code Generation Conventions
13620 @cindex code generation conventions
13621 @cindex options, code generation
13622 @cindex run-time options
13624 These machine-independent options control the interface conventions
13625 used in code generation.
13627 Most of them have both positive and negative forms; the negative form
13628 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
13629 one of the forms is listed---the one that is not the default.  You
13630 can figure out the other form by either removing @samp{no-} or adding
13633 @table @gcctabopt
13634 @item -fstack-reuse=@var{reuse-level}
13635 @opindex fstack_reuse
13636 This option controls stack space reuse for user declared local/auto variables
13637 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
13638 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
13639 local variables and temporaries, @samp{named_vars} enables the reuse only for
13640 user defined local variables with names, and @samp{none} disables stack reuse
13641 completely. The default value is @samp{all}. The option is needed when the
13642 program extends the lifetime of a scoped local variable or a compiler generated
13643 temporary beyond the end point defined by the language.  When a lifetime of
13644 a variable ends, and if the variable lives in memory, the optimizing compiler
13645 has the freedom to reuse its stack space with other temporaries or scoped
13646 local variables whose live range does not overlap with it. Legacy code extending
13647 local lifetime is likely to break with the stack reuse optimization.
13649 For example,
13651 @smallexample
13652    int *p;
13653    @{
13654      int local1;
13656      p = &local1;
13657      local1 = 10;
13658      ....
13659    @}
13660    @{
13661       int local2;
13662       local2 = 20;
13663       ...
13664    @}
13666    if (*p == 10)  // out of scope use of local1
13667      @{
13669      @}
13670 @end smallexample
13672 Another example:
13673 @smallexample
13675    struct A
13676    @{
13677        A(int k) : i(k), j(k) @{ @}
13678        int i;
13679        int j;
13680    @};
13682    A *ap;
13684    void foo(const A& ar)
13685    @{
13686       ap = &ar;
13687    @}
13689    void bar()
13690    @{
13691       foo(A(10)); // temp object's lifetime ends when foo returns
13693       @{
13694         A a(20);
13695         ....
13696       @}
13697       ap->i+= 10;  // ap references out of scope temp whose space
13698                    // is reused with a. What is the value of ap->i?
13699    @}
13701 @end smallexample
13703 The lifetime of a compiler generated temporary is well defined by the C++
13704 standard. When a lifetime of a temporary ends, and if the temporary lives
13705 in memory, the optimizing compiler has the freedom to reuse its stack
13706 space with other temporaries or scoped local variables whose live range
13707 does not overlap with it. However some of the legacy code relies on
13708 the behavior of older compilers in which temporaries' stack space is
13709 not reused, the aggressive stack reuse can lead to runtime errors. This
13710 option is used to control the temporary stack reuse optimization.
13712 @item -ftrapv
13713 @opindex ftrapv
13714 This option generates traps for signed overflow on addition, subtraction,
13715 multiplication operations.
13716 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
13717 @option{-ftrapv} @option{-fwrapv} on the command-line results in
13718 @option{-fwrapv} being effective.  Note that only active options override, so
13719 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
13720 results in @option{-ftrapv} being effective.
13722 @item -fwrapv
13723 @opindex fwrapv
13724 This option instructs the compiler to assume that signed arithmetic
13725 overflow of addition, subtraction and multiplication wraps around
13726 using twos-complement representation.  This flag enables some optimizations
13727 and disables others.
13728 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
13729 @option{-ftrapv} @option{-fwrapv} on the command-line results in
13730 @option{-fwrapv} being effective.  Note that only active options override, so
13731 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
13732 results in @option{-ftrapv} being effective.
13734 @item -fwrapv-pointer
13735 @opindex fwrapv-pointer
13736 This option instructs the compiler to assume that pointer arithmetic
13737 overflow on addition and subtraction wraps around using twos-complement
13738 representation.  This flag disables some optimizations which assume
13739 pointer overflow is invalid.
13741 @item -fstrict-overflow
13742 @opindex fstrict-overflow
13743 This option implies @option{-fno-wrapv} @option{-fno-wrapv-pointer} and when
13744 negated implies @option{-fwrapv} @option{-fwrapv-pointer}.
13746 @item -fexceptions
13747 @opindex fexceptions
13748 Enable exception handling.  Generates extra code needed to propagate
13749 exceptions.  For some targets, this implies GCC generates frame
13750 unwind information for all functions, which can produce significant data
13751 size overhead, although it does not affect execution.  If you do not
13752 specify this option, GCC enables it by default for languages like
13753 C++ that normally require exception handling, and disables it for
13754 languages like C that do not normally require it.  However, you may need
13755 to enable this option when compiling C code that needs to interoperate
13756 properly with exception handlers written in C++.  You may also wish to
13757 disable this option if you are compiling older C++ programs that don't
13758 use exception handling.
13760 @item -fnon-call-exceptions
13761 @opindex fnon-call-exceptions
13762 Generate code that allows trapping instructions to throw exceptions.
13763 Note that this requires platform-specific runtime support that does
13764 not exist everywhere.  Moreover, it only allows @emph{trapping}
13765 instructions to throw exceptions, i.e.@: memory references or floating-point
13766 instructions.  It does not allow exceptions to be thrown from
13767 arbitrary signal handlers such as @code{SIGALRM}.
13769 @item -fdelete-dead-exceptions
13770 @opindex fdelete-dead-exceptions
13771 Consider that instructions that may throw exceptions but don't otherwise
13772 contribute to the execution of the program can be optimized away.
13773 This option is enabled by default for the Ada front end, as permitted by
13774 the Ada language specification.
13775 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
13777 @item -funwind-tables
13778 @opindex funwind-tables
13779 Similar to @option{-fexceptions}, except that it just generates any needed
13780 static data, but does not affect the generated code in any other way.
13781 You normally do not need to enable this option; instead, a language processor
13782 that needs this handling enables it on your behalf.
13784 @item -fasynchronous-unwind-tables
13785 @opindex fasynchronous-unwind-tables
13786 Generate unwind table in DWARF format, if supported by target machine.  The
13787 table is exact at each instruction boundary, so it can be used for stack
13788 unwinding from asynchronous events (such as debugger or garbage collector).
13790 @item -fno-gnu-unique
13791 @opindex fno-gnu-unique
13792 @opindex fgnu-unique
13793 On systems with recent GNU assembler and C library, the C++ compiler
13794 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
13795 of template static data members and static local variables in inline
13796 functions are unique even in the presence of @code{RTLD_LOCAL}; this
13797 is necessary to avoid problems with a library used by two different
13798 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
13799 therefore disagreeing with the other one about the binding of the
13800 symbol.  But this causes @code{dlclose} to be ignored for affected
13801 DSOs; if your program relies on reinitialization of a DSO via
13802 @code{dlclose} and @code{dlopen}, you can use
13803 @option{-fno-gnu-unique}.
13805 @item -fpcc-struct-return
13806 @opindex fpcc-struct-return
13807 Return ``short'' @code{struct} and @code{union} values in memory like
13808 longer ones, rather than in registers.  This convention is less
13809 efficient, but it has the advantage of allowing intercallability between
13810 GCC-compiled files and files compiled with other compilers, particularly
13811 the Portable C Compiler (pcc).
13813 The precise convention for returning structures in memory depends
13814 on the target configuration macros.
13816 Short structures and unions are those whose size and alignment match
13817 that of some integer type.
13819 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13820 switch is not binary compatible with code compiled with the
13821 @option{-freg-struct-return} switch.
13822 Use it to conform to a non-default application binary interface.
13824 @item -freg-struct-return
13825 @opindex freg-struct-return
13826 Return @code{struct} and @code{union} values in registers when possible.
13827 This is more efficient for small structures than
13828 @option{-fpcc-struct-return}.
13830 If you specify neither @option{-fpcc-struct-return} nor
13831 @option{-freg-struct-return}, GCC defaults to whichever convention is
13832 standard for the target.  If there is no standard convention, GCC
13833 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
13834 the principal compiler.  In those cases, we can choose the standard, and
13835 we chose the more efficient register return alternative.
13837 @strong{Warning:} code compiled with the @option{-freg-struct-return}
13838 switch is not binary compatible with code compiled with the
13839 @option{-fpcc-struct-return} switch.
13840 Use it to conform to a non-default application binary interface.
13842 @item -fshort-enums
13843 @opindex fshort-enums
13844 Allocate to an @code{enum} type only as many bytes as it needs for the
13845 declared range of possible values.  Specifically, the @code{enum} type
13846 is equivalent to the smallest integer type that has enough room.
13848 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
13849 code that is not binary compatible with code generated without that switch.
13850 Use it to conform to a non-default application binary interface.
13852 @item -fshort-wchar
13853 @opindex fshort-wchar
13854 Override the underlying type for @code{wchar_t} to be @code{short
13855 unsigned int} instead of the default for the target.  This option is
13856 useful for building programs to run under WINE@.
13858 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
13859 code that is not binary compatible with code generated without that switch.
13860 Use it to conform to a non-default application binary interface.
13862 @item -fno-common
13863 @opindex fno-common
13864 @opindex fcommon
13865 @cindex tentative definitions
13866 In C code, this option controls the placement of global variables 
13867 defined without an initializer, known as @dfn{tentative definitions} 
13868 in the C standard.  Tentative definitions are distinct from declarations 
13869 of a variable with the @code{extern} keyword, which do not allocate storage.
13871 Unix C compilers have traditionally allocated storage for
13872 uninitialized global variables in a common block.  This allows the
13873 linker to resolve all tentative definitions of the same variable
13874 in different compilation units to the same object, or to a non-tentative
13875 definition.  
13876 This is the behavior specified by @option{-fcommon}, and is the default for 
13877 GCC on most targets.  
13878 On the other hand, this behavior is not required by ISO
13879 C, and on some targets may carry a speed or code size penalty on
13880 variable references.
13882 The @option{-fno-common} option specifies that the compiler should instead
13883 place uninitialized global variables in the BSS section of the object file.
13884 This inhibits the merging of tentative definitions by the linker so
13885 you get a multiple-definition error if the same 
13886 variable is defined in more than one compilation unit.
13887 Compiling with @option{-fno-common} is useful on targets for which
13888 it provides better performance, or if you wish to verify that the
13889 program will work on other systems that always treat uninitialized
13890 variable definitions this way.
13892 @item -fno-ident
13893 @opindex fno-ident
13894 @opindex fident
13895 Ignore the @code{#ident} directive.
13897 @item -finhibit-size-directive
13898 @opindex finhibit-size-directive
13899 Don't output a @code{.size} assembler directive, or anything else that
13900 would cause trouble if the function is split in the middle, and the
13901 two halves are placed at locations far apart in memory.  This option is
13902 used when compiling @file{crtstuff.c}; you should not need to use it
13903 for anything else.
13905 @item -fverbose-asm
13906 @opindex fverbose-asm
13907 Put extra commentary information in the generated assembly code to
13908 make it more readable.  This option is generally only of use to those
13909 who actually need to read the generated assembly code (perhaps while
13910 debugging the compiler itself).
13912 @option{-fno-verbose-asm}, the default, causes the
13913 extra information to be omitted and is useful when comparing two assembler
13914 files.
13916 The added comments include:
13918 @itemize @bullet
13920 @item
13921 information on the compiler version and command-line options,
13923 @item
13924 the source code lines associated with the assembly instructions,
13925 in the form FILENAME:LINENUMBER:CONTENT OF LINE,
13927 @item
13928 hints on which high-level expressions correspond to
13929 the various assembly instruction operands.
13931 @end itemize
13933 For example, given this C source file:
13935 @smallexample
13936 int test (int n)
13938   int i;
13939   int total = 0;
13941   for (i = 0; i < n; i++)
13942     total += i * i;
13944   return total;
13946 @end smallexample
13948 compiling to (x86_64) assembly via @option{-S} and emitting the result
13949 direct to stdout via @option{-o} @option{-}
13951 @smallexample
13952 gcc -S test.c -fverbose-asm -Os -o -
13953 @end smallexample
13955 gives output similar to this:
13957 @smallexample
13958         .file   "test.c"
13959 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
13960   [...snip...]
13961 # options passed:
13962   [...snip...]
13964         .text
13965         .globl  test
13966         .type   test, @@function
13967 test:
13968 .LFB0:
13969         .cfi_startproc
13970 # test.c:4:   int total = 0;
13971         xorl    %eax, %eax      # <retval>
13972 # test.c:6:   for (i = 0; i < n; i++)
13973         xorl    %edx, %edx      # i
13974 .L2:
13975 # test.c:6:   for (i = 0; i < n; i++)
13976         cmpl    %edi, %edx      # n, i
13977         jge     .L5     #,
13978 # test.c:7:     total += i * i;
13979         movl    %edx, %ecx      # i, tmp92
13980         imull   %edx, %ecx      # i, tmp92
13981 # test.c:6:   for (i = 0; i < n; i++)
13982         incl    %edx    # i
13983 # test.c:7:     total += i * i;
13984         addl    %ecx, %eax      # tmp92, <retval>
13985         jmp     .L2     #
13986 .L5:
13987 # test.c:10: @}
13988         ret
13989         .cfi_endproc
13990 .LFE0:
13991         .size   test, .-test
13992         .ident  "GCC: (GNU) 7.0.0 20160809 (experimental)"
13993         .section        .note.GNU-stack,"",@@progbits
13994 @end smallexample
13996 The comments are intended for humans rather than machines and hence the
13997 precise format of the comments is subject to change.
13999 @item -frecord-gcc-switches
14000 @opindex frecord-gcc-switches
14001 This switch causes the command line used to invoke the
14002 compiler to be recorded into the object file that is being created.
14003 This switch is only implemented on some targets and the exact format
14004 of the recording is target and binary file format dependent, but it
14005 usually takes the form of a section containing ASCII text.  This
14006 switch is related to the @option{-fverbose-asm} switch, but that
14007 switch only records information in the assembler output file as
14008 comments, so it never reaches the object file.
14009 See also @option{-grecord-gcc-switches} for another
14010 way of storing compiler options into the object file.
14012 @item -fpic
14013 @opindex fpic
14014 @cindex global offset table
14015 @cindex PIC
14016 Generate position-independent code (PIC) suitable for use in a shared
14017 library, if supported for the target machine.  Such code accesses all
14018 constant addresses through a global offset table (GOT)@.  The dynamic
14019 loader resolves the GOT entries when the program starts (the dynamic
14020 loader is not part of GCC; it is part of the operating system).  If
14021 the GOT size for the linked executable exceeds a machine-specific
14022 maximum size, you get an error message from the linker indicating that
14023 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14024 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
14025 on the m68k and RS/6000.  The x86 has no such limit.)
14027 Position-independent code requires special support, and therefore works
14028 only on certain machines.  For the x86, GCC supports PIC for System V
14029 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14030 position-independent.
14032 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14033 are defined to 1.
14035 @item -fPIC
14036 @opindex fPIC
14037 If supported for the target machine, emit position-independent code,
14038 suitable for dynamic linking and avoiding any limit on the size of the
14039 global offset table.  This option makes a difference on AArch64, m68k,
14040 PowerPC and SPARC@.
14042 Position-independent code requires special support, and therefore works
14043 only on certain machines.
14045 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14046 are defined to 2.
14048 @item -fpie
14049 @itemx -fPIE
14050 @opindex fpie
14051 @opindex fPIE
14052 These options are similar to @option{-fpic} and @option{-fPIC}, but the
14053 generated position-independent code can be only linked into executables.
14054 Usually these options are used to compile code that will be linked using
14055 the @option{-pie} GCC option.
14057 @option{-fpie} and @option{-fPIE} both define the macros
14058 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
14059 for @option{-fpie} and 2 for @option{-fPIE}.
14061 @item -fno-plt
14062 @opindex fno-plt
14063 @opindex fplt
14064 Do not use the PLT for external function calls in position-independent code.
14065 Instead, load the callee address at call sites from the GOT and branch to it.
14066 This leads to more efficient code by eliminating PLT stubs and exposing
14067 GOT loads to optimizations.  On architectures such as 32-bit x86 where
14068 PLT stubs expect the GOT pointer in a specific register, this gives more
14069 register allocation freedom to the compiler.
14070 Lazy binding requires use of the PLT; 
14071 with @option{-fno-plt} all external symbols are resolved at load time.
14073 Alternatively, the function attribute @code{noplt} can be used to avoid calls
14074 through the PLT for specific external functions.
14076 In position-dependent code, a few targets also convert calls to
14077 functions that are marked to not use the PLT to use the GOT instead.
14079 @item -fno-jump-tables
14080 @opindex fno-jump-tables
14081 @opindex fjump-tables
14082 Do not use jump tables for switch statements even where it would be
14083 more efficient than other code generation strategies.  This option is
14084 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14085 building code that forms part of a dynamic linker and cannot
14086 reference the address of a jump table.  On some targets, jump tables
14087 do not require a GOT and this option is not needed.
14089 @item -ffixed-@var{reg}
14090 @opindex ffixed
14091 Treat the register named @var{reg} as a fixed register; generated code
14092 should never refer to it (except perhaps as a stack pointer, frame
14093 pointer or in some other fixed role).
14095 @var{reg} must be the name of a register.  The register names accepted
14096 are machine-specific and are defined in the @code{REGISTER_NAMES}
14097 macro in the machine description macro file.
14099 This flag does not have a negative form, because it specifies a
14100 three-way choice.
14102 @item -fcall-used-@var{reg}
14103 @opindex fcall-used
14104 Treat the register named @var{reg} as an allocable register that is
14105 clobbered by function calls.  It may be allocated for temporaries or
14106 variables that do not live across a call.  Functions compiled this way
14107 do not save and restore the register @var{reg}.
14109 It is an error to use this flag with the frame pointer or stack pointer.
14110 Use of this flag for other registers that have fixed pervasive roles in
14111 the machine's execution model produces disastrous results.
14113 This flag does not have a negative form, because it specifies a
14114 three-way choice.
14116 @item -fcall-saved-@var{reg}
14117 @opindex fcall-saved
14118 Treat the register named @var{reg} as an allocable register saved by
14119 functions.  It may be allocated even for temporaries or variables that
14120 live across a call.  Functions compiled this way save and restore
14121 the register @var{reg} if they use it.
14123 It is an error to use this flag with the frame pointer or stack pointer.
14124 Use of this flag for other registers that have fixed pervasive roles in
14125 the machine's execution model produces disastrous results.
14127 A different sort of disaster results from the use of this flag for
14128 a register in which function values may be returned.
14130 This flag does not have a negative form, because it specifies a
14131 three-way choice.
14133 @item -fpack-struct[=@var{n}]
14134 @opindex fpack-struct
14135 Without a value specified, pack all structure members together without
14136 holes.  When a value is specified (which must be a small power of two), pack
14137 structure members according to this value, representing the maximum
14138 alignment (that is, objects with default alignment requirements larger than
14139 this are output potentially unaligned at the next fitting location.
14141 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14142 code that is not binary compatible with code generated without that switch.
14143 Additionally, it makes the code suboptimal.
14144 Use it to conform to a non-default application binary interface.
14146 @item -fleading-underscore
14147 @opindex fleading-underscore
14148 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
14149 change the way C symbols are represented in the object file.  One use
14150 is to help link with legacy assembly code.
14152 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
14153 generate code that is not binary compatible with code generated without that
14154 switch.  Use it to conform to a non-default application binary interface.
14155 Not all targets provide complete support for this switch.
14157 @item -ftls-model=@var{model}
14158 @opindex ftls-model
14159 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
14160 The @var{model} argument should be one of @samp{global-dynamic},
14161 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
14162 Note that the choice is subject to optimization: the compiler may use
14163 a more efficient model for symbols not visible outside of the translation
14164 unit, or if @option{-fpic} is not given on the command line.
14166 The default without @option{-fpic} is @samp{initial-exec}; with
14167 @option{-fpic} the default is @samp{global-dynamic}.
14169 @item -ftrampolines
14170 @opindex ftrampolines
14171 For targets that normally need trampolines for nested functions, always
14172 generate them instead of using descriptors.  Otherwise, for targets that
14173 do not need them, like for example HP-PA or IA-64, do nothing.
14175 A trampoline is a small piece of code that is created at run time on the
14176 stack when the address of a nested function is taken, and is used to call
14177 the nested function indirectly.  Therefore, it requires the stack to be
14178 made executable in order for the program to work properly.
14180 @option{-fno-trampolines} is enabled by default on a language by language
14181 basis to let the compiler avoid generating them, if it computes that this
14182 is safe, and replace them with descriptors.  Descriptors are made up of data
14183 only, but the generated code must be prepared to deal with them.  As of this
14184 writing, @option{-fno-trampolines} is enabled by default only for Ada.
14186 Moreover, code compiled with @option{-ftrampolines} and code compiled with
14187 @option{-fno-trampolines} are not binary compatible if nested functions are
14188 present.  This option must therefore be used on a program-wide basis and be
14189 manipulated with extreme care.
14191 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
14192 @opindex fvisibility
14193 Set the default ELF image symbol visibility to the specified option---all
14194 symbols are marked with this unless overridden within the code.
14195 Using this feature can very substantially improve linking and
14196 load times of shared object libraries, produce more optimized
14197 code, provide near-perfect API export and prevent symbol clashes.
14198 It is @strong{strongly} recommended that you use this in any shared objects
14199 you distribute.
14201 Despite the nomenclature, @samp{default} always means public; i.e.,
14202 available to be linked against from outside the shared object.
14203 @samp{protected} and @samp{internal} are pretty useless in real-world
14204 usage so the only other commonly used option is @samp{hidden}.
14205 The default if @option{-fvisibility} isn't specified is
14206 @samp{default}, i.e., make every symbol public.
14208 A good explanation of the benefits offered by ensuring ELF
14209 symbols have the correct visibility is given by ``How To Write
14210 Shared Libraries'' by Ulrich Drepper (which can be found at
14211 @w{@uref{https://www.akkadia.org/drepper/}})---however a superior
14212 solution made possible by this option to marking things hidden when
14213 the default is public is to make the default hidden and mark things
14214 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
14215 and @code{__attribute__ ((visibility("default")))} instead of
14216 @code{__declspec(dllexport)} you get almost identical semantics with
14217 identical syntax.  This is a great boon to those working with
14218 cross-platform projects.
14220 For those adding visibility support to existing code, you may find
14221 @code{#pragma GCC visibility} of use.  This works by you enclosing
14222 the declarations you wish to set visibility for with (for example)
14223 @code{#pragma GCC visibility push(hidden)} and
14224 @code{#pragma GCC visibility pop}.
14225 Bear in mind that symbol visibility should be viewed @strong{as
14226 part of the API interface contract} and thus all new code should
14227 always specify visibility when it is not the default; i.e., declarations
14228 only for use within the local DSO should @strong{always} be marked explicitly
14229 as hidden as so to avoid PLT indirection overheads---making this
14230 abundantly clear also aids readability and self-documentation of the code.
14231 Note that due to ISO C++ specification requirements, @code{operator new} and
14232 @code{operator delete} must always be of default visibility.
14234 Be aware that headers from outside your project, in particular system
14235 headers and headers from any other library you use, may not be
14236 expecting to be compiled with visibility other than the default.  You
14237 may need to explicitly say @code{#pragma GCC visibility push(default)}
14238 before including any such headers.
14240 @code{extern} declarations are not affected by @option{-fvisibility}, so
14241 a lot of code can be recompiled with @option{-fvisibility=hidden} with
14242 no modifications.  However, this means that calls to @code{extern}
14243 functions with no explicit visibility use the PLT, so it is more
14244 effective to use @code{__attribute ((visibility))} and/or
14245 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
14246 declarations should be treated as hidden.
14248 Note that @option{-fvisibility} does affect C++ vague linkage
14249 entities. This means that, for instance, an exception class that is
14250 be thrown between DSOs must be explicitly marked with default
14251 visibility so that the @samp{type_info} nodes are unified between
14252 the DSOs.
14254 An overview of these techniques, their benefits and how to use them
14255 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
14257 @item -fstrict-volatile-bitfields
14258 @opindex fstrict-volatile-bitfields
14259 This option should be used if accesses to volatile bit-fields (or other
14260 structure fields, although the compiler usually honors those types
14261 anyway) should use a single access of the width of the
14262 field's type, aligned to a natural alignment if possible.  For
14263 example, targets with memory-mapped peripheral registers might require
14264 all such accesses to be 16 bits wide; with this flag you can
14265 declare all peripheral bit-fields as @code{unsigned short} (assuming short
14266 is 16 bits on these targets) to force GCC to use 16-bit accesses
14267 instead of, perhaps, a more efficient 32-bit access.
14269 If this option is disabled, the compiler uses the most efficient
14270 instruction.  In the previous example, that might be a 32-bit load
14271 instruction, even though that accesses bytes that do not contain
14272 any portion of the bit-field, or memory-mapped registers unrelated to
14273 the one being updated.
14275 In some cases, such as when the @code{packed} attribute is applied to a 
14276 structure field, it may not be possible to access the field with a single
14277 read or write that is correctly aligned for the target machine.  In this
14278 case GCC falls back to generating multiple accesses rather than code that 
14279 will fault or truncate the result at run time.
14281 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
14282 not allowed to touch non bit-field members.  It is therefore recommended
14283 to define all bits of the field's type as bit-field members.
14285 The default value of this option is determined by the application binary
14286 interface for the target processor.
14288 @item -fsync-libcalls
14289 @opindex fsync-libcalls
14290 This option controls whether any out-of-line instance of the @code{__sync}
14291 family of functions may be used to implement the C++11 @code{__atomic}
14292 family of functions.
14294 The default value of this option is enabled, thus the only useful form
14295 of the option is @option{-fno-sync-libcalls}.  This option is used in
14296 the implementation of the @file{libatomic} runtime library.
14298 @end table
14300 @node Developer Options
14301 @section GCC Developer Options
14302 @cindex developer options
14303 @cindex debugging GCC
14304 @cindex debug dump options
14305 @cindex dump options
14306 @cindex compilation statistics
14308 This section describes command-line options that are primarily of
14309 interest to GCC developers, including options to support compiler
14310 testing and investigation of compiler bugs and compile-time
14311 performance problems.  This includes options that produce debug dumps
14312 at various points in the compilation; that print statistics such as
14313 memory use and execution time; and that print information about GCC's
14314 configuration, such as where it searches for libraries.  You should
14315 rarely need to use any of these options for ordinary compilation and
14316 linking tasks.
14318 Many developer options that cause GCC to dump output to a file take an
14319 optional @samp{=@var{filename}} suffix. You can specify @samp{stdout}
14320 or @samp{-} to dump to standard output, and @samp{stderr} for standard
14321 error.
14323 If @samp{=@var{filename}} is omitted, a default dump file name is
14324 constructed by concatenating the base dump file name, a pass number,
14325 phase letter, and pass name.  The base dump file name is the name of
14326 output file produced by the compiler if explicitly specified and not
14327 an executable; otherwise it is the source file name.
14328 The pass number is determined by the order passes are registered with
14329 the compiler's pass manager. 
14330 This is generally the same as the order of execution, but passes
14331 registered by plugins, target-specific passes, or passes that are
14332 otherwise registered late are numbered higher than the pass named
14333 @samp{final}, even if they are executed earlier.  The phase letter is
14334 one of @samp{i} (inter-procedural analysis), @samp{l}
14335 (language-specific), @samp{r} (RTL), or @samp{t} (tree). 
14336 The files are created in the directory of the output file. 
14338 @table @gcctabopt
14340 @item -d@var{letters}
14341 @itemx -fdump-rtl-@var{pass}
14342 @itemx -fdump-rtl-@var{pass}=@var{filename}
14343 @opindex d
14344 @opindex fdump-rtl-@var{pass}
14345 Says to make debugging dumps during compilation at times specified by
14346 @var{letters}.  This is used for debugging the RTL-based passes of the
14347 compiler.
14349 Some @option{-d@var{letters}} switches have different meaning when
14350 @option{-E} is used for preprocessing.  @xref{Preprocessor Options},
14351 for information about preprocessor-specific dump options.
14353 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
14354 @option{-d} option @var{letters}.  Here are the possible
14355 letters for use in @var{pass} and @var{letters}, and their meanings:
14357 @table @gcctabopt
14359 @item -fdump-rtl-alignments
14360 @opindex fdump-rtl-alignments
14361 Dump after branch alignments have been computed.
14363 @item -fdump-rtl-asmcons
14364 @opindex fdump-rtl-asmcons
14365 Dump after fixing rtl statements that have unsatisfied in/out constraints.
14367 @item -fdump-rtl-auto_inc_dec
14368 @opindex fdump-rtl-auto_inc_dec
14369 Dump after auto-inc-dec discovery.  This pass is only run on
14370 architectures that have auto inc or auto dec instructions.
14372 @item -fdump-rtl-barriers
14373 @opindex fdump-rtl-barriers
14374 Dump after cleaning up the barrier instructions.
14376 @item -fdump-rtl-bbpart
14377 @opindex fdump-rtl-bbpart
14378 Dump after partitioning hot and cold basic blocks.
14380 @item -fdump-rtl-bbro
14381 @opindex fdump-rtl-bbro
14382 Dump after block reordering.
14384 @item -fdump-rtl-btl1
14385 @itemx -fdump-rtl-btl2
14386 @opindex fdump-rtl-btl2
14387 @opindex fdump-rtl-btl2
14388 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
14389 after the two branch
14390 target load optimization passes.
14392 @item -fdump-rtl-bypass
14393 @opindex fdump-rtl-bypass
14394 Dump after jump bypassing and control flow optimizations.
14396 @item -fdump-rtl-combine
14397 @opindex fdump-rtl-combine
14398 Dump after the RTL instruction combination pass.
14400 @item -fdump-rtl-compgotos
14401 @opindex fdump-rtl-compgotos
14402 Dump after duplicating the computed gotos.
14404 @item -fdump-rtl-ce1
14405 @itemx -fdump-rtl-ce2
14406 @itemx -fdump-rtl-ce3
14407 @opindex fdump-rtl-ce1
14408 @opindex fdump-rtl-ce2
14409 @opindex fdump-rtl-ce3
14410 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
14411 @option{-fdump-rtl-ce3} enable dumping after the three
14412 if conversion passes.
14414 @item -fdump-rtl-cprop_hardreg
14415 @opindex fdump-rtl-cprop_hardreg
14416 Dump after hard register copy propagation.
14418 @item -fdump-rtl-csa
14419 @opindex fdump-rtl-csa
14420 Dump after combining stack adjustments.
14422 @item -fdump-rtl-cse1
14423 @itemx -fdump-rtl-cse2
14424 @opindex fdump-rtl-cse1
14425 @opindex fdump-rtl-cse2
14426 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
14427 the two common subexpression elimination passes.
14429 @item -fdump-rtl-dce
14430 @opindex fdump-rtl-dce
14431 Dump after the standalone dead code elimination passes.
14433 @item -fdump-rtl-dbr
14434 @opindex fdump-rtl-dbr
14435 Dump after delayed branch scheduling.
14437 @item -fdump-rtl-dce1
14438 @itemx -fdump-rtl-dce2
14439 @opindex fdump-rtl-dce1
14440 @opindex fdump-rtl-dce2
14441 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
14442 the two dead store elimination passes.
14444 @item -fdump-rtl-eh
14445 @opindex fdump-rtl-eh
14446 Dump after finalization of EH handling code.
14448 @item -fdump-rtl-eh_ranges
14449 @opindex fdump-rtl-eh_ranges
14450 Dump after conversion of EH handling range regions.
14452 @item -fdump-rtl-expand
14453 @opindex fdump-rtl-expand
14454 Dump after RTL generation.
14456 @item -fdump-rtl-fwprop1
14457 @itemx -fdump-rtl-fwprop2
14458 @opindex fdump-rtl-fwprop1
14459 @opindex fdump-rtl-fwprop2
14460 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
14461 dumping after the two forward propagation passes.
14463 @item -fdump-rtl-gcse1
14464 @itemx -fdump-rtl-gcse2
14465 @opindex fdump-rtl-gcse1
14466 @opindex fdump-rtl-gcse2
14467 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
14468 after global common subexpression elimination.
14470 @item -fdump-rtl-init-regs
14471 @opindex fdump-rtl-init-regs
14472 Dump after the initialization of the registers.
14474 @item -fdump-rtl-initvals
14475 @opindex fdump-rtl-initvals
14476 Dump after the computation of the initial value sets.
14478 @item -fdump-rtl-into_cfglayout
14479 @opindex fdump-rtl-into_cfglayout
14480 Dump after converting to cfglayout mode.
14482 @item -fdump-rtl-ira
14483 @opindex fdump-rtl-ira
14484 Dump after iterated register allocation.
14486 @item -fdump-rtl-jump
14487 @opindex fdump-rtl-jump
14488 Dump after the second jump optimization.
14490 @item -fdump-rtl-loop2
14491 @opindex fdump-rtl-loop2
14492 @option{-fdump-rtl-loop2} enables dumping after the rtl
14493 loop optimization passes.
14495 @item -fdump-rtl-mach
14496 @opindex fdump-rtl-mach
14497 Dump after performing the machine dependent reorganization pass, if that
14498 pass exists.
14500 @item -fdump-rtl-mode_sw
14501 @opindex fdump-rtl-mode_sw
14502 Dump after removing redundant mode switches.
14504 @item -fdump-rtl-rnreg
14505 @opindex fdump-rtl-rnreg
14506 Dump after register renumbering.
14508 @item -fdump-rtl-outof_cfglayout
14509 @opindex fdump-rtl-outof_cfglayout
14510 Dump after converting from cfglayout mode.
14512 @item -fdump-rtl-peephole2
14513 @opindex fdump-rtl-peephole2
14514 Dump after the peephole pass.
14516 @item -fdump-rtl-postreload
14517 @opindex fdump-rtl-postreload
14518 Dump after post-reload optimizations.
14520 @item -fdump-rtl-pro_and_epilogue
14521 @opindex fdump-rtl-pro_and_epilogue
14522 Dump after generating the function prologues and epilogues.
14524 @item -fdump-rtl-sched1
14525 @itemx -fdump-rtl-sched2
14526 @opindex fdump-rtl-sched1
14527 @opindex fdump-rtl-sched2
14528 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
14529 after the basic block scheduling passes.
14531 @item -fdump-rtl-ree
14532 @opindex fdump-rtl-ree
14533 Dump after sign/zero extension elimination.
14535 @item -fdump-rtl-seqabstr
14536 @opindex fdump-rtl-seqabstr
14537 Dump after common sequence discovery.
14539 @item -fdump-rtl-shorten
14540 @opindex fdump-rtl-shorten
14541 Dump after shortening branches.
14543 @item -fdump-rtl-sibling
14544 @opindex fdump-rtl-sibling
14545 Dump after sibling call optimizations.
14547 @item -fdump-rtl-split1
14548 @itemx -fdump-rtl-split2
14549 @itemx -fdump-rtl-split3
14550 @itemx -fdump-rtl-split4
14551 @itemx -fdump-rtl-split5
14552 @opindex fdump-rtl-split1
14553 @opindex fdump-rtl-split2
14554 @opindex fdump-rtl-split3
14555 @opindex fdump-rtl-split4
14556 @opindex fdump-rtl-split5
14557 These options enable dumping after five rounds of
14558 instruction splitting.
14560 @item -fdump-rtl-sms
14561 @opindex fdump-rtl-sms
14562 Dump after modulo scheduling.  This pass is only run on some
14563 architectures.
14565 @item -fdump-rtl-stack
14566 @opindex fdump-rtl-stack
14567 Dump after conversion from GCC's ``flat register file'' registers to the
14568 x87's stack-like registers.  This pass is only run on x86 variants.
14570 @item -fdump-rtl-subreg1
14571 @itemx -fdump-rtl-subreg2
14572 @opindex fdump-rtl-subreg1
14573 @opindex fdump-rtl-subreg2
14574 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
14575 the two subreg expansion passes.
14577 @item -fdump-rtl-unshare
14578 @opindex fdump-rtl-unshare
14579 Dump after all rtl has been unshared.
14581 @item -fdump-rtl-vartrack
14582 @opindex fdump-rtl-vartrack
14583 Dump after variable tracking.
14585 @item -fdump-rtl-vregs
14586 @opindex fdump-rtl-vregs
14587 Dump after converting virtual registers to hard registers.
14589 @item -fdump-rtl-web
14590 @opindex fdump-rtl-web
14591 Dump after live range splitting.
14593 @item -fdump-rtl-regclass
14594 @itemx -fdump-rtl-subregs_of_mode_init
14595 @itemx -fdump-rtl-subregs_of_mode_finish
14596 @itemx -fdump-rtl-dfinit
14597 @itemx -fdump-rtl-dfinish
14598 @opindex fdump-rtl-regclass
14599 @opindex fdump-rtl-subregs_of_mode_init
14600 @opindex fdump-rtl-subregs_of_mode_finish
14601 @opindex fdump-rtl-dfinit
14602 @opindex fdump-rtl-dfinish
14603 These dumps are defined but always produce empty files.
14605 @item -da
14606 @itemx -fdump-rtl-all
14607 @opindex da
14608 @opindex fdump-rtl-all
14609 Produce all the dumps listed above.
14611 @item -dA
14612 @opindex dA
14613 Annotate the assembler output with miscellaneous debugging information.
14615 @item -dD
14616 @opindex dD
14617 Dump all macro definitions, at the end of preprocessing, in addition to
14618 normal output.
14620 @item -dH
14621 @opindex dH
14622 Produce a core dump whenever an error occurs.
14624 @item -dp
14625 @opindex dp
14626 Annotate the assembler output with a comment indicating which
14627 pattern and alternative is used.  The length and cost of each instruction are
14628 also printed.
14630 @item -dP
14631 @opindex dP
14632 Dump the RTL in the assembler output as a comment before each instruction.
14633 Also turns on @option{-dp} annotation.
14635 @item -dx
14636 @opindex dx
14637 Just generate RTL for a function instead of compiling it.  Usually used
14638 with @option{-fdump-rtl-expand}.
14639 @end table
14641 @item -fdump-debug
14642 @opindex fdump-debug
14643 Dump debugging information generated during the debug
14644 generation phase.
14646 @item -fdump-earlydebug
14647 @opindex fdump-earlydebug
14648 Dump debugging information generated during the early debug
14649 generation phase.
14651 @item -fdump-noaddr
14652 @opindex fdump-noaddr
14653 When doing debugging dumps, suppress address output.  This makes it more
14654 feasible to use diff on debugging dumps for compiler invocations with
14655 different compiler binaries and/or different
14656 text / bss / data / heap / stack / dso start locations.
14658 @item -freport-bug
14659 @opindex freport-bug
14660 Collect and dump debug information into a temporary file if an
14661 internal compiler error (ICE) occurs.
14663 @item -fdump-unnumbered
14664 @opindex fdump-unnumbered
14665 When doing debugging dumps, suppress instruction numbers and address output.
14666 This makes it more feasible to use diff on debugging dumps for compiler
14667 invocations with different options, in particular with and without
14668 @option{-g}.
14670 @item -fdump-unnumbered-links
14671 @opindex fdump-unnumbered-links
14672 When doing debugging dumps (see @option{-d} option above), suppress
14673 instruction numbers for the links to the previous and next instructions
14674 in a sequence.
14676 @item -fdump-ipa-@var{switch}
14677 @itemx -fdump-ipa-@var{switch}-@var{options}
14678 @opindex fdump-ipa
14679 Control the dumping at various stages of inter-procedural analysis
14680 language tree to a file.  The file name is generated by appending a
14681 switch specific suffix to the source file name, and the file is created
14682 in the same directory as the output file.  The following dumps are
14683 possible:
14685 @table @samp
14686 @item all
14687 Enables all inter-procedural analysis dumps.
14689 @item cgraph
14690 Dumps information about call-graph optimization, unused function removal,
14691 and inlining decisions.
14693 @item inline
14694 Dump after function inlining.
14696 @end table
14698 Additionally, the options @option{-optimized}, @option{-missed},
14699 @option{-note}, and @option{-all} can be provided, with the same meaning
14700 as for @option{-fopt-info}, defaulting to @option{-optimized}.
14702 For example, @option{-fdump-ipa-inline-optimized-missed} will emit
14703 information on callsites that were inlined, along with callsites
14704 that were not inlined.
14706 By default, the dump will contain messages about successful
14707 optimizations (equivalent to @option{-optimized}) together with
14708 low-level details about the analysis.
14710 @item -fdump-lang-all
14711 @itemx -fdump-lang-@var{switch}
14712 @itemx -fdump-lang-@var{switch}-@var{options}
14713 @itemx -fdump-lang-@var{switch}-@var{options}=@var{filename}
14714 @opindex fdump-lang-all
14715 @opindex fdump-lang
14716 Control the dumping of language-specific information.  The @var{options}
14717 and @var{filename} portions behave as described in the
14718 @option{-fdump-tree} option.  The following @var{switch} values are
14719 accepted:
14721 @table @samp
14722 @item all
14724 Enable all language-specific dumps.
14726 @item class
14727 Dump class hierarchy information.  Virtual table information is emitted
14728 unless '@option{slim}' is specified.  This option is applicable to C++ only.
14730 @item raw
14731 Dump the raw internal tree data.  This option is applicable to C++ only.
14733 @end table
14735 @item -fdump-passes
14736 @opindex fdump-passes
14737 Print on @file{stderr} the list of optimization passes that are turned
14738 on and off by the current command-line options.
14740 @item -fdump-statistics-@var{option}
14741 @opindex fdump-statistics
14742 Enable and control dumping of pass statistics in a separate file.  The
14743 file name is generated by appending a suffix ending in
14744 @samp{.statistics} to the source file name, and the file is created in
14745 the same directory as the output file.  If the @samp{-@var{option}}
14746 form is used, @samp{-stats} causes counters to be summed over the
14747 whole compilation unit while @samp{-details} dumps every event as
14748 the passes generate them.  The default with no option is to sum
14749 counters for each function compiled.
14751 @item -fdump-tree-all
14752 @itemx -fdump-tree-@var{switch}
14753 @itemx -fdump-tree-@var{switch}-@var{options}
14754 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
14755 @opindex fdump-tree-all
14756 @opindex fdump-tree
14757 Control the dumping at various stages of processing the intermediate
14758 language tree to a file.  If the @samp{-@var{options}}
14759 form is used, @var{options} is a list of @samp{-} separated options
14760 which control the details of the dump.  Not all options are applicable
14761 to all dumps; those that are not meaningful are ignored.  The
14762 following options are available
14764 @table @samp
14765 @item address
14766 Print the address of each node.  Usually this is not meaningful as it
14767 changes according to the environment and source file.  Its primary use
14768 is for tying up a dump file with a debug environment.
14769 @item asmname
14770 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
14771 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
14772 use working backward from mangled names in the assembly file.
14773 @item slim
14774 When dumping front-end intermediate representations, inhibit dumping
14775 of members of a scope or body of a function merely because that scope
14776 has been reached.  Only dump such items when they are directly reachable
14777 by some other path.
14779 When dumping pretty-printed trees, this option inhibits dumping the
14780 bodies of control structures.
14782 When dumping RTL, print the RTL in slim (condensed) form instead of
14783 the default LISP-like representation.
14784 @item raw
14785 Print a raw representation of the tree.  By default, trees are
14786 pretty-printed into a C-like representation.
14787 @item details
14788 Enable more detailed dumps (not honored by every dump option). Also
14789 include information from the optimization passes.
14790 @item stats
14791 Enable dumping various statistics about the pass (not honored by every dump
14792 option).
14793 @item blocks
14794 Enable showing basic block boundaries (disabled in raw dumps).
14795 @item graph
14796 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
14797 dump a representation of the control flow graph suitable for viewing with
14798 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
14799 the file is pretty-printed as a subgraph, so that GraphViz can render them
14800 all in a single plot.
14802 This option currently only works for RTL dumps, and the RTL is always
14803 dumped in slim form.
14804 @item vops
14805 Enable showing virtual operands for every statement.
14806 @item lineno
14807 Enable showing line numbers for statements.
14808 @item uid
14809 Enable showing the unique ID (@code{DECL_UID}) for each variable.
14810 @item verbose
14811 Enable showing the tree dump for each statement.
14812 @item eh
14813 Enable showing the EH region number holding each statement.
14814 @item scev
14815 Enable showing scalar evolution analysis details.
14816 @item optimized
14817 Enable showing optimization information (only available in certain
14818 passes).
14819 @item missed
14820 Enable showing missed optimization information (only available in certain
14821 passes).
14822 @item note
14823 Enable other detailed optimization information (only available in
14824 certain passes).
14825 @item all
14826 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
14827 and @option{lineno}.
14828 @item optall
14829 Turn on all optimization options, i.e., @option{optimized},
14830 @option{missed}, and @option{note}.
14831 @end table
14833 To determine what tree dumps are available or find the dump for a pass
14834 of interest follow the steps below.
14836 @enumerate
14837 @item
14838 Invoke GCC with @option{-fdump-passes} and in the @file{stderr} output
14839 look for a code that corresponds to the pass you are interested in.
14840 For example, the codes @code{tree-evrp}, @code{tree-vrp1}, and
14841 @code{tree-vrp2} correspond to the three Value Range Propagation passes.
14842 The number at the end distinguishes distinct invocations of the same pass.
14843 @item
14844 To enable the creation of the dump file, append the pass code to
14845 the @option{-fdump-} option prefix and invoke GCC with it.  For example,
14846 to enable the dump from the Early Value Range Propagation pass, invoke
14847 GCC with the @option{-fdump-tree-evrp} option.  Optionally, you may
14848 specify the name of the dump file.  If you don't specify one, GCC
14849 creates as described below.
14850 @item
14851 Find the pass dump in a file whose name is composed of three components
14852 separated by a period: the name of the source file GCC was invoked to
14853 compile, a numeric suffix indicating the pass number followed by the
14854 letter @samp{t} for tree passes (and the letter @samp{r} for RTL passes),
14855 and finally the pass code.  For example, the Early VRP pass dump might
14856 be in a file named @file{myfile.c.038t.evrp} in the current working
14857 directory.  Note that the numeric codes are not stable and may change
14858 from one version of GCC to another.
14859 @end enumerate
14861 @item -fopt-info
14862 @itemx -fopt-info-@var{options}
14863 @itemx -fopt-info-@var{options}=@var{filename}
14864 @opindex fopt-info
14865 Controls optimization dumps from various optimization passes. If the
14866 @samp{-@var{options}} form is used, @var{options} is a list of
14867 @samp{-} separated option keywords to select the dump details and
14868 optimizations.  
14870 The @var{options} can be divided into three groups:
14871 @enumerate
14872 @item
14873 options describing what kinds of messages should be emitted,
14874 @item
14875 options describing the verbosity of the dump, and
14876 @item
14877 options describing which optimizations should be included.
14878 @end enumerate
14879 The options from each group can be freely mixed as they are
14880 non-overlapping. However, in case of any conflicts,
14881 the later options override the earlier options on the command
14882 line. 
14884 The following options control which kinds of messages should be emitted:
14886 @table @samp
14887 @item optimized
14888 Print information when an optimization is successfully applied. It is
14889 up to a pass to decide which information is relevant. For example, the
14890 vectorizer passes print the source location of loops which are
14891 successfully vectorized.
14892 @item missed
14893 Print information about missed optimizations. Individual passes
14894 control which information to include in the output. 
14895 @item note
14896 Print verbose information about optimizations, such as certain
14897 transformations, more detailed messages about decisions etc.
14898 @item all
14899 Print detailed optimization information. This includes
14900 @samp{optimized}, @samp{missed}, and @samp{note}.
14901 @end table
14903 The following option controls the dump verbosity:
14905 @table @samp
14906 @item internals
14907 By default, only ``high-level'' messages are emitted. This option enables
14908 additional, more detailed, messages, which are likely to only be of interest
14909 to GCC developers.
14910 @end table
14912 One or more of the following option keywords can be used to describe a
14913 group of optimizations:
14915 @table @samp
14916 @item ipa
14917 Enable dumps from all interprocedural optimizations.
14918 @item loop
14919 Enable dumps from all loop optimizations.
14920 @item inline
14921 Enable dumps from all inlining optimizations.
14922 @item omp
14923 Enable dumps from all OMP (Offloading and Multi Processing) optimizations.
14924 @item vec
14925 Enable dumps from all vectorization optimizations.
14926 @item optall
14927 Enable dumps from all optimizations. This is a superset of
14928 the optimization groups listed above.
14929 @end table
14931 If @var{options} is
14932 omitted, it defaults to @samp{optimized-optall}, which means to dump messages
14933 about successful optimizations from all the passes, omitting messages
14934 that are treated as ``internals''.
14936 If the @var{filename} is provided, then the dumps from all the
14937 applicable optimizations are concatenated into the @var{filename}.
14938 Otherwise the dump is output onto @file{stderr}. Though multiple
14939 @option{-fopt-info} options are accepted, only one of them can include
14940 a @var{filename}. If other filenames are provided then all but the
14941 first such option are ignored.
14943 Note that the output @var{filename} is overwritten
14944 in case of multiple translation units. If a combined output from
14945 multiple translation units is desired, @file{stderr} should be used
14946 instead.
14948 In the following example, the optimization info is output to
14949 @file{stderr}:
14951 @smallexample
14952 gcc -O3 -fopt-info
14953 @end smallexample
14955 This example:
14956 @smallexample
14957 gcc -O3 -fopt-info-missed=missed.all
14958 @end smallexample
14960 @noindent
14961 outputs missed optimization report from all the passes into
14962 @file{missed.all}, and this one:
14964 @smallexample
14965 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
14966 @end smallexample
14968 @noindent
14969 prints information about missed optimization opportunities from
14970 vectorization passes on @file{stderr}.  
14971 Note that @option{-fopt-info-vec-missed} is equivalent to 
14972 @option{-fopt-info-missed-vec}.  The order of the optimization group
14973 names and message types listed after @option{-fopt-info} does not matter.
14975 As another example,
14976 @smallexample
14977 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
14978 @end smallexample
14980 @noindent
14981 outputs information about missed optimizations as well as
14982 optimized locations from all the inlining passes into
14983 @file{inline.txt}.
14985 Finally, consider:
14987 @smallexample
14988 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
14989 @end smallexample
14991 @noindent
14992 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
14993 in conflict since only one output file is allowed. In this case, only
14994 the first option takes effect and the subsequent options are
14995 ignored. Thus only @file{vec.miss} is produced which contains
14996 dumps from the vectorizer about missed opportunities.
14998 @item -fsave-optimization-record
14999 @opindex fsave-optimization-record
15000 Write a SRCFILE.opt-record.json.gz file detailing what optimizations
15001 were performed, for those optimizations that support @option{-fopt-info}.
15003 This option is experimental and the format of the data within the
15004 compressed JSON file is subject to change.
15006 It is roughly equivalent to a machine-readable version of
15007 @option{-fopt-info-all}, as a collection of messages with source file,
15008 line number and column number, with the following additional data for
15009 each message:
15011 @itemize @bullet
15013 @item
15014 the execution count of the code being optimized, along with metadata about
15015 whether this was from actual profile data, or just an estimate, allowing
15016 consumers to prioritize messages by code hotness,
15018 @item
15019 the function name of the code being optimized, where applicable,
15021 @item
15022 the ``inlining chain'' for the code being optimized, so that when
15023 a function is inlined into several different places (which might
15024 themselves be inlined), the reader can distinguish between the copies,
15026 @item
15027 objects identifying those parts of the message that refer to expressions,
15028 statements or symbol-table nodes, which of these categories they are, and,
15029 when available, their source code location,
15031 @item
15032 the GCC pass that emitted the message, and
15034 @item
15035 the location in GCC's own code from which the message was emitted
15037 @end itemize
15039 Additionally, some messages are logically nested within other
15040 messages, reflecting implementation details of the optimization
15041 passes.
15043 @item -fsched-verbose=@var{n}
15044 @opindex fsched-verbose
15045 On targets that use instruction scheduling, this option controls the
15046 amount of debugging output the scheduler prints to the dump files.
15048 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
15049 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
15050 For @var{n} greater than one, it also output basic block probabilities,
15051 detailed ready list information and unit/insn info.  For @var{n} greater
15052 than two, it includes RTL at abort point, control-flow and regions info.
15053 And for @var{n} over four, @option{-fsched-verbose} also includes
15054 dependence info.
15058 @item -fenable-@var{kind}-@var{pass}
15059 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
15060 @opindex fdisable-
15061 @opindex fenable-
15063 This is a set of options that are used to explicitly disable/enable
15064 optimization passes.  These options are intended for use for debugging GCC.
15065 Compiler users should use regular options for enabling/disabling
15066 passes instead.
15068 @table @gcctabopt
15070 @item -fdisable-ipa-@var{pass}
15071 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
15072 statically invoked in the compiler multiple times, the pass name should be
15073 appended with a sequential number starting from 1.
15075 @item -fdisable-rtl-@var{pass}
15076 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
15077 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
15078 statically invoked in the compiler multiple times, the pass name should be
15079 appended with a sequential number starting from 1.  @var{range-list} is a 
15080 comma-separated list of function ranges or assembler names.  Each range is a number
15081 pair separated by a colon.  The range is inclusive in both ends.  If the range
15082 is trivial, the number pair can be simplified as a single number.  If the
15083 function's call graph node's @var{uid} falls within one of the specified ranges,
15084 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
15085 function header of a dump file, and the pass names can be dumped by using
15086 option @option{-fdump-passes}.
15088 @item -fdisable-tree-@var{pass}
15089 @itemx -fdisable-tree-@var{pass}=@var{range-list}
15090 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
15091 option arguments.
15093 @item -fenable-ipa-@var{pass}
15094 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
15095 statically invoked in the compiler multiple times, the pass name should be
15096 appended with a sequential number starting from 1.
15098 @item -fenable-rtl-@var{pass}
15099 @itemx -fenable-rtl-@var{pass}=@var{range-list}
15100 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
15101 description and examples.
15103 @item -fenable-tree-@var{pass}
15104 @itemx -fenable-tree-@var{pass}=@var{range-list}
15105 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
15106 of option arguments.
15108 @end table
15110 Here are some examples showing uses of these options.
15112 @smallexample
15114 # disable ccp1 for all functions
15115    -fdisable-tree-ccp1
15116 # disable complete unroll for function whose cgraph node uid is 1
15117    -fenable-tree-cunroll=1
15118 # disable gcse2 for functions at the following ranges [1,1],
15119 # [300,400], and [400,1000]
15120 # disable gcse2 for functions foo and foo2
15121    -fdisable-rtl-gcse2=foo,foo2
15122 # disable early inlining
15123    -fdisable-tree-einline
15124 # disable ipa inlining
15125    -fdisable-ipa-inline
15126 # enable tree full unroll
15127    -fenable-tree-unroll
15129 @end smallexample
15131 @item -fchecking
15132 @itemx -fchecking=@var{n}
15133 @opindex fchecking
15134 @opindex fno-checking
15135 Enable internal consistency checking.  The default depends on
15136 the compiler configuration.  @option{-fchecking=2} enables further
15137 internal consistency checking that might affect code generation.
15139 @item -frandom-seed=@var{string}
15140 @opindex frandom-seed
15141 This option provides a seed that GCC uses in place of
15142 random numbers in generating certain symbol names
15143 that have to be different in every compiled file.  It is also used to
15144 place unique stamps in coverage data files and the object files that
15145 produce them.  You can use the @option{-frandom-seed} option to produce
15146 reproducibly identical object files.
15148 The @var{string} can either be a number (decimal, octal or hex) or an
15149 arbitrary string (in which case it's converted to a number by
15150 computing CRC32).
15152 The @var{string} should be different for every file you compile.
15154 @item -save-temps
15155 @itemx -save-temps=cwd
15156 @opindex save-temps
15157 Store the usual ``temporary'' intermediate files permanently; place them
15158 in the current directory and name them based on the source file.  Thus,
15159 compiling @file{foo.c} with @option{-c -save-temps} produces files
15160 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
15161 preprocessed @file{foo.i} output file even though the compiler now
15162 normally uses an integrated preprocessor.
15164 When used in combination with the @option{-x} command-line option,
15165 @option{-save-temps} is sensible enough to avoid over writing an
15166 input source file with the same extension as an intermediate file.
15167 The corresponding intermediate file may be obtained by renaming the
15168 source file before using @option{-save-temps}.
15170 If you invoke GCC in parallel, compiling several different source
15171 files that share a common base name in different subdirectories or the
15172 same source file compiled for multiple output destinations, it is
15173 likely that the different parallel compilers will interfere with each
15174 other, and overwrite the temporary files.  For instance:
15176 @smallexample
15177 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
15178 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
15179 @end smallexample
15181 may result in @file{foo.i} and @file{foo.o} being written to
15182 simultaneously by both compilers.
15184 @item -save-temps=obj
15185 @opindex save-temps=obj
15186 Store the usual ``temporary'' intermediate files permanently.  If the
15187 @option{-o} option is used, the temporary files are based on the
15188 object file.  If the @option{-o} option is not used, the
15189 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
15191 For example:
15193 @smallexample
15194 gcc -save-temps=obj -c foo.c
15195 gcc -save-temps=obj -c bar.c -o dir/xbar.o
15196 gcc -save-temps=obj foobar.c -o dir2/yfoobar
15197 @end smallexample
15199 @noindent
15200 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
15201 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
15202 @file{dir2/yfoobar.o}.
15204 @item -time@r{[}=@var{file}@r{]}
15205 @opindex time
15206 Report the CPU time taken by each subprocess in the compilation
15207 sequence.  For C source files, this is the compiler proper and assembler
15208 (plus the linker if linking is done).
15210 Without the specification of an output file, the output looks like this:
15212 @smallexample
15213 # cc1 0.12 0.01
15214 # as 0.00 0.01
15215 @end smallexample
15217 The first number on each line is the ``user time'', that is time spent
15218 executing the program itself.  The second number is ``system time'',
15219 time spent executing operating system routines on behalf of the program.
15220 Both numbers are in seconds.
15222 With the specification of an output file, the output is appended to the
15223 named file, and it looks like this:
15225 @smallexample
15226 0.12 0.01 cc1 @var{options}
15227 0.00 0.01 as @var{options}
15228 @end smallexample
15230 The ``user time'' and the ``system time'' are moved before the program
15231 name, and the options passed to the program are displayed, so that one
15232 can later tell what file was being compiled, and with which options.
15234 @item -fdump-final-insns@r{[}=@var{file}@r{]}
15235 @opindex fdump-final-insns
15236 Dump the final internal representation (RTL) to @var{file}.  If the
15237 optional argument is omitted (or if @var{file} is @code{.}), the name
15238 of the dump file is determined by appending @code{.gkd} to the
15239 compilation output file name.
15241 @item -fcompare-debug@r{[}=@var{opts}@r{]}
15242 @opindex fcompare-debug
15243 @opindex fno-compare-debug
15244 If no error occurs during compilation, run the compiler a second time,
15245 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
15246 passed to the second compilation.  Dump the final internal
15247 representation in both compilations, and print an error if they differ.
15249 If the equal sign is omitted, the default @option{-gtoggle} is used.
15251 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
15252 and nonzero, implicitly enables @option{-fcompare-debug}.  If
15253 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
15254 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
15255 is used.
15257 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
15258 is equivalent to @option{-fno-compare-debug}, which disables the dumping
15259 of the final representation and the second compilation, preventing even
15260 @env{GCC_COMPARE_DEBUG} from taking effect.
15262 To verify full coverage during @option{-fcompare-debug} testing, set
15263 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
15264 which GCC rejects as an invalid option in any actual compilation
15265 (rather than preprocessing, assembly or linking).  To get just a
15266 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
15267 not overridden} will do.
15269 @item -fcompare-debug-second
15270 @opindex fcompare-debug-second
15271 This option is implicitly passed to the compiler for the second
15272 compilation requested by @option{-fcompare-debug}, along with options to
15273 silence warnings, and omitting other options that would cause the compiler
15274 to produce output to files or to standard output as a side effect.  Dump
15275 files and preserved temporary files are renamed so as to contain the
15276 @code{.gk} additional extension during the second compilation, to avoid
15277 overwriting those generated by the first.
15279 When this option is passed to the compiler driver, it causes the
15280 @emph{first} compilation to be skipped, which makes it useful for little
15281 other than debugging the compiler proper.
15283 @item -gtoggle
15284 @opindex gtoggle
15285 Turn off generation of debug info, if leaving out this option
15286 generates it, or turn it on at level 2 otherwise.  The position of this
15287 argument in the command line does not matter; it takes effect after all
15288 other options are processed, and it does so only once, no matter how
15289 many times it is given.  This is mainly intended to be used with
15290 @option{-fcompare-debug}.
15292 @item -fvar-tracking-assignments-toggle
15293 @opindex fvar-tracking-assignments-toggle
15294 @opindex fno-var-tracking-assignments-toggle
15295 Toggle @option{-fvar-tracking-assignments}, in the same way that
15296 @option{-gtoggle} toggles @option{-g}.
15298 @item -Q
15299 @opindex Q
15300 Makes the compiler print out each function name as it is compiled, and
15301 print some statistics about each pass when it finishes.
15303 @item -ftime-report
15304 @opindex ftime-report
15305 Makes the compiler print some statistics about the time consumed by each
15306 pass when it finishes.
15308 @item -ftime-report-details
15309 @opindex ftime-report-details
15310 Record the time consumed by infrastructure parts separately for each pass.
15312 @item -fira-verbose=@var{n}
15313 @opindex fira-verbose
15314 Control the verbosity of the dump file for the integrated register allocator.
15315 The default value is 5.  If the value @var{n} is greater or equal to 10,
15316 the dump output is sent to stderr using the same format as @var{n} minus 10.
15318 @item -flto-report
15319 @opindex flto-report
15320 Prints a report with internal details on the workings of the link-time
15321 optimizer.  The contents of this report vary from version to version.
15322 It is meant to be useful to GCC developers when processing object
15323 files in LTO mode (via @option{-flto}).
15325 Disabled by default.
15327 @item -flto-report-wpa
15328 @opindex flto-report-wpa
15329 Like @option{-flto-report}, but only print for the WPA phase of Link
15330 Time Optimization.
15332 @item -fmem-report
15333 @opindex fmem-report
15334 Makes the compiler print some statistics about permanent memory
15335 allocation when it finishes.
15337 @item -fmem-report-wpa
15338 @opindex fmem-report-wpa
15339 Makes the compiler print some statistics about permanent memory
15340 allocation for the WPA phase only.
15342 @item -fpre-ipa-mem-report
15343 @opindex fpre-ipa-mem-report
15344 @item -fpost-ipa-mem-report
15345 @opindex fpost-ipa-mem-report
15346 Makes the compiler print some statistics about permanent memory
15347 allocation before or after interprocedural optimization.
15349 @item -fprofile-report
15350 @opindex fprofile-report
15351 Makes the compiler print some statistics about consistency of the
15352 (estimated) profile and effect of individual passes.
15354 @item -fstack-usage
15355 @opindex fstack-usage
15356 Makes the compiler output stack usage information for the program, on a
15357 per-function basis.  The filename for the dump is made by appending
15358 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
15359 the output file, if explicitly specified and it is not an executable,
15360 otherwise it is the basename of the source file.  An entry is made up
15361 of three fields:
15363 @itemize
15364 @item
15365 The name of the function.
15366 @item
15367 A number of bytes.
15368 @item
15369 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
15370 @end itemize
15372 The qualifier @code{static} means that the function manipulates the stack
15373 statically: a fixed number of bytes are allocated for the frame on function
15374 entry and released on function exit; no stack adjustments are otherwise made
15375 in the function.  The second field is this fixed number of bytes.
15377 The qualifier @code{dynamic} means that the function manipulates the stack
15378 dynamically: in addition to the static allocation described above, stack
15379 adjustments are made in the body of the function, for example to push/pop
15380 arguments around function calls.  If the qualifier @code{bounded} is also
15381 present, the amount of these adjustments is bounded at compile time and
15382 the second field is an upper bound of the total amount of stack used by
15383 the function.  If it is not present, the amount of these adjustments is
15384 not bounded at compile time and the second field only represents the
15385 bounded part.
15387 @item -fstats
15388 @opindex fstats
15389 Emit statistics about front-end processing at the end of the compilation.
15390 This option is supported only by the C++ front end, and
15391 the information is generally only useful to the G++ development team.
15393 @item -fdbg-cnt-list
15394 @opindex fdbg-cnt-list
15395 Print the name and the counter upper bound for all debug counters.
15398 @item -fdbg-cnt=@var{counter-value-list}
15399 @opindex fdbg-cnt
15400 Set the internal debug counter lower and upper bound.  @var{counter-value-list}
15401 is a comma-separated list of @var{name}:@var{lower_bound}:@var{upper_bound}
15402 tuples which sets the lower and the upper bound of each debug
15403 counter @var{name}.  The @var{lower_bound} is optional and is zero
15404 initialized if not set.
15405 All debug counters have the initial upper bound of @code{UINT_MAX};
15406 thus @code{dbg_cnt} returns true always unless the upper bound
15407 is set by this option.
15408 For example, with @option{-fdbg-cnt=dce:2:4,tail_call:10},
15409 @code{dbg_cnt(dce)} returns true only for third and fourth invocation.
15410 For @code{dbg_cnt(tail_call)} true is returned for first 10 invocations.
15412 @item -print-file-name=@var{library}
15413 @opindex print-file-name
15414 Print the full absolute name of the library file @var{library} that
15415 would be used when linking---and don't do anything else.  With this
15416 option, GCC does not compile or link anything; it just prints the
15417 file name.
15419 @item -print-multi-directory
15420 @opindex print-multi-directory
15421 Print the directory name corresponding to the multilib selected by any
15422 other switches present in the command line.  This directory is supposed
15423 to exist in @env{GCC_EXEC_PREFIX}.
15425 @item -print-multi-lib
15426 @opindex print-multi-lib
15427 Print the mapping from multilib directory names to compiler switches
15428 that enable them.  The directory name is separated from the switches by
15429 @samp{;}, and each switch starts with an @samp{@@} instead of the
15430 @samp{-}, without spaces between multiple switches.  This is supposed to
15431 ease shell processing.
15433 @item -print-multi-os-directory
15434 @opindex print-multi-os-directory
15435 Print the path to OS libraries for the selected
15436 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
15437 present in the @file{lib} subdirectory and no multilibs are used, this is
15438 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
15439 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
15440 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
15441 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
15443 @item -print-multiarch
15444 @opindex print-multiarch
15445 Print the path to OS libraries for the selected multiarch,
15446 relative to some @file{lib} subdirectory.
15448 @item -print-prog-name=@var{program}
15449 @opindex print-prog-name
15450 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
15452 @item -print-libgcc-file-name
15453 @opindex print-libgcc-file-name
15454 Same as @option{-print-file-name=libgcc.a}.
15456 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
15457 but you do want to link with @file{libgcc.a}.  You can do:
15459 @smallexample
15460 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
15461 @end smallexample
15463 @item -print-search-dirs
15464 @opindex print-search-dirs
15465 Print the name of the configured installation directory and a list of
15466 program and library directories @command{gcc} searches---and don't do anything else.
15468 This is useful when @command{gcc} prints the error message
15469 @samp{installation problem, cannot exec cpp0: No such file or directory}.
15470 To resolve this you either need to put @file{cpp0} and the other compiler
15471 components where @command{gcc} expects to find them, or you can set the environment
15472 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
15473 Don't forget the trailing @samp{/}.
15474 @xref{Environment Variables}.
15476 @item -print-sysroot
15477 @opindex print-sysroot
15478 Print the target sysroot directory that is used during
15479 compilation.  This is the target sysroot specified either at configure
15480 time or using the @option{--sysroot} option, possibly with an extra
15481 suffix that depends on compilation options.  If no target sysroot is
15482 specified, the option prints nothing.
15484 @item -print-sysroot-headers-suffix
15485 @opindex print-sysroot-headers-suffix
15486 Print the suffix added to the target sysroot when searching for
15487 headers, or give an error if the compiler is not configured with such
15488 a suffix---and don't do anything else.
15490 @item -dumpmachine
15491 @opindex dumpmachine
15492 Print the compiler's target machine (for example,
15493 @samp{i686-pc-linux-gnu})---and don't do anything else.
15495 @item -dumpversion
15496 @opindex dumpversion
15497 Print the compiler version (for example, @code{3.0}, @code{6.3.0} or @code{7})---and don't do
15498 anything else.  This is the compiler version used in filesystem paths and
15499 specs. Depending on how the compiler has been configured it can be just
15500 a single number (major version), two numbers separated by a dot (major and
15501 minor version) or three numbers separated by dots (major, minor and patchlevel
15502 version).
15504 @item -dumpfullversion
15505 @opindex dumpfullversion
15506 Print the full compiler version---and don't do anything else. The output is
15507 always three numbers separated by dots, major, minor and patchlevel version.
15509 @item -dumpspecs
15510 @opindex dumpspecs
15511 Print the compiler's built-in specs---and don't do anything else.  (This
15512 is used when GCC itself is being built.)  @xref{Spec Files}.
15513 @end table
15515 @node Submodel Options
15516 @section Machine-Dependent Options
15517 @cindex submodel options
15518 @cindex specifying hardware config
15519 @cindex hardware models and configurations, specifying
15520 @cindex target-dependent options
15521 @cindex machine-dependent options
15523 Each target machine supported by GCC can have its own options---for
15524 example, to allow you to compile for a particular processor variant or
15525 ABI, or to control optimizations specific to that machine.  By
15526 convention, the names of machine-specific options start with
15527 @samp{-m}.
15529 Some configurations of the compiler also support additional target-specific
15530 options, usually for compatibility with other compilers on the same
15531 platform.
15533 @c This list is ordered alphanumerically by subsection name.
15534 @c It should be the same order and spelling as these options are listed
15535 @c in Machine Dependent Options
15537 @menu
15538 * AArch64 Options::
15539 * Adapteva Epiphany Options::
15540 * AMD GCN Options::
15541 * ARC Options::
15542 * ARM Options::
15543 * AVR Options::
15544 * Blackfin Options::
15545 * C6X Options::
15546 * CRIS Options::
15547 * CR16 Options::
15548 * C-SKY Options::
15549 * Darwin Options::
15550 * DEC Alpha Options::
15551 * FR30 Options::
15552 * FT32 Options::
15553 * FRV Options::
15554 * GNU/Linux Options::
15555 * H8/300 Options::
15556 * HPPA Options::
15557 * IA-64 Options::
15558 * LM32 Options::
15559 * M32C Options::
15560 * M32R/D Options::
15561 * M680x0 Options::
15562 * MCore Options::
15563 * MeP Options::
15564 * MicroBlaze Options::
15565 * MIPS Options::
15566 * MMIX Options::
15567 * MN10300 Options::
15568 * Moxie Options::
15569 * MSP430 Options::
15570 * NDS32 Options::
15571 * Nios II Options::
15572 * Nvidia PTX Options::
15573 * OpenRISC Options::
15574 * PDP-11 Options::
15575 * picoChip Options::
15576 * PowerPC Options::
15577 * RISC-V Options::
15578 * RL78 Options::
15579 * RS/6000 and PowerPC Options::
15580 * RX Options::
15581 * S/390 and zSeries Options::
15582 * Score Options::
15583 * SH Options::
15584 * Solaris 2 Options::
15585 * SPARC Options::
15586 * SPU Options::
15587 * System V Options::
15588 * TILE-Gx Options::
15589 * TILEPro Options::
15590 * V850 Options::
15591 * VAX Options::
15592 * Visium Options::
15593 * VMS Options::
15594 * VxWorks Options::
15595 * x86 Options::
15596 * x86 Windows Options::
15597 * Xstormy16 Options::
15598 * Xtensa Options::
15599 * zSeries Options::
15600 @end menu
15602 @node AArch64 Options
15603 @subsection AArch64 Options
15604 @cindex AArch64 Options
15606 These options are defined for AArch64 implementations:
15608 @table @gcctabopt
15610 @item -mabi=@var{name}
15611 @opindex mabi
15612 Generate code for the specified data model.  Permissible values
15613 are @samp{ilp32} for SysV-like data model where int, long int and pointers
15614 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
15615 but long int and pointers are 64 bits.
15617 The default depends on the specific target configuration.  Note that
15618 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
15619 entire program with the same ABI, and link with a compatible set of libraries.
15621 @item -mbig-endian
15622 @opindex mbig-endian
15623 Generate big-endian code.  This is the default when GCC is configured for an
15624 @samp{aarch64_be-*-*} target.
15626 @item -mgeneral-regs-only
15627 @opindex mgeneral-regs-only
15628 Generate code which uses only the general-purpose registers.  This will prevent
15629 the compiler from using floating-point and Advanced SIMD registers but will not
15630 impose any restrictions on the assembler.
15632 @item -mlittle-endian
15633 @opindex mlittle-endian
15634 Generate little-endian code.  This is the default when GCC is configured for an
15635 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
15637 @item -mcmodel=tiny
15638 @opindex mcmodel=tiny
15639 Generate code for the tiny code model.  The program and its statically defined
15640 symbols must be within 1MB of each other.  Programs can be statically or
15641 dynamically linked.
15643 @item -mcmodel=small
15644 @opindex mcmodel=small
15645 Generate code for the small code model.  The program and its statically defined
15646 symbols must be within 4GB of each other.  Programs can be statically or
15647 dynamically linked.  This is the default code model.
15649 @item -mcmodel=large
15650 @opindex mcmodel=large
15651 Generate code for the large code model.  This makes no assumptions about
15652 addresses and sizes of sections.  Programs can be statically linked only.
15654 @item -mstrict-align
15655 @itemx -mno-strict-align
15656 @opindex mstrict-align
15657 @opindex mno-strict-align
15658 Avoid or allow generating memory accesses that may not be aligned on a natural
15659 object boundary as described in the architecture specification.
15661 @item -momit-leaf-frame-pointer
15662 @itemx -mno-omit-leaf-frame-pointer
15663 @opindex momit-leaf-frame-pointer
15664 @opindex mno-omit-leaf-frame-pointer
15665 Omit or keep the frame pointer in leaf functions.  The former behavior is the
15666 default.
15668 @item -mstack-protector-guard=@var{guard}
15669 @itemx -mstack-protector-guard-reg=@var{reg}
15670 @itemx -mstack-protector-guard-offset=@var{offset}
15671 @opindex mstack-protector-guard
15672 @opindex mstack-protector-guard-reg
15673 @opindex mstack-protector-guard-offset
15674 Generate stack protection code using canary at @var{guard}.  Supported
15675 locations are @samp{global} for a global canary or @samp{sysreg} for a
15676 canary in an appropriate system register.
15678 With the latter choice the options
15679 @option{-mstack-protector-guard-reg=@var{reg}} and
15680 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
15681 which system register to use as base register for reading the canary,
15682 and from what offset from that base register. There is no default
15683 register or offset as this is entirely for use within the Linux
15684 kernel.
15686 @item -mstack-protector-guard=@var{guard}
15687 @itemx -mstack-protector-guard-reg=@var{reg}
15688 @itemx -mstack-protector-guard-offset=@var{offset}
15689 @opindex mstack-protector-guard
15690 @opindex mstack-protector-guard-reg
15691 @opindex mstack-protector-guard-offset
15692 Generate stack protection code using canary at @var{guard}.  Supported
15693 locations are @samp{global} for a global canary or @samp{sysreg} for a
15694 canary in an appropriate system register.
15696 With the latter choice the options
15697 @option{-mstack-protector-guard-reg=@var{reg}} and
15698 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
15699 which system register to use as base register for reading the canary,
15700 and from what offset from that base register. There is no default
15701 register or offset as this is entirely for use within the Linux
15702 kernel.
15704 @item -mtls-dialect=desc
15705 @opindex mtls-dialect=desc
15706 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
15707 of TLS variables.  This is the default.
15709 @item -mtls-dialect=traditional
15710 @opindex mtls-dialect=traditional
15711 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
15712 of TLS variables.
15714 @item -mtls-size=@var{size}
15715 @opindex mtls-size
15716 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
15717 This option requires binutils 2.26 or newer.
15719 @item -mfix-cortex-a53-835769
15720 @itemx -mno-fix-cortex-a53-835769
15721 @opindex mfix-cortex-a53-835769
15722 @opindex mno-fix-cortex-a53-835769
15723 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
15724 This involves inserting a NOP instruction between memory instructions and
15725 64-bit integer multiply-accumulate instructions.
15727 @item -mfix-cortex-a53-843419
15728 @itemx -mno-fix-cortex-a53-843419
15729 @opindex mfix-cortex-a53-843419
15730 @opindex mno-fix-cortex-a53-843419
15731 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
15732 This erratum workaround is made at link time and this will only pass the
15733 corresponding flag to the linker.
15735 @item -mlow-precision-recip-sqrt
15736 @itemx -mno-low-precision-recip-sqrt
15737 @opindex mlow-precision-recip-sqrt
15738 @opindex mno-low-precision-recip-sqrt
15739 Enable or disable the reciprocal square root approximation.
15740 This option only has an effect if @option{-ffast-math} or
15741 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
15742 precision of reciprocal square root results to about 16 bits for
15743 single precision and to 32 bits for double precision.
15745 @item -mlow-precision-sqrt
15746 @itemx -mno-low-precision-sqrt
15747 @opindex mlow-precision-sqrt
15748 @opindex mno-low-precision-sqrt
15749 Enable or disable the square root approximation.
15750 This option only has an effect if @option{-ffast-math} or
15751 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
15752 precision of square root results to about 16 bits for
15753 single precision and to 32 bits for double precision.
15754 If enabled, it implies @option{-mlow-precision-recip-sqrt}.
15756 @item -mlow-precision-div
15757 @itemx -mno-low-precision-div
15758 @opindex mlow-precision-div
15759 @opindex mno-low-precision-div
15760 Enable or disable the division approximation.
15761 This option only has an effect if @option{-ffast-math} or
15762 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
15763 precision of division results to about 16 bits for
15764 single precision and to 32 bits for double precision.
15766 @item -mtrack-speculation
15767 @itemx -mno-track-speculation
15768 Enable or disable generation of additional code to track speculative
15769 execution through conditional branches.  The tracking state can then
15770 be used by the compiler when expanding calls to
15771 @code{__builtin_speculation_safe_copy} to permit a more efficient code
15772 sequence to be generated.
15774 @item -march=@var{name}
15775 @opindex march
15776 Specify the name of the target architecture and, optionally, one or
15777 more feature modifiers.  This option has the form
15778 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
15780 The permissible values for @var{arch} are @samp{armv8-a},
15781 @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a}, @samp{armv8.4-a},
15782 @samp{armv8.5-a} or @var{native}.
15784 The value @samp{armv8.5-a} implies @samp{armv8.4-a} and enables compiler
15785 support for the ARMv8.5-A architecture extensions.
15787 The value @samp{armv8.4-a} implies @samp{armv8.3-a} and enables compiler
15788 support for the ARMv8.4-A architecture extensions.
15790 The value @samp{armv8.3-a} implies @samp{armv8.2-a} and enables compiler
15791 support for the ARMv8.3-A architecture extensions.
15793 The value @samp{armv8.2-a} implies @samp{armv8.1-a} and enables compiler
15794 support for the ARMv8.2-A architecture extensions.
15796 The value @samp{armv8.1-a} implies @samp{armv8-a} and enables compiler
15797 support for the ARMv8.1-A architecture extension.  In particular, it
15798 enables the @samp{+crc}, @samp{+lse}, and @samp{+rdma} features.
15800 The value @samp{native} is available on native AArch64 GNU/Linux and
15801 causes the compiler to pick the architecture of the host system.  This
15802 option has no effect if the compiler is unable to recognize the
15803 architecture of the host system,
15805 The permissible values for @var{feature} are listed in the sub-section
15806 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
15807 Feature Modifiers}.  Where conflicting feature modifiers are
15808 specified, the right-most feature is used.
15810 GCC uses @var{name} to determine what kind of instructions it can emit
15811 when generating assembly code.  If @option{-march} is specified
15812 without either of @option{-mtune} or @option{-mcpu} also being
15813 specified, the code is tuned to perform well across a range of target
15814 processors implementing the target architecture.
15816 @item -mtune=@var{name}
15817 @opindex mtune
15818 Specify the name of the target processor for which GCC should tune the
15819 performance of the code.  Permissible values for this option are:
15820 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
15821 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
15822 @samp{cortex-a76}, @samp{ares}, @samp{exynos-m1}, @samp{emag}, @samp{falkor},
15823 @samp{neoverse-e1},@samp{neoverse-n1},@samp{qdf24xx}, @samp{saphira},
15824 @samp{phecda}, @samp{xgene1}, @samp{vulcan}, @samp{octeontx},
15825 @samp{octeontx81},  @samp{octeontx83}, @samp{thunderx}, @samp{thunderxt88},
15826 @samp{thunderxt88p1}, @samp{thunderxt81}, @samp{tsv110},
15827 @samp{thunderxt83}, @samp{thunderx2t99},
15828 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
15829 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
15830 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55}
15831 @samp{native}.
15833 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
15834 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
15835 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55} specify that GCC
15836 should tune for a big.LITTLE system.
15838 Additionally on native AArch64 GNU/Linux systems the value
15839 @samp{native} tunes performance to the host system.  This option has no effect
15840 if the compiler is unable to recognize the processor of the host system.
15842 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
15843 are specified, the code is tuned to perform well across a range
15844 of target processors.
15846 This option cannot be suffixed by feature modifiers.
15848 @item -mcpu=@var{name}
15849 @opindex mcpu
15850 Specify the name of the target processor, optionally suffixed by one
15851 or more feature modifiers.  This option has the form
15852 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
15853 the permissible values for @var{cpu} are the same as those available
15854 for @option{-mtune}.  The permissible values for @var{feature} are
15855 documented in the sub-section on
15856 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
15857 Feature Modifiers}.  Where conflicting feature modifiers are
15858 specified, the right-most feature is used.
15860 GCC uses @var{name} to determine what kind of instructions it can emit when
15861 generating assembly code (as if by @option{-march}) and to determine
15862 the target processor for which to tune for performance (as if
15863 by @option{-mtune}).  Where this option is used in conjunction
15864 with @option{-march} or @option{-mtune}, those options take precedence
15865 over the appropriate part of this option.
15867 @item -moverride=@var{string}
15868 @opindex moverride
15869 Override tuning decisions made by the back-end in response to a
15870 @option{-mtune=} switch.  The syntax, semantics, and accepted values
15871 for @var{string} in this option are not guaranteed to be consistent
15872 across releases.
15874 This option is only intended to be useful when developing GCC.
15876 @item -mverbose-cost-dump
15877 @opindex mverbose-cost-dump
15878 Enable verbose cost model dumping in the debug dump files.  This option is
15879 provided for use in debugging the compiler.
15881 @item -mpc-relative-literal-loads
15882 @itemx -mno-pc-relative-literal-loads
15883 @opindex mpc-relative-literal-loads
15884 @opindex mno-pc-relative-literal-loads
15885 Enable or disable PC-relative literal loads.  With this option literal pools are
15886 accessed using a single instruction and emitted after each function.  This
15887 limits the maximum size of functions to 1MB.  This is enabled by default for
15888 @option{-mcmodel=tiny}.
15890 @item -msign-return-address=@var{scope}
15891 @opindex msign-return-address
15892 Select the function scope on which return address signing will be applied.
15893 Permissible values are @samp{none}, which disables return address signing,
15894 @samp{non-leaf}, which enables pointer signing for functions which are not leaf
15895 functions, and @samp{all}, which enables pointer signing for all functions.  The
15896 default value is @samp{none}. This option has been deprecated by
15897 -mbranch-protection.
15899 @item -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}]|@var{bti}
15900 @opindex mbranch-protection
15901 Select the branch protection features to use.
15902 @samp{none} is the default and turns off all types of branch protection.
15903 @samp{standard} turns on all types of branch protection features.  If a feature
15904 has additional tuning options, then @samp{standard} sets it to its standard
15905 level.
15906 @samp{pac-ret[+@var{leaf}]} turns on return address signing to its standard
15907 level: signing functions that save the return address to memory (non-leaf
15908 functions will practically always do this) using the a-key.  The optional
15909 argument @samp{leaf} can be used to extend the signing to include leaf
15910 functions.
15911 @samp{bti} turns on branch target identification mechanism.
15913 @item -msve-vector-bits=@var{bits}
15914 @opindex msve-vector-bits
15915 Specify the number of bits in an SVE vector register.  This option only has
15916 an effect when SVE is enabled.
15918 GCC supports two forms of SVE code generation: ``vector-length
15919 agnostic'' output that works with any size of vector register and
15920 ``vector-length specific'' output that allows GCC to make assumptions
15921 about the vector length when it is useful for optimization reasons.
15922 The possible values of @samp{bits} are: @samp{scalable}, @samp{128},
15923 @samp{256}, @samp{512}, @samp{1024} and @samp{2048}.
15924 Specifying @samp{scalable} selects vector-length agnostic
15925 output.  At present @samp{-msve-vector-bits=128} also generates vector-length
15926 agnostic output.  All other values generate vector-length specific code.
15927 The behavior of these values may change in future releases and no value except
15928 @samp{scalable} should be relied on for producing code that is portable across
15929 different hardware SVE vector lengths.
15931 The default is @samp{-msve-vector-bits=scalable}, which produces
15932 vector-length agnostic code.
15933 @end table
15935 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
15936 @anchor{aarch64-feature-modifiers}
15937 @cindex @option{-march} feature modifiers
15938 @cindex @option{-mcpu} feature modifiers
15939 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
15940 the following and their inverses @option{no@var{feature}}:
15942 @table @samp
15943 @item crc
15944 Enable CRC extension.  This is on by default for
15945 @option{-march=armv8.1-a}.
15946 @item crypto
15947 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
15948 instructions.
15949 @item fp
15950 Enable floating-point instructions.  This is on by default for all possible
15951 values for options @option{-march} and @option{-mcpu}.
15952 @item simd
15953 Enable Advanced SIMD instructions.  This also enables floating-point
15954 instructions.  This is on by default for all possible values for options
15955 @option{-march} and @option{-mcpu}.
15956 @item sve
15957 Enable Scalable Vector Extension instructions.  This also enables Advanced
15958 SIMD and floating-point instructions.
15959 @item lse
15960 Enable Large System Extension instructions.  This is on by default for
15961 @option{-march=armv8.1-a}.
15962 @item rdma
15963 Enable Round Double Multiply Accumulate instructions.  This is on by default
15964 for @option{-march=armv8.1-a}.
15965 @item fp16
15966 Enable FP16 extension.  This also enables floating-point instructions.
15967 @item fp16fml
15968 Enable FP16 fmla extension.  This also enables FP16 extensions and
15969 floating-point instructions. This option is enabled by default for @option{-march=armv8.4-a}. Use of this option with architectures prior to Armv8.2-A is not supported.
15971 @item rcpc
15972 Enable the RcPc extension.  This does not change code generation from GCC,
15973 but is passed on to the assembler, enabling inline asm statements to use
15974 instructions from the RcPc extension.
15975 @item dotprod
15976 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
15977 @item aes
15978 Enable the Armv8-a aes and pmull crypto extension.  This also enables Advanced
15979 SIMD instructions.
15980 @item sha2
15981 Enable the Armv8-a sha2 crypto extension.  This also enables Advanced SIMD instructions.
15982 @item sha3
15983 Enable the sha512 and sha3 crypto extension.  This also enables Advanced SIMD
15984 instructions. Use of this option with architectures prior to Armv8.2-A is not supported.
15985 @item sm4
15986 Enable the sm3 and sm4 crypto extension.  This also enables Advanced SIMD instructions.
15987 Use of this option with architectures prior to Armv8.2-A is not supported.
15988 @item profile
15989 Enable the Statistical Profiling extension.  This option is only to enable the
15990 extension at the assembler level and does not affect code generation.
15991 @item rng
15992 Enable the Armv8.5-a Random Number instructions.  This option is only to
15993 enable the extension at the assembler level and does not affect code
15994 generation.
15995 @item memtag
15996 Enable the Armv8.5-a Memory Tagging Extensions.  This option is only to
15997 enable the extension at the assembler level and does not affect code
15998 generation.
15999 @item sb
16000 Enable the Armv8-a Speculation Barrier instruction.  This option is only to
16001 enable the extension at the assembler level and does not affect code
16002 generation.  This option is enabled by default for @option{-march=armv8.5-a}.
16003 @item ssbs
16004 Enable the Armv8-a Speculative Store Bypass Safe instruction.  This option
16005 is only to enable the extension at the assembler level and does not affect code
16006 generation.  This option is enabled by default for @option{-march=armv8.5-a}.
16007 @item predres
16008 Enable the Armv8-a Execution and Data Prediction Restriction instructions.
16009 This option is only to enable the extension at the assembler level and does
16010 not affect code generation.  This option is enabled by default for
16011 @option{-march=armv8.5-a}.
16013 @end table
16015 Feature @option{crypto} implies @option{aes}, @option{sha2}, and @option{simd},
16016 which implies @option{fp}.
16017 Conversely, @option{nofp} implies @option{nosimd}, which implies
16018 @option{nocrypto}, @option{noaes} and @option{nosha2}.
16020 @node Adapteva Epiphany Options
16021 @subsection Adapteva Epiphany Options
16023 These @samp{-m} options are defined for Adapteva Epiphany:
16025 @table @gcctabopt
16026 @item -mhalf-reg-file
16027 @opindex mhalf-reg-file
16028 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
16029 That allows code to run on hardware variants that lack these registers.
16031 @item -mprefer-short-insn-regs
16032 @opindex mprefer-short-insn-regs
16033 Preferentially allocate registers that allow short instruction generation.
16034 This can result in increased instruction count, so this may either reduce or
16035 increase overall code size.
16037 @item -mbranch-cost=@var{num}
16038 @opindex mbranch-cost
16039 Set the cost of branches to roughly @var{num} ``simple'' instructions.
16040 This cost is only a heuristic and is not guaranteed to produce
16041 consistent results across releases.
16043 @item -mcmove
16044 @opindex mcmove
16045 Enable the generation of conditional moves.
16047 @item -mnops=@var{num}
16048 @opindex mnops
16049 Emit @var{num} NOPs before every other generated instruction.
16051 @item -mno-soft-cmpsf
16052 @opindex mno-soft-cmpsf
16053 @opindex msoft-cmpsf
16054 For single-precision floating-point comparisons, emit an @code{fsub} instruction
16055 and test the flags.  This is faster than a software comparison, but can
16056 get incorrect results in the presence of NaNs, or when two different small
16057 numbers are compared such that their difference is calculated as zero.
16058 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
16059 software comparisons.
16061 @item -mstack-offset=@var{num}
16062 @opindex mstack-offset
16063 Set the offset between the top of the stack and the stack pointer.
16064 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
16065 can be used by leaf functions without stack allocation.
16066 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
16067 Note also that this option changes the ABI; compiling a program with a
16068 different stack offset than the libraries have been compiled with
16069 generally does not work.
16070 This option can be useful if you want to evaluate if a different stack
16071 offset would give you better code, but to actually use a different stack
16072 offset to build working programs, it is recommended to configure the
16073 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
16075 @item -mno-round-nearest
16076 @opindex mno-round-nearest
16077 @opindex mround-nearest
16078 Make the scheduler assume that the rounding mode has been set to
16079 truncating.  The default is @option{-mround-nearest}.
16081 @item -mlong-calls
16082 @opindex mlong-calls
16083 If not otherwise specified by an attribute, assume all calls might be beyond
16084 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
16085 function address into a register before performing a (otherwise direct) call.
16086 This is the default.
16088 @item -mshort-calls
16089 @opindex short-calls
16090 If not otherwise specified by an attribute, assume all direct calls are
16091 in the range of the @code{b} / @code{bl} instructions, so use these instructions
16092 for direct calls.  The default is @option{-mlong-calls}.
16094 @item -msmall16
16095 @opindex msmall16
16096 Assume addresses can be loaded as 16-bit unsigned values.  This does not
16097 apply to function addresses for which @option{-mlong-calls} semantics
16098 are in effect.
16100 @item -mfp-mode=@var{mode}
16101 @opindex mfp-mode
16102 Set the prevailing mode of the floating-point unit.
16103 This determines the floating-point mode that is provided and expected
16104 at function call and return time.  Making this mode match the mode you
16105 predominantly need at function start can make your programs smaller and
16106 faster by avoiding unnecessary mode switches.
16108 @var{mode} can be set to one the following values:
16110 @table @samp
16111 @item caller
16112 Any mode at function entry is valid, and retained or restored when
16113 the function returns, and when it calls other functions.
16114 This mode is useful for compiling libraries or other compilation units
16115 you might want to incorporate into different programs with different
16116 prevailing FPU modes, and the convenience of being able to use a single
16117 object file outweighs the size and speed overhead for any extra
16118 mode switching that might be needed, compared with what would be needed
16119 with a more specific choice of prevailing FPU mode.
16121 @item truncate
16122 This is the mode used for floating-point calculations with
16123 truncating (i.e.@: round towards zero) rounding mode.  That includes
16124 conversion from floating point to integer.
16126 @item round-nearest
16127 This is the mode used for floating-point calculations with
16128 round-to-nearest-or-even rounding mode.
16130 @item int
16131 This is the mode used to perform integer calculations in the FPU, e.g.@:
16132 integer multiply, or integer multiply-and-accumulate.
16133 @end table
16135 The default is @option{-mfp-mode=caller}
16137 @item -mno-split-lohi
16138 @itemx -mno-postinc
16139 @itemx -mno-postmodify
16140 @opindex mno-split-lohi
16141 @opindex msplit-lohi
16142 @opindex mno-postinc
16143 @opindex mpostinc
16144 @opindex mno-postmodify
16145 @opindex mpostmodify
16146 Code generation tweaks that disable, respectively, splitting of 32-bit
16147 loads, generation of post-increment addresses, and generation of
16148 post-modify addresses.  The defaults are @option{msplit-lohi},
16149 @option{-mpost-inc}, and @option{-mpost-modify}.
16151 @item -mnovect-double
16152 @opindex mno-vect-double
16153 @opindex mvect-double
16154 Change the preferred SIMD mode to SImode.  The default is
16155 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
16157 @item -max-vect-align=@var{num}
16158 @opindex max-vect-align
16159 The maximum alignment for SIMD vector mode types.
16160 @var{num} may be 4 or 8.  The default is 8.
16161 Note that this is an ABI change, even though many library function
16162 interfaces are unaffected if they don't use SIMD vector modes
16163 in places that affect size and/or alignment of relevant types.
16165 @item -msplit-vecmove-early
16166 @opindex msplit-vecmove-early
16167 Split vector moves into single word moves before reload.  In theory this
16168 can give better register allocation, but so far the reverse seems to be
16169 generally the case.
16171 @item -m1reg-@var{reg}
16172 @opindex m1reg-
16173 Specify a register to hold the constant @minus{}1, which makes loading small negative
16174 constants and certain bitmasks faster.
16175 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
16176 which specify use of that register as a fixed register,
16177 and @samp{none}, which means that no register is used for this
16178 purpose.  The default is @option{-m1reg-none}.
16180 @end table
16182 @node AMD GCN Options
16183 @subsection AMD GCN Options
16184 @cindex AMD GCN Options
16186 These options are defined specifically for the AMD GCN port.
16188 @table @gcctabopt
16190 @item -march=@var{gpu}
16191 @opindex march
16192 @itemx -mtune=@var{gpu}
16193 @opindex mtune
16194 Set architecture type or tuning for @var{gpu}. Supported values for @var{gpu}
16197 @table @samp
16198 @opindex fiji
16199 @item fiji
16200 Compile for GCN3 Fiji devices (gfx803).
16202 @item gfx900
16203 Compile for GCN5 Vega 10 devices (gfx900).
16205 @end table
16207 @item -mstack-size=@var{bytes}
16208 @opindex mstack-size
16209 Specify how many @var{bytes} of stack space will be requested for each GPU
16210 thread (wave-front).  Beware that there may be many threads and limited memory
16211 available.  The size of the stack allocation may also have an impact on
16212 run-time performance.  The default is 32KB when using OpenACC or OpenMP, and
16213 1MB otherwise.
16215 @end table
16217 @node ARC Options
16218 @subsection ARC Options
16219 @cindex ARC options
16221 The following options control the architecture variant for which code
16222 is being compiled:
16224 @c architecture variants
16225 @table @gcctabopt
16227 @item -mbarrel-shifter
16228 @opindex mbarrel-shifter
16229 Generate instructions supported by barrel shifter.  This is the default
16230 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
16232 @item -mjli-always
16233 @opindex mjli-alawys
16234 Force to call a function using jli_s instruction.  This option is
16235 valid only for ARCv2 architecture.
16237 @item -mcpu=@var{cpu}
16238 @opindex mcpu
16239 Set architecture type, register usage, and instruction scheduling
16240 parameters for @var{cpu}.  There are also shortcut alias options
16241 available for backward compatibility and convenience.  Supported
16242 values for @var{cpu} are
16244 @table @samp
16245 @opindex mA6
16246 @opindex mARC600
16247 @item arc600
16248 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
16250 @item arc601
16251 @opindex mARC601
16252 Compile for ARC601.  Alias: @option{-mARC601}.
16254 @item arc700
16255 @opindex mA7
16256 @opindex mARC700
16257 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
16258 This is the default when configured with @option{--with-cpu=arc700}@.
16260 @item arcem
16261 Compile for ARC EM.
16263 @item archs
16264 Compile for ARC HS.
16266 @item em
16267 Compile for ARC EM CPU with no hardware extensions.
16269 @item em4
16270 Compile for ARC EM4 CPU.
16272 @item em4_dmips
16273 Compile for ARC EM4 DMIPS CPU.
16275 @item em4_fpus
16276 Compile for ARC EM4 DMIPS CPU with the single-precision floating-point
16277 extension.
16279 @item em4_fpuda
16280 Compile for ARC EM4 DMIPS CPU with single-precision floating-point and
16281 double assist instructions.
16283 @item hs
16284 Compile for ARC HS CPU with no hardware extensions except the atomic
16285 instructions.
16287 @item hs34
16288 Compile for ARC HS34 CPU.
16290 @item hs38
16291 Compile for ARC HS38 CPU.
16293 @item hs38_linux
16294 Compile for ARC HS38 CPU with all hardware extensions on.
16296 @item arc600_norm
16297 Compile for ARC 600 CPU with @code{norm} instructions enabled.
16299 @item arc600_mul32x16
16300 Compile for ARC 600 CPU with @code{norm} and 32x16-bit multiply 
16301 instructions enabled.
16303 @item arc600_mul64
16304 Compile for ARC 600 CPU with @code{norm} and @code{mul64}-family 
16305 instructions enabled.
16307 @item arc601_norm
16308 Compile for ARC 601 CPU with @code{norm} instructions enabled.
16310 @item arc601_mul32x16
16311 Compile for ARC 601 CPU with @code{norm} and 32x16-bit multiply
16312 instructions enabled.
16314 @item arc601_mul64
16315 Compile for ARC 601 CPU with @code{norm} and @code{mul64}-family
16316 instructions enabled.
16318 @item nps400
16319 Compile for ARC 700 on NPS400 chip.
16321 @item em_mini
16322 Compile for ARC EM minimalist configuration featuring reduced register
16323 set.
16325 @end table
16327 @item -mdpfp
16328 @opindex mdpfp
16329 @itemx -mdpfp-compact
16330 @opindex mdpfp-compact
16331 Generate double-precision FPX instructions, tuned for the compact
16332 implementation.
16334 @item -mdpfp-fast
16335 @opindex mdpfp-fast
16336 Generate double-precision FPX instructions, tuned for the fast
16337 implementation.
16339 @item -mno-dpfp-lrsr
16340 @opindex mno-dpfp-lrsr
16341 Disable @code{lr} and @code{sr} instructions from using FPX extension
16342 aux registers.
16344 @item -mea
16345 @opindex mea
16346 Generate extended arithmetic instructions.  Currently only
16347 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
16348 supported.  This is always enabled for @option{-mcpu=ARC700}.
16350 @item -mno-mpy
16351 @opindex mno-mpy
16352 @opindex mmpy
16353 Do not generate @code{mpy}-family instructions for ARC700.  This option is
16354 deprecated.
16356 @item -mmul32x16
16357 @opindex mmul32x16
16358 Generate 32x16-bit multiply and multiply-accumulate instructions.
16360 @item -mmul64
16361 @opindex mmul64
16362 Generate @code{mul64} and @code{mulu64} instructions.  
16363 Only valid for @option{-mcpu=ARC600}.
16365 @item -mnorm
16366 @opindex mnorm
16367 Generate @code{norm} instructions.  This is the default if @option{-mcpu=ARC700}
16368 is in effect.
16370 @item -mspfp
16371 @opindex mspfp
16372 @itemx -mspfp-compact
16373 @opindex mspfp-compact
16374 Generate single-precision FPX instructions, tuned for the compact
16375 implementation.
16377 @item -mspfp-fast
16378 @opindex mspfp-fast
16379 Generate single-precision FPX instructions, tuned for the fast
16380 implementation.
16382 @item -msimd
16383 @opindex msimd
16384 Enable generation of ARC SIMD instructions via target-specific
16385 builtins.  Only valid for @option{-mcpu=ARC700}.
16387 @item -msoft-float
16388 @opindex msoft-float
16389 This option ignored; it is provided for compatibility purposes only.
16390 Software floating-point code is emitted by default, and this default
16391 can overridden by FPX options; @option{-mspfp}, @option{-mspfp-compact}, or
16392 @option{-mspfp-fast} for single precision, and @option{-mdpfp},
16393 @option{-mdpfp-compact}, or @option{-mdpfp-fast} for double precision.
16395 @item -mswap
16396 @opindex mswap
16397 Generate @code{swap} instructions.
16399 @item -matomic
16400 @opindex matomic
16401 This enables use of the locked load/store conditional extension to implement
16402 atomic memory built-in functions.  Not available for ARC 6xx or ARC
16403 EM cores.
16405 @item -mdiv-rem
16406 @opindex mdiv-rem
16407 Enable @code{div} and @code{rem} instructions for ARCv2 cores.
16409 @item -mcode-density
16410 @opindex mcode-density
16411 Enable code density instructions for ARC EM.  
16412 This option is on by default for ARC HS.
16414 @item -mll64
16415 @opindex mll64
16416 Enable double load/store operations for ARC HS cores.
16418 @item -mtp-regno=@var{regno}
16419 @opindex mtp-regno
16420 Specify thread pointer register number.
16422 @item -mmpy-option=@var{multo}
16423 @opindex mmpy-option
16424 Compile ARCv2 code with a multiplier design option.  You can specify 
16425 the option using either a string or numeric value for @var{multo}.  
16426 @samp{wlh1} is the default value.  The recognized values are:
16428 @table @samp
16429 @item 0
16430 @itemx none
16431 No multiplier available.
16433 @item 1
16434 @itemx w
16435 16x16 multiplier, fully pipelined.
16436 The following instructions are enabled: @code{mpyw} and @code{mpyuw}.
16438 @item 2
16439 @itemx wlh1
16440 32x32 multiplier, fully
16441 pipelined (1 stage).  The following instructions are additionally
16442 enabled: @code{mpy}, @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
16444 @item 3
16445 @itemx wlh2
16446 32x32 multiplier, fully pipelined
16447 (2 stages).  The following instructions are additionally enabled: @code{mpy},
16448 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
16450 @item 4
16451 @itemx wlh3
16452 Two 16x16 multipliers, blocking,
16453 sequential.  The following instructions are additionally enabled: @code{mpy},
16454 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
16456 @item 5
16457 @itemx wlh4
16458 One 16x16 multiplier, blocking,
16459 sequential.  The following instructions are additionally enabled: @code{mpy},
16460 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
16462 @item 6
16463 @itemx wlh5
16464 One 32x4 multiplier, blocking,
16465 sequential.  The following instructions are additionally enabled: @code{mpy},
16466 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
16468 @item 7
16469 @itemx plus_dmpy
16470 ARC HS SIMD support.
16472 @item 8
16473 @itemx plus_macd
16474 ARC HS SIMD support.
16476 @item 9
16477 @itemx plus_qmacw
16478 ARC HS SIMD support.
16480 @end table
16482 This option is only available for ARCv2 cores@.
16484 @item -mfpu=@var{fpu}
16485 @opindex mfpu
16486 Enables support for specific floating-point hardware extensions for ARCv2
16487 cores.  Supported values for @var{fpu} are:
16489 @table @samp
16491 @item fpus
16492 Enables support for single-precision floating-point hardware
16493 extensions@.
16495 @item fpud
16496 Enables support for double-precision floating-point hardware
16497 extensions.  The single-precision floating-point extension is also
16498 enabled.  Not available for ARC EM@.
16500 @item fpuda
16501 Enables support for double-precision floating-point hardware
16502 extensions using double-precision assist instructions.  The single-precision
16503 floating-point extension is also enabled.  This option is
16504 only available for ARC EM@.
16506 @item fpuda_div
16507 Enables support for double-precision floating-point hardware
16508 extensions using double-precision assist instructions.
16509 The single-precision floating-point, square-root, and divide 
16510 extensions are also enabled.  This option is
16511 only available for ARC EM@.
16513 @item fpuda_fma
16514 Enables support for double-precision floating-point hardware
16515 extensions using double-precision assist instructions.
16516 The single-precision floating-point and fused multiply and add 
16517 hardware extensions are also enabled.  This option is
16518 only available for ARC EM@.
16520 @item fpuda_all
16521 Enables support for double-precision floating-point hardware
16522 extensions using double-precision assist instructions.
16523 All single-precision floating-point hardware extensions are also
16524 enabled.  This option is only available for ARC EM@.
16526 @item fpus_div
16527 Enables support for single-precision floating-point, square-root and divide 
16528 hardware extensions@.
16530 @item fpud_div
16531 Enables support for double-precision floating-point, square-root and divide 
16532 hardware extensions.  This option
16533 includes option @samp{fpus_div}. Not available for ARC EM@.
16535 @item fpus_fma
16536 Enables support for single-precision floating-point and 
16537 fused multiply and add hardware extensions@.
16539 @item fpud_fma
16540 Enables support for double-precision floating-point and 
16541 fused multiply and add hardware extensions.  This option
16542 includes option @samp{fpus_fma}.  Not available for ARC EM@.
16544 @item fpus_all
16545 Enables support for all single-precision floating-point hardware
16546 extensions@.
16548 @item fpud_all
16549 Enables support for all single- and double-precision floating-point
16550 hardware extensions.  Not available for ARC EM@.
16552 @end table
16554 @item -mirq-ctrl-saved=@var{register-range}, @var{blink}, @var{lp_count}
16555 @opindex mirq-ctrl-saved
16556 Specifies general-purposes registers that the processor automatically
16557 saves/restores on interrupt entry and exit.  @var{register-range} is
16558 specified as two registers separated by a dash.  The register range
16559 always starts with @code{r0}, the upper limit is @code{fp} register.
16560 @var{blink} and @var{lp_count} are optional.  This option is only
16561 valid for ARC EM and ARC HS cores.
16563 @item -mrgf-banked-regs=@var{number}
16564 @opindex mrgf-banked-regs
16565 Specifies the number of registers replicated in second register bank
16566 on entry to fast interrupt.  Fast interrupts are interrupts with the
16567 highest priority level P0.  These interrupts save only PC and STATUS32
16568 registers to avoid memory transactions during interrupt entry and exit
16569 sequences.  Use this option when you are using fast interrupts in an
16570 ARC V2 family processor.  Permitted values are 4, 8, 16, and 32.
16572 @item -mlpc-width=@var{width}
16573 @opindex mlpc-width
16574 Specify the width of the @code{lp_count} register.  Valid values for
16575 @var{width} are 8, 16, 20, 24, 28 and 32 bits.  The default width is
16576 fixed to 32 bits.  If the width is less than 32, the compiler does not
16577 attempt to transform loops in your program to use the zero-delay loop
16578 mechanism unless it is known that the @code{lp_count} register can
16579 hold the required loop-counter value.  Depending on the width
16580 specified, the compiler and run-time library might continue to use the
16581 loop mechanism for various needs.  This option defines macro
16582 @code{__ARC_LPC_WIDTH__} with the value of @var{width}.
16584 @item -mrf16
16585 @opindex mrf16
16586 This option instructs the compiler to generate code for a 16-entry
16587 register file.  This option defines the @code{__ARC_RF16__}
16588 preprocessor macro.
16590 @item -mbranch-index
16591 @opindex mbranch-index
16592 Enable use of @code{bi} or @code{bih} instructions to implement jump
16593 tables.
16595 @end table
16597 The following options are passed through to the assembler, and also
16598 define preprocessor macro symbols.
16600 @c Flags used by the assembler, but for which we define preprocessor
16601 @c macro symbols as well.
16602 @table @gcctabopt
16603 @item -mdsp-packa
16604 @opindex mdsp-packa
16605 Passed down to the assembler to enable the DSP Pack A extensions.
16606 Also sets the preprocessor symbol @code{__Xdsp_packa}.  This option is
16607 deprecated.
16609 @item -mdvbf
16610 @opindex mdvbf
16611 Passed down to the assembler to enable the dual Viterbi butterfly
16612 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.  This
16613 option is deprecated.
16615 @c ARC700 4.10 extension instruction
16616 @item -mlock
16617 @opindex mlock
16618 Passed down to the assembler to enable the locked load/store
16619 conditional extension.  Also sets the preprocessor symbol
16620 @code{__Xlock}.
16622 @item -mmac-d16
16623 @opindex mmac-d16
16624 Passed down to the assembler.  Also sets the preprocessor symbol
16625 @code{__Xxmac_d16}.  This option is deprecated.
16627 @item -mmac-24
16628 @opindex mmac-24
16629 Passed down to the assembler.  Also sets the preprocessor symbol
16630 @code{__Xxmac_24}.  This option is deprecated.
16632 @c ARC700 4.10 extension instruction
16633 @item -mrtsc
16634 @opindex mrtsc
16635 Passed down to the assembler to enable the 64-bit time-stamp counter
16636 extension instruction.  Also sets the preprocessor symbol
16637 @code{__Xrtsc}.  This option is deprecated.
16639 @c ARC700 4.10 extension instruction
16640 @item -mswape
16641 @opindex mswape
16642 Passed down to the assembler to enable the swap byte ordering
16643 extension instruction.  Also sets the preprocessor symbol
16644 @code{__Xswape}.
16646 @item -mtelephony
16647 @opindex mtelephony
16648 Passed down to the assembler to enable dual- and single-operand
16649 instructions for telephony.  Also sets the preprocessor symbol
16650 @code{__Xtelephony}.  This option is deprecated.
16652 @item -mxy
16653 @opindex mxy
16654 Passed down to the assembler to enable the XY memory extension.  Also
16655 sets the preprocessor symbol @code{__Xxy}.
16657 @end table
16659 The following options control how the assembly code is annotated:
16661 @c Assembly annotation options
16662 @table @gcctabopt
16663 @item -misize
16664 @opindex misize
16665 Annotate assembler instructions with estimated addresses.
16667 @item -mannotate-align
16668 @opindex mannotate-align
16669 Explain what alignment considerations lead to the decision to make an
16670 instruction short or long.
16672 @end table
16674 The following options are passed through to the linker:
16676 @c options passed through to the linker
16677 @table @gcctabopt
16678 @item -marclinux
16679 @opindex marclinux
16680 Passed through to the linker, to specify use of the @code{arclinux} emulation.
16681 This option is enabled by default in tool chains built for
16682 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
16683 when profiling is not requested.
16685 @item -marclinux_prof
16686 @opindex marclinux_prof
16687 Passed through to the linker, to specify use of the
16688 @code{arclinux_prof} emulation.  This option is enabled by default in
16689 tool chains built for @w{@code{arc-linux-uclibc}} and
16690 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
16692 @end table
16694 The following options control the semantics of generated code:
16696 @c semantically relevant code generation options
16697 @table @gcctabopt
16698 @item -mlong-calls
16699 @opindex mlong-calls
16700 Generate calls as register indirect calls, thus providing access
16701 to the full 32-bit address range.
16703 @item -mmedium-calls
16704 @opindex mmedium-calls
16705 Don't use less than 25-bit addressing range for calls, which is the
16706 offset available for an unconditional branch-and-link
16707 instruction.  Conditional execution of function calls is suppressed, to
16708 allow use of the 25-bit range, rather than the 21-bit range with
16709 conditional branch-and-link.  This is the default for tool chains built
16710 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
16712 @item -G @var{num}
16713 @opindex G
16714 Put definitions of externally-visible data in a small data section if
16715 that data is no bigger than @var{num} bytes.  The default value of
16716 @var{num} is 4 for any ARC configuration, or 8 when we have double
16717 load/store operations.
16719 @item -mno-sdata
16720 @opindex mno-sdata
16721 @opindex msdata
16722 Do not generate sdata references.  This is the default for tool chains
16723 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
16724 targets.
16726 @item -mvolatile-cache
16727 @opindex mvolatile-cache
16728 Use ordinarily cached memory accesses for volatile references.  This is the
16729 default.
16731 @item -mno-volatile-cache
16732 @opindex mno-volatile-cache
16733 @opindex mvolatile-cache
16734 Enable cache bypass for volatile references.
16736 @end table
16738 The following options fine tune code generation:
16739 @c code generation tuning options
16740 @table @gcctabopt
16741 @item -malign-call
16742 @opindex malign-call
16743 Do alignment optimizations for call instructions.
16745 @item -mauto-modify-reg
16746 @opindex mauto-modify-reg
16747 Enable the use of pre/post modify with register displacement.
16749 @item -mbbit-peephole
16750 @opindex mbbit-peephole
16751 Enable bbit peephole2.
16753 @item -mno-brcc
16754 @opindex mno-brcc
16755 This option disables a target-specific pass in @file{arc_reorg} to
16756 generate compare-and-branch (@code{br@var{cc}}) instructions.  
16757 It has no effect on
16758 generation of these instructions driven by the combiner pass.
16760 @item -mcase-vector-pcrel
16761 @opindex mcase-vector-pcrel
16762 Use PC-relative switch case tables to enable case table shortening.
16763 This is the default for @option{-Os}.
16765 @item -mcompact-casesi
16766 @opindex mcompact-casesi
16767 Enable compact @code{casesi} pattern.  This is the default for @option{-Os},
16768 and only available for ARCv1 cores.  This option is deprecated.
16770 @item -mno-cond-exec
16771 @opindex mno-cond-exec
16772 Disable the ARCompact-specific pass to generate conditional 
16773 execution instructions.
16775 Due to delay slot scheduling and interactions between operand numbers,
16776 literal sizes, instruction lengths, and the support for conditional execution,
16777 the target-independent pass to generate conditional execution is often lacking,
16778 so the ARC port has kept a special pass around that tries to find more
16779 conditional execution generation opportunities after register allocation,
16780 branch shortening, and delay slot scheduling have been done.  This pass
16781 generally, but not always, improves performance and code size, at the cost of
16782 extra compilation time, which is why there is an option to switch it off.
16783 If you have a problem with call instructions exceeding their allowable
16784 offset range because they are conditionalized, you should consider using
16785 @option{-mmedium-calls} instead.
16787 @item -mearly-cbranchsi
16788 @opindex mearly-cbranchsi
16789 Enable pre-reload use of the @code{cbranchsi} pattern.
16791 @item -mexpand-adddi
16792 @opindex mexpand-adddi
16793 Expand @code{adddi3} and @code{subdi3} at RTL generation time into
16794 @code{add.f}, @code{adc} etc.  This option is deprecated.
16796 @item -mindexed-loads
16797 @opindex mindexed-loads
16798 Enable the use of indexed loads.  This can be problematic because some
16799 optimizers then assume that indexed stores exist, which is not
16800 the case.
16802 @item -mlra
16803 @opindex mlra
16804 Enable Local Register Allocation.  This is still experimental for ARC,
16805 so by default the compiler uses standard reload
16806 (i.e.@: @option{-mno-lra}).
16808 @item -mlra-priority-none
16809 @opindex mlra-priority-none
16810 Don't indicate any priority for target registers.
16812 @item -mlra-priority-compact
16813 @opindex mlra-priority-compact
16814 Indicate target register priority for r0..r3 / r12..r15.
16816 @item -mlra-priority-noncompact
16817 @opindex mlra-priority-noncompact
16818 Reduce target register priority for r0..r3 / r12..r15.
16820 @item -mmillicode
16821 @opindex mmillicode
16822 When optimizing for size (using @option{-Os}), prologues and epilogues
16823 that have to save or restore a large number of registers are often
16824 shortened by using call to a special function in libgcc; this is
16825 referred to as a @emph{millicode} call.  As these calls can pose
16826 performance issues, and/or cause linking issues when linking in a
16827 nonstandard way, this option is provided to turn on or off millicode
16828 call generation.
16830 @item -mcode-density-frame
16831 @opindex mcode-density-frame
16832 This option enable the compiler to emit @code{enter} and @code{leave}
16833 instructions.  These instructions are only valid for CPUs with
16834 code-density feature.
16836 @item -mmixed-code
16837 @opindex mmixed-code
16838 Tweak register allocation to help 16-bit instruction generation.
16839 This generally has the effect of decreasing the average instruction size
16840 while increasing the instruction count.
16842 @item -mq-class
16843 @opindex mq-class
16844 Enable @samp{q} instruction alternatives.
16845 This is the default for @option{-Os}.
16847 @item -mRcq
16848 @opindex mRcq
16849 Enable @samp{Rcq} constraint handling.  
16850 Most short code generation depends on this.
16851 This is the default.
16853 @item -mRcw
16854 @opindex mRcw
16855 Enable @samp{Rcw} constraint handling.  
16856 Most ccfsm condexec mostly depends on this.
16857 This is the default.
16859 @item -msize-level=@var{level}
16860 @opindex msize-level
16861 Fine-tune size optimization with regards to instruction lengths and alignment.
16862 The recognized values for @var{level} are:
16863 @table @samp
16864 @item 0
16865 No size optimization.  This level is deprecated and treated like @samp{1}.
16867 @item 1
16868 Short instructions are used opportunistically.
16870 @item 2
16871 In addition, alignment of loops and of code after barriers are dropped.
16873 @item 3
16874 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
16876 @end table
16878 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
16879 the behavior when this is not set is equivalent to level @samp{1}.
16881 @item -mtune=@var{cpu}
16882 @opindex mtune
16883 Set instruction scheduling parameters for @var{cpu}, overriding any implied
16884 by @option{-mcpu=}.
16886 Supported values for @var{cpu} are
16888 @table @samp
16889 @item ARC600
16890 Tune for ARC600 CPU.
16892 @item ARC601
16893 Tune for ARC601 CPU.
16895 @item ARC700
16896 Tune for ARC700 CPU with standard multiplier block.
16898 @item ARC700-xmac
16899 Tune for ARC700 CPU with XMAC block.
16901 @item ARC725D
16902 Tune for ARC725D CPU.
16904 @item ARC750D
16905 Tune for ARC750D CPU.
16907 @end table
16909 @item -mmultcost=@var{num}
16910 @opindex mmultcost
16911 Cost to assume for a multiply instruction, with @samp{4} being equal to a
16912 normal instruction.
16914 @item -munalign-prob-threshold=@var{probability}
16915 @opindex munalign-prob-threshold
16916 Set probability threshold for unaligning branches.
16917 When tuning for @samp{ARC700} and optimizing for speed, branches without
16918 filled delay slot are preferably emitted unaligned and long, unless
16919 profiling indicates that the probability for the branch to be taken
16920 is below @var{probability}.  @xref{Cross-profiling}.
16921 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
16923 @end table
16925 The following options are maintained for backward compatibility, but
16926 are now deprecated and will be removed in a future release:
16928 @c Deprecated options
16929 @table @gcctabopt
16931 @item -margonaut
16932 @opindex margonaut
16933 Obsolete FPX.
16935 @item -mbig-endian
16936 @opindex mbig-endian
16937 @itemx -EB
16938 @opindex EB
16939 Compile code for big-endian targets.  Use of these options is now
16940 deprecated.  Big-endian code is supported by configuring GCC to build
16941 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets,
16942 for which big endian is the default.
16944 @item -mlittle-endian
16945 @opindex mlittle-endian
16946 @itemx -EL
16947 @opindex EL
16948 Compile code for little-endian targets.  Use of these options is now
16949 deprecated.  Little-endian code is supported by configuring GCC to build 
16950 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets,
16951 for which little endian is the default.
16953 @item -mbarrel_shifter
16954 @opindex mbarrel_shifter
16955 Replaced by @option{-mbarrel-shifter}.
16957 @item -mdpfp_compact
16958 @opindex mdpfp_compact
16959 Replaced by @option{-mdpfp-compact}.
16961 @item -mdpfp_fast
16962 @opindex mdpfp_fast
16963 Replaced by @option{-mdpfp-fast}.
16965 @item -mdsp_packa
16966 @opindex mdsp_packa
16967 Replaced by @option{-mdsp-packa}.
16969 @item -mEA
16970 @opindex mEA
16971 Replaced by @option{-mea}.
16973 @item -mmac_24
16974 @opindex mmac_24
16975 Replaced by @option{-mmac-24}.
16977 @item -mmac_d16
16978 @opindex mmac_d16
16979 Replaced by @option{-mmac-d16}.
16981 @item -mspfp_compact
16982 @opindex mspfp_compact
16983 Replaced by @option{-mspfp-compact}.
16985 @item -mspfp_fast
16986 @opindex mspfp_fast
16987 Replaced by @option{-mspfp-fast}.
16989 @item -mtune=@var{cpu}
16990 @opindex mtune
16991 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
16992 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
16993 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively.
16995 @item -multcost=@var{num}
16996 @opindex multcost
16997 Replaced by @option{-mmultcost}.
16999 @end table
17001 @node ARM Options
17002 @subsection ARM Options
17003 @cindex ARM options
17005 These @samp{-m} options are defined for the ARM port:
17007 @table @gcctabopt
17008 @item -mabi=@var{name}
17009 @opindex mabi
17010 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
17011 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
17013 @item -mapcs-frame
17014 @opindex mapcs-frame
17015 Generate a stack frame that is compliant with the ARM Procedure Call
17016 Standard for all functions, even if this is not strictly necessary for
17017 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
17018 with this option causes the stack frames not to be generated for
17019 leaf functions.  The default is @option{-mno-apcs-frame}.
17020 This option is deprecated.
17022 @item -mapcs
17023 @opindex mapcs
17024 This is a synonym for @option{-mapcs-frame} and is deprecated.
17026 @ignore
17027 @c not currently implemented
17028 @item -mapcs-stack-check
17029 @opindex mapcs-stack-check
17030 Generate code to check the amount of stack space available upon entry to
17031 every function (that actually uses some stack space).  If there is
17032 insufficient space available then either the function
17033 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
17034 called, depending upon the amount of stack space required.  The runtime
17035 system is required to provide these functions.  The default is
17036 @option{-mno-apcs-stack-check}, since this produces smaller code.
17038 @c not currently implemented
17039 @item -mapcs-reentrant
17040 @opindex mapcs-reentrant
17041 Generate reentrant, position-independent code.  The default is
17042 @option{-mno-apcs-reentrant}.
17043 @end ignore
17045 @item -mthumb-interwork
17046 @opindex mthumb-interwork
17047 Generate code that supports calling between the ARM and Thumb
17048 instruction sets.  Without this option, on pre-v5 architectures, the
17049 two instruction sets cannot be reliably used inside one program.  The
17050 default is @option{-mno-thumb-interwork}, since slightly larger code
17051 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
17052 configurations this option is meaningless.
17054 @item -mno-sched-prolog
17055 @opindex mno-sched-prolog
17056 @opindex msched-prolog
17057 Prevent the reordering of instructions in the function prologue, or the
17058 merging of those instruction with the instructions in the function's
17059 body.  This means that all functions start with a recognizable set
17060 of instructions (or in fact one of a choice from a small set of
17061 different function prologues), and this information can be used to
17062 locate the start of functions inside an executable piece of code.  The
17063 default is @option{-msched-prolog}.
17065 @item -mfloat-abi=@var{name}
17066 @opindex mfloat-abi
17067 Specifies which floating-point ABI to use.  Permissible values
17068 are: @samp{soft}, @samp{softfp} and @samp{hard}.
17070 Specifying @samp{soft} causes GCC to generate output containing
17071 library calls for floating-point operations.
17072 @samp{softfp} allows the generation of code using hardware floating-point
17073 instructions, but still uses the soft-float calling conventions.
17074 @samp{hard} allows generation of floating-point instructions
17075 and uses FPU-specific calling conventions.
17077 The default depends on the specific target configuration.  Note that
17078 the hard-float and soft-float ABIs are not link-compatible; you must
17079 compile your entire program with the same ABI, and link with a
17080 compatible set of libraries.
17082 @item -mgeneral-regs-only
17083 @opindex mgeneral-regs-only
17084 Generate code which uses only the general-purpose registers.  This will prevent
17085 the compiler from using floating-point and Advanced SIMD registers but will not
17086 impose any restrictions on the assembler.
17088 @item -mlittle-endian
17089 @opindex mlittle-endian
17090 Generate code for a processor running in little-endian mode.  This is
17091 the default for all standard configurations.
17093 @item -mbig-endian
17094 @opindex mbig-endian
17095 Generate code for a processor running in big-endian mode; the default is
17096 to compile code for a little-endian processor.
17098 @item -mbe8
17099 @itemx -mbe32
17100 @opindex mbe8
17101 When linking a big-endian image select between BE8 and BE32 formats.
17102 The option has no effect for little-endian images and is ignored.  The
17103 default is dependent on the selected target architecture.  For ARMv6
17104 and later architectures the default is BE8, for older architectures
17105 the default is BE32.  BE32 format has been deprecated by ARM.
17107 @item -march=@var{name}@r{[}+extension@dots{}@r{]}
17108 @opindex march
17109 This specifies the name of the target ARM architecture.  GCC uses this
17110 name to determine what kind of instructions it can emit when generating
17111 assembly code.  This option can be used in conjunction with or instead
17112 of the @option{-mcpu=} option.
17114 Permissible names are:
17115 @samp{armv4t},
17116 @samp{armv5t}, @samp{armv5te},
17117 @samp{armv6}, @samp{armv6j}, @samp{armv6k}, @samp{armv6kz}, @samp{armv6t2},
17118 @samp{armv6z}, @samp{armv6zk},
17119 @samp{armv7}, @samp{armv7-a}, @samp{armv7ve}, 
17120 @samp{armv8-a}, @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a},
17121 @samp{armv8.4-a},
17122 @samp{armv8.5-a},
17123 @samp{armv7-r},
17124 @samp{armv8-r},
17125 @samp{armv6-m}, @samp{armv6s-m},
17126 @samp{armv7-m}, @samp{armv7e-m},
17127 @samp{armv8-m.base}, @samp{armv8-m.main},
17128 @samp{iwmmxt} and @samp{iwmmxt2}.
17130 Additionally, the following architectures, which lack support for the
17131 Thumb execution state, are recognized but support is deprecated: @samp{armv4}.
17133 Many of the architectures support extensions.  These can be added by
17134 appending @samp{+@var{extension}} to the architecture name.  Extension
17135 options are processed in order and capabilities accumulate.  An extension
17136 will also enable any necessary base extensions
17137 upon which it depends.  For example, the @samp{+crypto} extension
17138 will always enable the @samp{+simd} extension.  The exception to the
17139 additive construction is for extensions that are prefixed with
17140 @samp{+no@dots{}}: these extensions disable the specified option and
17141 any other extensions that may depend on the presence of that
17142 extension.
17144 For example, @samp{-march=armv7-a+simd+nofp+vfpv4} is equivalent to
17145 writing @samp{-march=armv7-a+vfpv4} since the @samp{+simd} option is
17146 entirely disabled by the @samp{+nofp} option that follows it.
17148 Most extension names are generically named, but have an effect that is
17149 dependent upon the architecture to which it is applied.  For example,
17150 the @samp{+simd} option can be applied to both @samp{armv7-a} and
17151 @samp{armv8-a} architectures, but will enable the original ARMv7-A
17152 Advanced SIMD (Neon) extensions for @samp{armv7-a} and the ARMv8-A
17153 variant for @samp{armv8-a}.
17155 The table below lists the supported extensions for each architecture.
17156 Architectures not mentioned do not support any extensions.
17158 @table @samp
17159 @item armv5te
17160 @itemx armv6
17161 @itemx armv6j
17162 @itemx armv6k
17163 @itemx armv6kz
17164 @itemx armv6t2
17165 @itemx armv6z
17166 @itemx armv6zk
17167 @table @samp
17168 @item +fp
17169 The VFPv2 floating-point instructions.  The extension @samp{+vfpv2} can be
17170 used as an alias for this extension.
17172 @item +nofp
17173 Disable the floating-point instructions.
17174 @end table
17176 @item armv7
17177 The common subset of the ARMv7-A, ARMv7-R and ARMv7-M architectures.
17178 @table @samp
17179 @item +fp
17180 The VFPv3 floating-point instructions, with 16 double-precision
17181 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
17182 for this extension.  Note that floating-point is not supported by the
17183 base ARMv7-M architecture, but is compatible with both the ARMv7-A and
17184 ARMv7-R architectures.
17186 @item +nofp
17187 Disable the floating-point instructions.
17188 @end table
17190 @item armv7-a
17191 @table @samp
17192 @item +mp
17193 The multiprocessing extension.
17195 @item +sec
17196 The security extension.
17198 @item +fp
17199 The VFPv3 floating-point instructions, with 16 double-precision
17200 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
17201 for this extension.
17203 @item +simd
17204 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
17205 The extensions @samp{+neon} and @samp{+neon-vfpv3} can be used as aliases
17206 for this extension.
17208 @item +vfpv3
17209 The VFPv3 floating-point instructions, with 32 double-precision
17210 registers.
17212 @item +vfpv3-d16-fp16
17213 The VFPv3 floating-point instructions, with 16 double-precision
17214 registers and the half-precision floating-point conversion operations.
17216 @item +vfpv3-fp16
17217 The VFPv3 floating-point instructions, with 32 double-precision
17218 registers and the half-precision floating-point conversion operations.
17220 @item +vfpv4-d16
17221 The VFPv4 floating-point instructions, with 16 double-precision
17222 registers.
17224 @item +vfpv4
17225 The VFPv4 floating-point instructions, with 32 double-precision
17226 registers.
17228 @item +neon-fp16
17229 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
17230 the half-precision floating-point conversion operations.
17232 @item +neon-vfpv4
17233 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.
17235 @item +nosimd
17236 Disable the Advanced SIMD instructions (does not disable floating point).
17238 @item +nofp
17239 Disable the floating-point and Advanced SIMD instructions.
17240 @end table
17242 @item armv7ve
17243 The extended version of the ARMv7-A architecture with support for
17244 virtualization.
17245 @table @samp
17246 @item +fp
17247 The VFPv4 floating-point instructions, with 16 double-precision registers.
17248 The extension @samp{+vfpv4-d16} can be used as an alias for this extension.
17250 @item +simd
17251 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.  The
17252 extension @samp{+neon-vfpv4} can be used as an alias for this extension.
17254 @item +vfpv3-d16
17255 The VFPv3 floating-point instructions, with 16 double-precision
17256 registers.
17258 @item +vfpv3
17259 The VFPv3 floating-point instructions, with 32 double-precision
17260 registers.
17262 @item +vfpv3-d16-fp16
17263 The VFPv3 floating-point instructions, with 16 double-precision
17264 registers and the half-precision floating-point conversion operations.
17266 @item +vfpv3-fp16
17267 The VFPv3 floating-point instructions, with 32 double-precision
17268 registers and the half-precision floating-point conversion operations.
17270 @item +vfpv4-d16
17271 The VFPv4 floating-point instructions, with 16 double-precision
17272 registers.
17274 @item +vfpv4
17275 The VFPv4 floating-point instructions, with 32 double-precision
17276 registers.
17278 @item +neon
17279 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
17280 The extension @samp{+neon-vfpv3} can be used as an alias for this extension.
17282 @item +neon-fp16
17283 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
17284 the half-precision floating-point conversion operations.
17286 @item +nosimd
17287 Disable the Advanced SIMD instructions (does not disable floating point).
17289 @item +nofp
17290 Disable the floating-point and Advanced SIMD instructions.
17291 @end table
17293 @item armv8-a
17294 @table @samp
17295 @item +crc
17296 The Cyclic Redundancy Check (CRC) instructions.
17297 @item +simd
17298 The ARMv8-A Advanced SIMD and floating-point instructions.
17299 @item +crypto
17300 The cryptographic instructions.
17301 @item +nocrypto
17302 Disable the cryptographic instructions.
17303 @item +nofp
17304 Disable the floating-point, Advanced SIMD and cryptographic instructions.
17305 @item +sb
17306 Speculation Barrier Instruction.
17307 @item +predres
17308 Execution and Data Prediction Restriction Instructions.
17309 @end table
17311 @item armv8.1-a
17312 @table @samp
17313 @item +simd
17314 The ARMv8.1-A Advanced SIMD and floating-point instructions.
17316 @item +crypto
17317 The cryptographic instructions.  This also enables the Advanced SIMD and
17318 floating-point instructions.
17320 @item +nocrypto
17321 Disable the cryptographic instructions.
17323 @item +nofp
17324 Disable the floating-point, Advanced SIMD and cryptographic instructions.
17326 @item +sb
17327 Speculation Barrier Instruction.
17329 @item +predres
17330 Execution and Data Prediction Restriction Instructions.
17331 @end table
17333 @item armv8.2-a
17334 @itemx armv8.3-a
17335 @table @samp
17336 @item +fp16
17337 The half-precision floating-point data processing instructions.
17338 This also enables the Advanced SIMD and floating-point instructions.
17340 @item +fp16fml
17341 The half-precision floating-point fmla extension.  This also enables
17342 the half-precision floating-point extension and Advanced SIMD and
17343 floating-point instructions.
17345 @item +simd
17346 The ARMv8.1-A Advanced SIMD and floating-point instructions.
17348 @item +crypto
17349 The cryptographic instructions.  This also enables the Advanced SIMD and
17350 floating-point instructions.
17352 @item +dotprod
17353 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
17355 @item +nocrypto
17356 Disable the cryptographic extension.
17358 @item +nofp
17359 Disable the floating-point, Advanced SIMD and cryptographic instructions.
17361 @item +sb
17362 Speculation Barrier Instruction.
17364 @item +predres
17365 Execution and Data Prediction Restriction Instructions.
17366 @end table
17368 @item armv8.4-a
17369 @table @samp
17370 @item +fp16
17371 The half-precision floating-point data processing instructions.
17372 This also enables the Advanced SIMD and floating-point instructions as well
17373 as the Dot Product extension and the half-precision floating-point fmla
17374 extension.
17376 @item +simd
17377 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
17378 Dot Product extension.
17380 @item +crypto
17381 The cryptographic instructions.  This also enables the Advanced SIMD and
17382 floating-point instructions as well as the Dot Product extension.
17384 @item +nocrypto
17385 Disable the cryptographic extension.
17387 @item +nofp
17388 Disable the floating-point, Advanced SIMD and cryptographic instructions.
17390 @item +sb
17391 Speculation Barrier Instruction.
17393 @item +predres
17394 Execution and Data Prediction Restriction Instructions.
17395 @end table
17397 @item armv8.5-a
17398 @table @samp
17399 @item +fp16
17400 The half-precision floating-point data processing instructions.
17401 This also enables the Advanced SIMD and floating-point instructions as well
17402 as the Dot Product extension and the half-precision floating-point fmla
17403 extension.
17405 @item +simd
17406 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
17407 Dot Product extension.
17409 @item +crypto
17410 The cryptographic instructions.  This also enables the Advanced SIMD and
17411 floating-point instructions as well as the Dot Product extension.
17413 @item +nocrypto
17414 Disable the cryptographic extension.
17416 @item +nofp
17417 Disable the floating-point, Advanced SIMD and cryptographic instructions.
17418 @end table
17420 @item armv7-r
17421 @table @samp
17422 @item +fp.sp
17423 The single-precision VFPv3 floating-point instructions.  The extension
17424 @samp{+vfpv3xd} can be used as an alias for this extension.
17426 @item +fp
17427 The VFPv3 floating-point instructions with 16 double-precision registers.
17428 The extension +vfpv3-d16 can be used as an alias for this extension.
17430 @item +vfpv3xd-d16-fp16
17431 The single-precision VFPv3 floating-point instructions with 16 double-precision
17432 registers and the half-precision floating-point conversion operations.
17434 @item +vfpv3-d16-fp16
17435 The VFPv3 floating-point instructions with 16 double-precision
17436 registers and the half-precision floating-point conversion operations.
17438 @item +nofp
17439 Disable the floating-point extension.
17441 @item +idiv
17442 The ARM-state integer division instructions.
17444 @item +noidiv
17445 Disable the ARM-state integer division extension.
17446 @end table
17448 @item armv7e-m
17449 @table @samp
17450 @item +fp
17451 The single-precision VFPv4 floating-point instructions.
17453 @item +fpv5
17454 The single-precision FPv5 floating-point instructions.
17456 @item +fp.dp
17457 The single- and double-precision FPv5 floating-point instructions.
17459 @item +nofp
17460 Disable the floating-point extensions.
17461 @end table
17463 @item  armv8-m.main
17464 @table @samp
17465 @item +dsp
17466 The DSP instructions.
17468 @item +nodsp
17469 Disable the DSP extension.
17471 @item +fp
17472 The single-precision floating-point instructions.
17474 @item +fp.dp
17475 The single- and double-precision floating-point instructions.
17477 @item +nofp
17478 Disable the floating-point extension.
17479 @end table
17481 @item armv8-r
17482 @table @samp
17483 @item +crc
17484 The Cyclic Redundancy Check (CRC) instructions.
17485 @item +fp.sp
17486 The single-precision FPv5 floating-point instructions.
17487 @item +simd
17488 The ARMv8-A Advanced SIMD and floating-point instructions.
17489 @item +crypto
17490 The cryptographic instructions.
17491 @item +nocrypto
17492 Disable the cryptographic instructions.
17493 @item +nofp
17494 Disable the floating-point, Advanced SIMD and cryptographic instructions.
17495 @end table
17497 @end table
17499 @option{-march=native} causes the compiler to auto-detect the architecture
17500 of the build computer.  At present, this feature is only supported on
17501 GNU/Linux, and not all architectures are recognized.  If the auto-detect
17502 is unsuccessful the option has no effect.
17504 @item -mtune=@var{name}
17505 @opindex mtune
17506 This option specifies the name of the target ARM processor for
17507 which GCC should tune the performance of the code.
17508 For some ARM implementations better performance can be obtained by using
17509 this option.
17510 Permissible names are: @samp{arm7tdmi}, @samp{arm7tdmi-s}, @samp{arm710t},
17511 @samp{arm720t}, @samp{arm740t}, @samp{strongarm}, @samp{strongarm110},
17512 @samp{strongarm1100}, 0@samp{strongarm1110}, @samp{arm8}, @samp{arm810},
17513 @samp{arm9}, @samp{arm9e}, @samp{arm920}, @samp{arm920t}, @samp{arm922t},
17514 @samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm926ej-s},
17515 @samp{arm940t}, @samp{arm9tdmi}, @samp{arm10tdmi}, @samp{arm1020t},
17516 @samp{arm1026ej-s}, @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
17517 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
17518 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
17519 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
17520 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
17521 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
17522 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
17523 @samp{cortex-a76}, @samp{ares}, @samp{cortex-r4}, @samp{cortex-r4f},
17524 @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8}, @samp{cortex-r52},
17525 @samp{cortex-m0}, @samp{cortex-m0plus}, @samp{cortex-m1}, @samp{cortex-m3},
17526 @samp{cortex-m4}, @samp{cortex-m7}, @samp{cortex-m23}, @samp{cortex-m33},
17527 @samp{cortex-m1.small-multiply}, @samp{cortex-m0.small-multiply},
17528 @samp{cortex-m0plus.small-multiply}, @samp{exynos-m1}, @samp{marvell-pj4},
17529 @samp{neoverse-n1}, @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2},
17530 @samp{ep9312}, @samp{fa526}, @samp{fa626}, @samp{fa606te}, @samp{fa626te},
17531 @samp{fmp626}, @samp{fa726te}, @samp{xgene1}.
17533 Additionally, this option can specify that GCC should tune the performance
17534 of the code for a big.LITTLE system.  Permissible names are:
17535 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
17536 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
17537 @samp{cortex-a72.cortex-a35}, @samp{cortex-a73.cortex-a53},
17538 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55}.
17540 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
17541 performance for a blend of processors within architecture @var{arch}.
17542 The aim is to generate code that run well on the current most popular
17543 processors, balancing between optimizations that benefit some CPUs in the
17544 range, and avoiding performance pitfalls of other CPUs.  The effects of
17545 this option may change in future GCC versions as CPU models come and go.
17547 @option{-mtune} permits the same extension options as @option{-mcpu}, but
17548 the extension options do not affect the tuning of the generated code.
17550 @option{-mtune=native} causes the compiler to auto-detect the CPU
17551 of the build computer.  At present, this feature is only supported on
17552 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
17553 unsuccessful the option has no effect.
17555 @item -mcpu=@var{name}@r{[}+extension@dots{}@r{]}
17556 @opindex mcpu
17557 This specifies the name of the target ARM processor.  GCC uses this name
17558 to derive the name of the target ARM architecture (as if specified
17559 by @option{-march}) and the ARM processor type for which to tune for
17560 performance (as if specified by @option{-mtune}).  Where this option
17561 is used in conjunction with @option{-march} or @option{-mtune},
17562 those options take precedence over the appropriate part of this option.
17564 Many of the supported CPUs implement optional architectural
17565 extensions.  Where this is so the architectural extensions are
17566 normally enabled by default.  If implementations that lack the
17567 extension exist, then the extension syntax can be used to disable
17568 those extensions that have been omitted.  For floating-point and
17569 Advanced SIMD (Neon) instructions, the settings of the options
17570 @option{-mfloat-abi} and @option{-mfpu} must also be considered:
17571 floating-point and Advanced SIMD instructions will only be used if
17572 @option{-mfloat-abi} is not set to @samp{soft}; and any setting of
17573 @option{-mfpu} other than @samp{auto} will override the available
17574 floating-point and SIMD extension instructions.
17576 For example, @samp{cortex-a9} can be found in three major
17577 configurations: integer only, with just a floating-point unit or with
17578 floating-point and Advanced SIMD.  The default is to enable all the
17579 instructions, but the extensions @samp{+nosimd} and @samp{+nofp} can
17580 be used to disable just the SIMD or both the SIMD and floating-point
17581 instructions respectively.
17583 Permissible names for this option are the same as those for
17584 @option{-mtune}.
17586 The following extension options are common to the listed CPUs:
17588 @table @samp
17589 @item +nodsp
17590 Disable the DSP instructions on @samp{cortex-m33}.
17592 @item  +nofp
17593 Disables the floating-point instructions on @samp{arm9e},
17594 @samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm10e},
17595 @samp{arm1020e}, @samp{arm1022e}, @samp{arm926ej-s},
17596 @samp{arm1026ej-s}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
17597 @samp{cortex-m4}, @samp{cortex-m7} and @samp{cortex-m33}.
17598 Disables the floating-point and SIMD instructions on
17599 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7},
17600 @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a12},
17601 @samp{cortex-a15}, @samp{cortex-a17}, @samp{cortex-a15.cortex-a7},
17602 @samp{cortex-a17.cortex-a7}, @samp{cortex-a32}, @samp{cortex-a35},
17603 @samp{cortex-a53} and @samp{cortex-a55}.
17605 @item +nofp.dp
17606 Disables the double-precision component of the floating-point instructions
17607 on @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8}, @samp{cortex-r52} and
17608 @samp{cortex-m7}.
17610 @item +nosimd
17611 Disables the SIMD (but not floating-point) instructions on
17612 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}
17613 and @samp{cortex-a9}.
17615 @item +crypto
17616 Enables the cryptographic instructions on @samp{cortex-a32},
17617 @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55}, @samp{cortex-a57},
17618 @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75}, @samp{exynos-m1},
17619 @samp{xgene1}, @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
17620 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53} and
17621 @samp{cortex-a75.cortex-a55}.
17622 @end table
17624 Additionally the @samp{generic-armv7-a} pseudo target defaults to
17625 VFPv3 with 16 double-precision registers.  It supports the following
17626 extension options: @samp{mp}, @samp{sec}, @samp{vfpv3-d16},
17627 @samp{vfpv3}, @samp{vfpv3-d16-fp16}, @samp{vfpv3-fp16},
17628 @samp{vfpv4-d16}, @samp{vfpv4}, @samp{neon}, @samp{neon-vfpv3},
17629 @samp{neon-fp16}, @samp{neon-vfpv4}.  The meanings are the same as for
17630 the extensions to @option{-march=armv7-a}.
17632 @option{-mcpu=generic-@var{arch}} is also permissible, and is
17633 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
17634 See @option{-mtune} for more information.
17636 @option{-mcpu=native} causes the compiler to auto-detect the CPU
17637 of the build computer.  At present, this feature is only supported on
17638 GNU/Linux, and not all architectures are recognized.  If the auto-detect
17639 is unsuccessful the option has no effect.
17641 @item -mfpu=@var{name}
17642 @opindex mfpu
17643 This specifies what floating-point hardware (or hardware emulation) is
17644 available on the target.  Permissible names are: @samp{auto}, @samp{vfpv2},
17645 @samp{vfpv3},
17646 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
17647 @samp{vfpv3xd-fp16}, @samp{neon-vfpv3}, @samp{neon-fp16}, @samp{vfpv4},
17648 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
17649 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
17650 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
17651 Note that @samp{neon} is an alias for @samp{neon-vfpv3} and @samp{vfp}
17652 is an alias for @samp{vfpv2}.
17654 The setting @samp{auto} is the default and is special.  It causes the
17655 compiler to select the floating-point and Advanced SIMD instructions
17656 based on the settings of @option{-mcpu} and @option{-march}.
17658 If the selected floating-point hardware includes the NEON extension
17659 (e.g.@: @option{-mfpu=neon}), note that floating-point
17660 operations are not generated by GCC's auto-vectorization pass unless
17661 @option{-funsafe-math-optimizations} is also specified.  This is
17662 because NEON hardware does not fully implement the IEEE 754 standard for
17663 floating-point arithmetic (in particular denormal values are treated as
17664 zero), so the use of NEON instructions may lead to a loss of precision.
17666 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}).
17668 @item -mfp16-format=@var{name}
17669 @opindex mfp16-format
17670 Specify the format of the @code{__fp16} half-precision floating-point type.
17671 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
17672 the default is @samp{none}, in which case the @code{__fp16} type is not
17673 defined.  @xref{Half-Precision}, for more information.
17675 @item -mstructure-size-boundary=@var{n}
17676 @opindex mstructure-size-boundary
17677 The sizes of all structures and unions are rounded up to a multiple
17678 of the number of bits set by this option.  Permissible values are 8, 32
17679 and 64.  The default value varies for different toolchains.  For the COFF
17680 targeted toolchain the default value is 8.  A value of 64 is only allowed
17681 if the underlying ABI supports it.
17683 Specifying a larger number can produce faster, more efficient code, but
17684 can also increase the size of the program.  Different values are potentially
17685 incompatible.  Code compiled with one value cannot necessarily expect to
17686 work with code or libraries compiled with another value, if they exchange
17687 information using structures or unions.
17689 This option is deprecated.
17691 @item -mabort-on-noreturn
17692 @opindex mabort-on-noreturn
17693 Generate a call to the function @code{abort} at the end of a
17694 @code{noreturn} function.  It is executed if the function tries to
17695 return.
17697 @item -mlong-calls
17698 @itemx -mno-long-calls
17699 @opindex mlong-calls
17700 @opindex mno-long-calls
17701 Tells the compiler to perform function calls by first loading the
17702 address of the function into a register and then performing a subroutine
17703 call on this register.  This switch is needed if the target function
17704 lies outside of the 64-megabyte addressing range of the offset-based
17705 version of subroutine call instruction.
17707 Even if this switch is enabled, not all function calls are turned
17708 into long calls.  The heuristic is that static functions, functions
17709 that have the @code{short_call} attribute, functions that are inside
17710 the scope of a @code{#pragma no_long_calls} directive, and functions whose
17711 definitions have already been compiled within the current compilation
17712 unit are not turned into long calls.  The exceptions to this rule are
17713 that weak function definitions, functions with the @code{long_call}
17714 attribute or the @code{section} attribute, and functions that are within
17715 the scope of a @code{#pragma long_calls} directive are always
17716 turned into long calls.
17718 This feature is not enabled by default.  Specifying
17719 @option{-mno-long-calls} restores the default behavior, as does
17720 placing the function calls within the scope of a @code{#pragma
17721 long_calls_off} directive.  Note these switches have no effect on how
17722 the compiler generates code to handle function calls via function
17723 pointers.
17725 @item -msingle-pic-base
17726 @opindex msingle-pic-base
17727 Treat the register used for PIC addressing as read-only, rather than
17728 loading it in the prologue for each function.  The runtime system is
17729 responsible for initializing this register with an appropriate value
17730 before execution begins.
17732 @item -mpic-register=@var{reg}
17733 @opindex mpic-register
17734 Specify the register to be used for PIC addressing.
17735 For standard PIC base case, the default is any suitable register
17736 determined by compiler.  For single PIC base case, the default is
17737 @samp{R9} if target is EABI based or stack-checking is enabled,
17738 otherwise the default is @samp{R10}.
17740 @item -mpic-data-is-text-relative
17741 @opindex mpic-data-is-text-relative
17742 Assume that the displacement between the text and data segments is fixed
17743 at static link time.  This permits using PC-relative addressing
17744 operations to access data known to be in the data segment.  For
17745 non-VxWorks RTP targets, this option is enabled by default.  When
17746 disabled on such targets, it will enable @option{-msingle-pic-base} by
17747 default.
17749 @item -mpoke-function-name
17750 @opindex mpoke-function-name
17751 Write the name of each function into the text section, directly
17752 preceding the function prologue.  The generated code is similar to this:
17754 @smallexample
17755      t0
17756          .ascii "arm_poke_function_name", 0
17757          .align
17758      t1
17759          .word 0xff000000 + (t1 - t0)
17760      arm_poke_function_name
17761          mov     ip, sp
17762          stmfd   sp!, @{fp, ip, lr, pc@}
17763          sub     fp, ip, #4
17764 @end smallexample
17766 When performing a stack backtrace, code can inspect the value of
17767 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
17768 location @code{pc - 12} and the top 8 bits are set, then we know that
17769 there is a function name embedded immediately preceding this location
17770 and has length @code{((pc[-3]) & 0xff000000)}.
17772 @item -mthumb
17773 @itemx -marm
17774 @opindex marm
17775 @opindex mthumb
17777 Select between generating code that executes in ARM and Thumb
17778 states.  The default for most configurations is to generate code
17779 that executes in ARM state, but the default can be changed by
17780 configuring GCC with the @option{--with-mode=}@var{state}
17781 configure option.
17783 You can also override the ARM and Thumb mode for each function
17784 by using the @code{target("thumb")} and @code{target("arm")} function attributes
17785 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
17787 @item -mflip-thumb 
17788 @opindex mflip-thumb
17789 Switch ARM/Thumb modes on alternating functions.
17790 This option is provided for regression testing of mixed Thumb/ARM code
17791 generation, and is not intended for ordinary use in compiling code.
17793 @item -mtpcs-frame
17794 @opindex mtpcs-frame
17795 Generate a stack frame that is compliant with the Thumb Procedure Call
17796 Standard for all non-leaf functions.  (A leaf function is one that does
17797 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
17799 @item -mtpcs-leaf-frame
17800 @opindex mtpcs-leaf-frame
17801 Generate a stack frame that is compliant with the Thumb Procedure Call
17802 Standard for all leaf functions.  (A leaf function is one that does
17803 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
17805 @item -mcallee-super-interworking
17806 @opindex mcallee-super-interworking
17807 Gives all externally visible functions in the file being compiled an ARM
17808 instruction set header which switches to Thumb mode before executing the
17809 rest of the function.  This allows these functions to be called from
17810 non-interworking code.  This option is not valid in AAPCS configurations
17811 because interworking is enabled by default.
17813 @item -mcaller-super-interworking
17814 @opindex mcaller-super-interworking
17815 Allows calls via function pointers (including virtual functions) to
17816 execute correctly regardless of whether the target code has been
17817 compiled for interworking or not.  There is a small overhead in the cost
17818 of executing a function pointer if this option is enabled.  This option
17819 is not valid in AAPCS configurations because interworking is enabled
17820 by default.
17822 @item -mtp=@var{name}
17823 @opindex mtp
17824 Specify the access model for the thread local storage pointer.  The valid
17825 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
17826 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
17827 (supported in the arm6k architecture), and @samp{auto}, which uses the
17828 best available method for the selected processor.  The default setting is
17829 @samp{auto}.
17831 @item -mtls-dialect=@var{dialect}
17832 @opindex mtls-dialect
17833 Specify the dialect to use for accessing thread local storage.  Two
17834 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
17835 @samp{gnu} dialect selects the original GNU scheme for supporting
17836 local and global dynamic TLS models.  The @samp{gnu2} dialect
17837 selects the GNU descriptor scheme, which provides better performance
17838 for shared libraries.  The GNU descriptor scheme is compatible with
17839 the original scheme, but does require new assembler, linker and
17840 library support.  Initial and local exec TLS models are unaffected by
17841 this option and always use the original scheme.
17843 @item -mword-relocations
17844 @opindex mword-relocations
17845 Only generate absolute relocations on word-sized values (i.e.@: R_ARM_ABS32).
17846 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
17847 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
17848 is specified. This option conflicts with @option{-mslow-flash-data}.
17850 @item -mfix-cortex-m3-ldrd
17851 @opindex mfix-cortex-m3-ldrd
17852 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
17853 with overlapping destination and base registers are used.  This option avoids
17854 generating these instructions.  This option is enabled by default when
17855 @option{-mcpu=cortex-m3} is specified.
17857 @item -munaligned-access
17858 @itemx -mno-unaligned-access
17859 @opindex munaligned-access
17860 @opindex mno-unaligned-access
17861 Enables (or disables) reading and writing of 16- and 32- bit values
17862 from addresses that are not 16- or 32- bit aligned.  By default
17863 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
17864 ARMv8-M Baseline architectures, and enabled for all other
17865 architectures.  If unaligned access is not enabled then words in packed
17866 data structures are accessed a byte at a time.
17868 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
17869 generated object file to either true or false, depending upon the
17870 setting of this option.  If unaligned access is enabled then the
17871 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
17872 defined.
17874 @item -mneon-for-64bits
17875 @opindex mneon-for-64bits
17876 Enables using Neon to handle scalar 64-bits operations. This is
17877 disabled by default since the cost of moving data from core registers
17878 to Neon is high.
17880 @item -mslow-flash-data
17881 @opindex mslow-flash-data
17882 Assume loading data from flash is slower than fetching instruction.
17883 Therefore literal load is minimized for better performance.
17884 This option is only supported when compiling for ARMv7 M-profile and
17885 off by default. It conflicts with @option{-mword-relocations}.
17887 @item -masm-syntax-unified
17888 @opindex masm-syntax-unified
17889 Assume inline assembler is using unified asm syntax.  The default is
17890 currently off which implies divided syntax.  This option has no impact
17891 on Thumb2. However, this may change in future releases of GCC.
17892 Divided syntax should be considered deprecated.
17894 @item -mrestrict-it
17895 @opindex mrestrict-it
17896 Restricts generation of IT blocks to conform to the rules of ARMv8-A.
17897 IT blocks can only contain a single 16-bit instruction from a select
17898 set of instructions. This option is on by default for ARMv8-A Thumb mode.
17900 @item -mprint-tune-info
17901 @opindex mprint-tune-info
17902 Print CPU tuning information as comment in assembler file.  This is
17903 an option used only for regression testing of the compiler and not
17904 intended for ordinary use in compiling code.  This option is disabled
17905 by default.
17907 @item -mverbose-cost-dump
17908 @opindex mverbose-cost-dump
17909 Enable verbose cost model dumping in the debug dump files.  This option is
17910 provided for use in debugging the compiler.
17912 @item -mpure-code
17913 @opindex mpure-code
17914 Do not allow constant data to be placed in code sections.
17915 Additionally, when compiling for ELF object format give all text sections the
17916 ELF processor-specific section attribute @code{SHF_ARM_PURECODE}.  This option
17917 is only available when generating non-pic code for M-profile targets with the
17918 MOVT instruction.
17920 @item -mcmse
17921 @opindex mcmse
17922 Generate secure code as per the "ARMv8-M Security Extensions: Requirements on
17923 Development Tools Engineering Specification", which can be found on
17924 @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}.
17925 @end table
17927 @node AVR Options
17928 @subsection AVR Options
17929 @cindex AVR Options
17931 These options are defined for AVR implementations:
17933 @table @gcctabopt
17934 @item -mmcu=@var{mcu}
17935 @opindex mmcu
17936 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
17938 The default for this option is@tie{}@samp{avr2}.
17940 GCC supports the following AVR devices and ISAs:
17942 @include avr-mmcu.texi
17944 @item -mabsdata
17945 @opindex mabsdata
17947 Assume that all data in static storage can be accessed by LDS / STS
17948 instructions.  This option has only an effect on reduced Tiny devices like
17949 ATtiny40.  See also the @code{absdata}
17950 @ref{AVR Variable Attributes,variable attribute}.
17952 @item -maccumulate-args
17953 @opindex maccumulate-args
17954 Accumulate outgoing function arguments and acquire/release the needed
17955 stack space for outgoing function arguments once in function
17956 prologue/epilogue.  Without this option, outgoing arguments are pushed
17957 before calling a function and popped afterwards.
17959 Popping the arguments after the function call can be expensive on
17960 AVR so that accumulating the stack space might lead to smaller
17961 executables because arguments need not be removed from the
17962 stack after such a function call.
17964 This option can lead to reduced code size for functions that perform
17965 several calls to functions that get their arguments on the stack like
17966 calls to printf-like functions.
17968 @item -mbranch-cost=@var{cost}
17969 @opindex mbranch-cost
17970 Set the branch costs for conditional branch instructions to
17971 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
17972 integers. The default branch cost is 0.
17974 @item -mcall-prologues
17975 @opindex mcall-prologues
17976 Functions prologues/epilogues are expanded as calls to appropriate
17977 subroutines.  Code size is smaller.
17979 @item -mgas-isr-prologues
17980 @opindex mgas-isr-prologues
17981 Interrupt service routines (ISRs) may use the @code{__gcc_isr} pseudo
17982 instruction supported by GNU Binutils.
17983 If this option is on, the feature can still be disabled for individual
17984 ISRs by means of the @ref{AVR Function Attributes,,@code{no_gccisr}}
17985 function attribute.  This feature is activated per default
17986 if optimization is on (but not with @option{-Og}, @pxref{Optimize Options}),
17987 and if GNU Binutils support @w{@uref{https://sourceware.org/PR21683,PR21683}}.
17989 @item -mint8
17990 @opindex mint8
17991 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
17992 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
17993 and @code{long long} is 4 bytes.  Please note that this option does not
17994 conform to the C standards, but it results in smaller code
17995 size.
17997 @item -mmain-is-OS_task
17998 @opindex mmain-is-OS_task
17999 Do not save registers in @code{main}.  The effect is the same like
18000 attaching attribute @ref{AVR Function Attributes,,@code{OS_task}}
18001 to @code{main}. It is activated per default if optimization is on.
18003 @item -mn-flash=@var{num}
18004 @opindex mn-flash
18005 Assume that the flash memory has a size of 
18006 @var{num} times 64@tie{}KiB.
18008 @item -mno-interrupts
18009 @opindex mno-interrupts
18010 Generated code is not compatible with hardware interrupts.
18011 Code size is smaller.
18013 @item -mrelax
18014 @opindex mrelax
18015 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
18016 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
18017 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
18018 the assembler's command line and the @option{--relax} option to the
18019 linker's command line.
18021 Jump relaxing is performed by the linker because jump offsets are not
18022 known before code is located. Therefore, the assembler code generated by the
18023 compiler is the same, but the instructions in the executable may
18024 differ from instructions in the assembler code.
18026 Relaxing must be turned on if linker stubs are needed, see the
18027 section on @code{EIND} and linker stubs below.
18029 @item -mrmw
18030 @opindex mrmw
18031 Assume that the device supports the Read-Modify-Write
18032 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
18034 @item -mshort-calls
18035 @opindex mshort-calls
18037 Assume that @code{RJMP} and @code{RCALL} can target the whole
18038 program memory.
18040 This option is used internally for multilib selection.  It is
18041 not an optimization option, and you don't need to set it by hand.
18043 @item -msp8
18044 @opindex msp8
18045 Treat the stack pointer register as an 8-bit register,
18046 i.e.@: assume the high byte of the stack pointer is zero.
18047 In general, you don't need to set this option by hand.
18049 This option is used internally by the compiler to select and
18050 build multilibs for architectures @code{avr2} and @code{avr25}.
18051 These architectures mix devices with and without @code{SPH}.
18052 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
18053 the compiler driver adds or removes this option from the compiler
18054 proper's command line, because the compiler then knows if the device
18055 or architecture has an 8-bit stack pointer and thus no @code{SPH}
18056 register or not.
18058 @item -mstrict-X
18059 @opindex mstrict-X
18060 Use address register @code{X} in a way proposed by the hardware.  This means
18061 that @code{X} is only used in indirect, post-increment or
18062 pre-decrement addressing.
18064 Without this option, the @code{X} register may be used in the same way
18065 as @code{Y} or @code{Z} which then is emulated by additional
18066 instructions.  
18067 For example, loading a value with @code{X+const} addressing with a
18068 small non-negative @code{const < 64} to a register @var{Rn} is
18069 performed as
18071 @example
18072 adiw r26, const   ; X += const
18073 ld   @var{Rn}, X        ; @var{Rn} = *X
18074 sbiw r26, const   ; X -= const
18075 @end example
18077 @item -mtiny-stack
18078 @opindex mtiny-stack
18079 Only change the lower 8@tie{}bits of the stack pointer.
18081 @item -mfract-convert-truncate
18082 @opindex mfract-convert-truncate
18083 Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
18085 @item -nodevicelib
18086 @opindex nodevicelib
18087 Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
18089 @item -Waddr-space-convert
18090 @opindex Waddr-space-convert
18091 @opindex Wno-addr-space-convert
18092 Warn about conversions between address spaces in the case where the
18093 resulting address space is not contained in the incoming address space.
18095 @item -Wmisspelled-isr
18096 @opindex Wmisspelled-isr
18097 @opindex Wno-misspelled-isr
18098 Warn if the ISR is misspelled, i.e.@: without __vector prefix.
18099 Enabled by default.
18100 @end table
18102 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
18103 @cindex @code{EIND}
18104 Pointers in the implementation are 16@tie{}bits wide.
18105 The address of a function or label is represented as word address so
18106 that indirect jumps and calls can target any code address in the
18107 range of 64@tie{}Ki words.
18109 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
18110 bytes of program memory space, there is a special function register called
18111 @code{EIND} that serves as most significant part of the target address
18112 when @code{EICALL} or @code{EIJMP} instructions are used.
18114 Indirect jumps and calls on these devices are handled as follows by
18115 the compiler and are subject to some limitations:
18117 @itemize @bullet
18119 @item
18120 The compiler never sets @code{EIND}.
18122 @item
18123 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
18124 instructions or might read @code{EIND} directly in order to emulate an
18125 indirect call/jump by means of a @code{RET} instruction.
18127 @item
18128 The compiler assumes that @code{EIND} never changes during the startup
18129 code or during the application. In particular, @code{EIND} is not
18130 saved/restored in function or interrupt service routine
18131 prologue/epilogue.
18133 @item
18134 For indirect calls to functions and computed goto, the linker
18135 generates @emph{stubs}. Stubs are jump pads sometimes also called
18136 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
18137 The stub contains a direct jump to the desired address.
18139 @item
18140 Linker relaxation must be turned on so that the linker generates
18141 the stubs correctly in all situations. See the compiler option
18142 @option{-mrelax} and the linker option @option{--relax}.
18143 There are corner cases where the linker is supposed to generate stubs
18144 but aborts without relaxation and without a helpful error message.
18146 @item
18147 The default linker script is arranged for code with @code{EIND = 0}.
18148 If code is supposed to work for a setup with @code{EIND != 0}, a custom
18149 linker script has to be used in order to place the sections whose
18150 name start with @code{.trampolines} into the segment where @code{EIND}
18151 points to.
18153 @item
18154 The startup code from libgcc never sets @code{EIND}.
18155 Notice that startup code is a blend of code from libgcc and AVR-LibC.
18156 For the impact of AVR-LibC on @code{EIND}, see the
18157 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
18159 @item
18160 It is legitimate for user-specific startup code to set up @code{EIND}
18161 early, for example by means of initialization code located in
18162 section @code{.init3}. Such code runs prior to general startup code
18163 that initializes RAM and calls constructors, but after the bit
18164 of startup code from AVR-LibC that sets @code{EIND} to the segment
18165 where the vector table is located.
18166 @example
18167 #include <avr/io.h>
18169 static void
18170 __attribute__((section(".init3"),naked,used,no_instrument_function))
18171 init3_set_eind (void)
18173   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
18174                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
18176 @end example
18178 @noindent
18179 The @code{__trampolines_start} symbol is defined in the linker script.
18181 @item
18182 Stubs are generated automatically by the linker if
18183 the following two conditions are met:
18184 @itemize @minus
18186 @item The address of a label is taken by means of the @code{gs} modifier
18187 (short for @emph{generate stubs}) like so:
18188 @example
18189 LDI r24, lo8(gs(@var{func}))
18190 LDI r25, hi8(gs(@var{func}))
18191 @end example
18192 @item The final location of that label is in a code segment
18193 @emph{outside} the segment where the stubs are located.
18194 @end itemize
18196 @item
18197 The compiler emits such @code{gs} modifiers for code labels in the
18198 following situations:
18199 @itemize @minus
18200 @item Taking address of a function or code label.
18201 @item Computed goto.
18202 @item If prologue-save function is used, see @option{-mcall-prologues}
18203 command-line option.
18204 @item Switch/case dispatch tables. If you do not want such dispatch
18205 tables you can specify the @option{-fno-jump-tables} command-line option.
18206 @item C and C++ constructors/destructors called during startup/shutdown.
18207 @item If the tools hit a @code{gs()} modifier explained above.
18208 @end itemize
18210 @item
18211 Jumping to non-symbolic addresses like so is @emph{not} supported:
18213 @example
18214 int main (void)
18216     /* Call function at word address 0x2 */
18217     return ((int(*)(void)) 0x2)();
18219 @end example
18221 Instead, a stub has to be set up, i.e.@: the function has to be called
18222 through a symbol (@code{func_4} in the example):
18224 @example
18225 int main (void)
18227     extern int func_4 (void);
18229     /* Call function at byte address 0x4 */
18230     return func_4();
18232 @end example
18234 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
18235 Alternatively, @code{func_4} can be defined in the linker script.
18236 @end itemize
18238 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
18239 @cindex @code{RAMPD}
18240 @cindex @code{RAMPX}
18241 @cindex @code{RAMPY}
18242 @cindex @code{RAMPZ}
18243 Some AVR devices support memories larger than the 64@tie{}KiB range
18244 that can be accessed with 16-bit pointers.  To access memory locations
18245 outside this 64@tie{}KiB range, the content of a @code{RAMP}
18246 register is used as high part of the address:
18247 The @code{X}, @code{Y}, @code{Z} address register is concatenated
18248 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
18249 register, respectively, to get a wide address. Similarly,
18250 @code{RAMPD} is used together with direct addressing.
18252 @itemize
18253 @item
18254 The startup code initializes the @code{RAMP} special function
18255 registers with zero.
18257 @item
18258 If a @ref{AVR Named Address Spaces,named address space} other than
18259 generic or @code{__flash} is used, then @code{RAMPZ} is set
18260 as needed before the operation.
18262 @item
18263 If the device supports RAM larger than 64@tie{}KiB and the compiler
18264 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
18265 is reset to zero after the operation.
18267 @item
18268 If the device comes with a specific @code{RAMP} register, the ISR
18269 prologue/epilogue saves/restores that SFR and initializes it with
18270 zero in case the ISR code might (implicitly) use it.
18272 @item
18273 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
18274 If you use inline assembler to read from locations outside the
18275 16-bit address range and change one of the @code{RAMP} registers,
18276 you must reset it to zero after the access.
18278 @end itemize
18280 @subsubsection AVR Built-in Macros
18282 GCC defines several built-in macros so that the user code can test
18283 for the presence or absence of features.  Almost any of the following
18284 built-in macros are deduced from device capabilities and thus
18285 triggered by the @option{-mmcu=} command-line option.
18287 For even more AVR-specific built-in macros see
18288 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
18290 @table @code
18292 @item __AVR_ARCH__
18293 Build-in macro that resolves to a decimal number that identifies the
18294 architecture and depends on the @option{-mmcu=@var{mcu}} option.
18295 Possible values are:
18297 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
18298 @code{4}, @code{5}, @code{51}, @code{6}
18300 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
18301 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
18303 respectively and
18305 @code{100},
18306 @code{102}, @code{103}, @code{104},
18307 @code{105}, @code{106}, @code{107}
18309 for @var{mcu}=@code{avrtiny},
18310 @code{avrxmega2}, @code{avrxmega3}, @code{avrxmega4},
18311 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
18312 If @var{mcu} specifies a device, this built-in macro is set
18313 accordingly. For example, with @option{-mmcu=atmega8} the macro is
18314 defined to @code{4}.
18316 @item __AVR_@var{Device}__
18317 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
18318 the device's name. For example, @option{-mmcu=atmega8} defines the
18319 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
18320 @code{__AVR_ATtiny261A__}, etc.
18322 The built-in macros' names follow
18323 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
18324 the device name as from the AVR user manual. The difference between
18325 @var{Device} in the built-in macro and @var{device} in
18326 @option{-mmcu=@var{device}} is that the latter is always lowercase.
18328 If @var{device} is not a device but only a core architecture like
18329 @samp{avr51}, this macro is not defined.
18331 @item __AVR_DEVICE_NAME__
18332 Setting @option{-mmcu=@var{device}} defines this built-in macro to
18333 the device's name. For example, with @option{-mmcu=atmega8} the macro
18334 is defined to @code{atmega8}.
18336 If @var{device} is not a device but only a core architecture like
18337 @samp{avr51}, this macro is not defined.
18339 @item __AVR_XMEGA__
18340 The device / architecture belongs to the XMEGA family of devices.
18342 @item __AVR_HAVE_ELPM__
18343 The device has the @code{ELPM} instruction.
18345 @item __AVR_HAVE_ELPMX__
18346 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
18347 R@var{n},Z+} instructions.
18349 @item __AVR_HAVE_MOVW__
18350 The device has the @code{MOVW} instruction to perform 16-bit
18351 register-register moves.
18353 @item __AVR_HAVE_LPMX__
18354 The device has the @code{LPM R@var{n},Z} and
18355 @code{LPM R@var{n},Z+} instructions.
18357 @item __AVR_HAVE_MUL__
18358 The device has a hardware multiplier. 
18360 @item __AVR_HAVE_JMP_CALL__
18361 The device has the @code{JMP} and @code{CALL} instructions.
18362 This is the case for devices with more than 8@tie{}KiB of program
18363 memory.
18365 @item __AVR_HAVE_EIJMP_EICALL__
18366 @itemx __AVR_3_BYTE_PC__
18367 The device has the @code{EIJMP} and @code{EICALL} instructions.
18368 This is the case for devices with more than 128@tie{}KiB of program memory.
18369 This also means that the program counter
18370 (PC) is 3@tie{}bytes wide.
18372 @item __AVR_2_BYTE_PC__
18373 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
18374 with up to 128@tie{}KiB of program memory.
18376 @item __AVR_HAVE_8BIT_SP__
18377 @itemx __AVR_HAVE_16BIT_SP__
18378 The stack pointer (SP) register is treated as 8-bit respectively
18379 16-bit register by the compiler.
18380 The definition of these macros is affected by @option{-mtiny-stack}.
18382 @item __AVR_HAVE_SPH__
18383 @itemx __AVR_SP8__
18384 The device has the SPH (high part of stack pointer) special function
18385 register or has an 8-bit stack pointer, respectively.
18386 The definition of these macros is affected by @option{-mmcu=} and
18387 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
18388 by @option{-msp8}.
18390 @item __AVR_HAVE_RAMPD__
18391 @itemx __AVR_HAVE_RAMPX__
18392 @itemx __AVR_HAVE_RAMPY__
18393 @itemx __AVR_HAVE_RAMPZ__
18394 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
18395 @code{RAMPZ} special function register, respectively.
18397 @item __NO_INTERRUPTS__
18398 This macro reflects the @option{-mno-interrupts} command-line option.
18400 @item __AVR_ERRATA_SKIP__
18401 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
18402 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
18403 instructions because of a hardware erratum.  Skip instructions are
18404 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
18405 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
18406 set.
18408 @item __AVR_ISA_RMW__
18409 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
18411 @item __AVR_SFR_OFFSET__=@var{offset}
18412 Instructions that can address I/O special function registers directly
18413 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
18414 address as if addressed by an instruction to access RAM like @code{LD}
18415 or @code{STS}. This offset depends on the device architecture and has
18416 to be subtracted from the RAM address in order to get the
18417 respective I/O@tie{}address.
18419 @item __AVR_SHORT_CALLS__
18420 The @option{-mshort-calls} command line option is set.
18422 @item __AVR_PM_BASE_ADDRESS__=@var{addr}
18423 Some devices support reading from flash memory by means of @code{LD*}
18424 instructions.  The flash memory is seen in the data address space
18425 at an offset of @code{__AVR_PM_BASE_ADDRESS__}.  If this macro
18426 is not defined, this feature is not available.  If defined,
18427 the address space is linear and there is no need to put
18428 @code{.rodata} into RAM.  This is handled by the default linker
18429 description file, and is currently available for
18430 @code{avrtiny} and @code{avrxmega3}.  Even more convenient,
18431 there is no need to use address spaces like @code{__flash} or
18432 features like attribute @code{progmem} and @code{pgm_read_*}.
18434 @item __WITH_AVRLIBC__
18435 The compiler is configured to be used together with AVR-Libc.
18436 See the @option{--with-avrlibc} configure option.
18438 @end table
18440 @node Blackfin Options
18441 @subsection Blackfin Options
18442 @cindex Blackfin Options
18444 @table @gcctabopt
18445 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
18446 @opindex mcpu=
18447 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
18448 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
18449 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
18450 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
18451 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
18452 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
18453 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
18454 @samp{bf561}, @samp{bf592}.
18456 The optional @var{sirevision} specifies the silicon revision of the target
18457 Blackfin processor.  Any workarounds available for the targeted silicon revision
18458 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
18459 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
18460 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
18461 hexadecimal digits representing the major and minor numbers in the silicon
18462 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
18463 is not defined.  If @var{sirevision} is @samp{any}, the
18464 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
18465 If this optional @var{sirevision} is not used, GCC assumes the latest known
18466 silicon revision of the targeted Blackfin processor.
18468 GCC defines a preprocessor macro for the specified @var{cpu}.
18469 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
18470 provided by libgloss to be linked in if @option{-msim} is not given.
18472 Without this option, @samp{bf532} is used as the processor by default.
18474 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
18475 only the preprocessor macro is defined.
18477 @item -msim
18478 @opindex msim
18479 Specifies that the program will be run on the simulator.  This causes
18480 the simulator BSP provided by libgloss to be linked in.  This option
18481 has effect only for @samp{bfin-elf} toolchain.
18482 Certain other options, such as @option{-mid-shared-library} and
18483 @option{-mfdpic}, imply @option{-msim}.
18485 @item -momit-leaf-frame-pointer
18486 @opindex momit-leaf-frame-pointer
18487 Don't keep the frame pointer in a register for leaf functions.  This
18488 avoids the instructions to save, set up and restore frame pointers and
18489 makes an extra register available in leaf functions.
18491 @item -mspecld-anomaly
18492 @opindex mspecld-anomaly
18493 When enabled, the compiler ensures that the generated code does not
18494 contain speculative loads after jump instructions. If this option is used,
18495 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
18497 @item -mno-specld-anomaly
18498 @opindex mno-specld-anomaly
18499 @opindex mspecld-anomaly
18500 Don't generate extra code to prevent speculative loads from occurring.
18502 @item -mcsync-anomaly
18503 @opindex mcsync-anomaly
18504 When enabled, the compiler ensures that the generated code does not
18505 contain CSYNC or SSYNC instructions too soon after conditional branches.
18506 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
18508 @item -mno-csync-anomaly
18509 @opindex mno-csync-anomaly
18510 @opindex mcsync-anomaly
18511 Don't generate extra code to prevent CSYNC or SSYNC instructions from
18512 occurring too soon after a conditional branch.
18514 @item -mlow64k
18515 @opindex mlow64k
18516 When enabled, the compiler is free to take advantage of the knowledge that
18517 the entire program fits into the low 64k of memory.
18519 @item -mno-low64k
18520 @opindex mno-low64k
18521 Assume that the program is arbitrarily large.  This is the default.
18523 @item -mstack-check-l1
18524 @opindex mstack-check-l1
18525 Do stack checking using information placed into L1 scratchpad memory by the
18526 uClinux kernel.
18528 @item -mid-shared-library
18529 @opindex mid-shared-library
18530 Generate code that supports shared libraries via the library ID method.
18531 This allows for execute in place and shared libraries in an environment
18532 without virtual memory management.  This option implies @option{-fPIC}.
18533 With a @samp{bfin-elf} target, this option implies @option{-msim}.
18535 @item -mno-id-shared-library
18536 @opindex mno-id-shared-library
18537 @opindex mid-shared-library
18538 Generate code that doesn't assume ID-based shared libraries are being used.
18539 This is the default.
18541 @item -mleaf-id-shared-library
18542 @opindex mleaf-id-shared-library
18543 Generate code that supports shared libraries via the library ID method,
18544 but assumes that this library or executable won't link against any other
18545 ID shared libraries.  That allows the compiler to use faster code for jumps
18546 and calls.
18548 @item -mno-leaf-id-shared-library
18549 @opindex mno-leaf-id-shared-library
18550 @opindex mleaf-id-shared-library
18551 Do not assume that the code being compiled won't link against any ID shared
18552 libraries.  Slower code is generated for jump and call insns.
18554 @item -mshared-library-id=n
18555 @opindex mshared-library-id
18556 Specifies the identification number of the ID-based shared library being
18557 compiled.  Specifying a value of 0 generates more compact code; specifying
18558 other values forces the allocation of that number to the current
18559 library but is no more space- or time-efficient than omitting this option.
18561 @item -msep-data
18562 @opindex msep-data
18563 Generate code that allows the data segment to be located in a different
18564 area of memory from the text segment.  This allows for execute in place in
18565 an environment without virtual memory management by eliminating relocations
18566 against the text section.
18568 @item -mno-sep-data
18569 @opindex mno-sep-data
18570 @opindex msep-data
18571 Generate code that assumes that the data segment follows the text segment.
18572 This is the default.
18574 @item -mlong-calls
18575 @itemx -mno-long-calls
18576 @opindex mlong-calls
18577 @opindex mno-long-calls
18578 Tells the compiler to perform function calls by first loading the
18579 address of the function into a register and then performing a subroutine
18580 call on this register.  This switch is needed if the target function
18581 lies outside of the 24-bit addressing range of the offset-based
18582 version of subroutine call instruction.
18584 This feature is not enabled by default.  Specifying
18585 @option{-mno-long-calls} restores the default behavior.  Note these
18586 switches have no effect on how the compiler generates code to handle
18587 function calls via function pointers.
18589 @item -mfast-fp
18590 @opindex mfast-fp
18591 Link with the fast floating-point library. This library relaxes some of
18592 the IEEE floating-point standard's rules for checking inputs against
18593 Not-a-Number (NAN), in the interest of performance.
18595 @item -minline-plt
18596 @opindex minline-plt
18597 Enable inlining of PLT entries in function calls to functions that are
18598 not known to bind locally.  It has no effect without @option{-mfdpic}.
18600 @item -mmulticore
18601 @opindex mmulticore
18602 Build a standalone application for multicore Blackfin processors. 
18603 This option causes proper start files and link scripts supporting 
18604 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
18605 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
18607 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
18608 selects the one-application-per-core programming model.  Without
18609 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
18610 programming model is used. In this model, the main function of Core B
18611 should be named as @code{coreb_main}.
18613 If this option is not used, the single-core application programming
18614 model is used.
18616 @item -mcorea
18617 @opindex mcorea
18618 Build a standalone application for Core A of BF561 when using
18619 the one-application-per-core programming model. Proper start files
18620 and link scripts are used to support Core A, and the macro
18621 @code{__BFIN_COREA} is defined.
18622 This option can only be used in conjunction with @option{-mmulticore}.
18624 @item -mcoreb
18625 @opindex mcoreb
18626 Build a standalone application for Core B of BF561 when using
18627 the one-application-per-core programming model. Proper start files
18628 and link scripts are used to support Core B, and the macro
18629 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
18630 should be used instead of @code{main}. 
18631 This option can only be used in conjunction with @option{-mmulticore}.
18633 @item -msdram
18634 @opindex msdram
18635 Build a standalone application for SDRAM. Proper start files and
18636 link scripts are used to put the application into SDRAM, and the macro
18637 @code{__BFIN_SDRAM} is defined.
18638 The loader should initialize SDRAM before loading the application.
18640 @item -micplb
18641 @opindex micplb
18642 Assume that ICPLBs are enabled at run time.  This has an effect on certain
18643 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
18644 are enabled; for standalone applications the default is off.
18645 @end table
18647 @node C6X Options
18648 @subsection C6X Options
18649 @cindex C6X Options
18651 @table @gcctabopt
18652 @item -march=@var{name}
18653 @opindex march
18654 This specifies the name of the target architecture.  GCC uses this
18655 name to determine what kind of instructions it can emit when generating
18656 assembly code.  Permissible names are: @samp{c62x},
18657 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
18659 @item -mbig-endian
18660 @opindex mbig-endian
18661 Generate code for a big-endian target.
18663 @item -mlittle-endian
18664 @opindex mlittle-endian
18665 Generate code for a little-endian target.  This is the default.
18667 @item -msim
18668 @opindex msim
18669 Choose startup files and linker script suitable for the simulator.
18671 @item -msdata=default
18672 @opindex msdata=default
18673 Put small global and static data in the @code{.neardata} section,
18674 which is pointed to by register @code{B14}.  Put small uninitialized
18675 global and static data in the @code{.bss} section, which is adjacent
18676 to the @code{.neardata} section.  Put small read-only data into the
18677 @code{.rodata} section.  The corresponding sections used for large
18678 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
18680 @item -msdata=all
18681 @opindex msdata=all
18682 Put all data, not just small objects, into the sections reserved for
18683 small data, and use addressing relative to the @code{B14} register to
18684 access them.
18686 @item -msdata=none
18687 @opindex msdata=none
18688 Make no use of the sections reserved for small data, and use absolute
18689 addresses to access all data.  Put all initialized global and static
18690 data in the @code{.fardata} section, and all uninitialized data in the
18691 @code{.far} section.  Put all constant data into the @code{.const}
18692 section.
18693 @end table
18695 @node CRIS Options
18696 @subsection CRIS Options
18697 @cindex CRIS Options
18699 These options are defined specifically for the CRIS ports.
18701 @table @gcctabopt
18702 @item -march=@var{architecture-type}
18703 @itemx -mcpu=@var{architecture-type}
18704 @opindex march
18705 @opindex mcpu
18706 Generate code for the specified architecture.  The choices for
18707 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
18708 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
18709 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
18710 @samp{v10}.
18712 @item -mtune=@var{architecture-type}
18713 @opindex mtune
18714 Tune to @var{architecture-type} everything applicable about the generated
18715 code, except for the ABI and the set of available instructions.  The
18716 choices for @var{architecture-type} are the same as for
18717 @option{-march=@var{architecture-type}}.
18719 @item -mmax-stack-frame=@var{n}
18720 @opindex mmax-stack-frame
18721 Warn when the stack frame of a function exceeds @var{n} bytes.
18723 @item -metrax4
18724 @itemx -metrax100
18725 @opindex metrax4
18726 @opindex metrax100
18727 The options @option{-metrax4} and @option{-metrax100} are synonyms for
18728 @option{-march=v3} and @option{-march=v8} respectively.
18730 @item -mmul-bug-workaround
18731 @itemx -mno-mul-bug-workaround
18732 @opindex mmul-bug-workaround
18733 @opindex mno-mul-bug-workaround
18734 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
18735 models where it applies.  This option is active by default.
18737 @item -mpdebug
18738 @opindex mpdebug
18739 Enable CRIS-specific verbose debug-related information in the assembly
18740 code.  This option also has the effect of turning off the @samp{#NO_APP}
18741 formatted-code indicator to the assembler at the beginning of the
18742 assembly file.
18744 @item -mcc-init
18745 @opindex mcc-init
18746 Do not use condition-code results from previous instruction; always emit
18747 compare and test instructions before use of condition codes.
18749 @item -mno-side-effects
18750 @opindex mno-side-effects
18751 @opindex mside-effects
18752 Do not emit instructions with side effects in addressing modes other than
18753 post-increment.
18755 @item -mstack-align
18756 @itemx -mno-stack-align
18757 @itemx -mdata-align
18758 @itemx -mno-data-align
18759 @itemx -mconst-align
18760 @itemx -mno-const-align
18761 @opindex mstack-align
18762 @opindex mno-stack-align
18763 @opindex mdata-align
18764 @opindex mno-data-align
18765 @opindex mconst-align
18766 @opindex mno-const-align
18767 These options (@samp{no-} options) arrange (eliminate arrangements) for the
18768 stack frame, individual data and constants to be aligned for the maximum
18769 single data access size for the chosen CPU model.  The default is to
18770 arrange for 32-bit alignment.  ABI details such as structure layout are
18771 not affected by these options.
18773 @item -m32-bit
18774 @itemx -m16-bit
18775 @itemx -m8-bit
18776 @opindex m32-bit
18777 @opindex m16-bit
18778 @opindex m8-bit
18779 Similar to the stack- data- and const-align options above, these options
18780 arrange for stack frame, writable data and constants to all be 32-bit,
18781 16-bit or 8-bit aligned.  The default is 32-bit alignment.
18783 @item -mno-prologue-epilogue
18784 @itemx -mprologue-epilogue
18785 @opindex mno-prologue-epilogue
18786 @opindex mprologue-epilogue
18787 With @option{-mno-prologue-epilogue}, the normal function prologue and
18788 epilogue which set up the stack frame are omitted and no return
18789 instructions or return sequences are generated in the code.  Use this
18790 option only together with visual inspection of the compiled code: no
18791 warnings or errors are generated when call-saved registers must be saved,
18792 or storage for local variables needs to be allocated.
18794 @item -mno-gotplt
18795 @itemx -mgotplt
18796 @opindex mno-gotplt
18797 @opindex mgotplt
18798 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
18799 instruction sequences that load addresses for functions from the PLT part
18800 of the GOT rather than (traditional on other architectures) calls to the
18801 PLT@.  The default is @option{-mgotplt}.
18803 @item -melf
18804 @opindex melf
18805 Legacy no-op option only recognized with the cris-axis-elf and
18806 cris-axis-linux-gnu targets.
18808 @item -mlinux
18809 @opindex mlinux
18810 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
18812 @item -sim
18813 @opindex sim
18814 This option, recognized for the cris-axis-elf, arranges
18815 to link with input-output functions from a simulator library.  Code,
18816 initialized data and zero-initialized data are allocated consecutively.
18818 @item -sim2
18819 @opindex sim2
18820 Like @option{-sim}, but pass linker options to locate initialized data at
18821 0x40000000 and zero-initialized data at 0x80000000.
18822 @end table
18824 @node CR16 Options
18825 @subsection CR16 Options
18826 @cindex CR16 Options
18828 These options are defined specifically for the CR16 ports.
18830 @table @gcctabopt
18832 @item -mmac
18833 @opindex mmac
18834 Enable the use of multiply-accumulate instructions. Disabled by default.
18836 @item -mcr16cplus
18837 @itemx -mcr16c
18838 @opindex mcr16cplus
18839 @opindex mcr16c
18840 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
18841 is default.
18843 @item -msim
18844 @opindex msim
18845 Links the library libsim.a which is in compatible with simulator. Applicable
18846 to ELF compiler only.
18848 @item -mint32
18849 @opindex mint32
18850 Choose integer type as 32-bit wide.
18852 @item -mbit-ops
18853 @opindex mbit-ops
18854 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
18856 @item -mdata-model=@var{model}
18857 @opindex mdata-model
18858 Choose a data model. The choices for @var{model} are @samp{near},
18859 @samp{far} or @samp{medium}. @samp{medium} is default.
18860 However, @samp{far} is not valid with @option{-mcr16c}, as the
18861 CR16C architecture does not support the far data model.
18862 @end table
18864 @node C-SKY Options
18865 @subsection C-SKY Options
18866 @cindex C-SKY Options
18868 GCC supports these options when compiling for C-SKY V2 processors.
18870 @table @gcctabopt
18872 @item -march=@var{arch}
18873 @opindex march=
18874 Specify the C-SKY target architecture.  Valid values for @var{arch} are:
18875 @samp{ck801}, @samp{ck802}, @samp{ck803}, @samp{ck807}, and @samp{ck810}.
18876 The default is @samp{ck810}.
18878 @item -mcpu=@var{cpu}
18879 @opindex mcpu=
18880 Specify the C-SKY target processor.  Valid values for @var{cpu} are:
18881 @samp{ck801}, @samp{ck801t},
18882 @samp{ck802}, @samp{ck802t}, @samp{ck802j},
18883 @samp{ck803}, @samp{ck803h}, @samp{ck803t}, @samp{ck803ht},
18884 @samp{ck803f}, @samp{ck803fh}, @samp{ck803e}, @samp{ck803eh},
18885 @samp{ck803et}, @samp{ck803eht}, @samp{ck803ef}, @samp{ck803efh},
18886 @samp{ck803ft}, @samp{ck803eft}, @samp{ck803efht}, @samp{ck803r1},
18887 @samp{ck803hr1}, @samp{ck803tr1}, @samp{ck803htr1}, @samp{ck803fr1},
18888 @samp{ck803fhr1}, @samp{ck803er1}, @samp{ck803ehr1}, @samp{ck803etr1},
18889 @samp{ck803ehtr1}, @samp{ck803efr1}, @samp{ck803efhr1}, @samp{ck803ftr1},
18890 @samp{ck803eftr1}, @samp{ck803efhtr1},
18891 @samp{ck803s}, @samp{ck803st}, @samp{ck803se}, @samp{ck803sf},
18892 @samp{ck803sef}, @samp{ck803seft},
18893 @samp{ck807e}, @samp{ck807ef}, @samp{ck807}, @samp{ck807f},
18894 @samp{ck810e}, @samp{ck810et}, @samp{ck810ef}, @samp{ck810eft},
18895 @samp{ck810}, @samp{ck810v}, @samp{ck810f}, @samp{ck810t}, @samp{ck810fv},
18896 @samp{ck810tv}, @samp{ck810ft}, and @samp{ck810ftv}.
18898 @item -mbig-endian
18899 @opindex mbig-endian
18900 @itemx -EB
18901 @opindex EB
18902 @itemx -mlittle-endian
18903 @opindex mlittle-endian
18904 @itemx -EL
18905 @opindex EL
18907 Select big- or little-endian code.  The default is little-endian.
18909 @item -mhard-float
18910 @opindex mhard-float
18911 @itemx -msoft-float
18912 @opindex msoft-float
18914 Select hardware or software floating-point implementations.
18915 The default is soft float.
18917 @item -mdouble-float
18918 @itemx -mno-double-float
18919 @opindex mdouble-float
18920 When @option{-mhard-float} is in effect, enable generation of
18921 double-precision float instructions.  This is the default except
18922 when compiling for CK803.
18924 @item -mfdivdu
18925 @itemx -mno-fdivdu
18926 @opindex mfdivdu
18927 When @option{-mhard-float} is in effect, enable generation of
18928 @code{frecipd}, @code{fsqrtd}, and @code{fdivd} instructions.
18929 This is the default except when compiling for CK803.
18931 @item -mfpu=@var{fpu}
18932 @opindex mfpu=
18933 Select the floating-point processor.  This option can only be used with
18934 @option{-mhard-float}.
18935 Values for @var{fpu} are
18936 @samp{fpv2_sf} (equivalent to @samp{-mno-double-float -mno-fdivdu}),
18937 @samp{fpv2} (@samp{-mdouble-float -mno-divdu}), and
18938 @samp{fpv2_divd} (@samp{-mdouble-float -mdivdu}).
18940 @item -melrw
18941 @itemx -mno-elrw
18942 @opindex melrw
18943 Enable the extended @code{lrw} instruction.  This option defaults to on
18944 for CK801 and off otherwise.
18946 @item -mistack
18947 @itemx -mno-istack
18948 @opindex mistack
18949 Enable interrupt stack instructions; the default is off.
18951 The @option{-mistack} option is required to handle the
18952 @code{interrupt} and @code{isr} function attributes
18953 (@pxref{C-SKY Function Attributes}).
18955 @item -mmp
18956 @opindex mmp
18957 Enable multiprocessor instructions; the default is off.
18959 @item -mcp
18960 @opindex mcp
18961 Enable coprocessor instructions; the default is off.
18963 @item -mcache
18964 @opindex mcache
18965 Enable coprocessor instructions; the default is off.
18967 @item -msecurity
18968 @opindex msecurity
18969 Enable C-SKY security instructions; the default is off.
18971 @item -mtrust
18972 @opindex mtrust
18973 Enable C-SKY trust instructions; the default is off.
18975 @item -mdsp
18976 @opindex mdsp
18977 @itemx -medsp
18978 @opindex medsp
18979 @itemx -mvdsp
18980 @opindex mvdsp
18981 Enable C-SKY DSP, Enhanced DSP, or Vector DSP instructions, respectively.
18982 All of these options default to off.
18984 @item -mdiv
18985 @itemx -mno-div
18986 @opindex mdiv
18987 Generate divide instructions.  Default is off.
18989 @item -msmart
18990 @itemx -mno-smart
18991 @opindex msmart
18992 Generate code for Smart Mode, using only registers numbered 0-7 to allow
18993 use of 16-bit instructions.  This option is ignored for CK801 where this
18994 is the required behavior, and it defaults to on for CK802.
18995 For other targets, the default is off.
18997 @item -mhigh-registers
18998 @itemx -mno-high-registers
18999 @opindex mhigh-registers
19000 Generate code using the high registers numbered 16-31.  This option
19001 is not supported on CK801, CK802, or CK803, and is enabled by default
19002 for other processors.
19004 @item -manchor
19005 @itemx -mno-anchor
19006 @opindex manchor
19007 Generate code using global anchor symbol addresses.
19009 @item -mpushpop
19010 @itemx -mno-pushpop
19011 @opindex mpushpop
19012 Generate code using @code{push} and @code{pop} instructions.  This option
19013 defaults to on.
19015 @item -mmultiple-stld
19016 @itemx -mstm
19017 @itemx -mno-multiple-stld
19018 @itemx -mno-stm
19019 @opindex mmultiple-stld
19020 Generate code using @code{stm} and @code{ldm} instructions.  This option
19021 isn't supported on CK801 but is enabled by default on other processors.
19023 @item -mconstpool
19024 @itemx -mno-constpool
19025 @opindex mconstpool
19026 Create constant pools in the compiler instead of deferring it to the
19027 assembler.  This option is the default and required for correct code
19028 generation on CK801 and CK802, and is optional on other processors.
19030 @item -mstack-size
19031 @item -mno-stack-size
19032 @opindex mstack-size
19033 Emit @code{.stack_size} directives for each function in the assembly
19034 output.  This option defaults to off.
19036 @item -mccrt
19037 @itemx -mno-ccrt
19038 @opindex mccrt
19039 Generate code for the C-SKY compiler runtime instead of libgcc.  This
19040 option defaults to off.
19042 @item -mbranch-cost=@var{n}
19043 @opindex mbranch-cost=
19044 Set the branch costs to roughly @code{n} instructions.  The default is 1.
19046 @item -msched-prolog
19047 @itemx -mno-sched-prolog
19048 @opindex msched-prolog
19049 Permit scheduling of function prologue and epilogue sequences.  Using
19050 this option can result in code that is not compliant with the C-SKY V2 ABI
19051 prologue requirements and that cannot be debugged or backtraced.
19052 It is disabled by default.
19054 @end table
19056 @node Darwin Options
19057 @subsection Darwin Options
19058 @cindex Darwin options
19060 These options are defined for all architectures running the Darwin operating
19061 system.
19063 FSF GCC on Darwin does not create ``fat'' object files; it creates
19064 an object file for the single architecture that GCC was built to
19065 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
19066 @option{-arch} options are used; it does so by running the compiler or
19067 linker multiple times and joining the results together with
19068 @file{lipo}.
19070 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
19071 @samp{i686}) is determined by the flags that specify the ISA
19072 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
19073 @option{-force_cpusubtype_ALL} option can be used to override this.
19075 The Darwin tools vary in their behavior when presented with an ISA
19076 mismatch.  The assembler, @file{as}, only permits instructions to
19077 be used that are valid for the subtype of the file it is generating,
19078 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
19079 The linker for shared libraries, @file{/usr/bin/libtool}, fails
19080 and prints an error if asked to create a shared library with a less
19081 restrictive subtype than its input files (for instance, trying to put
19082 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
19083 for executables, @command{ld}, quietly gives the executable the most
19084 restrictive subtype of any of its input files.
19086 @table @gcctabopt
19087 @item -F@var{dir}
19088 @opindex F
19089 Add the framework directory @var{dir} to the head of the list of
19090 directories to be searched for header files.  These directories are
19091 interleaved with those specified by @option{-I} options and are
19092 scanned in a left-to-right order.
19094 A framework directory is a directory with frameworks in it.  A
19095 framework is a directory with a @file{Headers} and/or
19096 @file{PrivateHeaders} directory contained directly in it that ends
19097 in @file{.framework}.  The name of a framework is the name of this
19098 directory excluding the @file{.framework}.  Headers associated with
19099 the framework are found in one of those two directories, with
19100 @file{Headers} being searched first.  A subframework is a framework
19101 directory that is in a framework's @file{Frameworks} directory.
19102 Includes of subframework headers can only appear in a header of a
19103 framework that contains the subframework, or in a sibling subframework
19104 header.  Two subframeworks are siblings if they occur in the same
19105 framework.  A subframework should not have the same name as a
19106 framework; a warning is issued if this is violated.  Currently a
19107 subframework cannot have subframeworks; in the future, the mechanism
19108 may be extended to support this.  The standard frameworks can be found
19109 in @file{/System/Library/Frameworks} and
19110 @file{/Library/Frameworks}.  An example include looks like
19111 @code{#include <Framework/header.h>}, where @file{Framework} denotes
19112 the name of the framework and @file{header.h} is found in the
19113 @file{PrivateHeaders} or @file{Headers} directory.
19115 @item -iframework@var{dir}
19116 @opindex iframework
19117 Like @option{-F} except the directory is a treated as a system
19118 directory.  The main difference between this @option{-iframework} and
19119 @option{-F} is that with @option{-iframework} the compiler does not
19120 warn about constructs contained within header files found via
19121 @var{dir}.  This option is valid only for the C family of languages.
19123 @item -gused
19124 @opindex gused
19125 Emit debugging information for symbols that are used.  For stabs
19126 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
19127 This is by default ON@.
19129 @item -gfull
19130 @opindex gfull
19131 Emit debugging information for all symbols and types.
19133 @item -mmacosx-version-min=@var{version}
19134 The earliest version of MacOS X that this executable will run on
19135 is @var{version}.  Typical values of @var{version} include @code{10.1},
19136 @code{10.2}, and @code{10.3.9}.
19138 If the compiler was built to use the system's headers by default,
19139 then the default for this option is the system version on which the
19140 compiler is running, otherwise the default is to make choices that
19141 are compatible with as many systems and code bases as possible.
19143 @item -mkernel
19144 @opindex mkernel
19145 Enable kernel development mode.  The @option{-mkernel} option sets
19146 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
19147 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
19148 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
19149 applicable.  This mode also sets @option{-mno-altivec},
19150 @option{-msoft-float}, @option{-fno-builtin} and
19151 @option{-mlong-branch} for PowerPC targets.
19153 @item -mone-byte-bool
19154 @opindex mone-byte-bool
19155 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
19156 By default @code{sizeof(bool)} is @code{4} when compiling for
19157 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
19158 option has no effect on x86.
19160 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
19161 to generate code that is not binary compatible with code generated
19162 without that switch.  Using this switch may require recompiling all
19163 other modules in a program, including system libraries.  Use this
19164 switch to conform to a non-default data model.
19166 @item -mfix-and-continue
19167 @itemx -ffix-and-continue
19168 @itemx -findirect-data
19169 @opindex mfix-and-continue
19170 @opindex ffix-and-continue
19171 @opindex findirect-data
19172 Generate code suitable for fast turnaround development, such as to
19173 allow GDB to dynamically load @file{.o} files into already-running
19174 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
19175 are provided for backwards compatibility.
19177 @item -all_load
19178 @opindex all_load
19179 Loads all members of static archive libraries.
19180 See man ld(1) for more information.
19182 @item -arch_errors_fatal
19183 @opindex arch_errors_fatal
19184 Cause the errors having to do with files that have the wrong architecture
19185 to be fatal.
19187 @item -bind_at_load
19188 @opindex bind_at_load
19189 Causes the output file to be marked such that the dynamic linker will
19190 bind all undefined references when the file is loaded or launched.
19192 @item -bundle
19193 @opindex bundle
19194 Produce a Mach-o bundle format file.
19195 See man ld(1) for more information.
19197 @item -bundle_loader @var{executable}
19198 @opindex bundle_loader
19199 This option specifies the @var{executable} that will load the build
19200 output file being linked.  See man ld(1) for more information.
19202 @item -dynamiclib
19203 @opindex dynamiclib
19204 When passed this option, GCC produces a dynamic library instead of
19205 an executable when linking, using the Darwin @file{libtool} command.
19207 @item -force_cpusubtype_ALL
19208 @opindex force_cpusubtype_ALL
19209 This causes GCC's output file to have the @samp{ALL} subtype, instead of
19210 one controlled by the @option{-mcpu} or @option{-march} option.
19212 @item -allowable_client  @var{client_name}
19213 @itemx -client_name
19214 @itemx -compatibility_version
19215 @itemx -current_version
19216 @itemx -dead_strip
19217 @itemx -dependency-file
19218 @itemx -dylib_file
19219 @itemx -dylinker_install_name
19220 @itemx -dynamic
19221 @itemx -exported_symbols_list
19222 @itemx -filelist
19223 @need 800
19224 @itemx -flat_namespace
19225 @itemx -force_flat_namespace
19226 @itemx -headerpad_max_install_names
19227 @itemx -image_base
19228 @itemx -init
19229 @itemx -install_name
19230 @itemx -keep_private_externs
19231 @itemx -multi_module
19232 @itemx -multiply_defined
19233 @itemx -multiply_defined_unused
19234 @need 800
19235 @itemx -noall_load
19236 @itemx -no_dead_strip_inits_and_terms
19237 @itemx -nofixprebinding
19238 @itemx -nomultidefs
19239 @itemx -noprebind
19240 @itemx -noseglinkedit
19241 @itemx -pagezero_size
19242 @itemx -prebind
19243 @itemx -prebind_all_twolevel_modules
19244 @itemx -private_bundle
19245 @need 800
19246 @itemx -read_only_relocs
19247 @itemx -sectalign
19248 @itemx -sectobjectsymbols
19249 @itemx -whyload
19250 @itemx -seg1addr
19251 @itemx -sectcreate
19252 @itemx -sectobjectsymbols
19253 @itemx -sectorder
19254 @itemx -segaddr
19255 @itemx -segs_read_only_addr
19256 @need 800
19257 @itemx -segs_read_write_addr
19258 @itemx -seg_addr_table
19259 @itemx -seg_addr_table_filename
19260 @itemx -seglinkedit
19261 @itemx -segprot
19262 @itemx -segs_read_only_addr
19263 @itemx -segs_read_write_addr
19264 @itemx -single_module
19265 @itemx -static
19266 @itemx -sub_library
19267 @need 800
19268 @itemx -sub_umbrella
19269 @itemx -twolevel_namespace
19270 @itemx -umbrella
19271 @itemx -undefined
19272 @itemx -unexported_symbols_list
19273 @itemx -weak_reference_mismatches
19274 @itemx -whatsloaded
19275 @opindex allowable_client
19276 @opindex client_name
19277 @opindex compatibility_version
19278 @opindex current_version
19279 @opindex dead_strip
19280 @opindex dependency-file
19281 @opindex dylib_file
19282 @opindex dylinker_install_name
19283 @opindex dynamic
19284 @opindex exported_symbols_list
19285 @opindex filelist
19286 @opindex flat_namespace
19287 @opindex force_flat_namespace
19288 @opindex headerpad_max_install_names
19289 @opindex image_base
19290 @opindex init
19291 @opindex install_name
19292 @opindex keep_private_externs
19293 @opindex multi_module
19294 @opindex multiply_defined
19295 @opindex multiply_defined_unused
19296 @opindex noall_load
19297 @opindex no_dead_strip_inits_and_terms
19298 @opindex nofixprebinding
19299 @opindex nomultidefs
19300 @opindex noprebind
19301 @opindex noseglinkedit
19302 @opindex pagezero_size
19303 @opindex prebind
19304 @opindex prebind_all_twolevel_modules
19305 @opindex private_bundle
19306 @opindex read_only_relocs
19307 @opindex sectalign
19308 @opindex sectobjectsymbols
19309 @opindex whyload
19310 @opindex seg1addr
19311 @opindex sectcreate
19312 @opindex sectobjectsymbols
19313 @opindex sectorder
19314 @opindex segaddr
19315 @opindex segs_read_only_addr
19316 @opindex segs_read_write_addr
19317 @opindex seg_addr_table
19318 @opindex seg_addr_table_filename
19319 @opindex seglinkedit
19320 @opindex segprot
19321 @opindex segs_read_only_addr
19322 @opindex segs_read_write_addr
19323 @opindex single_module
19324 @opindex static
19325 @opindex sub_library
19326 @opindex sub_umbrella
19327 @opindex twolevel_namespace
19328 @opindex umbrella
19329 @opindex undefined
19330 @opindex unexported_symbols_list
19331 @opindex weak_reference_mismatches
19332 @opindex whatsloaded
19333 These options are passed to the Darwin linker.  The Darwin linker man page
19334 describes them in detail.
19335 @end table
19337 @node DEC Alpha Options
19338 @subsection DEC Alpha Options
19340 These @samp{-m} options are defined for the DEC Alpha implementations:
19342 @table @gcctabopt
19343 @item -mno-soft-float
19344 @itemx -msoft-float
19345 @opindex mno-soft-float
19346 @opindex msoft-float
19347 Use (do not use) the hardware floating-point instructions for
19348 floating-point operations.  When @option{-msoft-float} is specified,
19349 functions in @file{libgcc.a} are used to perform floating-point
19350 operations.  Unless they are replaced by routines that emulate the
19351 floating-point operations, or compiled in such a way as to call such
19352 emulations routines, these routines issue floating-point
19353 operations.   If you are compiling for an Alpha without floating-point
19354 operations, you must ensure that the library is built so as not to call
19355 them.
19357 Note that Alpha implementations without floating-point operations are
19358 required to have floating-point registers.
19360 @item -mfp-reg
19361 @itemx -mno-fp-regs
19362 @opindex mfp-reg
19363 @opindex mno-fp-regs
19364 Generate code that uses (does not use) the floating-point register set.
19365 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
19366 register set is not used, floating-point operands are passed in integer
19367 registers as if they were integers and floating-point results are passed
19368 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
19369 so any function with a floating-point argument or return value called by code
19370 compiled with @option{-mno-fp-regs} must also be compiled with that
19371 option.
19373 A typical use of this option is building a kernel that does not use,
19374 and hence need not save and restore, any floating-point registers.
19376 @item -mieee
19377 @opindex mieee
19378 The Alpha architecture implements floating-point hardware optimized for
19379 maximum performance.  It is mostly compliant with the IEEE floating-point
19380 standard.  However, for full compliance, software assistance is
19381 required.  This option generates code fully IEEE-compliant code
19382 @emph{except} that the @var{inexact-flag} is not maintained (see below).
19383 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
19384 defined during compilation.  The resulting code is less efficient but is
19385 able to correctly support denormalized numbers and exceptional IEEE
19386 values such as not-a-number and plus/minus infinity.  Other Alpha
19387 compilers call this option @option{-ieee_with_no_inexact}.
19389 @item -mieee-with-inexact
19390 @opindex mieee-with-inexact
19391 This is like @option{-mieee} except the generated code also maintains
19392 the IEEE @var{inexact-flag}.  Turning on this option causes the
19393 generated code to implement fully-compliant IEEE math.  In addition to
19394 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
19395 macro.  On some Alpha implementations the resulting code may execute
19396 significantly slower than the code generated by default.  Since there is
19397 very little code that depends on the @var{inexact-flag}, you should
19398 normally not specify this option.  Other Alpha compilers call this
19399 option @option{-ieee_with_inexact}.
19401 @item -mfp-trap-mode=@var{trap-mode}
19402 @opindex mfp-trap-mode
19403 This option controls what floating-point related traps are enabled.
19404 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
19405 The trap mode can be set to one of four values:
19407 @table @samp
19408 @item n
19409 This is the default (normal) setting.  The only traps that are enabled
19410 are the ones that cannot be disabled in software (e.g., division by zero
19411 trap).
19413 @item u
19414 In addition to the traps enabled by @samp{n}, underflow traps are enabled
19415 as well.
19417 @item su
19418 Like @samp{u}, but the instructions are marked to be safe for software
19419 completion (see Alpha architecture manual for details).
19421 @item sui
19422 Like @samp{su}, but inexact traps are enabled as well.
19423 @end table
19425 @item -mfp-rounding-mode=@var{rounding-mode}
19426 @opindex mfp-rounding-mode
19427 Selects the IEEE rounding mode.  Other Alpha compilers call this option
19428 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
19431 @table @samp
19432 @item n
19433 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
19434 the nearest machine number or towards the even machine number in case
19435 of a tie.
19437 @item m
19438 Round towards minus infinity.
19440 @item c
19441 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
19443 @item d
19444 Dynamic rounding mode.  A field in the floating-point control register
19445 (@var{fpcr}, see Alpha architecture reference manual) controls the
19446 rounding mode in effect.  The C library initializes this register for
19447 rounding towards plus infinity.  Thus, unless your program modifies the
19448 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
19449 @end table
19451 @item -mtrap-precision=@var{trap-precision}
19452 @opindex mtrap-precision
19453 In the Alpha architecture, floating-point traps are imprecise.  This
19454 means without software assistance it is impossible to recover from a
19455 floating trap and program execution normally needs to be terminated.
19456 GCC can generate code that can assist operating system trap handlers
19457 in determining the exact location that caused a floating-point trap.
19458 Depending on the requirements of an application, different levels of
19459 precisions can be selected:
19461 @table @samp
19462 @item p
19463 Program precision.  This option is the default and means a trap handler
19464 can only identify which program caused a floating-point exception.
19466 @item f
19467 Function precision.  The trap handler can determine the function that
19468 caused a floating-point exception.
19470 @item i
19471 Instruction precision.  The trap handler can determine the exact
19472 instruction that caused a floating-point exception.
19473 @end table
19475 Other Alpha compilers provide the equivalent options called
19476 @option{-scope_safe} and @option{-resumption_safe}.
19478 @item -mieee-conformant
19479 @opindex mieee-conformant
19480 This option marks the generated code as IEEE conformant.  You must not
19481 use this option unless you also specify @option{-mtrap-precision=i} and either
19482 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
19483 is to emit the line @samp{.eflag 48} in the function prologue of the
19484 generated assembly file.
19486 @item -mbuild-constants
19487 @opindex mbuild-constants
19488 Normally GCC examines a 32- or 64-bit integer constant to
19489 see if it can construct it from smaller constants in two or three
19490 instructions.  If it cannot, it outputs the constant as a literal and
19491 generates code to load it from the data segment at run time.
19493 Use this option to require GCC to construct @emph{all} integer constants
19494 using code, even if it takes more instructions (the maximum is six).
19496 You typically use this option to build a shared library dynamic
19497 loader.  Itself a shared library, it must relocate itself in memory
19498 before it can find the variables and constants in its own data segment.
19500 @item -mbwx
19501 @itemx -mno-bwx
19502 @itemx -mcix
19503 @itemx -mno-cix
19504 @itemx -mfix
19505 @itemx -mno-fix
19506 @itemx -mmax
19507 @itemx -mno-max
19508 @opindex mbwx
19509 @opindex mno-bwx
19510 @opindex mcix
19511 @opindex mno-cix
19512 @opindex mfix
19513 @opindex mno-fix
19514 @opindex mmax
19515 @opindex mno-max
19516 Indicate whether GCC should generate code to use the optional BWX,
19517 CIX, FIX and MAX instruction sets.  The default is to use the instruction
19518 sets supported by the CPU type specified via @option{-mcpu=} option or that
19519 of the CPU on which GCC was built if none is specified.
19521 @item -mfloat-vax
19522 @itemx -mfloat-ieee
19523 @opindex mfloat-vax
19524 @opindex mfloat-ieee
19525 Generate code that uses (does not use) VAX F and G floating-point
19526 arithmetic instead of IEEE single and double precision.
19528 @item -mexplicit-relocs
19529 @itemx -mno-explicit-relocs
19530 @opindex mexplicit-relocs
19531 @opindex mno-explicit-relocs
19532 Older Alpha assemblers provided no way to generate symbol relocations
19533 except via assembler macros.  Use of these macros does not allow
19534 optimal instruction scheduling.  GNU binutils as of version 2.12
19535 supports a new syntax that allows the compiler to explicitly mark
19536 which relocations should apply to which instructions.  This option
19537 is mostly useful for debugging, as GCC detects the capabilities of
19538 the assembler when it is built and sets the default accordingly.
19540 @item -msmall-data
19541 @itemx -mlarge-data
19542 @opindex msmall-data
19543 @opindex mlarge-data
19544 When @option{-mexplicit-relocs} is in effect, static data is
19545 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
19546 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
19547 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
19548 16-bit relocations off of the @code{$gp} register.  This limits the
19549 size of the small data area to 64KB, but allows the variables to be
19550 directly accessed via a single instruction.
19552 The default is @option{-mlarge-data}.  With this option the data area
19553 is limited to just below 2GB@.  Programs that require more than 2GB of
19554 data must use @code{malloc} or @code{mmap} to allocate the data in the
19555 heap instead of in the program's data segment.
19557 When generating code for shared libraries, @option{-fpic} implies
19558 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
19560 @item -msmall-text
19561 @itemx -mlarge-text
19562 @opindex msmall-text
19563 @opindex mlarge-text
19564 When @option{-msmall-text} is used, the compiler assumes that the
19565 code of the entire program (or shared library) fits in 4MB, and is
19566 thus reachable with a branch instruction.  When @option{-msmall-data}
19567 is used, the compiler can assume that all local symbols share the
19568 same @code{$gp} value, and thus reduce the number of instructions
19569 required for a function call from 4 to 1.
19571 The default is @option{-mlarge-text}.
19573 @item -mcpu=@var{cpu_type}
19574 @opindex mcpu
19575 Set the instruction set and instruction scheduling parameters for
19576 machine type @var{cpu_type}.  You can specify either the @samp{EV}
19577 style name or the corresponding chip number.  GCC supports scheduling
19578 parameters for the EV4, EV5 and EV6 family of processors and
19579 chooses the default values for the instruction set from the processor
19580 you specify.  If you do not specify a processor type, GCC defaults
19581 to the processor on which the compiler was built.
19583 Supported values for @var{cpu_type} are
19585 @table @samp
19586 @item ev4
19587 @itemx ev45
19588 @itemx 21064
19589 Schedules as an EV4 and has no instruction set extensions.
19591 @item ev5
19592 @itemx 21164
19593 Schedules as an EV5 and has no instruction set extensions.
19595 @item ev56
19596 @itemx 21164a
19597 Schedules as an EV5 and supports the BWX extension.
19599 @item pca56
19600 @itemx 21164pc
19601 @itemx 21164PC
19602 Schedules as an EV5 and supports the BWX and MAX extensions.
19604 @item ev6
19605 @itemx 21264
19606 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
19608 @item ev67
19609 @itemx 21264a
19610 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
19611 @end table
19613 Native toolchains also support the value @samp{native},
19614 which selects the best architecture option for the host processor.
19615 @option{-mcpu=native} has no effect if GCC does not recognize
19616 the processor.
19618 @item -mtune=@var{cpu_type}
19619 @opindex mtune
19620 Set only the instruction scheduling parameters for machine type
19621 @var{cpu_type}.  The instruction set is not changed.
19623 Native toolchains also support the value @samp{native},
19624 which selects the best architecture option for the host processor.
19625 @option{-mtune=native} has no effect if GCC does not recognize
19626 the processor.
19628 @item -mmemory-latency=@var{time}
19629 @opindex mmemory-latency
19630 Sets the latency the scheduler should assume for typical memory
19631 references as seen by the application.  This number is highly
19632 dependent on the memory access patterns used by the application
19633 and the size of the external cache on the machine.
19635 Valid options for @var{time} are
19637 @table @samp
19638 @item @var{number}
19639 A decimal number representing clock cycles.
19641 @item L1
19642 @itemx L2
19643 @itemx L3
19644 @itemx main
19645 The compiler contains estimates of the number of clock cycles for
19646 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
19647 (also called Dcache, Scache, and Bcache), as well as to main memory.
19648 Note that L3 is only valid for EV5.
19650 @end table
19651 @end table
19653 @node FR30 Options
19654 @subsection FR30 Options
19655 @cindex FR30 Options
19657 These options are defined specifically for the FR30 port.
19659 @table @gcctabopt
19661 @item -msmall-model
19662 @opindex msmall-model
19663 Use the small address space model.  This can produce smaller code, but
19664 it does assume that all symbolic values and addresses fit into a
19665 20-bit range.
19667 @item -mno-lsim
19668 @opindex mno-lsim
19669 Assume that runtime support has been provided and so there is no need
19670 to include the simulator library (@file{libsim.a}) on the linker
19671 command line.
19673 @end table
19675 @node FT32 Options
19676 @subsection FT32 Options
19677 @cindex FT32 Options
19679 These options are defined specifically for the FT32 port.
19681 @table @gcctabopt
19683 @item -msim
19684 @opindex msim
19685 Specifies that the program will be run on the simulator.  This causes
19686 an alternate runtime startup and library to be linked.
19687 You must not use this option when generating programs that will run on
19688 real hardware; you must provide your own runtime library for whatever
19689 I/O functions are needed.
19691 @item -mlra
19692 @opindex mlra
19693 Enable Local Register Allocation.  This is still experimental for FT32,
19694 so by default the compiler uses standard reload.
19696 @item -mnodiv
19697 @opindex mnodiv
19698 Do not use div and mod instructions.
19700 @item -mft32b
19701 @opindex mft32b
19702 Enable use of the extended instructions of the FT32B processor.
19704 @item -mcompress
19705 @opindex mcompress
19706 Compress all code using the Ft32B code compression scheme.
19708 @item -mnopm
19709 @opindex  mnopm
19710 Do not generate code that reads program memory.
19712 @end table
19714 @node FRV Options
19715 @subsection FRV Options
19716 @cindex FRV Options
19718 @table @gcctabopt
19719 @item -mgpr-32
19720 @opindex mgpr-32
19722 Only use the first 32 general-purpose registers.
19724 @item -mgpr-64
19725 @opindex mgpr-64
19727 Use all 64 general-purpose registers.
19729 @item -mfpr-32
19730 @opindex mfpr-32
19732 Use only the first 32 floating-point registers.
19734 @item -mfpr-64
19735 @opindex mfpr-64
19737 Use all 64 floating-point registers.
19739 @item -mhard-float
19740 @opindex mhard-float
19742 Use hardware instructions for floating-point operations.
19744 @item -msoft-float
19745 @opindex msoft-float
19747 Use library routines for floating-point operations.
19749 @item -malloc-cc
19750 @opindex malloc-cc
19752 Dynamically allocate condition code registers.
19754 @item -mfixed-cc
19755 @opindex mfixed-cc
19757 Do not try to dynamically allocate condition code registers, only
19758 use @code{icc0} and @code{fcc0}.
19760 @item -mdword
19761 @opindex mdword
19763 Change ABI to use double word insns.
19765 @item -mno-dword
19766 @opindex mno-dword
19767 @opindex mdword
19769 Do not use double word instructions.
19771 @item -mdouble
19772 @opindex mdouble
19774 Use floating-point double instructions.
19776 @item -mno-double
19777 @opindex mno-double
19779 Do not use floating-point double instructions.
19781 @item -mmedia
19782 @opindex mmedia
19784 Use media instructions.
19786 @item -mno-media
19787 @opindex mno-media
19789 Do not use media instructions.
19791 @item -mmuladd
19792 @opindex mmuladd
19794 Use multiply and add/subtract instructions.
19796 @item -mno-muladd
19797 @opindex mno-muladd
19799 Do not use multiply and add/subtract instructions.
19801 @item -mfdpic
19802 @opindex mfdpic
19804 Select the FDPIC ABI, which uses function descriptors to represent
19805 pointers to functions.  Without any PIC/PIE-related options, it
19806 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
19807 assumes GOT entries and small data are within a 12-bit range from the
19808 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
19809 are computed with 32 bits.
19810 With a @samp{bfin-elf} target, this option implies @option{-msim}.
19812 @item -minline-plt
19813 @opindex minline-plt
19815 Enable inlining of PLT entries in function calls to functions that are
19816 not known to bind locally.  It has no effect without @option{-mfdpic}.
19817 It's enabled by default if optimizing for speed and compiling for
19818 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
19819 optimization option such as @option{-O3} or above is present in the
19820 command line.
19822 @item -mTLS
19823 @opindex mTLS
19825 Assume a large TLS segment when generating thread-local code.
19827 @item -mtls
19828 @opindex mtls
19830 Do not assume a large TLS segment when generating thread-local code.
19832 @item -mgprel-ro
19833 @opindex mgprel-ro
19835 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
19836 that is known to be in read-only sections.  It's enabled by default,
19837 except for @option{-fpic} or @option{-fpie}: even though it may help
19838 make the global offset table smaller, it trades 1 instruction for 4.
19839 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
19840 one of which may be shared by multiple symbols, and it avoids the need
19841 for a GOT entry for the referenced symbol, so it's more likely to be a
19842 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
19844 @item -multilib-library-pic
19845 @opindex multilib-library-pic
19847 Link with the (library, not FD) pic libraries.  It's implied by
19848 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
19849 @option{-fpic} without @option{-mfdpic}.  You should never have to use
19850 it explicitly.
19852 @item -mlinked-fp
19853 @opindex mlinked-fp
19855 Follow the EABI requirement of always creating a frame pointer whenever
19856 a stack frame is allocated.  This option is enabled by default and can
19857 be disabled with @option{-mno-linked-fp}.
19859 @item -mlong-calls
19860 @opindex mlong-calls
19862 Use indirect addressing to call functions outside the current
19863 compilation unit.  This allows the functions to be placed anywhere
19864 within the 32-bit address space.
19866 @item -malign-labels
19867 @opindex malign-labels
19869 Try to align labels to an 8-byte boundary by inserting NOPs into the
19870 previous packet.  This option only has an effect when VLIW packing
19871 is enabled.  It doesn't create new packets; it merely adds NOPs to
19872 existing ones.
19874 @item -mlibrary-pic
19875 @opindex mlibrary-pic
19877 Generate position-independent EABI code.
19879 @item -macc-4
19880 @opindex macc-4
19882 Use only the first four media accumulator registers.
19884 @item -macc-8
19885 @opindex macc-8
19887 Use all eight media accumulator registers.
19889 @item -mpack
19890 @opindex mpack
19892 Pack VLIW instructions.
19894 @item -mno-pack
19895 @opindex mno-pack
19897 Do not pack VLIW instructions.
19899 @item -mno-eflags
19900 @opindex mno-eflags
19902 Do not mark ABI switches in e_flags.
19904 @item -mcond-move
19905 @opindex mcond-move
19907 Enable the use of conditional-move instructions (default).
19909 This switch is mainly for debugging the compiler and will likely be removed
19910 in a future version.
19912 @item -mno-cond-move
19913 @opindex mno-cond-move
19915 Disable the use of conditional-move instructions.
19917 This switch is mainly for debugging the compiler and will likely be removed
19918 in a future version.
19920 @item -mscc
19921 @opindex mscc
19923 Enable the use of conditional set instructions (default).
19925 This switch is mainly for debugging the compiler and will likely be removed
19926 in a future version.
19928 @item -mno-scc
19929 @opindex mno-scc
19931 Disable the use of conditional set instructions.
19933 This switch is mainly for debugging the compiler and will likely be removed
19934 in a future version.
19936 @item -mcond-exec
19937 @opindex mcond-exec
19939 Enable the use of conditional execution (default).
19941 This switch is mainly for debugging the compiler and will likely be removed
19942 in a future version.
19944 @item -mno-cond-exec
19945 @opindex mno-cond-exec
19947 Disable the use of conditional execution.
19949 This switch is mainly for debugging the compiler and will likely be removed
19950 in a future version.
19952 @item -mvliw-branch
19953 @opindex mvliw-branch
19955 Run a pass to pack branches into VLIW instructions (default).
19957 This switch is mainly for debugging the compiler and will likely be removed
19958 in a future version.
19960 @item -mno-vliw-branch
19961 @opindex mno-vliw-branch
19963 Do not run a pass to pack branches into VLIW instructions.
19965 This switch is mainly for debugging the compiler and will likely be removed
19966 in a future version.
19968 @item -mmulti-cond-exec
19969 @opindex mmulti-cond-exec
19971 Enable optimization of @code{&&} and @code{||} in conditional execution
19972 (default).
19974 This switch is mainly for debugging the compiler and will likely be removed
19975 in a future version.
19977 @item -mno-multi-cond-exec
19978 @opindex mno-multi-cond-exec
19980 Disable optimization of @code{&&} and @code{||} in conditional execution.
19982 This switch is mainly for debugging the compiler and will likely be removed
19983 in a future version.
19985 @item -mnested-cond-exec
19986 @opindex mnested-cond-exec
19988 Enable nested conditional execution optimizations (default).
19990 This switch is mainly for debugging the compiler and will likely be removed
19991 in a future version.
19993 @item -mno-nested-cond-exec
19994 @opindex mno-nested-cond-exec
19996 Disable nested conditional execution optimizations.
19998 This switch is mainly for debugging the compiler and will likely be removed
19999 in a future version.
20001 @item -moptimize-membar
20002 @opindex moptimize-membar
20004 This switch removes redundant @code{membar} instructions from the
20005 compiler-generated code.  It is enabled by default.
20007 @item -mno-optimize-membar
20008 @opindex mno-optimize-membar
20009 @opindex moptimize-membar
20011 This switch disables the automatic removal of redundant @code{membar}
20012 instructions from the generated code.
20014 @item -mtomcat-stats
20015 @opindex mtomcat-stats
20017 Cause gas to print out tomcat statistics.
20019 @item -mcpu=@var{cpu}
20020 @opindex mcpu
20022 Select the processor type for which to generate code.  Possible values are
20023 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
20024 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
20026 @end table
20028 @node GNU/Linux Options
20029 @subsection GNU/Linux Options
20031 These @samp{-m} options are defined for GNU/Linux targets:
20033 @table @gcctabopt
20034 @item -mglibc
20035 @opindex mglibc
20036 Use the GNU C library.  This is the default except
20037 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
20038 @samp{*-*-linux-*android*} targets.
20040 @item -muclibc
20041 @opindex muclibc
20042 Use uClibc C library.  This is the default on
20043 @samp{*-*-linux-*uclibc*} targets.
20045 @item -mmusl
20046 @opindex mmusl
20047 Use the musl C library.  This is the default on
20048 @samp{*-*-linux-*musl*} targets.
20050 @item -mbionic
20051 @opindex mbionic
20052 Use Bionic C library.  This is the default on
20053 @samp{*-*-linux-*android*} targets.
20055 @item -mandroid
20056 @opindex mandroid
20057 Compile code compatible with Android platform.  This is the default on
20058 @samp{*-*-linux-*android*} targets.
20060 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
20061 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
20062 this option makes the GCC driver pass Android-specific options to the linker.
20063 Finally, this option causes the preprocessor macro @code{__ANDROID__}
20064 to be defined.
20066 @item -tno-android-cc
20067 @opindex tno-android-cc
20068 Disable compilation effects of @option{-mandroid}, i.e., do not enable
20069 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
20070 @option{-fno-rtti} by default.
20072 @item -tno-android-ld
20073 @opindex tno-android-ld
20074 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
20075 linking options to the linker.
20077 @end table
20079 @node H8/300 Options
20080 @subsection H8/300 Options
20082 These @samp{-m} options are defined for the H8/300 implementations:
20084 @table @gcctabopt
20085 @item -mrelax
20086 @opindex mrelax
20087 Shorten some address references at link time, when possible; uses the
20088 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
20089 ld, Using ld}, for a fuller description.
20091 @item -mh
20092 @opindex mh
20093 Generate code for the H8/300H@.
20095 @item -ms
20096 @opindex ms
20097 Generate code for the H8S@.
20099 @item -mn
20100 @opindex mn
20101 Generate code for the H8S and H8/300H in the normal mode.  This switch
20102 must be used either with @option{-mh} or @option{-ms}.
20104 @item -ms2600
20105 @opindex ms2600
20106 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
20108 @item -mexr
20109 @opindex mexr
20110 Extended registers are stored on stack before execution of function
20111 with monitor attribute. Default option is @option{-mexr}.
20112 This option is valid only for H8S targets.
20114 @item -mno-exr
20115 @opindex mno-exr
20116 @opindex mexr
20117 Extended registers are not stored on stack before execution of function 
20118 with monitor attribute. Default option is @option{-mno-exr}. 
20119 This option is valid only for H8S targets.
20121 @item -mint32
20122 @opindex mint32
20123 Make @code{int} data 32 bits by default.
20125 @item -malign-300
20126 @opindex malign-300
20127 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
20128 The default for the H8/300H and H8S is to align longs and floats on
20129 4-byte boundaries.
20130 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
20131 This option has no effect on the H8/300.
20132 @end table
20134 @node HPPA Options
20135 @subsection HPPA Options
20136 @cindex HPPA Options
20138 These @samp{-m} options are defined for the HPPA family of computers:
20140 @table @gcctabopt
20141 @item -march=@var{architecture-type}
20142 @opindex march
20143 Generate code for the specified architecture.  The choices for
20144 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
20145 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
20146 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
20147 architecture option for your machine.  Code compiled for lower numbered
20148 architectures runs on higher numbered architectures, but not the
20149 other way around.
20151 @item -mpa-risc-1-0
20152 @itemx -mpa-risc-1-1
20153 @itemx -mpa-risc-2-0
20154 @opindex mpa-risc-1-0
20155 @opindex mpa-risc-1-1
20156 @opindex mpa-risc-2-0
20157 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
20159 @item -mcaller-copies
20160 @opindex mcaller-copies
20161 The caller copies function arguments passed by hidden reference.  This
20162 option should be used with care as it is not compatible with the default
20163 32-bit runtime.  However, only aggregates larger than eight bytes are
20164 passed by hidden reference and the option provides better compatibility
20165 with OpenMP.
20167 @item -mjump-in-delay
20168 @opindex mjump-in-delay
20169 This option is ignored and provided for compatibility purposes only.
20171 @item -mdisable-fpregs
20172 @opindex mdisable-fpregs
20173 Prevent floating-point registers from being used in any manner.  This is
20174 necessary for compiling kernels that perform lazy context switching of
20175 floating-point registers.  If you use this option and attempt to perform
20176 floating-point operations, the compiler aborts.
20178 @item -mdisable-indexing
20179 @opindex mdisable-indexing
20180 Prevent the compiler from using indexing address modes.  This avoids some
20181 rather obscure problems when compiling MIG generated code under MACH@.
20183 @item -mno-space-regs
20184 @opindex mno-space-regs
20185 @opindex mspace-regs
20186 Generate code that assumes the target has no space registers.  This allows
20187 GCC to generate faster indirect calls and use unscaled index address modes.
20189 Such code is suitable for level 0 PA systems and kernels.
20191 @item -mfast-indirect-calls
20192 @opindex mfast-indirect-calls
20193 Generate code that assumes calls never cross space boundaries.  This
20194 allows GCC to emit code that performs faster indirect calls.
20196 This option does not work in the presence of shared libraries or nested
20197 functions.
20199 @item -mfixed-range=@var{register-range}
20200 @opindex mfixed-range
20201 Generate code treating the given register range as fixed registers.
20202 A fixed register is one that the register allocator cannot use.  This is
20203 useful when compiling kernel code.  A register range is specified as
20204 two registers separated by a dash.  Multiple register ranges can be
20205 specified separated by a comma.
20207 @item -mlong-load-store
20208 @opindex mlong-load-store
20209 Generate 3-instruction load and store sequences as sometimes required by
20210 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
20211 the HP compilers.
20213 @item -mportable-runtime
20214 @opindex mportable-runtime
20215 Use the portable calling conventions proposed by HP for ELF systems.
20217 @item -mgas
20218 @opindex mgas
20219 Enable the use of assembler directives only GAS understands.
20221 @item -mschedule=@var{cpu-type}
20222 @opindex mschedule
20223 Schedule code according to the constraints for the machine type
20224 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
20225 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
20226 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
20227 proper scheduling option for your machine.  The default scheduling is
20228 @samp{8000}.
20230 @item -mlinker-opt
20231 @opindex mlinker-opt
20232 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
20233 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
20234 linkers in which they give bogus error messages when linking some programs.
20236 @item -msoft-float
20237 @opindex msoft-float
20238 Generate output containing library calls for floating point.
20239 @strong{Warning:} the requisite libraries are not available for all HPPA
20240 targets.  Normally the facilities of the machine's usual C compiler are
20241 used, but this cannot be done directly in cross-compilation.  You must make
20242 your own arrangements to provide suitable library functions for
20243 cross-compilation.
20245 @option{-msoft-float} changes the calling convention in the output file;
20246 therefore, it is only useful if you compile @emph{all} of a program with
20247 this option.  In particular, you need to compile @file{libgcc.a}, the
20248 library that comes with GCC, with @option{-msoft-float} in order for
20249 this to work.
20251 @item -msio
20252 @opindex msio
20253 Generate the predefine, @code{_SIO}, for server IO@.  The default is
20254 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
20255 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
20256 options are available under HP-UX and HI-UX@.
20258 @item -mgnu-ld
20259 @opindex mgnu-ld
20260 Use options specific to GNU @command{ld}.
20261 This passes @option{-shared} to @command{ld} when
20262 building a shared library.  It is the default when GCC is configured,
20263 explicitly or implicitly, with the GNU linker.  This option does not
20264 affect which @command{ld} is called; it only changes what parameters
20265 are passed to that @command{ld}.
20266 The @command{ld} that is called is determined by the
20267 @option{--with-ld} configure option, GCC's program search path, and
20268 finally by the user's @env{PATH}.  The linker used by GCC can be printed
20269 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
20270 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
20272 @item -mhp-ld
20273 @opindex mhp-ld
20274 Use options specific to HP @command{ld}.
20275 This passes @option{-b} to @command{ld} when building
20276 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
20277 links.  It is the default when GCC is configured, explicitly or
20278 implicitly, with the HP linker.  This option does not affect
20279 which @command{ld} is called; it only changes what parameters are passed to that
20280 @command{ld}.
20281 The @command{ld} that is called is determined by the @option{--with-ld}
20282 configure option, GCC's program search path, and finally by the user's
20283 @env{PATH}.  The linker used by GCC can be printed using @samp{which
20284 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
20285 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
20287 @item -mlong-calls
20288 @opindex mno-long-calls
20289 @opindex mlong-calls
20290 Generate code that uses long call sequences.  This ensures that a call
20291 is always able to reach linker generated stubs.  The default is to generate
20292 long calls only when the distance from the call site to the beginning
20293 of the function or translation unit, as the case may be, exceeds a
20294 predefined limit set by the branch type being used.  The limits for
20295 normal calls are 7,600,000 and 240,000 bytes, respectively for the
20296 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
20297 240,000 bytes.
20299 Distances are measured from the beginning of functions when using the
20300 @option{-ffunction-sections} option, or when using the @option{-mgas}
20301 and @option{-mno-portable-runtime} options together under HP-UX with
20302 the SOM linker.
20304 It is normally not desirable to use this option as it degrades
20305 performance.  However, it may be useful in large applications,
20306 particularly when partial linking is used to build the application.
20308 The types of long calls used depends on the capabilities of the
20309 assembler and linker, and the type of code being generated.  The
20310 impact on systems that support long absolute calls, and long pic
20311 symbol-difference or pc-relative calls should be relatively small.
20312 However, an indirect call is used on 32-bit ELF systems in pic code
20313 and it is quite long.
20315 @item -munix=@var{unix-std}
20316 @opindex march
20317 Generate compiler predefines and select a startfile for the specified
20318 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
20319 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
20320 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
20321 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
20322 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
20323 and later.
20325 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
20326 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
20327 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
20328 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
20329 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
20330 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
20332 It is @emph{important} to note that this option changes the interfaces
20333 for various library routines.  It also affects the operational behavior
20334 of the C library.  Thus, @emph{extreme} care is needed in using this
20335 option.
20337 Library code that is intended to operate with more than one UNIX
20338 standard must test, set and restore the variable @code{__xpg4_extended_mask}
20339 as appropriate.  Most GNU software doesn't provide this capability.
20341 @item -nolibdld
20342 @opindex nolibdld
20343 Suppress the generation of link options to search libdld.sl when the
20344 @option{-static} option is specified on HP-UX 10 and later.
20346 @item -static
20347 @opindex static
20348 The HP-UX implementation of setlocale in libc has a dependency on
20349 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
20350 when the @option{-static} option is specified, special link options
20351 are needed to resolve this dependency.
20353 On HP-UX 10 and later, the GCC driver adds the necessary options to
20354 link with libdld.sl when the @option{-static} option is specified.
20355 This causes the resulting binary to be dynamic.  On the 64-bit port,
20356 the linkers generate dynamic binaries by default in any case.  The
20357 @option{-nolibdld} option can be used to prevent the GCC driver from
20358 adding these link options.
20360 @item -threads
20361 @opindex threads
20362 Add support for multithreading with the @dfn{dce thread} library
20363 under HP-UX@.  This option sets flags for both the preprocessor and
20364 linker.
20365 @end table
20367 @node IA-64 Options
20368 @subsection IA-64 Options
20369 @cindex IA-64 Options
20371 These are the @samp{-m} options defined for the Intel IA-64 architecture.
20373 @table @gcctabopt
20374 @item -mbig-endian
20375 @opindex mbig-endian
20376 Generate code for a big-endian target.  This is the default for HP-UX@.
20378 @item -mlittle-endian
20379 @opindex mlittle-endian
20380 Generate code for a little-endian target.  This is the default for AIX5
20381 and GNU/Linux.
20383 @item -mgnu-as
20384 @itemx -mno-gnu-as
20385 @opindex mgnu-as
20386 @opindex mno-gnu-as
20387 Generate (or don't) code for the GNU assembler.  This is the default.
20388 @c Also, this is the default if the configure option @option{--with-gnu-as}
20389 @c is used.
20391 @item -mgnu-ld
20392 @itemx -mno-gnu-ld
20393 @opindex mgnu-ld
20394 @opindex mno-gnu-ld
20395 Generate (or don't) code for the GNU linker.  This is the default.
20396 @c Also, this is the default if the configure option @option{--with-gnu-ld}
20397 @c is used.
20399 @item -mno-pic
20400 @opindex mno-pic
20401 Generate code that does not use a global pointer register.  The result
20402 is not position independent code, and violates the IA-64 ABI@.
20404 @item -mvolatile-asm-stop
20405 @itemx -mno-volatile-asm-stop
20406 @opindex mvolatile-asm-stop
20407 @opindex mno-volatile-asm-stop
20408 Generate (or don't) a stop bit immediately before and after volatile asm
20409 statements.
20411 @item -mregister-names
20412 @itemx -mno-register-names
20413 @opindex mregister-names
20414 @opindex mno-register-names
20415 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
20416 the stacked registers.  This may make assembler output more readable.
20418 @item -mno-sdata
20419 @itemx -msdata
20420 @opindex mno-sdata
20421 @opindex msdata
20422 Disable (or enable) optimizations that use the small data section.  This may
20423 be useful for working around optimizer bugs.
20425 @item -mconstant-gp
20426 @opindex mconstant-gp
20427 Generate code that uses a single constant global pointer value.  This is
20428 useful when compiling kernel code.
20430 @item -mauto-pic
20431 @opindex mauto-pic
20432 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
20433 This is useful when compiling firmware code.
20435 @item -minline-float-divide-min-latency
20436 @opindex minline-float-divide-min-latency
20437 Generate code for inline divides of floating-point values
20438 using the minimum latency algorithm.
20440 @item -minline-float-divide-max-throughput
20441 @opindex minline-float-divide-max-throughput
20442 Generate code for inline divides of floating-point values
20443 using the maximum throughput algorithm.
20445 @item -mno-inline-float-divide
20446 @opindex mno-inline-float-divide
20447 Do not generate inline code for divides of floating-point values.
20449 @item -minline-int-divide-min-latency
20450 @opindex minline-int-divide-min-latency
20451 Generate code for inline divides of integer values
20452 using the minimum latency algorithm.
20454 @item -minline-int-divide-max-throughput
20455 @opindex minline-int-divide-max-throughput
20456 Generate code for inline divides of integer values
20457 using the maximum throughput algorithm.
20459 @item -mno-inline-int-divide
20460 @opindex mno-inline-int-divide
20461 @opindex minline-int-divide
20462 Do not generate inline code for divides of integer values.
20464 @item -minline-sqrt-min-latency
20465 @opindex minline-sqrt-min-latency
20466 Generate code for inline square roots
20467 using the minimum latency algorithm.
20469 @item -minline-sqrt-max-throughput
20470 @opindex minline-sqrt-max-throughput
20471 Generate code for inline square roots
20472 using the maximum throughput algorithm.
20474 @item -mno-inline-sqrt
20475 @opindex mno-inline-sqrt
20476 Do not generate inline code for @code{sqrt}.
20478 @item -mfused-madd
20479 @itemx -mno-fused-madd
20480 @opindex mfused-madd
20481 @opindex mno-fused-madd
20482 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
20483 instructions.  The default is to use these instructions.
20485 @item -mno-dwarf2-asm
20486 @itemx -mdwarf2-asm
20487 @opindex mno-dwarf2-asm
20488 @opindex mdwarf2-asm
20489 Don't (or do) generate assembler code for the DWARF line number debugging
20490 info.  This may be useful when not using the GNU assembler.
20492 @item -mearly-stop-bits
20493 @itemx -mno-early-stop-bits
20494 @opindex mearly-stop-bits
20495 @opindex mno-early-stop-bits
20496 Allow stop bits to be placed earlier than immediately preceding the
20497 instruction that triggered the stop bit.  This can improve instruction
20498 scheduling, but does not always do so.
20500 @item -mfixed-range=@var{register-range}
20501 @opindex mfixed-range
20502 Generate code treating the given register range as fixed registers.
20503 A fixed register is one that the register allocator cannot use.  This is
20504 useful when compiling kernel code.  A register range is specified as
20505 two registers separated by a dash.  Multiple register ranges can be
20506 specified separated by a comma.
20508 @item -mtls-size=@var{tls-size}
20509 @opindex mtls-size
20510 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
20513 @item -mtune=@var{cpu-type}
20514 @opindex mtune
20515 Tune the instruction scheduling for a particular CPU, Valid values are
20516 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
20517 and @samp{mckinley}.
20519 @item -milp32
20520 @itemx -mlp64
20521 @opindex milp32
20522 @opindex mlp64
20523 Generate code for a 32-bit or 64-bit environment.
20524 The 32-bit environment sets int, long and pointer to 32 bits.
20525 The 64-bit environment sets int to 32 bits and long and pointer
20526 to 64 bits.  These are HP-UX specific flags.
20528 @item -mno-sched-br-data-spec
20529 @itemx -msched-br-data-spec
20530 @opindex mno-sched-br-data-spec
20531 @opindex msched-br-data-spec
20532 (Dis/En)able data speculative scheduling before reload.
20533 This results in generation of @code{ld.a} instructions and
20534 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
20535 The default setting is disabled.
20537 @item -msched-ar-data-spec
20538 @itemx -mno-sched-ar-data-spec
20539 @opindex msched-ar-data-spec
20540 @opindex mno-sched-ar-data-spec
20541 (En/Dis)able data speculative scheduling after reload.
20542 This results in generation of @code{ld.a} instructions and
20543 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
20544 The default setting is enabled.
20546 @item -mno-sched-control-spec
20547 @itemx -msched-control-spec
20548 @opindex mno-sched-control-spec
20549 @opindex msched-control-spec
20550 (Dis/En)able control speculative scheduling.  This feature is
20551 available only during region scheduling (i.e.@: before reload).
20552 This results in generation of the @code{ld.s} instructions and
20553 the corresponding check instructions @code{chk.s}.
20554 The default setting is disabled.
20556 @item -msched-br-in-data-spec
20557 @itemx -mno-sched-br-in-data-spec
20558 @opindex msched-br-in-data-spec
20559 @opindex mno-sched-br-in-data-spec
20560 (En/Dis)able speculative scheduling of the instructions that
20561 are dependent on the data speculative loads before reload.
20562 This is effective only with @option{-msched-br-data-spec} enabled.
20563 The default setting is enabled.
20565 @item -msched-ar-in-data-spec
20566 @itemx -mno-sched-ar-in-data-spec
20567 @opindex msched-ar-in-data-spec
20568 @opindex mno-sched-ar-in-data-spec
20569 (En/Dis)able speculative scheduling of the instructions that
20570 are dependent on the data speculative loads after reload.
20571 This is effective only with @option{-msched-ar-data-spec} enabled.
20572 The default setting is enabled.
20574 @item -msched-in-control-spec
20575 @itemx -mno-sched-in-control-spec
20576 @opindex msched-in-control-spec
20577 @opindex mno-sched-in-control-spec
20578 (En/Dis)able speculative scheduling of the instructions that
20579 are dependent on the control speculative loads.
20580 This is effective only with @option{-msched-control-spec} enabled.
20581 The default setting is enabled.
20583 @item -mno-sched-prefer-non-data-spec-insns
20584 @itemx -msched-prefer-non-data-spec-insns
20585 @opindex mno-sched-prefer-non-data-spec-insns
20586 @opindex msched-prefer-non-data-spec-insns
20587 If enabled, data-speculative instructions are chosen for schedule
20588 only if there are no other choices at the moment.  This makes
20589 the use of the data speculation much more conservative.
20590 The default setting is disabled.
20592 @item -mno-sched-prefer-non-control-spec-insns
20593 @itemx -msched-prefer-non-control-spec-insns
20594 @opindex mno-sched-prefer-non-control-spec-insns
20595 @opindex msched-prefer-non-control-spec-insns
20596 If enabled, control-speculative instructions are chosen for schedule
20597 only if there are no other choices at the moment.  This makes
20598 the use of the control speculation much more conservative.
20599 The default setting is disabled.
20601 @item -mno-sched-count-spec-in-critical-path
20602 @itemx -msched-count-spec-in-critical-path
20603 @opindex mno-sched-count-spec-in-critical-path
20604 @opindex msched-count-spec-in-critical-path
20605 If enabled, speculative dependencies are considered during
20606 computation of the instructions priorities.  This makes the use of the
20607 speculation a bit more conservative.
20608 The default setting is disabled.
20610 @item -msched-spec-ldc
20611 @opindex msched-spec-ldc
20612 Use a simple data speculation check.  This option is on by default.
20614 @item -msched-control-spec-ldc
20615 @opindex msched-spec-ldc
20616 Use a simple check for control speculation.  This option is on by default.
20618 @item -msched-stop-bits-after-every-cycle
20619 @opindex msched-stop-bits-after-every-cycle
20620 Place a stop bit after every cycle when scheduling.  This option is on
20621 by default.
20623 @item -msched-fp-mem-deps-zero-cost
20624 @opindex msched-fp-mem-deps-zero-cost
20625 Assume that floating-point stores and loads are not likely to cause a conflict
20626 when placed into the same instruction group.  This option is disabled by
20627 default.
20629 @item -msel-sched-dont-check-control-spec
20630 @opindex msel-sched-dont-check-control-spec
20631 Generate checks for control speculation in selective scheduling.
20632 This flag is disabled by default.
20634 @item -msched-max-memory-insns=@var{max-insns}
20635 @opindex msched-max-memory-insns
20636 Limit on the number of memory insns per instruction group, giving lower
20637 priority to subsequent memory insns attempting to schedule in the same
20638 instruction group. Frequently useful to prevent cache bank conflicts.
20639 The default value is 1.
20641 @item -msched-max-memory-insns-hard-limit
20642 @opindex msched-max-memory-insns-hard-limit
20643 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
20644 disallowing more than that number in an instruction group.
20645 Otherwise, the limit is ``soft'', meaning that non-memory operations
20646 are preferred when the limit is reached, but memory operations may still
20647 be scheduled.
20649 @end table
20651 @node LM32 Options
20652 @subsection LM32 Options
20653 @cindex LM32 options
20655 These @option{-m} options are defined for the LatticeMico32 architecture:
20657 @table @gcctabopt
20658 @item -mbarrel-shift-enabled
20659 @opindex mbarrel-shift-enabled
20660 Enable barrel-shift instructions.
20662 @item -mdivide-enabled
20663 @opindex mdivide-enabled
20664 Enable divide and modulus instructions.
20666 @item -mmultiply-enabled
20667 @opindex multiply-enabled
20668 Enable multiply instructions.
20670 @item -msign-extend-enabled
20671 @opindex msign-extend-enabled
20672 Enable sign extend instructions.
20674 @item -muser-enabled
20675 @opindex muser-enabled
20676 Enable user-defined instructions.
20678 @end table
20680 @node M32C Options
20681 @subsection M32C Options
20682 @cindex M32C options
20684 @table @gcctabopt
20685 @item -mcpu=@var{name}
20686 @opindex mcpu=
20687 Select the CPU for which code is generated.  @var{name} may be one of
20688 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
20689 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
20690 the M32C/80 series.
20692 @item -msim
20693 @opindex msim
20694 Specifies that the program will be run on the simulator.  This causes
20695 an alternate runtime library to be linked in which supports, for
20696 example, file I/O@.  You must not use this option when generating
20697 programs that will run on real hardware; you must provide your own
20698 runtime library for whatever I/O functions are needed.
20700 @item -memregs=@var{number}
20701 @opindex memregs=
20702 Specifies the number of memory-based pseudo-registers GCC uses
20703 during code generation.  These pseudo-registers are used like real
20704 registers, so there is a tradeoff between GCC's ability to fit the
20705 code into available registers, and the performance penalty of using
20706 memory instead of registers.  Note that all modules in a program must
20707 be compiled with the same value for this option.  Because of that, you
20708 must not use this option with GCC's default runtime libraries.
20710 @end table
20712 @node M32R/D Options
20713 @subsection M32R/D Options
20714 @cindex M32R/D options
20716 These @option{-m} options are defined for Renesas M32R/D architectures:
20718 @table @gcctabopt
20719 @item -m32r2
20720 @opindex m32r2
20721 Generate code for the M32R/2@.
20723 @item -m32rx
20724 @opindex m32rx
20725 Generate code for the M32R/X@.
20727 @item -m32r
20728 @opindex m32r
20729 Generate code for the M32R@.  This is the default.
20731 @item -mmodel=small
20732 @opindex mmodel=small
20733 Assume all objects live in the lower 16MB of memory (so that their addresses
20734 can be loaded with the @code{ld24} instruction), and assume all subroutines
20735 are reachable with the @code{bl} instruction.
20736 This is the default.
20738 The addressability of a particular object can be set with the
20739 @code{model} attribute.
20741 @item -mmodel=medium
20742 @opindex mmodel=medium
20743 Assume objects may be anywhere in the 32-bit address space (the compiler
20744 generates @code{seth/add3} instructions to load their addresses), and
20745 assume all subroutines are reachable with the @code{bl} instruction.
20747 @item -mmodel=large
20748 @opindex mmodel=large
20749 Assume objects may be anywhere in the 32-bit address space (the compiler
20750 generates @code{seth/add3} instructions to load their addresses), and
20751 assume subroutines may not be reachable with the @code{bl} instruction
20752 (the compiler generates the much slower @code{seth/add3/jl}
20753 instruction sequence).
20755 @item -msdata=none
20756 @opindex msdata=none
20757 Disable use of the small data area.  Variables are put into
20758 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
20759 @code{section} attribute has been specified).
20760 This is the default.
20762 The small data area consists of sections @code{.sdata} and @code{.sbss}.
20763 Objects may be explicitly put in the small data area with the
20764 @code{section} attribute using one of these sections.
20766 @item -msdata=sdata
20767 @opindex msdata=sdata
20768 Put small global and static data in the small data area, but do not
20769 generate special code to reference them.
20771 @item -msdata=use
20772 @opindex msdata=use
20773 Put small global and static data in the small data area, and generate
20774 special instructions to reference them.
20776 @item -G @var{num}
20777 @opindex G
20778 @cindex smaller data references
20779 Put global and static objects less than or equal to @var{num} bytes
20780 into the small data or BSS sections instead of the normal data or BSS
20781 sections.  The default value of @var{num} is 8.
20782 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
20783 for this option to have any effect.
20785 All modules should be compiled with the same @option{-G @var{num}} value.
20786 Compiling with different values of @var{num} may or may not work; if it
20787 doesn't the linker gives an error message---incorrect code is not
20788 generated.
20790 @item -mdebug
20791 @opindex mdebug
20792 Makes the M32R-specific code in the compiler display some statistics
20793 that might help in debugging programs.
20795 @item -malign-loops
20796 @opindex malign-loops
20797 Align all loops to a 32-byte boundary.
20799 @item -mno-align-loops
20800 @opindex mno-align-loops
20801 Do not enforce a 32-byte alignment for loops.  This is the default.
20803 @item -missue-rate=@var{number}
20804 @opindex missue-rate=@var{number}
20805 Issue @var{number} instructions per cycle.  @var{number} can only be 1
20806 or 2.
20808 @item -mbranch-cost=@var{number}
20809 @opindex mbranch-cost=@var{number}
20810 @var{number} can only be 1 or 2.  If it is 1 then branches are
20811 preferred over conditional code, if it is 2, then the opposite applies.
20813 @item -mflush-trap=@var{number}
20814 @opindex mflush-trap=@var{number}
20815 Specifies the trap number to use to flush the cache.  The default is
20816 12.  Valid numbers are between 0 and 15 inclusive.
20818 @item -mno-flush-trap
20819 @opindex mno-flush-trap
20820 Specifies that the cache cannot be flushed by using a trap.
20822 @item -mflush-func=@var{name}
20823 @opindex mflush-func=@var{name}
20824 Specifies the name of the operating system function to call to flush
20825 the cache.  The default is @samp{_flush_cache}, but a function call
20826 is only used if a trap is not available.
20828 @item -mno-flush-func
20829 @opindex mno-flush-func
20830 Indicates that there is no OS function for flushing the cache.
20832 @end table
20834 @node M680x0 Options
20835 @subsection M680x0 Options
20836 @cindex M680x0 options
20838 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
20839 The default settings depend on which architecture was selected when
20840 the compiler was configured; the defaults for the most common choices
20841 are given below.
20843 @table @gcctabopt
20844 @item -march=@var{arch}
20845 @opindex march
20846 Generate code for a specific M680x0 or ColdFire instruction set
20847 architecture.  Permissible values of @var{arch} for M680x0
20848 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
20849 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
20850 architectures are selected according to Freescale's ISA classification
20851 and the permissible values are: @samp{isaa}, @samp{isaaplus},
20852 @samp{isab} and @samp{isac}.
20854 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
20855 code for a ColdFire target.  The @var{arch} in this macro is one of the
20856 @option{-march} arguments given above.
20858 When used together, @option{-march} and @option{-mtune} select code
20859 that runs on a family of similar processors but that is optimized
20860 for a particular microarchitecture.
20862 @item -mcpu=@var{cpu}
20863 @opindex mcpu
20864 Generate code for a specific M680x0 or ColdFire processor.
20865 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
20866 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
20867 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
20868 below, which also classifies the CPUs into families:
20870 @multitable @columnfractions 0.20 0.80
20871 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
20872 @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}
20873 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
20874 @item @samp{5206e} @tab @samp{5206e}
20875 @item @samp{5208} @tab @samp{5207} @samp{5208}
20876 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
20877 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
20878 @item @samp{5216} @tab @samp{5214} @samp{5216}
20879 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
20880 @item @samp{5225} @tab @samp{5224} @samp{5225}
20881 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
20882 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
20883 @item @samp{5249} @tab @samp{5249}
20884 @item @samp{5250} @tab @samp{5250}
20885 @item @samp{5271} @tab @samp{5270} @samp{5271}
20886 @item @samp{5272} @tab @samp{5272}
20887 @item @samp{5275} @tab @samp{5274} @samp{5275}
20888 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
20889 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
20890 @item @samp{5307} @tab @samp{5307}
20891 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
20892 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
20893 @item @samp{5407} @tab @samp{5407}
20894 @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}
20895 @end multitable
20897 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
20898 @var{arch} is compatible with @var{cpu}.  Other combinations of
20899 @option{-mcpu} and @option{-march} are rejected.
20901 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
20902 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
20903 where the value of @var{family} is given by the table above.
20905 @item -mtune=@var{tune}
20906 @opindex mtune
20907 Tune the code for a particular microarchitecture within the
20908 constraints set by @option{-march} and @option{-mcpu}.
20909 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
20910 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
20911 and @samp{cpu32}.  The ColdFire microarchitectures
20912 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
20914 You can also use @option{-mtune=68020-40} for code that needs
20915 to run relatively well on 68020, 68030 and 68040 targets.
20916 @option{-mtune=68020-60} is similar but includes 68060 targets
20917 as well.  These two options select the same tuning decisions as
20918 @option{-m68020-40} and @option{-m68020-60} respectively.
20920 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
20921 when tuning for 680x0 architecture @var{arch}.  It also defines
20922 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
20923 option is used.  If GCC is tuning for a range of architectures,
20924 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
20925 it defines the macros for every architecture in the range.
20927 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
20928 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
20929 of the arguments given above.
20931 @item -m68000
20932 @itemx -mc68000
20933 @opindex m68000
20934 @opindex mc68000
20935 Generate output for a 68000.  This is the default
20936 when the compiler is configured for 68000-based systems.
20937 It is equivalent to @option{-march=68000}.
20939 Use this option for microcontrollers with a 68000 or EC000 core,
20940 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
20942 @item -m68010
20943 @opindex m68010
20944 Generate output for a 68010.  This is the default
20945 when the compiler is configured for 68010-based systems.
20946 It is equivalent to @option{-march=68010}.
20948 @item -m68020
20949 @itemx -mc68020
20950 @opindex m68020
20951 @opindex mc68020
20952 Generate output for a 68020.  This is the default
20953 when the compiler is configured for 68020-based systems.
20954 It is equivalent to @option{-march=68020}.
20956 @item -m68030
20957 @opindex m68030
20958 Generate output for a 68030.  This is the default when the compiler is
20959 configured for 68030-based systems.  It is equivalent to
20960 @option{-march=68030}.
20962 @item -m68040
20963 @opindex m68040
20964 Generate output for a 68040.  This is the default when the compiler is
20965 configured for 68040-based systems.  It is equivalent to
20966 @option{-march=68040}.
20968 This option inhibits the use of 68881/68882 instructions that have to be
20969 emulated by software on the 68040.  Use this option if your 68040 does not
20970 have code to emulate those instructions.
20972 @item -m68060
20973 @opindex m68060
20974 Generate output for a 68060.  This is the default when the compiler is
20975 configured for 68060-based systems.  It is equivalent to
20976 @option{-march=68060}.
20978 This option inhibits the use of 68020 and 68881/68882 instructions that
20979 have to be emulated by software on the 68060.  Use this option if your 68060
20980 does not have code to emulate those instructions.
20982 @item -mcpu32
20983 @opindex mcpu32
20984 Generate output for a CPU32.  This is the default
20985 when the compiler is configured for CPU32-based systems.
20986 It is equivalent to @option{-march=cpu32}.
20988 Use this option for microcontrollers with a
20989 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
20990 68336, 68340, 68341, 68349 and 68360.
20992 @item -m5200
20993 @opindex m5200
20994 Generate output for a 520X ColdFire CPU@.  This is the default
20995 when the compiler is configured for 520X-based systems.
20996 It is equivalent to @option{-mcpu=5206}, and is now deprecated
20997 in favor of that option.
20999 Use this option for microcontroller with a 5200 core, including
21000 the MCF5202, MCF5203, MCF5204 and MCF5206.
21002 @item -m5206e
21003 @opindex m5206e
21004 Generate output for a 5206e ColdFire CPU@.  The option is now
21005 deprecated in favor of the equivalent @option{-mcpu=5206e}.
21007 @item -m528x
21008 @opindex m528x
21009 Generate output for a member of the ColdFire 528X family.
21010 The option is now deprecated in favor of the equivalent
21011 @option{-mcpu=528x}.
21013 @item -m5307
21014 @opindex m5307
21015 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
21016 in favor of the equivalent @option{-mcpu=5307}.
21018 @item -m5407
21019 @opindex m5407
21020 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
21021 in favor of the equivalent @option{-mcpu=5407}.
21023 @item -mcfv4e
21024 @opindex mcfv4e
21025 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
21026 This includes use of hardware floating-point instructions.
21027 The option is equivalent to @option{-mcpu=547x}, and is now
21028 deprecated in favor of that option.
21030 @item -m68020-40
21031 @opindex m68020-40
21032 Generate output for a 68040, without using any of the new instructions.
21033 This results in code that can run relatively efficiently on either a
21034 68020/68881 or a 68030 or a 68040.  The generated code does use the
21035 68881 instructions that are emulated on the 68040.
21037 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
21039 @item -m68020-60
21040 @opindex m68020-60
21041 Generate output for a 68060, without using any of the new instructions.
21042 This results in code that can run relatively efficiently on either a
21043 68020/68881 or a 68030 or a 68040.  The generated code does use the
21044 68881 instructions that are emulated on the 68060.
21046 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
21048 @item -mhard-float
21049 @itemx -m68881
21050 @opindex mhard-float
21051 @opindex m68881
21052 Generate floating-point instructions.  This is the default for 68020
21053 and above, and for ColdFire devices that have an FPU@.  It defines the
21054 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
21055 on ColdFire targets.
21057 @item -msoft-float
21058 @opindex msoft-float
21059 Do not generate floating-point instructions; use library calls instead.
21060 This is the default for 68000, 68010, and 68832 targets.  It is also
21061 the default for ColdFire devices that have no FPU.
21063 @item -mdiv
21064 @itemx -mno-div
21065 @opindex mdiv
21066 @opindex mno-div
21067 Generate (do not generate) ColdFire hardware divide and remainder
21068 instructions.  If @option{-march} is used without @option{-mcpu},
21069 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
21070 architectures.  Otherwise, the default is taken from the target CPU
21071 (either the default CPU, or the one specified by @option{-mcpu}).  For
21072 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
21073 @option{-mcpu=5206e}.
21075 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
21077 @item -mshort
21078 @opindex mshort
21079 Consider type @code{int} to be 16 bits wide, like @code{short int}.
21080 Additionally, parameters passed on the stack are also aligned to a
21081 16-bit boundary even on targets whose API mandates promotion to 32-bit.
21083 @item -mno-short
21084 @opindex mno-short
21085 Do not consider type @code{int} to be 16 bits wide.  This is the default.
21087 @item -mnobitfield
21088 @itemx -mno-bitfield
21089 @opindex mnobitfield
21090 @opindex mno-bitfield
21091 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
21092 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
21094 @item -mbitfield
21095 @opindex mbitfield
21096 Do use the bit-field instructions.  The @option{-m68020} option implies
21097 @option{-mbitfield}.  This is the default if you use a configuration
21098 designed for a 68020.
21100 @item -mrtd
21101 @opindex mrtd
21102 Use a different function-calling convention, in which functions
21103 that take a fixed number of arguments return with the @code{rtd}
21104 instruction, which pops their arguments while returning.  This
21105 saves one instruction in the caller since there is no need to pop
21106 the arguments there.
21108 This calling convention is incompatible with the one normally
21109 used on Unix, so you cannot use it if you need to call libraries
21110 compiled with the Unix compiler.
21112 Also, you must provide function prototypes for all functions that
21113 take variable numbers of arguments (including @code{printf});
21114 otherwise incorrect code is generated for calls to those
21115 functions.
21117 In addition, seriously incorrect code results if you call a
21118 function with too many arguments.  (Normally, extra arguments are
21119 harmlessly ignored.)
21121 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
21122 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
21124 The default is @option{-mno-rtd}.
21126 @item -malign-int
21127 @itemx -mno-align-int
21128 @opindex malign-int
21129 @opindex mno-align-int
21130 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
21131 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
21132 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
21133 Aligning variables on 32-bit boundaries produces code that runs somewhat
21134 faster on processors with 32-bit busses at the expense of more memory.
21136 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
21137 aligns structures containing the above types differently than
21138 most published application binary interface specifications for the m68k.
21140 @item -mpcrel
21141 @opindex mpcrel
21142 Use the pc-relative addressing mode of the 68000 directly, instead of
21143 using a global offset table.  At present, this option implies @option{-fpic},
21144 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
21145 not presently supported with @option{-mpcrel}, though this could be supported for
21146 68020 and higher processors.
21148 @item -mno-strict-align
21149 @itemx -mstrict-align
21150 @opindex mno-strict-align
21151 @opindex mstrict-align
21152 Do not (do) assume that unaligned memory references are handled by
21153 the system.
21155 @item -msep-data
21156 Generate code that allows the data segment to be located in a different
21157 area of memory from the text segment.  This allows for execute-in-place in
21158 an environment without virtual memory management.  This option implies
21159 @option{-fPIC}.
21161 @item -mno-sep-data
21162 Generate code that assumes that the data segment follows the text segment.
21163 This is the default.
21165 @item -mid-shared-library
21166 Generate code that supports shared libraries via the library ID method.
21167 This allows for execute-in-place and shared libraries in an environment
21168 without virtual memory management.  This option implies @option{-fPIC}.
21170 @item -mno-id-shared-library
21171 Generate code that doesn't assume ID-based shared libraries are being used.
21172 This is the default.
21174 @item -mshared-library-id=n
21175 Specifies the identification number of the ID-based shared library being
21176 compiled.  Specifying a value of 0 generates more compact code; specifying
21177 other values forces the allocation of that number to the current
21178 library, but is no more space- or time-efficient than omitting this option.
21180 @item -mxgot
21181 @itemx -mno-xgot
21182 @opindex mxgot
21183 @opindex mno-xgot
21184 When generating position-independent code for ColdFire, generate code
21185 that works if the GOT has more than 8192 entries.  This code is
21186 larger and slower than code generated without this option.  On M680x0
21187 processors, this option is not needed; @option{-fPIC} suffices.
21189 GCC normally uses a single instruction to load values from the GOT@.
21190 While this is relatively efficient, it only works if the GOT
21191 is smaller than about 64k.  Anything larger causes the linker
21192 to report an error such as:
21194 @cindex relocation truncated to fit (ColdFire)
21195 @smallexample
21196 relocation truncated to fit: R_68K_GOT16O foobar
21197 @end smallexample
21199 If this happens, you should recompile your code with @option{-mxgot}.
21200 It should then work with very large GOTs.  However, code generated with
21201 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
21202 the value of a global symbol.
21204 Note that some linkers, including newer versions of the GNU linker,
21205 can create multiple GOTs and sort GOT entries.  If you have such a linker,
21206 you should only need to use @option{-mxgot} when compiling a single
21207 object file that accesses more than 8192 GOT entries.  Very few do.
21209 These options have no effect unless GCC is generating
21210 position-independent code.
21212 @item -mlong-jump-table-offsets
21213 @opindex mlong-jump-table-offsets
21214 Use 32-bit offsets in @code{switch} tables.  The default is to use
21215 16-bit offsets.
21217 @end table
21219 @node MCore Options
21220 @subsection MCore Options
21221 @cindex MCore options
21223 These are the @samp{-m} options defined for the Motorola M*Core
21224 processors.
21226 @table @gcctabopt
21228 @item -mhardlit
21229 @itemx -mno-hardlit
21230 @opindex mhardlit
21231 @opindex mno-hardlit
21232 Inline constants into the code stream if it can be done in two
21233 instructions or less.
21235 @item -mdiv
21236 @itemx -mno-div
21237 @opindex mdiv
21238 @opindex mno-div
21239 Use the divide instruction.  (Enabled by default).
21241 @item -mrelax-immediate
21242 @itemx -mno-relax-immediate
21243 @opindex mrelax-immediate
21244 @opindex mno-relax-immediate
21245 Allow arbitrary-sized immediates in bit operations.
21247 @item -mwide-bitfields
21248 @itemx -mno-wide-bitfields
21249 @opindex mwide-bitfields
21250 @opindex mno-wide-bitfields
21251 Always treat bit-fields as @code{int}-sized.
21253 @item -m4byte-functions
21254 @itemx -mno-4byte-functions
21255 @opindex m4byte-functions
21256 @opindex mno-4byte-functions
21257 Force all functions to be aligned to a 4-byte boundary.
21259 @item -mcallgraph-data
21260 @itemx -mno-callgraph-data
21261 @opindex mcallgraph-data
21262 @opindex mno-callgraph-data
21263 Emit callgraph information.
21265 @item -mslow-bytes
21266 @itemx -mno-slow-bytes
21267 @opindex mslow-bytes
21268 @opindex mno-slow-bytes
21269 Prefer word access when reading byte quantities.
21271 @item -mlittle-endian
21272 @itemx -mbig-endian
21273 @opindex mlittle-endian
21274 @opindex mbig-endian
21275 Generate code for a little-endian target.
21277 @item -m210
21278 @itemx -m340
21279 @opindex m210
21280 @opindex m340
21281 Generate code for the 210 processor.
21283 @item -mno-lsim
21284 @opindex mno-lsim
21285 Assume that runtime support has been provided and so omit the
21286 simulator library (@file{libsim.a)} from the linker command line.
21288 @item -mstack-increment=@var{size}
21289 @opindex mstack-increment
21290 Set the maximum amount for a single stack increment operation.  Large
21291 values can increase the speed of programs that contain functions
21292 that need a large amount of stack space, but they can also trigger a
21293 segmentation fault if the stack is extended too much.  The default
21294 value is 0x1000.
21296 @end table
21298 @node MeP Options
21299 @subsection MeP Options
21300 @cindex MeP options
21302 @table @gcctabopt
21304 @item -mabsdiff
21305 @opindex mabsdiff
21306 Enables the @code{abs} instruction, which is the absolute difference
21307 between two registers.
21309 @item -mall-opts
21310 @opindex mall-opts
21311 Enables all the optional instructions---average, multiply, divide, bit
21312 operations, leading zero, absolute difference, min/max, clip, and
21313 saturation.
21316 @item -maverage
21317 @opindex maverage
21318 Enables the @code{ave} instruction, which computes the average of two
21319 registers.
21321 @item -mbased=@var{n}
21322 @opindex mbased=
21323 Variables of size @var{n} bytes or smaller are placed in the
21324 @code{.based} section by default.  Based variables use the @code{$tp}
21325 register as a base register, and there is a 128-byte limit to the
21326 @code{.based} section.
21328 @item -mbitops
21329 @opindex mbitops
21330 Enables the bit operation instructions---bit test (@code{btstm}), set
21331 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
21332 test-and-set (@code{tas}).
21334 @item -mc=@var{name}
21335 @opindex mc=
21336 Selects which section constant data is placed in.  @var{name} may
21337 be @samp{tiny}, @samp{near}, or @samp{far}.
21339 @item -mclip
21340 @opindex mclip
21341 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
21342 useful unless you also provide @option{-mminmax}.
21344 @item -mconfig=@var{name}
21345 @opindex mconfig=
21346 Selects one of the built-in core configurations.  Each MeP chip has
21347 one or more modules in it; each module has a core CPU and a variety of
21348 coprocessors, optional instructions, and peripherals.  The
21349 @code{MeP-Integrator} tool, not part of GCC, provides these
21350 configurations through this option; using this option is the same as
21351 using all the corresponding command-line options.  The default
21352 configuration is @samp{default}.
21354 @item -mcop
21355 @opindex mcop
21356 Enables the coprocessor instructions.  By default, this is a 32-bit
21357 coprocessor.  Note that the coprocessor is normally enabled via the
21358 @option{-mconfig=} option.
21360 @item -mcop32
21361 @opindex mcop32
21362 Enables the 32-bit coprocessor's instructions.
21364 @item -mcop64
21365 @opindex mcop64
21366 Enables the 64-bit coprocessor's instructions.
21368 @item -mivc2
21369 @opindex mivc2
21370 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
21372 @item -mdc
21373 @opindex mdc
21374 Causes constant variables to be placed in the @code{.near} section.
21376 @item -mdiv
21377 @opindex mdiv
21378 Enables the @code{div} and @code{divu} instructions.
21380 @item -meb
21381 @opindex meb
21382 Generate big-endian code.
21384 @item -mel
21385 @opindex mel
21386 Generate little-endian code.
21388 @item -mio-volatile
21389 @opindex mio-volatile
21390 Tells the compiler that any variable marked with the @code{io}
21391 attribute is to be considered volatile.
21393 @item -ml
21394 @opindex ml
21395 Causes variables to be assigned to the @code{.far} section by default.
21397 @item -mleadz
21398 @opindex mleadz
21399 Enables the @code{leadz} (leading zero) instruction.
21401 @item -mm
21402 @opindex mm
21403 Causes variables to be assigned to the @code{.near} section by default.
21405 @item -mminmax
21406 @opindex mminmax
21407 Enables the @code{min} and @code{max} instructions.
21409 @item -mmult
21410 @opindex mmult
21411 Enables the multiplication and multiply-accumulate instructions.
21413 @item -mno-opts
21414 @opindex mno-opts
21415 Disables all the optional instructions enabled by @option{-mall-opts}.
21417 @item -mrepeat
21418 @opindex mrepeat
21419 Enables the @code{repeat} and @code{erepeat} instructions, used for
21420 low-overhead looping.
21422 @item -ms
21423 @opindex ms
21424 Causes all variables to default to the @code{.tiny} section.  Note
21425 that there is a 65536-byte limit to this section.  Accesses to these
21426 variables use the @code{%gp} base register.
21428 @item -msatur
21429 @opindex msatur
21430 Enables the saturation instructions.  Note that the compiler does not
21431 currently generate these itself, but this option is included for
21432 compatibility with other tools, like @code{as}.
21434 @item -msdram
21435 @opindex msdram
21436 Link the SDRAM-based runtime instead of the default ROM-based runtime.
21438 @item -msim
21439 @opindex msim
21440 Link the simulator run-time libraries.
21442 @item -msimnovec
21443 @opindex msimnovec
21444 Link the simulator runtime libraries, excluding built-in support
21445 for reset and exception vectors and tables.
21447 @item -mtf
21448 @opindex mtf
21449 Causes all functions to default to the @code{.far} section.  Without
21450 this option, functions default to the @code{.near} section.
21452 @item -mtiny=@var{n}
21453 @opindex mtiny=
21454 Variables that are @var{n} bytes or smaller are allocated to the
21455 @code{.tiny} section.  These variables use the @code{$gp} base
21456 register.  The default for this option is 4, but note that there's a
21457 65536-byte limit to the @code{.tiny} section.
21459 @end table
21461 @node MicroBlaze Options
21462 @subsection MicroBlaze Options
21463 @cindex MicroBlaze Options
21465 @table @gcctabopt
21467 @item -msoft-float
21468 @opindex msoft-float
21469 Use software emulation for floating point (default).
21471 @item -mhard-float
21472 @opindex mhard-float
21473 Use hardware floating-point instructions.
21475 @item -mmemcpy
21476 @opindex mmemcpy
21477 Do not optimize block moves, use @code{memcpy}.
21479 @item -mno-clearbss
21480 @opindex mno-clearbss
21481 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
21483 @item -mcpu=@var{cpu-type}
21484 @opindex mcpu=
21485 Use features of, and schedule code for, the given CPU.
21486 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
21487 where @var{X} is a major version, @var{YY} is the minor version, and
21488 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
21489 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v6.00.a}.
21491 @item -mxl-soft-mul
21492 @opindex mxl-soft-mul
21493 Use software multiply emulation (default).
21495 @item -mxl-soft-div
21496 @opindex mxl-soft-div
21497 Use software emulation for divides (default).
21499 @item -mxl-barrel-shift
21500 @opindex mxl-barrel-shift
21501 Use the hardware barrel shifter.
21503 @item -mxl-pattern-compare
21504 @opindex mxl-pattern-compare
21505 Use pattern compare instructions.
21507 @item -msmall-divides
21508 @opindex msmall-divides
21509 Use table lookup optimization for small signed integer divisions.
21511 @item -mxl-stack-check
21512 @opindex mxl-stack-check
21513 This option is deprecated.  Use @option{-fstack-check} instead.
21515 @item -mxl-gp-opt
21516 @opindex mxl-gp-opt
21517 Use GP-relative @code{.sdata}/@code{.sbss} sections.
21519 @item -mxl-multiply-high
21520 @opindex mxl-multiply-high
21521 Use multiply high instructions for high part of 32x32 multiply.
21523 @item -mxl-float-convert
21524 @opindex mxl-float-convert
21525 Use hardware floating-point conversion instructions.
21527 @item -mxl-float-sqrt
21528 @opindex mxl-float-sqrt
21529 Use hardware floating-point square root instruction.
21531 @item -mbig-endian
21532 @opindex mbig-endian
21533 Generate code for a big-endian target.
21535 @item -mlittle-endian
21536 @opindex mlittle-endian
21537 Generate code for a little-endian target.
21539 @item -mxl-reorder
21540 @opindex mxl-reorder
21541 Use reorder instructions (swap and byte reversed load/store).
21543 @item -mxl-mode-@var{app-model}
21544 Select application model @var{app-model}.  Valid models are
21545 @table @samp
21546 @item executable
21547 normal executable (default), uses startup code @file{crt0.o}.
21549 @item -mpic-data-is-text-relative
21550 @opindex mpic-data-is-text-relative
21551 Assume that the displacement between the text and data segments is fixed
21552 at static link time.  This allows data to be referenced by offset from start of
21553 text address instead of GOT since PC-relative addressing is not supported.
21555 @item xmdstub
21556 for use with Xilinx Microprocessor Debugger (XMD) based
21557 software intrusive debug agent called xmdstub. This uses startup file
21558 @file{crt1.o} and sets the start address of the program to 0x800.
21560 @item bootstrap
21561 for applications that are loaded using a bootloader.
21562 This model uses startup file @file{crt2.o} which does not contain a processor
21563 reset vector handler. This is suitable for transferring control on a
21564 processor reset to the bootloader rather than the application.
21566 @item novectors
21567 for applications that do not require any of the
21568 MicroBlaze vectors. This option may be useful for applications running
21569 within a monitoring application. This model uses @file{crt3.o} as a startup file.
21570 @end table
21572 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
21573 @option{-mxl-mode-@var{app-model}}.
21575 @end table
21577 @node MIPS Options
21578 @subsection MIPS Options
21579 @cindex MIPS options
21581 @table @gcctabopt
21583 @item -EB
21584 @opindex EB
21585 Generate big-endian code.
21587 @item -EL
21588 @opindex EL
21589 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
21590 configurations.
21592 @item -march=@var{arch}
21593 @opindex march
21594 Generate code that runs on @var{arch}, which can be the name of a
21595 generic MIPS ISA, or the name of a particular processor.
21596 The ISA names are:
21597 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
21598 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
21599 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
21600 @samp{mips64r5} and @samp{mips64r6}.
21601 The processor names are:
21602 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
21603 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
21604 @samp{5kc}, @samp{5kf},
21605 @samp{20kc},
21606 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
21607 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
21608 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
21609 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
21610 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
21611 @samp{i6400}, @samp{i6500},
21612 @samp{interaptiv},
21613 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a}, @samp{gs464},
21614 @samp{gs464e}, @samp{gs264e},
21615 @samp{m4k},
21616 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
21617 @samp{m5100}, @samp{m5101},
21618 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
21619 @samp{orion},
21620 @samp{p5600}, @samp{p6600},
21621 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
21622 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r5900},
21623 @samp{r6000}, @samp{r8000},
21624 @samp{rm7000}, @samp{rm9000},
21625 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
21626 @samp{sb1},
21627 @samp{sr71000},
21628 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
21629 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
21630 @samp{xlr} and @samp{xlp}.
21631 The special value @samp{from-abi} selects the
21632 most compatible architecture for the selected ABI (that is,
21633 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
21635 The native Linux/GNU toolchain also supports the value @samp{native},
21636 which selects the best architecture option for the host processor.
21637 @option{-march=native} has no effect if GCC does not recognize
21638 the processor.
21640 In processor names, a final @samp{000} can be abbreviated as @samp{k}
21641 (for example, @option{-march=r2k}).  Prefixes are optional, and
21642 @samp{vr} may be written @samp{r}.
21644 Names of the form @samp{@var{n}f2_1} refer to processors with
21645 FPUs clocked at half the rate of the core, names of the form
21646 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
21647 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
21648 processors with FPUs clocked a ratio of 3:2 with respect to the core.
21649 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
21650 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
21651 accepted as synonyms for @samp{@var{n}f1_1}.
21653 GCC defines two macros based on the value of this option.  The first
21654 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
21655 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
21656 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
21657 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
21658 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
21660 Note that the @code{_MIPS_ARCH} macro uses the processor names given
21661 above.  In other words, it has the full prefix and does not
21662 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
21663 the macro names the resolved architecture (either @code{"mips1"} or
21664 @code{"mips3"}).  It names the default architecture when no
21665 @option{-march} option is given.
21667 @item -mtune=@var{arch}
21668 @opindex mtune
21669 Optimize for @var{arch}.  Among other things, this option controls
21670 the way instructions are scheduled, and the perceived cost of arithmetic
21671 operations.  The list of @var{arch} values is the same as for
21672 @option{-march}.
21674 When this option is not used, GCC optimizes for the processor
21675 specified by @option{-march}.  By using @option{-march} and
21676 @option{-mtune} together, it is possible to generate code that
21677 runs on a family of processors, but optimize the code for one
21678 particular member of that family.
21680 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
21681 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
21682 @option{-march} ones described above.
21684 @item -mips1
21685 @opindex mips1
21686 Equivalent to @option{-march=mips1}.
21688 @item -mips2
21689 @opindex mips2
21690 Equivalent to @option{-march=mips2}.
21692 @item -mips3
21693 @opindex mips3
21694 Equivalent to @option{-march=mips3}.
21696 @item -mips4
21697 @opindex mips4
21698 Equivalent to @option{-march=mips4}.
21700 @item -mips32
21701 @opindex mips32
21702 Equivalent to @option{-march=mips32}.
21704 @item -mips32r3
21705 @opindex mips32r3
21706 Equivalent to @option{-march=mips32r3}.
21708 @item -mips32r5
21709 @opindex mips32r5
21710 Equivalent to @option{-march=mips32r5}.
21712 @item -mips32r6
21713 @opindex mips32r6
21714 Equivalent to @option{-march=mips32r6}.
21716 @item -mips64
21717 @opindex mips64
21718 Equivalent to @option{-march=mips64}.
21720 @item -mips64r2
21721 @opindex mips64r2
21722 Equivalent to @option{-march=mips64r2}.
21724 @item -mips64r3
21725 @opindex mips64r3
21726 Equivalent to @option{-march=mips64r3}.
21728 @item -mips64r5
21729 @opindex mips64r5
21730 Equivalent to @option{-march=mips64r5}.
21732 @item -mips64r6
21733 @opindex mips64r6
21734 Equivalent to @option{-march=mips64r6}.
21736 @item -mips16
21737 @itemx -mno-mips16
21738 @opindex mips16
21739 @opindex mno-mips16
21740 Generate (do not generate) MIPS16 code.  If GCC is targeting a
21741 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
21743 MIPS16 code generation can also be controlled on a per-function basis
21744 by means of @code{mips16} and @code{nomips16} attributes.
21745 @xref{Function Attributes}, for more information.
21747 @item -mflip-mips16
21748 @opindex mflip-mips16
21749 Generate MIPS16 code on alternating functions.  This option is provided
21750 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
21751 not intended for ordinary use in compiling user code.
21753 @item -minterlink-compressed
21754 @itemx -mno-interlink-compressed
21755 @opindex minterlink-compressed
21756 @opindex mno-interlink-compressed
21757 Require (do not require) that code using the standard (uncompressed) MIPS ISA
21758 be link-compatible with MIPS16 and microMIPS code, and vice versa.
21760 For example, code using the standard ISA encoding cannot jump directly
21761 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
21762 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
21763 knows that the target of the jump is not compressed.
21765 @item -minterlink-mips16
21766 @itemx -mno-interlink-mips16
21767 @opindex minterlink-mips16
21768 @opindex mno-interlink-mips16
21769 Aliases of @option{-minterlink-compressed} and
21770 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
21771 and are retained for backwards compatibility.
21773 @item -mabi=32
21774 @itemx -mabi=o64
21775 @itemx -mabi=n32
21776 @itemx -mabi=64
21777 @itemx -mabi=eabi
21778 @opindex mabi=32
21779 @opindex mabi=o64
21780 @opindex mabi=n32
21781 @opindex mabi=64
21782 @opindex mabi=eabi
21783 Generate code for the given ABI@.
21785 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
21786 generates 64-bit code when you select a 64-bit architecture, but you
21787 can use @option{-mgp32} to get 32-bit code instead.
21789 For information about the O64 ABI, see
21790 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
21792 GCC supports a variant of the o32 ABI in which floating-point registers
21793 are 64 rather than 32 bits wide.  You can select this combination with
21794 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
21795 and @code{mfhc1} instructions and is therefore only supported for
21796 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
21798 The register assignments for arguments and return values remain the
21799 same, but each scalar value is passed in a single 64-bit register
21800 rather than a pair of 32-bit registers.  For example, scalar
21801 floating-point values are returned in @samp{$f0} only, not a
21802 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
21803 remains the same in that the even-numbered double-precision registers
21804 are saved.
21806 Two additional variants of the o32 ABI are supported to enable
21807 a transition from 32-bit to 64-bit registers.  These are FPXX
21808 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
21809 The FPXX extension mandates that all code must execute correctly
21810 when run using 32-bit or 64-bit registers.  The code can be interlinked
21811 with either FP32 or FP64, but not both.
21812 The FP64A extension is similar to the FP64 extension but forbids the
21813 use of odd-numbered single-precision registers.  This can be used
21814 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
21815 processors and allows both FP32 and FP64A code to interlink and
21816 run in the same process without changing FPU modes.
21818 @item -mabicalls
21819 @itemx -mno-abicalls
21820 @opindex mabicalls
21821 @opindex mno-abicalls
21822 Generate (do not generate) code that is suitable for SVR4-style
21823 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
21824 systems.
21826 @item -mshared
21827 @itemx -mno-shared
21828 Generate (do not generate) code that is fully position-independent,
21829 and that can therefore be linked into shared libraries.  This option
21830 only affects @option{-mabicalls}.
21832 All @option{-mabicalls} code has traditionally been position-independent,
21833 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
21834 as an extension, the GNU toolchain allows executables to use absolute
21835 accesses for locally-binding symbols.  It can also use shorter GP
21836 initialization sequences and generate direct calls to locally-defined
21837 functions.  This mode is selected by @option{-mno-shared}.
21839 @option{-mno-shared} depends on binutils 2.16 or higher and generates
21840 objects that can only be linked by the GNU linker.  However, the option
21841 does not affect the ABI of the final executable; it only affects the ABI
21842 of relocatable objects.  Using @option{-mno-shared} generally makes
21843 executables both smaller and quicker.
21845 @option{-mshared} is the default.
21847 @item -mplt
21848 @itemx -mno-plt
21849 @opindex mplt
21850 @opindex mno-plt
21851 Assume (do not assume) that the static and dynamic linkers
21852 support PLTs and copy relocations.  This option only affects
21853 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
21854 has no effect without @option{-msym32}.
21856 You can make @option{-mplt} the default by configuring
21857 GCC with @option{--with-mips-plt}.  The default is
21858 @option{-mno-plt} otherwise.
21860 @item -mxgot
21861 @itemx -mno-xgot
21862 @opindex mxgot
21863 @opindex mno-xgot
21864 Lift (do not lift) the usual restrictions on the size of the global
21865 offset table.
21867 GCC normally uses a single instruction to load values from the GOT@.
21868 While this is relatively efficient, it only works if the GOT
21869 is smaller than about 64k.  Anything larger causes the linker
21870 to report an error such as:
21872 @cindex relocation truncated to fit (MIPS)
21873 @smallexample
21874 relocation truncated to fit: R_MIPS_GOT16 foobar
21875 @end smallexample
21877 If this happens, you should recompile your code with @option{-mxgot}.
21878 This works with very large GOTs, although the code is also
21879 less efficient, since it takes three instructions to fetch the
21880 value of a global symbol.
21882 Note that some linkers can create multiple GOTs.  If you have such a
21883 linker, you should only need to use @option{-mxgot} when a single object
21884 file accesses more than 64k's worth of GOT entries.  Very few do.
21886 These options have no effect unless GCC is generating position
21887 independent code.
21889 @item -mgp32
21890 @opindex mgp32
21891 Assume that general-purpose registers are 32 bits wide.
21893 @item -mgp64
21894 @opindex mgp64
21895 Assume that general-purpose registers are 64 bits wide.
21897 @item -mfp32
21898 @opindex mfp32
21899 Assume that floating-point registers are 32 bits wide.
21901 @item -mfp64
21902 @opindex mfp64
21903 Assume that floating-point registers are 64 bits wide.
21905 @item -mfpxx
21906 @opindex mfpxx
21907 Do not assume the width of floating-point registers.
21909 @item -mhard-float
21910 @opindex mhard-float
21911 Use floating-point coprocessor instructions.
21913 @item -msoft-float
21914 @opindex msoft-float
21915 Do not use floating-point coprocessor instructions.  Implement
21916 floating-point calculations using library calls instead.
21918 @item -mno-float
21919 @opindex mno-float
21920 Equivalent to @option{-msoft-float}, but additionally asserts that the
21921 program being compiled does not perform any floating-point operations.
21922 This option is presently supported only by some bare-metal MIPS
21923 configurations, where it may select a special set of libraries
21924 that lack all floating-point support (including, for example, the
21925 floating-point @code{printf} formats).  
21926 If code compiled with @option{-mno-float} accidentally contains
21927 floating-point operations, it is likely to suffer a link-time
21928 or run-time failure.
21930 @item -msingle-float
21931 @opindex msingle-float
21932 Assume that the floating-point coprocessor only supports single-precision
21933 operations.
21935 @item -mdouble-float
21936 @opindex mdouble-float
21937 Assume that the floating-point coprocessor supports double-precision
21938 operations.  This is the default.
21940 @item -modd-spreg
21941 @itemx -mno-odd-spreg
21942 @opindex modd-spreg
21943 @opindex mno-odd-spreg
21944 Enable the use of odd-numbered single-precision floating-point registers
21945 for the o32 ABI.  This is the default for processors that are known to
21946 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
21947 is set by default.
21949 @item -mabs=2008
21950 @itemx -mabs=legacy
21951 @opindex mabs=2008
21952 @opindex mabs=legacy
21953 These options control the treatment of the special not-a-number (NaN)
21954 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
21955 @code{neg.@i{fmt}} machine instructions.
21957 By default or when @option{-mabs=legacy} is used the legacy
21958 treatment is selected.  In this case these instructions are considered
21959 arithmetic and avoided where correct operation is required and the
21960 input operand might be a NaN.  A longer sequence of instructions that
21961 manipulate the sign bit of floating-point datum manually is used
21962 instead unless the @option{-ffinite-math-only} option has also been
21963 specified.
21965 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
21966 this case these instructions are considered non-arithmetic and therefore
21967 operating correctly in all cases, including in particular where the
21968 input operand is a NaN.  These instructions are therefore always used
21969 for the respective operations.
21971 @item -mnan=2008
21972 @itemx -mnan=legacy
21973 @opindex mnan=2008
21974 @opindex mnan=legacy
21975 These options control the encoding of the special not-a-number (NaN)
21976 IEEE 754 floating-point data.
21978 The @option{-mnan=legacy} option selects the legacy encoding.  In this
21979 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
21980 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
21981 by the first bit of their trailing significand field being 1.
21983 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
21984 this case qNaNs are denoted by the first bit of their trailing
21985 significand field being 1, whereas sNaNs are denoted by the first bit of
21986 their trailing significand field being 0.
21988 The default is @option{-mnan=legacy} unless GCC has been configured with
21989 @option{--with-nan=2008}.
21991 @item -mllsc
21992 @itemx -mno-llsc
21993 @opindex mllsc
21994 @opindex mno-llsc
21995 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
21996 implement atomic memory built-in functions.  When neither option is
21997 specified, GCC uses the instructions if the target architecture
21998 supports them.
22000 @option{-mllsc} is useful if the runtime environment can emulate the
22001 instructions and @option{-mno-llsc} can be useful when compiling for
22002 nonstandard ISAs.  You can make either option the default by
22003 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
22004 respectively.  @option{--with-llsc} is the default for some
22005 configurations; see the installation documentation for details.
22007 @item -mdsp
22008 @itemx -mno-dsp
22009 @opindex mdsp
22010 @opindex mno-dsp
22011 Use (do not use) revision 1 of the MIPS DSP ASE@.
22012 @xref{MIPS DSP Built-in Functions}.  This option defines the
22013 preprocessor macro @code{__mips_dsp}.  It also defines
22014 @code{__mips_dsp_rev} to 1.
22016 @item -mdspr2
22017 @itemx -mno-dspr2
22018 @opindex mdspr2
22019 @opindex mno-dspr2
22020 Use (do not use) revision 2 of the MIPS DSP ASE@.
22021 @xref{MIPS DSP Built-in Functions}.  This option defines the
22022 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
22023 It also defines @code{__mips_dsp_rev} to 2.
22025 @item -msmartmips
22026 @itemx -mno-smartmips
22027 @opindex msmartmips
22028 @opindex mno-smartmips
22029 Use (do not use) the MIPS SmartMIPS ASE.
22031 @item -mpaired-single
22032 @itemx -mno-paired-single
22033 @opindex mpaired-single
22034 @opindex mno-paired-single
22035 Use (do not use) paired-single floating-point instructions.
22036 @xref{MIPS Paired-Single Support}.  This option requires
22037 hardware floating-point support to be enabled.
22039 @item -mdmx
22040 @itemx -mno-mdmx
22041 @opindex mdmx
22042 @opindex mno-mdmx
22043 Use (do not use) MIPS Digital Media Extension instructions.
22044 This option can only be used when generating 64-bit code and requires
22045 hardware floating-point support to be enabled.
22047 @item -mips3d
22048 @itemx -mno-mips3d
22049 @opindex mips3d
22050 @opindex mno-mips3d
22051 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
22052 The option @option{-mips3d} implies @option{-mpaired-single}.
22054 @item -mmicromips
22055 @itemx -mno-micromips
22056 @opindex mmicromips
22057 @opindex mno-mmicromips
22058 Generate (do not generate) microMIPS code.
22060 MicroMIPS code generation can also be controlled on a per-function basis
22061 by means of @code{micromips} and @code{nomicromips} attributes.
22062 @xref{Function Attributes}, for more information.
22064 @item -mmt
22065 @itemx -mno-mt
22066 @opindex mmt
22067 @opindex mno-mt
22068 Use (do not use) MT Multithreading instructions.
22070 @item -mmcu
22071 @itemx -mno-mcu
22072 @opindex mmcu
22073 @opindex mno-mcu
22074 Use (do not use) the MIPS MCU ASE instructions.
22076 @item -meva
22077 @itemx -mno-eva
22078 @opindex meva
22079 @opindex mno-eva
22080 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
22082 @item -mvirt
22083 @itemx -mno-virt
22084 @opindex mvirt
22085 @opindex mno-virt
22086 Use (do not use) the MIPS Virtualization (VZ) instructions.
22088 @item -mxpa
22089 @itemx -mno-xpa
22090 @opindex mxpa
22091 @opindex mno-xpa
22092 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
22094 @item -mcrc
22095 @itemx -mno-crc
22096 @opindex mcrc
22097 @opindex mno-crc
22098 Use (do not use) the MIPS Cyclic Redundancy Check (CRC) instructions.
22100 @item -mginv
22101 @itemx -mno-ginv
22102 @opindex mginv
22103 @opindex mno-ginv
22104 Use (do not use) the MIPS Global INValidate (GINV) instructions.
22106 @item -mloongson-mmi
22107 @itemx -mno-loongson-mmi
22108 @opindex mloongson-mmi
22109 @opindex mno-loongson-mmi
22110 Use (do not use) the MIPS Loongson MultiMedia extensions Instructions (MMI).
22112 @item -mloongson-ext
22113 @itemx -mno-loongson-ext
22114 @opindex mloongson-ext
22115 @opindex mno-loongson-ext
22116 Use (do not use) the MIPS Loongson EXTensions (EXT) instructions.
22118 @item -mloongson-ext2
22119 @itemx -mno-loongson-ext2
22120 @opindex mloongson-ext2
22121 @opindex mno-loongson-ext2
22122 Use (do not use) the MIPS Loongson EXTensions r2 (EXT2) instructions.
22124 @item -mlong64
22125 @opindex mlong64
22126 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
22127 an explanation of the default and the way that the pointer size is
22128 determined.
22130 @item -mlong32
22131 @opindex mlong32
22132 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
22134 The default size of @code{int}s, @code{long}s and pointers depends on
22135 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
22136 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
22137 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
22138 or the same size as integer registers, whichever is smaller.
22140 @item -msym32
22141 @itemx -mno-sym32
22142 @opindex msym32
22143 @opindex mno-sym32
22144 Assume (do not assume) that all symbols have 32-bit values, regardless
22145 of the selected ABI@.  This option is useful in combination with
22146 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
22147 to generate shorter and faster references to symbolic addresses.
22149 @item -G @var{num}
22150 @opindex G
22151 Put definitions of externally-visible data in a small data section
22152 if that data is no bigger than @var{num} bytes.  GCC can then generate
22153 more efficient accesses to the data; see @option{-mgpopt} for details.
22155 The default @option{-G} option depends on the configuration.
22157 @item -mlocal-sdata
22158 @itemx -mno-local-sdata
22159 @opindex mlocal-sdata
22160 @opindex mno-local-sdata
22161 Extend (do not extend) the @option{-G} behavior to local data too,
22162 such as to static variables in C@.  @option{-mlocal-sdata} is the
22163 default for all configurations.
22165 If the linker complains that an application is using too much small data,
22166 you might want to try rebuilding the less performance-critical parts with
22167 @option{-mno-local-sdata}.  You might also want to build large
22168 libraries with @option{-mno-local-sdata}, so that the libraries leave
22169 more room for the main program.
22171 @item -mextern-sdata
22172 @itemx -mno-extern-sdata
22173 @opindex mextern-sdata
22174 @opindex mno-extern-sdata
22175 Assume (do not assume) that externally-defined data is in
22176 a small data section if the size of that data is within the @option{-G} limit.
22177 @option{-mextern-sdata} is the default for all configurations.
22179 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
22180 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
22181 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
22182 is placed in a small data section.  If @var{Var} is defined by another
22183 module, you must either compile that module with a high-enough
22184 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
22185 definition.  If @var{Var} is common, you must link the application
22186 with a high-enough @option{-G} setting.
22188 The easiest way of satisfying these restrictions is to compile
22189 and link every module with the same @option{-G} option.  However,
22190 you may wish to build a library that supports several different
22191 small data limits.  You can do this by compiling the library with
22192 the highest supported @option{-G} setting and additionally using
22193 @option{-mno-extern-sdata} to stop the library from making assumptions
22194 about externally-defined data.
22196 @item -mgpopt
22197 @itemx -mno-gpopt
22198 @opindex mgpopt
22199 @opindex mno-gpopt
22200 Use (do not use) GP-relative accesses for symbols that are known to be
22201 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
22202 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
22203 configurations.
22205 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
22206 might not hold the value of @code{_gp}.  For example, if the code is
22207 part of a library that might be used in a boot monitor, programs that
22208 call boot monitor routines pass an unknown value in @code{$gp}.
22209 (In such situations, the boot monitor itself is usually compiled
22210 with @option{-G0}.)
22212 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
22213 @option{-mno-extern-sdata}.
22215 @item -membedded-data
22216 @itemx -mno-embedded-data
22217 @opindex membedded-data
22218 @opindex mno-embedded-data
22219 Allocate variables to the read-only data section first if possible, then
22220 next in the small data section if possible, otherwise in data.  This gives
22221 slightly slower code than the default, but reduces the amount of RAM required
22222 when executing, and thus may be preferred for some embedded systems.
22224 @item -muninit-const-in-rodata
22225 @itemx -mno-uninit-const-in-rodata
22226 @opindex muninit-const-in-rodata
22227 @opindex mno-uninit-const-in-rodata
22228 Put uninitialized @code{const} variables in the read-only data section.
22229 This option is only meaningful in conjunction with @option{-membedded-data}.
22231 @item -mcode-readable=@var{setting}
22232 @opindex mcode-readable
22233 Specify whether GCC may generate code that reads from executable sections.
22234 There are three possible settings:
22236 @table @gcctabopt
22237 @item -mcode-readable=yes
22238 Instructions may freely access executable sections.  This is the
22239 default setting.
22241 @item -mcode-readable=pcrel
22242 MIPS16 PC-relative load instructions can access executable sections,
22243 but other instructions must not do so.  This option is useful on 4KSc
22244 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
22245 It is also useful on processors that can be configured to have a dual
22246 instruction/data SRAM interface and that, like the M4K, automatically
22247 redirect PC-relative loads to the instruction RAM.
22249 @item -mcode-readable=no
22250 Instructions must not access executable sections.  This option can be
22251 useful on targets that are configured to have a dual instruction/data
22252 SRAM interface but that (unlike the M4K) do not automatically redirect
22253 PC-relative loads to the instruction RAM.
22254 @end table
22256 @item -msplit-addresses
22257 @itemx -mno-split-addresses
22258 @opindex msplit-addresses
22259 @opindex mno-split-addresses
22260 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
22261 relocation operators.  This option has been superseded by
22262 @option{-mexplicit-relocs} but is retained for backwards compatibility.
22264 @item -mexplicit-relocs
22265 @itemx -mno-explicit-relocs
22266 @opindex mexplicit-relocs
22267 @opindex mno-explicit-relocs
22268 Use (do not use) assembler relocation operators when dealing with symbolic
22269 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
22270 is to use assembler macros instead.
22272 @option{-mexplicit-relocs} is the default if GCC was configured
22273 to use an assembler that supports relocation operators.
22275 @item -mcheck-zero-division
22276 @itemx -mno-check-zero-division
22277 @opindex mcheck-zero-division
22278 @opindex mno-check-zero-division
22279 Trap (do not trap) on integer division by zero.
22281 The default is @option{-mcheck-zero-division}.
22283 @item -mdivide-traps
22284 @itemx -mdivide-breaks
22285 @opindex mdivide-traps
22286 @opindex mdivide-breaks
22287 MIPS systems check for division by zero by generating either a
22288 conditional trap or a break instruction.  Using traps results in
22289 smaller code, but is only supported on MIPS II and later.  Also, some
22290 versions of the Linux kernel have a bug that prevents trap from
22291 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
22292 allow conditional traps on architectures that support them and
22293 @option{-mdivide-breaks} to force the use of breaks.
22295 The default is usually @option{-mdivide-traps}, but this can be
22296 overridden at configure time using @option{--with-divide=breaks}.
22297 Divide-by-zero checks can be completely disabled using
22298 @option{-mno-check-zero-division}.
22300 @item -mload-store-pairs
22301 @itemx -mno-load-store-pairs
22302 @opindex mload-store-pairs
22303 @opindex mno-load-store-pairs
22304 Enable (disable) an optimization that pairs consecutive load or store
22305 instructions to enable load/store bonding.  This option is enabled by
22306 default but only takes effect when the selected architecture is known
22307 to support bonding.
22309 @item -mmemcpy
22310 @itemx -mno-memcpy
22311 @opindex mmemcpy
22312 @opindex mno-memcpy
22313 Force (do not force) the use of @code{memcpy} for non-trivial block
22314 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
22315 most constant-sized copies.
22317 @item -mlong-calls
22318 @itemx -mno-long-calls
22319 @opindex mlong-calls
22320 @opindex mno-long-calls
22321 Disable (do not disable) use of the @code{jal} instruction.  Calling
22322 functions using @code{jal} is more efficient but requires the caller
22323 and callee to be in the same 256 megabyte segment.
22325 This option has no effect on abicalls code.  The default is
22326 @option{-mno-long-calls}.
22328 @item -mmad
22329 @itemx -mno-mad
22330 @opindex mmad
22331 @opindex mno-mad
22332 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
22333 instructions, as provided by the R4650 ISA@.
22335 @item -mimadd
22336 @itemx -mno-imadd
22337 @opindex mimadd
22338 @opindex mno-imadd
22339 Enable (disable) use of the @code{madd} and @code{msub} integer
22340 instructions.  The default is @option{-mimadd} on architectures
22341 that support @code{madd} and @code{msub} except for the 74k 
22342 architecture where it was found to generate slower code.
22344 @item -mfused-madd
22345 @itemx -mno-fused-madd
22346 @opindex mfused-madd
22347 @opindex mno-fused-madd
22348 Enable (disable) use of the floating-point multiply-accumulate
22349 instructions, when they are available.  The default is
22350 @option{-mfused-madd}.
22352 On the R8000 CPU when multiply-accumulate instructions are used,
22353 the intermediate product is calculated to infinite precision
22354 and is not subject to the FCSR Flush to Zero bit.  This may be
22355 undesirable in some circumstances.  On other processors the result
22356 is numerically identical to the equivalent computation using
22357 separate multiply, add, subtract and negate instructions.
22359 @item -nocpp
22360 @opindex nocpp
22361 Tell the MIPS assembler to not run its preprocessor over user
22362 assembler files (with a @samp{.s} suffix) when assembling them.
22364 @item -mfix-24k
22365 @itemx -mno-fix-24k
22366 @opindex mfix-24k
22367 @opindex mno-fix-24k
22368 Work around the 24K E48 (lost data on stores during refill) errata.
22369 The workarounds are implemented by the assembler rather than by GCC@.
22371 @item -mfix-r4000
22372 @itemx -mno-fix-r4000
22373 @opindex mfix-r4000
22374 @opindex mno-fix-r4000
22375 Work around certain R4000 CPU errata:
22376 @itemize @minus
22377 @item
22378 A double-word or a variable shift may give an incorrect result if executed
22379 immediately after starting an integer division.
22380 @item
22381 A double-word or a variable shift may give an incorrect result if executed
22382 while an integer multiplication is in progress.
22383 @item
22384 An integer division may give an incorrect result if started in a delay slot
22385 of a taken branch or a jump.
22386 @end itemize
22388 @item -mfix-r4400
22389 @itemx -mno-fix-r4400
22390 @opindex mfix-r4400
22391 @opindex mno-fix-r4400
22392 Work around certain R4400 CPU errata:
22393 @itemize @minus
22394 @item
22395 A double-word or a variable shift may give an incorrect result if executed
22396 immediately after starting an integer division.
22397 @end itemize
22399 @item -mfix-r10000
22400 @itemx -mno-fix-r10000
22401 @opindex mfix-r10000
22402 @opindex mno-fix-r10000
22403 Work around certain R10000 errata:
22404 @itemize @minus
22405 @item
22406 @code{ll}/@code{sc} sequences may not behave atomically on revisions
22407 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
22408 @end itemize
22410 This option can only be used if the target architecture supports
22411 branch-likely instructions.  @option{-mfix-r10000} is the default when
22412 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
22413 otherwise.
22415 @item -mfix-r5900
22416 @itemx -mno-fix-r5900
22417 @opindex mfix-r5900
22418 Do not attempt to schedule the preceding instruction into the delay slot
22419 of a branch instruction placed at the end of a short loop of six
22420 instructions or fewer and always schedule a @code{nop} instruction there
22421 instead.  The short loop bug under certain conditions causes loops to
22422 execute only once or twice, due to a hardware bug in the R5900 chip.  The
22423 workaround is implemented by the assembler rather than by GCC@.
22425 @item -mfix-rm7000
22426 @itemx -mno-fix-rm7000
22427 @opindex mfix-rm7000
22428 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
22429 workarounds are implemented by the assembler rather than by GCC@.
22431 @item -mfix-vr4120
22432 @itemx -mno-fix-vr4120
22433 @opindex mfix-vr4120
22434 Work around certain VR4120 errata:
22435 @itemize @minus
22436 @item
22437 @code{dmultu} does not always produce the correct result.
22438 @item
22439 @code{div} and @code{ddiv} do not always produce the correct result if one
22440 of the operands is negative.
22441 @end itemize
22442 The workarounds for the division errata rely on special functions in
22443 @file{libgcc.a}.  At present, these functions are only provided by
22444 the @code{mips64vr*-elf} configurations.
22446 Other VR4120 errata require a NOP to be inserted between certain pairs of
22447 instructions.  These errata are handled by the assembler, not by GCC itself.
22449 @item -mfix-vr4130
22450 @opindex mfix-vr4130
22451 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
22452 workarounds are implemented by the assembler rather than by GCC,
22453 although GCC avoids using @code{mflo} and @code{mfhi} if the
22454 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
22455 instructions are available instead.
22457 @item -mfix-sb1
22458 @itemx -mno-fix-sb1
22459 @opindex mfix-sb1
22460 Work around certain SB-1 CPU core errata.
22461 (This flag currently works around the SB-1 revision 2
22462 ``F1'' and ``F2'' floating-point errata.)
22464 @item -mr10k-cache-barrier=@var{setting}
22465 @opindex mr10k-cache-barrier
22466 Specify whether GCC should insert cache barriers to avoid the
22467 side effects of speculation on R10K processors.
22469 In common with many processors, the R10K tries to predict the outcome
22470 of a conditional branch and speculatively executes instructions from
22471 the ``taken'' branch.  It later aborts these instructions if the
22472 predicted outcome is wrong.  However, on the R10K, even aborted
22473 instructions can have side effects.
22475 This problem only affects kernel stores and, depending on the system,
22476 kernel loads.  As an example, a speculatively-executed store may load
22477 the target memory into cache and mark the cache line as dirty, even if
22478 the store itself is later aborted.  If a DMA operation writes to the
22479 same area of memory before the ``dirty'' line is flushed, the cached
22480 data overwrites the DMA-ed data.  See the R10K processor manual
22481 for a full description, including other potential problems.
22483 One workaround is to insert cache barrier instructions before every memory
22484 access that might be speculatively executed and that might have side
22485 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
22486 controls GCC's implementation of this workaround.  It assumes that
22487 aborted accesses to any byte in the following regions does not have
22488 side effects:
22490 @enumerate
22491 @item
22492 the memory occupied by the current function's stack frame;
22494 @item
22495 the memory occupied by an incoming stack argument;
22497 @item
22498 the memory occupied by an object with a link-time-constant address.
22499 @end enumerate
22501 It is the kernel's responsibility to ensure that speculative
22502 accesses to these regions are indeed safe.
22504 If the input program contains a function declaration such as:
22506 @smallexample
22507 void foo (void);
22508 @end smallexample
22510 then the implementation of @code{foo} must allow @code{j foo} and
22511 @code{jal foo} to be executed speculatively.  GCC honors this
22512 restriction for functions it compiles itself.  It expects non-GCC
22513 functions (such as hand-written assembly code) to do the same.
22515 The option has three forms:
22517 @table @gcctabopt
22518 @item -mr10k-cache-barrier=load-store
22519 Insert a cache barrier before a load or store that might be
22520 speculatively executed and that might have side effects even
22521 if aborted.
22523 @item -mr10k-cache-barrier=store
22524 Insert a cache barrier before a store that might be speculatively
22525 executed and that might have side effects even if aborted.
22527 @item -mr10k-cache-barrier=none
22528 Disable the insertion of cache barriers.  This is the default setting.
22529 @end table
22531 @item -mflush-func=@var{func}
22532 @itemx -mno-flush-func
22533 @opindex mflush-func
22534 Specifies the function to call to flush the I and D caches, or to not
22535 call any such function.  If called, the function must take the same
22536 arguments as the common @code{_flush_func}, that is, the address of the
22537 memory range for which the cache is being flushed, the size of the
22538 memory range, and the number 3 (to flush both caches).  The default
22539 depends on the target GCC was configured for, but commonly is either
22540 @code{_flush_func} or @code{__cpu_flush}.
22542 @item mbranch-cost=@var{num}
22543 @opindex mbranch-cost
22544 Set the cost of branches to roughly @var{num} ``simple'' instructions.
22545 This cost is only a heuristic and is not guaranteed to produce
22546 consistent results across releases.  A zero cost redundantly selects
22547 the default, which is based on the @option{-mtune} setting.
22549 @item -mbranch-likely
22550 @itemx -mno-branch-likely
22551 @opindex mbranch-likely
22552 @opindex mno-branch-likely
22553 Enable or disable use of Branch Likely instructions, regardless of the
22554 default for the selected architecture.  By default, Branch Likely
22555 instructions may be generated if they are supported by the selected
22556 architecture.  An exception is for the MIPS32 and MIPS64 architectures
22557 and processors that implement those architectures; for those, Branch
22558 Likely instructions are not be generated by default because the MIPS32
22559 and MIPS64 architectures specifically deprecate their use.
22561 @item -mcompact-branches=never
22562 @itemx -mcompact-branches=optimal
22563 @itemx -mcompact-branches=always
22564 @opindex mcompact-branches=never
22565 @opindex mcompact-branches=optimal
22566 @opindex mcompact-branches=always
22567 These options control which form of branches will be generated.  The
22568 default is @option{-mcompact-branches=optimal}.
22570 The @option{-mcompact-branches=never} option ensures that compact branch
22571 instructions will never be generated.
22573 The @option{-mcompact-branches=always} option ensures that a compact
22574 branch instruction will be generated if available.  If a compact branch
22575 instruction is not available, a delay slot form of the branch will be
22576 used instead.
22578 This option is supported from MIPS Release 6 onwards.
22580 The @option{-mcompact-branches=optimal} option will cause a delay slot
22581 branch to be used if one is available in the current ISA and the delay
22582 slot is successfully filled.  If the delay slot is not filled, a compact
22583 branch will be chosen if one is available.
22585 @item -mfp-exceptions
22586 @itemx -mno-fp-exceptions
22587 @opindex mfp-exceptions
22588 Specifies whether FP exceptions are enabled.  This affects how
22589 FP instructions are scheduled for some processors.
22590 The default is that FP exceptions are
22591 enabled.
22593 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
22594 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
22595 FP pipe.
22597 @item -mvr4130-align
22598 @itemx -mno-vr4130-align
22599 @opindex mvr4130-align
22600 The VR4130 pipeline is two-way superscalar, but can only issue two
22601 instructions together if the first one is 8-byte aligned.  When this
22602 option is enabled, GCC aligns pairs of instructions that it
22603 thinks should execute in parallel.
22605 This option only has an effect when optimizing for the VR4130.
22606 It normally makes code faster, but at the expense of making it bigger.
22607 It is enabled by default at optimization level @option{-O3}.
22609 @item -msynci
22610 @itemx -mno-synci
22611 @opindex msynci
22612 Enable (disable) generation of @code{synci} instructions on
22613 architectures that support it.  The @code{synci} instructions (if
22614 enabled) are generated when @code{__builtin___clear_cache} is
22615 compiled.
22617 This option defaults to @option{-mno-synci}, but the default can be
22618 overridden by configuring GCC with @option{--with-synci}.
22620 When compiling code for single processor systems, it is generally safe
22621 to use @code{synci}.  However, on many multi-core (SMP) systems, it
22622 does not invalidate the instruction caches on all cores and may lead
22623 to undefined behavior.
22625 @item -mrelax-pic-calls
22626 @itemx -mno-relax-pic-calls
22627 @opindex mrelax-pic-calls
22628 Try to turn PIC calls that are normally dispatched via register
22629 @code{$25} into direct calls.  This is only possible if the linker can
22630 resolve the destination at link time and if the destination is within
22631 range for a direct call.
22633 @option{-mrelax-pic-calls} is the default if GCC was configured to use
22634 an assembler and a linker that support the @code{.reloc} assembly
22635 directive and @option{-mexplicit-relocs} is in effect.  With
22636 @option{-mno-explicit-relocs}, this optimization can be performed by the
22637 assembler and the linker alone without help from the compiler.
22639 @item -mmcount-ra-address
22640 @itemx -mno-mcount-ra-address
22641 @opindex mmcount-ra-address
22642 @opindex mno-mcount-ra-address
22643 Emit (do not emit) code that allows @code{_mcount} to modify the
22644 calling function's return address.  When enabled, this option extends
22645 the usual @code{_mcount} interface with a new @var{ra-address}
22646 parameter, which has type @code{intptr_t *} and is passed in register
22647 @code{$12}.  @code{_mcount} can then modify the return address by
22648 doing both of the following:
22649 @itemize
22650 @item
22651 Returning the new address in register @code{$31}.
22652 @item
22653 Storing the new address in @code{*@var{ra-address}},
22654 if @var{ra-address} is nonnull.
22655 @end itemize
22657 The default is @option{-mno-mcount-ra-address}.
22659 @item -mframe-header-opt
22660 @itemx -mno-frame-header-opt
22661 @opindex mframe-header-opt
22662 Enable (disable) frame header optimization in the o32 ABI.  When using the
22663 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
22664 function to write out register arguments.  When enabled, this optimization
22665 will suppress the allocation of the frame header if it can be determined that
22666 it is unused.
22668 This optimization is off by default at all optimization levels.
22670 @item -mlxc1-sxc1
22671 @itemx -mno-lxc1-sxc1
22672 @opindex mlxc1-sxc1
22673 When applicable, enable (disable) the generation of @code{lwxc1},
22674 @code{swxc1}, @code{ldxc1}, @code{sdxc1} instructions.  Enabled by default.
22676 @item -mmadd4
22677 @itemx -mno-madd4
22678 @opindex mmadd4
22679 When applicable, enable (disable) the generation of 4-operand @code{madd.s},
22680 @code{madd.d} and related instructions.  Enabled by default.
22682 @end table
22684 @node MMIX Options
22685 @subsection MMIX Options
22686 @cindex MMIX Options
22688 These options are defined for the MMIX:
22690 @table @gcctabopt
22691 @item -mlibfuncs
22692 @itemx -mno-libfuncs
22693 @opindex mlibfuncs
22694 @opindex mno-libfuncs
22695 Specify that intrinsic library functions are being compiled, passing all
22696 values in registers, no matter the size.
22698 @item -mepsilon
22699 @itemx -mno-epsilon
22700 @opindex mepsilon
22701 @opindex mno-epsilon
22702 Generate floating-point comparison instructions that compare with respect
22703 to the @code{rE} epsilon register.
22705 @item -mabi=mmixware
22706 @itemx -mabi=gnu
22707 @opindex mabi=mmixware
22708 @opindex mabi=gnu
22709 Generate code that passes function parameters and return values that (in
22710 the called function) are seen as registers @code{$0} and up, as opposed to
22711 the GNU ABI which uses global registers @code{$231} and up.
22713 @item -mzero-extend
22714 @itemx -mno-zero-extend
22715 @opindex mzero-extend
22716 @opindex mno-zero-extend
22717 When reading data from memory in sizes shorter than 64 bits, use (do not
22718 use) zero-extending load instructions by default, rather than
22719 sign-extending ones.
22721 @item -mknuthdiv
22722 @itemx -mno-knuthdiv
22723 @opindex mknuthdiv
22724 @opindex mno-knuthdiv
22725 Make the result of a division yielding a remainder have the same sign as
22726 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
22727 remainder follows the sign of the dividend.  Both methods are
22728 arithmetically valid, the latter being almost exclusively used.
22730 @item -mtoplevel-symbols
22731 @itemx -mno-toplevel-symbols
22732 @opindex mtoplevel-symbols
22733 @opindex mno-toplevel-symbols
22734 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
22735 code can be used with the @code{PREFIX} assembly directive.
22737 @item -melf
22738 @opindex melf
22739 Generate an executable in the ELF format, rather than the default
22740 @samp{mmo} format used by the @command{mmix} simulator.
22742 @item -mbranch-predict
22743 @itemx -mno-branch-predict
22744 @opindex mbranch-predict
22745 @opindex mno-branch-predict
22746 Use (do not use) the probable-branch instructions, when static branch
22747 prediction indicates a probable branch.
22749 @item -mbase-addresses
22750 @itemx -mno-base-addresses
22751 @opindex mbase-addresses
22752 @opindex mno-base-addresses
22753 Generate (do not generate) code that uses @emph{base addresses}.  Using a
22754 base address automatically generates a request (handled by the assembler
22755 and the linker) for a constant to be set up in a global register.  The
22756 register is used for one or more base address requests within the range 0
22757 to 255 from the value held in the register.  The generally leads to short
22758 and fast code, but the number of different data items that can be
22759 addressed is limited.  This means that a program that uses lots of static
22760 data may require @option{-mno-base-addresses}.
22762 @item -msingle-exit
22763 @itemx -mno-single-exit
22764 @opindex msingle-exit
22765 @opindex mno-single-exit
22766 Force (do not force) generated code to have a single exit point in each
22767 function.
22768 @end table
22770 @node MN10300 Options
22771 @subsection MN10300 Options
22772 @cindex MN10300 options
22774 These @option{-m} options are defined for Matsushita MN10300 architectures:
22776 @table @gcctabopt
22777 @item -mmult-bug
22778 @opindex mmult-bug
22779 Generate code to avoid bugs in the multiply instructions for the MN10300
22780 processors.  This is the default.
22782 @item -mno-mult-bug
22783 @opindex mno-mult-bug
22784 Do not generate code to avoid bugs in the multiply instructions for the
22785 MN10300 processors.
22787 @item -mam33
22788 @opindex mam33
22789 Generate code using features specific to the AM33 processor.
22791 @item -mno-am33
22792 @opindex mno-am33
22793 Do not generate code using features specific to the AM33 processor.  This
22794 is the default.
22796 @item -mam33-2
22797 @opindex mam33-2
22798 Generate code using features specific to the AM33/2.0 processor.
22800 @item -mam34
22801 @opindex mam34
22802 Generate code using features specific to the AM34 processor.
22804 @item -mtune=@var{cpu-type}
22805 @opindex mtune
22806 Use the timing characteristics of the indicated CPU type when
22807 scheduling instructions.  This does not change the targeted processor
22808 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
22809 @samp{am33-2} or @samp{am34}.
22811 @item -mreturn-pointer-on-d0
22812 @opindex mreturn-pointer-on-d0
22813 When generating a function that returns a pointer, return the pointer
22814 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
22815 only in @code{a0}, and attempts to call such functions without a prototype
22816 result in errors.  Note that this option is on by default; use
22817 @option{-mno-return-pointer-on-d0} to disable it.
22819 @item -mno-crt0
22820 @opindex mno-crt0
22821 Do not link in the C run-time initialization object file.
22823 @item -mrelax
22824 @opindex mrelax
22825 Indicate to the linker that it should perform a relaxation optimization pass
22826 to shorten branches, calls and absolute memory addresses.  This option only
22827 has an effect when used on the command line for the final link step.
22829 This option makes symbolic debugging impossible.
22831 @item -mliw
22832 @opindex mliw
22833 Allow the compiler to generate @emph{Long Instruction Word}
22834 instructions if the target is the @samp{AM33} or later.  This is the
22835 default.  This option defines the preprocessor macro @code{__LIW__}.
22837 @item -mno-liw
22838 @opindex mno-liw
22839 Do not allow the compiler to generate @emph{Long Instruction Word}
22840 instructions.  This option defines the preprocessor macro
22841 @code{__NO_LIW__}.
22843 @item -msetlb
22844 @opindex msetlb
22845 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
22846 instructions if the target is the @samp{AM33} or later.  This is the
22847 default.  This option defines the preprocessor macro @code{__SETLB__}.
22849 @item -mno-setlb
22850 @opindex mno-setlb
22851 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
22852 instructions.  This option defines the preprocessor macro
22853 @code{__NO_SETLB__}.
22855 @end table
22857 @node Moxie Options
22858 @subsection Moxie Options
22859 @cindex Moxie Options
22861 @table @gcctabopt
22863 @item -meb
22864 @opindex meb
22865 Generate big-endian code.  This is the default for @samp{moxie-*-*}
22866 configurations.
22868 @item -mel
22869 @opindex mel
22870 Generate little-endian code.
22872 @item -mmul.x
22873 @opindex mmul.x
22874 Generate mul.x and umul.x instructions.  This is the default for
22875 @samp{moxiebox-*-*} configurations.
22877 @item -mno-crt0
22878 @opindex mno-crt0
22879 Do not link in the C run-time initialization object file.
22881 @end table
22883 @node MSP430 Options
22884 @subsection MSP430 Options
22885 @cindex MSP430 Options
22887 These options are defined for the MSP430:
22889 @table @gcctabopt
22891 @item -masm-hex
22892 @opindex masm-hex
22893 Force assembly output to always use hex constants.  Normally such
22894 constants are signed decimals, but this option is available for
22895 testsuite and/or aesthetic purposes.
22897 @item -mmcu=
22898 @opindex mmcu=
22899 Select the MCU to target.  This is used to create a C preprocessor
22900 symbol based upon the MCU name, converted to upper case and pre- and
22901 post-fixed with @samp{__}.  This in turn is used by the
22902 @file{msp430.h} header file to select an MCU-specific supplementary
22903 header file.
22905 The option also sets the ISA to use.  If the MCU name is one that is
22906 known to only support the 430 ISA then that is selected, otherwise the
22907 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
22908 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
22909 name selects the 430X ISA.
22911 In addition an MCU-specific linker script is added to the linker
22912 command line.  The script's name is the name of the MCU with
22913 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
22914 command line defines the C preprocessor symbol @code{__XXX__} and
22915 cause the linker to search for a script called @file{xxx.ld}.
22917 This option is also passed on to the assembler.
22919 @item -mwarn-mcu
22920 @itemx -mno-warn-mcu
22921 @opindex mwarn-mcu
22922 @opindex mno-warn-mcu
22923 This option enables or disables warnings about conflicts between the
22924 MCU name specified by the @option{-mmcu} option and the ISA set by the
22925 @option{-mcpu} option and/or the hardware multiply support set by the
22926 @option{-mhwmult} option.  It also toggles warnings about unrecognized
22927 MCU names.  This option is on by default.
22929 @item -mcpu=
22930 @opindex mcpu=
22931 Specifies the ISA to use.  Accepted values are @samp{msp430},
22932 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
22933 @option{-mmcu=} option should be used to select the ISA.
22935 @item -msim
22936 @opindex msim
22937 Link to the simulator runtime libraries and linker script.  Overrides
22938 any scripts that would be selected by the @option{-mmcu=} option.
22940 @item -mlarge
22941 @opindex mlarge
22942 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
22944 @item -msmall
22945 @opindex msmall
22946 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
22948 @item -mrelax
22949 @opindex mrelax
22950 This option is passed to the assembler and linker, and allows the
22951 linker to perform certain optimizations that cannot be done until
22952 the final link.
22954 @item mhwmult=
22955 @opindex mhwmult=
22956 Describes the type of hardware multiply supported by the target.
22957 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
22958 for the original 16-bit-only multiply supported by early MCUs.
22959 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
22960 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
22961 A value of @samp{auto} can also be given.  This tells GCC to deduce
22962 the hardware multiply support based upon the MCU name provided by the
22963 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
22964 the MCU name is not recognized then no hardware multiply support is
22965 assumed.  @code{auto} is the default setting.
22967 Hardware multiplies are normally performed by calling a library
22968 routine.  This saves space in the generated code.  When compiling at
22969 @option{-O3} or higher however the hardware multiplier is invoked
22970 inline.  This makes for bigger, but faster code.
22972 The hardware multiply routines disable interrupts whilst running and
22973 restore the previous interrupt state when they finish.  This makes
22974 them safe to use inside interrupt handlers as well as in normal code.
22976 @item -minrt
22977 @opindex minrt
22978 Enable the use of a minimum runtime environment - no static
22979 initializers or constructors.  This is intended for memory-constrained
22980 devices.  The compiler includes special symbols in some objects
22981 that tell the linker and runtime which code fragments are required.
22983 @item -mcode-region=
22984 @itemx -mdata-region=
22985 @opindex mcode-region
22986 @opindex mdata-region
22987 These options tell the compiler where to place functions and data that
22988 do not have one of the @code{lower}, @code{upper}, @code{either} or
22989 @code{section} attributes.  Possible values are @code{lower},
22990 @code{upper}, @code{either} or @code{any}.  The first three behave
22991 like the corresponding attribute.  The fourth possible value -
22992 @code{any} - is the default.  It leaves placement entirely up to the
22993 linker script and how it assigns the standard sections
22994 (@code{.text}, @code{.data}, etc) to the memory regions.
22996 @item -msilicon-errata=
22997 @opindex msilicon-errata
22998 This option passes on a request to assembler to enable the fixes for
22999 the named silicon errata.
23001 @item -msilicon-errata-warn=
23002 @opindex msilicon-errata-warn
23003 This option passes on a request to the assembler to enable warning
23004 messages when a silicon errata might need to be applied.
23006 @end table
23008 @node NDS32 Options
23009 @subsection NDS32 Options
23010 @cindex NDS32 Options
23012 These options are defined for NDS32 implementations:
23014 @table @gcctabopt
23016 @item -mbig-endian
23017 @opindex mbig-endian
23018 Generate code in big-endian mode.
23020 @item -mlittle-endian
23021 @opindex mlittle-endian
23022 Generate code in little-endian mode.
23024 @item -mreduced-regs
23025 @opindex mreduced-regs
23026 Use reduced-set registers for register allocation.
23028 @item -mfull-regs
23029 @opindex mfull-regs
23030 Use full-set registers for register allocation.
23032 @item -mcmov
23033 @opindex mcmov
23034 Generate conditional move instructions.
23036 @item -mno-cmov
23037 @opindex mno-cmov
23038 Do not generate conditional move instructions.
23040 @item -mext-perf
23041 @opindex mext-perf
23042 Generate performance extension instructions.
23044 @item -mno-ext-perf
23045 @opindex mno-ext-perf
23046 Do not generate performance extension instructions.
23048 @item -mext-perf2
23049 @opindex mext-perf2
23050 Generate performance extension 2 instructions.
23052 @item -mno-ext-perf2
23053 @opindex mno-ext-perf2
23054 Do not generate performance extension 2 instructions.
23056 @item -mext-string
23057 @opindex mext-string
23058 Generate string extension instructions.
23060 @item -mno-ext-string
23061 @opindex mno-ext-string
23062 Do not generate string extension instructions.
23064 @item -mv3push
23065 @opindex mv3push
23066 Generate v3 push25/pop25 instructions.
23068 @item -mno-v3push
23069 @opindex mno-v3push
23070 Do not generate v3 push25/pop25 instructions.
23072 @item -m16-bit
23073 @opindex m16-bit
23074 Generate 16-bit instructions.
23076 @item -mno-16-bit
23077 @opindex mno-16-bit
23078 Do not generate 16-bit instructions.
23080 @item -misr-vector-size=@var{num}
23081 @opindex misr-vector-size
23082 Specify the size of each interrupt vector, which must be 4 or 16.
23084 @item -mcache-block-size=@var{num}
23085 @opindex mcache-block-size
23086 Specify the size of each cache block,
23087 which must be a power of 2 between 4 and 512.
23089 @item -march=@var{arch}
23090 @opindex march
23091 Specify the name of the target architecture.
23093 @item -mcmodel=@var{code-model}
23094 @opindex mcmodel
23095 Set the code model to one of
23096 @table @asis
23097 @item @samp{small}
23098 All the data and read-only data segments must be within 512KB addressing space.
23099 The text segment must be within 16MB addressing space.
23100 @item @samp{medium}
23101 The data segment must be within 512KB while the read-only data segment can be
23102 within 4GB addressing space.  The text segment should be still within 16MB
23103 addressing space.
23104 @item @samp{large}
23105 All the text and data segments can be within 4GB addressing space.
23106 @end table
23108 @item -mctor-dtor
23109 @opindex mctor-dtor
23110 Enable constructor/destructor feature.
23112 @item -mrelax
23113 @opindex mrelax
23114 Guide linker to relax instructions.
23116 @end table
23118 @node Nios II Options
23119 @subsection Nios II Options
23120 @cindex Nios II options
23121 @cindex Altera Nios II options
23123 These are the options defined for the Altera Nios II processor.
23125 @table @gcctabopt
23127 @item -G @var{num}
23128 @opindex G
23129 @cindex smaller data references
23130 Put global and static objects less than or equal to @var{num} bytes
23131 into the small data or BSS sections instead of the normal data or BSS
23132 sections.  The default value of @var{num} is 8.
23134 @item -mgpopt=@var{option}
23135 @itemx -mgpopt
23136 @itemx -mno-gpopt
23137 @opindex mgpopt
23138 @opindex mno-gpopt
23139 Generate (do not generate) GP-relative accesses.  The following 
23140 @var{option} names are recognized:
23142 @table @samp
23144 @item none
23145 Do not generate GP-relative accesses.
23147 @item local
23148 Generate GP-relative accesses for small data objects that are not 
23149 external, weak, or uninitialized common symbols.  
23150 Also use GP-relative addressing for objects that
23151 have been explicitly placed in a small data section via a @code{section}
23152 attribute.
23154 @item global
23155 As for @samp{local}, but also generate GP-relative accesses for
23156 small data objects that are external, weak, or common.  If you use this option,
23157 you must ensure that all parts of your program (including libraries) are
23158 compiled with the same @option{-G} setting.
23160 @item data
23161 Generate GP-relative accesses for all data objects in the program.  If you
23162 use this option, the entire data and BSS segments
23163 of your program must fit in 64K of memory and you must use an appropriate
23164 linker script to allocate them within the addressable range of the
23165 global pointer.
23167 @item all
23168 Generate GP-relative addresses for function pointers as well as data
23169 pointers.  If you use this option, the entire text, data, and BSS segments
23170 of your program must fit in 64K of memory and you must use an appropriate
23171 linker script to allocate them within the addressable range of the
23172 global pointer.
23174 @end table
23176 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
23177 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
23179 The default is @option{-mgpopt} except when @option{-fpic} or
23180 @option{-fPIC} is specified to generate position-independent code.
23181 Note that the Nios II ABI does not permit GP-relative accesses from
23182 shared libraries.
23184 You may need to specify @option{-mno-gpopt} explicitly when building
23185 programs that include large amounts of small data, including large
23186 GOT data sections.  In this case, the 16-bit offset for GP-relative
23187 addressing may not be large enough to allow access to the entire 
23188 small data section.
23190 @item -mgprel-sec=@var{regexp}
23191 @opindex mgprel-sec
23192 This option specifies additional section names that can be accessed via
23193 GP-relative addressing.  It is most useful in conjunction with 
23194 @code{section} attributes on variable declarations 
23195 (@pxref{Common Variable Attributes}) and a custom linker script.  
23196 The @var{regexp} is a POSIX Extended Regular Expression.
23198 This option does not affect the behavior of the @option{-G} option, and 
23199 the specified sections are in addition to the standard @code{.sdata}
23200 and @code{.sbss} small-data sections that are recognized by @option{-mgpopt}.
23202 @item -mr0rel-sec=@var{regexp}
23203 @opindex mr0rel-sec
23204 This option specifies names of sections that can be accessed via a 
23205 16-bit offset from @code{r0}; that is, in the low 32K or high 32K 
23206 of the 32-bit address space.  It is most useful in conjunction with 
23207 @code{section} attributes on variable declarations 
23208 (@pxref{Common Variable Attributes}) and a custom linker script.  
23209 The @var{regexp} is a POSIX Extended Regular Expression.
23211 In contrast to the use of GP-relative addressing for small data, 
23212 zero-based addressing is never generated by default and there are no 
23213 conventional section names used in standard linker scripts for sections
23214 in the low or high areas of memory.
23216 @item -mel
23217 @itemx -meb
23218 @opindex mel
23219 @opindex meb
23220 Generate little-endian (default) or big-endian (experimental) code,
23221 respectively.
23223 @item -march=@var{arch}
23224 @opindex march
23225 This specifies the name of the target Nios II architecture.  GCC uses this
23226 name to determine what kind of instructions it can emit when generating
23227 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
23229 The preprocessor macro @code{__nios2_arch__} is available to programs,
23230 with value 1 or 2, indicating the targeted ISA level.
23232 @item -mbypass-cache
23233 @itemx -mno-bypass-cache
23234 @opindex mno-bypass-cache
23235 @opindex mbypass-cache
23236 Force all load and store instructions to always bypass cache by 
23237 using I/O variants of the instructions. The default is not to
23238 bypass the cache.
23240 @item -mno-cache-volatile 
23241 @itemx -mcache-volatile       
23242 @opindex mcache-volatile 
23243 @opindex mno-cache-volatile
23244 Volatile memory access bypass the cache using the I/O variants of 
23245 the load and store instructions. The default is not to bypass the cache.
23247 @item -mno-fast-sw-div
23248 @itemx -mfast-sw-div
23249 @opindex mno-fast-sw-div
23250 @opindex mfast-sw-div
23251 Do not use table-based fast divide for small numbers. The default 
23252 is to use the fast divide at @option{-O3} and above.
23254 @item -mno-hw-mul
23255 @itemx -mhw-mul
23256 @itemx -mno-hw-mulx
23257 @itemx -mhw-mulx
23258 @itemx -mno-hw-div
23259 @itemx -mhw-div
23260 @opindex mno-hw-mul
23261 @opindex mhw-mul
23262 @opindex mno-hw-mulx
23263 @opindex mhw-mulx
23264 @opindex mno-hw-div
23265 @opindex mhw-div
23266 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
23267 instructions by the compiler. The default is to emit @code{mul}
23268 and not emit @code{div} and @code{mulx}.
23270 @item -mbmx
23271 @itemx -mno-bmx
23272 @itemx -mcdx
23273 @itemx -mno-cdx
23274 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
23275 CDX (code density) instructions.  Enabling these instructions also
23276 requires @option{-march=r2}.  Since these instructions are optional
23277 extensions to the R2 architecture, the default is not to emit them.
23279 @item -mcustom-@var{insn}=@var{N}
23280 @itemx -mno-custom-@var{insn}
23281 @opindex mcustom-@var{insn}
23282 @opindex mno-custom-@var{insn}
23283 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
23284 custom instruction with encoding @var{N} when generating code that uses 
23285 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
23286 instruction 253 for single-precision floating-point add operations instead
23287 of the default behavior of using a library call.
23289 The following values of @var{insn} are supported.  Except as otherwise
23290 noted, floating-point operations are expected to be implemented with
23291 normal IEEE 754 semantics and correspond directly to the C operators or the
23292 equivalent GCC built-in functions (@pxref{Other Builtins}).
23294 Single-precision floating point:
23295 @table @asis
23297 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
23298 Binary arithmetic operations.
23300 @item @samp{fnegs}
23301 Unary negation.
23303 @item @samp{fabss}
23304 Unary absolute value.
23306 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
23307 Comparison operations.
23309 @item @samp{fmins}, @samp{fmaxs}
23310 Floating-point minimum and maximum.  These instructions are only
23311 generated if @option{-ffinite-math-only} is specified.
23313 @item @samp{fsqrts}
23314 Unary square root operation.
23316 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
23317 Floating-point trigonometric and exponential functions.  These instructions
23318 are only generated if @option{-funsafe-math-optimizations} is also specified.
23320 @end table
23322 Double-precision floating point:
23323 @table @asis
23325 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
23326 Binary arithmetic operations.
23328 @item @samp{fnegd}
23329 Unary negation.
23331 @item @samp{fabsd}
23332 Unary absolute value.
23334 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
23335 Comparison operations.
23337 @item @samp{fmind}, @samp{fmaxd}
23338 Double-precision minimum and maximum.  These instructions are only
23339 generated if @option{-ffinite-math-only} is specified.
23341 @item @samp{fsqrtd}
23342 Unary square root operation.
23344 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
23345 Double-precision trigonometric and exponential functions.  These instructions
23346 are only generated if @option{-funsafe-math-optimizations} is also specified.
23348 @end table
23350 Conversions:
23351 @table @asis
23352 @item @samp{fextsd}
23353 Conversion from single precision to double precision.
23355 @item @samp{ftruncds}
23356 Conversion from double precision to single precision.
23358 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
23359 Conversion from floating point to signed or unsigned integer types, with
23360 truncation towards zero.
23362 @item @samp{round}
23363 Conversion from single-precision floating point to signed integer,
23364 rounding to the nearest integer and ties away from zero.
23365 This corresponds to the @code{__builtin_lroundf} function when
23366 @option{-fno-math-errno} is used.
23368 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
23369 Conversion from signed or unsigned integer types to floating-point types.
23371 @end table
23373 In addition, all of the following transfer instructions for internal
23374 registers X and Y must be provided to use any of the double-precision
23375 floating-point instructions.  Custom instructions taking two
23376 double-precision source operands expect the first operand in the
23377 64-bit register X.  The other operand (or only operand of a unary
23378 operation) is given to the custom arithmetic instruction with the
23379 least significant half in source register @var{src1} and the most
23380 significant half in @var{src2}.  A custom instruction that returns a
23381 double-precision result returns the most significant 32 bits in the
23382 destination register and the other half in 32-bit register Y.  
23383 GCC automatically generates the necessary code sequences to write
23384 register X and/or read register Y when double-precision floating-point
23385 instructions are used.
23387 @table @asis
23389 @item @samp{fwrx}
23390 Write @var{src1} into the least significant half of X and @var{src2} into
23391 the most significant half of X.
23393 @item @samp{fwry}
23394 Write @var{src1} into Y.
23396 @item @samp{frdxhi}, @samp{frdxlo}
23397 Read the most or least (respectively) significant half of X and store it in
23398 @var{dest}.
23400 @item @samp{frdy}
23401 Read the value of Y and store it into @var{dest}.
23402 @end table
23404 Note that you can gain more local control over generation of Nios II custom
23405 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
23406 and @code{target("no-custom-@var{insn}")} function attributes
23407 (@pxref{Function Attributes})
23408 or pragmas (@pxref{Function Specific Option Pragmas}).
23410 @item -mcustom-fpu-cfg=@var{name}
23411 @opindex mcustom-fpu-cfg
23413 This option enables a predefined, named set of custom instruction encodings
23414 (see @option{-mcustom-@var{insn}} above).  
23415 Currently, the following sets are defined:
23417 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
23418 @gccoptlist{-mcustom-fmuls=252 @gol
23419 -mcustom-fadds=253 @gol
23420 -mcustom-fsubs=254 @gol
23421 -fsingle-precision-constant}
23423 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
23424 @gccoptlist{-mcustom-fmuls=252 @gol
23425 -mcustom-fadds=253 @gol
23426 -mcustom-fsubs=254 @gol
23427 -mcustom-fdivs=255 @gol
23428 -fsingle-precision-constant}
23430 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
23431 @gccoptlist{-mcustom-floatus=243 @gol
23432 -mcustom-fixsi=244 @gol
23433 -mcustom-floatis=245 @gol
23434 -mcustom-fcmpgts=246 @gol
23435 -mcustom-fcmples=249 @gol
23436 -mcustom-fcmpeqs=250 @gol
23437 -mcustom-fcmpnes=251 @gol
23438 -mcustom-fmuls=252 @gol
23439 -mcustom-fadds=253 @gol
23440 -mcustom-fsubs=254 @gol
23441 -mcustom-fdivs=255 @gol
23442 -fsingle-precision-constant}
23444 Custom instruction assignments given by individual
23445 @option{-mcustom-@var{insn}=} options override those given by
23446 @option{-mcustom-fpu-cfg=}, regardless of the
23447 order of the options on the command line.
23449 Note that you can gain more local control over selection of a FPU
23450 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
23451 function attribute (@pxref{Function Attributes})
23452 or pragma (@pxref{Function Specific Option Pragmas}).
23454 @end table
23456 These additional @samp{-m} options are available for the Altera Nios II
23457 ELF (bare-metal) target:
23459 @table @gcctabopt
23461 @item -mhal
23462 @opindex mhal
23463 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
23464 startup and termination code, and is typically used in conjunction with
23465 @option{-msys-crt0=} to specify the location of the alternate startup code
23466 provided by the HAL BSP.
23468 @item -msmallc
23469 @opindex msmallc
23470 Link with a limited version of the C library, @option{-lsmallc}, rather than
23471 Newlib.
23473 @item -msys-crt0=@var{startfile}
23474 @opindex msys-crt0
23475 @var{startfile} is the file name of the startfile (crt0) to use 
23476 when linking.  This option is only useful in conjunction with @option{-mhal}.
23478 @item -msys-lib=@var{systemlib}
23479 @opindex msys-lib
23480 @var{systemlib} is the library name of the library that provides
23481 low-level system calls required by the C library,
23482 e.g.@: @code{read} and @code{write}.
23483 This option is typically used to link with a library provided by a HAL BSP.
23485 @end table
23487 @node Nvidia PTX Options
23488 @subsection Nvidia PTX Options
23489 @cindex Nvidia PTX options
23490 @cindex nvptx options
23492 These options are defined for Nvidia PTX:
23494 @table @gcctabopt
23496 @item -m32
23497 @itemx -m64
23498 @opindex m32
23499 @opindex m64
23500 Generate code for 32-bit or 64-bit ABI.
23502 @item -misa=@var{ISA-string}
23503 @opindex march
23504 Generate code for given the specified PTX ISA (e.g.@: @samp{sm_35}).  ISA
23505 strings must be lower-case.  Valid ISA strings include @samp{sm_30} and
23506 @samp{sm_35}.  The default ISA is sm_30.
23508 @item -mmainkernel
23509 @opindex mmainkernel
23510 Link in code for a __main kernel.  This is for stand-alone instead of
23511 offloading execution.
23513 @item -moptimize
23514 @opindex moptimize
23515 Apply partitioned execution optimizations.  This is the default when any
23516 level of optimization is selected.
23518 @item -msoft-stack
23519 @opindex msoft-stack
23520 Generate code that does not use @code{.local} memory
23521 directly for stack storage. Instead, a per-warp stack pointer is
23522 maintained explicitly. This enables variable-length stack allocation (with
23523 variable-length arrays or @code{alloca}), and when global memory is used for
23524 underlying storage, makes it possible to access automatic variables from other
23525 threads, or with atomic instructions. This code generation variant is used
23526 for OpenMP offloading, but the option is exposed on its own for the purpose
23527 of testing the compiler; to generate code suitable for linking into programs
23528 using OpenMP offloading, use option @option{-mgomp}.
23530 @item -muniform-simt
23531 @opindex muniform-simt
23532 Switch to code generation variant that allows to execute all threads in each
23533 warp, while maintaining memory state and side effects as if only one thread
23534 in each warp was active outside of OpenMP SIMD regions.  All atomic operations
23535 and calls to runtime (malloc, free, vprintf) are conditionally executed (iff
23536 current lane index equals the master lane index), and the register being
23537 assigned is copied via a shuffle instruction from the master lane.  Outside of
23538 SIMD regions lane 0 is the master; inside, each thread sees itself as the
23539 master.  Shared memory array @code{int __nvptx_uni[]} stores all-zeros or
23540 all-ones bitmasks for each warp, indicating current mode (0 outside of SIMD
23541 regions).  Each thread can bitwise-and the bitmask at position @code{tid.y}
23542 with current lane index to compute the master lane index.
23544 @item -mgomp
23545 @opindex mgomp
23546 Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and
23547 @option{-muniform-simt} options, and selects corresponding multilib variant.
23549 @end table
23551 @node OpenRISC Options
23552 @subsection OpenRISC Options
23553 @cindex OpenRISC Options
23555 These options are defined for OpenRISC:
23557 @table @gcctabopt
23559 @item -mboard=@var{name}
23560 @opindex mboard
23561 Configure a board specific runtime.  This will be passed to the linker for
23562 newlib board library linking.  The default is @code{or1ksim}.
23564 @item -mnewlib
23565 @opindex mnewlib
23566 For compatibility, it's always newlib for elf now.
23568 @item -mhard-div
23569 @opindex mhard-div
23570 Generate code for hardware which supports divide instructions.  This is the
23571 default.
23573 @item -mhard-mul
23574 @opindex mhard-mul
23575 Generate code for hardware which supports multiply instructions.  This is the
23576 default.
23578 @item -mcmov
23579 @opindex mcmov
23580 Generate code for hardware which supports the conditional move (@code{l.cmov})
23581 instruction.
23583 @item -mror
23584 @opindex mror
23585 Generate code for hardware which supports rotate right instructions.
23587 @item -msext
23588 @opindex msext
23589 Generate code for hardware which supports sign-extension instructions.
23591 @item -msfimm
23592 @opindex msfimm
23593 Generate code for hardware which supports set flag immediate (@code{l.sf*i})
23594 instructions.
23596 @item -mshftimm
23597 @opindex mshftimm
23598 Generate code for hardware which supports shift immediate related instructions
23599 (i.e. @code{l.srai}, @code{l.srli}, @code{l.slli}, @code{1.rori}).  Note, to
23600 enable generation of the @code{l.rori} instruction the @option{-mror} flag must
23601 also be specified.
23603 @item -msoft-div
23604 @opindex msoft-div
23605 Generate code for hardware which requires divide instruction emulation.
23607 @item -msoft-mul
23608 @opindex msoft-mul
23609 Generate code for hardware which requires multiply instruction emulation.
23611 @end table
23613 @node PDP-11 Options
23614 @subsection PDP-11 Options
23615 @cindex PDP-11 Options
23617 These options are defined for the PDP-11:
23619 @table @gcctabopt
23620 @item -mfpu
23621 @opindex mfpu
23622 Use hardware FPP floating point.  This is the default.  (FIS floating
23623 point on the PDP-11/40 is not supported.)  Implies -m45.
23625 @item -msoft-float
23626 @opindex msoft-float
23627 Do not use hardware floating point.
23629 @item -mac0
23630 @opindex mac0
23631 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
23633 @item -mno-ac0
23634 @opindex mno-ac0
23635 Return floating-point results in memory.  This is the default.
23637 @item -m40
23638 @opindex m40
23639 Generate code for a PDP-11/40.  Implies -msoft-float -mno-split.
23641 @item -m45
23642 @opindex m45
23643 Generate code for a PDP-11/45.  This is the default.
23645 @item -m10
23646 @opindex m10
23647 Generate code for a PDP-11/10.  Implies -msoft-float -mno-split.
23649 @item -mint16
23650 @itemx -mno-int32
23651 @opindex mint16
23652 @opindex mno-int32
23653 Use 16-bit @code{int}.  This is the default.
23655 @item -mint32
23656 @itemx -mno-int16
23657 @opindex mint32
23658 @opindex mno-int16
23659 Use 32-bit @code{int}.
23661 @item -msplit
23662 @opindex msplit
23663 Target has split instruction and data space.  Implies -m45.
23665 @item -munix-asm
23666 @opindex munix-asm
23667 Use Unix assembler syntax.
23669 @item -mdec-asm
23670 @opindex mdec-asm
23671 Use DEC assembler syntax.
23673 @item -mgnu-asm
23674 @opindex mgnu-asm
23675 Use GNU assembler syntax.  This is the default.
23677 @item -mlra
23678 @opindex mlra
23679 Use the new LRA register allocator.  By default, the old ``reload''
23680 allocator is used.
23681 @end table
23683 @node picoChip Options
23684 @subsection picoChip Options
23685 @cindex picoChip options
23687 These @samp{-m} options are defined for picoChip implementations:
23689 @table @gcctabopt
23691 @item -mae=@var{ae_type}
23692 @opindex mcpu
23693 Set the instruction set, register set, and instruction scheduling
23694 parameters for array element type @var{ae_type}.  Supported values
23695 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
23697 @option{-mae=ANY} selects a completely generic AE type.  Code
23698 generated with this option runs on any of the other AE types.  The
23699 code is not as efficient as it would be if compiled for a specific
23700 AE type, and some types of operation (e.g., multiplication) do not
23701 work properly on all types of AE.
23703 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
23704 for compiled code, and is the default.
23706 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
23707 option may suffer from poor performance of byte (char) manipulation,
23708 since the DSP AE does not provide hardware support for byte load/stores.
23710 @item -msymbol-as-address
23711 Enable the compiler to directly use a symbol name as an address in a
23712 load/store instruction, without first loading it into a
23713 register.  Typically, the use of this option generates larger
23714 programs, which run faster than when the option isn't used.  However, the
23715 results vary from program to program, so it is left as a user option,
23716 rather than being permanently enabled.
23718 @item -mno-inefficient-warnings
23719 Disables warnings about the generation of inefficient code.  These
23720 warnings can be generated, for example, when compiling code that
23721 performs byte-level memory operations on the MAC AE type.  The MAC AE has
23722 no hardware support for byte-level memory operations, so all byte
23723 load/stores must be synthesized from word load/store operations.  This is
23724 inefficient and a warning is generated to indicate
23725 that you should rewrite the code to avoid byte operations, or to target
23726 an AE type that has the necessary hardware support.  This option disables
23727 these warnings.
23729 @end table
23731 @node PowerPC Options
23732 @subsection PowerPC Options
23733 @cindex PowerPC options
23735 These are listed under @xref{RS/6000 and PowerPC Options}.
23737 @node RISC-V Options
23738 @subsection RISC-V Options
23739 @cindex RISC-V Options
23741 These command-line options are defined for RISC-V targets:
23743 @table @gcctabopt
23744 @item -mbranch-cost=@var{n}
23745 @opindex mbranch-cost
23746 Set the cost of branches to roughly @var{n} instructions.
23748 @item -mplt
23749 @itemx -mno-plt
23750 @opindex plt
23751 When generating PIC code, do or don't allow the use of PLTs. Ignored for
23752 non-PIC.  The default is @option{-mplt}.
23754 @item -mabi=@var{ABI-string}
23755 @opindex mabi
23756 Specify integer and floating-point calling convention.  @var{ABI-string}
23757 contains two parts: the size of integer types and the registers used for
23758 floating-point types.  For example @samp{-march=rv64ifd -mabi=lp64d} means that
23759 @samp{long} and pointers are 64-bit (implicitly defining @samp{int} to be
23760 32-bit), and that floating-point values up to 64 bits wide are passed in F
23761 registers.  Contrast this with @samp{-march=rv64ifd -mabi=lp64f}, which still
23762 allows the compiler to generate code that uses the F and D extensions but only
23763 allows floating-point values up to 32 bits long to be passed in registers; or
23764 @samp{-march=rv64ifd -mabi=lp64}, in which no floating-point arguments will be
23765 passed in registers.
23767 The default for this argument is system dependent, users who want a specific
23768 calling convention should specify one explicitly.  The valid calling
23769 conventions are: @samp{ilp32}, @samp{ilp32f}, @samp{ilp32d}, @samp{lp64},
23770 @samp{lp64f}, and @samp{lp64d}.  Some calling conventions are impossible to
23771 implement on some ISAs: for example, @samp{-march=rv32if -mabi=ilp32d} is
23772 invalid because the ABI requires 64-bit values be passed in F registers, but F
23773 registers are only 32 bits wide.  There is also the @samp{ilp32e} ABI that can
23774 only be used with the @samp{rv32e} architecture.  This ABI is not well
23775 specified at present, and is subject to change.
23777 @item -mfdiv
23778 @itemx -mno-fdiv
23779 @opindex mfdiv
23780 Do or don't use hardware floating-point divide and square root instructions.
23781 This requires the F or D extensions for floating-point registers.  The default
23782 is to use them if the specified architecture has these instructions.
23784 @item -mdiv
23785 @itemx -mno-div
23786 @opindex mdiv
23787 Do or don't use hardware instructions for integer division.  This requires the
23788 M extension.  The default is to use them if the specified architecture has
23789 these instructions.
23791 @item -march=@var{ISA-string}
23792 @opindex march
23793 Generate code for given RISC-V ISA (e.g.@: @samp{rv64im}).  ISA strings must be
23794 lower-case.  Examples include @samp{rv64i}, @samp{rv32g}, @samp{rv32e}, and
23795 @samp{rv32imaf}.
23797 @item -mtune=@var{processor-string}
23798 @opindex mtune
23799 Optimize the output for the given processor, specified by microarchitecture
23800 name.  Permissible values for this option are: @samp{rocket},
23801 @samp{sifive-3-series}, @samp{sifive-5-series}, @samp{sifive-7-series},
23802 and @samp{size}.
23804 When @option{-mtune=} is not specified, the default is @samp{rocket}.
23806 The @samp{size} choice is not intended for use by end-users.  This is used
23807 when @option{-Os} is specified.  It overrides the instruction cost info
23808 provided by @option{-mtune=}, but does not override the pipeline info.  This
23809 helps reduce code size while still giving good performance.
23811 @item -mpreferred-stack-boundary=@var{num}
23812 @opindex mpreferred-stack-boundary
23813 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
23814 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
23815 the default is 4 (16 bytes or 128-bits).
23817 @strong{Warning:} If you use this switch, then you must build all modules with
23818 the same value, including any libraries.  This includes the system libraries
23819 and startup modules.
23821 @item -msmall-data-limit=@var{n}
23822 @opindex msmall-data-limit
23823 Put global and static data smaller than @var{n} bytes into a special section
23824 (on some targets).
23826 @item -msave-restore
23827 @itemx -mno-save-restore
23828 @opindex msave-restore
23829 Do or don't use smaller but slower prologue and epilogue code that uses
23830 library function calls.  The default is to use fast inline prologues and
23831 epilogues.
23833 @item -mstrict-align
23834 @itemx -mno-strict-align
23835 @opindex mstrict-align
23836 Do not or do generate unaligned memory accesses.  The default is set depending
23837 on whether the processor we are optimizing for supports fast unaligned access
23838 or not.
23840 @item -mcmodel=medlow
23841 @opindex mcmodel=medlow
23842 Generate code for the medium-low code model. The program and its statically
23843 defined symbols must lie within a single 2 GiB address range and must lie
23844 between absolute addresses @minus{}2 GiB and +2 GiB. Programs can be
23845 statically or dynamically linked. This is the default code model.
23847 @item -mcmodel=medany
23848 @opindex mcmodel=medany
23849 Generate code for the medium-any code model. The program and its statically
23850 defined symbols must be within any single 2 GiB address range. Programs can be
23851 statically or dynamically linked.
23853 @item -mexplicit-relocs
23854 @itemx -mno-exlicit-relocs
23855 Use or do not use assembler relocation operators when dealing with symbolic
23856 addresses.  The alternative is to use assembler macros instead, which may
23857 limit optimization.
23859 @item -mrelax
23860 @itemx -mno-relax
23861 Take advantage of linker relaxations to reduce the number of instructions
23862 required to materialize symbol addresses. The default is to take advantage of
23863 linker relaxations.
23865 @item -memit-attribute
23866 @itemx -mno-emit-attribute
23867 Emit (do not emit) RISC-V attribute to record extra information into ELF
23868 objects.  This feature requires at least binutils 2.32.
23869 @end table
23871 @node RL78 Options
23872 @subsection RL78 Options
23873 @cindex RL78 Options
23875 @table @gcctabopt
23877 @item -msim
23878 @opindex msim
23879 Links in additional target libraries to support operation within a
23880 simulator.
23882 @item -mmul=none
23883 @itemx -mmul=g10
23884 @itemx -mmul=g13
23885 @itemx -mmul=g14
23886 @itemx -mmul=rl78
23887 @opindex mmul
23888 Specifies the type of hardware multiplication and division support to
23889 be used.  The simplest is @code{none}, which uses software for both
23890 multiplication and division.  This is the default.  The @code{g13}
23891 value is for the hardware multiply/divide peripheral found on the
23892 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
23893 the multiplication and division instructions supported by the RL78/G14
23894 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
23895 the value @code{mg10} is an alias for @code{none}.
23897 In addition a C preprocessor macro is defined, based upon the setting
23898 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
23899 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
23901 @item -mcpu=g10
23902 @itemx -mcpu=g13
23903 @itemx -mcpu=g14
23904 @itemx -mcpu=rl78
23905 @opindex mcpu
23906 Specifies the RL78 core to target.  The default is the G14 core, also
23907 known as an S3 core or just RL78.  The G13 or S2 core does not have
23908 multiply or divide instructions, instead it uses a hardware peripheral
23909 for these operations.  The G10 or S1 core does not have register
23910 banks, so it uses a different calling convention.
23912 If this option is set it also selects the type of hardware multiply
23913 support to use, unless this is overridden by an explicit
23914 @option{-mmul=none} option on the command line.  Thus specifying
23915 @option{-mcpu=g13} enables the use of the G13 hardware multiply
23916 peripheral and specifying @option{-mcpu=g10} disables the use of
23917 hardware multiplications altogether.
23919 Note, although the RL78/G14 core is the default target, specifying
23920 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
23921 change the behavior of the toolchain since it also enables G14
23922 hardware multiply support.  If these options are not specified on the
23923 command line then software multiplication routines will be used even
23924 though the code targets the RL78 core.  This is for backwards
23925 compatibility with older toolchains which did not have hardware
23926 multiply and divide support.
23928 In addition a C preprocessor macro is defined, based upon the setting
23929 of this option.  Possible values are: @code{__RL78_G10__},
23930 @code{__RL78_G13__} or @code{__RL78_G14__}.
23932 @item -mg10
23933 @itemx -mg13
23934 @itemx -mg14
23935 @itemx -mrl78
23936 @opindex mg10
23937 @opindex mg13
23938 @opindex mg14
23939 @opindex mrl78
23940 These are aliases for the corresponding @option{-mcpu=} option.  They
23941 are provided for backwards compatibility.
23943 @item -mallregs
23944 @opindex mallregs
23945 Allow the compiler to use all of the available registers.  By default
23946 registers @code{r24..r31} are reserved for use in interrupt handlers.
23947 With this option enabled these registers can be used in ordinary
23948 functions as well.
23950 @item -m64bit-doubles
23951 @itemx -m32bit-doubles
23952 @opindex m64bit-doubles
23953 @opindex m32bit-doubles
23954 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
23955 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
23956 @option{-m32bit-doubles}.
23958 @item -msave-mduc-in-interrupts
23959 @itemx -mno-save-mduc-in-interrupts
23960 @opindex msave-mduc-in-interrupts
23961 @opindex mno-save-mduc-in-interrupts
23962 Specifies that interrupt handler functions should preserve the
23963 MDUC registers.  This is only necessary if normal code might use
23964 the MDUC registers, for example because it performs multiplication
23965 and division operations.  The default is to ignore the MDUC registers
23966 as this makes the interrupt handlers faster.  The target option -mg13
23967 needs to be passed for this to work as this feature is only available
23968 on the G13 target (S2 core).  The MDUC registers will only be saved
23969 if the interrupt handler performs a multiplication or division
23970 operation or it calls another function.
23972 @end table
23974 @node RS/6000 and PowerPC Options
23975 @subsection IBM RS/6000 and PowerPC Options
23976 @cindex RS/6000 and PowerPC Options
23977 @cindex IBM RS/6000 and PowerPC Options
23979 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
23980 @table @gcctabopt
23981 @item -mpowerpc-gpopt
23982 @itemx -mno-powerpc-gpopt
23983 @itemx -mpowerpc-gfxopt
23984 @itemx -mno-powerpc-gfxopt
23985 @need 800
23986 @itemx -mpowerpc64
23987 @itemx -mno-powerpc64
23988 @itemx -mmfcrf
23989 @itemx -mno-mfcrf
23990 @itemx -mpopcntb
23991 @itemx -mno-popcntb
23992 @itemx -mpopcntd
23993 @itemx -mno-popcntd
23994 @itemx -mfprnd
23995 @itemx -mno-fprnd
23996 @need 800
23997 @itemx -mcmpb
23998 @itemx -mno-cmpb
23999 @itemx -mmfpgpr
24000 @itemx -mno-mfpgpr
24001 @itemx -mhard-dfp
24002 @itemx -mno-hard-dfp
24003 @opindex mpowerpc-gpopt
24004 @opindex mno-powerpc-gpopt
24005 @opindex mpowerpc-gfxopt
24006 @opindex mno-powerpc-gfxopt
24007 @opindex mpowerpc64
24008 @opindex mno-powerpc64
24009 @opindex mmfcrf
24010 @opindex mno-mfcrf
24011 @opindex mpopcntb
24012 @opindex mno-popcntb
24013 @opindex mpopcntd
24014 @opindex mno-popcntd
24015 @opindex mfprnd
24016 @opindex mno-fprnd
24017 @opindex mcmpb
24018 @opindex mno-cmpb
24019 @opindex mmfpgpr
24020 @opindex mno-mfpgpr
24021 @opindex mhard-dfp
24022 @opindex mno-hard-dfp
24023 You use these options to specify which instructions are available on the
24024 processor you are using.  The default value of these options is
24025 determined when configuring GCC@.  Specifying the
24026 @option{-mcpu=@var{cpu_type}} overrides the specification of these
24027 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
24028 rather than the options listed above.
24030 Specifying @option{-mpowerpc-gpopt} allows
24031 GCC to use the optional PowerPC architecture instructions in the
24032 General Purpose group, including floating-point square root.  Specifying
24033 @option{-mpowerpc-gfxopt} allows GCC to
24034 use the optional PowerPC architecture instructions in the Graphics
24035 group, including floating-point select.
24037 The @option{-mmfcrf} option allows GCC to generate the move from
24038 condition register field instruction implemented on the POWER4
24039 processor and other processors that support the PowerPC V2.01
24040 architecture.
24041 The @option{-mpopcntb} option allows GCC to generate the popcount and
24042 double-precision FP reciprocal estimate instruction implemented on the
24043 POWER5 processor and other processors that support the PowerPC V2.02
24044 architecture.
24045 The @option{-mpopcntd} option allows GCC to generate the popcount
24046 instruction implemented on the POWER7 processor and other processors
24047 that support the PowerPC V2.06 architecture.
24048 The @option{-mfprnd} option allows GCC to generate the FP round to
24049 integer instructions implemented on the POWER5+ processor and other
24050 processors that support the PowerPC V2.03 architecture.
24051 The @option{-mcmpb} option allows GCC to generate the compare bytes
24052 instruction implemented on the POWER6 processor and other processors
24053 that support the PowerPC V2.05 architecture.
24054 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
24055 general-purpose register instructions implemented on the POWER6X
24056 processor and other processors that support the extended PowerPC V2.05
24057 architecture.
24058 The @option{-mhard-dfp} option allows GCC to generate the decimal
24059 floating-point instructions implemented on some POWER processors.
24061 The @option{-mpowerpc64} option allows GCC to generate the additional
24062 64-bit instructions that are found in the full PowerPC64 architecture
24063 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
24064 @option{-mno-powerpc64}.
24066 @item -mcpu=@var{cpu_type}
24067 @opindex mcpu
24068 Set architecture type, register usage, and
24069 instruction scheduling parameters for machine type @var{cpu_type}.
24070 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
24071 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
24072 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
24073 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
24074 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
24075 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
24076 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
24077 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
24078 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
24079 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
24080 @samp{power9}, @samp{powerpc}, @samp{powerpc64}, @samp{powerpc64le},
24081 @samp{rs64}, and @samp{native}.
24083 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
24084 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
24085 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
24086 architecture machine types, with an appropriate, generic processor
24087 model assumed for scheduling purposes.
24089 Specifying @samp{native} as cpu type detects and selects the
24090 architecture option that corresponds to the host processor of the
24091 system performing the compilation.
24092 @option{-mcpu=native} has no effect if GCC does not recognize the
24093 processor.
24095 The other options specify a specific processor.  Code generated under
24096 those options runs best on that processor, and may not run at all on
24097 others.
24099 The @option{-mcpu} options automatically enable or disable the
24100 following options:
24102 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
24103 -mpopcntb  -mpopcntd  -mpowerpc64 @gol
24104 -mpowerpc-gpopt  -mpowerpc-gfxopt @gol
24105 -mmulhw  -mdlmzb  -mmfpgpr  -mvsx @gol
24106 -mcrypto  -mhtm  -mpower8-fusion  -mpower8-vector @gol
24107 -mquad-memory  -mquad-memory-atomic  -mfloat128  -mfloat128-hardware}
24109 The particular options set for any particular CPU varies between
24110 compiler versions, depending on what setting seems to produce optimal
24111 code for that CPU; it doesn't necessarily reflect the actual hardware's
24112 capabilities.  If you wish to set an individual option to a particular
24113 value, you may specify it after the @option{-mcpu} option, like
24114 @option{-mcpu=970 -mno-altivec}.
24116 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
24117 not enabled or disabled by the @option{-mcpu} option at present because
24118 AIX does not have full support for these options.  You may still
24119 enable or disable them individually if you're sure it'll work in your
24120 environment.
24122 @item -mtune=@var{cpu_type}
24123 @opindex mtune
24124 Set the instruction scheduling parameters for machine type
24125 @var{cpu_type}, but do not set the architecture type or register usage,
24126 as @option{-mcpu=@var{cpu_type}} does.  The same
24127 values for @var{cpu_type} are used for @option{-mtune} as for
24128 @option{-mcpu}.  If both are specified, the code generated uses the
24129 architecture and registers set by @option{-mcpu}, but the
24130 scheduling parameters set by @option{-mtune}.
24132 @item -mcmodel=small
24133 @opindex mcmodel=small
24134 Generate PowerPC64 code for the small model: The TOC is limited to
24135 64k.
24137 @item -mcmodel=medium
24138 @opindex mcmodel=medium
24139 Generate PowerPC64 code for the medium model: The TOC and other static
24140 data may be up to a total of 4G in size.  This is the default for 64-bit
24141 Linux.
24143 @item -mcmodel=large
24144 @opindex mcmodel=large
24145 Generate PowerPC64 code for the large model: The TOC may be up to 4G
24146 in size.  Other data and code is only limited by the 64-bit address
24147 space.
24149 @item -maltivec
24150 @itemx -mno-altivec
24151 @opindex maltivec
24152 @opindex mno-altivec
24153 Generate code that uses (does not use) AltiVec instructions, and also
24154 enable the use of built-in functions that allow more direct access to
24155 the AltiVec instruction set.  You may also need to set
24156 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
24157 enhancements.
24159 When @option{-maltivec} is used, the element order for AltiVec intrinsics
24160 such as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
24161 match array element order corresponding to the endianness of the
24162 target.  That is, element zero identifies the leftmost element in a
24163 vector register when targeting a big-endian platform, and identifies
24164 the rightmost element in a vector register when targeting a
24165 little-endian platform.
24167 @item -mvrsave
24168 @itemx -mno-vrsave
24169 @opindex mvrsave
24170 @opindex mno-vrsave
24171 Generate VRSAVE instructions when generating AltiVec code.
24173 @item -msecure-plt
24174 @opindex msecure-plt
24175 Generate code that allows @command{ld} and @command{ld.so}
24176 to build executables and shared
24177 libraries with non-executable @code{.plt} and @code{.got} sections.
24178 This is a PowerPC
24179 32-bit SYSV ABI option.
24181 @item -mbss-plt
24182 @opindex mbss-plt
24183 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
24184 fills in, and
24185 requires @code{.plt} and @code{.got}
24186 sections that are both writable and executable.
24187 This is a PowerPC 32-bit SYSV ABI option.
24189 @item -misel
24190 @itemx -mno-isel
24191 @opindex misel
24192 @opindex mno-isel
24193 This switch enables or disables the generation of ISEL instructions.
24195 @item -mvsx
24196 @itemx -mno-vsx
24197 @opindex mvsx
24198 @opindex mno-vsx
24199 Generate code that uses (does not use) vector/scalar (VSX)
24200 instructions, and also enable the use of built-in functions that allow
24201 more direct access to the VSX instruction set.
24203 @item -mcrypto
24204 @itemx -mno-crypto
24205 @opindex mcrypto
24206 @opindex mno-crypto
24207 Enable the use (disable) of the built-in functions that allow direct
24208 access to the cryptographic instructions that were added in version
24209 2.07 of the PowerPC ISA.
24211 @item -mhtm
24212 @itemx -mno-htm
24213 @opindex mhtm
24214 @opindex mno-htm
24215 Enable (disable) the use of the built-in functions that allow direct
24216 access to the Hardware Transactional Memory (HTM) instructions that
24217 were added in version 2.07 of the PowerPC ISA.
24219 @item -mpower8-fusion
24220 @itemx -mno-power8-fusion
24221 @opindex mpower8-fusion
24222 @opindex mno-power8-fusion
24223 Generate code that keeps (does not keeps) some integer operations
24224 adjacent so that the instructions can be fused together on power8 and
24225 later processors.
24227 @item -mpower8-vector
24228 @itemx -mno-power8-vector
24229 @opindex mpower8-vector
24230 @opindex mno-power8-vector
24231 Generate code that uses (does not use) the vector and scalar
24232 instructions that were added in version 2.07 of the PowerPC ISA.  Also
24233 enable the use of built-in functions that allow more direct access to
24234 the vector instructions.
24236 @item -mquad-memory
24237 @itemx -mno-quad-memory
24238 @opindex mquad-memory
24239 @opindex mno-quad-memory
24240 Generate code that uses (does not use) the non-atomic quad word memory
24241 instructions.  The @option{-mquad-memory} option requires use of
24242 64-bit mode.
24244 @item -mquad-memory-atomic
24245 @itemx -mno-quad-memory-atomic
24246 @opindex mquad-memory-atomic
24247 @opindex mno-quad-memory-atomic
24248 Generate code that uses (does not use) the atomic quad word memory
24249 instructions.  The @option{-mquad-memory-atomic} option requires use of
24250 64-bit mode.
24252 @item -mfloat128
24253 @itemx -mno-float128
24254 @opindex mfloat128
24255 @opindex mno-float128
24256 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
24257 and use either software emulation for IEEE 128-bit floating point or
24258 hardware instructions.
24260 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7},
24261 @option{-mcpu=power8}), or @option{-mcpu=power9} must be enabled to
24262 use the IEEE 128-bit floating point support.  The IEEE 128-bit
24263 floating point support only works on PowerPC Linux systems.
24265 The default for @option{-mfloat128} is enabled on PowerPC Linux
24266 systems using the VSX instruction set, and disabled on other systems.
24268 If you use the ISA 3.0 instruction set (@option{-mpower9-vector} or
24269 @option{-mcpu=power9}) on a 64-bit system, the IEEE 128-bit floating
24270 point support will also enable the generation of ISA 3.0 IEEE 128-bit
24271 floating point instructions.  Otherwise, if you do not specify to
24272 generate ISA 3.0 instructions or you are targeting a 32-bit big endian
24273 system, IEEE 128-bit floating point will be done with software
24274 emulation.
24276 @item -mfloat128-hardware
24277 @itemx -mno-float128-hardware
24278 @opindex mfloat128-hardware
24279 @opindex mno-float128-hardware
24280 Enable/disable using ISA 3.0 hardware instructions to support the
24281 @var{__float128} data type.
24283 The default for @option{-mfloat128-hardware} is enabled on PowerPC
24284 Linux systems using the ISA 3.0 instruction set, and disabled on other
24285 systems.
24287 @item -m32
24288 @itemx -m64
24289 @opindex m32
24290 @opindex m64
24291 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
24292 targets (including GNU/Linux).  The 32-bit environment sets int, long
24293 and pointer to 32 bits and generates code that runs on any PowerPC
24294 variant.  The 64-bit environment sets int to 32 bits and long and
24295 pointer to 64 bits, and generates code for PowerPC64, as for
24296 @option{-mpowerpc64}.
24298 @item -mfull-toc
24299 @itemx -mno-fp-in-toc
24300 @itemx -mno-sum-in-toc
24301 @itemx -mminimal-toc
24302 @opindex mfull-toc
24303 @opindex mno-fp-in-toc
24304 @opindex mno-sum-in-toc
24305 @opindex mminimal-toc
24306 Modify generation of the TOC (Table Of Contents), which is created for
24307 every executable file.  The @option{-mfull-toc} option is selected by
24308 default.  In that case, GCC allocates at least one TOC entry for
24309 each unique non-automatic variable reference in your program.  GCC
24310 also places floating-point constants in the TOC@.  However, only
24311 16,384 entries are available in the TOC@.
24313 If you receive a linker error message that saying you have overflowed
24314 the available TOC space, you can reduce the amount of TOC space used
24315 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
24316 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
24317 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
24318 generate code to calculate the sum of an address and a constant at
24319 run time instead of putting that sum into the TOC@.  You may specify one
24320 or both of these options.  Each causes GCC to produce very slightly
24321 slower and larger code at the expense of conserving TOC space.
24323 If you still run out of space in the TOC even when you specify both of
24324 these options, specify @option{-mminimal-toc} instead.  This option causes
24325 GCC to make only one TOC entry for every file.  When you specify this
24326 option, GCC produces code that is slower and larger but which
24327 uses extremely little TOC space.  You may wish to use this option
24328 only on files that contain less frequently-executed code.
24330 @item -maix64
24331 @itemx -maix32
24332 @opindex maix64
24333 @opindex maix32
24334 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
24335 @code{long} type, and the infrastructure needed to support them.
24336 Specifying @option{-maix64} implies @option{-mpowerpc64},
24337 while @option{-maix32} disables the 64-bit ABI and
24338 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
24340 @item -mxl-compat
24341 @itemx -mno-xl-compat
24342 @opindex mxl-compat
24343 @opindex mno-xl-compat
24344 Produce code that conforms more closely to IBM XL compiler semantics
24345 when using AIX-compatible ABI@.  Pass floating-point arguments to
24346 prototyped functions beyond the register save area (RSA) on the stack
24347 in addition to argument FPRs.  Do not assume that most significant
24348 double in 128-bit long double value is properly rounded when comparing
24349 values and converting to double.  Use XL symbol names for long double
24350 support routines.
24352 The AIX calling convention was extended but not initially documented to
24353 handle an obscure K&R C case of calling a function that takes the
24354 address of its arguments with fewer arguments than declared.  IBM XL
24355 compilers access floating-point arguments that do not fit in the
24356 RSA from the stack when a subroutine is compiled without
24357 optimization.  Because always storing floating-point arguments on the
24358 stack is inefficient and rarely needed, this option is not enabled by
24359 default and only is necessary when calling subroutines compiled by IBM
24360 XL compilers without optimization.
24362 @item -mpe
24363 @opindex mpe
24364 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
24365 application written to use message passing with special startup code to
24366 enable the application to run.  The system must have PE installed in the
24367 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
24368 must be overridden with the @option{-specs=} option to specify the
24369 appropriate directory location.  The Parallel Environment does not
24370 support threads, so the @option{-mpe} option and the @option{-pthread}
24371 option are incompatible.
24373 @item -malign-natural
24374 @itemx -malign-power
24375 @opindex malign-natural
24376 @opindex malign-power
24377 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
24378 @option{-malign-natural} overrides the ABI-defined alignment of larger
24379 types, such as floating-point doubles, on their natural size-based boundary.
24380 The option @option{-malign-power} instructs GCC to follow the ABI-specified
24381 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
24383 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
24384 is not supported.
24386 @item -msoft-float
24387 @itemx -mhard-float
24388 @opindex msoft-float
24389 @opindex mhard-float
24390 Generate code that does not use (uses) the floating-point register set.
24391 Software floating-point emulation is provided if you use the
24392 @option{-msoft-float} option, and pass the option to GCC when linking.
24394 @item -mmultiple
24395 @itemx -mno-multiple
24396 @opindex mmultiple
24397 @opindex mno-multiple
24398 Generate code that uses (does not use) the load multiple word
24399 instructions and the store multiple word instructions.  These
24400 instructions are generated by default on POWER systems, and not
24401 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
24402 PowerPC systems, since those instructions do not work when the
24403 processor is in little-endian mode.  The exceptions are PPC740 and
24404 PPC750 which permit these instructions in little-endian mode.
24406 @item -mupdate
24407 @itemx -mno-update
24408 @opindex mupdate
24409 @opindex mno-update
24410 Generate code that uses (does not use) the load or store instructions
24411 that update the base register to the address of the calculated memory
24412 location.  These instructions are generated by default.  If you use
24413 @option{-mno-update}, there is a small window between the time that the
24414 stack pointer is updated and the address of the previous frame is
24415 stored, which means code that walks the stack frame across interrupts or
24416 signals may get corrupted data.
24418 @item -mavoid-indexed-addresses
24419 @itemx -mno-avoid-indexed-addresses
24420 @opindex mavoid-indexed-addresses
24421 @opindex mno-avoid-indexed-addresses
24422 Generate code that tries to avoid (not avoid) the use of indexed load
24423 or store instructions. These instructions can incur a performance
24424 penalty on Power6 processors in certain situations, such as when
24425 stepping through large arrays that cross a 16M boundary.  This option
24426 is enabled by default when targeting Power6 and disabled otherwise.
24428 @item -mfused-madd
24429 @itemx -mno-fused-madd
24430 @opindex mfused-madd
24431 @opindex mno-fused-madd
24432 Generate code that uses (does not use) the floating-point multiply and
24433 accumulate instructions.  These instructions are generated by default
24434 if hardware floating point is used.  The machine-dependent
24435 @option{-mfused-madd} option is now mapped to the machine-independent
24436 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
24437 mapped to @option{-ffp-contract=off}.
24439 @item -mmulhw
24440 @itemx -mno-mulhw
24441 @opindex mmulhw
24442 @opindex mno-mulhw
24443 Generate code that uses (does not use) the half-word multiply and
24444 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
24445 These instructions are generated by default when targeting those
24446 processors.
24448 @item -mdlmzb
24449 @itemx -mno-dlmzb
24450 @opindex mdlmzb
24451 @opindex mno-dlmzb
24452 Generate code that uses (does not use) the string-search @samp{dlmzb}
24453 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
24454 generated by default when targeting those processors.
24456 @item -mno-bit-align
24457 @itemx -mbit-align
24458 @opindex mno-bit-align
24459 @opindex mbit-align
24460 On System V.4 and embedded PowerPC systems do not (do) force structures
24461 and unions that contain bit-fields to be aligned to the base type of the
24462 bit-field.
24464 For example, by default a structure containing nothing but 8
24465 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
24466 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
24467 the structure is aligned to a 1-byte boundary and is 1 byte in
24468 size.
24470 @item -mno-strict-align
24471 @itemx -mstrict-align
24472 @opindex mno-strict-align
24473 @opindex mstrict-align
24474 On System V.4 and embedded PowerPC systems do not (do) assume that
24475 unaligned memory references are handled by the system.
24477 @item -mrelocatable
24478 @itemx -mno-relocatable
24479 @opindex mrelocatable
24480 @opindex mno-relocatable
24481 Generate code that allows (does not allow) a static executable to be
24482 relocated to a different address at run time.  A simple embedded
24483 PowerPC system loader should relocate the entire contents of
24484 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
24485 a table of 32-bit addresses generated by this option.  For this to
24486 work, all objects linked together must be compiled with
24487 @option{-mrelocatable} or @option{-mrelocatable-lib}.
24488 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
24490 @item -mrelocatable-lib
24491 @itemx -mno-relocatable-lib
24492 @opindex mrelocatable-lib
24493 @opindex mno-relocatable-lib
24494 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
24495 @code{.fixup} section to allow static executables to be relocated at
24496 run time, but @option{-mrelocatable-lib} does not use the smaller stack
24497 alignment of @option{-mrelocatable}.  Objects compiled with
24498 @option{-mrelocatable-lib} may be linked with objects compiled with
24499 any combination of the @option{-mrelocatable} options.
24501 @item -mno-toc
24502 @itemx -mtoc
24503 @opindex mno-toc
24504 @opindex mtoc
24505 On System V.4 and embedded PowerPC systems do not (do) assume that
24506 register 2 contains a pointer to a global area pointing to the addresses
24507 used in the program.
24509 @item -mlittle
24510 @itemx -mlittle-endian
24511 @opindex mlittle
24512 @opindex mlittle-endian
24513 On System V.4 and embedded PowerPC systems compile code for the
24514 processor in little-endian mode.  The @option{-mlittle-endian} option is
24515 the same as @option{-mlittle}.
24517 @item -mbig
24518 @itemx -mbig-endian
24519 @opindex mbig
24520 @opindex mbig-endian
24521 On System V.4 and embedded PowerPC systems compile code for the
24522 processor in big-endian mode.  The @option{-mbig-endian} option is
24523 the same as @option{-mbig}.
24525 @item -mdynamic-no-pic
24526 @opindex mdynamic-no-pic
24527 On Darwin and Mac OS X systems, compile code so that it is not
24528 relocatable, but that its external references are relocatable.  The
24529 resulting code is suitable for applications, but not shared
24530 libraries.
24532 @item -msingle-pic-base
24533 @opindex msingle-pic-base
24534 Treat the register used for PIC addressing as read-only, rather than
24535 loading it in the prologue for each function.  The runtime system is
24536 responsible for initializing this register with an appropriate value
24537 before execution begins.
24539 @item -mprioritize-restricted-insns=@var{priority}
24540 @opindex mprioritize-restricted-insns
24541 This option controls the priority that is assigned to
24542 dispatch-slot restricted instructions during the second scheduling
24543 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
24544 or @samp{2} to assign no, highest, or second-highest (respectively) 
24545 priority to dispatch-slot restricted
24546 instructions.
24548 @item -msched-costly-dep=@var{dependence_type}
24549 @opindex msched-costly-dep
24550 This option controls which dependences are considered costly
24551 by the target during instruction scheduling.  The argument
24552 @var{dependence_type} takes one of the following values:
24554 @table @asis
24555 @item @samp{no}
24556 No dependence is costly.
24558 @item @samp{all}
24559 All dependences are costly.
24561 @item @samp{true_store_to_load}
24562 A true dependence from store to load is costly.
24564 @item @samp{store_to_load}
24565 Any dependence from store to load is costly.
24567 @item @var{number}
24568 Any dependence for which the latency is greater than or equal to 
24569 @var{number} is costly.
24570 @end table
24572 @item -minsert-sched-nops=@var{scheme}
24573 @opindex minsert-sched-nops
24574 This option controls which NOP insertion scheme is used during
24575 the second scheduling pass.  The argument @var{scheme} takes one of the
24576 following values:
24578 @table @asis
24579 @item @samp{no}
24580 Don't insert NOPs.
24582 @item @samp{pad}
24583 Pad with NOPs any dispatch group that has vacant issue slots,
24584 according to the scheduler's grouping.
24586 @item @samp{regroup_exact}
24587 Insert NOPs to force costly dependent insns into
24588 separate groups.  Insert exactly as many NOPs as needed to force an insn
24589 to a new group, according to the estimated processor grouping.
24591 @item @var{number}
24592 Insert NOPs to force costly dependent insns into
24593 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
24594 @end table
24596 @item -mcall-sysv
24597 @opindex mcall-sysv
24598 On System V.4 and embedded PowerPC systems compile code using calling
24599 conventions that adhere to the March 1995 draft of the System V
24600 Application Binary Interface, PowerPC processor supplement.  This is the
24601 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
24603 @item -mcall-sysv-eabi
24604 @itemx -mcall-eabi
24605 @opindex mcall-sysv-eabi
24606 @opindex mcall-eabi
24607 Specify both @option{-mcall-sysv} and @option{-meabi} options.
24609 @item -mcall-sysv-noeabi
24610 @opindex mcall-sysv-noeabi
24611 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
24613 @item -mcall-aixdesc
24614 @opindex m
24615 On System V.4 and embedded PowerPC systems compile code for the AIX
24616 operating system.
24618 @item -mcall-linux
24619 @opindex mcall-linux
24620 On System V.4 and embedded PowerPC systems compile code for the
24621 Linux-based GNU system.
24623 @item -mcall-freebsd
24624 @opindex mcall-freebsd
24625 On System V.4 and embedded PowerPC systems compile code for the
24626 FreeBSD operating system.
24628 @item -mcall-netbsd
24629 @opindex mcall-netbsd
24630 On System V.4 and embedded PowerPC systems compile code for the
24631 NetBSD operating system.
24633 @item -mcall-openbsd
24634 @opindex mcall-netbsd
24635 On System V.4 and embedded PowerPC systems compile code for the
24636 OpenBSD operating system.
24638 @item -mtraceback=@var{traceback_type}
24639 @opindex mtraceback
24640 Select the type of traceback table. Valid values for @var{traceback_type}
24641 are @samp{full}, @samp{part}, and @samp{no}.
24643 @item -maix-struct-return
24644 @opindex maix-struct-return
24645 Return all structures in memory (as specified by the AIX ABI)@.
24647 @item -msvr4-struct-return
24648 @opindex msvr4-struct-return
24649 Return structures smaller than 8 bytes in registers (as specified by the
24650 SVR4 ABI)@.
24652 @item -mabi=@var{abi-type}
24653 @opindex mabi
24654 Extend the current ABI with a particular extension, or remove such extension.
24655 Valid values are @samp{altivec}, @samp{no-altivec},
24656 @samp{ibmlongdouble}, @samp{ieeelongdouble},
24657 @samp{elfv1}, @samp{elfv2}@.
24659 @item -mabi=ibmlongdouble
24660 @opindex mabi=ibmlongdouble
24661 Change the current ABI to use IBM extended-precision long double.
24662 This is not likely to work if your system defaults to using IEEE
24663 extended-precision long double.  If you change the long double type
24664 from IEEE extended-precision, the compiler will issue a warning unless
24665 you use the @option{-Wno-psabi} option.  Requires @option{-mlong-double-128}
24666 to be enabled.
24668 @item -mabi=ieeelongdouble
24669 @opindex mabi=ieeelongdouble
24670 Change the current ABI to use IEEE extended-precision long double.
24671 This is not likely to work if your system defaults to using IBM
24672 extended-precision long double.  If you change the long double type
24673 from IBM extended-precision, the compiler will issue a warning unless
24674 you use the @option{-Wno-psabi} option.  Requires @option{-mlong-double-128}
24675 to be enabled.
24677 @item -mabi=elfv1
24678 @opindex mabi=elfv1
24679 Change the current ABI to use the ELFv1 ABI.
24680 This is the default ABI for big-endian PowerPC 64-bit Linux.
24681 Overriding the default ABI requires special system support and is
24682 likely to fail in spectacular ways.
24684 @item -mabi=elfv2
24685 @opindex mabi=elfv2
24686 Change the current ABI to use the ELFv2 ABI.
24687 This is the default ABI for little-endian PowerPC 64-bit Linux.
24688 Overriding the default ABI requires special system support and is
24689 likely to fail in spectacular ways.
24691 @item -mgnu-attribute
24692 @itemx -mno-gnu-attribute
24693 @opindex mgnu-attribute
24694 @opindex mno-gnu-attribute
24695 Emit .gnu_attribute assembly directives to set tag/value pairs in a
24696 .gnu.attributes section that specify ABI variations in function
24697 parameters or return values.
24699 @item -mprototype
24700 @itemx -mno-prototype
24701 @opindex mprototype
24702 @opindex mno-prototype
24703 On System V.4 and embedded PowerPC systems assume that all calls to
24704 variable argument functions are properly prototyped.  Otherwise, the
24705 compiler must insert an instruction before every non-prototyped call to
24706 set or clear bit 6 of the condition code register (@code{CR}) to
24707 indicate whether floating-point values are passed in the floating-point
24708 registers in case the function takes variable arguments.  With
24709 @option{-mprototype}, only calls to prototyped variable argument functions
24710 set or clear the bit.
24712 @item -msim
24713 @opindex msim
24714 On embedded PowerPC systems, assume that the startup module is called
24715 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
24716 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
24717 configurations.
24719 @item -mmvme
24720 @opindex mmvme
24721 On embedded PowerPC systems, assume that the startup module is called
24722 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
24723 @file{libc.a}.
24725 @item -mads
24726 @opindex mads
24727 On embedded PowerPC systems, assume that the startup module is called
24728 @file{crt0.o} and the standard C libraries are @file{libads.a} and
24729 @file{libc.a}.
24731 @item -myellowknife
24732 @opindex myellowknife
24733 On embedded PowerPC systems, assume that the startup module is called
24734 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
24735 @file{libc.a}.
24737 @item -mvxworks
24738 @opindex mvxworks
24739 On System V.4 and embedded PowerPC systems, specify that you are
24740 compiling for a VxWorks system.
24742 @item -memb
24743 @opindex memb
24744 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
24745 header to indicate that @samp{eabi} extended relocations are used.
24747 @item -meabi
24748 @itemx -mno-eabi
24749 @opindex meabi
24750 @opindex mno-eabi
24751 On System V.4 and embedded PowerPC systems do (do not) adhere to the
24752 Embedded Applications Binary Interface (EABI), which is a set of
24753 modifications to the System V.4 specifications.  Selecting @option{-meabi}
24754 means that the stack is aligned to an 8-byte boundary, a function
24755 @code{__eabi} is called from @code{main} to set up the EABI
24756 environment, and the @option{-msdata} option can use both @code{r2} and
24757 @code{r13} to point to two separate small data areas.  Selecting
24758 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
24759 no EABI initialization function is called from @code{main}, and the
24760 @option{-msdata} option only uses @code{r13} to point to a single
24761 small data area.  The @option{-meabi} option is on by default if you
24762 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
24764 @item -msdata=eabi
24765 @opindex msdata=eabi
24766 On System V.4 and embedded PowerPC systems, put small initialized
24767 @code{const} global and static data in the @code{.sdata2} section, which
24768 is pointed to by register @code{r2}.  Put small initialized
24769 non-@code{const} global and static data in the @code{.sdata} section,
24770 which is pointed to by register @code{r13}.  Put small uninitialized
24771 global and static data in the @code{.sbss} section, which is adjacent to
24772 the @code{.sdata} section.  The @option{-msdata=eabi} option is
24773 incompatible with the @option{-mrelocatable} option.  The
24774 @option{-msdata=eabi} option also sets the @option{-memb} option.
24776 @item -msdata=sysv
24777 @opindex msdata=sysv
24778 On System V.4 and embedded PowerPC systems, put small global and static
24779 data in the @code{.sdata} section, which is pointed to by register
24780 @code{r13}.  Put small uninitialized global and static data in the
24781 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
24782 The @option{-msdata=sysv} option is incompatible with the
24783 @option{-mrelocatable} option.
24785 @item -msdata=default
24786 @itemx -msdata
24787 @opindex msdata=default
24788 @opindex msdata
24789 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
24790 compile code the same as @option{-msdata=eabi}, otherwise compile code the
24791 same as @option{-msdata=sysv}.
24793 @item -msdata=data
24794 @opindex msdata=data
24795 On System V.4 and embedded PowerPC systems, put small global
24796 data in the @code{.sdata} section.  Put small uninitialized global
24797 data in the @code{.sbss} section.  Do not use register @code{r13}
24798 to address small data however.  This is the default behavior unless
24799 other @option{-msdata} options are used.
24801 @item -msdata=none
24802 @itemx -mno-sdata
24803 @opindex msdata=none
24804 @opindex mno-sdata
24805 On embedded PowerPC systems, put all initialized global and static data
24806 in the @code{.data} section, and all uninitialized data in the
24807 @code{.bss} section.
24809 @item -mreadonly-in-sdata
24810 @opindex mreadonly-in-sdata
24811 @opindex mno-readonly-in-sdata
24812 Put read-only objects in the @code{.sdata} section as well.  This is the
24813 default.
24815 @item -mblock-move-inline-limit=@var{num}
24816 @opindex mblock-move-inline-limit
24817 Inline all block moves (such as calls to @code{memcpy} or structure
24818 copies) less than or equal to @var{num} bytes.  The minimum value for
24819 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
24820 targets.  The default value is target-specific.
24822 @item -mblock-compare-inline-limit=@var{num}
24823 @opindex mblock-compare-inline-limit
24824 Generate non-looping inline code for all block compares (such as calls
24825 to @code{memcmp} or structure compares) less than or equal to @var{num}
24826 bytes. If @var{num} is 0, all inline expansion (non-loop and loop) of
24827 block compare is disabled. The default value is target-specific.
24829 @item -mblock-compare-inline-loop-limit=@var{num}
24830 @opindex mblock-compare-inline-loop-limit
24831 Generate an inline expansion using loop code for all block compares that
24832 are less than or equal to @var{num} bytes, but greater than the limit
24833 for non-loop inline block compare expansion. If the block length is not
24834 constant, at most @var{num} bytes will be compared before @code{memcmp}
24835 is called to compare the remainder of the block. The default value is
24836 target-specific.
24838 @item -mstring-compare-inline-limit=@var{num}
24839 @opindex mstring-compare-inline-limit
24840 Compare at most @var{num} string bytes with inline code.
24841 If the difference or end of string is not found at the
24842 end of the inline compare a call to @code{strcmp} or @code{strncmp} will
24843 take care of the rest of the comparison. The default is 64 bytes.
24845 @item -G @var{num}
24846 @opindex G
24847 @cindex smaller data references (PowerPC)
24848 @cindex .sdata/.sdata2 references (PowerPC)
24849 On embedded PowerPC systems, put global and static items less than or
24850 equal to @var{num} bytes into the small data or BSS sections instead of
24851 the normal data or BSS section.  By default, @var{num} is 8.  The
24852 @option{-G @var{num}} switch is also passed to the linker.
24853 All modules should be compiled with the same @option{-G @var{num}} value.
24855 @item -mregnames
24856 @itemx -mno-regnames
24857 @opindex mregnames
24858 @opindex mno-regnames
24859 On System V.4 and embedded PowerPC systems do (do not) emit register
24860 names in the assembly language output using symbolic forms.
24862 @item -mlongcall
24863 @itemx -mno-longcall
24864 @opindex mlongcall
24865 @opindex mno-longcall
24866 By default assume that all calls are far away so that a longer and more
24867 expensive calling sequence is required.  This is required for calls
24868 farther than 32 megabytes (33,554,432 bytes) from the current location.
24869 A short call is generated if the compiler knows
24870 the call cannot be that far away.  This setting can be overridden by
24871 the @code{shortcall} function attribute, or by @code{#pragma
24872 longcall(0)}.
24874 Some linkers are capable of detecting out-of-range calls and generating
24875 glue code on the fly.  On these systems, long calls are unnecessary and
24876 generate slower code.  As of this writing, the AIX linker can do this,
24877 as can the GNU linker for PowerPC/64.  It is planned to add this feature
24878 to the GNU linker for 32-bit PowerPC systems as well.
24880 On PowerPC64 ELFv2 and 32-bit PowerPC systems with newer GNU linkers,
24881 GCC can generate long calls using an inline PLT call sequence (see
24882 @option{-mpltseq}).  PowerPC with @option{-mbss-plt} and PowerPC64
24883 ELFv1 (big-endian) do not support inline PLT calls.
24885 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
24886 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
24887 addresses represent the callee and the branch island.  The
24888 Darwin/PPC linker prefers the first address and generates a @code{bl
24889 callee} if the PPC @code{bl} instruction reaches the callee directly;
24890 otherwise, the linker generates @code{bl L42} to call the branch
24891 island.  The branch island is appended to the body of the
24892 calling function; it computes the full 32-bit address of the callee
24893 and jumps to it.
24895 On Mach-O (Darwin) systems, this option directs the compiler emit to
24896 the glue for every direct call, and the Darwin linker decides whether
24897 to use or discard it.
24899 In the future, GCC may ignore all longcall specifications
24900 when the linker is known to generate glue.
24902 @item -mpltseq
24903 @itemx -mno-pltseq
24904 @opindex mpltseq
24905 @opindex mno-pltseq
24906 Implement (do not implement) -fno-plt and long calls using an inline
24907 PLT call sequence that supports lazy linking and long calls to
24908 functions in dlopen'd shared libraries.  Inline PLT calls are only
24909 supported on PowerPC64 ELFv2 and 32-bit PowerPC systems with newer GNU
24910 linkers, and are enabled by default if the support is detected when
24911 configuring GCC, and, in the case of 32-bit PowerPC, if GCC is
24912 configured with @option{--enable-secureplt}.  @option{-mpltseq} code
24913 and @option{-mbss-plt} 32-bit PowerPC relocatable objects may not be
24914 linked together.
24916 @item -mtls-markers
24917 @itemx -mno-tls-markers
24918 @opindex mtls-markers
24919 @opindex mno-tls-markers
24920 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
24921 specifying the function argument.  The relocation allows the linker to
24922 reliably associate function call with argument setup instructions for
24923 TLS optimization, which in turn allows GCC to better schedule the
24924 sequence.
24926 @item -mrecip
24927 @itemx -mno-recip
24928 @opindex mrecip
24929 This option enables use of the reciprocal estimate and
24930 reciprocal square root estimate instructions with additional
24931 Newton-Raphson steps to increase precision instead of doing a divide or
24932 square root and divide for floating-point arguments.  You should use
24933 the @option{-ffast-math} option when using @option{-mrecip} (or at
24934 least @option{-funsafe-math-optimizations},
24935 @option{-ffinite-math-only}, @option{-freciprocal-math} and
24936 @option{-fno-trapping-math}).  Note that while the throughput of the
24937 sequence is generally higher than the throughput of the non-reciprocal
24938 instruction, the precision of the sequence can be decreased by up to 2
24939 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
24940 roots.
24942 @item -mrecip=@var{opt}
24943 @opindex mrecip=opt
24944 This option controls which reciprocal estimate instructions
24945 may be used.  @var{opt} is a comma-separated list of options, which may
24946 be preceded by a @code{!} to invert the option:
24948 @table @samp
24950 @item all
24951 Enable all estimate instructions.
24953 @item default 
24954 Enable the default instructions, equivalent to @option{-mrecip}.
24956 @item none 
24957 Disable all estimate instructions, equivalent to @option{-mno-recip}.
24959 @item div 
24960 Enable the reciprocal approximation instructions for both 
24961 single and double precision.
24963 @item divf 
24964 Enable the single-precision reciprocal approximation instructions.
24966 @item divd 
24967 Enable the double-precision reciprocal approximation instructions.
24969 @item rsqrt 
24970 Enable the reciprocal square root approximation instructions for both
24971 single and double precision.
24973 @item rsqrtf 
24974 Enable the single-precision reciprocal square root approximation instructions.
24976 @item rsqrtd 
24977 Enable the double-precision reciprocal square root approximation instructions.
24979 @end table
24981 So, for example, @option{-mrecip=all,!rsqrtd} enables
24982 all of the reciprocal estimate instructions, except for the
24983 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
24984 which handle the double-precision reciprocal square root calculations.
24986 @item -mrecip-precision
24987 @itemx -mno-recip-precision
24988 @opindex mrecip-precision
24989 Assume (do not assume) that the reciprocal estimate instructions
24990 provide higher-precision estimates than is mandated by the PowerPC
24991 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
24992 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
24993 The double-precision square root estimate instructions are not generated by
24994 default on low-precision machines, since they do not provide an
24995 estimate that converges after three steps.
24997 @item -mveclibabi=@var{type}
24998 @opindex mveclibabi
24999 Specifies the ABI type to use for vectorizing intrinsics using an
25000 external library.  The only type supported at present is @samp{mass},
25001 which specifies to use IBM's Mathematical Acceleration Subsystem
25002 (MASS) libraries for vectorizing intrinsics using external libraries.
25003 GCC currently emits calls to @code{acosd2}, @code{acosf4},
25004 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
25005 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
25006 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
25007 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
25008 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
25009 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
25010 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
25011 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
25012 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
25013 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
25014 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
25015 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
25016 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
25017 for power7.  Both @option{-ftree-vectorize} and
25018 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
25019 libraries must be specified at link time.
25021 @item -mfriz
25022 @itemx -mno-friz
25023 @opindex mfriz
25024 Generate (do not generate) the @code{friz} instruction when the
25025 @option{-funsafe-math-optimizations} option is used to optimize
25026 rounding of floating-point values to 64-bit integer and back to floating
25027 point.  The @code{friz} instruction does not return the same value if
25028 the floating-point number is too large to fit in an integer.
25030 @item -mpointers-to-nested-functions
25031 @itemx -mno-pointers-to-nested-functions
25032 @opindex mpointers-to-nested-functions
25033 Generate (do not generate) code to load up the static chain register
25034 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
25035 systems where a function pointer points to a 3-word descriptor giving
25036 the function address, TOC value to be loaded in register @code{r2}, and
25037 static chain value to be loaded in register @code{r11}.  The
25038 @option{-mpointers-to-nested-functions} is on by default.  You cannot
25039 call through pointers to nested functions or pointers
25040 to functions compiled in other languages that use the static chain if
25041 you use @option{-mno-pointers-to-nested-functions}.
25043 @item -msave-toc-indirect
25044 @itemx -mno-save-toc-indirect
25045 @opindex msave-toc-indirect
25046 Generate (do not generate) code to save the TOC value in the reserved
25047 stack location in the function prologue if the function calls through
25048 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
25049 saved in the prologue, it is saved just before the call through the
25050 pointer.  The @option{-mno-save-toc-indirect} option is the default.
25052 @item -mcompat-align-parm
25053 @itemx -mno-compat-align-parm
25054 @opindex mcompat-align-parm
25055 Generate (do not generate) code to pass structure parameters with a
25056 maximum alignment of 64 bits, for compatibility with older versions
25057 of GCC.
25059 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
25060 structure parameter on a 128-bit boundary when that structure contained
25061 a member requiring 128-bit alignment.  This is corrected in more
25062 recent versions of GCC.  This option may be used to generate code
25063 that is compatible with functions compiled with older versions of
25064 GCC.
25066 The @option{-mno-compat-align-parm} option is the default.
25068 @item -mstack-protector-guard=@var{guard}
25069 @itemx -mstack-protector-guard-reg=@var{reg}
25070 @itemx -mstack-protector-guard-offset=@var{offset}
25071 @itemx -mstack-protector-guard-symbol=@var{symbol}
25072 @opindex mstack-protector-guard
25073 @opindex mstack-protector-guard-reg
25074 @opindex mstack-protector-guard-offset
25075 @opindex mstack-protector-guard-symbol
25076 Generate stack protection code using canary at @var{guard}.  Supported
25077 locations are @samp{global} for global canary or @samp{tls} for per-thread
25078 canary in the TLS block (the default with GNU libc version 2.4 or later).
25080 With the latter choice the options
25081 @option{-mstack-protector-guard-reg=@var{reg}} and
25082 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
25083 which register to use as base register for reading the canary, and from what
25084 offset from that base register. The default for those is as specified in the
25085 relevant ABI.  @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
25086 the offset with a symbol reference to a canary in the TLS block.
25087 @end table
25089 @node RX Options
25090 @subsection RX Options
25091 @cindex RX Options
25093 These command-line options are defined for RX targets:
25095 @table @gcctabopt
25096 @item -m64bit-doubles
25097 @itemx -m32bit-doubles
25098 @opindex m64bit-doubles
25099 @opindex m32bit-doubles
25100 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
25101 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
25102 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
25103 works on 32-bit values, which is why the default is
25104 @option{-m32bit-doubles}.
25106 @item -fpu
25107 @itemx -nofpu
25108 @opindex fpu
25109 @opindex nofpu
25110 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
25111 floating-point hardware.  The default is enabled for the RX600
25112 series and disabled for the RX200 series.
25114 Floating-point instructions are only generated for 32-bit floating-point 
25115 values, however, so the FPU hardware is not used for doubles if the
25116 @option{-m64bit-doubles} option is used.
25118 @emph{Note} If the @option{-fpu} option is enabled then
25119 @option{-funsafe-math-optimizations} is also enabled automatically.
25120 This is because the RX FPU instructions are themselves unsafe.
25122 @item -mcpu=@var{name}
25123 @opindex mcpu
25124 Selects the type of RX CPU to be targeted.  Currently three types are
25125 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
25126 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
25128 The only difference between @samp{RX600} and @samp{RX610} is that the
25129 @samp{RX610} does not support the @code{MVTIPL} instruction.
25131 The @samp{RX200} series does not have a hardware floating-point unit
25132 and so @option{-nofpu} is enabled by default when this type is
25133 selected.
25135 @item -mbig-endian-data
25136 @itemx -mlittle-endian-data
25137 @opindex mbig-endian-data
25138 @opindex mlittle-endian-data
25139 Store data (but not code) in the big-endian format.  The default is
25140 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
25141 format.
25143 @item -msmall-data-limit=@var{N}
25144 @opindex msmall-data-limit
25145 Specifies the maximum size in bytes of global and static variables
25146 which can be placed into the small data area.  Using the small data
25147 area can lead to smaller and faster code, but the size of area is
25148 limited and it is up to the programmer to ensure that the area does
25149 not overflow.  Also when the small data area is used one of the RX's
25150 registers (usually @code{r13}) is reserved for use pointing to this
25151 area, so it is no longer available for use by the compiler.  This
25152 could result in slower and/or larger code if variables are pushed onto
25153 the stack instead of being held in this register.
25155 Note, common variables (variables that have not been initialized) and
25156 constants are not placed into the small data area as they are assigned
25157 to other sections in the output executable.
25159 The default value is zero, which disables this feature.  Note, this
25160 feature is not enabled by default with higher optimization levels
25161 (@option{-O2} etc) because of the potentially detrimental effects of
25162 reserving a register.  It is up to the programmer to experiment and
25163 discover whether this feature is of benefit to their program.  See the
25164 description of the @option{-mpid} option for a description of how the
25165 actual register to hold the small data area pointer is chosen.
25167 @item -msim
25168 @itemx -mno-sim
25169 @opindex msim
25170 @opindex mno-sim
25171 Use the simulator runtime.  The default is to use the libgloss
25172 board-specific runtime.
25174 @item -mas100-syntax
25175 @itemx -mno-as100-syntax
25176 @opindex mas100-syntax
25177 @opindex mno-as100-syntax
25178 When generating assembler output use a syntax that is compatible with
25179 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
25180 assembler, but it has some restrictions so it is not generated by default.
25182 @item -mmax-constant-size=@var{N}
25183 @opindex mmax-constant-size
25184 Specifies the maximum size, in bytes, of a constant that can be used as
25185 an operand in a RX instruction.  Although the RX instruction set does
25186 allow constants of up to 4 bytes in length to be used in instructions,
25187 a longer value equates to a longer instruction.  Thus in some
25188 circumstances it can be beneficial to restrict the size of constants
25189 that are used in instructions.  Constants that are too big are instead
25190 placed into a constant pool and referenced via register indirection.
25192 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
25193 or 4 means that constants of any size are allowed.
25195 @item -mrelax
25196 @opindex mrelax
25197 Enable linker relaxation.  Linker relaxation is a process whereby the
25198 linker attempts to reduce the size of a program by finding shorter
25199 versions of various instructions.  Disabled by default.
25201 @item -mint-register=@var{N}
25202 @opindex mint-register
25203 Specify the number of registers to reserve for fast interrupt handler
25204 functions.  The value @var{N} can be between 0 and 4.  A value of 1
25205 means that register @code{r13} is reserved for the exclusive use
25206 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
25207 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
25208 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
25209 A value of 0, the default, does not reserve any registers.
25211 @item -msave-acc-in-interrupts
25212 @opindex msave-acc-in-interrupts
25213 Specifies that interrupt handler functions should preserve the
25214 accumulator register.  This is only necessary if normal code might use
25215 the accumulator register, for example because it performs 64-bit
25216 multiplications.  The default is to ignore the accumulator as this
25217 makes the interrupt handlers faster.
25219 @item -mpid
25220 @itemx -mno-pid
25221 @opindex mpid
25222 @opindex mno-pid
25223 Enables the generation of position independent data.  When enabled any
25224 access to constant data is done via an offset from a base address
25225 held in a register.  This allows the location of constant data to be
25226 determined at run time without requiring the executable to be
25227 relocated, which is a benefit to embedded applications with tight
25228 memory constraints.  Data that can be modified is not affected by this
25229 option.
25231 Note, using this feature reserves a register, usually @code{r13}, for
25232 the constant data base address.  This can result in slower and/or
25233 larger code, especially in complicated functions.
25235 The actual register chosen to hold the constant data base address
25236 depends upon whether the @option{-msmall-data-limit} and/or the
25237 @option{-mint-register} command-line options are enabled.  Starting
25238 with register @code{r13} and proceeding downwards, registers are
25239 allocated first to satisfy the requirements of @option{-mint-register},
25240 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
25241 is possible for the small data area register to be @code{r8} if both
25242 @option{-mint-register=4} and @option{-mpid} are specified on the
25243 command line.
25245 By default this feature is not enabled.  The default can be restored
25246 via the @option{-mno-pid} command-line option.
25248 @item -mno-warn-multiple-fast-interrupts
25249 @itemx -mwarn-multiple-fast-interrupts
25250 @opindex mno-warn-multiple-fast-interrupts
25251 @opindex mwarn-multiple-fast-interrupts
25252 Prevents GCC from issuing a warning message if it finds more than one
25253 fast interrupt handler when it is compiling a file.  The default is to
25254 issue a warning for each extra fast interrupt handler found, as the RX
25255 only supports one such interrupt.
25257 @item -mallow-string-insns
25258 @itemx -mno-allow-string-insns
25259 @opindex mallow-string-insns
25260 @opindex mno-allow-string-insns
25261 Enables or disables the use of the string manipulation instructions
25262 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
25263 @code{SWHILE} and also the @code{RMPA} instruction.  These
25264 instructions may prefetch data, which is not safe to do if accessing
25265 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
25266 for more information).
25268 The default is to allow these instructions, but it is not possible for
25269 GCC to reliably detect all circumstances where a string instruction
25270 might be used to access an I/O register, so their use cannot be
25271 disabled automatically.  Instead it is reliant upon the programmer to
25272 use the @option{-mno-allow-string-insns} option if their program
25273 accesses I/O space.
25275 When the instructions are enabled GCC defines the C preprocessor
25276 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
25277 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
25279 @item -mjsr
25280 @itemx -mno-jsr
25281 @opindex mjsr
25282 @opindex mno-jsr
25283 Use only (or not only) @code{JSR} instructions to access functions.
25284 This option can be used when code size exceeds the range of @code{BSR}
25285 instructions.  Note that @option{-mno-jsr} does not mean to not use
25286 @code{JSR} but instead means that any type of branch may be used.
25287 @end table
25289 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
25290 has special significance to the RX port when used with the
25291 @code{interrupt} function attribute.  This attribute indicates a
25292 function intended to process fast interrupts.  GCC ensures
25293 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
25294 and/or @code{r13} and only provided that the normal use of the
25295 corresponding registers have been restricted via the
25296 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
25297 options.
25299 @node S/390 and zSeries Options
25300 @subsection S/390 and zSeries Options
25301 @cindex S/390 and zSeries Options
25303 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
25305 @table @gcctabopt
25306 @item -mhard-float
25307 @itemx -msoft-float
25308 @opindex mhard-float
25309 @opindex msoft-float
25310 Use (do not use) the hardware floating-point instructions and registers
25311 for floating-point operations.  When @option{-msoft-float} is specified,
25312 functions in @file{libgcc.a} are used to perform floating-point
25313 operations.  When @option{-mhard-float} is specified, the compiler
25314 generates IEEE floating-point instructions.  This is the default.
25316 @item -mhard-dfp
25317 @itemx -mno-hard-dfp
25318 @opindex mhard-dfp
25319 @opindex mno-hard-dfp
25320 Use (do not use) the hardware decimal-floating-point instructions for
25321 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
25322 specified, functions in @file{libgcc.a} are used to perform
25323 decimal-floating-point operations.  When @option{-mhard-dfp} is
25324 specified, the compiler generates decimal-floating-point hardware
25325 instructions.  This is the default for @option{-march=z9-ec} or higher.
25327 @item -mlong-double-64
25328 @itemx -mlong-double-128
25329 @opindex mlong-double-64
25330 @opindex mlong-double-128
25331 These switches control the size of @code{long double} type. A size
25332 of 64 bits makes the @code{long double} type equivalent to the @code{double}
25333 type. This is the default.
25335 @item -mbackchain
25336 @itemx -mno-backchain
25337 @opindex mbackchain
25338 @opindex mno-backchain
25339 Store (do not store) the address of the caller's frame as backchain pointer
25340 into the callee's stack frame.
25341 A backchain may be needed to allow debugging using tools that do not understand
25342 DWARF call frame information.
25343 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
25344 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
25345 the backchain is placed into the topmost word of the 96/160 byte register
25346 save area.
25348 In general, code compiled with @option{-mbackchain} is call-compatible with
25349 code compiled with @option{-mmo-backchain}; however, use of the backchain
25350 for debugging purposes usually requires that the whole binary is built with
25351 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
25352 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
25353 to build a linux kernel use @option{-msoft-float}.
25355 The default is to not maintain the backchain.
25357 @item -mpacked-stack
25358 @itemx -mno-packed-stack
25359 @opindex mpacked-stack
25360 @opindex mno-packed-stack
25361 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
25362 specified, the compiler uses the all fields of the 96/160 byte register save
25363 area only for their default purpose; unused fields still take up stack space.
25364 When @option{-mpacked-stack} is specified, register save slots are densely
25365 packed at the top of the register save area; unused space is reused for other
25366 purposes, allowing for more efficient use of the available stack space.
25367 However, when @option{-mbackchain} is also in effect, the topmost word of
25368 the save area is always used to store the backchain, and the return address
25369 register is always saved two words below the backchain.
25371 As long as the stack frame backchain is not used, code generated with
25372 @option{-mpacked-stack} is call-compatible with code generated with
25373 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
25374 S/390 or zSeries generated code that uses the stack frame backchain at run
25375 time, not just for debugging purposes.  Such code is not call-compatible
25376 with code compiled with @option{-mpacked-stack}.  Also, note that the
25377 combination of @option{-mbackchain},
25378 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
25379 to build a linux kernel use @option{-msoft-float}.
25381 The default is to not use the packed stack layout.
25383 @item -msmall-exec
25384 @itemx -mno-small-exec
25385 @opindex msmall-exec
25386 @opindex mno-small-exec
25387 Generate (or do not generate) code using the @code{bras} instruction
25388 to do subroutine calls.
25389 This only works reliably if the total executable size does not
25390 exceed 64k.  The default is to use the @code{basr} instruction instead,
25391 which does not have this limitation.
25393 @item -m64
25394 @itemx -m31
25395 @opindex m64
25396 @opindex m31
25397 When @option{-m31} is specified, generate code compliant to the
25398 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
25399 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
25400 particular to generate 64-bit instructions.  For the @samp{s390}
25401 targets, the default is @option{-m31}, while the @samp{s390x}
25402 targets default to @option{-m64}.
25404 @item -mzarch
25405 @itemx -mesa
25406 @opindex mzarch
25407 @opindex mesa
25408 When @option{-mzarch} is specified, generate code using the
25409 instructions available on z/Architecture.
25410 When @option{-mesa} is specified, generate code using the
25411 instructions available on ESA/390.  Note that @option{-mesa} is
25412 not possible with @option{-m64}.
25413 When generating code compliant to the GNU/Linux for S/390 ABI,
25414 the default is @option{-mesa}.  When generating code compliant
25415 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
25417 @item -mhtm
25418 @itemx -mno-htm
25419 @opindex mhtm
25420 @opindex mno-htm
25421 The @option{-mhtm} option enables a set of builtins making use of
25422 instructions available with the transactional execution facility
25423 introduced with the IBM zEnterprise EC12 machine generation
25424 @ref{S/390 System z Built-in Functions}.
25425 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
25427 @item -mvx
25428 @itemx -mno-vx
25429 @opindex mvx
25430 @opindex mno-vx
25431 When @option{-mvx} is specified, generate code using the instructions
25432 available with the vector extension facility introduced with the IBM
25433 z13 machine generation.
25434 This option changes the ABI for some vector type values with regard to
25435 alignment and calling conventions.  In case vector type values are
25436 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
25437 command will be added to mark the resulting binary with the ABI used.
25438 @option{-mvx} is enabled by default when using @option{-march=z13}.
25440 @item -mzvector
25441 @itemx -mno-zvector
25442 @opindex mzvector
25443 @opindex mno-zvector
25444 The @option{-mzvector} option enables vector language extensions and
25445 builtins using instructions available with the vector extension
25446 facility introduced with the IBM z13 machine generation.
25447 This option adds support for @samp{vector} to be used as a keyword to
25448 define vector type variables and arguments.  @samp{vector} is only
25449 available when GNU extensions are enabled.  It will not be expanded
25450 when requesting strict standard compliance e.g.@: with @option{-std=c99}.
25451 In addition to the GCC low-level builtins @option{-mzvector} enables
25452 a set of builtins added for compatibility with AltiVec-style
25453 implementations like Power and Cell.  In order to make use of these
25454 builtins the header file @file{vecintrin.h} needs to be included.
25455 @option{-mzvector} is disabled by default.
25457 @item -mmvcle
25458 @itemx -mno-mvcle
25459 @opindex mmvcle
25460 @opindex mno-mvcle
25461 Generate (or do not generate) code using the @code{mvcle} instruction
25462 to perform block moves.  When @option{-mno-mvcle} is specified,
25463 use a @code{mvc} loop instead.  This is the default unless optimizing for
25464 size.
25466 @item -mdebug
25467 @itemx -mno-debug
25468 @opindex mdebug
25469 @opindex mno-debug
25470 Print (or do not print) additional debug information when compiling.
25471 The default is to not print debug information.
25473 @item -march=@var{cpu-type}
25474 @opindex march
25475 Generate code that runs on @var{cpu-type}, which is the name of a
25476 system representing a certain processor type.  Possible values for
25477 @var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
25478 @samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
25479 @samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11},
25480 @samp{z14}/@samp{arch12}, and @samp{native}.
25482 The default is @option{-march=z900}.
25484 Specifying @samp{native} as cpu type can be used to select the best
25485 architecture option for the host processor.
25486 @option{-march=native} has no effect if GCC does not recognize the
25487 processor.
25489 @item -mtune=@var{cpu-type}
25490 @opindex mtune
25491 Tune to @var{cpu-type} everything applicable about the generated code,
25492 except for the ABI and the set of available instructions.
25493 The list of @var{cpu-type} values is the same as for @option{-march}.
25494 The default is the value used for @option{-march}.
25496 @item -mtpf-trace
25497 @itemx -mno-tpf-trace
25498 @opindex mtpf-trace
25499 @opindex mno-tpf-trace
25500 Generate code that adds (does not add) in TPF OS specific branches to trace
25501 routines in the operating system.  This option is off by default, even
25502 when compiling for the TPF OS@.
25504 @item -mfused-madd
25505 @itemx -mno-fused-madd
25506 @opindex mfused-madd
25507 @opindex mno-fused-madd
25508 Generate code that uses (does not use) the floating-point multiply and
25509 accumulate instructions.  These instructions are generated by default if
25510 hardware floating point is used.
25512 @item -mwarn-framesize=@var{framesize}
25513 @opindex mwarn-framesize
25514 Emit a warning if the current function exceeds the given frame size.  Because
25515 this is a compile-time check it doesn't need to be a real problem when the program
25516 runs.  It is intended to identify functions that most probably cause
25517 a stack overflow.  It is useful to be used in an environment with limited stack
25518 size e.g.@: the linux kernel.
25520 @item -mwarn-dynamicstack
25521 @opindex mwarn-dynamicstack
25522 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
25523 arrays.  This is generally a bad idea with a limited stack size.
25525 @item -mstack-guard=@var{stack-guard}
25526 @itemx -mstack-size=@var{stack-size}
25527 @opindex mstack-guard
25528 @opindex mstack-size
25529 If these options are provided the S/390 back end emits additional instructions in
25530 the function prologue that trigger a trap if the stack size is @var{stack-guard}
25531 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
25532 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
25533 the frame size of the compiled function is chosen.
25534 These options are intended to be used to help debugging stack overflow problems.
25535 The additionally emitted code causes only little overhead and hence can also be
25536 used in production-like systems without greater performance degradation.  The given
25537 values have to be exact powers of 2 and @var{stack-size} has to be greater than
25538 @var{stack-guard} without exceeding 64k.
25539 In order to be efficient the extra code makes the assumption that the stack starts
25540 at an address aligned to the value given by @var{stack-size}.
25541 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
25543 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
25544 @opindex mhotpatch
25545 If the hotpatch option is enabled, a ``hot-patching'' function
25546 prologue is generated for all functions in the compilation unit.
25547 The funtion label is prepended with the given number of two-byte
25548 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
25549 the label, 2 * @var{post-halfwords} bytes are appended, using the
25550 largest NOP like instructions the architecture allows (maximum
25551 1000000).
25553 If both arguments are zero, hotpatching is disabled.
25555 This option can be overridden for individual functions with the
25556 @code{hotpatch} attribute.
25557 @end table
25559 @node Score Options
25560 @subsection Score Options
25561 @cindex Score Options
25563 These options are defined for Score implementations:
25565 @table @gcctabopt
25566 @item -meb
25567 @opindex meb
25568 Compile code for big-endian mode.  This is the default.
25570 @item -mel
25571 @opindex mel
25572 Compile code for little-endian mode.
25574 @item -mnhwloop
25575 @opindex mnhwloop
25576 Disable generation of @code{bcnz} instructions.
25578 @item -muls
25579 @opindex muls
25580 Enable generation of unaligned load and store instructions.
25582 @item -mmac
25583 @opindex mmac
25584 Enable the use of multiply-accumulate instructions. Disabled by default.
25586 @item -mscore5
25587 @opindex mscore5
25588 Specify the SCORE5 as the target architecture.
25590 @item -mscore5u
25591 @opindex mscore5u
25592 Specify the SCORE5U of the target architecture.
25594 @item -mscore7
25595 @opindex mscore7
25596 Specify the SCORE7 as the target architecture. This is the default.
25598 @item -mscore7d
25599 @opindex mscore7d
25600 Specify the SCORE7D as the target architecture.
25601 @end table
25603 @node SH Options
25604 @subsection SH Options
25606 These @samp{-m} options are defined for the SH implementations:
25608 @table @gcctabopt
25609 @item -m1
25610 @opindex m1
25611 Generate code for the SH1.
25613 @item -m2
25614 @opindex m2
25615 Generate code for the SH2.
25617 @item -m2e
25618 Generate code for the SH2e.
25620 @item -m2a-nofpu
25621 @opindex m2a-nofpu
25622 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
25623 that the floating-point unit is not used.
25625 @item -m2a-single-only
25626 @opindex m2a-single-only
25627 Generate code for the SH2a-FPU, in such a way that no double-precision
25628 floating-point operations are used.
25630 @item -m2a-single
25631 @opindex m2a-single
25632 Generate code for the SH2a-FPU assuming the floating-point unit is in
25633 single-precision mode by default.
25635 @item -m2a
25636 @opindex m2a
25637 Generate code for the SH2a-FPU assuming the floating-point unit is in
25638 double-precision mode by default.
25640 @item -m3
25641 @opindex m3
25642 Generate code for the SH3.
25644 @item -m3e
25645 @opindex m3e
25646 Generate code for the SH3e.
25648 @item -m4-nofpu
25649 @opindex m4-nofpu
25650 Generate code for the SH4 without a floating-point unit.
25652 @item -m4-single-only
25653 @opindex m4-single-only
25654 Generate code for the SH4 with a floating-point unit that only
25655 supports single-precision arithmetic.
25657 @item -m4-single
25658 @opindex m4-single
25659 Generate code for the SH4 assuming the floating-point unit is in
25660 single-precision mode by default.
25662 @item -m4
25663 @opindex m4
25664 Generate code for the SH4.
25666 @item -m4-100
25667 @opindex m4-100
25668 Generate code for SH4-100.
25670 @item -m4-100-nofpu
25671 @opindex m4-100-nofpu
25672 Generate code for SH4-100 in such a way that the
25673 floating-point unit is not used.
25675 @item -m4-100-single
25676 @opindex m4-100-single
25677 Generate code for SH4-100 assuming the floating-point unit is in
25678 single-precision mode by default.
25680 @item -m4-100-single-only
25681 @opindex m4-100-single-only
25682 Generate code for SH4-100 in such a way that no double-precision
25683 floating-point operations are used.
25685 @item -m4-200
25686 @opindex m4-200
25687 Generate code for SH4-200.
25689 @item -m4-200-nofpu
25690 @opindex m4-200-nofpu
25691 Generate code for SH4-200 without in such a way that the
25692 floating-point unit is not used.
25694 @item -m4-200-single
25695 @opindex m4-200-single
25696 Generate code for SH4-200 assuming the floating-point unit is in
25697 single-precision mode by default.
25699 @item -m4-200-single-only
25700 @opindex m4-200-single-only
25701 Generate code for SH4-200 in such a way that no double-precision
25702 floating-point operations are used.
25704 @item -m4-300
25705 @opindex m4-300
25706 Generate code for SH4-300.
25708 @item -m4-300-nofpu
25709 @opindex m4-300-nofpu
25710 Generate code for SH4-300 without in such a way that the
25711 floating-point unit is not used.
25713 @item -m4-300-single
25714 @opindex m4-300-single
25715 Generate code for SH4-300 in such a way that no double-precision
25716 floating-point operations are used.
25718 @item -m4-300-single-only
25719 @opindex m4-300-single-only
25720 Generate code for SH4-300 in such a way that no double-precision
25721 floating-point operations are used.
25723 @item -m4-340
25724 @opindex m4-340
25725 Generate code for SH4-340 (no MMU, no FPU).
25727 @item -m4-500
25728 @opindex m4-500
25729 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
25730 assembler.
25732 @item -m4a-nofpu
25733 @opindex m4a-nofpu
25734 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
25735 floating-point unit is not used.
25737 @item -m4a-single-only
25738 @opindex m4a-single-only
25739 Generate code for the SH4a, in such a way that no double-precision
25740 floating-point operations are used.
25742 @item -m4a-single
25743 @opindex m4a-single
25744 Generate code for the SH4a assuming the floating-point unit is in
25745 single-precision mode by default.
25747 @item -m4a
25748 @opindex m4a
25749 Generate code for the SH4a.
25751 @item -m4al
25752 @opindex m4al
25753 Same as @option{-m4a-nofpu}, except that it implicitly passes
25754 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
25755 instructions at the moment.
25757 @item -mb
25758 @opindex mb
25759 Compile code for the processor in big-endian mode.
25761 @item -ml
25762 @opindex ml
25763 Compile code for the processor in little-endian mode.
25765 @item -mdalign
25766 @opindex mdalign
25767 Align doubles at 64-bit boundaries.  Note that this changes the calling
25768 conventions, and thus some functions from the standard C library do
25769 not work unless you recompile it first with @option{-mdalign}.
25771 @item -mrelax
25772 @opindex mrelax
25773 Shorten some address references at link time, when possible; uses the
25774 linker option @option{-relax}.
25776 @item -mbigtable
25777 @opindex mbigtable
25778 Use 32-bit offsets in @code{switch} tables.  The default is to use
25779 16-bit offsets.
25781 @item -mbitops
25782 @opindex mbitops
25783 Enable the use of bit manipulation instructions on SH2A.
25785 @item -mfmovd
25786 @opindex mfmovd
25787 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
25788 alignment constraints.
25790 @item -mrenesas
25791 @opindex mrenesas
25792 Comply with the calling conventions defined by Renesas.
25794 @item -mno-renesas
25795 @opindex mno-renesas
25796 Comply with the calling conventions defined for GCC before the Renesas
25797 conventions were available.  This option is the default for all
25798 targets of the SH toolchain.
25800 @item -mnomacsave
25801 @opindex mnomacsave
25802 Mark the @code{MAC} register as call-clobbered, even if
25803 @option{-mrenesas} is given.
25805 @item -mieee
25806 @itemx -mno-ieee
25807 @opindex mieee
25808 @opindex mno-ieee
25809 Control the IEEE compliance of floating-point comparisons, which affects the
25810 handling of cases where the result of a comparison is unordered.  By default
25811 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
25812 enabled @option{-mno-ieee} is implicitly set, which results in faster
25813 floating-point greater-equal and less-equal comparisons.  The implicit settings
25814 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
25816 @item -minline-ic_invalidate
25817 @opindex minline-ic_invalidate
25818 Inline code to invalidate instruction cache entries after setting up
25819 nested function trampolines.
25820 This option has no effect if @option{-musermode} is in effect and the selected
25821 code generation option (e.g.@: @option{-m4}) does not allow the use of the @code{icbi}
25822 instruction.
25823 If the selected code generation option does not allow the use of the @code{icbi}
25824 instruction, and @option{-musermode} is not in effect, the inlined code
25825 manipulates the instruction cache address array directly with an associative
25826 write.  This not only requires privileged mode at run time, but it also
25827 fails if the cache line had been mapped via the TLB and has become unmapped.
25829 @item -misize
25830 @opindex misize
25831 Dump instruction size and location in the assembly code.
25833 @item -mpadstruct
25834 @opindex mpadstruct
25835 This option is deprecated.  It pads structures to multiple of 4 bytes,
25836 which is incompatible with the SH ABI@.
25838 @item -matomic-model=@var{model}
25839 @opindex matomic-model=@var{model}
25840 Sets the model of atomic operations and additional parameters as a comma
25841 separated list.  For details on the atomic built-in functions see
25842 @ref{__atomic Builtins}.  The following models and parameters are supported:
25844 @table @samp
25846 @item none
25847 Disable compiler generated atomic sequences and emit library calls for atomic
25848 operations.  This is the default if the target is not @code{sh*-*-linux*}.
25850 @item soft-gusa
25851 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
25852 built-in functions.  The generated atomic sequences require additional support
25853 from the interrupt/exception handling code of the system and are only suitable
25854 for SH3* and SH4* single-core systems.  This option is enabled by default when
25855 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
25856 this option also partially utilizes the hardware atomic instructions
25857 @code{movli.l} and @code{movco.l} to create more efficient code, unless
25858 @samp{strict} is specified.  
25860 @item soft-tcb
25861 Generate software atomic sequences that use a variable in the thread control
25862 block.  This is a variation of the gUSA sequences which can also be used on
25863 SH1* and SH2* targets.  The generated atomic sequences require additional
25864 support from the interrupt/exception handling code of the system and are only
25865 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
25866 parameter has to be specified as well.
25868 @item soft-imask
25869 Generate software atomic sequences that temporarily disable interrupts by
25870 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
25871 in privileged mode and is only suitable for single-core systems.  Additional
25872 support from the interrupt/exception handling code of the system is not
25873 required.  This model is enabled by default when the target is
25874 @code{sh*-*-linux*} and SH1* or SH2*.
25876 @item hard-llcs
25877 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
25878 instructions only.  This is only available on SH4A and is suitable for
25879 multi-core systems.  Since the hardware instructions support only 32 bit atomic
25880 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
25881 Code compiled with this option is also compatible with other software
25882 atomic model interrupt/exception handling systems if executed on an SH4A
25883 system.  Additional support from the interrupt/exception handling code of the
25884 system is not required for this model.
25886 @item gbr-offset=
25887 This parameter specifies the offset in bytes of the variable in the thread
25888 control block structure that should be used by the generated atomic sequences
25889 when the @samp{soft-tcb} model has been selected.  For other models this
25890 parameter is ignored.  The specified value must be an integer multiple of four
25891 and in the range 0-1020.
25893 @item strict
25894 This parameter prevents mixed usage of multiple atomic models, even if they
25895 are compatible, and makes the compiler generate atomic sequences of the
25896 specified model only.
25898 @end table
25900 @item -mtas
25901 @opindex mtas
25902 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
25903 Notice that depending on the particular hardware and software configuration
25904 this can degrade overall performance due to the operand cache line flushes
25905 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
25906 processors the @code{tas.b} instruction must be used with caution since it
25907 can result in data corruption for certain cache configurations.
25909 @item -mprefergot
25910 @opindex mprefergot
25911 When generating position-independent code, emit function calls using
25912 the Global Offset Table instead of the Procedure Linkage Table.
25914 @item -musermode
25915 @itemx -mno-usermode
25916 @opindex musermode
25917 @opindex mno-usermode
25918 Don't allow (allow) the compiler generating privileged mode code.  Specifying
25919 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
25920 inlined code would not work in user mode.  @option{-musermode} is the default
25921 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
25922 @option{-musermode} has no effect, since there is no user mode.
25924 @item -multcost=@var{number}
25925 @opindex multcost=@var{number}
25926 Set the cost to assume for a multiply insn.
25928 @item -mdiv=@var{strategy}
25929 @opindex mdiv=@var{strategy}
25930 Set the division strategy to be used for integer division operations.
25931 @var{strategy} can be one of: 
25933 @table @samp
25935 @item call-div1
25936 Calls a library function that uses the single-step division instruction
25937 @code{div1} to perform the operation.  Division by zero calculates an
25938 unspecified result and does not trap.  This is the default except for SH4,
25939 SH2A and SHcompact.
25941 @item call-fp
25942 Calls a library function that performs the operation in double precision
25943 floating point.  Division by zero causes a floating-point exception.  This is
25944 the default for SHcompact with FPU.  Specifying this for targets that do not
25945 have a double precision FPU defaults to @code{call-div1}.
25947 @item call-table
25948 Calls a library function that uses a lookup table for small divisors and
25949 the @code{div1} instruction with case distinction for larger divisors.  Division
25950 by zero calculates an unspecified result and does not trap.  This is the default
25951 for SH4.  Specifying this for targets that do not have dynamic shift
25952 instructions defaults to @code{call-div1}.
25954 @end table
25956 When a division strategy has not been specified the default strategy is
25957 selected based on the current target.  For SH2A the default strategy is to
25958 use the @code{divs} and @code{divu} instructions instead of library function
25959 calls.
25961 @item -maccumulate-outgoing-args
25962 @opindex maccumulate-outgoing-args
25963 Reserve space once for outgoing arguments in the function prologue rather
25964 than around each call.  Generally beneficial for performance and size.  Also
25965 needed for unwinding to avoid changing the stack frame around conditional code.
25967 @item -mdivsi3_libfunc=@var{name}
25968 @opindex mdivsi3_libfunc=@var{name}
25969 Set the name of the library function used for 32-bit signed division to
25970 @var{name}.
25971 This only affects the name used in the @samp{call} division strategies, and
25972 the compiler still expects the same sets of input/output/clobbered registers as
25973 if this option were not present.
25975 @item -mfixed-range=@var{register-range}
25976 @opindex mfixed-range
25977 Generate code treating the given register range as fixed registers.
25978 A fixed register is one that the register allocator cannot use.  This is
25979 useful when compiling kernel code.  A register range is specified as
25980 two registers separated by a dash.  Multiple register ranges can be
25981 specified separated by a comma.
25983 @item -mbranch-cost=@var{num}
25984 @opindex mbranch-cost=@var{num}
25985 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
25986 make the compiler try to generate more branch-free code if possible.  
25987 If not specified the value is selected depending on the processor type that
25988 is being compiled for.
25990 @item -mzdcbranch
25991 @itemx -mno-zdcbranch
25992 @opindex mzdcbranch
25993 @opindex mno-zdcbranch
25994 Assume (do not assume) that zero displacement conditional branch instructions
25995 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
25996 compiler prefers zero displacement branch code sequences.  This is
25997 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
25998 disabled by specifying @option{-mno-zdcbranch}.
26000 @item -mcbranch-force-delay-slot
26001 @opindex mcbranch-force-delay-slot
26002 Force the usage of delay slots for conditional branches, which stuffs the delay
26003 slot with a @code{nop} if a suitable instruction cannot be found.  By default
26004 this option is disabled.  It can be enabled to work around hardware bugs as
26005 found in the original SH7055.
26007 @item -mfused-madd
26008 @itemx -mno-fused-madd
26009 @opindex mfused-madd
26010 @opindex mno-fused-madd
26011 Generate code that uses (does not use) the floating-point multiply and
26012 accumulate instructions.  These instructions are generated by default
26013 if hardware floating point is used.  The machine-dependent
26014 @option{-mfused-madd} option is now mapped to the machine-independent
26015 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
26016 mapped to @option{-ffp-contract=off}.
26018 @item -mfsca
26019 @itemx -mno-fsca
26020 @opindex mfsca
26021 @opindex mno-fsca
26022 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
26023 and cosine approximations.  The option @option{-mfsca} must be used in
26024 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
26025 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
26026 approximations even if @option{-funsafe-math-optimizations} is in effect.
26028 @item -mfsrra
26029 @itemx -mno-fsrra
26030 @opindex mfsrra
26031 @opindex mno-fsrra
26032 Allow or disallow the compiler to emit the @code{fsrra} instruction for
26033 reciprocal square root approximations.  The option @option{-mfsrra} must be used
26034 in combination with @option{-funsafe-math-optimizations} and
26035 @option{-ffinite-math-only}.  It is enabled by default when generating code for
26036 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
26037 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
26038 in effect.
26040 @item -mpretend-cmove
26041 @opindex mpretend-cmove
26042 Prefer zero-displacement conditional branches for conditional move instruction
26043 patterns.  This can result in faster code on the SH4 processor.
26045 @item -mfdpic
26046 @opindex fdpic
26047 Generate code using the FDPIC ABI.
26049 @end table
26051 @node Solaris 2 Options
26052 @subsection Solaris 2 Options
26053 @cindex Solaris 2 options
26055 These @samp{-m} options are supported on Solaris 2:
26057 @table @gcctabopt
26058 @item -mclear-hwcap
26059 @opindex mclear-hwcap
26060 @option{-mclear-hwcap} tells the compiler to remove the hardware
26061 capabilities generated by the Solaris assembler.  This is only necessary
26062 when object files use ISA extensions not supported by the current
26063 machine, but check at runtime whether or not to use them.
26065 @item -mimpure-text
26066 @opindex mimpure-text
26067 @option{-mimpure-text}, used in addition to @option{-shared}, tells
26068 the compiler to not pass @option{-z text} to the linker when linking a
26069 shared object.  Using this option, you can link position-dependent
26070 code into a shared object.
26072 @option{-mimpure-text} suppresses the ``relocations remain against
26073 allocatable but non-writable sections'' linker error message.
26074 However, the necessary relocations trigger copy-on-write, and the
26075 shared object is not actually shared across processes.  Instead of
26076 using @option{-mimpure-text}, you should compile all source code with
26077 @option{-fpic} or @option{-fPIC}.
26079 @end table
26081 These switches are supported in addition to the above on Solaris 2:
26083 @table @gcctabopt
26084 @item -pthreads
26085 @opindex pthreads
26086 This is a synonym for @option{-pthread}.
26087 @end table
26089 @node SPARC Options
26090 @subsection SPARC Options
26091 @cindex SPARC options
26093 These @samp{-m} options are supported on the SPARC:
26095 @table @gcctabopt
26096 @item -mno-app-regs
26097 @itemx -mapp-regs
26098 @opindex mno-app-regs
26099 @opindex mapp-regs
26100 Specify @option{-mapp-regs} to generate output using the global registers
26101 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
26102 global register 1, each global register 2 through 4 is then treated as an
26103 allocable register that is clobbered by function calls.  This is the default.
26105 To be fully SVR4 ABI-compliant at the cost of some performance loss,
26106 specify @option{-mno-app-regs}.  You should compile libraries and system
26107 software with this option.
26109 @item -mflat
26110 @itemx -mno-flat
26111 @opindex mflat
26112 @opindex mno-flat
26113 With @option{-mflat}, the compiler does not generate save/restore instructions
26114 and uses a ``flat'' or single register window model.  This model is compatible
26115 with the regular register window model.  The local registers and the input
26116 registers (0--5) are still treated as ``call-saved'' registers and are
26117 saved on the stack as needed.
26119 With @option{-mno-flat} (the default), the compiler generates save/restore
26120 instructions (except for leaf functions).  This is the normal operating mode.
26122 @item -mfpu
26123 @itemx -mhard-float
26124 @opindex mfpu
26125 @opindex mhard-float
26126 Generate output containing floating-point instructions.  This is the
26127 default.
26129 @item -mno-fpu
26130 @itemx -msoft-float
26131 @opindex mno-fpu
26132 @opindex msoft-float
26133 Generate output containing library calls for floating point.
26134 @strong{Warning:} the requisite libraries are not available for all SPARC
26135 targets.  Normally the facilities of the machine's usual C compiler are
26136 used, but this cannot be done directly in cross-compilation.  You must make
26137 your own arrangements to provide suitable library functions for
26138 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
26139 @samp{sparclite-*-*} do provide software floating-point support.
26141 @option{-msoft-float} changes the calling convention in the output file;
26142 therefore, it is only useful if you compile @emph{all} of a program with
26143 this option.  In particular, you need to compile @file{libgcc.a}, the
26144 library that comes with GCC, with @option{-msoft-float} in order for
26145 this to work.
26147 @item -mhard-quad-float
26148 @opindex mhard-quad-float
26149 Generate output containing quad-word (long double) floating-point
26150 instructions.
26152 @item -msoft-quad-float
26153 @opindex msoft-quad-float
26154 Generate output containing library calls for quad-word (long double)
26155 floating-point instructions.  The functions called are those specified
26156 in the SPARC ABI@.  This is the default.
26158 As of this writing, there are no SPARC implementations that have hardware
26159 support for the quad-word floating-point instructions.  They all invoke
26160 a trap handler for one of these instructions, and then the trap handler
26161 emulates the effect of the instruction.  Because of the trap handler overhead,
26162 this is much slower than calling the ABI library routines.  Thus the
26163 @option{-msoft-quad-float} option is the default.
26165 @item -mno-unaligned-doubles
26166 @itemx -munaligned-doubles
26167 @opindex mno-unaligned-doubles
26168 @opindex munaligned-doubles
26169 Assume that doubles have 8-byte alignment.  This is the default.
26171 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
26172 alignment only if they are contained in another type, or if they have an
26173 absolute address.  Otherwise, it assumes they have 4-byte alignment.
26174 Specifying this option avoids some rare compatibility problems with code
26175 generated by other compilers.  It is not the default because it results
26176 in a performance loss, especially for floating-point code.
26178 @item -muser-mode
26179 @itemx -mno-user-mode
26180 @opindex muser-mode
26181 @opindex mno-user-mode
26182 Do not generate code that can only run in supervisor mode.  This is relevant
26183 only for the @code{casa} instruction emitted for the LEON3 processor.  This
26184 is the default.
26186 @item -mfaster-structs
26187 @itemx -mno-faster-structs
26188 @opindex mfaster-structs
26189 @opindex mno-faster-structs
26190 With @option{-mfaster-structs}, the compiler assumes that structures
26191 should have 8-byte alignment.  This enables the use of pairs of
26192 @code{ldd} and @code{std} instructions for copies in structure
26193 assignment, in place of twice as many @code{ld} and @code{st} pairs.
26194 However, the use of this changed alignment directly violates the SPARC
26195 ABI@.  Thus, it's intended only for use on targets where the developer
26196 acknowledges that their resulting code is not directly in line with
26197 the rules of the ABI@.
26199 @item -mstd-struct-return
26200 @itemx -mno-std-struct-return
26201 @opindex mstd-struct-return
26202 @opindex mno-std-struct-return
26203 With @option{-mstd-struct-return}, the compiler generates checking code
26204 in functions returning structures or unions to detect size mismatches
26205 between the two sides of function calls, as per the 32-bit ABI@.
26207 The default is @option{-mno-std-struct-return}.  This option has no effect
26208 in 64-bit mode.
26210 @item -mlra
26211 @itemx -mno-lra
26212 @opindex mlra
26213 @opindex mno-lra
26214 Enable Local Register Allocation.  This is the default for SPARC since GCC 7
26215 so @option{-mno-lra} needs to be passed to get old Reload.
26217 @item -mcpu=@var{cpu_type}
26218 @opindex mcpu
26219 Set the instruction set, register set, and instruction scheduling parameters
26220 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
26221 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
26222 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
26223 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
26224 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
26225 @samp{niagara3}, @samp{niagara4}, @samp{niagara7} and @samp{m8}.
26227 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
26228 which selects the best architecture option for the host processor.
26229 @option{-mcpu=native} has no effect if GCC does not recognize
26230 the processor.
26232 Default instruction scheduling parameters are used for values that select
26233 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
26234 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
26236 Here is a list of each supported architecture and their supported
26237 implementations.
26239 @table @asis
26240 @item v7
26241 cypress, leon3v7
26243 @item v8
26244 supersparc, hypersparc, leon, leon3
26246 @item sparclite
26247 f930, f934, sparclite86x
26249 @item sparclet
26250 tsc701
26252 @item v9
26253 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
26254 niagara7, m8
26255 @end table
26257 By default (unless configured otherwise), GCC generates code for the V7
26258 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
26259 additionally optimizes it for the Cypress CY7C602 chip, as used in the
26260 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
26261 SPARCStation 1, 2, IPX etc.
26263 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
26264 architecture.  The only difference from V7 code is that the compiler emits
26265 the integer multiply and integer divide instructions which exist in SPARC-V8
26266 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
26267 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
26268 2000 series.
26270 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
26271 the SPARC architecture.  This adds the integer multiply, integer divide step
26272 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
26273 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
26274 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
26275 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
26276 MB86934 chip, which is the more recent SPARClite with FPU@.
26278 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
26279 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
26280 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
26281 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
26282 optimizes it for the TEMIC SPARClet chip.
26284 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
26285 architecture.  This adds 64-bit integer and floating-point move instructions,
26286 3 additional floating-point condition code registers and conditional move
26287 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
26288 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
26289 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
26290 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
26291 @option{-mcpu=niagara}, the compiler additionally optimizes it for
26292 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
26293 additionally optimizes it for Sun UltraSPARC T2 chips. With
26294 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
26295 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
26296 additionally optimizes it for Sun UltraSPARC T4 chips.  With
26297 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
26298 Oracle SPARC M7 chips.  With @option{-mcpu=m8}, the compiler
26299 additionally optimizes it for Oracle M8 chips.
26301 @item -mtune=@var{cpu_type}
26302 @opindex mtune
26303 Set the instruction scheduling parameters for machine type
26304 @var{cpu_type}, but do not set the instruction set or register set that the
26305 option @option{-mcpu=@var{cpu_type}} does.
26307 The same values for @option{-mcpu=@var{cpu_type}} can be used for
26308 @option{-mtune=@var{cpu_type}}, but the only useful values are those
26309 that select a particular CPU implementation.  Those are
26310 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
26311 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
26312 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
26313 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
26314 @samp{niagara4}, @samp{niagara7} and @samp{m8}.  With native Solaris
26315 and GNU/Linux toolchains, @samp{native} can also be used.
26317 @item -mv8plus
26318 @itemx -mno-v8plus
26319 @opindex mv8plus
26320 @opindex mno-v8plus
26321 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
26322 difference from the V8 ABI is that the global and out registers are
26323 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
26324 mode for all SPARC-V9 processors.
26326 @item -mvis
26327 @itemx -mno-vis
26328 @opindex mvis
26329 @opindex mno-vis
26330 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
26331 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
26333 @item -mvis2
26334 @itemx -mno-vis2
26335 @opindex mvis2
26336 @opindex mno-vis2
26337 With @option{-mvis2}, GCC generates code that takes advantage of
26338 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
26339 default is @option{-mvis2} when targeting a cpu that supports such
26340 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
26341 also sets @option{-mvis}.
26343 @item -mvis3
26344 @itemx -mno-vis3
26345 @opindex mvis3
26346 @opindex mno-vis3
26347 With @option{-mvis3}, GCC generates code that takes advantage of
26348 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
26349 default is @option{-mvis3} when targeting a cpu that supports such
26350 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
26351 also sets @option{-mvis2} and @option{-mvis}.
26353 @item -mvis4
26354 @itemx -mno-vis4
26355 @opindex mvis4
26356 @opindex mno-vis4
26357 With @option{-mvis4}, GCC generates code that takes advantage of
26358 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
26359 default is @option{-mvis4} when targeting a cpu that supports such
26360 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
26361 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
26363 @item -mvis4b
26364 @itemx -mno-vis4b
26365 @opindex mvis4b
26366 @opindex mno-vis4b
26367 With @option{-mvis4b}, GCC generates code that takes advantage of
26368 version 4.0 of the UltraSPARC Visual Instruction Set extensions, plus
26369 the additional VIS instructions introduced in the Oracle SPARC
26370 Architecture 2017.  The default is @option{-mvis4b} when targeting a
26371 cpu that supports such instructions, such as m8 and later.  Setting
26372 @option{-mvis4b} also sets @option{-mvis4}, @option{-mvis3},
26373 @option{-mvis2} and @option{-mvis}.
26375 @item -mcbcond
26376 @itemx -mno-cbcond
26377 @opindex mcbcond
26378 @opindex mno-cbcond
26379 With @option{-mcbcond}, GCC generates code that takes advantage of the UltraSPARC
26380 Compare-and-Branch-on-Condition instructions.  The default is @option{-mcbcond}
26381 when targeting a CPU that supports such instructions, such as Niagara-4 and
26382 later.
26384 @item -mfmaf
26385 @itemx -mno-fmaf
26386 @opindex mfmaf
26387 @opindex mno-fmaf
26388 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
26389 Fused Multiply-Add Floating-point instructions.  The default is @option{-mfmaf}
26390 when targeting a CPU that supports such instructions, such as Niagara-3 and
26391 later.
26393 @item -mfsmuld
26394 @itemx -mno-fsmuld
26395 @opindex mfsmuld
26396 @opindex mno-fsmuld
26397 With @option{-mfsmuld}, GCC generates code that takes advantage of the
26398 Floating-point Multiply Single to Double (FsMULd) instruction.  The default is
26399 @option{-mfsmuld} when targeting a CPU supporting the architecture versions V8
26400 or V9 with FPU except @option{-mcpu=leon}.
26402 @item -mpopc
26403 @itemx -mno-popc
26404 @opindex mpopc
26405 @opindex mno-popc
26406 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
26407 Population Count instruction.  The default is @option{-mpopc}
26408 when targeting a CPU that supports such an instruction, such as Niagara-2 and
26409 later.
26411 @item -msubxc
26412 @itemx -mno-subxc
26413 @opindex msubxc
26414 @opindex mno-subxc
26415 With @option{-msubxc}, GCC generates code that takes advantage of the UltraSPARC
26416 Subtract-Extended-with-Carry instruction.  The default is @option{-msubxc}
26417 when targeting a CPU that supports such an instruction, such as Niagara-7 and
26418 later.
26420 @item -mfix-at697f
26421 @opindex mfix-at697f
26422 Enable the documented workaround for the single erratum of the Atmel AT697F
26423 processor (which corresponds to erratum #13 of the AT697E processor).
26425 @item -mfix-ut699
26426 @opindex mfix-ut699
26427 Enable the documented workarounds for the floating-point errata and the data
26428 cache nullify errata of the UT699 processor.
26430 @item -mfix-ut700
26431 @opindex mfix-ut700
26432 Enable the documented workaround for the back-to-back store errata of
26433 the UT699E/UT700 processor.
26435 @item -mfix-gr712rc
26436 @opindex mfix-gr712rc
26437 Enable the documented workaround for the back-to-back store errata of
26438 the GR712RC processor.
26439 @end table
26441 These @samp{-m} options are supported in addition to the above
26442 on SPARC-V9 processors in 64-bit environments:
26444 @table @gcctabopt
26445 @item -m32
26446 @itemx -m64
26447 @opindex m32
26448 @opindex m64
26449 Generate code for a 32-bit or 64-bit environment.
26450 The 32-bit environment sets int, long and pointer to 32 bits.
26451 The 64-bit environment sets int to 32 bits and long and pointer
26452 to 64 bits.
26454 @item -mcmodel=@var{which}
26455 @opindex mcmodel
26456 Set the code model to one of
26458 @table @samp
26459 @item medlow
26460 The Medium/Low code model: 64-bit addresses, programs
26461 must be linked in the low 32 bits of memory.  Programs can be statically
26462 or dynamically linked.
26464 @item medmid
26465 The Medium/Middle code model: 64-bit addresses, programs
26466 must be linked in the low 44 bits of memory, the text and data segments must
26467 be less than 2GB in size and the data segment must be located within 2GB of
26468 the text segment.
26470 @item medany
26471 The Medium/Anywhere code model: 64-bit addresses, programs
26472 may be linked anywhere in memory, the text and data segments must be less
26473 than 2GB in size and the data segment must be located within 2GB of the
26474 text segment.
26476 @item embmedany
26477 The Medium/Anywhere code model for embedded systems:
26478 64-bit addresses, the text and data segments must be less than 2GB in
26479 size, both starting anywhere in memory (determined at link time).  The
26480 global register %g4 points to the base of the data segment.  Programs
26481 are statically linked and PIC is not supported.
26482 @end table
26484 @item -mmemory-model=@var{mem-model}
26485 @opindex mmemory-model
26486 Set the memory model in force on the processor to one of
26488 @table @samp
26489 @item default
26490 The default memory model for the processor and operating system.
26492 @item rmo
26493 Relaxed Memory Order
26495 @item pso
26496 Partial Store Order
26498 @item tso
26499 Total Store Order
26501 @item sc
26502 Sequential Consistency
26503 @end table
26505 These memory models are formally defined in Appendix D of the SPARC-V9
26506 architecture manual, as set in the processor's @code{PSTATE.MM} field.
26508 @item -mstack-bias
26509 @itemx -mno-stack-bias
26510 @opindex mstack-bias
26511 @opindex mno-stack-bias
26512 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
26513 frame pointer if present, are offset by @minus{}2047 which must be added back
26514 when making stack frame references.  This is the default in 64-bit mode.
26515 Otherwise, assume no such offset is present.
26516 @end table
26518 @node SPU Options
26519 @subsection SPU Options
26520 @cindex SPU options
26522 These @samp{-m} options are supported on the SPU:
26524 @table @gcctabopt
26525 @item -mwarn-reloc
26526 @itemx -merror-reloc
26527 @opindex mwarn-reloc
26528 @opindex merror-reloc
26530 The loader for SPU does not handle dynamic relocations.  By default, GCC
26531 gives an error when it generates code that requires a dynamic
26532 relocation.  @option{-mno-error-reloc} disables the error,
26533 @option{-mwarn-reloc} generates a warning instead.
26535 @item -msafe-dma
26536 @itemx -munsafe-dma
26537 @opindex msafe-dma
26538 @opindex munsafe-dma
26540 Instructions that initiate or test completion of DMA must not be
26541 reordered with respect to loads and stores of the memory that is being
26542 accessed.
26543 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
26544 memory accesses, but that can lead to inefficient code in places where the
26545 memory is known to not change.  Rather than mark the memory as volatile,
26546 you can use @option{-msafe-dma} to tell the compiler to treat
26547 the DMA instructions as potentially affecting all memory.  
26549 @item -mbranch-hints
26550 @opindex mbranch-hints
26552 By default, GCC generates a branch hint instruction to avoid
26553 pipeline stalls for always-taken or probably-taken branches.  A hint
26554 is not generated closer than 8 instructions away from its branch.
26555 There is little reason to disable them, except for debugging purposes,
26556 or to make an object a little bit smaller.
26558 @item -msmall-mem
26559 @itemx -mlarge-mem
26560 @opindex msmall-mem
26561 @opindex mlarge-mem
26563 By default, GCC generates code assuming that addresses are never larger
26564 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
26565 a full 32-bit address.
26567 @item -mstdmain
26568 @opindex mstdmain
26570 By default, GCC links against startup code that assumes the SPU-style
26571 main function interface (which has an unconventional parameter list).
26572 With @option{-mstdmain}, GCC links your program against startup
26573 code that assumes a C99-style interface to @code{main}, including a
26574 local copy of @code{argv} strings.
26576 @item -mfixed-range=@var{register-range}
26577 @opindex mfixed-range
26578 Generate code treating the given register range as fixed registers.
26579 A fixed register is one that the register allocator cannot use.  This is
26580 useful when compiling kernel code.  A register range is specified as
26581 two registers separated by a dash.  Multiple register ranges can be
26582 specified separated by a comma.
26584 @item -mea32
26585 @itemx -mea64
26586 @opindex mea32
26587 @opindex mea64
26588 Compile code assuming that pointers to the PPU address space accessed
26589 via the @code{__ea} named address space qualifier are either 32 or 64
26590 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
26591 all object code in an executable must be compiled with the same setting.
26593 @item -maddress-space-conversion
26594 @itemx -mno-address-space-conversion
26595 @opindex maddress-space-conversion
26596 @opindex mno-address-space-conversion
26597 Allow/disallow treating the @code{__ea} address space as superset
26598 of the generic address space.  This enables explicit type casts
26599 between @code{__ea} and generic pointer as well as implicit
26600 conversions of generic pointers to @code{__ea} pointers.  The
26601 default is to allow address space pointer conversions.
26603 @item -mcache-size=@var{cache-size}
26604 @opindex mcache-size
26605 This option controls the version of libgcc that the compiler links to an
26606 executable and selects a software-managed cache for accessing variables
26607 in the @code{__ea} address space with a particular cache size.  Possible
26608 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
26609 and @samp{128}.  The default cache size is 64KB.
26611 @item -matomic-updates
26612 @itemx -mno-atomic-updates
26613 @opindex matomic-updates
26614 @opindex mno-atomic-updates
26615 This option controls the version of libgcc that the compiler links to an
26616 executable and selects whether atomic updates to the software-managed
26617 cache of PPU-side variables are used.  If you use atomic updates, changes
26618 to a PPU variable from SPU code using the @code{__ea} named address space
26619 qualifier do not interfere with changes to other PPU variables residing
26620 in the same cache line from PPU code.  If you do not use atomic updates,
26621 such interference may occur; however, writing back cache lines is
26622 more efficient.  The default behavior is to use atomic updates.
26624 @item -mdual-nops
26625 @itemx -mdual-nops=@var{n}
26626 @opindex mdual-nops
26627 By default, GCC inserts NOPs to increase dual issue when it expects
26628 it to increase performance.  @var{n} can be a value from 0 to 10.  A
26629 smaller @var{n} inserts fewer NOPs.  10 is the default, 0 is the
26630 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
26632 @item -mhint-max-nops=@var{n}
26633 @opindex mhint-max-nops
26634 Maximum number of NOPs to insert for a branch hint.  A branch hint must
26635 be at least 8 instructions away from the branch it is affecting.  GCC
26636 inserts up to @var{n} NOPs to enforce this, otherwise it does not
26637 generate the branch hint.
26639 @item -mhint-max-distance=@var{n}
26640 @opindex mhint-max-distance
26641 The encoding of the branch hint instruction limits the hint to be within
26642 256 instructions of the branch it is affecting.  By default, GCC makes
26643 sure it is within 125.
26645 @item -msafe-hints
26646 @opindex msafe-hints
26647 Work around a hardware bug that causes the SPU to stall indefinitely.
26648 By default, GCC inserts the @code{hbrp} instruction to make sure
26649 this stall won't happen.
26651 @end table
26653 @node System V Options
26654 @subsection Options for System V
26656 These additional options are available on System V Release 4 for
26657 compatibility with other compilers on those systems:
26659 @table @gcctabopt
26660 @item -G
26661 @opindex G
26662 Create a shared object.
26663 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
26665 @item -Qy
26666 @opindex Qy
26667 Identify the versions of each tool used by the compiler, in a
26668 @code{.ident} assembler directive in the output.
26670 @item -Qn
26671 @opindex Qn
26672 Refrain from adding @code{.ident} directives to the output file (this is
26673 the default).
26675 @item -YP,@var{dirs}
26676 @opindex YP
26677 Search the directories @var{dirs}, and no others, for libraries
26678 specified with @option{-l}.
26680 @item -Ym,@var{dir}
26681 @opindex Ym
26682 Look in the directory @var{dir} to find the M4 preprocessor.
26683 The assembler uses this option.
26684 @c This is supposed to go with a -Yd for predefined M4 macro files, but
26685 @c the generic assembler that comes with Solaris takes just -Ym.
26686 @end table
26688 @node TILE-Gx Options
26689 @subsection TILE-Gx Options
26690 @cindex TILE-Gx options
26692 These @samp{-m} options are supported on the TILE-Gx:
26694 @table @gcctabopt
26695 @item -mcmodel=small
26696 @opindex mcmodel=small
26697 Generate code for the small model.  The distance for direct calls is
26698 limited to 500M in either direction.  PC-relative addresses are 32
26699 bits.  Absolute addresses support the full address range.
26701 @item -mcmodel=large
26702 @opindex mcmodel=large
26703 Generate code for the large model.  There is no limitation on call
26704 distance, pc-relative addresses, or absolute addresses.
26706 @item -mcpu=@var{name}
26707 @opindex mcpu
26708 Selects the type of CPU to be targeted.  Currently the only supported
26709 type is @samp{tilegx}.
26711 @item -m32
26712 @itemx -m64
26713 @opindex m32
26714 @opindex m64
26715 Generate code for a 32-bit or 64-bit environment.  The 32-bit
26716 environment sets int, long, and pointer to 32 bits.  The 64-bit
26717 environment sets int to 32 bits and long and pointer to 64 bits.
26719 @item -mbig-endian
26720 @itemx -mlittle-endian
26721 @opindex mbig-endian
26722 @opindex mlittle-endian
26723 Generate code in big/little endian mode, respectively.
26724 @end table
26726 @node TILEPro Options
26727 @subsection TILEPro Options
26728 @cindex TILEPro options
26730 These @samp{-m} options are supported on the TILEPro:
26732 @table @gcctabopt
26733 @item -mcpu=@var{name}
26734 @opindex mcpu
26735 Selects the type of CPU to be targeted.  Currently the only supported
26736 type is @samp{tilepro}.
26738 @item -m32
26739 @opindex m32
26740 Generate code for a 32-bit environment, which sets int, long, and
26741 pointer to 32 bits.  This is the only supported behavior so the flag
26742 is essentially ignored.
26743 @end table
26745 @node V850 Options
26746 @subsection V850 Options
26747 @cindex V850 Options
26749 These @samp{-m} options are defined for V850 implementations:
26751 @table @gcctabopt
26752 @item -mlong-calls
26753 @itemx -mno-long-calls
26754 @opindex mlong-calls
26755 @opindex mno-long-calls
26756 Treat all calls as being far away (near).  If calls are assumed to be
26757 far away, the compiler always loads the function's address into a
26758 register, and calls indirect through the pointer.
26760 @item -mno-ep
26761 @itemx -mep
26762 @opindex mno-ep
26763 @opindex mep
26764 Do not optimize (do optimize) basic blocks that use the same index
26765 pointer 4 or more times to copy pointer into the @code{ep} register, and
26766 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
26767 option is on by default if you optimize.
26769 @item -mno-prolog-function
26770 @itemx -mprolog-function
26771 @opindex mno-prolog-function
26772 @opindex mprolog-function
26773 Do not use (do use) external functions to save and restore registers
26774 at the prologue and epilogue of a function.  The external functions
26775 are slower, but use less code space if more than one function saves
26776 the same number of registers.  The @option{-mprolog-function} option
26777 is on by default if you optimize.
26779 @item -mspace
26780 @opindex mspace
26781 Try to make the code as small as possible.  At present, this just turns
26782 on the @option{-mep} and @option{-mprolog-function} options.
26784 @item -mtda=@var{n}
26785 @opindex mtda
26786 Put static or global variables whose size is @var{n} bytes or less into
26787 the tiny data area that register @code{ep} points to.  The tiny data
26788 area can hold up to 256 bytes in total (128 bytes for byte references).
26790 @item -msda=@var{n}
26791 @opindex msda
26792 Put static or global variables whose size is @var{n} bytes or less into
26793 the small data area that register @code{gp} points to.  The small data
26794 area can hold up to 64 kilobytes.
26796 @item -mzda=@var{n}
26797 @opindex mzda
26798 Put static or global variables whose size is @var{n} bytes or less into
26799 the first 32 kilobytes of memory.
26801 @item -mv850
26802 @opindex mv850
26803 Specify that the target processor is the V850.
26805 @item -mv850e3v5
26806 @opindex mv850e3v5
26807 Specify that the target processor is the V850E3V5.  The preprocessor
26808 constant @code{__v850e3v5__} is defined if this option is used.
26810 @item -mv850e2v4
26811 @opindex mv850e2v4
26812 Specify that the target processor is the V850E3V5.  This is an alias for
26813 the @option{-mv850e3v5} option.
26815 @item -mv850e2v3
26816 @opindex mv850e2v3
26817 Specify that the target processor is the V850E2V3.  The preprocessor
26818 constant @code{__v850e2v3__} is defined if this option is used.
26820 @item -mv850e2
26821 @opindex mv850e2
26822 Specify that the target processor is the V850E2.  The preprocessor
26823 constant @code{__v850e2__} is defined if this option is used.
26825 @item -mv850e1
26826 @opindex mv850e1
26827 Specify that the target processor is the V850E1.  The preprocessor
26828 constants @code{__v850e1__} and @code{__v850e__} are defined if
26829 this option is used.
26831 @item -mv850es
26832 @opindex mv850es
26833 Specify that the target processor is the V850ES.  This is an alias for
26834 the @option{-mv850e1} option.
26836 @item -mv850e
26837 @opindex mv850e
26838 Specify that the target processor is the V850E@.  The preprocessor
26839 constant @code{__v850e__} is defined if this option is used.
26841 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
26842 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
26843 are defined then a default target processor is chosen and the
26844 relevant @samp{__v850*__} preprocessor constant is defined.
26846 The preprocessor constants @code{__v850} and @code{__v851__} are always
26847 defined, regardless of which processor variant is the target.
26849 @item -mdisable-callt
26850 @itemx -mno-disable-callt
26851 @opindex mdisable-callt
26852 @opindex mno-disable-callt
26853 This option suppresses generation of the @code{CALLT} instruction for the
26854 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
26855 architecture.
26857 This option is enabled by default when the RH850 ABI is
26858 in use (see @option{-mrh850-abi}), and disabled by default when the
26859 GCC ABI is in use.  If @code{CALLT} instructions are being generated
26860 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
26862 @item -mrelax
26863 @itemx -mno-relax
26864 @opindex mrelax
26865 @opindex mno-relax
26866 Pass on (or do not pass on) the @option{-mrelax} command-line option
26867 to the assembler.
26869 @item -mlong-jumps
26870 @itemx -mno-long-jumps
26871 @opindex mlong-jumps
26872 @opindex mno-long-jumps
26873 Disable (or re-enable) the generation of PC-relative jump instructions.
26875 @item -msoft-float
26876 @itemx -mhard-float
26877 @opindex msoft-float
26878 @opindex mhard-float
26879 Disable (or re-enable) the generation of hardware floating point
26880 instructions.  This option is only significant when the target
26881 architecture is @samp{V850E2V3} or higher.  If hardware floating point
26882 instructions are being generated then the C preprocessor symbol
26883 @code{__FPU_OK__} is defined, otherwise the symbol
26884 @code{__NO_FPU__} is defined.
26886 @item -mloop
26887 @opindex mloop
26888 Enables the use of the e3v5 LOOP instruction.  The use of this
26889 instruction is not enabled by default when the e3v5 architecture is
26890 selected because its use is still experimental.
26892 @item -mrh850-abi
26893 @itemx -mghs
26894 @opindex mrh850-abi
26895 @opindex mghs
26896 Enables support for the RH850 version of the V850 ABI.  This is the
26897 default.  With this version of the ABI the following rules apply:
26899 @itemize
26900 @item
26901 Integer sized structures and unions are returned via a memory pointer
26902 rather than a register.
26904 @item
26905 Large structures and unions (more than 8 bytes in size) are passed by
26906 value.
26908 @item
26909 Functions are aligned to 16-bit boundaries.
26911 @item
26912 The @option{-m8byte-align} command-line option is supported.
26914 @item
26915 The @option{-mdisable-callt} command-line option is enabled by
26916 default.  The @option{-mno-disable-callt} command-line option is not
26917 supported.
26918 @end itemize
26920 When this version of the ABI is enabled the C preprocessor symbol
26921 @code{__V850_RH850_ABI__} is defined.
26923 @item -mgcc-abi
26924 @opindex mgcc-abi
26925 Enables support for the old GCC version of the V850 ABI.  With this
26926 version of the ABI the following rules apply:
26928 @itemize
26929 @item
26930 Integer sized structures and unions are returned in register @code{r10}.
26932 @item
26933 Large structures and unions (more than 8 bytes in size) are passed by
26934 reference.
26936 @item
26937 Functions are aligned to 32-bit boundaries, unless optimizing for
26938 size.
26940 @item
26941 The @option{-m8byte-align} command-line option is not supported.
26943 @item
26944 The @option{-mdisable-callt} command-line option is supported but not
26945 enabled by default.
26946 @end itemize
26948 When this version of the ABI is enabled the C preprocessor symbol
26949 @code{__V850_GCC_ABI__} is defined.
26951 @item -m8byte-align
26952 @itemx -mno-8byte-align
26953 @opindex m8byte-align
26954 @opindex mno-8byte-align
26955 Enables support for @code{double} and @code{long long} types to be
26956 aligned on 8-byte boundaries.  The default is to restrict the
26957 alignment of all objects to at most 4-bytes.  When
26958 @option{-m8byte-align} is in effect the C preprocessor symbol
26959 @code{__V850_8BYTE_ALIGN__} is defined.
26961 @item -mbig-switch
26962 @opindex mbig-switch
26963 Generate code suitable for big switch tables.  Use this option only if
26964 the assembler/linker complain about out of range branches within a switch
26965 table.
26967 @item -mapp-regs
26968 @opindex mapp-regs
26969 This option causes r2 and r5 to be used in the code generated by
26970 the compiler.  This setting is the default.
26972 @item -mno-app-regs
26973 @opindex mno-app-regs
26974 This option causes r2 and r5 to be treated as fixed registers.
26976 @end table
26978 @node VAX Options
26979 @subsection VAX Options
26980 @cindex VAX options
26982 These @samp{-m} options are defined for the VAX:
26984 @table @gcctabopt
26985 @item -munix
26986 @opindex munix
26987 Do not output certain jump instructions (@code{aobleq} and so on)
26988 that the Unix assembler for the VAX cannot handle across long
26989 ranges.
26991 @item -mgnu
26992 @opindex mgnu
26993 Do output those jump instructions, on the assumption that the
26994 GNU assembler is being used.
26996 @item -mg
26997 @opindex mg
26998 Output code for G-format floating-point numbers instead of D-format.
26999 @end table
27001 @node Visium Options
27002 @subsection Visium Options
27003 @cindex Visium options
27005 @table @gcctabopt
27007 @item -mdebug
27008 @opindex mdebug
27009 A program which performs file I/O and is destined to run on an MCM target
27010 should be linked with this option.  It causes the libraries libc.a and
27011 libdebug.a to be linked.  The program should be run on the target under
27012 the control of the GDB remote debugging stub.
27014 @item -msim
27015 @opindex msim
27016 A program which performs file I/O and is destined to run on the simulator
27017 should be linked with option.  This causes libraries libc.a and libsim.a to
27018 be linked.
27020 @item -mfpu
27021 @itemx -mhard-float
27022 @opindex mfpu
27023 @opindex mhard-float
27024 Generate code containing floating-point instructions.  This is the
27025 default.
27027 @item -mno-fpu
27028 @itemx -msoft-float
27029 @opindex mno-fpu
27030 @opindex msoft-float
27031 Generate code containing library calls for floating-point.
27033 @option{-msoft-float} changes the calling convention in the output file;
27034 therefore, it is only useful if you compile @emph{all} of a program with
27035 this option.  In particular, you need to compile @file{libgcc.a}, the
27036 library that comes with GCC, with @option{-msoft-float} in order for
27037 this to work.
27039 @item -mcpu=@var{cpu_type}
27040 @opindex mcpu
27041 Set the instruction set, register set, and instruction scheduling parameters
27042 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
27043 @samp{mcm}, @samp{gr5} and @samp{gr6}.
27045 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
27047 By default (unless configured otherwise), GCC generates code for the GR5
27048 variant of the Visium architecture.  
27050 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
27051 architecture.  The only difference from GR5 code is that the compiler will
27052 generate block move instructions.
27054 @item -mtune=@var{cpu_type}
27055 @opindex mtune
27056 Set the instruction scheduling parameters for machine type @var{cpu_type},
27057 but do not set the instruction set or register set that the option
27058 @option{-mcpu=@var{cpu_type}} would.
27060 @item -msv-mode
27061 @opindex msv-mode
27062 Generate code for the supervisor mode, where there are no restrictions on
27063 the access to general registers.  This is the default.
27065 @item -muser-mode
27066 @opindex muser-mode
27067 Generate code for the user mode, where the access to some general registers
27068 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
27069 mode; on the GR6, only registers r29 to r31 are affected.
27070 @end table
27072 @node VMS Options
27073 @subsection VMS Options
27075 These @samp{-m} options are defined for the VMS implementations:
27077 @table @gcctabopt
27078 @item -mvms-return-codes
27079 @opindex mvms-return-codes
27080 Return VMS condition codes from @code{main}. The default is to return POSIX-style
27081 condition (e.g.@: error) codes.
27083 @item -mdebug-main=@var{prefix}
27084 @opindex mdebug-main=@var{prefix}
27085 Flag the first routine whose name starts with @var{prefix} as the main
27086 routine for the debugger.
27088 @item -mmalloc64
27089 @opindex mmalloc64
27090 Default to 64-bit memory allocation routines.
27092 @item -mpointer-size=@var{size}
27093 @opindex mpointer-size=@var{size}
27094 Set the default size of pointers. Possible options for @var{size} are
27095 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
27096 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
27097 The later option disables @code{pragma pointer_size}.
27098 @end table
27100 @node VxWorks Options
27101 @subsection VxWorks Options
27102 @cindex VxWorks Options
27104 The options in this section are defined for all VxWorks targets.
27105 Options specific to the target hardware are listed with the other
27106 options for that target.
27108 @table @gcctabopt
27109 @item -mrtp
27110 @opindex mrtp
27111 GCC can generate code for both VxWorks kernels and real time processes
27112 (RTPs).  This option switches from the former to the latter.  It also
27113 defines the preprocessor macro @code{__RTP__}.
27115 @item -non-static
27116 @opindex non-static
27117 Link an RTP executable against shared libraries rather than static
27118 libraries.  The options @option{-static} and @option{-shared} can
27119 also be used for RTPs (@pxref{Link Options}); @option{-static}
27120 is the default.
27122 @item -Bstatic
27123 @itemx -Bdynamic
27124 @opindex Bstatic
27125 @opindex Bdynamic
27126 These options are passed down to the linker.  They are defined for
27127 compatibility with Diab.
27129 @item -Xbind-lazy
27130 @opindex Xbind-lazy
27131 Enable lazy binding of function calls.  This option is equivalent to
27132 @option{-Wl,-z,now} and is defined for compatibility with Diab.
27134 @item -Xbind-now
27135 @opindex Xbind-now
27136 Disable lazy binding of function calls.  This option is the default and
27137 is defined for compatibility with Diab.
27138 @end table
27140 @node x86 Options
27141 @subsection x86 Options
27142 @cindex x86 Options
27144 These @samp{-m} options are defined for the x86 family of computers.
27146 @table @gcctabopt
27148 @item -march=@var{cpu-type}
27149 @opindex march
27150 Generate instructions for the machine type @var{cpu-type}.  In contrast to
27151 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
27152 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
27153 to generate code that may not run at all on processors other than the one
27154 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
27155 @option{-mtune=@var{cpu-type}}.
27157 The choices for @var{cpu-type} are:
27159 @table @samp
27160 @item native
27161 This selects the CPU to generate code for at compilation time by determining
27162 the processor type of the compiling machine.  Using @option{-march=native}
27163 enables all instruction subsets supported by the local machine (hence
27164 the result might not run on different machines).  Using @option{-mtune=native}
27165 produces code optimized for the local machine under the constraints
27166 of the selected instruction set.  
27168 @item x86-64
27169 A generic CPU with 64-bit extensions.
27171 @item i386
27172 Original Intel i386 CPU@.
27174 @item i486
27175 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
27177 @item i586
27178 @itemx pentium
27179 Intel Pentium CPU with no MMX support.
27181 @item lakemont
27182 Intel Lakemont MCU, based on Intel Pentium CPU.
27184 @item pentium-mmx
27185 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
27187 @item pentiumpro
27188 Intel Pentium Pro CPU@.
27190 @item i686
27191 When used with @option{-march}, the Pentium Pro
27192 instruction set is used, so the code runs on all i686 family chips.
27193 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
27195 @item pentium2
27196 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
27197 support.
27199 @item pentium3
27200 @itemx pentium3m
27201 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
27202 set support.
27204 @item pentium-m
27205 Intel Pentium M; low-power version of Intel Pentium III CPU
27206 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
27208 @item pentium4
27209 @itemx pentium4m
27210 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
27212 @item prescott
27213 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
27214 set support.
27216 @item nocona
27217 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
27218 SSE2 and SSE3 instruction set support.
27220 @item core2
27221 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
27222 instruction set support.
27224 @item nehalem
27225 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
27226 SSE4.1, SSE4.2 and POPCNT instruction set support.
27228 @item westmere
27229 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
27230 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
27232 @item sandybridge
27233 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
27234 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
27236 @item ivybridge
27237 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
27238 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
27239 instruction set support.
27241 @item haswell
27242 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27243 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27244 BMI, BMI2 and F16C instruction set support.
27246 @item broadwell
27247 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27248 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27249 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
27251 @item skylake
27252 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27253 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27254 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
27255 XSAVES instruction set support.
27257 @item bonnell
27258 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
27259 instruction set support.
27261 @item silvermont
27262 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27263 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
27265 @item goldmont
27266 Intel Goldmont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27267 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT and FSGSBASE
27268 instruction set support.
27270 @item goldmont-plus
27271 Intel Goldmont Plus CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27272 SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE,
27273 PTWRITE, RDPID, SGX and UMIP instruction set support.
27275 @item tremont
27276 Intel Tremont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27277 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE, PTWRITE,
27278 RDPID, SGX, UMIP, GFNI-SSE, CLWB and ENCLV instruction set support.
27280 @item knl
27281 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27282 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27283 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
27284 AVX512CD instruction set support.
27286 @item knm
27287 Intel Knights Mill CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27288 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27289 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER, AVX512CD,
27290 AVX5124VNNIW, AVX5124FMAPS and AVX512VPOPCNTDQ instruction set support.
27292 @item skylake-avx512
27293 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27294 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27295 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
27296 CLWB, AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
27298 @item cannonlake
27299 Intel Cannonlake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27300 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27301 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27302 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27303 AVX512IFMA, SHA and UMIP instruction set support.
27305 @item icelake-client
27306 Intel Icelake Client CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27307 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27308 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27309 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27310 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
27311 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES instruction set support.
27313 @item icelake-server
27314 Intel Icelake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27315 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27316 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27317 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27318 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
27319 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES, PCONFIG and WBNOINVD instruction
27320 set support.
27322 @item cascadelake
27323 Intel Cascadelake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27324 SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI,
27325 BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, CLWB,
27326 AVX512VL, AVX512BW, AVX512DQ, AVX512CD and AVX512VNNI instruction set support.
27328 @item k6
27329 AMD K6 CPU with MMX instruction set support.
27331 @item k6-2
27332 @itemx k6-3
27333 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
27335 @item athlon
27336 @itemx athlon-tbird
27337 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
27338 support.
27340 @item athlon-4
27341 @itemx athlon-xp
27342 @itemx athlon-mp
27343 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
27344 instruction set support.
27346 @item k8
27347 @itemx opteron
27348 @itemx athlon64
27349 @itemx athlon-fx
27350 Processors based on the AMD K8 core with x86-64 instruction set support,
27351 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
27352 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
27353 instruction set extensions.)
27355 @item k8-sse3
27356 @itemx opteron-sse3
27357 @itemx athlon64-sse3
27358 Improved versions of AMD K8 cores with SSE3 instruction set support.
27360 @item amdfam10
27361 @itemx barcelona
27362 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
27363 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
27364 instruction set extensions.)
27366 @item bdver1
27367 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
27368 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
27369 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
27370 @item bdver2
27371 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27372 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
27373 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
27374 extensions.)
27375 @item bdver3
27376 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27377 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
27378 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
27379 64-bit instruction set extensions.
27380 @item bdver4
27381 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27382 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
27383 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
27384 SSE4.2, ABM and 64-bit instruction set extensions.
27386 @item znver1
27387 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
27388 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
27389 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
27390 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
27391 instruction set extensions.
27392 @item znver2
27393 AMD Family 17h core based CPUs with x86-64 instruction set support. (This
27394 supersets BMI, BMI2, ,CLWB, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED,
27395 MWAITX, SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A,
27396 SSSE3, SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
27397 instruction set extensions.)
27400 @item btver1
27401 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
27402 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
27403 instruction set extensions.)
27405 @item btver2
27406 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
27407 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
27408 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
27410 @item winchip-c6
27411 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
27412 set support.
27414 @item winchip2
27415 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
27416 instruction set support.
27418 @item c3
27419 VIA C3 CPU with MMX and 3DNow!@: instruction set support.
27420 (No scheduling is implemented for this chip.)
27422 @item c3-2
27423 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
27424 (No scheduling is implemented for this chip.)
27426 @item c7
27427 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
27428 (No scheduling is implemented for this chip.)
27430 @item samuel-2
27431 VIA Eden Samuel 2 CPU with MMX and 3DNow!@: instruction set support.
27432 (No scheduling is implemented for this chip.)
27434 @item nehemiah
27435 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
27436 (No scheduling is implemented for this chip.)
27438 @item esther
27439 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
27440 (No scheduling is implemented for this chip.)
27442 @item eden-x2
27443 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3 instruction set support.
27444 (No scheduling is implemented for this chip.)
27446 @item eden-x4
27447 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
27448 AVX and AVX2 instruction set support.
27449 (No scheduling is implemented for this chip.)
27451 @item nano
27452 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27453 instruction set support.
27454 (No scheduling is implemented for this chip.)
27456 @item nano-1000
27457 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27458 instruction set support.
27459 (No scheduling is implemented for this chip.)
27461 @item nano-2000
27462 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27463 instruction set support.
27464 (No scheduling is implemented for this chip.)
27466 @item nano-3000
27467 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27468 instruction set support.
27469 (No scheduling is implemented for this chip.)
27471 @item nano-x2
27472 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27473 instruction set support.
27474 (No scheduling is implemented for this chip.)
27476 @item nano-x4
27477 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27478 instruction set support.
27479 (No scheduling is implemented for this chip.)
27481 @item geode
27482 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
27483 @end table
27485 @item -mtune=@var{cpu-type}
27486 @opindex mtune
27487 Tune to @var{cpu-type} everything applicable about the generated code, except
27488 for the ABI and the set of available instructions.  
27489 While picking a specific @var{cpu-type} schedules things appropriately
27490 for that particular chip, the compiler does not generate any code that
27491 cannot run on the default machine type unless you use a
27492 @option{-march=@var{cpu-type}} option.
27493 For example, if GCC is configured for i686-pc-linux-gnu
27494 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
27495 but still runs on i686 machines.
27497 The choices for @var{cpu-type} are the same as for @option{-march}.
27498 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
27500 @table @samp
27501 @item generic
27502 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
27503 If you know the CPU on which your code will run, then you should use
27504 the corresponding @option{-mtune} or @option{-march} option instead of
27505 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
27506 of your application will have, then you should use this option.
27508 As new processors are deployed in the marketplace, the behavior of this
27509 option will change.  Therefore, if you upgrade to a newer version of
27510 GCC, code generation controlled by this option will change to reflect
27511 the processors
27512 that are most common at the time that version of GCC is released.
27514 There is no @option{-march=generic} option because @option{-march}
27515 indicates the instruction set the compiler can use, and there is no
27516 generic instruction set applicable to all processors.  In contrast,
27517 @option{-mtune} indicates the processor (or, in this case, collection of
27518 processors) for which the code is optimized.
27520 @item intel
27521 Produce code optimized for the most current Intel processors, which are
27522 Haswell and Silvermont for this version of GCC.  If you know the CPU
27523 on which your code will run, then you should use the corresponding
27524 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
27525 But, if you want your application performs better on both Haswell and
27526 Silvermont, then you should use this option.
27528 As new Intel processors are deployed in the marketplace, the behavior of
27529 this option will change.  Therefore, if you upgrade to a newer version of
27530 GCC, code generation controlled by this option will change to reflect
27531 the most current Intel processors at the time that version of GCC is
27532 released.
27534 There is no @option{-march=intel} option because @option{-march} indicates
27535 the instruction set the compiler can use, and there is no common
27536 instruction set applicable to all processors.  In contrast,
27537 @option{-mtune} indicates the processor (or, in this case, collection of
27538 processors) for which the code is optimized.
27539 @end table
27541 @item -mcpu=@var{cpu-type}
27542 @opindex mcpu
27543 A deprecated synonym for @option{-mtune}.
27545 @item -mfpmath=@var{unit}
27546 @opindex mfpmath
27547 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
27548 for @var{unit} are:
27550 @table @samp
27551 @item 387
27552 Use the standard 387 floating-point coprocessor present on the majority of chips and
27553 emulated otherwise.  Code compiled with this option runs almost everywhere.
27554 The temporary results are computed in 80-bit precision instead of the precision
27555 specified by the type, resulting in slightly different results compared to most
27556 of other chips.  See @option{-ffloat-store} for more detailed description.
27558 This is the default choice for non-Darwin x86-32 targets.
27560 @item sse
27561 Use scalar floating-point instructions present in the SSE instruction set.
27562 This instruction set is supported by Pentium III and newer chips,
27563 and in the AMD line
27564 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
27565 instruction set supports only single-precision arithmetic, thus the double and
27566 extended-precision arithmetic are still done using 387.  A later version, present
27567 only in Pentium 4 and AMD x86-64 chips, supports double-precision
27568 arithmetic too.
27570 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
27571 or @option{-msse2} switches to enable SSE extensions and make this option
27572 effective.  For the x86-64 compiler, these extensions are enabled by default.
27574 The resulting code should be considerably faster in the majority of cases and avoid
27575 the numerical instability problems of 387 code, but may break some existing
27576 code that expects temporaries to be 80 bits.
27578 This is the default choice for the x86-64 compiler, Darwin x86-32 targets,
27579 and the default choice for x86-32 targets with the SSE2 instruction set
27580 when @option{-ffast-math} is enabled.
27582 @item sse,387
27583 @itemx sse+387
27584 @itemx both
27585 Attempt to utilize both instruction sets at once.  This effectively doubles the
27586 amount of available registers, and on chips with separate execution units for
27587 387 and SSE the execution resources too.  Use this option with care, as it is
27588 still experimental, because the GCC register allocator does not model separate
27589 functional units well, resulting in unstable performance.
27590 @end table
27592 @item -masm=@var{dialect}
27593 @opindex masm=@var{dialect}
27594 Output assembly instructions using selected @var{dialect}.  Also affects
27595 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
27596 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
27597 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
27598 not support @samp{intel}.
27600 @item -mieee-fp
27601 @itemx -mno-ieee-fp
27602 @opindex mieee-fp
27603 @opindex mno-ieee-fp
27604 Control whether or not the compiler uses IEEE floating-point
27605 comparisons.  These correctly handle the case where the result of a
27606 comparison is unordered.
27608 @item -m80387
27609 @itemx -mhard-float
27610 @opindex 80387
27611 @opindex mhard-float
27612 Generate output containing 80387 instructions for floating point.
27614 @item -mno-80387
27615 @itemx -msoft-float
27616 @opindex no-80387
27617 @opindex msoft-float
27618 Generate output containing library calls for floating point.
27620 @strong{Warning:} the requisite libraries are not part of GCC@.
27621 Normally the facilities of the machine's usual C compiler are used, but
27622 this cannot be done directly in cross-compilation.  You must make your
27623 own arrangements to provide suitable library functions for
27624 cross-compilation.
27626 On machines where a function returns floating-point results in the 80387
27627 register stack, some floating-point opcodes may be emitted even if
27628 @option{-msoft-float} is used.
27630 @item -mno-fp-ret-in-387
27631 @opindex mno-fp-ret-in-387
27632 @opindex mfp-ret-in-387
27633 Do not use the FPU registers for return values of functions.
27635 The usual calling convention has functions return values of types
27636 @code{float} and @code{double} in an FPU register, even if there
27637 is no FPU@.  The idea is that the operating system should emulate
27638 an FPU@.
27640 The option @option{-mno-fp-ret-in-387} causes such values to be returned
27641 in ordinary CPU registers instead.
27643 @item -mno-fancy-math-387
27644 @opindex mno-fancy-math-387
27645 @opindex mfancy-math-387
27646 Some 387 emulators do not support the @code{sin}, @code{cos} and
27647 @code{sqrt} instructions for the 387.  Specify this option to avoid
27648 generating those instructions.
27649 This option is overridden when @option{-march}
27650 indicates that the target CPU always has an FPU and so the
27651 instruction does not need emulation.  These
27652 instructions are not generated unless you also use the
27653 @option{-funsafe-math-optimizations} switch.
27655 @item -malign-double
27656 @itemx -mno-align-double
27657 @opindex malign-double
27658 @opindex mno-align-double
27659 Control whether GCC aligns @code{double}, @code{long double}, and
27660 @code{long long} variables on a two-word boundary or a one-word
27661 boundary.  Aligning @code{double} variables on a two-word boundary
27662 produces code that runs somewhat faster on a Pentium at the
27663 expense of more memory.
27665 On x86-64, @option{-malign-double} is enabled by default.
27667 @strong{Warning:} if you use the @option{-malign-double} switch,
27668 structures containing the above types are aligned differently than
27669 the published application binary interface specifications for the x86-32
27670 and are not binary compatible with structures in code compiled
27671 without that switch.
27673 @item -m96bit-long-double
27674 @itemx -m128bit-long-double
27675 @opindex m96bit-long-double
27676 @opindex m128bit-long-double
27677 These switches control the size of @code{long double} type.  The x86-32
27678 application binary interface specifies the size to be 96 bits,
27679 so @option{-m96bit-long-double} is the default in 32-bit mode.
27681 Modern architectures (Pentium and newer) prefer @code{long double}
27682 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
27683 conforming to the ABI, this is not possible.  So specifying
27684 @option{-m128bit-long-double} aligns @code{long double}
27685 to a 16-byte boundary by padding the @code{long double} with an additional
27686 32-bit zero.
27688 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
27689 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
27691 Notice that neither of these options enable any extra precision over the x87
27692 standard of 80 bits for a @code{long double}.
27694 @strong{Warning:} if you override the default value for your target ABI, this
27695 changes the size of 
27696 structures and arrays containing @code{long double} variables,
27697 as well as modifying the function calling convention for functions taking
27698 @code{long double}.  Hence they are not binary-compatible
27699 with code compiled without that switch.
27701 @item -mlong-double-64
27702 @itemx -mlong-double-80
27703 @itemx -mlong-double-128
27704 @opindex mlong-double-64
27705 @opindex mlong-double-80
27706 @opindex mlong-double-128
27707 These switches control the size of @code{long double} type. A size
27708 of 64 bits makes the @code{long double} type equivalent to the @code{double}
27709 type. This is the default for 32-bit Bionic C library.  A size
27710 of 128 bits makes the @code{long double} type equivalent to the
27711 @code{__float128} type. This is the default for 64-bit Bionic C library.
27713 @strong{Warning:} if you override the default value for your target ABI, this
27714 changes the size of
27715 structures and arrays containing @code{long double} variables,
27716 as well as modifying the function calling convention for functions taking
27717 @code{long double}.  Hence they are not binary-compatible
27718 with code compiled without that switch.
27720 @item -malign-data=@var{type}
27721 @opindex malign-data
27722 Control how GCC aligns variables.  Supported values for @var{type} are
27723 @samp{compat} uses increased alignment value compatible uses GCC 4.8
27724 and earlier, @samp{abi} uses alignment value as specified by the
27725 psABI, and @samp{cacheline} uses increased alignment value to match
27726 the cache line size.  @samp{compat} is the default.
27728 @item -mlarge-data-threshold=@var{threshold}
27729 @opindex mlarge-data-threshold
27730 When @option{-mcmodel=medium} is specified, data objects larger than
27731 @var{threshold} are placed in the large data section.  This value must be the
27732 same across all objects linked into the binary, and defaults to 65535.
27734 @item -mrtd
27735 @opindex mrtd
27736 Use a different function-calling convention, in which functions that
27737 take a fixed number of arguments return with the @code{ret @var{num}}
27738 instruction, which pops their arguments while returning.  This saves one
27739 instruction in the caller since there is no need to pop the arguments
27740 there.
27742 You can specify that an individual function is called with this calling
27743 sequence with the function attribute @code{stdcall}.  You can also
27744 override the @option{-mrtd} option by using the function attribute
27745 @code{cdecl}.  @xref{Function Attributes}.
27747 @strong{Warning:} this calling convention is incompatible with the one
27748 normally used on Unix, so you cannot use it if you need to call
27749 libraries compiled with the Unix compiler.
27751 Also, you must provide function prototypes for all functions that
27752 take variable numbers of arguments (including @code{printf});
27753 otherwise incorrect code is generated for calls to those
27754 functions.
27756 In addition, seriously incorrect code results if you call a
27757 function with too many arguments.  (Normally, extra arguments are
27758 harmlessly ignored.)
27760 @item -mregparm=@var{num}
27761 @opindex mregparm
27762 Control how many registers are used to pass integer arguments.  By
27763 default, no registers are used to pass arguments, and at most 3
27764 registers can be used.  You can control this behavior for a specific
27765 function by using the function attribute @code{regparm}.
27766 @xref{Function Attributes}.
27768 @strong{Warning:} if you use this switch, and
27769 @var{num} is nonzero, then you must build all modules with the same
27770 value, including any libraries.  This includes the system libraries and
27771 startup modules.
27773 @item -msseregparm
27774 @opindex msseregparm
27775 Use SSE register passing conventions for float and double arguments
27776 and return values.  You can control this behavior for a specific
27777 function by using the function attribute @code{sseregparm}.
27778 @xref{Function Attributes}.
27780 @strong{Warning:} if you use this switch then you must build all
27781 modules with the same value, including any libraries.  This includes
27782 the system libraries and startup modules.
27784 @item -mvect8-ret-in-mem
27785 @opindex mvect8-ret-in-mem
27786 Return 8-byte vectors in memory instead of MMX registers.  This is the
27787 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
27788 Studio compilers until version 12.  Later compiler versions (starting
27789 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
27790 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
27791 you need to remain compatible with existing code produced by those
27792 previous compiler versions or older versions of GCC@.
27794 @item -mpc32
27795 @itemx -mpc64
27796 @itemx -mpc80
27797 @opindex mpc32
27798 @opindex mpc64
27799 @opindex mpc80
27801 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
27802 is specified, the significands of results of floating-point operations are
27803 rounded to 24 bits (single precision); @option{-mpc64} rounds the
27804 significands of results of floating-point operations to 53 bits (double
27805 precision) and @option{-mpc80} rounds the significands of results of
27806 floating-point operations to 64 bits (extended double precision), which is
27807 the default.  When this option is used, floating-point operations in higher
27808 precisions are not available to the programmer without setting the FPU
27809 control word explicitly.
27811 Setting the rounding of floating-point operations to less than the default
27812 80 bits can speed some programs by 2% or more.  Note that some mathematical
27813 libraries assume that extended-precision (80-bit) floating-point operations
27814 are enabled by default; routines in such libraries could suffer significant
27815 loss of accuracy, typically through so-called ``catastrophic cancellation'',
27816 when this option is used to set the precision to less than extended precision.
27818 @item -mstackrealign
27819 @opindex mstackrealign
27820 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
27821 option generates an alternate prologue and epilogue that realigns the
27822 run-time stack if necessary.  This supports mixing legacy codes that keep
27823 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
27824 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
27825 applicable to individual functions.
27827 @item -mpreferred-stack-boundary=@var{num}
27828 @opindex mpreferred-stack-boundary
27829 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
27830 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
27831 the default is 4 (16 bytes or 128 bits).
27833 @strong{Warning:} When generating code for the x86-64 architecture with
27834 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
27835 used to keep the stack boundary aligned to 8 byte boundary.  Since
27836 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
27837 intended to be used in controlled environment where stack space is
27838 important limitation.  This option leads to wrong code when functions
27839 compiled with 16 byte stack alignment (such as functions from a standard
27840 library) are called with misaligned stack.  In this case, SSE
27841 instructions may lead to misaligned memory access traps.  In addition,
27842 variable arguments are handled incorrectly for 16 byte aligned
27843 objects (including x87 long double and __int128), leading to wrong
27844 results.  You must build all modules with
27845 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
27846 includes the system libraries and startup modules.
27848 @item -mincoming-stack-boundary=@var{num}
27849 @opindex mincoming-stack-boundary
27850 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
27851 boundary.  If @option{-mincoming-stack-boundary} is not specified,
27852 the one specified by @option{-mpreferred-stack-boundary} is used.
27854 On Pentium and Pentium Pro, @code{double} and @code{long double} values
27855 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
27856 suffer significant run time performance penalties.  On Pentium III, the
27857 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
27858 properly if it is not 16-byte aligned.
27860 To ensure proper alignment of this values on the stack, the stack boundary
27861 must be as aligned as that required by any value stored on the stack.
27862 Further, every function must be generated such that it keeps the stack
27863 aligned.  Thus calling a function compiled with a higher preferred
27864 stack boundary from a function compiled with a lower preferred stack
27865 boundary most likely misaligns the stack.  It is recommended that
27866 libraries that use callbacks always use the default setting.
27868 This extra alignment does consume extra stack space, and generally
27869 increases code size.  Code that is sensitive to stack space usage, such
27870 as embedded systems and operating system kernels, may want to reduce the
27871 preferred alignment to @option{-mpreferred-stack-boundary=2}.
27873 @need 200
27874 @item -mmmx
27875 @opindex mmmx
27876 @need 200
27877 @itemx -msse
27878 @opindex msse
27879 @need 200
27880 @itemx -msse2
27881 @opindex msse2
27882 @need 200
27883 @itemx -msse3
27884 @opindex msse3
27885 @need 200
27886 @itemx -mssse3
27887 @opindex mssse3
27888 @need 200
27889 @itemx -msse4
27890 @opindex msse4
27891 @need 200
27892 @itemx -msse4a
27893 @opindex msse4a
27894 @need 200
27895 @itemx -msse4.1
27896 @opindex msse4.1
27897 @need 200
27898 @itemx -msse4.2
27899 @opindex msse4.2
27900 @need 200
27901 @itemx -mavx
27902 @opindex mavx
27903 @need 200
27904 @itemx -mavx2
27905 @opindex mavx2
27906 @need 200
27907 @itemx -mavx512f
27908 @opindex mavx512f
27909 @need 200
27910 @itemx -mavx512pf
27911 @opindex mavx512pf
27912 @need 200
27913 @itemx -mavx512er
27914 @opindex mavx512er
27915 @need 200
27916 @itemx -mavx512cd
27917 @opindex mavx512cd
27918 @need 200
27919 @itemx -mavx512vl
27920 @opindex mavx512vl
27921 @need 200
27922 @itemx -mavx512bw
27923 @opindex mavx512bw
27924 @need 200
27925 @itemx -mavx512dq
27926 @opindex mavx512dq
27927 @need 200
27928 @itemx -mavx512ifma
27929 @opindex mavx512ifma
27930 @need 200
27931 @itemx -mavx512vbmi
27932 @opindex mavx512vbmi
27933 @need 200
27934 @itemx -msha
27935 @opindex msha
27936 @need 200
27937 @itemx -maes
27938 @opindex maes
27939 @need 200
27940 @itemx -mpclmul
27941 @opindex mpclmul
27942 @need 200
27943 @itemx -mclflushopt
27944 @opindex mclflushopt
27945 @need 200
27946 @itemx -mclwb
27947 @opindex mclwb
27948 @need 200
27949 @itemx -mfsgsbase
27950 @opindex mfsgsbase
27951 @need 200
27952 @itemx -mptwrite
27953 @opindex mptwrite
27954 @need 200
27955 @itemx -mrdrnd
27956 @opindex mrdrnd
27957 @need 200
27958 @itemx -mf16c
27959 @opindex mf16c
27960 @need 200
27961 @itemx -mfma
27962 @opindex mfma
27963 @need 200
27964 @itemx -mpconfig
27965 @opindex mpconfig
27966 @need 200
27967 @itemx -mwbnoinvd
27968 @opindex mwbnoinvd
27969 @need 200
27970 @itemx -mfma4
27971 @opindex mfma4
27972 @need 200
27973 @itemx -mprfchw
27974 @opindex mprfchw
27975 @need 200
27976 @itemx -mrdpid
27977 @opindex mrdpid
27978 @need 200
27979 @itemx -mprefetchwt1
27980 @opindex mprefetchwt1
27981 @need 200
27982 @itemx -mrdseed
27983 @opindex mrdseed
27984 @need 200
27985 @itemx -msgx
27986 @opindex msgx
27987 @need 200
27988 @itemx -mxop
27989 @opindex mxop
27990 @need 200
27991 @itemx -mlwp
27992 @opindex mlwp
27993 @need 200
27994 @itemx -m3dnow
27995 @opindex m3dnow
27996 @need 200
27997 @itemx -m3dnowa
27998 @opindex m3dnowa
27999 @need 200
28000 @itemx -mpopcnt
28001 @opindex mpopcnt
28002 @need 200
28003 @itemx -mabm
28004 @opindex mabm
28005 @need 200
28006 @itemx -madx
28007 @opindex madx
28008 @need 200
28009 @itemx -mbmi
28010 @opindex mbmi
28011 @need 200
28012 @itemx -mbmi2
28013 @opindex mbmi2
28014 @need 200
28015 @itemx -mlzcnt
28016 @opindex mlzcnt
28017 @need 200
28018 @itemx -mfxsr
28019 @opindex mfxsr
28020 @need 200
28021 @itemx -mxsave
28022 @opindex mxsave
28023 @need 200
28024 @itemx -mxsaveopt
28025 @opindex mxsaveopt
28026 @need 200
28027 @itemx -mxsavec
28028 @opindex mxsavec
28029 @need 200
28030 @itemx -mxsaves
28031 @opindex mxsaves
28032 @need 200
28033 @itemx -mrtm
28034 @opindex mrtm
28035 @need 200
28036 @itemx -mhle
28037 @opindex mhle
28038 @need 200
28039 @itemx -mtbm
28040 @opindex mtbm
28041 @need 200
28042 @itemx -mmwaitx
28043 @opindex mmwaitx
28044 @need 200
28045 @itemx -mclzero
28046 @opindex mclzero
28047 @need 200
28048 @itemx -mpku
28049 @opindex mpku
28050 @need 200
28051 @itemx -mavx512vbmi2
28052 @opindex mavx512vbmi2
28053 @need 200
28054 @itemx -mavx512bf16
28055 @opindex mavx512bf16
28056 @need 200
28057 @itemx -mgfni
28058 @opindex mgfni
28059 @need 200
28060 @itemx -mvaes
28061 @opindex mvaes
28062 @need 200
28063 @itemx -mwaitpkg
28064 @opindex mwaitpkg
28065 @need 200
28066 @itemx -mvpclmulqdq
28067 @opindex mvpclmulqdq
28068 @need 200
28069 @itemx -mavx512bitalg
28070 @opindex mavx512bitalg
28071 @need 200
28072 @itemx -mmovdiri
28073 @opindex mmovdiri
28074 @need 200
28075 @itemx -mmovdir64b
28076 @opindex mmovdir64b
28077 @need 200
28078 @itemx -mavx512vpopcntdq
28079 @opindex mavx512vpopcntdq
28080 @need 200
28081 @itemx -mavx5124fmaps
28082 @opindex mavx5124fmaps
28083 @need 200
28084 @itemx -mavx512vnni
28085 @opindex mavx512vnni
28086 @need 200
28087 @itemx -mavx5124vnniw
28088 @opindex mavx5124vnniw
28089 @need 200
28090 @itemx -mcldemote
28091 @opindex mcldemote
28092 These switches enable the use of instructions in the MMX, SSE,
28093 SSE2, SSE3, SSSE3, SSE4, SSE4A, SSE4.1, SSE4.2, AVX, AVX2, AVX512F, AVX512PF,
28094 AVX512ER, AVX512CD, AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA, AVX512VBMI, SHA,
28095 AES, PCLMUL, CLFLUSHOPT, CLWB, FSGSBASE, PTWRITE, RDRND, F16C, FMA, PCONFIG,
28096 WBNOINVD, FMA4, PREFETCHW, RDPID, PREFETCHWT1, RDSEED, SGX, XOP, LWP,
28097 3DNow!@:, enhanced 3DNow!@:, POPCNT, ABM, ADX, BMI, BMI2, LZCNT, FXSR, XSAVE,
28098 XSAVEOPT, XSAVEC, XSAVES, RTM, HLE, TBM, MWAITX, CLZERO, PKU, AVX512VBMI2,
28099 GFNI, VAES, WAITPKG, VPCLMULQDQ, AVX512BITALG, MOVDIRI, MOVDIR64B, AVX512BF16
28100 AVX512VPOPCNTDQ, AVX5124FMAPS, AVX512VNNI, AVX5124VNNIW, or CLDEMOTE
28101 extended instruction sets.  Each has a corresponding @option{-mno-} option to
28102 disable use of these instructions.
28104 These extensions are also available as built-in functions: see
28105 @ref{x86 Built-in Functions}, for details of the functions enabled and
28106 disabled by these switches.
28108 To generate SSE/SSE2 instructions automatically from floating-point
28109 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
28111 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
28112 generates new AVX instructions or AVX equivalence for all SSEx instructions
28113 when needed.
28115 These options enable GCC to use these extended instructions in
28116 generated code, even without @option{-mfpmath=sse}.  Applications that
28117 perform run-time CPU detection must compile separate files for each
28118 supported architecture, using the appropriate flags.  In particular,
28119 the file containing the CPU detection code should be compiled without
28120 these options.
28122 @item -mdump-tune-features
28123 @opindex mdump-tune-features
28124 This option instructs GCC to dump the names of the x86 performance 
28125 tuning features and default settings. The names can be used in 
28126 @option{-mtune-ctrl=@var{feature-list}}.
28128 @item -mtune-ctrl=@var{feature-list}
28129 @opindex mtune-ctrl=@var{feature-list}
28130 This option is used to do fine grain control of x86 code generation features.
28131 @var{feature-list} is a comma separated list of @var{feature} names. See also
28132 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
28133 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
28134 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
28135 developers. Using it may lead to code paths not covered by testing and can
28136 potentially result in compiler ICEs or runtime errors.
28138 @item -mno-default
28139 @opindex mno-default
28140 This option instructs GCC to turn off all tunable features. See also 
28141 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
28143 @item -mcld
28144 @opindex mcld
28145 This option instructs GCC to emit a @code{cld} instruction in the prologue
28146 of functions that use string instructions.  String instructions depend on
28147 the DF flag to select between autoincrement or autodecrement mode.  While the
28148 ABI specifies the DF flag to be cleared on function entry, some operating
28149 systems violate this specification by not clearing the DF flag in their
28150 exception dispatchers.  The exception handler can be invoked with the DF flag
28151 set, which leads to wrong direction mode when string instructions are used.
28152 This option can be enabled by default on 32-bit x86 targets by configuring
28153 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
28154 instructions can be suppressed with the @option{-mno-cld} compiler option
28155 in this case.
28157 @item -mvzeroupper
28158 @opindex mvzeroupper
28159 This option instructs GCC to emit a @code{vzeroupper} instruction
28160 before a transfer of control flow out of the function to minimize
28161 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
28162 intrinsics.
28164 @item -mprefer-avx128
28165 @opindex mprefer-avx128
28166 This option instructs GCC to use 128-bit AVX instructions instead of
28167 256-bit AVX instructions in the auto-vectorizer.
28169 @item -mprefer-vector-width=@var{opt}
28170 @opindex mprefer-vector-width
28171 This option instructs GCC to use @var{opt}-bit vector width in instructions
28172 instead of default on the selected platform.
28174 @table @samp
28175 @item none
28176 No extra limitations applied to GCC other than defined by the selected platform.
28178 @item 128
28179 Prefer 128-bit vector width for instructions.
28181 @item 256
28182 Prefer 256-bit vector width for instructions.
28184 @item 512
28185 Prefer 512-bit vector width for instructions.
28186 @end table
28188 @item -mcx16
28189 @opindex mcx16
28190 This option enables GCC to generate @code{CMPXCHG16B} instructions in 64-bit
28191 code to implement compare-and-exchange operations on 16-byte aligned 128-bit
28192 objects.  This is useful for atomic updates of data structures exceeding one
28193 machine word in size.  The compiler uses this instruction to implement
28194 @ref{__sync Builtins}.  However, for @ref{__atomic Builtins} operating on
28195 128-bit integers, a library call is always used.
28197 @item -msahf
28198 @opindex msahf
28199 This option enables generation of @code{SAHF} instructions in 64-bit code.
28200 Early Intel Pentium 4 CPUs with Intel 64 support,
28201 prior to the introduction of Pentium 4 G1 step in December 2005,
28202 lacked the @code{LAHF} and @code{SAHF} instructions
28203 which are supported by AMD64.
28204 These are load and store instructions, respectively, for certain status flags.
28205 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
28206 @code{drem}, and @code{remainder} built-in functions;
28207 see @ref{Other Builtins} for details.
28209 @item -mmovbe
28210 @opindex mmovbe
28211 This option enables use of the @code{movbe} instruction to implement
28212 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
28214 @item -mshstk
28215 @opindex mshstk
28216 The @option{-mshstk} option enables shadow stack built-in functions
28217 from x86 Control-flow Enforcement Technology (CET).
28219 @item -mcrc32
28220 @opindex mcrc32
28221 This option enables built-in functions @code{__builtin_ia32_crc32qi},
28222 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
28223 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
28225 @item -mrecip
28226 @opindex mrecip
28227 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
28228 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
28229 with an additional Newton-Raphson step
28230 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
28231 (and their vectorized
28232 variants) for single-precision floating-point arguments.  These instructions
28233 are generated only when @option{-funsafe-math-optimizations} is enabled
28234 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
28235 Note that while the throughput of the sequence is higher than the throughput
28236 of the non-reciprocal instruction, the precision of the sequence can be
28237 decreased by up to 2 ulp (i.e.@: the inverse of 1.0 equals 0.99999994).
28239 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
28240 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
28241 combination), and doesn't need @option{-mrecip}.
28243 Also note that GCC emits the above sequence with additional Newton-Raphson step
28244 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
28245 already with @option{-ffast-math} (or the above option combination), and
28246 doesn't need @option{-mrecip}.
28248 @item -mrecip=@var{opt}
28249 @opindex mrecip=opt
28250 This option controls which reciprocal estimate instructions
28251 may be used.  @var{opt} is a comma-separated list of options, which may
28252 be preceded by a @samp{!} to invert the option:
28254 @table @samp
28255 @item all
28256 Enable all estimate instructions.
28258 @item default
28259 Enable the default instructions, equivalent to @option{-mrecip}.
28261 @item none
28262 Disable all estimate instructions, equivalent to @option{-mno-recip}.
28264 @item div
28265 Enable the approximation for scalar division.
28267 @item vec-div
28268 Enable the approximation for vectorized division.
28270 @item sqrt
28271 Enable the approximation for scalar square root.
28273 @item vec-sqrt
28274 Enable the approximation for vectorized square root.
28275 @end table
28277 So, for example, @option{-mrecip=all,!sqrt} enables
28278 all of the reciprocal approximations, except for square root.
28280 @item -mveclibabi=@var{type}
28281 @opindex mveclibabi
28282 Specifies the ABI type to use for vectorizing intrinsics using an
28283 external library.  Supported values for @var{type} are @samp{svml} 
28284 for the Intel short
28285 vector math library and @samp{acml} for the AMD math core library.
28286 To use this option, both @option{-ftree-vectorize} and
28287 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
28288 ABI-compatible library must be specified at link time.
28290 GCC currently emits calls to @code{vmldExp2},
28291 @code{vmldLn2}, @code{vmldLog102}, @code{vmldPow2},
28292 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
28293 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
28294 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
28295 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4},
28296 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
28297 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
28298 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
28299 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
28300 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
28301 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
28302 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
28303 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
28304 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
28305 when @option{-mveclibabi=acml} is used.  
28307 @item -mabi=@var{name}
28308 @opindex mabi
28309 Generate code for the specified calling convention.  Permissible values
28310 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
28311 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
28312 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
28313 You can control this behavior for specific functions by
28314 using the function attributes @code{ms_abi} and @code{sysv_abi}.
28315 @xref{Function Attributes}.
28317 @item -mforce-indirect-call
28318 @opindex mforce-indirect-call
28319 Force all calls to functions to be indirect. This is useful
28320 when using Intel Processor Trace where it generates more precise timing
28321 information for function calls.
28323 @item -mmanual-endbr
28324 @opindex mmanual-endbr
28325 Insert ENDBR instruction at function entry only via the @code{cf_check}
28326 function attribute. This is useful when used with the option
28327 @option{-fcf-protection=branch} to control ENDBR insertion at the
28328 function entry.
28330 @item -mcall-ms2sysv-xlogues
28331 @opindex mcall-ms2sysv-xlogues
28332 @opindex mno-call-ms2sysv-xlogues
28333 Due to differences in 64-bit ABIs, any Microsoft ABI function that calls a
28334 System V ABI function must consider RSI, RDI and XMM6-15 as clobbered.  By
28335 default, the code for saving and restoring these registers is emitted inline,
28336 resulting in fairly lengthy prologues and epilogues.  Using
28337 @option{-mcall-ms2sysv-xlogues} emits prologues and epilogues that
28338 use stubs in the static portion of libgcc to perform these saves and restores,
28339 thus reducing function size at the cost of a few extra instructions.
28341 @item -mtls-dialect=@var{type}
28342 @opindex mtls-dialect
28343 Generate code to access thread-local storage using the @samp{gnu} or
28344 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
28345 @samp{gnu2} is more efficient, but it may add compile- and run-time
28346 requirements that cannot be satisfied on all systems.
28348 @item -mpush-args
28349 @itemx -mno-push-args
28350 @opindex mpush-args
28351 @opindex mno-push-args
28352 Use PUSH operations to store outgoing parameters.  This method is shorter
28353 and usually equally fast as method using SUB/MOV operations and is enabled
28354 by default.  In some cases disabling it may improve performance because of
28355 improved scheduling and reduced dependencies.
28357 @item -maccumulate-outgoing-args
28358 @opindex maccumulate-outgoing-args
28359 If enabled, the maximum amount of space required for outgoing arguments is
28360 computed in the function prologue.  This is faster on most modern CPUs
28361 because of reduced dependencies, improved scheduling and reduced stack usage
28362 when the preferred stack boundary is not equal to 2.  The drawback is a notable
28363 increase in code size.  This switch implies @option{-mno-push-args}.
28365 @item -mthreads
28366 @opindex mthreads
28367 Support thread-safe exception handling on MinGW.  Programs that rely
28368 on thread-safe exception handling must compile and link all code with the
28369 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
28370 @option{-D_MT}; when linking, it links in a special thread helper library
28371 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
28373 @item -mms-bitfields
28374 @itemx -mno-ms-bitfields
28375 @opindex mms-bitfields
28376 @opindex mno-ms-bitfields
28378 Enable/disable bit-field layout compatible with the native Microsoft
28379 Windows compiler.  
28381 If @code{packed} is used on a structure, or if bit-fields are used,
28382 it may be that the Microsoft ABI lays out the structure differently
28383 than the way GCC normally does.  Particularly when moving packed
28384 data between functions compiled with GCC and the native Microsoft compiler
28385 (either via function call or as data in a file), it may be necessary to access
28386 either format.
28388 This option is enabled by default for Microsoft Windows
28389 targets.  This behavior can also be controlled locally by use of variable
28390 or type attributes.  For more information, see @ref{x86 Variable Attributes}
28391 and @ref{x86 Type Attributes}.
28393 The Microsoft structure layout algorithm is fairly simple with the exception
28394 of the bit-field packing.  
28395 The padding and alignment of members of structures and whether a bit-field 
28396 can straddle a storage-unit boundary are determine by these rules:
28398 @enumerate
28399 @item Structure members are stored sequentially in the order in which they are
28400 declared: the first member has the lowest memory address and the last member
28401 the highest.
28403 @item Every data object has an alignment requirement.  The alignment requirement
28404 for all data except structures, unions, and arrays is either the size of the
28405 object or the current packing size (specified with either the
28406 @code{aligned} attribute or the @code{pack} pragma),
28407 whichever is less.  For structures, unions, and arrays,
28408 the alignment requirement is the largest alignment requirement of its members.
28409 Every object is allocated an offset so that:
28411 @smallexample
28412 offset % alignment_requirement == 0
28413 @end smallexample
28415 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
28416 unit if the integral types are the same size and if the next bit-field fits
28417 into the current allocation unit without crossing the boundary imposed by the
28418 common alignment requirements of the bit-fields.
28419 @end enumerate
28421 MSVC interprets zero-length bit-fields in the following ways:
28423 @enumerate
28424 @item If a zero-length bit-field is inserted between two bit-fields that
28425 are normally coalesced, the bit-fields are not coalesced.
28427 For example:
28429 @smallexample
28430 struct
28431  @{
28432    unsigned long bf_1 : 12;
28433    unsigned long : 0;
28434    unsigned long bf_2 : 12;
28435  @} t1;
28436 @end smallexample
28438 @noindent
28439 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
28440 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
28442 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
28443 alignment of the zero-length bit-field is greater than the member that follows it,
28444 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
28446 For example:
28448 @smallexample
28449 struct
28450  @{
28451    char foo : 4;
28452    short : 0;
28453    char bar;
28454  @} t2;
28456 struct
28457  @{
28458    char foo : 4;
28459    short : 0;
28460    double bar;
28461  @} t3;
28462 @end smallexample
28464 @noindent
28465 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
28466 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
28467 bit-field does not affect the alignment of @code{bar} or, as a result, the size
28468 of the structure.
28470 Taking this into account, it is important to note the following:
28472 @enumerate
28473 @item If a zero-length bit-field follows a normal bit-field, the type of the
28474 zero-length bit-field may affect the alignment of the structure as whole. For
28475 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
28476 normal bit-field, and is of type short.
28478 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
28479 still affect the alignment of the structure:
28481 @smallexample
28482 struct
28483  @{
28484    char foo : 6;
28485    long : 0;
28486  @} t4;
28487 @end smallexample
28489 @noindent
28490 Here, @code{t4} takes up 4 bytes.
28491 @end enumerate
28493 @item Zero-length bit-fields following non-bit-field members are ignored:
28495 @smallexample
28496 struct
28497  @{
28498    char foo;
28499    long : 0;
28500    char bar;
28501  @} t5;
28502 @end smallexample
28504 @noindent
28505 Here, @code{t5} takes up 2 bytes.
28506 @end enumerate
28509 @item -mno-align-stringops
28510 @opindex mno-align-stringops
28511 @opindex malign-stringops
28512 Do not align the destination of inlined string operations.  This switch reduces
28513 code size and improves performance in case the destination is already aligned,
28514 but GCC doesn't know about it.
28516 @item -minline-all-stringops
28517 @opindex minline-all-stringops
28518 By default GCC inlines string operations only when the destination is 
28519 known to be aligned to least a 4-byte boundary.  
28520 This enables more inlining and increases code
28521 size, but may improve performance of code that depends on fast
28522 @code{memcpy} and @code{memset} for short lengths.
28523 The option enables inline expansion of @code{strlen} for all
28524 pointer alignments.
28526 @item -minline-stringops-dynamically
28527 @opindex minline-stringops-dynamically
28528 For string operations of unknown size, use run-time checks with
28529 inline code for small blocks and a library call for large blocks.
28531 @item -mstringop-strategy=@var{alg}
28532 @opindex mstringop-strategy=@var{alg}
28533 Override the internal decision heuristic for the particular algorithm to use
28534 for inlining string operations.  The allowed values for @var{alg} are:
28536 @table @samp
28537 @item rep_byte
28538 @itemx rep_4byte
28539 @itemx rep_8byte
28540 Expand using i386 @code{rep} prefix of the specified size.
28542 @item byte_loop
28543 @itemx loop
28544 @itemx unrolled_loop
28545 Expand into an inline loop.
28547 @item libcall
28548 Always use a library call.
28549 @end table
28551 @item -mmemcpy-strategy=@var{strategy}
28552 @opindex mmemcpy-strategy=@var{strategy}
28553 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
28554 should be inlined and what inline algorithm to use when the expected size
28555 of the copy operation is known. @var{strategy} 
28556 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
28557 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
28558 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
28559 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
28560 in the list must be specified in increasing order.  The minimal byte size for 
28561 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
28562 preceding range.
28564 @item -mmemset-strategy=@var{strategy}
28565 @opindex mmemset-strategy=@var{strategy}
28566 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
28567 @code{__builtin_memset} expansion.
28569 @item -momit-leaf-frame-pointer
28570 @opindex momit-leaf-frame-pointer
28571 Don't keep the frame pointer in a register for leaf functions.  This
28572 avoids the instructions to save, set up, and restore frame pointers and
28573 makes an extra register available in leaf functions.  The option
28574 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
28575 which might make debugging harder.
28577 @item -mtls-direct-seg-refs
28578 @itemx -mno-tls-direct-seg-refs
28579 @opindex mtls-direct-seg-refs
28580 Controls whether TLS variables may be accessed with offsets from the
28581 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
28582 or whether the thread base pointer must be added.  Whether or not this
28583 is valid depends on the operating system, and whether it maps the
28584 segment to cover the entire TLS area.
28586 For systems that use the GNU C Library, the default is on.
28588 @item -msse2avx
28589 @itemx -mno-sse2avx
28590 @opindex msse2avx
28591 Specify that the assembler should encode SSE instructions with VEX
28592 prefix.  The option @option{-mavx} turns this on by default.
28594 @item -mfentry
28595 @itemx -mno-fentry
28596 @opindex mfentry
28597 If profiling is active (@option{-pg}), put the profiling
28598 counter call before the prologue.
28599 Note: On x86 architectures the attribute @code{ms_hook_prologue}
28600 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
28602 @item -mrecord-mcount
28603 @itemx -mno-record-mcount
28604 @opindex mrecord-mcount
28605 If profiling is active (@option{-pg}), generate a __mcount_loc section
28606 that contains pointers to each profiling call. This is useful for
28607 automatically patching and out calls.
28609 @item -mnop-mcount
28610 @itemx -mno-nop-mcount
28611 @opindex mnop-mcount
28612 If profiling is active (@option{-pg}), generate the calls to
28613 the profiling functions as NOPs. This is useful when they
28614 should be patched in later dynamically. This is likely only
28615 useful together with @option{-mrecord-mcount}.
28617 @item -minstrument-return=@var{type}
28618 @opindex minstrument-return
28619 Instrument function exit in -pg -mfentry instrumented functions with
28620 call to specified function. This only instruments true returns ending
28621 with ret, but not sibling calls ending with jump. Valid types
28622 are @var{none} to not instrument, @var{call} to generate a call to __return__,
28623 or @var{nop5} to generate a 5 byte nop.
28625 @item -mrecord-return
28626 @itemx -mno-record-return
28627 @opindex mrecord-return
28628 Generate a __return_loc section pointing to all return instrumentation code.
28630 @item -mfentry-name=@var{name}
28631 @opindex mfentry-name
28632 Set name of __fentry__ symbol called at function entry for -pg -mfentry functions.
28634 @item -mfentry-section=@var{name}
28635 @opindex mfentry-section
28636 Set name of section to record -mrecord-mcount calls (default __mcount_loc).
28638 @item -mskip-rax-setup
28639 @itemx -mno-skip-rax-setup
28640 @opindex mskip-rax-setup
28641 When generating code for the x86-64 architecture with SSE extensions
28642 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
28643 register when there are no variable arguments passed in vector registers.
28645 @strong{Warning:} Since RAX register is used to avoid unnecessarily
28646 saving vector registers on stack when passing variable arguments, the
28647 impacts of this option are callees may waste some stack space,
28648 misbehave or jump to a random location.  GCC 4.4 or newer don't have
28649 those issues, regardless the RAX register value.
28651 @item -m8bit-idiv
28652 @itemx -mno-8bit-idiv
28653 @opindex m8bit-idiv
28654 On some processors, like Intel Atom, 8-bit unsigned integer divide is
28655 much faster than 32-bit/64-bit integer divide.  This option generates a
28656 run-time check.  If both dividend and divisor are within range of 0
28657 to 255, 8-bit unsigned integer divide is used instead of
28658 32-bit/64-bit integer divide.
28660 @item -mavx256-split-unaligned-load
28661 @itemx -mavx256-split-unaligned-store
28662 @opindex mavx256-split-unaligned-load
28663 @opindex mavx256-split-unaligned-store
28664 Split 32-byte AVX unaligned load and store.
28666 @item -mstack-protector-guard=@var{guard}
28667 @itemx -mstack-protector-guard-reg=@var{reg}
28668 @itemx -mstack-protector-guard-offset=@var{offset}
28669 @opindex mstack-protector-guard
28670 @opindex mstack-protector-guard-reg
28671 @opindex mstack-protector-guard-offset
28672 Generate stack protection code using canary at @var{guard}.  Supported
28673 locations are @samp{global} for global canary or @samp{tls} for per-thread
28674 canary in the TLS block (the default).  This option has effect only when
28675 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
28677 With the latter choice the options
28678 @option{-mstack-protector-guard-reg=@var{reg}} and
28679 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
28680 which segment register (@code{%fs} or @code{%gs}) to use as base register
28681 for reading the canary, and from what offset from that base register.
28682 The default for those is as specified in the relevant ABI.
28684 @item -mgeneral-regs-only
28685 @opindex mgeneral-regs-only
28686 Generate code that uses only the general-purpose registers.  This
28687 prevents the compiler from using floating-point, vector, mask and bound
28688 registers.
28690 @item -mindirect-branch=@var{choice}
28691 @opindex mindirect-branch
28692 Convert indirect call and jump with @var{choice}.  The default is
28693 @samp{keep}, which keeps indirect call and jump unmodified.
28694 @samp{thunk} converts indirect call and jump to call and return thunk.
28695 @samp{thunk-inline} converts indirect call and jump to inlined call
28696 and return thunk.  @samp{thunk-extern} converts indirect call and jump
28697 to external call and return thunk provided in a separate object file.
28698 You can control this behavior for a specific function by using the
28699 function attribute @code{indirect_branch}.  @xref{Function Attributes}.
28701 Note that @option{-mcmodel=large} is incompatible with
28702 @option{-mindirect-branch=thunk} and
28703 @option{-mindirect-branch=thunk-extern} since the thunk function may
28704 not be reachable in the large code model.
28706 Note that @option{-mindirect-branch=thunk-extern} is incompatible with
28707 @option{-fcf-protection=branch} since the external thunk cannot be modified
28708 to disable control-flow check.
28710 @item -mfunction-return=@var{choice}
28711 @opindex mfunction-return
28712 Convert function return with @var{choice}.  The default is @samp{keep},
28713 which keeps function return unmodified.  @samp{thunk} converts function
28714 return to call and return thunk.  @samp{thunk-inline} converts function
28715 return to inlined call and return thunk.  @samp{thunk-extern} converts
28716 function return to external call and return thunk provided in a separate
28717 object file.  You can control this behavior for a specific function by
28718 using the function attribute @code{function_return}.
28719 @xref{Function Attributes}.
28721 Note that @option{-mcmodel=large} is incompatible with
28722 @option{-mfunction-return=thunk} and
28723 @option{-mfunction-return=thunk-extern} since the thunk function may
28724 not be reachable in the large code model.
28727 @item -mindirect-branch-register
28728 @opindex mindirect-branch-register
28729 Force indirect call and jump via register.
28731 @end table
28733 These @samp{-m} switches are supported in addition to the above
28734 on x86-64 processors in 64-bit environments.
28736 @table @gcctabopt
28737 @item -m32
28738 @itemx -m64
28739 @itemx -mx32
28740 @itemx -m16
28741 @itemx -miamcu
28742 @opindex m32
28743 @opindex m64
28744 @opindex mx32
28745 @opindex m16
28746 @opindex miamcu
28747 Generate code for a 16-bit, 32-bit or 64-bit environment.
28748 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
28749 to 32 bits, and
28750 generates code that runs on any i386 system.
28752 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
28753 types to 64 bits, and generates code for the x86-64 architecture.
28754 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
28755 and @option{-mdynamic-no-pic} options.
28757 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
28758 to 32 bits, and
28759 generates code for the x86-64 architecture.
28761 The @option{-m16} option is the same as @option{-m32}, except for that
28762 it outputs the @code{.code16gcc} assembly directive at the beginning of
28763 the assembly output so that the binary can run in 16-bit mode.
28765 The @option{-miamcu} option generates code which conforms to Intel MCU
28766 psABI.  It requires the @option{-m32} option to be turned on.
28768 @item -mno-red-zone
28769 @opindex mno-red-zone
28770 @opindex mred-zone
28771 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
28772 by the x86-64 ABI; it is a 128-byte area beyond the location of the
28773 stack pointer that is not modified by signal or interrupt handlers
28774 and therefore can be used for temporary data without adjusting the stack
28775 pointer.  The flag @option{-mno-red-zone} disables this red zone.
28777 @item -mcmodel=small
28778 @opindex mcmodel=small
28779 Generate code for the small code model: the program and its symbols must
28780 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
28781 Programs can be statically or dynamically linked.  This is the default
28782 code model.
28784 @item -mcmodel=kernel
28785 @opindex mcmodel=kernel
28786 Generate code for the kernel code model.  The kernel runs in the
28787 negative 2 GB of the address space.
28788 This model has to be used for Linux kernel code.
28790 @item -mcmodel=medium
28791 @opindex mcmodel=medium
28792 Generate code for the medium model: the program is linked in the lower 2
28793 GB of the address space.  Small symbols are also placed there.  Symbols
28794 with sizes larger than @option{-mlarge-data-threshold} are put into
28795 large data or BSS sections and can be located above 2GB.  Programs can
28796 be statically or dynamically linked.
28798 @item -mcmodel=large
28799 @opindex mcmodel=large
28800 Generate code for the large model.  This model makes no assumptions
28801 about addresses and sizes of sections.
28803 @item -maddress-mode=long
28804 @opindex maddress-mode=long
28805 Generate code for long address mode.  This is only supported for 64-bit
28806 and x32 environments.  It is the default address mode for 64-bit
28807 environments.
28809 @item -maddress-mode=short
28810 @opindex maddress-mode=short
28811 Generate code for short address mode.  This is only supported for 32-bit
28812 and x32 environments.  It is the default address mode for 32-bit and
28813 x32 environments.
28814 @end table
28816 @node x86 Windows Options
28817 @subsection x86 Windows Options
28818 @cindex x86 Windows Options
28819 @cindex Windows Options for x86
28821 These additional options are available for Microsoft Windows targets:
28823 @table @gcctabopt
28824 @item -mconsole
28825 @opindex mconsole
28826 This option
28827 specifies that a console application is to be generated, by
28828 instructing the linker to set the PE header subsystem type
28829 required for console applications.
28830 This option is available for Cygwin and MinGW targets and is
28831 enabled by default on those targets.
28833 @item -mdll
28834 @opindex mdll
28835 This option is available for Cygwin and MinGW targets.  It
28836 specifies that a DLL---a dynamic link library---is to be
28837 generated, enabling the selection of the required runtime
28838 startup object and entry point.
28840 @item -mnop-fun-dllimport
28841 @opindex mnop-fun-dllimport
28842 This option is available for Cygwin and MinGW targets.  It
28843 specifies that the @code{dllimport} attribute should be ignored.
28845 @item -mthread
28846 @opindex mthread
28847 This option is available for MinGW targets. It specifies
28848 that MinGW-specific thread support is to be used.
28850 @item -municode
28851 @opindex municode
28852 This option is available for MinGW-w64 targets.  It causes
28853 the @code{UNICODE} preprocessor macro to be predefined, and
28854 chooses Unicode-capable runtime startup code.
28856 @item -mwin32
28857 @opindex mwin32
28858 This option is available for Cygwin and MinGW targets.  It
28859 specifies that the typical Microsoft Windows predefined macros are to
28860 be set in the pre-processor, but does not influence the choice
28861 of runtime library/startup code.
28863 @item -mwindows
28864 @opindex mwindows
28865 This option is available for Cygwin and MinGW targets.  It
28866 specifies that a GUI application is to be generated by
28867 instructing the linker to set the PE header subsystem type
28868 appropriately.
28870 @item -fno-set-stack-executable
28871 @opindex fno-set-stack-executable
28872 @opindex fset-stack-executable
28873 This option is available for MinGW targets. It specifies that
28874 the executable flag for the stack used by nested functions isn't
28875 set. This is necessary for binaries running in kernel mode of
28876 Microsoft Windows, as there the User32 API, which is used to set executable
28877 privileges, isn't available.
28879 @item -fwritable-relocated-rdata
28880 @opindex fno-writable-relocated-rdata
28881 @opindex fwritable-relocated-rdata
28882 This option is available for MinGW and Cygwin targets.  It specifies
28883 that relocated-data in read-only section is put into the @code{.data}
28884 section.  This is a necessary for older runtimes not supporting
28885 modification of @code{.rdata} sections for pseudo-relocation.
28887 @item -mpe-aligned-commons
28888 @opindex mpe-aligned-commons
28889 This option is available for Cygwin and MinGW targets.  It
28890 specifies that the GNU extension to the PE file format that
28891 permits the correct alignment of COMMON variables should be
28892 used when generating code.  It is enabled by default if
28893 GCC detects that the target assembler found during configuration
28894 supports the feature.
28895 @end table
28897 See also under @ref{x86 Options} for standard options.
28899 @node Xstormy16 Options
28900 @subsection Xstormy16 Options
28901 @cindex Xstormy16 Options
28903 These options are defined for Xstormy16:
28905 @table @gcctabopt
28906 @item -msim
28907 @opindex msim
28908 Choose startup files and linker script suitable for the simulator.
28909 @end table
28911 @node Xtensa Options
28912 @subsection Xtensa Options
28913 @cindex Xtensa Options
28915 These options are supported for Xtensa targets:
28917 @table @gcctabopt
28918 @item -mconst16
28919 @itemx -mno-const16
28920 @opindex mconst16
28921 @opindex mno-const16
28922 Enable or disable use of @code{CONST16} instructions for loading
28923 constant values.  The @code{CONST16} instruction is currently not a
28924 standard option from Tensilica.  When enabled, @code{CONST16}
28925 instructions are always used in place of the standard @code{L32R}
28926 instructions.  The use of @code{CONST16} is enabled by default only if
28927 the @code{L32R} instruction is not available.
28929 @item -mfused-madd
28930 @itemx -mno-fused-madd
28931 @opindex mfused-madd
28932 @opindex mno-fused-madd
28933 Enable or disable use of fused multiply/add and multiply/subtract
28934 instructions in the floating-point option.  This has no effect if the
28935 floating-point option is not also enabled.  Disabling fused multiply/add
28936 and multiply/subtract instructions forces the compiler to use separate
28937 instructions for the multiply and add/subtract operations.  This may be
28938 desirable in some cases where strict IEEE 754-compliant results are
28939 required: the fused multiply add/subtract instructions do not round the
28940 intermediate result, thereby producing results with @emph{more} bits of
28941 precision than specified by the IEEE standard.  Disabling fused multiply
28942 add/subtract instructions also ensures that the program output is not
28943 sensitive to the compiler's ability to combine multiply and add/subtract
28944 operations.
28946 @item -mserialize-volatile
28947 @itemx -mno-serialize-volatile
28948 @opindex mserialize-volatile
28949 @opindex mno-serialize-volatile
28950 When this option is enabled, GCC inserts @code{MEMW} instructions before
28951 @code{volatile} memory references to guarantee sequential consistency.
28952 The default is @option{-mserialize-volatile}.  Use
28953 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
28955 @item -mforce-no-pic
28956 @opindex mforce-no-pic
28957 For targets, like GNU/Linux, where all user-mode Xtensa code must be
28958 position-independent code (PIC), this option disables PIC for compiling
28959 kernel code.
28961 @item -mtext-section-literals
28962 @itemx -mno-text-section-literals
28963 @opindex mtext-section-literals
28964 @opindex mno-text-section-literals
28965 These options control the treatment of literal pools.  The default is
28966 @option{-mno-text-section-literals}, which places literals in a separate
28967 section in the output file.  This allows the literal pool to be placed
28968 in a data RAM/ROM, and it also allows the linker to combine literal
28969 pools from separate object files to remove redundant literals and
28970 improve code size.  With @option{-mtext-section-literals}, the literals
28971 are interspersed in the text section in order to keep them as close as
28972 possible to their references.  This may be necessary for large assembly
28973 files.  Literals for each function are placed right before that function.
28975 @item -mauto-litpools
28976 @itemx -mno-auto-litpools
28977 @opindex mauto-litpools
28978 @opindex mno-auto-litpools
28979 These options control the treatment of literal pools.  The default is
28980 @option{-mno-auto-litpools}, which places literals in a separate
28981 section in the output file unless @option{-mtext-section-literals} is
28982 used.  With @option{-mauto-litpools} the literals are interspersed in
28983 the text section by the assembler.  Compiler does not produce explicit
28984 @code{.literal} directives and loads literals into registers with
28985 @code{MOVI} instructions instead of @code{L32R} to let the assembler
28986 do relaxation and place literals as necessary.  This option allows
28987 assembler to create several literal pools per function and assemble
28988 very big functions, which may not be possible with
28989 @option{-mtext-section-literals}.
28991 @item -mtarget-align
28992 @itemx -mno-target-align
28993 @opindex mtarget-align
28994 @opindex mno-target-align
28995 When this option is enabled, GCC instructs the assembler to
28996 automatically align instructions to reduce branch penalties at the
28997 expense of some code density.  The assembler attempts to widen density
28998 instructions to align branch targets and the instructions following call
28999 instructions.  If there are not enough preceding safe density
29000 instructions to align a target, no widening is performed.  The
29001 default is @option{-mtarget-align}.  These options do not affect the
29002 treatment of auto-aligned instructions like @code{LOOP}, which the
29003 assembler always aligns, either by widening density instructions or
29004 by inserting NOP instructions.
29006 @item -mlongcalls
29007 @itemx -mno-longcalls
29008 @opindex mlongcalls
29009 @opindex mno-longcalls
29010 When this option is enabled, GCC instructs the assembler to translate
29011 direct calls to indirect calls unless it can determine that the target
29012 of a direct call is in the range allowed by the call instruction.  This
29013 translation typically occurs for calls to functions in other source
29014 files.  Specifically, the assembler translates a direct @code{CALL}
29015 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
29016 The default is @option{-mno-longcalls}.  This option should be used in
29017 programs where the call target can potentially be out of range.  This
29018 option is implemented in the assembler, not the compiler, so the
29019 assembly code generated by GCC still shows direct call
29020 instructions---look at the disassembled object code to see the actual
29021 instructions.  Note that the assembler uses an indirect call for
29022 every cross-file call, not just those that really are out of range.
29023 @end table
29025 @node zSeries Options
29026 @subsection zSeries Options
29027 @cindex zSeries options
29029 These are listed under @xref{S/390 and zSeries Options}.
29032 @c man end
29034 @node Spec Files
29035 @section Specifying Subprocesses and the Switches to Pass to Them
29036 @cindex Spec Files
29038 @command{gcc} is a driver program.  It performs its job by invoking a
29039 sequence of other programs to do the work of compiling, assembling and
29040 linking.  GCC interprets its command-line parameters and uses these to
29041 deduce which programs it should invoke, and which command-line options
29042 it ought to place on their command lines.  This behavior is controlled
29043 by @dfn{spec strings}.  In most cases there is one spec string for each
29044 program that GCC can invoke, but a few programs have multiple spec
29045 strings to control their behavior.  The spec strings built into GCC can
29046 be overridden by using the @option{-specs=} command-line switch to specify
29047 a spec file.
29049 @dfn{Spec files} are plain-text files that are used to construct spec
29050 strings.  They consist of a sequence of directives separated by blank
29051 lines.  The type of directive is determined by the first non-whitespace
29052 character on the line, which can be one of the following:
29054 @table @code
29055 @item %@var{command}
29056 Issues a @var{command} to the spec file processor.  The commands that can
29057 appear here are:
29059 @table @code
29060 @item %include <@var{file}>
29061 @cindex @code{%include}
29062 Search for @var{file} and insert its text at the current point in the
29063 specs file.
29065 @item %include_noerr <@var{file}>
29066 @cindex @code{%include_noerr}
29067 Just like @samp{%include}, but do not generate an error message if the include
29068 file cannot be found.
29070 @item %rename @var{old_name} @var{new_name}
29071 @cindex @code{%rename}
29072 Rename the spec string @var{old_name} to @var{new_name}.
29074 @end table
29076 @item *[@var{spec_name}]:
29077 This tells the compiler to create, override or delete the named spec
29078 string.  All lines after this directive up to the next directive or
29079 blank line are considered to be the text for the spec string.  If this
29080 results in an empty string then the spec is deleted.  (Or, if the
29081 spec did not exist, then nothing happens.)  Otherwise, if the spec
29082 does not currently exist a new spec is created.  If the spec does
29083 exist then its contents are overridden by the text of this
29084 directive, unless the first character of that text is the @samp{+}
29085 character, in which case the text is appended to the spec.
29087 @item [@var{suffix}]:
29088 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
29089 and up to the next directive or blank line are considered to make up the
29090 spec string for the indicated suffix.  When the compiler encounters an
29091 input file with the named suffix, it processes the spec string in
29092 order to work out how to compile that file.  For example:
29094 @smallexample
29095 .ZZ:
29096 z-compile -input %i
29097 @end smallexample
29099 This says that any input file whose name ends in @samp{.ZZ} should be
29100 passed to the program @samp{z-compile}, which should be invoked with the
29101 command-line switch @option{-input} and with the result of performing the
29102 @samp{%i} substitution.  (See below.)
29104 As an alternative to providing a spec string, the text following a
29105 suffix directive can be one of the following:
29107 @table @code
29108 @item @@@var{language}
29109 This says that the suffix is an alias for a known @var{language}.  This is
29110 similar to using the @option{-x} command-line switch to GCC to specify a
29111 language explicitly.  For example:
29113 @smallexample
29114 .ZZ:
29115 @@c++
29116 @end smallexample
29118 Says that .ZZ files are, in fact, C++ source files.
29120 @item #@var{name}
29121 This causes an error messages saying:
29123 @smallexample
29124 @var{name} compiler not installed on this system.
29125 @end smallexample
29126 @end table
29128 GCC already has an extensive list of suffixes built into it.
29129 This directive adds an entry to the end of the list of suffixes, but
29130 since the list is searched from the end backwards, it is effectively
29131 possible to override earlier entries using this technique.
29133 @end table
29135 GCC has the following spec strings built into it.  Spec files can
29136 override these strings or create their own.  Note that individual
29137 targets can also add their own spec strings to this list.
29139 @smallexample
29140 asm          Options to pass to the assembler
29141 asm_final    Options to pass to the assembler post-processor
29142 cpp          Options to pass to the C preprocessor
29143 cc1          Options to pass to the C compiler
29144 cc1plus      Options to pass to the C++ compiler
29145 endfile      Object files to include at the end of the link
29146 link         Options to pass to the linker
29147 lib          Libraries to include on the command line to the linker
29148 libgcc       Decides which GCC support library to pass to the linker
29149 linker       Sets the name of the linker
29150 predefines   Defines to be passed to the C preprocessor
29151 signed_char  Defines to pass to CPP to say whether @code{char} is signed
29152              by default
29153 startfile    Object files to include at the start of the link
29154 @end smallexample
29156 Here is a small example of a spec file:
29158 @smallexample
29159 %rename lib                 old_lib
29161 *lib:
29162 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
29163 @end smallexample
29165 This example renames the spec called @samp{lib} to @samp{old_lib} and
29166 then overrides the previous definition of @samp{lib} with a new one.
29167 The new definition adds in some extra command-line options before
29168 including the text of the old definition.
29170 @dfn{Spec strings} are a list of command-line options to be passed to their
29171 corresponding program.  In addition, the spec strings can contain
29172 @samp{%}-prefixed sequences to substitute variable text or to
29173 conditionally insert text into the command line.  Using these constructs
29174 it is possible to generate quite complex command lines.
29176 Here is a table of all defined @samp{%}-sequences for spec
29177 strings.  Note that spaces are not generated automatically around the
29178 results of expanding these sequences.  Therefore you can concatenate them
29179 together or combine them with constant text in a single argument.
29181 @table @code
29182 @item %%
29183 Substitute one @samp{%} into the program name or argument.
29185 @item %i
29186 Substitute the name of the input file being processed.
29188 @item %b
29189 Substitute the basename of the input file being processed.
29190 This is the substring up to (and not including) the last period
29191 and not including the directory.
29193 @item %B
29194 This is the same as @samp{%b}, but include the file suffix (text after
29195 the last period).
29197 @item %d
29198 Marks the argument containing or following the @samp{%d} as a
29199 temporary file name, so that that file is deleted if GCC exits
29200 successfully.  Unlike @samp{%g}, this contributes no text to the
29201 argument.
29203 @item %g@var{suffix}
29204 Substitute a file name that has suffix @var{suffix} and is chosen
29205 once per compilation, and mark the argument in the same way as
29206 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
29207 name is now chosen in a way that is hard to predict even when previously
29208 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
29209 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
29210 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
29211 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
29212 was simply substituted with a file name chosen once per compilation,
29213 without regard to any appended suffix (which was therefore treated
29214 just like ordinary text), making such attacks more likely to succeed.
29216 @item %u@var{suffix}
29217 Like @samp{%g}, but generates a new temporary file name
29218 each time it appears instead of once per compilation.
29220 @item %U@var{suffix}
29221 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
29222 new one if there is no such last file name.  In the absence of any
29223 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
29224 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
29225 involves the generation of two distinct file names, one
29226 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
29227 simply substituted with a file name chosen for the previous @samp{%u},
29228 without regard to any appended suffix.
29230 @item %j@var{suffix}
29231 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
29232 writable, and if @option{-save-temps} is not used; 
29233 otherwise, substitute the name
29234 of a temporary file, just like @samp{%u}.  This temporary file is not
29235 meant for communication between processes, but rather as a junk
29236 disposal mechanism.
29238 @item %|@var{suffix}
29239 @itemx %m@var{suffix}
29240 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
29241 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
29242 all.  These are the two most common ways to instruct a program that it
29243 should read from standard input or write to standard output.  If you
29244 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
29245 construct: see for example @file{f/lang-specs.h}.
29247 @item %.@var{SUFFIX}
29248 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
29249 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
29250 terminated by the next space or %.
29252 @item %w
29253 Marks the argument containing or following the @samp{%w} as the
29254 designated output file of this compilation.  This puts the argument
29255 into the sequence of arguments that @samp{%o} substitutes.
29257 @item %o
29258 Substitutes the names of all the output files, with spaces
29259 automatically placed around them.  You should write spaces
29260 around the @samp{%o} as well or the results are undefined.
29261 @samp{%o} is for use in the specs for running the linker.
29262 Input files whose names have no recognized suffix are not compiled
29263 at all, but they are included among the output files, so they are
29264 linked.
29266 @item %O
29267 Substitutes the suffix for object files.  Note that this is
29268 handled specially when it immediately follows @samp{%g, %u, or %U},
29269 because of the need for those to form complete file names.  The
29270 handling is such that @samp{%O} is treated exactly as if it had already
29271 been substituted, except that @samp{%g, %u, and %U} do not currently
29272 support additional @var{suffix} characters following @samp{%O} as they do
29273 following, for example, @samp{.o}.
29275 @item %p
29276 Substitutes the standard macro predefinitions for the
29277 current target machine.  Use this when running @command{cpp}.
29279 @item %P
29280 Like @samp{%p}, but puts @samp{__} before and after the name of each
29281 predefined macro, except for macros that start with @samp{__} or with
29282 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
29285 @item %I
29286 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
29287 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
29288 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
29289 and @option{-imultilib} as necessary.
29291 @item %s
29292 Current argument is the name of a library or startup file of some sort.
29293 Search for that file in a standard list of directories and substitute
29294 the full name found.  The current working directory is included in the
29295 list of directories scanned.
29297 @item %T
29298 Current argument is the name of a linker script.  Search for that file
29299 in the current list of directories to scan for libraries. If the file
29300 is located insert a @option{--script} option into the command line
29301 followed by the full path name found.  If the file is not found then
29302 generate an error message.  Note: the current working directory is not
29303 searched.
29305 @item %e@var{str}
29306 Print @var{str} as an error message.  @var{str} is terminated by a newline.
29307 Use this when inconsistent options are detected.
29309 @item %(@var{name})
29310 Substitute the contents of spec string @var{name} at this point.
29312 @item %x@{@var{option}@}
29313 Accumulate an option for @samp{%X}.
29315 @item %X
29316 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
29317 spec string.
29319 @item %Y
29320 Output the accumulated assembler options specified by @option{-Wa}.
29322 @item %Z
29323 Output the accumulated preprocessor options specified by @option{-Wp}.
29325 @item %a
29326 Process the @code{asm} spec.  This is used to compute the
29327 switches to be passed to the assembler.
29329 @item %A
29330 Process the @code{asm_final} spec.  This is a spec string for
29331 passing switches to an assembler post-processor, if such a program is
29332 needed.
29334 @item %l
29335 Process the @code{link} spec.  This is the spec for computing the
29336 command line passed to the linker.  Typically it makes use of the
29337 @samp{%L %G %S %D and %E} sequences.
29339 @item %D
29340 Dump out a @option{-L} option for each directory that GCC believes might
29341 contain startup files.  If the target supports multilibs then the
29342 current multilib directory is prepended to each of these paths.
29344 @item %L
29345 Process the @code{lib} spec.  This is a spec string for deciding which
29346 libraries are included on the command line to the linker.
29348 @item %G
29349 Process the @code{libgcc} spec.  This is a spec string for deciding
29350 which GCC support library is included on the command line to the linker.
29352 @item %S
29353 Process the @code{startfile} spec.  This is a spec for deciding which
29354 object files are the first ones passed to the linker.  Typically
29355 this might be a file named @file{crt0.o}.
29357 @item %E
29358 Process the @code{endfile} spec.  This is a spec string that specifies
29359 the last object files that are passed to the linker.
29361 @item %C
29362 Process the @code{cpp} spec.  This is used to construct the arguments
29363 to be passed to the C preprocessor.
29365 @item %1
29366 Process the @code{cc1} spec.  This is used to construct the options to be
29367 passed to the actual C compiler (@command{cc1}).
29369 @item %2
29370 Process the @code{cc1plus} spec.  This is used to construct the options to be
29371 passed to the actual C++ compiler (@command{cc1plus}).
29373 @item %*
29374 Substitute the variable part of a matched option.  See below.
29375 Note that each comma in the substituted string is replaced by
29376 a single space.
29378 @item %<S
29379 Remove all occurrences of @code{-S} from the command line.  Note---this
29380 command is position dependent.  @samp{%} commands in the spec string
29381 before this one see @code{-S}, @samp{%} commands in the spec string
29382 after this one do not.
29384 @item %:@var{function}(@var{args})
29385 Call the named function @var{function}, passing it @var{args}.
29386 @var{args} is first processed as a nested spec string, then split
29387 into an argument vector in the usual fashion.  The function returns
29388 a string which is processed as if it had appeared literally as part
29389 of the current spec.
29391 The following built-in spec functions are provided:
29393 @table @code
29394 @item @code{getenv}
29395 The @code{getenv} spec function takes two arguments: an environment
29396 variable name and a string.  If the environment variable is not
29397 defined, a fatal error is issued.  Otherwise, the return value is the
29398 value of the environment variable concatenated with the string.  For
29399 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
29401 @smallexample
29402 %:getenv(TOPDIR /include)
29403 @end smallexample
29405 expands to @file{/path/to/top/include}.
29407 @item @code{if-exists}
29408 The @code{if-exists} spec function takes one argument, an absolute
29409 pathname to a file.  If the file exists, @code{if-exists} returns the
29410 pathname.  Here is a small example of its usage:
29412 @smallexample
29413 *startfile:
29414 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
29415 @end smallexample
29417 @item @code{if-exists-else}
29418 The @code{if-exists-else} spec function is similar to the @code{if-exists}
29419 spec function, except that it takes two arguments.  The first argument is
29420 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
29421 returns the pathname.  If it does not exist, it returns the second argument.
29422 This way, @code{if-exists-else} can be used to select one file or another,
29423 based on the existence of the first.  Here is a small example of its usage:
29425 @smallexample
29426 *startfile:
29427 crt0%O%s %:if-exists(crti%O%s) \
29428 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
29429 @end smallexample
29431 @item @code{replace-outfile}
29432 The @code{replace-outfile} spec function takes two arguments.  It looks for the
29433 first argument in the outfiles array and replaces it with the second argument.  Here
29434 is a small example of its usage:
29436 @smallexample
29437 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
29438 @end smallexample
29440 @item @code{remove-outfile}
29441 The @code{remove-outfile} spec function takes one argument.  It looks for the
29442 first argument in the outfiles array and removes it.  Here is a small example
29443 its usage:
29445 @smallexample
29446 %:remove-outfile(-lm)
29447 @end smallexample
29449 @item @code{pass-through-libs}
29450 The @code{pass-through-libs} spec function takes any number of arguments.  It
29451 finds any @option{-l} options and any non-options ending in @file{.a} (which it
29452 assumes are the names of linker input library archive files) and returns a
29453 result containing all the found arguments each prepended by
29454 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
29455 intended to be passed to the LTO linker plugin.
29457 @smallexample
29458 %:pass-through-libs(%G %L %G)
29459 @end smallexample
29461 @item @code{print-asm-header}
29462 The @code{print-asm-header} function takes no arguments and simply
29463 prints a banner like:
29465 @smallexample
29466 Assembler options
29467 =================
29469 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
29470 @end smallexample
29472 It is used to separate compiler options from assembler options
29473 in the @option{--target-help} output.
29474 @end table
29476 @item %@{S@}
29477 Substitutes the @code{-S} switch, if that switch is given to GCC@.
29478 If that switch is not specified, this substitutes nothing.  Note that
29479 the leading dash is omitted when specifying this option, and it is
29480 automatically inserted if the substitution is performed.  Thus the spec
29481 string @samp{%@{foo@}} matches the command-line option @option{-foo}
29482 and outputs the command-line option @option{-foo}.
29484 @item %W@{S@}
29485 Like %@{@code{S}@} but mark last argument supplied within as a file to be
29486 deleted on failure.
29488 @item %@{S*@}
29489 Substitutes all the switches specified to GCC whose names start
29490 with @code{-S}, but which also take an argument.  This is used for
29491 switches like @option{-o}, @option{-D}, @option{-I}, etc.
29492 GCC considers @option{-o foo} as being
29493 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
29494 text, including the space.  Thus two arguments are generated.
29496 @item %@{S*&T*@}
29497 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
29498 (the order of @code{S} and @code{T} in the spec is not significant).
29499 There can be any number of ampersand-separated variables; for each the
29500 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
29502 @item %@{S:X@}
29503 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
29505 @item %@{!S:X@}
29506 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
29508 @item %@{S*:X@}
29509 Substitutes @code{X} if one or more switches whose names start with
29510 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
29511 once, no matter how many such switches appeared.  However, if @code{%*}
29512 appears somewhere in @code{X}, then @code{X} is substituted once
29513 for each matching switch, with the @code{%*} replaced by the part of
29514 that switch matching the @code{*}.
29516 If @code{%*} appears as the last part of a spec sequence then a space
29517 is added after the end of the last substitution.  If there is more
29518 text in the sequence, however, then a space is not generated.  This
29519 allows the @code{%*} substitution to be used as part of a larger
29520 string.  For example, a spec string like this:
29522 @smallexample
29523 %@{mcu=*:--script=%*/memory.ld@}
29524 @end smallexample
29526 @noindent
29527 when matching an option like @option{-mcu=newchip} produces:
29529 @smallexample
29530 --script=newchip/memory.ld
29531 @end smallexample
29533 @item %@{.S:X@}
29534 Substitutes @code{X}, if processing a file with suffix @code{S}.
29536 @item %@{!.S:X@}
29537 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
29539 @item %@{,S:X@}
29540 Substitutes @code{X}, if processing a file for language @code{S}.
29542 @item %@{!,S:X@}
29543 Substitutes @code{X}, if not processing a file for language @code{S}.
29545 @item %@{S|P:X@}
29546 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
29547 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
29548 @code{*} sequences as well, although they have a stronger binding than
29549 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
29550 alternatives must be starred, and only the first matching alternative
29551 is substituted.
29553 For example, a spec string like this:
29555 @smallexample
29556 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
29557 @end smallexample
29559 @noindent
29560 outputs the following command-line options from the following input
29561 command-line options:
29563 @smallexample
29564 fred.c        -foo -baz
29565 jim.d         -bar -boggle
29566 -d fred.c     -foo -baz -boggle
29567 -d jim.d      -bar -baz -boggle
29568 @end smallexample
29570 @item %@{S:X; T:Y; :D@}
29572 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
29573 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
29574 be as many clauses as you need.  This may be combined with @code{.},
29575 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
29578 @end table
29580 The switch matching text @code{S} in a @samp{%@{S@}}, @samp{%@{S:X@}}
29581 or similar construct can use a backslash to ignore the special meaning
29582 of the character following it, thus allowing literal matching of a
29583 character that is otherwise specially treated.  For example,
29584 @samp{%@{std=iso9899\:1999:X@}} substitutes @code{X} if the
29585 @option{-std=iso9899:1999} option is given.
29587 The conditional text @code{X} in a @samp{%@{S:X@}} or similar
29588 construct may contain other nested @samp{%} constructs or spaces, or
29589 even newlines.  They are processed as usual, as described above.
29590 Trailing white space in @code{X} is ignored.  White space may also
29591 appear anywhere on the left side of the colon in these constructs,
29592 except between @code{.} or @code{*} and the corresponding word.
29594 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
29595 handled specifically in these constructs.  If another value of
29596 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
29597 @option{-W} switch is found later in the command line, the earlier
29598 switch value is ignored, except with @{@code{S}*@} where @code{S} is
29599 just one letter, which passes all matching options.
29601 The character @samp{|} at the beginning of the predicate text is used to
29602 indicate that a command should be piped to the following command, but
29603 only if @option{-pipe} is specified.
29605 It is built into GCC which switches take arguments and which do not.
29606 (You might think it would be useful to generalize this to allow each
29607 compiler's spec to say which switches take arguments.  But this cannot
29608 be done in a consistent fashion.  GCC cannot even decide which input
29609 files have been specified without knowing which switches take arguments,
29610 and it must know which input files to compile in order to tell which
29611 compilers to run).
29613 GCC also knows implicitly that arguments starting in @option{-l} are to be
29614 treated as compiler output files, and passed to the linker in their
29615 proper position among the other output files.
29617 @node Environment Variables
29618 @section Environment Variables Affecting GCC
29619 @cindex environment variables
29621 @c man begin ENVIRONMENT
29622 This section describes several environment variables that affect how GCC
29623 operates.  Some of them work by specifying directories or prefixes to use
29624 when searching for various kinds of files.  Some are used to specify other
29625 aspects of the compilation environment.
29627 Note that you can also specify places to search using options such as
29628 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
29629 take precedence over places specified using environment variables, which
29630 in turn take precedence over those specified by the configuration of GCC@.
29631 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
29632 GNU Compiler Collection (GCC) Internals}.
29634 @table @env
29635 @item LANG
29636 @itemx LC_CTYPE
29637 @c @itemx LC_COLLATE
29638 @itemx LC_MESSAGES
29639 @c @itemx LC_MONETARY
29640 @c @itemx LC_NUMERIC
29641 @c @itemx LC_TIME
29642 @itemx LC_ALL
29643 @findex LANG
29644 @findex LC_CTYPE
29645 @c @findex LC_COLLATE
29646 @findex LC_MESSAGES
29647 @c @findex LC_MONETARY
29648 @c @findex LC_NUMERIC
29649 @c @findex LC_TIME
29650 @findex LC_ALL
29651 @cindex locale
29652 These environment variables control the way that GCC uses
29653 localization information which allows GCC to work with different
29654 national conventions.  GCC inspects the locale categories
29655 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
29656 so.  These locale categories can be set to any value supported by your
29657 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
29658 Kingdom encoded in UTF-8.
29660 The @env{LC_CTYPE} environment variable specifies character
29661 classification.  GCC uses it to determine the character boundaries in
29662 a string; this is needed for some multibyte encodings that contain quote
29663 and escape characters that are otherwise interpreted as a string
29664 end or escape.
29666 The @env{LC_MESSAGES} environment variable specifies the language to
29667 use in diagnostic messages.
29669 If the @env{LC_ALL} environment variable is set, it overrides the value
29670 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
29671 and @env{LC_MESSAGES} default to the value of the @env{LANG}
29672 environment variable.  If none of these variables are set, GCC
29673 defaults to traditional C English behavior.
29675 @item TMPDIR
29676 @findex TMPDIR
29677 If @env{TMPDIR} is set, it specifies the directory to use for temporary
29678 files.  GCC uses temporary files to hold the output of one stage of
29679 compilation which is to be used as input to the next stage: for example,
29680 the output of the preprocessor, which is the input to the compiler
29681 proper.
29683 @item GCC_COMPARE_DEBUG
29684 @findex GCC_COMPARE_DEBUG
29685 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
29686 @option{-fcompare-debug} to the compiler driver.  See the documentation
29687 of this option for more details.
29689 @item GCC_EXEC_PREFIX
29690 @findex GCC_EXEC_PREFIX
29691 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
29692 names of the subprograms executed by the compiler.  No slash is added
29693 when this prefix is combined with the name of a subprogram, but you can
29694 specify a prefix that ends with a slash if you wish.
29696 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
29697 an appropriate prefix to use based on the pathname it is invoked with.
29699 If GCC cannot find the subprogram using the specified prefix, it
29700 tries looking in the usual places for the subprogram.
29702 The default value of @env{GCC_EXEC_PREFIX} is
29703 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
29704 the installed compiler. In many cases @var{prefix} is the value
29705 of @code{prefix} when you ran the @file{configure} script.
29707 Other prefixes specified with @option{-B} take precedence over this prefix.
29709 This prefix is also used for finding files such as @file{crt0.o} that are
29710 used for linking.
29712 In addition, the prefix is used in an unusual way in finding the
29713 directories to search for header files.  For each of the standard
29714 directories whose name normally begins with @samp{/usr/local/lib/gcc}
29715 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
29716 replacing that beginning with the specified prefix to produce an
29717 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
29718 @file{foo/bar} just before it searches the standard directory 
29719 @file{/usr/local/lib/bar}.
29720 If a standard directory begins with the configured
29721 @var{prefix} then the value of @var{prefix} is replaced by
29722 @env{GCC_EXEC_PREFIX} when looking for header files.
29724 @item COMPILER_PATH
29725 @findex COMPILER_PATH
29726 The value of @env{COMPILER_PATH} is a colon-separated list of
29727 directories, much like @env{PATH}.  GCC tries the directories thus
29728 specified when searching for subprograms, if it cannot find the
29729 subprograms using @env{GCC_EXEC_PREFIX}.
29731 @item LIBRARY_PATH
29732 @findex LIBRARY_PATH
29733 The value of @env{LIBRARY_PATH} is a colon-separated list of
29734 directories, much like @env{PATH}.  When configured as a native compiler,
29735 GCC tries the directories thus specified when searching for special
29736 linker files, if it cannot find them using @env{GCC_EXEC_PREFIX}.  Linking
29737 using GCC also uses these directories when searching for ordinary
29738 libraries for the @option{-l} option (but directories specified with
29739 @option{-L} come first).
29741 @item LANG
29742 @findex LANG
29743 @cindex locale definition
29744 This variable is used to pass locale information to the compiler.  One way in
29745 which this information is used is to determine the character set to be used
29746 when character literals, string literals and comments are parsed in C and C++.
29747 When the compiler is configured to allow multibyte characters,
29748 the following values for @env{LANG} are recognized:
29750 @table @samp
29751 @item C-JIS
29752 Recognize JIS characters.
29753 @item C-SJIS
29754 Recognize SJIS characters.
29755 @item C-EUCJP
29756 Recognize EUCJP characters.
29757 @end table
29759 If @env{LANG} is not defined, or if it has some other value, then the
29760 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
29761 recognize and translate multibyte characters.
29762 @end table
29764 @noindent
29765 Some additional environment variables affect the behavior of the
29766 preprocessor.
29768 @include cppenv.texi
29770 @c man end
29772 @node Precompiled Headers
29773 @section Using Precompiled Headers
29774 @cindex precompiled headers
29775 @cindex speed of compilation
29777 Often large projects have many header files that are included in every
29778 source file.  The time the compiler takes to process these header files
29779 over and over again can account for nearly all of the time required to
29780 build the project.  To make builds faster, GCC allows you to
29781 @dfn{precompile} a header file.
29783 To create a precompiled header file, simply compile it as you would any
29784 other file, if necessary using the @option{-x} option to make the driver
29785 treat it as a C or C++ header file.  You may want to use a
29786 tool like @command{make} to keep the precompiled header up-to-date when
29787 the headers it contains change.
29789 A precompiled header file is searched for when @code{#include} is
29790 seen in the compilation.  As it searches for the included file
29791 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
29792 compiler looks for a precompiled header in each directory just before it
29793 looks for the include file in that directory.  The name searched for is
29794 the name specified in the @code{#include} with @samp{.gch} appended.  If
29795 the precompiled header file cannot be used, it is ignored.
29797 For instance, if you have @code{#include "all.h"}, and you have
29798 @file{all.h.gch} in the same directory as @file{all.h}, then the
29799 precompiled header file is used if possible, and the original
29800 header is used otherwise.
29802 Alternatively, you might decide to put the precompiled header file in a
29803 directory and use @option{-I} to ensure that directory is searched
29804 before (or instead of) the directory containing the original header.
29805 Then, if you want to check that the precompiled header file is always
29806 used, you can put a file of the same name as the original header in this
29807 directory containing an @code{#error} command.
29809 This also works with @option{-include}.  So yet another way to use
29810 precompiled headers, good for projects not designed with precompiled
29811 header files in mind, is to simply take most of the header files used by
29812 a project, include them from another header file, precompile that header
29813 file, and @option{-include} the precompiled header.  If the header files
29814 have guards against multiple inclusion, they are skipped because
29815 they've already been included (in the precompiled header).
29817 If you need to precompile the same header file for different
29818 languages, targets, or compiler options, you can instead make a
29819 @emph{directory} named like @file{all.h.gch}, and put each precompiled
29820 header in the directory, perhaps using @option{-o}.  It doesn't matter
29821 what you call the files in the directory; every precompiled header in
29822 the directory is considered.  The first precompiled header
29823 encountered in the directory that is valid for this compilation is
29824 used; they're searched in no particular order.
29826 There are many other possibilities, limited only by your imagination,
29827 good sense, and the constraints of your build system.
29829 A precompiled header file can be used only when these conditions apply:
29831 @itemize
29832 @item
29833 Only one precompiled header can be used in a particular compilation.
29835 @item
29836 A precompiled header cannot be used once the first C token is seen.  You
29837 can have preprocessor directives before a precompiled header; you cannot
29838 include a precompiled header from inside another header.
29840 @item
29841 The precompiled header file must be produced for the same language as
29842 the current compilation.  You cannot use a C precompiled header for a C++
29843 compilation.
29845 @item
29846 The precompiled header file must have been produced by the same compiler
29847 binary as the current compilation is using.
29849 @item
29850 Any macros defined before the precompiled header is included must
29851 either be defined in the same way as when the precompiled header was
29852 generated, or must not affect the precompiled header, which usually
29853 means that they don't appear in the precompiled header at all.
29855 The @option{-D} option is one way to define a macro before a
29856 precompiled header is included; using a @code{#define} can also do it.
29857 There are also some options that define macros implicitly, like
29858 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
29859 defined this way.
29861 @item If debugging information is output when using the precompiled
29862 header, using @option{-g} or similar, the same kind of debugging information
29863 must have been output when building the precompiled header.  However,
29864 a precompiled header built using @option{-g} can be used in a compilation
29865 when no debugging information is being output.
29867 @item The same @option{-m} options must generally be used when building
29868 and using the precompiled header.  @xref{Submodel Options},
29869 for any cases where this rule is relaxed.
29871 @item Each of the following options must be the same when building and using
29872 the precompiled header:
29874 @gccoptlist{-fexceptions}
29876 @item
29877 Some other command-line options starting with @option{-f},
29878 @option{-p}, or @option{-O} must be defined in the same way as when
29879 the precompiled header was generated.  At present, it's not clear
29880 which options are safe to change and which are not; the safest choice
29881 is to use exactly the same options when generating and using the
29882 precompiled header.  The following are known to be safe:
29884 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
29885 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
29886 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
29887 -pedantic-errors}
29889 @end itemize
29891 For all of these except the last, the compiler automatically
29892 ignores the precompiled header if the conditions aren't met.  If you
29893 find an option combination that doesn't work and doesn't cause the
29894 precompiled header to be ignored, please consider filing a bug report,
29895 see @ref{Bugs}.
29897 If you do use differing options when generating and using the
29898 precompiled header, the actual behavior is a mixture of the
29899 behavior for the options.  For instance, if you use @option{-g} to
29900 generate the precompiled header but not when using it, you may or may
29901 not get debugging information for routines in the precompiled header.