Add GCC_EXTRA_DIAGNOSTIC_OUTPUT environment variable for fix-it hints
[official-gcc.git] / gcc / doc / invoke.texi
blob8f100911048986dcba6fe9cedf70c9511c0aa58f
1 @c Copyright (C) 1988-2021 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-2021 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 @command{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 * Static Analyzer Options:: More expensive warnings.
157 * Debugging Options::   Producing debuggable code.
158 * Optimize Options::    How much optimization?
159 * Instrumentation Options:: Enabling profiling and extra run-time error checking.
160 * Preprocessor Options:: Controlling header files and macro definitions.
161                          Also, getting dependency information for Make.
162 * Assembler Options::   Passing options to the assembler.
163 * Link Options::        Specifying libraries and so on.
164 * Directory Options::   Where to find header files and libraries.
165                         Where to find the compiler executable files.
166 * Code Gen Options::    Specifying conventions for function calls, data layout
167                         and register usage.
168 * Developer Options::   Printing GCC configuration info, statistics, and
169                         debugging dumps.
170 * Submodel Options::    Target-specific options, such as compiling for a
171                         specific processor variant.
172 * Spec Files::          How to pass switches to sub-processes.
173 * Environment Variables:: Env vars that affect GCC.
174 * Precompiled Headers:: Compiling a header once, and using it many times.
175 * C++ Modules::         Experimental C++20 module system.
176 @end menu
178 @c man begin OPTIONS
180 @node Option Summary
181 @section Option Summary
183 Here is a summary of all the options, grouped by type.  Explanations are
184 in the following sections.
186 @table @emph
187 @item Overall Options
188 @xref{Overall Options,,Options Controlling the Kind of Output}.
189 @gccoptlist{-c  -S  -E  -o @var{file} @gol
190 -dumpbase @var{dumpbase}  -dumpbase-ext @var{auxdropsuf} @gol
191 -dumpdir @var{dumppfx}  -x @var{language}  @gol
192 -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  --version @gol
193 -pass-exit-codes  -pipe  -specs=@var{file}  -wrapper  @gol
194 @@@var{file}  -ffile-prefix-map=@var{old}=@var{new}  @gol
195 -fplugin=@var{file}  -fplugin-arg-@var{name}=@var{arg}  @gol
196 -fdump-ada-spec@r{[}-slim@r{]}  -fada-spec-parent=@var{unit}  -fdump-go-spec=@var{file}}
198 @item C Language Options
199 @xref{C Dialect Options,,Options Controlling C Dialect}.
200 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
201 -fpermitted-flt-eval-methods=@var{standard} @gol
202 -aux-info @var{filename}  -fallow-parameterless-variadic-functions @gol
203 -fno-asm  -fno-builtin  -fno-builtin-@var{function}  -fgimple@gol
204 -fhosted  -ffreestanding @gol
205 -fopenacc  -fopenacc-dim=@var{geom}  -fopenacc-kernels=@var{mode} @gol
206 -fopenmp  -fopenmp-simd @gol
207 -fms-extensions  -fplan9-extensions  -fsso-struct=@var{endianness} @gol
208 -fallow-single-precision  -fcond-mismatch  -flax-vector-conversions @gol
209 -fsigned-bitfields  -fsigned-char @gol
210 -funsigned-bitfields  -funsigned-char}
212 @item C++ Language Options
213 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
214 @gccoptlist{-fabi-version=@var{n}  -fno-access-control @gol
215 -faligned-new=@var{n}  -fargs-in-order=@var{n}  -fchar8_t  -fcheck-new @gol
216 -fconstexpr-depth=@var{n}  -fconstexpr-cache-depth=@var{n} @gol
217 -fconstexpr-loop-limit=@var{n}  -fconstexpr-ops-limit=@var{n} @gol
218 -fno-elide-constructors @gol
219 -fno-enforce-eh-specs @gol
220 -fno-gnu-keywords @gol
221 -fno-implicit-templates @gol
222 -fno-implicit-inline-templates @gol
223 -fno-implement-inlines  @gol
224 -fmodule-header@r{[}=@var{kind}@r{]} -fmodule-only -fmodules-ts @gol
225 -fmodule-implicit-inline @gol
226 -fno-module-lazy @gol
227 -fmodule-mapper=@var{specification} @gol
228 -fmodule-version-ignore @gol
229 -fms-extensions @gol
230 -fnew-inheriting-ctors @gol
231 -fnew-ttp-matching @gol
232 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
233 -fno-optional-diags  -fpermissive @gol
234 -fno-pretty-templates @gol
235 -fno-rtti  -fsized-deallocation @gol
236 -ftemplate-backtrace-limit=@var{n} @gol
237 -ftemplate-depth=@var{n} @gol
238 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
239 -fno-weak  -nostdinc++ @gol
240 -fvisibility-inlines-hidden @gol
241 -fvisibility-ms-compat @gol
242 -fext-numeric-literals @gol
243 -flang-info-include-translate@r{[}=@var{name}@r{]} @gol
244 -flang-info-include-translate-not @gol
245 -stdlib=@var{libstdc++,libc++} @gol
246 -Wabi-tag  -Wcatch-value  -Wcatch-value=@var{n} @gol
247 -Wno-class-conversion  -Wclass-memaccess @gol
248 -Wcomma-subscript  -Wconditionally-supported @gol
249 -Wno-conversion-null  -Wctad-maybe-unsupported @gol
250 -Wctor-dtor-privacy  -Wno-delete-incomplete @gol
251 -Wdelete-non-virtual-dtor  -Wdeprecated-copy -Wdeprecated-copy-dtor @gol
252 -Wno-deprecated-enum-enum-conversion -Wno-deprecated-enum-float-conversion @gol
253 -Weffc++  -Wno-exceptions -Wextra-semi  -Wno-inaccessible-base @gol
254 -Wno-inherited-variadic-ctor  -Wno-init-list-lifetime @gol
255 -Winvalid-imported-macros @gol
256 -Wno-invalid-offsetof  -Wno-literal-suffix @gol
257 -Wno-mismatched-new-delete -Wmismatched-tags @gol
258 -Wmultiple-inheritance  -Wnamespaces  -Wnarrowing @gol
259 -Wnoexcept  -Wnoexcept-type  -Wnon-virtual-dtor @gol
260 -Wpessimizing-move  -Wno-placement-new  -Wplacement-new=@var{n} @gol
261 -Wrange-loop-construct -Wredundant-move -Wredundant-tags @gol
262 -Wreorder  -Wregister @gol
263 -Wstrict-null-sentinel  -Wno-subobject-linkage  -Wtemplates @gol
264 -Wno-non-template-friend  -Wold-style-cast @gol
265 -Woverloaded-virtual  -Wno-pmf-conversions -Wsign-promo @gol
266 -Wsized-deallocation  -Wsuggest-final-methods @gol
267 -Wsuggest-final-types  -Wsuggest-override  @gol
268 -Wno-terminate  -Wuseless-cast  -Wno-vexing-parse  @gol
269 -Wvirtual-inheritance  @gol
270 -Wno-virtual-move-assign  -Wvolatile  -Wzero-as-null-pointer-constant}
272 @item Objective-C and Objective-C++ Language Options
273 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
274 Objective-C and Objective-C++ Dialects}.
275 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
276 -fgnu-runtime  -fnext-runtime @gol
277 -fno-nil-receivers @gol
278 -fobjc-abi-version=@var{n} @gol
279 -fobjc-call-cxx-cdtors @gol
280 -fobjc-direct-dispatch @gol
281 -fobjc-exceptions @gol
282 -fobjc-gc @gol
283 -fobjc-nilcheck @gol
284 -fobjc-std=objc1 @gol
285 -fno-local-ivars @gol
286 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
287 -freplace-objc-classes @gol
288 -fzero-link @gol
289 -gen-decls @gol
290 -Wassign-intercept  -Wno-property-assign-default @gol
291 -Wno-protocol -Wobjc-root-class -Wselector @gol
292 -Wstrict-selector-match @gol
293 -Wundeclared-selector}
295 @item Diagnostic Message Formatting Options
296 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
297 @gccoptlist{-fmessage-length=@var{n}  @gol
298 -fdiagnostics-plain-output @gol
299 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
300 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
301 -fdiagnostics-urls=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
302 -fdiagnostics-format=@r{[}text@r{|}json@r{]}  @gol
303 -fno-diagnostics-show-option  -fno-diagnostics-show-caret @gol
304 -fno-diagnostics-show-labels  -fno-diagnostics-show-line-numbers @gol
305 -fno-diagnostics-show-cwe  @gol
306 -fdiagnostics-minimum-margin-width=@var{width} @gol
307 -fdiagnostics-parseable-fixits  -fdiagnostics-generate-patch @gol
308 -fdiagnostics-show-template-tree  -fno-elide-type @gol
309 -fdiagnostics-path-format=@r{[}none@r{|}separate-events@r{|}inline-events@r{]} @gol
310 -fdiagnostics-show-path-depths @gol
311 -fno-show-column @gol
312 -fdiagnostics-column-unit=@r{[}display@r{|}byte@r{]} @gol
313 -fdiagnostics-column-origin=@var{origin}}
315 @item Warning Options
316 @xref{Warning Options,,Options to Request or Suppress Warnings}.
317 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
318 -pedantic-errors @gol
319 -w  -Wextra  -Wall  -Wabi=@var{n} @gol
320 -Waddress  -Wno-address-of-packed-member  -Waggregate-return @gol
321 -Walloc-size-larger-than=@var{byte-size}  -Walloc-zero @gol
322 -Walloca  -Walloca-larger-than=@var{byte-size} @gol
323 -Wno-aggressive-loop-optimizations @gol
324 -Warith-conversion @gol
325 -Warray-bounds  -Warray-bounds=@var{n} @gol
326 -Wno-attributes  -Wattribute-alias=@var{n} -Wno-attribute-alias @gol
327 -Wno-attribute-warning  -Wbool-compare  -Wbool-operation @gol
328 -Wno-builtin-declaration-mismatch @gol
329 -Wno-builtin-macro-redefined  -Wc90-c99-compat  -Wc99-c11-compat @gol
330 -Wc11-c2x-compat @gol
331 -Wc++-compat  -Wc++11-compat  -Wc++14-compat  -Wc++17-compat  @gol
332 -Wc++20-compat  @gol
333 -Wcast-align  -Wcast-align=strict  -Wcast-function-type  -Wcast-qual  @gol
334 -Wchar-subscripts @gol
335 -Wclobbered  -Wcomment @gol
336 -Wconversion  -Wno-coverage-mismatch  -Wno-cpp @gol
337 -Wdangling-else  -Wdate-time @gol
338 -Wno-deprecated  -Wno-deprecated-declarations  -Wno-designated-init @gol
339 -Wdisabled-optimization @gol
340 -Wno-discarded-array-qualifiers  -Wno-discarded-qualifiers @gol
341 -Wno-div-by-zero  -Wdouble-promotion @gol
342 -Wduplicated-branches  -Wduplicated-cond @gol
343 -Wempty-body  -Wno-endif-labels  -Wenum-compare  -Wenum-conversion @gol
344 -Werror  -Werror=*  -Wexpansion-to-defined  -Wfatal-errors @gol
345 -Wfloat-conversion  -Wfloat-equal  -Wformat  -Wformat=2 @gol
346 -Wno-format-contains-nul  -Wno-format-extra-args  @gol
347 -Wformat-nonliteral  -Wformat-overflow=@var{n} @gol
348 -Wformat-security  -Wformat-signedness  -Wformat-truncation=@var{n} @gol
349 -Wformat-y2k  -Wframe-address @gol
350 -Wframe-larger-than=@var{byte-size}  -Wno-free-nonheap-object @gol
351 -Wno-if-not-aligned  -Wno-ignored-attributes @gol
352 -Wignored-qualifiers  -Wno-incompatible-pointer-types @gol
353 -Wimplicit  -Wimplicit-fallthrough  -Wimplicit-fallthrough=@var{n} @gol
354 -Wno-implicit-function-declaration  -Wno-implicit-int @gol
355 -Winit-self  -Winline  -Wno-int-conversion  -Wint-in-bool-context @gol
356 -Wno-int-to-pointer-cast  -Wno-invalid-memory-model @gol
357 -Winvalid-pch  -Wjump-misses-init  -Wlarger-than=@var{byte-size} @gol
358 -Wlogical-not-parentheses  -Wlogical-op  -Wlong-long @gol
359 -Wno-lto-type-mismatch -Wmain  -Wmaybe-uninitialized @gol
360 -Wmemset-elt-size  -Wmemset-transposed-args @gol
361 -Wmisleading-indentation  -Wmissing-attributes  -Wmissing-braces @gol
362 -Wmissing-field-initializers  -Wmissing-format-attribute @gol
363 -Wmissing-include-dirs  -Wmissing-noreturn  -Wno-missing-profile @gol
364 -Wno-multichar  -Wmultistatement-macros  -Wnonnull  -Wnonnull-compare @gol
365 -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
366 -Wnull-dereference  -Wno-odr  -Wopenmp-simd  @gol
367 -Wno-overflow  -Woverlength-strings  -Wno-override-init-side-effects @gol
368 -Wpacked  -Wno-packed-bitfield-compat  -Wpacked-not-aligned  -Wpadded @gol
369 -Wparentheses  -Wno-pedantic-ms-format @gol
370 -Wpointer-arith  -Wno-pointer-compare  -Wno-pointer-to-int-cast @gol
371 -Wno-pragmas  -Wno-prio-ctor-dtor  -Wredundant-decls @gol
372 -Wrestrict  -Wno-return-local-addr  -Wreturn-type @gol
373 -Wno-scalar-storage-order  -Wsequence-point @gol
374 -Wshadow  -Wshadow=global  -Wshadow=local  -Wshadow=compatible-local @gol
375 -Wno-shadow-ivar @gol
376 -Wno-shift-count-negative  -Wno-shift-count-overflow  -Wshift-negative-value @gol
377 -Wno-shift-overflow  -Wshift-overflow=@var{n} @gol
378 -Wsign-compare  -Wsign-conversion @gol
379 -Wno-sizeof-array-argument @gol
380 -Wsizeof-array-div @gol
381 -Wsizeof-pointer-div  -Wsizeof-pointer-memaccess @gol
382 -Wstack-protector  -Wstack-usage=@var{byte-size}  -Wstrict-aliasing @gol
383 -Wstrict-aliasing=n  -Wstrict-overflow  -Wstrict-overflow=@var{n} @gol
384 -Wstring-compare @gol
385 -Wno-stringop-overflow -Wno-stringop-overread @gol
386 -Wno-stringop-truncation @gol
387 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}malloc@r{]} @gol
388 -Wswitch  -Wno-switch-bool  -Wswitch-default  -Wswitch-enum @gol
389 -Wno-switch-outside-range  -Wno-switch-unreachable  -Wsync-nand @gol
390 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
391 -Wtsan -Wtype-limits  -Wundef @gol
392 -Wuninitialized  -Wunknown-pragmas @gol
393 -Wunsuffixed-float-constants  -Wunused @gol
394 -Wunused-but-set-parameter  -Wunused-but-set-variable @gol
395 -Wunused-const-variable  -Wunused-const-variable=@var{n} @gol
396 -Wunused-function  -Wunused-label  -Wunused-local-typedefs @gol
397 -Wunused-macros @gol
398 -Wunused-parameter  -Wno-unused-result @gol
399 -Wunused-value  -Wunused-variable @gol
400 -Wno-varargs  -Wvariadic-macros @gol
401 -Wvector-operation-performance @gol
402 -Wvla  -Wvla-larger-than=@var{byte-size}  -Wno-vla-larger-than @gol
403 -Wvolatile-register-var  -Wwrite-strings @gol
404 -Wzero-length-bounds}
406 @item Static Analyzer Options
407 @gccoptlist{
408 -fanalyzer @gol
409 -fanalyzer-call-summaries @gol
410 -fanalyzer-checker=@var{name} @gol
411 -fno-analyzer-feasibility @gol
412 -fanalyzer-fine-grained @gol
413 -fanalyzer-state-merge @gol
414 -fanalyzer-state-purge @gol
415 -fanalyzer-transitivity @gol
416 -fanalyzer-verbose-edges @gol
417 -fanalyzer-verbose-state-changes @gol
418 -fanalyzer-verbosity=@var{level} @gol
419 -fdump-analyzer @gol
420 -fdump-analyzer-stderr @gol
421 -fdump-analyzer-callgraph @gol
422 -fdump-analyzer-exploded-graph @gol
423 -fdump-analyzer-exploded-nodes @gol
424 -fdump-analyzer-exploded-nodes-2 @gol
425 -fdump-analyzer-exploded-nodes-3 @gol
426 -fdump-analyzer-json @gol
427 -fdump-analyzer-state-purge @gol
428 -fdump-analyzer-supergraph @gol
429 -Wno-analyzer-double-fclose @gol
430 -Wno-analyzer-double-free @gol
431 -Wno-analyzer-exposure-through-output-file @gol
432 -Wno-analyzer-file-leak @gol
433 -Wno-analyzer-free-of-non-heap @gol
434 -Wno-analyzer-malloc-leak @gol
435 -Wno-analyzer-mismatching-deallocation @gol
436 -Wno-analyzer-null-argument @gol
437 -Wno-analyzer-null-dereference @gol
438 -Wno-analyzer-possible-null-argument @gol
439 -Wno-analyzer-possible-null-dereference @gol
440 -Wno-analyzer-shift-count-negative @gol
441 -Wno-analyzer-shift-count-overflow @gol
442 -Wno-analyzer-stale-setjmp-buffer @gol
443 -Wno-analyzer-tainted-array-index @gol
444 -Wanalyzer-too-complex @gol
445 -Wno-analyzer-unsafe-call-within-signal-handler @gol
446 -Wno-analyzer-use-after-free @gol
447 -Wno-analyzer-use-of-pointer-in-stale-stack-frame @gol
448 -Wno-analyzer-use-of-uninitialized-value @gol
449 -Wno-analyzer-write-to-const @gol
450 -Wno-analyzer-write-to-string-literal @gol
453 @item C and Objective-C-only Warning Options
454 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
455 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
456 -Wold-style-declaration  -Wold-style-definition @gol
457 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
458 -Wdeclaration-after-statement  -Wpointer-sign}
460 @item Debugging Options
461 @xref{Debugging Options,,Options for Debugging Your Program}.
462 @gccoptlist{-g  -g@var{level}  -gdwarf  -gdwarf-@var{version} @gol
463 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
464 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
465 -gas-loc-support  -gno-as-loc-support @gol
466 -gas-locview-support  -gno-as-locview-support @gol
467 -gcolumn-info  -gno-column-info  -gdwarf32  -gdwarf64 @gol
468 -gstatement-frontiers  -gno-statement-frontiers @gol
469 -gvariable-location-views  -gno-variable-location-views @gol
470 -ginternal-reset-location-views  -gno-internal-reset-location-views @gol
471 -ginline-points  -gno-inline-points @gol
472 -gvms  -gxcoff  -gxcoff+  -gz@r{[}=@var{type}@r{]} @gol
473 -gsplit-dwarf  -gdescribe-dies  -gno-describe-dies @gol
474 -fdebug-prefix-map=@var{old}=@var{new}  -fdebug-types-section @gol
475 -fno-eliminate-unused-debug-types @gol
476 -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
477 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
478 -fno-eliminate-unused-debug-symbols  -femit-class-debug-always @gol
479 -fno-merge-debug-strings  -fno-dwarf2-cfi-asm @gol
480 -fvar-tracking  -fvar-tracking-assignments}
482 @item Optimization Options
483 @xref{Optimize Options,,Options that Control Optimization}.
484 @gccoptlist{-faggressive-loop-optimizations @gol
485 -falign-functions[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
486 -falign-jumps[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
487 -falign-labels[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
488 -falign-loops[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
489 -fno-allocation-dce -fallow-store-data-races @gol
490 -fassociative-math  -fauto-profile  -fauto-profile[=@var{path}] @gol
491 -fauto-inc-dec  -fbranch-probabilities @gol
492 -fcaller-saves @gol
493 -fcombine-stack-adjustments  -fconserve-stack @gol
494 -fcompare-elim  -fcprop-registers  -fcrossjumping @gol
495 -fcse-follow-jumps  -fcse-skip-blocks  -fcx-fortran-rules @gol
496 -fcx-limited-range @gol
497 -fdata-sections  -fdce  -fdelayed-branch @gol
498 -fdelete-null-pointer-checks  -fdevirtualize  -fdevirtualize-speculatively @gol
499 -fdevirtualize-at-ltrans  -fdse @gol
500 -fearly-inlining  -fipa-sra  -fexpensive-optimizations  -ffat-lto-objects @gol
501 -ffast-math  -ffinite-math-only  -ffloat-store  -fexcess-precision=@var{style} @gol
502 -ffinite-loops @gol
503 -fforward-propagate  -ffp-contract=@var{style}  -ffunction-sections @gol
504 -fgcse  -fgcse-after-reload  -fgcse-las  -fgcse-lm  -fgraphite-identity @gol
505 -fgcse-sm  -fhoist-adjacent-loads  -fif-conversion @gol
506 -fif-conversion2  -findirect-inlining @gol
507 -finline-functions  -finline-functions-called-once  -finline-limit=@var{n} @gol
508 -finline-small-functions -fipa-modref -fipa-cp  -fipa-cp-clone @gol
509 -fipa-bit-cp  -fipa-vrp  -fipa-pta  -fipa-profile  -fipa-pure-const @gol
510 -fipa-reference  -fipa-reference-addressable @gol
511 -fipa-stack-alignment  -fipa-icf  -fira-algorithm=@var{algorithm} @gol
512 -flive-patching=@var{level} @gol
513 -fira-region=@var{region}  -fira-hoist-pressure @gol
514 -fira-loop-pressure  -fno-ira-share-save-slots @gol
515 -fno-ira-share-spill-slots @gol
516 -fisolate-erroneous-paths-dereference  -fisolate-erroneous-paths-attribute @gol
517 -fivopts  -fkeep-inline-functions  -fkeep-static-functions @gol
518 -fkeep-static-consts  -flimit-function-alignment  -flive-range-shrinkage @gol
519 -floop-block  -floop-interchange  -floop-strip-mine @gol
520 -floop-unroll-and-jam  -floop-nest-optimize @gol
521 -floop-parallelize-all  -flra-remat  -flto  -flto-compression-level @gol
522 -flto-partition=@var{alg}  -fmerge-all-constants @gol
523 -fmerge-constants  -fmodulo-sched  -fmodulo-sched-allow-regmoves @gol
524 -fmove-loop-invariants  -fno-branch-count-reg @gol
525 -fno-defer-pop  -fno-fp-int-builtin-inexact  -fno-function-cse @gol
526 -fno-guess-branch-probability  -fno-inline  -fno-math-errno  -fno-peephole @gol
527 -fno-peephole2  -fno-printf-return-value  -fno-sched-interblock @gol
528 -fno-sched-spec  -fno-signed-zeros @gol
529 -fno-toplevel-reorder  -fno-trapping-math  -fno-zero-initialized-in-bss @gol
530 -fomit-frame-pointer  -foptimize-sibling-calls @gol
531 -fpartial-inlining  -fpeel-loops  -fpredictive-commoning @gol
532 -fprefetch-loop-arrays @gol
533 -fprofile-correction @gol
534 -fprofile-use  -fprofile-use=@var{path} -fprofile-partial-training @gol
535 -fprofile-values -fprofile-reorder-functions @gol
536 -freciprocal-math  -free  -frename-registers  -freorder-blocks @gol
537 -freorder-blocks-algorithm=@var{algorithm} @gol
538 -freorder-blocks-and-partition  -freorder-functions @gol
539 -frerun-cse-after-loop  -freschedule-modulo-scheduled-loops @gol
540 -frounding-math  -fsave-optimization-record @gol
541 -fsched2-use-superblocks  -fsched-pressure @gol
542 -fsched-spec-load  -fsched-spec-load-dangerous @gol
543 -fsched-stalled-insns-dep[=@var{n}]  -fsched-stalled-insns[=@var{n}] @gol
544 -fsched-group-heuristic  -fsched-critical-path-heuristic @gol
545 -fsched-spec-insn-heuristic  -fsched-rank-heuristic @gol
546 -fsched-last-insn-heuristic  -fsched-dep-count-heuristic @gol
547 -fschedule-fusion @gol
548 -fschedule-insns  -fschedule-insns2  -fsection-anchors @gol
549 -fselective-scheduling  -fselective-scheduling2 @gol
550 -fsel-sched-pipelining  -fsel-sched-pipelining-outer-loops @gol
551 -fsemantic-interposition  -fshrink-wrap  -fshrink-wrap-separate @gol
552 -fsignaling-nans @gol
553 -fsingle-precision-constant  -fsplit-ivs-in-unroller  -fsplit-loops@gol
554 -fsplit-paths @gol
555 -fsplit-wide-types  -fsplit-wide-types-early  -fssa-backprop  -fssa-phiopt @gol
556 -fstdarg-opt  -fstore-merging  -fstrict-aliasing @gol
557 -fthread-jumps  -ftracer  -ftree-bit-ccp @gol
558 -ftree-builtin-call-dce  -ftree-ccp  -ftree-ch @gol
559 -ftree-coalesce-vars  -ftree-copy-prop  -ftree-dce  -ftree-dominator-opts @gol
560 -ftree-dse  -ftree-forwprop  -ftree-fre  -fcode-hoisting @gol
561 -ftree-loop-if-convert  -ftree-loop-im @gol
562 -ftree-phiprop  -ftree-loop-distribution  -ftree-loop-distribute-patterns @gol
563 -ftree-loop-ivcanon  -ftree-loop-linear  -ftree-loop-optimize @gol
564 -ftree-loop-vectorize @gol
565 -ftree-parallelize-loops=@var{n}  -ftree-pre  -ftree-partial-pre  -ftree-pta @gol
566 -ftree-reassoc  -ftree-scev-cprop  -ftree-sink  -ftree-slsr  -ftree-sra @gol
567 -ftree-switch-conversion  -ftree-tail-merge @gol
568 -ftree-ter  -ftree-vectorize  -ftree-vrp  -funconstrained-commons @gol
569 -funit-at-a-time  -funroll-all-loops  -funroll-loops @gol
570 -funsafe-math-optimizations  -funswitch-loops @gol
571 -fipa-ra  -fvariable-expansion-in-unroller  -fvect-cost-model  -fvpt @gol
572 -fweb  -fwhole-program  -fwpa  -fuse-linker-plugin -fzero-call-used-regs @gol
573 --param @var{name}=@var{value}
574 -O  -O0  -O1  -O2  -O3  -Os  -Ofast  -Og}
576 @item Program Instrumentation Options
577 @xref{Instrumentation Options,,Program Instrumentation Options}.
578 @gccoptlist{-p  -pg  -fprofile-arcs  --coverage  -ftest-coverage @gol
579 -fprofile-abs-path @gol
580 -fprofile-dir=@var{path}  -fprofile-generate  -fprofile-generate=@var{path} @gol
581 -fprofile-info-section  -fprofile-info-section=@var{name} @gol
582 -fprofile-note=@var{path} -fprofile-prefix-path=@var{path} @gol
583 -fprofile-update=@var{method} -fprofile-filter-files=@var{regex} @gol
584 -fprofile-exclude-files=@var{regex} @gol
585 -fprofile-reproducible=@r{[}multithreaded@r{|}parallel-runs@r{|}serial@r{]} @gol
586 -fsanitize=@var{style}  -fsanitize-recover  -fsanitize-recover=@var{style} @gol
587 -fasan-shadow-offset=@var{number}  -fsanitize-sections=@var{s1},@var{s2},... @gol
588 -fsanitize-undefined-trap-on-error  -fbounds-check @gol
589 -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{|}check@r{]} @gol
590 -fstack-protector  -fstack-protector-all  -fstack-protector-strong @gol
591 -fstack-protector-explicit  -fstack-check @gol
592 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
593 -fno-stack-limit  -fsplit-stack @gol
594 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
595 -fvtv-counts  -fvtv-debug @gol
596 -finstrument-functions @gol
597 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
598 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}}
600 @item Preprocessor Options
601 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
602 @gccoptlist{-A@var{question}=@var{answer} @gol
603 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
604 -C  -CC  -D@var{macro}@r{[}=@var{defn}@r{]} @gol
605 -dD  -dI  -dM  -dN  -dU @gol
606 -fdebug-cpp  -fdirectives-only  -fdollars-in-identifiers  @gol
607 -fexec-charset=@var{charset}  -fextended-identifiers  @gol
608 -finput-charset=@var{charset}  -flarge-source-files  @gol
609 -fmacro-prefix-map=@var{old}=@var{new} -fmax-include-depth=@var{depth} @gol
610 -fno-canonical-system-headers  -fpch-deps  -fpch-preprocess  @gol
611 -fpreprocessed  -ftabstop=@var{width}  -ftrack-macro-expansion  @gol
612 -fwide-exec-charset=@var{charset}  -fworking-directory @gol
613 -H  -imacros @var{file}  -include @var{file} @gol
614 -M  -MD  -MF  -MG  -MM  -MMD  -MP  -MQ  -MT -Mno-modules @gol
615 -no-integrated-cpp  -P  -pthread  -remap @gol
616 -traditional  -traditional-cpp  -trigraphs @gol
617 -U@var{macro}  -undef  @gol
618 -Wp,@var{option}  -Xpreprocessor @var{option}}
620 @item Assembler Options
621 @xref{Assembler Options,,Passing Options to the Assembler}.
622 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
624 @item Linker Options
625 @xref{Link Options,,Options for Linking}.
626 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker}  -l@var{library} @gol
627 -nostartfiles  -nodefaultlibs  -nolibc  -nostdlib @gol
628 -e @var{entry}  --entry=@var{entry} @gol
629 -pie  -pthread  -r  -rdynamic @gol
630 -s  -static  -static-pie  -static-libgcc  -static-libstdc++ @gol
631 -static-libasan  -static-libtsan  -static-liblsan  -static-libubsan @gol
632 -shared  -shared-libgcc  -symbolic @gol
633 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
634 -u @var{symbol}  -z @var{keyword}}
636 @item Directory Options
637 @xref{Directory Options,,Options for Directory Search}.
638 @gccoptlist{-B@var{prefix}  -I@var{dir}  -I- @gol
639 -idirafter @var{dir} @gol
640 -imacros @var{file}  -imultilib @var{dir} @gol
641 -iplugindir=@var{dir}  -iprefix @var{file} @gol
642 -iquote @var{dir}  -isysroot @var{dir}  -isystem @var{dir} @gol
643 -iwithprefix @var{dir}  -iwithprefixbefore @var{dir}  @gol
644 -L@var{dir}  -no-canonical-prefixes  --no-sysroot-suffix @gol
645 -nostdinc  -nostdinc++  --sysroot=@var{dir}}
647 @item Code Generation Options
648 @xref{Code Gen Options,,Options for Code Generation Conventions}.
649 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
650 -ffixed-@var{reg}  -fexceptions @gol
651 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
652 -fasynchronous-unwind-tables @gol
653 -fno-gnu-unique @gol
654 -finhibit-size-directive  -fcommon  -fno-ident @gol
655 -fpcc-struct-return  -fpic  -fPIC  -fpie  -fPIE  -fno-plt @gol
656 -fno-jump-tables -fno-bit-tests @gol
657 -frecord-gcc-switches @gol
658 -freg-struct-return  -fshort-enums  -fshort-wchar @gol
659 -fverbose-asm  -fpack-struct[=@var{n}]  @gol
660 -fleading-underscore  -ftls-model=@var{model} @gol
661 -fstack-reuse=@var{reuse_level} @gol
662 -ftrampolines  -ftrapv  -fwrapv @gol
663 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
664 -fstrict-volatile-bitfields  -fsync-libcalls}
666 @item Developer Options
667 @xref{Developer Options,,GCC Developer Options}.
668 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
669 -dumpfullversion  -fcallgraph-info@r{[}=su,da@r{]}
670 -fchecking  -fchecking=@var{n}
671 -fdbg-cnt-list @gol  -fdbg-cnt=@var{counter-value-list} @gol
672 -fdisable-ipa-@var{pass_name} @gol
673 -fdisable-rtl-@var{pass_name} @gol
674 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
675 -fdisable-tree-@var{pass_name} @gol
676 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
677 -fdump-debug  -fdump-earlydebug @gol
678 -fdump-noaddr  -fdump-unnumbered  -fdump-unnumbered-links @gol
679 -fdump-final-insns@r{[}=@var{file}@r{]} @gol
680 -fdump-ipa-all  -fdump-ipa-cgraph  -fdump-ipa-inline @gol
681 -fdump-lang-all @gol
682 -fdump-lang-@var{switch} @gol
683 -fdump-lang-@var{switch}-@var{options} @gol
684 -fdump-lang-@var{switch}-@var{options}=@var{filename} @gol
685 -fdump-passes @gol
686 -fdump-rtl-@var{pass}  -fdump-rtl-@var{pass}=@var{filename} @gol
687 -fdump-statistics @gol
688 -fdump-tree-all @gol
689 -fdump-tree-@var{switch} @gol
690 -fdump-tree-@var{switch}-@var{options} @gol
691 -fdump-tree-@var{switch}-@var{options}=@var{filename} @gol
692 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
693 -fenable-@var{kind}-@var{pass} @gol
694 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
695 -fira-verbose=@var{n} @gol
696 -flto-report  -flto-report-wpa  -fmem-report-wpa @gol
697 -fmem-report  -fpre-ipa-mem-report  -fpost-ipa-mem-report @gol
698 -fopt-info  -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
699 -fprofile-report @gol
700 -frandom-seed=@var{string}  -fsched-verbose=@var{n} @gol
701 -fsel-sched-verbose  -fsel-sched-dump-cfg  -fsel-sched-pipelining-verbose @gol
702 -fstats  -fstack-usage  -ftime-report  -ftime-report-details @gol
703 -fvar-tracking-assignments-toggle  -gtoggle @gol
704 -print-file-name=@var{library}  -print-libgcc-file-name @gol
705 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
706 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
707 -print-sysroot  -print-sysroot-headers-suffix @gol
708 -save-temps  -save-temps=cwd  -save-temps=obj  -time@r{[}=@var{file}@r{]}}
710 @item Machine-Dependent Options
711 @xref{Submodel Options,,Machine-Dependent Options}.
712 @c This list is ordered alphanumerically by subsection name.
713 @c Try and put the significant identifier (CPU or system) first,
714 @c so users have a clue at guessing where the ones they want will be.
716 @emph{AArch64 Options}
717 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
718 -mgeneral-regs-only @gol
719 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
720 -mstrict-align  -mno-strict-align @gol
721 -momit-leaf-frame-pointer @gol
722 -mtls-dialect=desc  -mtls-dialect=traditional @gol
723 -mtls-size=@var{size} @gol
724 -mfix-cortex-a53-835769  -mfix-cortex-a53-843419 @gol
725 -mlow-precision-recip-sqrt  -mlow-precision-sqrt  -mlow-precision-div @gol
726 -mpc-relative-literal-loads @gol
727 -msign-return-address=@var{scope} @gol
728 -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}
729 +@var{b-key}]|@var{bti} @gol
730 -mharden-sls=@var{opts} @gol
731 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}  @gol
732 -moverride=@var{string}  -mverbose-cost-dump @gol
733 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{sysreg} @gol
734 -mstack-protector-guard-offset=@var{offset} -mtrack-speculation @gol
735 -moutline-atomics }
737 @emph{Adapteva Epiphany Options}
738 @gccoptlist{-mhalf-reg-file  -mprefer-short-insn-regs @gol
739 -mbranch-cost=@var{num}  -mcmove  -mnops=@var{num}  -msoft-cmpsf @gol
740 -msplit-lohi  -mpost-inc  -mpost-modify  -mstack-offset=@var{num} @gol
741 -mround-nearest  -mlong-calls  -mshort-calls  -msmall16 @gol
742 -mfp-mode=@var{mode}  -mvect-double  -max-vect-align=@var{num} @gol
743 -msplit-vecmove-early  -m1reg-@var{reg}}
745 @emph{AMD GCN Options}
746 @gccoptlist{-march=@var{gpu} -mtune=@var{gpu} -mstack-size=@var{bytes}}
748 @emph{ARC Options}
749 @gccoptlist{-mbarrel-shifter  -mjli-always @gol
750 -mcpu=@var{cpu}  -mA6  -mARC600  -mA7  -mARC700 @gol
751 -mdpfp  -mdpfp-compact  -mdpfp-fast  -mno-dpfp-lrsr @gol
752 -mea  -mno-mpy  -mmul32x16  -mmul64  -matomic @gol
753 -mnorm  -mspfp  -mspfp-compact  -mspfp-fast  -msimd  -msoft-float  -mswap @gol
754 -mcrc  -mdsp-packa  -mdvbf  -mlock  -mmac-d16  -mmac-24  -mrtsc  -mswape @gol
755 -mtelephony  -mxy  -misize  -mannotate-align  -marclinux  -marclinux_prof @gol
756 -mlong-calls  -mmedium-calls  -msdata  -mirq-ctrl-saved @gol
757 -mrgf-banked-regs  -mlpc-width=@var{width}  -G @var{num} @gol
758 -mvolatile-cache  -mtp-regno=@var{regno} @gol
759 -malign-call  -mauto-modify-reg  -mbbit-peephole  -mno-brcc @gol
760 -mcase-vector-pcrel  -mcompact-casesi  -mno-cond-exec  -mearly-cbranchsi @gol
761 -mexpand-adddi  -mindexed-loads  -mlra  -mlra-priority-none @gol
762 -mlra-priority-compact mlra-priority-noncompact  -mmillicode @gol
763 -mmixed-code  -mq-class  -mRcq  -mRcw  -msize-level=@var{level} @gol
764 -mtune=@var{cpu}  -mmultcost=@var{num}  -mcode-density-frame @gol
765 -munalign-prob-threshold=@var{probability}  -mmpy-option=@var{multo} @gol
766 -mdiv-rem  -mcode-density  -mll64  -mfpu=@var{fpu}  -mrf16  -mbranch-index}
768 @emph{ARM Options}
769 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
770 -mabi=@var{name} @gol
771 -mapcs-stack-check  -mno-apcs-stack-check @gol
772 -mapcs-reentrant  -mno-apcs-reentrant @gol
773 -mgeneral-regs-only @gol
774 -msched-prolog  -mno-sched-prolog @gol
775 -mlittle-endian  -mbig-endian @gol
776 -mbe8  -mbe32 @gol
777 -mfloat-abi=@var{name} @gol
778 -mfp16-format=@var{name}
779 -mthumb-interwork  -mno-thumb-interwork @gol
780 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
781 -mtune=@var{name}  -mprint-tune-info @gol
782 -mstructure-size-boundary=@var{n} @gol
783 -mabort-on-noreturn @gol
784 -mlong-calls  -mno-long-calls @gol
785 -msingle-pic-base  -mno-single-pic-base @gol
786 -mpic-register=@var{reg} @gol
787 -mnop-fun-dllimport @gol
788 -mpoke-function-name @gol
789 -mthumb  -marm  -mflip-thumb @gol
790 -mtpcs-frame  -mtpcs-leaf-frame @gol
791 -mcaller-super-interworking  -mcallee-super-interworking @gol
792 -mtp=@var{name}  -mtls-dialect=@var{dialect} @gol
793 -mword-relocations @gol
794 -mfix-cortex-m3-ldrd @gol
795 -munaligned-access @gol
796 -mneon-for-64bits @gol
797 -mslow-flash-data @gol
798 -masm-syntax-unified @gol
799 -mrestrict-it @gol
800 -mverbose-cost-dump @gol
801 -mpure-code @gol
802 -mcmse @gol
803 -mfdpic}
805 @emph{AVR Options}
806 @gccoptlist{-mmcu=@var{mcu}  -mabsdata  -maccumulate-args @gol
807 -mbranch-cost=@var{cost} @gol
808 -mcall-prologues  -mgas-isr-prologues  -mint8 @gol
809 -mdouble=@var{bits} -mlong-double=@var{bits} @gol
810 -mn_flash=@var{size}  -mno-interrupts @gol
811 -mmain-is-OS_task  -mrelax  -mrmw  -mstrict-X  -mtiny-stack @gol
812 -mfract-convert-truncate @gol
813 -mshort-calls  -nodevicelib  -nodevicespecs @gol
814 -Waddr-space-convert  -Wmisspelled-isr}
816 @emph{Blackfin Options}
817 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
818 -msim  -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
819 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
820 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
821 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
822 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
823 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
824 -mfast-fp  -minline-plt  -mmulticore  -mcorea  -mcoreb  -msdram @gol
825 -micplb}
827 @emph{C6X Options}
828 @gccoptlist{-mbig-endian  -mlittle-endian  -march=@var{cpu} @gol
829 -msim  -msdata=@var{sdata-type}}
831 @emph{CRIS Options}
832 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
833 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
834 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
835 -mstack-align  -mdata-align  -mconst-align @gol
836 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
837 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
838 -mmul-bug-workaround  -mno-mul-bug-workaround}
840 @emph{CR16 Options}
841 @gccoptlist{-mmac @gol
842 -mcr16cplus  -mcr16c @gol
843 -msim  -mint32  -mbit-ops
844 -mdata-model=@var{model}}
846 @emph{C-SKY Options}
847 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu} @gol
848 -mbig-endian  -EB  -mlittle-endian  -EL @gol
849 -mhard-float  -msoft-float  -mfpu=@var{fpu}  -mdouble-float  -mfdivdu @gol
850 -mfloat-abi=@var{name} @gol
851 -melrw  -mistack  -mmp  -mcp  -mcache  -msecurity  -mtrust @gol
852 -mdsp  -medsp  -mvdsp @gol
853 -mdiv  -msmart  -mhigh-registers  -manchor @gol
854 -mpushpop  -mmultiple-stld  -mconstpool  -mstack-size  -mccrt @gol
855 -mbranch-cost=@var{n}  -mcse-cc  -msched-prolog -msim}
857 @emph{Darwin Options}
858 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
859 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
860 -client_name  -compatibility_version  -current_version @gol
861 -dead_strip @gol
862 -dependency-file  -dylib_file  -dylinker_install_name @gol
863 -dynamic  -dynamiclib  -exported_symbols_list @gol
864 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
865 -force_flat_namespace  -headerpad_max_install_names @gol
866 -iframework @gol
867 -image_base  -init  -install_name  -keep_private_externs @gol
868 -multi_module  -multiply_defined  -multiply_defined_unused @gol
869 -noall_load   -no_dead_strip_inits_and_terms @gol
870 -nofixprebinding  -nomultidefs  -noprebind  -noseglinkedit @gol
871 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
872 -private_bundle  -read_only_relocs  -sectalign @gol
873 -sectobjectsymbols  -whyload  -seg1addr @gol
874 -sectcreate  -sectobjectsymbols  -sectorder @gol
875 -segaddr  -segs_read_only_addr  -segs_read_write_addr @gol
876 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
877 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
878 -single_module  -static  -sub_library  -sub_umbrella @gol
879 -twolevel_namespace  -umbrella  -undefined @gol
880 -unexported_symbols_list  -weak_reference_mismatches @gol
881 -whatsloaded  -F  -gused  -gfull  -mmacosx-version-min=@var{version} @gol
882 -mkernel  -mone-byte-bool}
884 @emph{DEC Alpha Options}
885 @gccoptlist{-mno-fp-regs  -msoft-float @gol
886 -mieee  -mieee-with-inexact  -mieee-conformant @gol
887 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
888 -mtrap-precision=@var{mode}  -mbuild-constants @gol
889 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
890 -mbwx  -mmax  -mfix  -mcix @gol
891 -mfloat-vax  -mfloat-ieee @gol
892 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
893 -msmall-text  -mlarge-text @gol
894 -mmemory-latency=@var{time}}
896 @emph{eBPF Options}
897 @gccoptlist{-mbig-endian -mlittle-endian -mkernel=@var{version}
898 -mframe-limit=@var{bytes} -mxbpf}
900 @emph{FR30 Options}
901 @gccoptlist{-msmall-model  -mno-lsim}
903 @emph{FT32 Options}
904 @gccoptlist{-msim  -mlra  -mnodiv  -mft32b  -mcompress  -mnopm}
906 @emph{FRV Options}
907 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
908 -mhard-float  -msoft-float @gol
909 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
910 -mdouble  -mno-double @gol
911 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
912 -mfdpic  -minline-plt  -mgprel-ro  -multilib-library-pic @gol
913 -mlinked-fp  -mlong-calls  -malign-labels @gol
914 -mlibrary-pic  -macc-4  -macc-8 @gol
915 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
916 -moptimize-membar  -mno-optimize-membar @gol
917 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
918 -mvliw-branch  -mno-vliw-branch @gol
919 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
920 -mno-nested-cond-exec  -mtomcat-stats @gol
921 -mTLS  -mtls @gol
922 -mcpu=@var{cpu}}
924 @emph{GNU/Linux Options}
925 @gccoptlist{-mglibc  -muclibc  -mmusl  -mbionic  -mandroid @gol
926 -tno-android-cc  -tno-android-ld}
928 @emph{H8/300 Options}
929 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr  -mno-exr  -mint32  -malign-300}
931 @emph{HPPA Options}
932 @gccoptlist{-march=@var{architecture-type} @gol
933 -mcaller-copies  -mdisable-fpregs  -mdisable-indexing @gol
934 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
935 -mfixed-range=@var{register-range} @gol
936 -mjump-in-delay  -mlinker-opt  -mlong-calls @gol
937 -mlong-load-store  -mno-disable-fpregs @gol
938 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
939 -mno-jump-in-delay  -mno-long-load-store @gol
940 -mno-portable-runtime  -mno-soft-float @gol
941 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
942 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
943 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
944 -munix=@var{unix-std}  -nolibdld  -static  -threads}
946 @emph{IA-64 Options}
947 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
948 -mvolatile-asm-stop  -mregister-names  -msdata  -mno-sdata @gol
949 -mconstant-gp  -mauto-pic  -mfused-madd @gol
950 -minline-float-divide-min-latency @gol
951 -minline-float-divide-max-throughput @gol
952 -mno-inline-float-divide @gol
953 -minline-int-divide-min-latency @gol
954 -minline-int-divide-max-throughput  @gol
955 -mno-inline-int-divide @gol
956 -minline-sqrt-min-latency  -minline-sqrt-max-throughput @gol
957 -mno-inline-sqrt @gol
958 -mdwarf2-asm  -mearly-stop-bits @gol
959 -mfixed-range=@var{register-range}  -mtls-size=@var{tls-size} @gol
960 -mtune=@var{cpu-type}  -milp32  -mlp64 @gol
961 -msched-br-data-spec  -msched-ar-data-spec  -msched-control-spec @gol
962 -msched-br-in-data-spec  -msched-ar-in-data-spec  -msched-in-control-spec @gol
963 -msched-spec-ldc  -msched-spec-control-ldc @gol
964 -msched-prefer-non-data-spec-insns  -msched-prefer-non-control-spec-insns @gol
965 -msched-stop-bits-after-every-cycle  -msched-count-spec-in-critical-path @gol
966 -msel-sched-dont-check-control-spec  -msched-fp-mem-deps-zero-cost @gol
967 -msched-max-memory-insns-hard-limit  -msched-max-memory-insns=@var{max-insns}}
969 @emph{LM32 Options}
970 @gccoptlist{-mbarrel-shift-enabled  -mdivide-enabled  -mmultiply-enabled @gol
971 -msign-extend-enabled  -muser-enabled}
973 @emph{M32R/D Options}
974 @gccoptlist{-m32r2  -m32rx  -m32r @gol
975 -mdebug @gol
976 -malign-loops  -mno-align-loops @gol
977 -missue-rate=@var{number} @gol
978 -mbranch-cost=@var{number} @gol
979 -mmodel=@var{code-size-model-type} @gol
980 -msdata=@var{sdata-type} @gol
981 -mno-flush-func  -mflush-func=@var{name} @gol
982 -mno-flush-trap  -mflush-trap=@var{number} @gol
983 -G @var{num}}
985 @emph{M32C Options}
986 @gccoptlist{-mcpu=@var{cpu}  -msim  -memregs=@var{number}}
988 @emph{M680x0 Options}
989 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
990 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
991 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
992 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
993 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
994 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
995 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
996 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
997 -mxgot  -mno-xgot  -mlong-jump-table-offsets}
999 @emph{MCore Options}
1000 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
1001 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
1002 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
1003 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
1004 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
1006 @emph{MeP Options}
1007 @gccoptlist{-mabsdiff  -mall-opts  -maverage  -mbased=@var{n}  -mbitops @gol
1008 -mc=@var{n}  -mclip  -mconfig=@var{name}  -mcop  -mcop32  -mcop64  -mivc2 @gol
1009 -mdc  -mdiv  -meb  -mel  -mio-volatile  -ml  -mleadz  -mm  -mminmax @gol
1010 -mmult  -mno-opts  -mrepeat  -ms  -msatur  -msdram  -msim  -msimnovec  -mtf @gol
1011 -mtiny=@var{n}}
1013 @emph{MicroBlaze Options}
1014 @gccoptlist{-msoft-float  -mhard-float  -msmall-divides  -mcpu=@var{cpu} @gol
1015 -mmemcpy  -mxl-soft-mul  -mxl-soft-div  -mxl-barrel-shift @gol
1016 -mxl-pattern-compare  -mxl-stack-check  -mxl-gp-opt  -mno-clearbss @gol
1017 -mxl-multiply-high  -mxl-float-convert  -mxl-float-sqrt @gol
1018 -mbig-endian  -mlittle-endian  -mxl-reorder  -mxl-mode-@var{app-model} @gol
1019 -mpic-data-is-text-relative}
1021 @emph{MIPS Options}
1022 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
1023 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
1024 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
1025 -mips16  -mno-mips16  -mflip-mips16 @gol
1026 -minterlink-compressed  -mno-interlink-compressed @gol
1027 -minterlink-mips16  -mno-interlink-mips16 @gol
1028 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
1029 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
1030 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
1031 -mno-float  -msingle-float  -mdouble-float @gol
1032 -modd-spreg  -mno-odd-spreg @gol
1033 -mabs=@var{mode}  -mnan=@var{encoding} @gol
1034 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
1035 -mmcu  -mmno-mcu @gol
1036 -meva  -mno-eva @gol
1037 -mvirt  -mno-virt @gol
1038 -mxpa  -mno-xpa @gol
1039 -mcrc  -mno-crc @gol
1040 -mginv  -mno-ginv @gol
1041 -mmicromips  -mno-micromips @gol
1042 -mmsa  -mno-msa @gol
1043 -mloongson-mmi  -mno-loongson-mmi @gol
1044 -mloongson-ext  -mno-loongson-ext @gol
1045 -mloongson-ext2  -mno-loongson-ext2 @gol
1046 -mfpu=@var{fpu-type} @gol
1047 -msmartmips  -mno-smartmips @gol
1048 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
1049 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
1050 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
1051 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
1052 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
1053 -membedded-data  -mno-embedded-data @gol
1054 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
1055 -mcode-readable=@var{setting} @gol
1056 -msplit-addresses  -mno-split-addresses @gol
1057 -mexplicit-relocs  -mno-explicit-relocs @gol
1058 -mcheck-zero-division  -mno-check-zero-division @gol
1059 -mdivide-traps  -mdivide-breaks @gol
1060 -mload-store-pairs  -mno-load-store-pairs @gol
1061 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
1062 -mmad  -mno-mad  -mimadd  -mno-imadd  -mfused-madd  -mno-fused-madd  -nocpp @gol
1063 -mfix-24k  -mno-fix-24k @gol
1064 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
1065 -mfix-r5900  -mno-fix-r5900 @gol
1066 -mfix-r10000  -mno-fix-r10000  -mfix-rm7000  -mno-fix-rm7000 @gol
1067 -mfix-vr4120  -mno-fix-vr4120 @gol
1068 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
1069 -mflush-func=@var{func}  -mno-flush-func @gol
1070 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
1071 -mcompact-branches=@var{policy} @gol
1072 -mfp-exceptions  -mno-fp-exceptions @gol
1073 -mvr4130-align  -mno-vr4130-align  -msynci  -mno-synci @gol
1074 -mlxc1-sxc1  -mno-lxc1-sxc1  -mmadd4  -mno-madd4 @gol
1075 -mrelax-pic-calls  -mno-relax-pic-calls  -mmcount-ra-address @gol
1076 -mframe-header-opt  -mno-frame-header-opt}
1078 @emph{MMIX Options}
1079 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
1080 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
1081 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
1082 -mno-base-addresses  -msingle-exit  -mno-single-exit}
1084 @emph{MN10300 Options}
1085 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
1086 -mno-am33  -mam33  -mam33-2  -mam34 @gol
1087 -mtune=@var{cpu-type} @gol
1088 -mreturn-pointer-on-d0 @gol
1089 -mno-crt0  -mrelax  -mliw  -msetlb}
1091 @emph{Moxie Options}
1092 @gccoptlist{-meb  -mel  -mmul.x  -mno-crt0}
1094 @emph{MSP430 Options}
1095 @gccoptlist{-msim  -masm-hex  -mmcu=  -mcpu=  -mlarge  -msmall  -mrelax @gol
1096 -mwarn-mcu @gol
1097 -mcode-region=  -mdata-region= @gol
1098 -msilicon-errata=  -msilicon-errata-warn= @gol
1099 -mhwmult=  -minrt  -mtiny-printf  -mmax-inline-shift=}
1101 @emph{NDS32 Options}
1102 @gccoptlist{-mbig-endian  -mlittle-endian @gol
1103 -mreduced-regs  -mfull-regs @gol
1104 -mcmov  -mno-cmov @gol
1105 -mext-perf  -mno-ext-perf @gol
1106 -mext-perf2  -mno-ext-perf2 @gol
1107 -mext-string  -mno-ext-string @gol
1108 -mv3push  -mno-v3push @gol
1109 -m16bit  -mno-16bit @gol
1110 -misr-vector-size=@var{num} @gol
1111 -mcache-block-size=@var{num} @gol
1112 -march=@var{arch} @gol
1113 -mcmodel=@var{code-model} @gol
1114 -mctor-dtor  -mrelax}
1116 @emph{Nios II Options}
1117 @gccoptlist{-G @var{num}  -mgpopt=@var{option}  -mgpopt  -mno-gpopt @gol
1118 -mgprel-sec=@var{regexp}  -mr0rel-sec=@var{regexp} @gol
1119 -mel  -meb @gol
1120 -mno-bypass-cache  -mbypass-cache @gol
1121 -mno-cache-volatile  -mcache-volatile @gol
1122 -mno-fast-sw-div  -mfast-sw-div @gol
1123 -mhw-mul  -mno-hw-mul  -mhw-mulx  -mno-hw-mulx  -mno-hw-div  -mhw-div @gol
1124 -mcustom-@var{insn}=@var{N}  -mno-custom-@var{insn} @gol
1125 -mcustom-fpu-cfg=@var{name} @gol
1126 -mhal  -msmallc  -msys-crt0=@var{name}  -msys-lib=@var{name} @gol
1127 -march=@var{arch}  -mbmx  -mno-bmx  -mcdx  -mno-cdx}
1129 @emph{Nvidia PTX Options}
1130 @gccoptlist{-m64  -mmainkernel  -moptimize}
1132 @emph{OpenRISC Options}
1133 @gccoptlist{-mboard=@var{name}  -mnewlib  -mhard-mul  -mhard-div @gol
1134 -msoft-mul  -msoft-div @gol
1135 -msoft-float  -mhard-float  -mdouble-float -munordered-float @gol
1136 -mcmov  -mror  -mrori  -msext  -msfimm  -mshftimm}
1138 @emph{PDP-11 Options}
1139 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
1140 -mint32  -mno-int16  -mint16  -mno-int32 @gol
1141 -msplit  -munix-asm  -mdec-asm  -mgnu-asm  -mlra}
1143 @emph{picoChip Options}
1144 @gccoptlist{-mae=@var{ae_type}  -mvliw-lookahead=@var{N} @gol
1145 -msymbol-as-address  -mno-inefficient-warnings}
1147 @emph{PowerPC Options}
1148 See RS/6000 and PowerPC Options.
1150 @emph{PRU Options}
1151 @gccoptlist{-mmcu=@var{mcu}  -minrt  -mno-relax  -mloop @gol
1152 -mabi=@var{variant} @gol}
1154 @emph{RISC-V Options}
1155 @gccoptlist{-mbranch-cost=@var{N-instruction} @gol
1156 -mplt  -mno-plt @gol
1157 -mabi=@var{ABI-string} @gol
1158 -mfdiv  -mno-fdiv @gol
1159 -mdiv  -mno-div @gol
1160 -march=@var{ISA-string} @gol
1161 -mtune=@var{processor-string} @gol
1162 -mpreferred-stack-boundary=@var{num} @gol
1163 -msmall-data-limit=@var{N-bytes} @gol
1164 -msave-restore  -mno-save-restore @gol
1165 -mshorten-memrefs  -mno-shorten-memrefs @gol
1166 -mstrict-align  -mno-strict-align @gol
1167 -mcmodel=medlow  -mcmodel=medany @gol
1168 -mexplicit-relocs  -mno-explicit-relocs @gol
1169 -mrelax  -mno-relax @gol
1170 -mriscv-attribute  -mmo-riscv-attribute @gol
1171 -malign-data=@var{type} @gol
1172 +-mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
1173 +-mstack-protector-guard-offset=@var{offset}}
1175 @emph{RL78 Options}
1176 @gccoptlist{-msim  -mmul=none  -mmul=g13  -mmul=g14  -mallregs @gol
1177 -mcpu=g10  -mcpu=g13  -mcpu=g14  -mg10  -mg13  -mg14 @gol
1178 -m64bit-doubles  -m32bit-doubles  -msave-mduc-in-interrupts}
1180 @emph{RS/6000 and PowerPC Options}
1181 @gccoptlist{-mcpu=@var{cpu-type} @gol
1182 -mtune=@var{cpu-type} @gol
1183 -mcmodel=@var{code-model} @gol
1184 -mpowerpc64 @gol
1185 -maltivec  -mno-altivec @gol
1186 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
1187 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
1188 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mpopcntd  -mno-popcntd @gol
1189 -mfprnd  -mno-fprnd @gol
1190 -mcmpb  -mno-cmpb  -mhard-dfp  -mno-hard-dfp @gol
1191 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
1192 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
1193 -malign-power  -malign-natural @gol
1194 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
1195 -mupdate  -mno-update @gol
1196 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
1197 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
1198 -mstrict-align  -mno-strict-align  -mrelocatable @gol
1199 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
1200 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
1201 -mdynamic-no-pic  -mswdiv  -msingle-pic-base @gol
1202 -mprioritize-restricted-insns=@var{priority} @gol
1203 -msched-costly-dep=@var{dependence_type} @gol
1204 -minsert-sched-nops=@var{scheme} @gol
1205 -mcall-aixdesc  -mcall-eabi  -mcall-freebsd  @gol
1206 -mcall-linux  -mcall-netbsd  -mcall-openbsd  @gol
1207 -mcall-sysv  -mcall-sysv-eabi  -mcall-sysv-noeabi @gol
1208 -mtraceback=@var{traceback_type} @gol
1209 -maix-struct-return  -msvr4-struct-return @gol
1210 -mabi=@var{abi-type}  -msecure-plt  -mbss-plt @gol
1211 -mlongcall  -mno-longcall  -mpltseq  -mno-pltseq  @gol
1212 -mblock-move-inline-limit=@var{num} @gol
1213 -mblock-compare-inline-limit=@var{num} @gol
1214 -mblock-compare-inline-loop-limit=@var{num} @gol
1215 -mno-block-ops-unaligned-vsx @gol
1216 -mstring-compare-inline-limit=@var{num} @gol
1217 -misel  -mno-isel @gol
1218 -mvrsave  -mno-vrsave @gol
1219 -mmulhw  -mno-mulhw @gol
1220 -mdlmzb  -mno-dlmzb @gol
1221 -mprototype  -mno-prototype @gol
1222 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
1223 -msdata=@var{opt}  -mreadonly-in-sdata  -mvxworks  -G @var{num} @gol
1224 -mrecip  -mrecip=@var{opt}  -mno-recip  -mrecip-precision @gol
1225 -mno-recip-precision @gol
1226 -mveclibabi=@var{type}  -mfriz  -mno-friz @gol
1227 -mpointers-to-nested-functions  -mno-pointers-to-nested-functions @gol
1228 -msave-toc-indirect  -mno-save-toc-indirect @gol
1229 -mpower8-fusion  -mno-mpower8-fusion  -mpower8-vector  -mno-power8-vector @gol
1230 -mcrypto  -mno-crypto  -mhtm  -mno-htm @gol
1231 -mquad-memory  -mno-quad-memory @gol
1232 -mquad-memory-atomic  -mno-quad-memory-atomic @gol
1233 -mcompat-align-parm  -mno-compat-align-parm @gol
1234 -mfloat128  -mno-float128  -mfloat128-hardware  -mno-float128-hardware @gol
1235 -mgnu-attribute  -mno-gnu-attribute @gol
1236 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
1237 -mstack-protector-guard-offset=@var{offset} -mprefixed -mno-prefixed @gol
1238 -mpcrel -mno-pcrel -mmma -mno-mmma}
1240 @emph{RX Options}
1241 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
1242 -mcpu=@gol
1243 -mbig-endian-data  -mlittle-endian-data @gol
1244 -msmall-data @gol
1245 -msim  -mno-sim@gol
1246 -mas100-syntax  -mno-as100-syntax@gol
1247 -mrelax@gol
1248 -mmax-constant-size=@gol
1249 -mint-register=@gol
1250 -mpid@gol
1251 -mallow-string-insns  -mno-allow-string-insns@gol
1252 -mjsr@gol
1253 -mno-warn-multiple-fast-interrupts@gol
1254 -msave-acc-in-interrupts}
1256 @emph{S/390 and zSeries Options}
1257 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1258 -mhard-float  -msoft-float  -mhard-dfp  -mno-hard-dfp @gol
1259 -mlong-double-64  -mlong-double-128 @gol
1260 -mbackchain  -mno-backchain  -mpacked-stack  -mno-packed-stack @gol
1261 -msmall-exec  -mno-small-exec  -mmvcle  -mno-mvcle @gol
1262 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
1263 -mhtm  -mvx  -mzvector @gol
1264 -mtpf-trace  -mno-tpf-trace  -mtpf-trace-skip  -mno-tpf-trace-skip @gol
1265 -mfused-madd  -mno-fused-madd @gol
1266 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size  -mstack-guard @gol
1267 -mhotpatch=@var{halfwords},@var{halfwords}}
1269 @emph{Score Options}
1270 @gccoptlist{-meb  -mel @gol
1271 -mnhwloop @gol
1272 -muls @gol
1273 -mmac @gol
1274 -mscore5  -mscore5u  -mscore7  -mscore7d}
1276 @emph{SH Options}
1277 @gccoptlist{-m1  -m2  -m2e @gol
1278 -m2a-nofpu  -m2a-single-only  -m2a-single  -m2a @gol
1279 -m3  -m3e @gol
1280 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
1281 -m4a-nofpu  -m4a-single-only  -m4a-single  -m4a  -m4al @gol
1282 -mb  -ml  -mdalign  -mrelax @gol
1283 -mbigtable  -mfmovd  -mrenesas  -mno-renesas  -mnomacsave @gol
1284 -mieee  -mno-ieee  -mbitops  -misize  -minline-ic_invalidate  -mpadstruct @gol
1285 -mprefergot  -musermode  -multcost=@var{number}  -mdiv=@var{strategy} @gol
1286 -mdivsi3_libfunc=@var{name}  -mfixed-range=@var{register-range} @gol
1287 -maccumulate-outgoing-args @gol
1288 -matomic-model=@var{atomic-model} @gol
1289 -mbranch-cost=@var{num}  -mzdcbranch  -mno-zdcbranch @gol
1290 -mcbranch-force-delay-slot @gol
1291 -mfused-madd  -mno-fused-madd  -mfsca  -mno-fsca  -mfsrra  -mno-fsrra @gol
1292 -mpretend-cmove  -mtas}
1294 @emph{Solaris 2 Options}
1295 @gccoptlist{-mclear-hwcap  -mno-clear-hwcap  -mimpure-text  -mno-impure-text @gol
1296 -pthreads}
1298 @emph{SPARC Options}
1299 @gccoptlist{-mcpu=@var{cpu-type} @gol
1300 -mtune=@var{cpu-type} @gol
1301 -mcmodel=@var{code-model} @gol
1302 -mmemory-model=@var{mem-model} @gol
1303 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1304 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1305 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1306 -mhard-quad-float  -msoft-quad-float @gol
1307 -mstack-bias  -mno-stack-bias @gol
1308 -mstd-struct-return  -mno-std-struct-return @gol
1309 -munaligned-doubles  -mno-unaligned-doubles @gol
1310 -muser-mode  -mno-user-mode @gol
1311 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1312 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1313 -mvis4  -mno-vis4  -mvis4b  -mno-vis4b @gol
1314 -mcbcond  -mno-cbcond  -mfmaf  -mno-fmaf  -mfsmuld  -mno-fsmuld  @gol
1315 -mpopc  -mno-popc  -msubxc  -mno-subxc @gol
1316 -mfix-at697f  -mfix-ut699  -mfix-ut700  -mfix-gr712rc @gol
1317 -mlra  -mno-lra}
1319 @emph{System V Options}
1320 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1322 @emph{TILE-Gx Options}
1323 @gccoptlist{-mcpu=CPU  -m32  -m64  -mbig-endian  -mlittle-endian @gol
1324 -mcmodel=@var{code-model}}
1326 @emph{TILEPro Options}
1327 @gccoptlist{-mcpu=@var{cpu}  -m32}
1329 @emph{V850 Options}
1330 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1331 -mprolog-function  -mno-prolog-function  -mspace @gol
1332 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1333 -mapp-regs  -mno-app-regs @gol
1334 -mdisable-callt  -mno-disable-callt @gol
1335 -mv850e2v3  -mv850e2  -mv850e1  -mv850es @gol
1336 -mv850e  -mv850  -mv850e3v5 @gol
1337 -mloop @gol
1338 -mrelax @gol
1339 -mlong-jumps @gol
1340 -msoft-float @gol
1341 -mhard-float @gol
1342 -mgcc-abi @gol
1343 -mrh850-abi @gol
1344 -mbig-switch}
1346 @emph{VAX Options}
1347 @gccoptlist{-mg  -mgnu  -munix}
1349 @emph{Visium Options}
1350 @gccoptlist{-mdebug  -msim  -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1351 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type}  -msv-mode  -muser-mode}
1353 @emph{VMS Options}
1354 @gccoptlist{-mvms-return-codes  -mdebug-main=@var{prefix}  -mmalloc64 @gol
1355 -mpointer-size=@var{size}}
1357 @emph{VxWorks Options}
1358 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1359 -Xbind-lazy  -Xbind-now}
1361 @emph{x86 Options}
1362 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1363 -mtune-ctrl=@var{feature-list}  -mdump-tune-features  -mno-default @gol
1364 -mfpmath=@var{unit} @gol
1365 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1366 -mno-fp-ret-in-387  -m80387  -mhard-float  -msoft-float @gol
1367 -mno-wide-multiply  -mrtd  -malign-double @gol
1368 -mpreferred-stack-boundary=@var{num} @gol
1369 -mincoming-stack-boundary=@var{num} @gol
1370 -mcld  -mcx16  -msahf  -mmovbe  -mcrc32 @gol
1371 -mrecip  -mrecip=@var{opt} @gol
1372 -mvzeroupper  -mprefer-avx128  -mprefer-vector-width=@var{opt} @gol
1373 -mmmx  -msse  -msse2  -msse3  -mssse3  -msse4.1  -msse4.2  -msse4  -mavx @gol
1374 -mavx2  -mavx512f  -mavx512pf  -mavx512er  -mavx512cd  -mavx512vl @gol
1375 -mavx512bw  -mavx512dq  -mavx512ifma  -mavx512vbmi  -msha  -maes @gol
1376 -mpclmul  -mfsgsbase  -mrdrnd  -mf16c  -mfma  -mpconfig  -mwbnoinvd  @gol
1377 -mptwrite  -mprefetchwt1  -mclflushopt  -mclwb  -mxsavec  -mxsaves @gol
1378 -msse4a  -m3dnow  -m3dnowa  -mpopcnt  -mabm  -mbmi  -mtbm  -mfma4  -mxop @gol
1379 -madx  -mlzcnt  -mbmi2  -mfxsr  -mxsave  -mxsaveopt  -mrtm  -mhle  -mlwp @gol
1380 -mmwaitx  -mclzero  -mpku  -mthreads  -mgfni  -mvaes  -mwaitpkg @gol
1381 -mshstk -mmanual-endbr -mforce-indirect-call  -mavx512vbmi2 -mavx512bf16 -menqcmd @gol
1382 -mvpclmulqdq  -mavx512bitalg  -mmovdiri  -mmovdir64b  -mavx512vpopcntdq @gol
1383 -mavx5124fmaps  -mavx512vnni  -mavx5124vnniw  -mprfchw  -mrdpid @gol
1384 -mrdseed  -msgx -mavx512vp2intersect -mserialize -mtsxldtrk@gol
1385 -mamx-tile  -mamx-int8  -mamx-bf16 -muintr -mhreset -mavxvnni@gol
1386 -mcldemote  -mms-bitfields  -mno-align-stringops  -minline-all-stringops @gol
1387 -minline-stringops-dynamically  -mstringop-strategy=@var{alg} @gol
1388 -mkl -mwidekl @gol
1389 -mmemcpy-strategy=@var{strategy}  -mmemset-strategy=@var{strategy} @gol
1390 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1391 -m96bit-long-double  -mlong-double-64  -mlong-double-80  -mlong-double-128 @gol
1392 -mregparm=@var{num}  -msseregparm @gol
1393 -mveclibabi=@var{type}  -mvect8-ret-in-mem @gol
1394 -mpc32  -mpc64  -mpc80  -mstackrealign @gol
1395 -momit-leaf-frame-pointer  -mno-red-zone  -mno-tls-direct-seg-refs @gol
1396 -mcmodel=@var{code-model}  -mabi=@var{name}  -maddress-mode=@var{mode} @gol
1397 -m32  -m64  -mx32  -m16  -miamcu  -mlarge-data-threshold=@var{num} @gol
1398 -msse2avx  -mfentry  -mrecord-mcount  -mnop-mcount  -m8bit-idiv @gol
1399 -minstrument-return=@var{type} -mfentry-name=@var{name} -mfentry-section=@var{name} @gol
1400 -mavx256-split-unaligned-load  -mavx256-split-unaligned-store @gol
1401 -malign-data=@var{type}  -mstack-protector-guard=@var{guard} @gol
1402 -mstack-protector-guard-reg=@var{reg} @gol
1403 -mstack-protector-guard-offset=@var{offset} @gol
1404 -mstack-protector-guard-symbol=@var{symbol} @gol
1405 -mgeneral-regs-only  -mcall-ms2sysv-xlogues @gol
1406 -mindirect-branch=@var{choice}  -mfunction-return=@var{choice} @gol
1407 -mindirect-branch-register -mneeded}
1409 @emph{x86 Windows Options}
1410 @gccoptlist{-mconsole  -mcygwin  -mno-cygwin  -mdll @gol
1411 -mnop-fun-dllimport  -mthread @gol
1412 -municode  -mwin32  -mwindows  -fno-set-stack-executable}
1414 @emph{Xstormy16 Options}
1415 @gccoptlist{-msim}
1417 @emph{Xtensa Options}
1418 @gccoptlist{-mconst16  -mno-const16 @gol
1419 -mfused-madd  -mno-fused-madd @gol
1420 -mforce-no-pic @gol
1421 -mserialize-volatile  -mno-serialize-volatile @gol
1422 -mtext-section-literals  -mno-text-section-literals @gol
1423 -mauto-litpools  -mno-auto-litpools @gol
1424 -mtarget-align  -mno-target-align @gol
1425 -mlongcalls  -mno-longcalls @gol
1426 -mabi=@var{abi-type}}
1428 @emph{zSeries Options}
1429 See S/390 and zSeries Options.
1430 @end table
1433 @node Overall Options
1434 @section Options Controlling the Kind of Output
1436 Compilation can involve up to four stages: preprocessing, compilation
1437 proper, assembly and linking, always in that order.  GCC is capable of
1438 preprocessing and compiling several files either into several
1439 assembler input files, or into one assembler input file; then each
1440 assembler input file produces an object file, and linking combines all
1441 the object files (those newly compiled, and those specified as input)
1442 into an executable file.
1444 @cindex file name suffix
1445 For any given input file, the file name suffix determines what kind of
1446 compilation is done:
1448 @table @gcctabopt
1449 @item @var{file}.c
1450 C source code that must be preprocessed.
1452 @item @var{file}.i
1453 C source code that should not be preprocessed.
1455 @item @var{file}.ii
1456 C++ source code that should not be preprocessed.
1458 @item @var{file}.m
1459 Objective-C source code.  Note that you must link with the @file{libobjc}
1460 library to make an Objective-C program work.
1462 @item @var{file}.mi
1463 Objective-C source code that should not be preprocessed.
1465 @item @var{file}.mm
1466 @itemx @var{file}.M
1467 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1468 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1469 to a literal capital M@.
1471 @item @var{file}.mii
1472 Objective-C++ source code that should not be preprocessed.
1474 @item @var{file}.h
1475 C, C++, Objective-C or Objective-C++ header file to be turned into a
1476 precompiled header (default), or C, C++ header file to be turned into an
1477 Ada spec (via the @option{-fdump-ada-spec} switch).
1479 @item @var{file}.cc
1480 @itemx @var{file}.cp
1481 @itemx @var{file}.cxx
1482 @itemx @var{file}.cpp
1483 @itemx @var{file}.CPP
1484 @itemx @var{file}.c++
1485 @itemx @var{file}.C
1486 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1487 the last two letters must both be literally @samp{x}.  Likewise,
1488 @samp{.C} refers to a literal capital C@.
1490 @item @var{file}.mm
1491 @itemx @var{file}.M
1492 Objective-C++ source code that must be preprocessed.
1494 @item @var{file}.mii
1495 Objective-C++ source code that should not be preprocessed.
1497 @item @var{file}.hh
1498 @itemx @var{file}.H
1499 @itemx @var{file}.hp
1500 @itemx @var{file}.hxx
1501 @itemx @var{file}.hpp
1502 @itemx @var{file}.HPP
1503 @itemx @var{file}.h++
1504 @itemx @var{file}.tcc
1505 C++ header file to be turned into a precompiled header or Ada spec.
1507 @item @var{file}.f
1508 @itemx @var{file}.for
1509 @itemx @var{file}.ftn
1510 Fixed form Fortran source code that should not be preprocessed.
1512 @item @var{file}.F
1513 @itemx @var{file}.FOR
1514 @itemx @var{file}.fpp
1515 @itemx @var{file}.FPP
1516 @itemx @var{file}.FTN
1517 Fixed form Fortran source code that must be preprocessed (with the traditional
1518 preprocessor).
1520 @item @var{file}.f90
1521 @itemx @var{file}.f95
1522 @itemx @var{file}.f03
1523 @itemx @var{file}.f08
1524 Free form Fortran source code that should not be preprocessed.
1526 @item @var{file}.F90
1527 @itemx @var{file}.F95
1528 @itemx @var{file}.F03
1529 @itemx @var{file}.F08
1530 Free form Fortran source code that must be preprocessed (with the
1531 traditional preprocessor).
1533 @item @var{file}.go
1534 Go source code.
1536 @item @var{file}.brig
1537 BRIG files (binary representation of HSAIL).
1539 @item @var{file}.d
1540 D source code.
1542 @item @var{file}.di
1543 D interface file.
1545 @item @var{file}.dd
1546 D documentation code (Ddoc).
1548 @item @var{file}.ads
1549 Ada source code file that contains a library unit declaration (a
1550 declaration of a package, subprogram, or generic, or a generic
1551 instantiation), or a library unit renaming declaration (a package,
1552 generic, or subprogram renaming declaration).  Such files are also
1553 called @dfn{specs}.
1555 @item @var{file}.adb
1556 Ada source code file containing a library unit body (a subprogram or
1557 package body).  Such files are also called @dfn{bodies}.
1559 @c GCC also knows about some suffixes for languages not yet included:
1560 @c Ratfor:
1561 @c @var{file}.r
1563 @item @var{file}.s
1564 Assembler code.
1566 @item @var{file}.S
1567 @itemx @var{file}.sx
1568 Assembler code that must be preprocessed.
1570 @item @var{other}
1571 An object file to be fed straight into linking.
1572 Any file name with no recognized suffix is treated this way.
1573 @end table
1575 @opindex x
1576 You can specify the input language explicitly with the @option{-x} option:
1578 @table @gcctabopt
1579 @item -x @var{language}
1580 Specify explicitly the @var{language} for the following input files
1581 (rather than letting the compiler choose a default based on the file
1582 name suffix).  This option applies to all following input files until
1583 the next @option{-x} option.  Possible values for @var{language} are:
1584 @smallexample
1585 c  c-header  cpp-output
1586 c++  c++-header  c++-system-header c++-user-header c++-cpp-output
1587 objective-c  objective-c-header  objective-c-cpp-output
1588 objective-c++ objective-c++-header objective-c++-cpp-output
1589 assembler  assembler-with-cpp
1592 f77  f77-cpp-input f95  f95-cpp-input
1594 brig
1595 @end smallexample
1597 @item -x none
1598 Turn off any specification of a language, so that subsequent files are
1599 handled according to their file name suffixes (as they are if @option{-x}
1600 has not been used at all).
1601 @end table
1603 If you only want some of the stages of compilation, you can use
1604 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1605 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1606 @command{gcc} is to stop.  Note that some combinations (for example,
1607 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1609 @table @gcctabopt
1610 @item -c
1611 @opindex c
1612 Compile or assemble the source files, but do not link.  The linking
1613 stage simply is not done.  The ultimate output is in the form of an
1614 object file for each source file.
1616 By default, the object file name for a source file is made by replacing
1617 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1619 Unrecognized input files, not requiring compilation or assembly, are
1620 ignored.
1622 @item -S
1623 @opindex S
1624 Stop after the stage of compilation proper; do not assemble.  The output
1625 is in the form of an assembler code file for each non-assembler input
1626 file specified.
1628 By default, the assembler file name for a source file is made by
1629 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1631 Input files that don't require compilation are ignored.
1633 @item -E
1634 @opindex E
1635 Stop after the preprocessing stage; do not run the compiler proper.  The
1636 output is in the form of preprocessed source code, which is sent to the
1637 standard output.
1639 Input files that don't require preprocessing are ignored.
1641 @cindex output file option
1642 @item -o @var{file}
1643 @opindex o
1644 Place the primary output in file @var{file}.  This applies to whatever
1645 sort of output is being produced, whether it be an executable file, an
1646 object file, an assembler file or preprocessed C code.
1648 If @option{-o} is not specified, the default is to put an executable
1649 file in @file{a.out}, the object file for
1650 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1651 assembler file in @file{@var{source}.s}, a precompiled header file in
1652 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1653 standard output.
1655 Though @option{-o} names only the primary output, it also affects the
1656 naming of auxiliary and dump outputs.  See the examples below.  Unless
1657 overridden, both auxiliary outputs and dump outputs are placed in the
1658 same directory as the primary output.  In auxiliary outputs, the suffix
1659 of the input file is replaced with that of the auxiliary output file
1660 type; in dump outputs, the suffix of the dump file is appended to the
1661 input file suffix.  In compilation commands, the base name of both
1662 auxiliary and dump outputs is that of the primary output; in compile and
1663 link commands, the primary output name, minus the executable suffix, is
1664 combined with the input file name.  If both share the same base name,
1665 disregarding the suffix, the result of the combination is that base
1666 name, otherwise, they are concatenated, separated by a dash.
1668 @smallexample
1669 gcc -c foo.c ...
1670 @end smallexample
1672 will use @file{foo.o} as the primary output, and place aux outputs and
1673 dumps next to it, e.g., aux file @file{foo.dwo} for
1674 @option{-gsplit-dwarf}, and dump file @file{foo.c.???r.final} for
1675 @option{-fdump-rtl-final}.
1677 If a non-linker output file is explicitly specified, aux and dump files
1678 by default take the same base name:
1680 @smallexample
1681 gcc -c foo.c -o dir/foobar.o ...
1682 @end smallexample
1684 will name aux outputs @file{dir/foobar.*} and dump outputs
1685 @file{dir/foobar.c.*}.
1687 A linker output will instead prefix aux and dump outputs:
1689 @smallexample
1690 gcc foo.c bar.c -o dir/foobar ...
1691 @end smallexample
1693 will generally name aux outputs @file{dir/foobar-foo.*} and
1694 @file{dir/foobar-bar.*}, and dump outputs @file{dir/foobar-foo.c.*} and
1695 @file{dir/foobar-bar.c.*}.
1697 The one exception to the above is when the executable shares the base
1698 name with the single input:
1700 @smallexample
1701 gcc foo.c -o dir/foo ...
1702 @end smallexample
1704 in which case aux outputs are named @file{dir/foo.*} and dump outputs
1705 named @file{dir/foo.c.*}.
1707 The location and the names of auxiliary and dump outputs can be adjusted
1708 by the options @option{-dumpbase}, @option{-dumpbase-ext},
1709 @option{-dumpdir}, @option{-save-temps=cwd}, and
1710 @option{-save-temps=obj}.
1713 @item -dumpbase @var{dumpbase}
1714 @opindex dumpbase
1715 This option sets the base name for auxiliary and dump output files.  It
1716 does not affect the name of the primary output file.  Intermediate
1717 outputs, when preserved, are not regarded as primary outputs, but as
1718 auxiliary outputs:
1720 @smallexample
1721 gcc -save-temps -S foo.c
1722 @end smallexample
1724 saves the (no longer) temporary preprocessed file in @file{foo.i}, and
1725 then compiles to the (implied) output file @file{foo.s}, whereas:
1727 @smallexample
1728 gcc -save-temps -dumpbase save-foo -c foo.c
1729 @end smallexample
1731 preprocesses to in @file{save-foo.i}, compiles to @file{save-foo.s} (now
1732 an intermediate, thus auxiliary output), and then assembles to the
1733 (implied) output file @file{foo.o}.
1735 Absent this option, dump and aux files take their names from the input
1736 file, or from the (non-linker) output file, if one is explicitly
1737 specified: dump output files (e.g. those requested by @option{-fdump-*}
1738 options) with the input name suffix, and aux output files (those
1739 requested by other non-dump options, e.g. @code{-save-temps},
1740 @code{-gsplit-dwarf}, @code{-fcallgraph-info}) without it.
1742 Similar suffix differentiation of dump and aux outputs can be attained
1743 for explicitly-given @option{-dumpbase basename.suf} by also specifying
1744 @option{-dumpbase-ext .suf}.
1746 If @var{dumpbase} is explicitly specified with any directory component,
1747 any @var{dumppfx} specification (e.g. @option{-dumpdir} or
1748 @option{-save-temps=*}) is ignored, and instead of appending to it,
1749 @var{dumpbase} fully overrides it:
1751 @smallexample
1752 gcc foo.c -c -o dir/foo.o -dumpbase alt/foo \
1753   -dumpdir pfx- -save-temps=cwd ...
1754 @end smallexample
1756 creates auxiliary and dump outputs named @file{alt/foo.*}, disregarding
1757 @file{dir/} in @option{-o}, the @file{./} prefix implied by
1758 @option{-save-temps=cwd}, and @file{pfx-} in @option{-dumpdir}.
1760 When @option{-dumpbase} is specified in a command that compiles multiple
1761 inputs, or that compiles and then links, it may be combined with
1762 @var{dumppfx}, as specified under @option{-dumpdir}.  Then, each input
1763 file is compiled using the combined @var{dumppfx}, and default values
1764 for @var{dumpbase} and @var{auxdropsuf} are computed for each input
1765 file:
1767 @smallexample
1768 gcc foo.c bar.c -c -dumpbase main ...
1769 @end smallexample
1771 creates @file{foo.o} and @file{bar.o} as primary outputs, and avoids
1772 overwriting the auxiliary and dump outputs by using the @var{dumpbase}
1773 as a prefix, creating auxiliary and dump outputs named @file{main-foo.*}
1774 and @file{main-bar.*}.
1776 An empty string specified as @var{dumpbase} avoids the influence of the
1777 output basename in the naming of auxiliary and dump outputs during
1778 compilation, computing default values :
1780 @smallexample
1781 gcc -c foo.c -o dir/foobar.o -dumpbase '' ...
1782 @end smallexample
1784 will name aux outputs @file{dir/foo.*} and dump outputs
1785 @file{dir/foo.c.*}.  Note how their basenames are taken from the input
1786 name, but the directory still defaults to that of the output.
1788 The empty-string dumpbase does not prevent the use of the output
1789 basename for outputs during linking:
1791 @smallexample
1792 gcc foo.c bar.c -o dir/foobar -dumpbase '' -flto ...
1793 @end smallexample
1795 The compilation of the source files will name auxiliary outputs
1796 @file{dir/foo.*} and @file{dir/bar.*}, and dump outputs
1797 @file{dir/foo.c.*} and @file{dir/bar.c.*}.  LTO recompilation during
1798 linking will use @file{dir/foobar.} as the prefix for dumps and
1799 auxiliary files.
1802 @item -dumpbase-ext @var{auxdropsuf}
1803 @opindex dumpbase-ext
1804 When forming the name of an auxiliary (but not a dump) output file, drop
1805 trailing @var{auxdropsuf} from @var{dumpbase} before appending any
1806 suffixes.  If not specified, this option defaults to the suffix of a
1807 default @var{dumpbase}, i.e., the suffix of the input file when
1808 @option{-dumpbase} is not present in the command line, or @var{dumpbase}
1809 is combined with @var{dumppfx}.
1811 @smallexample
1812 gcc foo.c -c -o dir/foo.o -dumpbase x-foo.c -dumpbase-ext .c ...
1813 @end smallexample
1815 creates @file{dir/foo.o} as the main output, and generates auxiliary
1816 outputs in @file{dir/x-foo.*}, taking the location of the primary
1817 output, and dropping the @file{.c} suffix from the @var{dumpbase}.  Dump
1818 outputs retain the suffix: @file{dir/x-foo.c.*}.
1820 This option is disregarded if it does not match the suffix of a
1821 specified @var{dumpbase}, except as an alternative to the executable
1822 suffix when appending the linker output base name to @var{dumppfx}, as
1823 specified below:
1825 @smallexample
1826 gcc foo.c bar.c -o main.out -dumpbase-ext .out ...
1827 @end smallexample
1829 creates @file{main.out} as the primary output, and avoids overwriting
1830 the auxiliary and dump outputs by using the executable name minus
1831 @var{auxdropsuf} as a prefix, creating auxiliary outputs named
1832 @file{main-foo.*} and @file{main-bar.*} and dump outputs named
1833 @file{main-foo.c.*} and @file{main-bar.c.*}.
1836 @item -dumpdir @var{dumppfx}
1837 @opindex dumpdir
1838 When forming the name of an auxiliary or dump output file, use
1839 @var{dumppfx} as a prefix:
1841 @smallexample
1842 gcc -dumpdir pfx- -c foo.c ...
1843 @end smallexample
1845 creates @file{foo.o} as the primary output, and auxiliary outputs named
1846 @file{pfx-foo.*}, combining the given @var{dumppfx} with the default
1847 @var{dumpbase} derived from the default primary output, derived in turn
1848 from the input name.  Dump outputs also take the input name suffix:
1849 @file{pfx-foo.c.*}.
1851 If @var{dumppfx} is to be used as a directory name, it must end with a
1852 directory separator:
1854 @smallexample
1855 gcc -dumpdir dir/ -c foo.c -o obj/bar.o ...
1856 @end smallexample
1858 creates @file{obj/bar.o} as the primary output, and auxiliary outputs
1859 named @file{dir/bar.*}, combining the given @var{dumppfx} with the
1860 default @var{dumpbase} derived from the primary output name.  Dump
1861 outputs also take the input name suffix: @file{dir/bar.c.*}.
1863 It defaults to the location of the output file; options
1864 @option{-save-temps=cwd} and @option{-save-temps=obj} override this
1865 default, just like an explicit @option{-dumpdir} option.  In case
1866 multiple such options are given, the last one prevails:
1868 @smallexample
1869 gcc -dumpdir pfx- -c foo.c -save-temps=obj ...
1870 @end smallexample
1872 outputs @file{foo.o}, with auxiliary outputs named @file{foo.*} because
1873 @option{-save-temps=*} overrides the @var{dumppfx} given by the earlier
1874 @option{-dumpdir} option.  It does not matter that @option{=obj} is the
1875 default for @option{-save-temps}, nor that the output directory is
1876 implicitly the current directory.  Dump outputs are named
1877 @file{foo.c.*}.
1879 When compiling from multiple input files, if @option{-dumpbase} is
1880 specified, @var{dumpbase}, minus a @var{auxdropsuf} suffix, and a dash
1881 are appended to (or override, if containing any directory components) an
1882 explicit or defaulted @var{dumppfx}, so that each of the multiple
1883 compilations gets differently-named aux and dump outputs.
1885 @smallexample
1886 gcc foo.c bar.c -c -dumpdir dir/pfx- -dumpbase main ...
1887 @end smallexample
1889 outputs auxiliary dumps to @file{dir/pfx-main-foo.*} and
1890 @file{dir/pfx-main-bar.*}, appending @var{dumpbase}- to @var{dumppfx}.
1891 Dump outputs retain the input file suffix: @file{dir/pfx-main-foo.c.*}
1892 and @file{dir/pfx-main-bar.c.*}, respectively.  Contrast with the
1893 single-input compilation:
1895 @smallexample
1896 gcc foo.c -c -dumpdir dir/pfx- -dumpbase main ...
1897 @end smallexample
1899 that, applying @option{-dumpbase} to a single source, does not compute
1900 and append a separate @var{dumpbase} per input file.  Its auxiliary and
1901 dump outputs go in @file{dir/pfx-main.*}.
1903 When compiling and then linking from multiple input files, a defaulted
1904 or explicitly specified @var{dumppfx} also undergoes the @var{dumpbase}-
1905 transformation above (e.g. the compilation of @file{foo.c} and
1906 @file{bar.c} above, but without @option{-c}).  If neither
1907 @option{-dumpdir} nor @option{-dumpbase} are given, the linker output
1908 base name, minus @var{auxdropsuf}, if specified, or the executable
1909 suffix otherwise, plus a dash is appended to the default @var{dumppfx}
1910 instead.  Note, however, that unlike earlier cases of linking:
1912 @smallexample
1913 gcc foo.c bar.c -dumpdir dir/pfx- -o main ...
1914 @end smallexample
1916 does not append the output name @file{main} to @var{dumppfx}, because
1917 @option{-dumpdir} is explicitly specified.  The goal is that the
1918 explicitly-specified @var{dumppfx} may contain the specified output name
1919 as part of the prefix, if desired; only an explicitly-specified
1920 @option{-dumpbase} would be combined with it, in order to avoid simply
1921 discarding a meaningful option.
1923 When compiling and then linking from a single input file, the linker
1924 output base name will only be appended to the default @var{dumppfx} as
1925 above if it does not share the base name with the single input file
1926 name.  This has been covered in single-input linking cases above, but
1927 not with an explicit @option{-dumpdir} that inhibits the combination,
1928 even if overridden by @option{-save-temps=*}:
1930 @smallexample
1931 gcc foo.c -dumpdir alt/pfx- -o dir/main.exe -save-temps=cwd ...
1932 @end smallexample
1934 Auxiliary outputs are named @file{foo.*}, and dump outputs
1935 @file{foo.c.*}, in the current working directory as ultimately requested
1936 by @option{-save-temps=cwd}.
1938 Summing it all up for an intuitive though slightly imprecise data flow:
1939 the primary output name is broken into a directory part and a basename
1940 part; @var{dumppfx} is set to the former, unless overridden by
1941 @option{-dumpdir} or @option{-save-temps=*}, and @var{dumpbase} is set
1942 to the latter, unless overriden by @option{-dumpbase}.  If there are
1943 multiple inputs or linking, this @var{dumpbase} may be combined with
1944 @var{dumppfx} and taken from each input file.  Auxiliary output names
1945 for each input are formed by combining @var{dumppfx}, @var{dumpbase}
1946 minus suffix, and the auxiliary output suffix; dump output names are
1947 only different in that the suffix from @var{dumpbase} is retained.
1949 When it comes to auxiliary and dump outputs created during LTO
1950 recompilation, a combination of @var{dumppfx} and @var{dumpbase}, as
1951 given or as derived from the linker output name but not from inputs,
1952 even in cases in which this combination would not otherwise be used as
1953 such, is passed down with a trailing period replacing the compiler-added
1954 dash, if any, as a @option{-dumpdir} option to @command{lto-wrapper};
1955 being involved in linking, this program does not normally get any
1956 @option{-dumpbase} and @option{-dumpbase-ext}, and it ignores them.
1958 When running sub-compilers, @command{lto-wrapper} appends LTO stage
1959 names to the received @var{dumppfx}, ensures it contains a directory
1960 component so that it overrides any @option{-dumpdir}, and passes that as
1961 @option{-dumpbase} to sub-compilers.
1963 @item -v
1964 @opindex v
1965 Print (on standard error output) the commands executed to run the stages
1966 of compilation.  Also print the version number of the compiler driver
1967 program and of the preprocessor and the compiler proper.
1969 @item -###
1970 @opindex ###
1971 Like @option{-v} except the commands are not executed and arguments
1972 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1973 This is useful for shell scripts to capture the driver-generated command lines.
1975 @item --help
1976 @opindex help
1977 Print (on the standard output) a description of the command-line options
1978 understood by @command{gcc}.  If the @option{-v} option is also specified
1979 then @option{--help} is also passed on to the various processes
1980 invoked by @command{gcc}, so that they can display the command-line options
1981 they accept.  If the @option{-Wextra} option has also been specified
1982 (prior to the @option{--help} option), then command-line options that
1983 have no documentation associated with them are also displayed.
1985 @item --target-help
1986 @opindex target-help
1987 Print (on the standard output) a description of target-specific command-line
1988 options for each tool.  For some targets extra target-specific
1989 information may also be printed.
1991 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1992 Print (on the standard output) a description of the command-line
1993 options understood by the compiler that fit into all specified classes
1994 and qualifiers.  These are the supported classes:
1996 @table @asis
1997 @item @samp{optimizers}
1998 Display all of the optimization options supported by the
1999 compiler.
2001 @item @samp{warnings}
2002 Display all of the options controlling warning messages
2003 produced by the compiler.
2005 @item @samp{target}
2006 Display target-specific options.  Unlike the
2007 @option{--target-help} option however, target-specific options of the
2008 linker and assembler are not displayed.  This is because those
2009 tools do not currently support the extended @option{--help=} syntax.
2011 @item @samp{params}
2012 Display the values recognized by the @option{--param}
2013 option.
2015 @item @var{language}
2016 Display the options supported for @var{language}, where
2017 @var{language} is the name of one of the languages supported in this
2018 version of GCC@.  If an option is supported by all languages, one needs
2019 to select @samp{common} class.
2021 @item @samp{common}
2022 Display the options that are common to all languages.
2023 @end table
2025 These are the supported qualifiers:
2027 @table @asis
2028 @item @samp{undocumented}
2029 Display only those options that are undocumented.
2031 @item @samp{joined}
2032 Display options taking an argument that appears after an equal
2033 sign in the same continuous piece of text, such as:
2034 @samp{--help=target}.
2036 @item @samp{separate}
2037 Display options taking an argument that appears as a separate word
2038 following the original option, such as: @samp{-o output-file}.
2039 @end table
2041 Thus for example to display all the undocumented target-specific
2042 switches supported by the compiler, use:
2044 @smallexample
2045 --help=target,undocumented
2046 @end smallexample
2048 The sense of a qualifier can be inverted by prefixing it with the
2049 @samp{^} character, so for example to display all binary warning
2050 options (i.e., ones that are either on or off and that do not take an
2051 argument) that have a description, use:
2053 @smallexample
2054 --help=warnings,^joined,^undocumented
2055 @end smallexample
2057 The argument to @option{--help=} should not consist solely of inverted
2058 qualifiers.
2060 Combining several classes is possible, although this usually
2061 restricts the output so much that there is nothing to display.  One
2062 case where it does work, however, is when one of the classes is
2063 @var{target}.  For example, to display all the target-specific
2064 optimization options, use:
2066 @smallexample
2067 --help=target,optimizers
2068 @end smallexample
2070 The @option{--help=} option can be repeated on the command line.  Each
2071 successive use displays its requested class of options, skipping
2072 those that have already been displayed.  If @option{--help} is also
2073 specified anywhere on the command line then this takes precedence
2074 over any @option{--help=} option.
2076 If the @option{-Q} option appears on the command line before the
2077 @option{--help=} option, then the descriptive text displayed by
2078 @option{--help=} is changed.  Instead of describing the displayed
2079 options, an indication is given as to whether the option is enabled,
2080 disabled or set to a specific value (assuming that the compiler
2081 knows this at the point where the @option{--help=} option is used).
2083 Here is a truncated example from the ARM port of @command{gcc}:
2085 @smallexample
2086   % gcc -Q -mabi=2 --help=target -c
2087   The following options are target specific:
2088   -mabi=                                2
2089   -mabort-on-noreturn                   [disabled]
2090   -mapcs                                [disabled]
2091 @end smallexample
2093 The output is sensitive to the effects of previous command-line
2094 options, so for example it is possible to find out which optimizations
2095 are enabled at @option{-O2} by using:
2097 @smallexample
2098 -Q -O2 --help=optimizers
2099 @end smallexample
2101 Alternatively you can discover which binary optimizations are enabled
2102 by @option{-O3} by using:
2104 @smallexample
2105 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
2106 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
2107 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
2108 @end smallexample
2110 @item --version
2111 @opindex version
2112 Display the version number and copyrights of the invoked GCC@.
2114 @item -pass-exit-codes
2115 @opindex pass-exit-codes
2116 Normally the @command{gcc} program exits with the code of 1 if any
2117 phase of the compiler returns a non-success return code.  If you specify
2118 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
2119 the numerically highest error produced by any phase returning an error
2120 indication.  The C, C++, and Fortran front ends return 4 if an internal
2121 compiler error is encountered.
2123 @item -pipe
2124 @opindex pipe
2125 Use pipes rather than temporary files for communication between the
2126 various stages of compilation.  This fails to work on some systems where
2127 the assembler is unable to read from a pipe; but the GNU assembler has
2128 no trouble.
2130 @item -specs=@var{file}
2131 @opindex specs
2132 Process @var{file} after the compiler reads in the standard @file{specs}
2133 file, in order to override the defaults which the @command{gcc} driver
2134 program uses when determining what switches to pass to @command{cc1},
2135 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
2136 @option{-specs=@var{file}} can be specified on the command line, and they
2137 are processed in order, from left to right.  @xref{Spec Files}, for
2138 information about the format of the @var{file}.
2140 @item -wrapper
2141 @opindex wrapper
2142 Invoke all subcommands under a wrapper program.  The name of the
2143 wrapper program and its parameters are passed as a comma separated
2144 list.
2146 @smallexample
2147 gcc -c t.c -wrapper gdb,--args
2148 @end smallexample
2150 @noindent
2151 This invokes all subprograms of @command{gcc} under
2152 @samp{gdb --args}, thus the invocation of @command{cc1} is
2153 @samp{gdb --args cc1 @dots{}}.
2155 @item -ffile-prefix-map=@var{old}=@var{new}
2156 @opindex ffile-prefix-map
2157 When compiling files residing in directory @file{@var{old}}, record
2158 any references to them in the result of the compilation as if the
2159 files resided in directory @file{@var{new}} instead.  Specifying this
2160 option is equivalent to specifying all the individual
2161 @option{-f*-prefix-map} options.  This can be used to make reproducible
2162 builds that are location independent.  See also
2163 @option{-fmacro-prefix-map} and @option{-fdebug-prefix-map}.
2165 @item -fplugin=@var{name}.so
2166 @opindex fplugin
2167 Load the plugin code in file @var{name}.so, assumed to be a
2168 shared object to be dlopen'd by the compiler.  The base name of
2169 the shared object file is used to identify the plugin for the
2170 purposes of argument parsing (See
2171 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
2172 Each plugin should define the callback functions specified in the
2173 Plugins API.
2175 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
2176 @opindex fplugin-arg
2177 Define an argument called @var{key} with a value of @var{value}
2178 for the plugin called @var{name}.
2180 @item -fdump-ada-spec@r{[}-slim@r{]}
2181 @opindex fdump-ada-spec
2182 For C and C++ source and include files, generate corresponding Ada specs.
2183 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
2184 GNAT User's Guide}, which provides detailed documentation on this feature.
2186 @item -fada-spec-parent=@var{unit}
2187 @opindex fada-spec-parent
2188 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
2189 Ada specs as child units of parent @var{unit}.
2191 @item -fdump-go-spec=@var{file}
2192 @opindex fdump-go-spec
2193 For input files in any language, generate corresponding Go
2194 declarations in @var{file}.  This generates Go @code{const},
2195 @code{type}, @code{var}, and @code{func} declarations which may be a
2196 useful way to start writing a Go interface to code written in some
2197 other language.
2199 @include @value{srcdir}/../libiberty/at-file.texi
2200 @end table
2202 @node Invoking G++
2203 @section Compiling C++ Programs
2205 @cindex suffixes for C++ source
2206 @cindex C++ source file suffixes
2207 C++ source files conventionally use one of the suffixes @samp{.C},
2208 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
2209 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
2210 @samp{.H}, or (for shared template code) @samp{.tcc}; and
2211 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
2212 files with these names and compiles them as C++ programs even if you
2213 call the compiler the same way as for compiling C programs (usually
2214 with the name @command{gcc}).
2216 @findex g++
2217 @findex c++
2218 However, the use of @command{gcc} does not add the C++ library.
2219 @command{g++} is a program that calls GCC and automatically specifies linking
2220 against the C++ library.  It treats @samp{.c},
2221 @samp{.h} and @samp{.i} files as C++ source files instead of C source
2222 files unless @option{-x} is used.  This program is also useful when
2223 precompiling a C header file with a @samp{.h} extension for use in C++
2224 compilations.  On many systems, @command{g++} is also installed with
2225 the name @command{c++}.
2227 @cindex invoking @command{g++}
2228 When you compile C++ programs, you may specify many of the same
2229 command-line options that you use for compiling programs in any
2230 language; or command-line options meaningful for C and related
2231 languages; or options that are meaningful only for C++ programs.
2232 @xref{C Dialect Options,,Options Controlling C Dialect}, for
2233 explanations of options for languages related to C@.
2234 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
2235 explanations of options that are meaningful only for C++ programs.
2237 @node C Dialect Options
2238 @section Options Controlling C Dialect
2239 @cindex dialect options
2240 @cindex language dialect options
2241 @cindex options, dialect
2243 The following options control the dialect of C (or languages derived
2244 from C, such as C++, Objective-C and Objective-C++) that the compiler
2245 accepts:
2247 @table @gcctabopt
2248 @cindex ANSI support
2249 @cindex ISO support
2250 @item -ansi
2251 @opindex ansi
2252 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
2253 equivalent to @option{-std=c++98}.
2255 This turns off certain features of GCC that are incompatible with ISO
2256 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
2257 such as the @code{asm} and @code{typeof} keywords, and
2258 predefined macros such as @code{unix} and @code{vax} that identify the
2259 type of system you are using.  It also enables the undesirable and
2260 rarely used ISO trigraph feature.  For the C compiler,
2261 it disables recognition of C++ style @samp{//} comments as well as
2262 the @code{inline} keyword.
2264 The alternate keywords @code{__asm__}, @code{__extension__},
2265 @code{__inline__} and @code{__typeof__} continue to work despite
2266 @option{-ansi}.  You would not want to use them in an ISO C program, of
2267 course, but it is useful to put them in header files that might be included
2268 in compilations done with @option{-ansi}.  Alternate predefined macros
2269 such as @code{__unix__} and @code{__vax__} are also available, with or
2270 without @option{-ansi}.
2272 The @option{-ansi} option does not cause non-ISO programs to be
2273 rejected gratuitously.  For that, @option{-Wpedantic} is required in
2274 addition to @option{-ansi}.  @xref{Warning Options}.
2276 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
2277 option is used.  Some header files may notice this macro and refrain
2278 from declaring certain functions or defining certain macros that the
2279 ISO standard doesn't call for; this is to avoid interfering with any
2280 programs that might use these names for other things.
2282 Functions that are normally built in but do not have semantics
2283 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
2284 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
2285 built-in functions provided by GCC}, for details of the functions
2286 affected.
2288 @item -std=
2289 @opindex std
2290 Determine the language standard. @xref{Standards,,Language Standards
2291 Supported by GCC}, for details of these standard versions.  This option
2292 is currently only supported when compiling C or C++.
2294 The compiler can accept several base standards, such as @samp{c90} or
2295 @samp{c++98}, and GNU dialects of those standards, such as
2296 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
2297 compiler accepts all programs following that standard plus those
2298 using GNU extensions that do not contradict it.  For example,
2299 @option{-std=c90} turns off certain features of GCC that are
2300 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
2301 keywords, but not other GNU extensions that do not have a meaning in
2302 ISO C90, such as omitting the middle term of a @code{?:}
2303 expression. On the other hand, when a GNU dialect of a standard is
2304 specified, all features supported by the compiler are enabled, even when
2305 those features change the meaning of the base standard.  As a result, some
2306 strict-conforming programs may be rejected.  The particular standard
2307 is used by @option{-Wpedantic} to identify which features are GNU
2308 extensions given that version of the standard. For example
2309 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
2310 comments, while @option{-std=gnu99 -Wpedantic} does not.
2312 A value for this option must be provided; possible values are
2314 @table @samp
2315 @item c90
2316 @itemx c89
2317 @itemx iso9899:1990
2318 Support all ISO C90 programs (certain GNU extensions that conflict
2319 with ISO C90 are disabled). Same as @option{-ansi} for C code.
2321 @item iso9899:199409
2322 ISO C90 as modified in amendment 1.
2324 @item c99
2325 @itemx c9x
2326 @itemx iso9899:1999
2327 @itemx iso9899:199x
2328 ISO C99.  This standard is substantially completely supported, modulo
2329 bugs and floating-point issues
2330 (mainly but not entirely relating to optional C99 features from
2331 Annexes F and G).  See
2332 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
2333 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
2335 @item c11
2336 @itemx c1x
2337 @itemx iso9899:2011
2338 ISO C11, the 2011 revision of the ISO C standard.  This standard is
2339 substantially completely supported, modulo bugs, floating-point issues
2340 (mainly but not entirely relating to optional C11 features from
2341 Annexes F and G) and the optional Annexes K (Bounds-checking
2342 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
2344 @item c17
2345 @itemx c18
2346 @itemx iso9899:2017
2347 @itemx iso9899:2018
2348 ISO C17, the 2017 revision of the ISO C standard
2349 (published in 2018).  This standard is
2350 same as C11 except for corrections of defects (all of which are also
2351 applied with @option{-std=c11}) and a new value of
2352 @code{__STDC_VERSION__}, and so is supported to the same extent as C11.
2354 @item c2x
2355 The next version of the ISO C standard, still under development.  The
2356 support for this version is experimental and incomplete.
2358 @item gnu90
2359 @itemx gnu89
2360 GNU dialect of ISO C90 (including some C99 features).
2362 @item gnu99
2363 @itemx gnu9x
2364 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
2366 @item gnu11
2367 @itemx gnu1x
2368 GNU dialect of ISO C11.
2369 The name @samp{gnu1x} is deprecated.
2371 @item gnu17
2372 @itemx gnu18
2373 GNU dialect of ISO C17.  This is the default for C code.
2375 @item gnu2x
2376 The next version of the ISO C standard, still under development, plus
2377 GNU extensions.  The support for this version is experimental and
2378 incomplete.
2380 @item c++98
2381 @itemx c++03
2382 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
2383 additional defect reports. Same as @option{-ansi} for C++ code.
2385 @item gnu++98
2386 @itemx gnu++03
2387 GNU dialect of @option{-std=c++98}.
2389 @item c++11
2390 @itemx c++0x
2391 The 2011 ISO C++ standard plus amendments.
2392 The name @samp{c++0x} is deprecated.
2394 @item gnu++11
2395 @itemx gnu++0x
2396 GNU dialect of @option{-std=c++11}.
2397 The name @samp{gnu++0x} is deprecated.
2399 @item c++14
2400 @itemx c++1y
2401 The 2014 ISO C++ standard plus amendments.
2402 The name @samp{c++1y} is deprecated.
2404 @item gnu++14
2405 @itemx gnu++1y
2406 GNU dialect of @option{-std=c++14}.
2407 The name @samp{gnu++1y} is deprecated.
2409 @item c++17
2410 @itemx c++1z
2411 The 2017 ISO C++ standard plus amendments.
2412 The name @samp{c++1z} is deprecated.
2414 @item gnu++17
2415 @itemx gnu++1z
2416 GNU dialect of @option{-std=c++17}.
2417 This is the default for C++ code.
2418 The name @samp{gnu++1z} is deprecated.
2420 @item c++20
2421 @itemx c++2a
2422 The 2020 ISO C++ standard plus amendments.
2423 Support is experimental, and could change in incompatible ways in
2424 future releases.
2425 The name @samp{c++2a} is deprecated.
2427 @item gnu++20
2428 @itemx gnu++2a
2429 GNU dialect of @option{-std=c++20}.
2430 Support is experimental, and could change in incompatible ways in
2431 future releases.
2432 The name @samp{gnu++2a} is deprecated.
2433 @end table
2435 @item -fgnu89-inline
2436 @opindex fgnu89-inline
2437 The option @option{-fgnu89-inline} tells GCC to use the traditional
2438 GNU semantics for @code{inline} functions when in C99 mode.
2439 @xref{Inline,,An Inline Function is As Fast As a Macro}.
2440 Using this option is roughly equivalent to adding the
2441 @code{gnu_inline} function attribute to all inline functions
2442 (@pxref{Function Attributes}).
2444 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
2445 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
2446 specifies the default behavior).
2447 This option is not supported in @option{-std=c90} or
2448 @option{-std=gnu90} mode.
2450 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
2451 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
2452 in effect for @code{inline} functions.  @xref{Common Predefined
2453 Macros,,,cpp,The C Preprocessor}.
2455 @item -fpermitted-flt-eval-methods=@var{style}
2456 @opindex fpermitted-flt-eval-methods
2457 @opindex fpermitted-flt-eval-methods=c11
2458 @opindex fpermitted-flt-eval-methods=ts-18661-3
2459 ISO/IEC TS 18661-3 defines new permissible values for
2460 @code{FLT_EVAL_METHOD} that indicate that operations and constants with
2461 a semantic type that is an interchange or extended format should be
2462 evaluated to the precision and range of that type.  These new values are
2463 a superset of those permitted under C99/C11, which does not specify the
2464 meaning of other positive values of @code{FLT_EVAL_METHOD}.  As such, code
2465 conforming to C11 may not have been written expecting the possibility of
2466 the new values.
2468 @option{-fpermitted-flt-eval-methods} specifies whether the compiler
2469 should allow only the values of @code{FLT_EVAL_METHOD} specified in C99/C11,
2470 or the extended set of values specified in ISO/IEC TS 18661-3.
2472 @var{style} is either @code{c11} or @code{ts-18661-3} as appropriate.
2474 The default when in a standards compliant mode (@option{-std=c11} or similar)
2475 is @option{-fpermitted-flt-eval-methods=c11}.  The default when in a GNU
2476 dialect (@option{-std=gnu11} or similar) is
2477 @option{-fpermitted-flt-eval-methods=ts-18661-3}.
2479 @item -aux-info @var{filename}
2480 @opindex aux-info
2481 Output to the given filename prototyped declarations for all functions
2482 declared and/or defined in a translation unit, including those in header
2483 files.  This option is silently ignored in any language other than C@.
2485 Besides declarations, the file indicates, in comments, the origin of
2486 each declaration (source file and line), whether the declaration was
2487 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
2488 @samp{O} for old, respectively, in the first character after the line
2489 number and the colon), and whether it came from a declaration or a
2490 definition (@samp{C} or @samp{F}, respectively, in the following
2491 character).  In the case of function definitions, a K&R-style list of
2492 arguments followed by their declarations is also provided, inside
2493 comments, after the declaration.
2495 @item -fallow-parameterless-variadic-functions
2496 @opindex fallow-parameterless-variadic-functions
2497 Accept variadic functions without named parameters.
2499 Although it is possible to define such a function, this is not very
2500 useful as it is not possible to read the arguments.  This is only
2501 supported for C as this construct is allowed by C++.
2503 @item -fno-asm
2504 @opindex fno-asm
2505 @opindex fasm
2506 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
2507 keyword, so that code can use these words as identifiers.  You can use
2508 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
2509 instead.  @option{-ansi} implies @option{-fno-asm}.
2511 In C++, this switch only affects the @code{typeof} keyword, since
2512 @code{asm} and @code{inline} are standard keywords.  You may want to
2513 use the @option{-fno-gnu-keywords} flag instead, which has the same
2514 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
2515 switch only affects the @code{asm} and @code{typeof} keywords, since
2516 @code{inline} is a standard keyword in ISO C99.
2518 @item -fno-builtin
2519 @itemx -fno-builtin-@var{function}
2520 @opindex fno-builtin
2521 @opindex fbuiltin
2522 @cindex built-in functions
2523 Don't recognize built-in functions that do not begin with
2524 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
2525 functions provided by GCC}, for details of the functions affected,
2526 including those which are not built-in functions when @option{-ansi} or
2527 @option{-std} options for strict ISO C conformance are used because they
2528 do not have an ISO standard meaning.
2530 GCC normally generates special code to handle certain built-in functions
2531 more efficiently; for instance, calls to @code{alloca} may become single
2532 instructions which adjust the stack directly, and calls to @code{memcpy}
2533 may become inline copy loops.  The resulting code is often both smaller
2534 and faster, but since the function calls no longer appear as such, you
2535 cannot set a breakpoint on those calls, nor can you change the behavior
2536 of the functions by linking with a different library.  In addition,
2537 when a function is recognized as a built-in function, GCC may use
2538 information about that function to warn about problems with calls to
2539 that function, or to generate more efficient code, even if the
2540 resulting code still contains calls to that function.  For example,
2541 warnings are given with @option{-Wformat} for bad calls to
2542 @code{printf} when @code{printf} is built in and @code{strlen} is
2543 known not to modify global memory.
2545 With the @option{-fno-builtin-@var{function}} option
2546 only the built-in function @var{function} is
2547 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
2548 function is named that is not built-in in this version of GCC, this
2549 option is ignored.  There is no corresponding
2550 @option{-fbuiltin-@var{function}} option; if you wish to enable
2551 built-in functions selectively when using @option{-fno-builtin} or
2552 @option{-ffreestanding}, you may define macros such as:
2554 @smallexample
2555 #define abs(n)          __builtin_abs ((n))
2556 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
2557 @end smallexample
2559 @item -fgimple
2560 @opindex fgimple
2562 Enable parsing of function definitions marked with @code{__GIMPLE}.
2563 This is an experimental feature that allows unit testing of GIMPLE
2564 passes.
2566 @item -fhosted
2567 @opindex fhosted
2568 @cindex hosted environment
2570 Assert that compilation targets a hosted environment.  This implies
2571 @option{-fbuiltin}.  A hosted environment is one in which the
2572 entire standard library is available, and in which @code{main} has a return
2573 type of @code{int}.  Examples are nearly everything except a kernel.
2574 This is equivalent to @option{-fno-freestanding}.
2576 @item -ffreestanding
2577 @opindex ffreestanding
2578 @cindex hosted environment
2580 Assert that compilation targets a freestanding environment.  This
2581 implies @option{-fno-builtin}.  A freestanding environment
2582 is one in which the standard library may not exist, and program startup may
2583 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
2584 This is equivalent to @option{-fno-hosted}.
2586 @xref{Standards,,Language Standards Supported by GCC}, for details of
2587 freestanding and hosted environments.
2589 @item -fopenacc
2590 @opindex fopenacc
2591 @cindex OpenACC accelerator programming
2592 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
2593 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
2594 compiler generates accelerated code according to the OpenACC Application
2595 Programming Interface v2.6 @w{@uref{https://www.openacc.org}}.  This option
2596 implies @option{-pthread}, and thus is only supported on targets that
2597 have support for @option{-pthread}.
2599 @item -fopenacc-dim=@var{geom}
2600 @opindex fopenacc-dim
2601 @cindex OpenACC accelerator programming
2602 Specify default compute dimensions for parallel offload regions that do
2603 not explicitly specify.  The @var{geom} value is a triple of
2604 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'.  A size
2605 can be omitted, to use a target-specific default value.
2607 @item -fopenacc-kernels=@var{mode}
2608 @opindex fopenacc-kernels
2609 @cindex OpenACC accelerator programming
2610 Specify mode of OpenACC `kernels' constructs handling.
2611 With @option{-fopenacc-kernels=decompose}, OpenACC `kernels'
2612 constructs are decomposed into parts, a sequence of compute
2613 constructs, each then handled individually.
2614 This is work in progress.
2615 With @option{-fopenacc-kernels=parloops}, OpenACC `kernels' constructs
2616 are handled by the @samp{parloops} pass, en bloc.
2617 This is the current default.
2619 @item -fopenmp
2620 @opindex fopenmp
2621 @cindex OpenMP parallel
2622 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
2623 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
2624 compiler generates parallel code according to the OpenMP Application
2625 Program Interface v4.5 @w{@uref{https://www.openmp.org}}.  This option
2626 implies @option{-pthread}, and thus is only supported on targets that
2627 have support for @option{-pthread}. @option{-fopenmp} implies
2628 @option{-fopenmp-simd}.
2630 @item -fopenmp-simd
2631 @opindex fopenmp-simd
2632 @cindex OpenMP SIMD
2633 @cindex SIMD
2634 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
2635 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
2636 are ignored.
2638 @item -fgnu-tm
2639 @opindex fgnu-tm
2640 When the option @option{-fgnu-tm} is specified, the compiler
2641 generates code for the Linux variant of Intel's current Transactional
2642 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
2643 an experimental feature whose interface may change in future versions
2644 of GCC, as the official specification changes.  Please note that not
2645 all architectures are supported for this feature.
2647 For more information on GCC's support for transactional memory,
2648 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
2649 Transactional Memory Library}.
2651 Note that the transactional memory feature is not supported with
2652 non-call exceptions (@option{-fnon-call-exceptions}).
2654 @item -fms-extensions
2655 @opindex fms-extensions
2656 Accept some non-standard constructs used in Microsoft header files.
2658 In C++ code, this allows member names in structures to be similar
2659 to previous types declarations.
2661 @smallexample
2662 typedef int UOW;
2663 struct ABC @{
2664   UOW UOW;
2666 @end smallexample
2668 Some cases of unnamed fields in structures and unions are only
2669 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
2670 fields within structs/unions}, for details.
2672 Note that this option is off for all targets except for x86
2673 targets using ms-abi.
2675 @item -fplan9-extensions
2676 @opindex fplan9-extensions
2677 Accept some non-standard constructs used in Plan 9 code.
2679 This enables @option{-fms-extensions}, permits passing pointers to
2680 structures with anonymous fields to functions that expect pointers to
2681 elements of the type of the field, and permits referring to anonymous
2682 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2683 struct/union fields within structs/unions}, for details.  This is only
2684 supported for C, not C++.
2686 @item -fcond-mismatch
2687 @opindex fcond-mismatch
2688 Allow conditional expressions with mismatched types in the second and
2689 third arguments.  The value of such an expression is void.  This option
2690 is not supported for C++.
2692 @item -flax-vector-conversions
2693 @opindex flax-vector-conversions
2694 Allow implicit conversions between vectors with differing numbers of
2695 elements and/or incompatible element types.  This option should not be
2696 used for new code.
2698 @item -funsigned-char
2699 @opindex funsigned-char
2700 Let the type @code{char} be unsigned, like @code{unsigned char}.
2702 Each kind of machine has a default for what @code{char} should
2703 be.  It is either like @code{unsigned char} by default or like
2704 @code{signed char} by default.
2706 Ideally, a portable program should always use @code{signed char} or
2707 @code{unsigned char} when it depends on the signedness of an object.
2708 But many programs have been written to use plain @code{char} and
2709 expect it to be signed, or expect it to be unsigned, depending on the
2710 machines they were written for.  This option, and its inverse, let you
2711 make such a program work with the opposite default.
2713 The type @code{char} is always a distinct type from each of
2714 @code{signed char} or @code{unsigned char}, even though its behavior
2715 is always just like one of those two.
2717 @item -fsigned-char
2718 @opindex fsigned-char
2719 Let the type @code{char} be signed, like @code{signed char}.
2721 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2722 the negative form of @option{-funsigned-char}.  Likewise, the option
2723 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2725 @item -fsigned-bitfields
2726 @itemx -funsigned-bitfields
2727 @itemx -fno-signed-bitfields
2728 @itemx -fno-unsigned-bitfields
2729 @opindex fsigned-bitfields
2730 @opindex funsigned-bitfields
2731 @opindex fno-signed-bitfields
2732 @opindex fno-unsigned-bitfields
2733 These options control whether a bit-field is signed or unsigned, when the
2734 declaration does not use either @code{signed} or @code{unsigned}.  By
2735 default, such a bit-field is signed, because this is consistent: the
2736 basic integer types such as @code{int} are signed types.
2738 @item -fsso-struct=@var{endianness}
2739 @opindex fsso-struct
2740 Set the default scalar storage order of structures and unions to the
2741 specified endianness.  The accepted values are @samp{big-endian},
2742 @samp{little-endian} and @samp{native} for the native endianness of
2743 the target (the default).  This option is not supported for C++.
2745 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2746 code that is not binary compatible with code generated without it if the
2747 specified endianness is not the native endianness of the target.
2748 @end table
2750 @node C++ Dialect Options
2751 @section Options Controlling C++ Dialect
2753 @cindex compiler options, C++
2754 @cindex C++ options, command-line
2755 @cindex options, C++
2756 This section describes the command-line options that are only meaningful
2757 for C++ programs.  You can also use most of the GNU compiler options
2758 regardless of what language your program is in.  For example, you
2759 might compile a file @file{firstClass.C} like this:
2761 @smallexample
2762 g++ -g -fstrict-enums -O -c firstClass.C
2763 @end smallexample
2765 @noindent
2766 In this example, only @option{-fstrict-enums} is an option meant
2767 only for C++ programs; you can use the other options with any
2768 language supported by GCC@.
2770 Some options for compiling C programs, such as @option{-std}, are also
2771 relevant for C++ programs.
2772 @xref{C Dialect Options,,Options Controlling C Dialect}.
2774 Here is a list of options that are @emph{only} for compiling C++ programs:
2776 @table @gcctabopt
2778 @item -fabi-version=@var{n}
2779 @opindex fabi-version
2780 Use version @var{n} of the C++ ABI@.  The default is version 0.
2782 Version 0 refers to the version conforming most closely to
2783 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2784 will change in different versions of G++ as ABI bugs are fixed.
2786 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2788 Version 2 is the version of the C++ ABI that first appeared in G++
2789 3.4, and was the default through G++ 4.9.
2791 Version 3 corrects an error in mangling a constant address as a
2792 template argument.
2794 Version 4, which first appeared in G++ 4.5, implements a standard
2795 mangling for vector types.
2797 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2798 attribute const/volatile on function pointer types, decltype of a
2799 plain decl, and use of a function parameter in the declaration of
2800 another parameter.
2802 Version 6, which first appeared in G++ 4.7, corrects the promotion
2803 behavior of C++11 scoped enums and the mangling of template argument
2804 packs, const/static_cast, prefix ++ and --, and a class scope function
2805 used as a template argument.
2807 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2808 builtin type and corrects the mangling of lambdas in default argument
2809 scope.
2811 Version 8, which first appeared in G++ 4.9, corrects the substitution
2812 behavior of function types with function-cv-qualifiers.
2814 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2815 @code{nullptr_t}.
2817 Version 10, which first appeared in G++ 6.1, adds mangling of
2818 attributes that affect type identity, such as ia32 calling convention
2819 attributes (e.g.@: @samp{stdcall}).
2821 Version 11, which first appeared in G++ 7, corrects the mangling of
2822 sizeof... expressions and operator names.  For multiple entities with
2823 the same name within a function, that are declared in different scopes,
2824 the mangling now changes starting with the twelfth occurrence.  It also
2825 implies @option{-fnew-inheriting-ctors}.
2827 Version 12, which first appeared in G++ 8, corrects the calling
2828 conventions for empty classes on the x86_64 target and for classes
2829 with only deleted copy/move constructors.  It accidentally changes the
2830 calling convention for classes with a deleted copy constructor and a
2831 trivial move constructor.
2833 Version 13, which first appeared in G++ 8.2, fixes the accidental
2834 change in version 12.
2836 Version 14, which first appeared in G++ 10, corrects the mangling of
2837 the nullptr expression.
2839 Version 15, which first appeared in G++ 11, changes the mangling of
2840 @code{__alignof__} to be distinct from that of @code{alignof}.
2842 See also @option{-Wabi}.
2844 @item -fabi-compat-version=@var{n}
2845 @opindex fabi-compat-version
2846 On targets that support strong aliases, G++
2847 works around mangling changes by creating an alias with the correct
2848 mangled name when defining a symbol with an incorrect mangled name.
2849 This switch specifies which ABI version to use for the alias.
2851 With @option{-fabi-version=0} (the default), this defaults to 11 (GCC 7
2852 compatibility).  If another ABI version is explicitly selected, this
2853 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2854 use @option{-fabi-compat-version=2}.
2856 If this option is not provided but @option{-Wabi=@var{n}} is, that
2857 version is used for compatibility aliases.  If this option is provided
2858 along with @option{-Wabi} (without the version), the version from this
2859 option is used for the warning.
2861 @item -fno-access-control
2862 @opindex fno-access-control
2863 @opindex faccess-control
2864 Turn off all access checking.  This switch is mainly useful for working
2865 around bugs in the access control code.
2867 @item -faligned-new
2868 @opindex faligned-new
2869 Enable support for C++17 @code{new} of types that require more
2870 alignment than @code{void* ::operator new(std::size_t)} provides.  A
2871 numeric argument such as @code{-faligned-new=32} can be used to
2872 specify how much alignment (in bytes) is provided by that function,
2873 but few users will need to override the default of
2874 @code{alignof(std::max_align_t)}.
2876 This flag is enabled by default for @option{-std=c++17}.
2878 @item -fchar8_t
2879 @itemx -fno-char8_t
2880 @opindex fchar8_t
2881 @opindex fno-char8_t
2882 Enable support for @code{char8_t} as adopted for C++20.  This includes
2883 the addition of a new @code{char8_t} fundamental type, changes to the
2884 types of UTF-8 string and character literals, new signatures for
2885 user-defined literals, associated standard library updates, and new
2886 @code{__cpp_char8_t} and @code{__cpp_lib_char8_t} feature test macros.
2888 This option enables functions to be overloaded for ordinary and UTF-8
2889 strings:
2891 @smallexample
2892 int f(const char *);    // #1
2893 int f(const char8_t *); // #2
2894 int v1 = f("text");     // Calls #1
2895 int v2 = f(u8"text");   // Calls #2
2896 @end smallexample
2898 @noindent
2899 and introduces new signatures for user-defined literals:
2901 @smallexample
2902 int operator""_udl1(char8_t);
2903 int v3 = u8'x'_udl1;
2904 int operator""_udl2(const char8_t*, std::size_t);
2905 int v4 = u8"text"_udl2;
2906 template<typename T, T...> int operator""_udl3();
2907 int v5 = u8"text"_udl3;
2908 @end smallexample
2910 @noindent
2911 The change to the types of UTF-8 string and character literals introduces
2912 incompatibilities with ISO C++11 and later standards.  For example, the
2913 following code is well-formed under ISO C++11, but is ill-formed when
2914 @option{-fchar8_t} is specified.
2916 @smallexample
2917 char ca[] = u8"xx";     // error: char-array initialized from wide
2918                         //        string
2919 const char *cp = u8"xx";// error: invalid conversion from
2920                         //        `const char8_t*' to `const char*'
2921 int f(const char*);
2922 auto v = f(u8"xx");     // error: invalid conversion from
2923                         //        `const char8_t*' to `const char*'
2924 std::string s@{u8"xx"@};  // error: no matching function for call to
2925                         //        `std::basic_string<char>::basic_string()'
2926 using namespace std::literals;
2927 s = u8"xx"s;            // error: conversion from
2928                         //        `basic_string<char8_t>' to non-scalar
2929                         //        type `basic_string<char>' requested
2930 @end smallexample
2932 @item -fcheck-new
2933 @opindex fcheck-new
2934 Check that the pointer returned by @code{operator new} is non-null
2935 before attempting to modify the storage allocated.  This check is
2936 normally unnecessary because the C++ standard specifies that
2937 @code{operator new} only returns @code{0} if it is declared
2938 @code{throw()}, in which case the compiler always checks the
2939 return value even without this option.  In all other cases, when
2940 @code{operator new} has a non-empty exception specification, memory
2941 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2942 @samp{new (nothrow)}.
2944 @item -fconcepts
2945 @itemx -fconcepts-ts
2946 @opindex fconcepts
2947 @opindex fconcepts-ts
2948 Below @option{-std=c++20}, @option{-fconcepts} enables support for the
2949 C++ Extensions for Concepts Technical Specification, ISO 19217 (2015).
2951 With @option{-std=c++20} and above, Concepts are part of the language
2952 standard, so @option{-fconcepts} defaults to on.  But the standard
2953 specification of Concepts differs significantly from the TS, so some
2954 constructs that were allowed in the TS but didn't make it into the
2955 standard can still be enabled by @option{-fconcepts-ts}.
2957 @item -fconstexpr-depth=@var{n}
2958 @opindex fconstexpr-depth
2959 Set the maximum nested evaluation depth for C++11 constexpr functions
2960 to @var{n}.  A limit is needed to detect endless recursion during
2961 constant expression evaluation.  The minimum specified by the standard
2962 is 512.
2964 @item -fconstexpr-cache-depth=@var{n}
2965 @opindex fconstexpr-cache-depth
2966 Set the maximum level of nested evaluation depth for C++11 constexpr
2967 functions that will be cached to @var{n}.  This is a heuristic that
2968 trades off compilation speed (when the cache avoids repeated
2969 calculations) against memory consumption (when the cache grows very
2970 large from highly recursive evaluations).  The default is 8.  Very few
2971 users are likely to want to adjust it, but if your code does heavy
2972 constexpr calculations you might want to experiment to find which
2973 value works best for you.
2975 @item -fconstexpr-loop-limit=@var{n}
2976 @opindex fconstexpr-loop-limit
2977 Set the maximum number of iterations for a loop in C++14 constexpr functions
2978 to @var{n}.  A limit is needed to detect infinite loops during
2979 constant expression evaluation.  The default is 262144 (1<<18).
2981 @item -fconstexpr-ops-limit=@var{n}
2982 @opindex fconstexpr-ops-limit
2983 Set the maximum number of operations during a single constexpr evaluation.
2984 Even when number of iterations of a single loop is limited with the above limit,
2985 if there are several nested loops and each of them has many iterations but still
2986 smaller than the above limit, or if in a body of some loop or even outside
2987 of a loop too many expressions need to be evaluated, the resulting constexpr
2988 evaluation might take too long.
2989 The default is 33554432 (1<<25).
2991 @item -fcoroutines
2992 @opindex fcoroutines
2993 Enable support for the C++ coroutines extension (experimental).
2995 @item -fno-elide-constructors
2996 @opindex fno-elide-constructors
2997 @opindex felide-constructors
2998 The C++ standard allows an implementation to omit creating a temporary
2999 that is only used to initialize another object of the same type.
3000 Specifying this option disables that optimization, and forces G++ to
3001 call the copy constructor in all cases.  This option also causes G++
3002 to call trivial member functions which otherwise would be expanded inline.
3004 In C++17, the compiler is required to omit these temporaries, but this
3005 option still affects trivial member functions.
3007 @item -fno-enforce-eh-specs
3008 @opindex fno-enforce-eh-specs
3009 @opindex fenforce-eh-specs
3010 Don't generate code to check for violation of exception specifications
3011 at run time.  This option violates the C++ standard, but may be useful
3012 for reducing code size in production builds, much like defining
3013 @code{NDEBUG}.  This does not give user code permission to throw
3014 exceptions in violation of the exception specifications; the compiler
3015 still optimizes based on the specifications, so throwing an
3016 unexpected exception results in undefined behavior at run time.
3018 @item -fextern-tls-init
3019 @itemx -fno-extern-tls-init
3020 @opindex fextern-tls-init
3021 @opindex fno-extern-tls-init
3022 The C++11 and OpenMP standards allow @code{thread_local} and
3023 @code{threadprivate} variables to have dynamic (runtime)
3024 initialization.  To support this, any use of such a variable goes
3025 through a wrapper function that performs any necessary initialization.
3026 When the use and definition of the variable are in the same
3027 translation unit, this overhead can be optimized away, but when the
3028 use is in a different translation unit there is significant overhead
3029 even if the variable doesn't actually need dynamic initialization.  If
3030 the programmer can be sure that no use of the variable in a
3031 non-defining TU needs to trigger dynamic initialization (either
3032 because the variable is statically initialized, or a use of the
3033 variable in the defining TU will be executed before any uses in
3034 another TU), they can avoid this overhead with the
3035 @option{-fno-extern-tls-init} option.
3037 On targets that support symbol aliases, the default is
3038 @option{-fextern-tls-init}.  On targets that do not support symbol
3039 aliases, the default is @option{-fno-extern-tls-init}.
3041 @item -fno-gnu-keywords
3042 @opindex fno-gnu-keywords
3043 @opindex fgnu-keywords
3044 Do not recognize @code{typeof} as a keyword, so that code can use this
3045 word as an identifier.  You can use the keyword @code{__typeof__} instead.
3046 This option is implied by the strict ISO C++ dialects: @option{-ansi},
3047 @option{-std=c++98}, @option{-std=c++11}, etc.
3049 @item -fno-implicit-templates
3050 @opindex fno-implicit-templates
3051 @opindex fimplicit-templates
3052 Never emit code for non-inline templates that are instantiated
3053 implicitly (i.e.@: by use); only emit code for explicit instantiations.
3054 If you use this option, you must take care to structure your code to
3055 include all the necessary explicit instantiations to avoid getting
3056 undefined symbols at link time.
3057 @xref{Template Instantiation}, for more information.
3059 @item -fno-implicit-inline-templates
3060 @opindex fno-implicit-inline-templates
3061 @opindex fimplicit-inline-templates
3062 Don't emit code for implicit instantiations of inline templates, either.
3063 The default is to handle inlines differently so that compiles with and
3064 without optimization need the same set of explicit instantiations.
3066 @item -fno-implement-inlines
3067 @opindex fno-implement-inlines
3068 @opindex fimplement-inlines
3069 To save space, do not emit out-of-line copies of inline functions
3070 controlled by @code{#pragma implementation}.  This causes linker
3071 errors if these functions are not inlined everywhere they are called.
3073 @item -fmodules-ts
3074 @itemx -fno-modules-ts
3075 @opindex fmodules-ts
3076 @opindex fno-modules-ts
3077 Enable support for C++20 modules (@xref{C++ Modules}).  The
3078 @option{-fno-modules-ts} is usually not needed, as that is the
3079 default.  Even though this is a C++20 feature, it is not currently
3080 implicitly enabled by selecting that standard version.
3082 @item -fmodule-header
3083 @itemx -fmodule-header=user
3084 @itemx -fmodule-header=system
3085 @opindex fmodule-header
3086 Compile a header file to create an importable header unit.
3088 @item -fmodule-implicit-inline
3089 @opindex fmodule-implicit-inline
3090 Member functions defined in their class definitions are not implicitly
3091 inline for modular code.  This is different to traditional C++
3092 behavior, for good reasons.  However, it may result in a difficulty
3093 during code porting.  This option makes such function definitions
3094 implicitly inline.  It does however generate an ABI incompatibility,
3095 so you must use it everywhere or nowhere.  (Such definitions outside
3096 of a named module remain implicitly inline, regardless.)
3098 @item -fno-module-lazy
3099 @opindex fno-module-lazy
3100 @opindex fmodule-lazy
3101 Disable lazy module importing and module mapper creation.
3103 @item -fmodule-mapper=@r{[}@var{hostname}@r{]}:@var{port}@r{[}?@var{ident}@r{]}
3104 @itemx -fmodule-mapper=|@var{program}@r{[}?@var{ident}@r{]} @var{args...}
3105 @itemx -fmodule-mapper==@var{socket}@r{[}?@var{ident}@r{]}
3106 @itemx -fmodule-mapper=<>@r{[}@var{inout}@r{]}@r{[}?@var{ident}@r{]}
3107 @itemx -fmodule-mapper=<@var{in}>@var{out}@r{[}?@var{ident}@r{]}
3108 @itemx -fmodule-mapper=@var{file}@r{[}?@var{ident}@r{]}
3109 @vindex CXX_MODULE_MAPPER @r{environment variable}
3110 @opindex fmodule-mapper
3111 An oracle to query for module name to filename mappings.  If
3112 unspecified the @env{CXX_MODULE_MAPPER} environment variable is used,
3113 and if that is unset, an in-process default is provided.
3115 @item -fmodule-only
3116 @opindex fmodule-only
3117 Only emit the Compiled Module Interface, inhibiting any object file.
3119 @item -fms-extensions
3120 @opindex fms-extensions
3121 Disable Wpedantic warnings about constructs used in MFC, such as implicit
3122 int and getting a pointer to member function via non-standard syntax.
3124 @item -fnew-inheriting-ctors
3125 @opindex fnew-inheriting-ctors
3126 Enable the P0136 adjustment to the semantics of C++11 constructor
3127 inheritance.  This is part of C++17 but also considered to be a Defect
3128 Report against C++11 and C++14.  This flag is enabled by default
3129 unless @option{-fabi-version=10} or lower is specified.
3131 @item -fnew-ttp-matching
3132 @opindex fnew-ttp-matching
3133 Enable the P0522 resolution to Core issue 150, template template
3134 parameters and default arguments: this allows a template with default
3135 template arguments as an argument for a template template parameter
3136 with fewer template parameters.  This flag is enabled by default for
3137 @option{-std=c++17}.
3139 @item -fno-nonansi-builtins
3140 @opindex fno-nonansi-builtins
3141 @opindex fnonansi-builtins
3142 Disable built-in declarations of functions that are not mandated by
3143 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
3144 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
3146 @item -fnothrow-opt
3147 @opindex fnothrow-opt
3148 Treat a @code{throw()} exception specification as if it were a
3149 @code{noexcept} specification to reduce or eliminate the text size
3150 overhead relative to a function with no exception specification.  If
3151 the function has local variables of types with non-trivial
3152 destructors, the exception specification actually makes the
3153 function smaller because the EH cleanups for those variables can be
3154 optimized away.  The semantic effect is that an exception thrown out of
3155 a function with such an exception specification results in a call
3156 to @code{terminate} rather than @code{unexpected}.
3158 @item -fno-operator-names
3159 @opindex fno-operator-names
3160 @opindex foperator-names
3161 Do not treat the operator name keywords @code{and}, @code{bitand},
3162 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
3163 synonyms as keywords.
3165 @item -fno-optional-diags
3166 @opindex fno-optional-diags
3167 @opindex foptional-diags
3168 Disable diagnostics that the standard says a compiler does not need to
3169 issue.  Currently, the only such diagnostic issued by G++ is the one for
3170 a name having multiple meanings within a class.
3172 @item -fpermissive
3173 @opindex fpermissive
3174 Downgrade some diagnostics about nonconformant code from errors to
3175 warnings.  Thus, using @option{-fpermissive} allows some
3176 nonconforming code to compile.
3178 @item -fno-pretty-templates
3179 @opindex fno-pretty-templates
3180 @opindex fpretty-templates
3181 When an error message refers to a specialization of a function
3182 template, the compiler normally prints the signature of the
3183 template followed by the template arguments and any typedefs or
3184 typenames in the signature (e.g.@: @code{void f(T) [with T = int]}
3185 rather than @code{void f(int)}) so that it's clear which template is
3186 involved.  When an error message refers to a specialization of a class
3187 template, the compiler omits any template arguments that match
3188 the default template arguments for that template.  If either of these
3189 behaviors make it harder to understand the error message rather than
3190 easier, you can use @option{-fno-pretty-templates} to disable them.
3192 @item -fno-rtti
3193 @opindex fno-rtti
3194 @opindex frtti
3195 Disable generation of information about every class with virtual
3196 functions for use by the C++ run-time type identification features
3197 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
3198 of the language, you can save some space by using this flag.  Note that
3199 exception handling uses the same information, but G++ generates it as
3200 needed. The @code{dynamic_cast} operator can still be used for casts that
3201 do not require run-time type information, i.e.@: casts to @code{void *} or to
3202 unambiguous base classes.
3204 Mixing code compiled with @option{-frtti} with that compiled with
3205 @option{-fno-rtti} may not work.  For example, programs may
3206 fail to link if a class compiled with @option{-fno-rtti} is used as a base 
3207 for a class compiled with @option{-frtti}.  
3209 @item -fsized-deallocation
3210 @opindex fsized-deallocation
3211 Enable the built-in global declarations
3212 @smallexample
3213 void operator delete (void *, std::size_t) noexcept;
3214 void operator delete[] (void *, std::size_t) noexcept;
3215 @end smallexample
3216 as introduced in C++14.  This is useful for user-defined replacement
3217 deallocation functions that, for example, use the size of the object
3218 to make deallocation faster.  Enabled by default under
3219 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
3220 warns about places that might want to add a definition.
3222 @item -fstrict-enums
3223 @opindex fstrict-enums
3224 Allow the compiler to optimize using the assumption that a value of
3225 enumerated type can only be one of the values of the enumeration (as
3226 defined in the C++ standard; basically, a value that can be
3227 represented in the minimum number of bits needed to represent all the
3228 enumerators).  This assumption may not be valid if the program uses a
3229 cast to convert an arbitrary integer value to the enumerated type.
3231 @item -fstrong-eval-order
3232 @opindex fstrong-eval-order
3233 Evaluate member access, array subscripting, and shift expressions in
3234 left-to-right order, and evaluate assignment in right-to-left order,
3235 as adopted for C++17.  Enabled by default with @option{-std=c++17}.
3236 @option{-fstrong-eval-order=some} enables just the ordering of member
3237 access and shift expressions, and is the default without
3238 @option{-std=c++17}.
3240 @item -ftemplate-backtrace-limit=@var{n}
3241 @opindex ftemplate-backtrace-limit
3242 Set the maximum number of template instantiation notes for a single
3243 warning or error to @var{n}.  The default value is 10.
3245 @item -ftemplate-depth=@var{n}
3246 @opindex ftemplate-depth
3247 Set the maximum instantiation depth for template classes to @var{n}.
3248 A limit on the template instantiation depth is needed to detect
3249 endless recursions during template class instantiation.  ANSI/ISO C++
3250 conforming programs must not rely on a maximum depth greater than 17
3251 (changed to 1024 in C++11).  The default value is 900, as the compiler
3252 can run out of stack space before hitting 1024 in some situations.
3254 @item -fno-threadsafe-statics
3255 @opindex fno-threadsafe-statics
3256 @opindex fthreadsafe-statics
3257 Do not emit the extra code to use the routines specified in the C++
3258 ABI for thread-safe initialization of local statics.  You can use this
3259 option to reduce code size slightly in code that doesn't need to be
3260 thread-safe.
3262 @item -fuse-cxa-atexit
3263 @opindex fuse-cxa-atexit
3264 Register destructors for objects with static storage duration with the
3265 @code{__cxa_atexit} function rather than the @code{atexit} function.
3266 This option is required for fully standards-compliant handling of static
3267 destructors, but only works if your C library supports
3268 @code{__cxa_atexit}.
3270 @item -fno-use-cxa-get-exception-ptr
3271 @opindex fno-use-cxa-get-exception-ptr
3272 @opindex fuse-cxa-get-exception-ptr
3273 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
3274 causes @code{std::uncaught_exception} to be incorrect, but is necessary
3275 if the runtime routine is not available.
3277 @item -fvisibility-inlines-hidden
3278 @opindex fvisibility-inlines-hidden
3279 This switch declares that the user does not attempt to compare
3280 pointers to inline functions or methods where the addresses of the two functions
3281 are taken in different shared objects.
3283 The effect of this is that GCC may, effectively, mark inline methods with
3284 @code{__attribute__ ((visibility ("hidden")))} so that they do not
3285 appear in the export table of a DSO and do not require a PLT indirection
3286 when used within the DSO@.  Enabling this option can have a dramatic effect
3287 on load and link times of a DSO as it massively reduces the size of the
3288 dynamic export table when the library makes heavy use of templates.
3290 The behavior of this switch is not quite the same as marking the
3291 methods as hidden directly, because it does not affect static variables
3292 local to the function or cause the compiler to deduce that
3293 the function is defined in only one shared object.
3295 You may mark a method as having a visibility explicitly to negate the
3296 effect of the switch for that method.  For example, if you do want to
3297 compare pointers to a particular inline method, you might mark it as
3298 having default visibility.  Marking the enclosing class with explicit
3299 visibility has no effect.
3301 Explicitly instantiated inline methods are unaffected by this option
3302 as their linkage might otherwise cross a shared library boundary.
3303 @xref{Template Instantiation}.
3305 @item -fvisibility-ms-compat
3306 @opindex fvisibility-ms-compat
3307 This flag attempts to use visibility settings to make GCC's C++
3308 linkage model compatible with that of Microsoft Visual Studio.
3310 The flag makes these changes to GCC's linkage model:
3312 @enumerate
3313 @item
3314 It sets the default visibility to @code{hidden}, like
3315 @option{-fvisibility=hidden}.
3317 @item
3318 Types, but not their members, are not hidden by default.
3320 @item
3321 The One Definition Rule is relaxed for types without explicit
3322 visibility specifications that are defined in more than one
3323 shared object: those declarations are permitted if they are
3324 permitted when this option is not used.
3325 @end enumerate
3327 In new code it is better to use @option{-fvisibility=hidden} and
3328 export those classes that are intended to be externally visible.
3329 Unfortunately it is possible for code to rely, perhaps accidentally,
3330 on the Visual Studio behavior.
3332 Among the consequences of these changes are that static data members
3333 of the same type with the same name but defined in different shared
3334 objects are different, so changing one does not change the other;
3335 and that pointers to function members defined in different shared
3336 objects may not compare equal.  When this flag is given, it is a
3337 violation of the ODR to define types with the same name differently.
3339 @item -fno-weak
3340 @opindex fno-weak
3341 @opindex fweak
3342 Do not use weak symbol support, even if it is provided by the linker.
3343 By default, G++ uses weak symbols if they are available.  This
3344 option exists only for testing, and should not be used by end-users;
3345 it results in inferior code and has no benefits.  This option may
3346 be removed in a future release of G++.
3348 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
3349 @opindex fext-numeric-literals
3350 @opindex fno-ext-numeric-literals
3351 Accept imaginary, fixed-point, or machine-defined
3352 literal number suffixes as GNU extensions.
3353 When this option is turned off these suffixes are treated
3354 as C++11 user-defined literal numeric suffixes.
3355 This is on by default for all pre-C++11 dialects and all GNU dialects:
3356 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
3357 @option{-std=gnu++14}.
3358 This option is off by default
3359 for ISO C++11 onwards (@option{-std=c++11}, ...).
3361 @item -nostdinc++
3362 @opindex nostdinc++
3363 Do not search for header files in the standard directories specific to
3364 C++, but do still search the other standard directories.  (This option
3365 is used when building the C++ library.)
3367 @item -flang-info-include-translate
3368 @itemx -flang-info-include-translate-not
3369 @itemx -flang-info-include-translate=@var{header}
3370 @opindex flang-info-include-translate
3371 @opindex flang-info-include-translate-not
3372 Diagnose include translation events.
3374 @item -stdlib=@var{libstdc++,libc++}
3375 @opindex stdlib
3376 When G++ is configured to support this option, it allows specification of
3377 alternate C++ runtime libraries.  Two options are available: @var{libstdc++}
3378 (the default, native C++ runtime for G++) and @var{libc++} which is the
3379 C++ runtime installed on some operating systems (e.g. Darwin versions from
3380 Darwin11 onwards).  The option switches G++ to use the headers from the
3381 specified library and to emit @code{-lstdc++} or @code{-lc++} respectively,
3382 when a C++ runtime is required for linking.
3383 @end table
3385 In addition, these warning options have meanings only for C++ programs:
3387 @table @gcctabopt
3388 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
3389 @opindex Wabi-tag
3390 Warn when a type with an ABI tag is used in a context that does not
3391 have that ABI tag.  See @ref{C++ Attributes} for more information
3392 about ABI tags.
3394 @item -Wcomma-subscript @r{(C++ and Objective-C++ only)}
3395 @opindex Wcomma-subscript
3396 @opindex Wno-comma-subscript
3397 Warn about uses of a comma expression within a subscripting expression.
3398 This usage was deprecated in C++20.  However, a comma expression wrapped
3399 in @code{( )} is not deprecated.  Example:
3401 @smallexample
3402 @group
3403 void f(int *a, int b, int c) @{
3404     a[b,c];     // deprecated
3405     a[(b,c)];   // OK
3407 @end group
3408 @end smallexample
3410 Enabled by default with @option{-std=c++20}.
3412 @item -Wctad-maybe-unsupported @r{(C++ and Objective-C++ only)}
3413 @opindex Wctad-maybe-unsupported
3414 @opindex Wno-ctad-maybe-unsupported
3415 Warn when performing class template argument deduction (CTAD) on a type with
3416 no explicitly written deduction guides.  This warning will point out cases
3417 where CTAD succeeded only because the compiler synthesized the implicit
3418 deduction guides, which might not be what the programmer intended.  Certain
3419 style guides allow CTAD only on types that specifically "opt-in"; i.e., on
3420 types that are designed to support CTAD.  This warning can be suppressed with
3421 the following pattern:
3423 @smallexample
3424 struct allow_ctad_t; // any name works
3425 template <typename T> struct S @{
3426   S(T) @{ @}
3428 S(allow_ctad_t) -> S<void>; // guide with incomplete parameter type will never be considered
3429 @end smallexample
3431 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
3432 @opindex Wctor-dtor-privacy
3433 @opindex Wno-ctor-dtor-privacy
3434 Warn when a class seems unusable because all the constructors or
3435 destructors in that class are private, and it has neither friends nor
3436 public static member functions.  Also warn if there are no non-private
3437 methods, and there's at least one private member function that isn't
3438 a constructor or destructor.
3440 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
3441 @opindex Wdelete-non-virtual-dtor
3442 @opindex Wno-delete-non-virtual-dtor
3443 Warn when @code{delete} is used to destroy an instance of a class that
3444 has virtual functions and non-virtual destructor. It is unsafe to delete
3445 an instance of a derived class through a pointer to a base class if the
3446 base class does not have a virtual destructor.  This warning is enabled
3447 by @option{-Wall}.
3449 @item -Wdeprecated-copy @r{(C++ and Objective-C++ only)}
3450 @opindex Wdeprecated-copy
3451 @opindex Wno-deprecated-copy
3452 Warn that the implicit declaration of a copy constructor or copy
3453 assignment operator is deprecated if the class has a user-provided
3454 copy constructor or copy assignment operator, in C++11 and up.  This
3455 warning is enabled by @option{-Wextra}.  With
3456 @option{-Wdeprecated-copy-dtor}, also deprecate if the class has a
3457 user-provided destructor.
3459 @item -Wno-deprecated-enum-enum-conversion @r{(C++ and Objective-C++ only)}
3460 @opindex Wdeprecated-enum-enum-conversion
3461 @opindex Wno-deprecated-enum-enum-conversion
3462 Disable the warning about the case when the usual arithmetic conversions
3463 are applied on operands where one is of enumeration type and the other is
3464 of a different enumeration type.  This conversion was deprecated in C++20.
3465 For example:
3467 @smallexample
3468 enum E1 @{ e @};
3469 enum E2 @{ f @};
3470 int k = f - e;
3471 @end smallexample
3473 @option{-Wdeprecated-enum-enum-conversion} is enabled by default with
3474 @option{-std=c++20}.  In pre-C++20 dialects, this warning can be enabled
3475 by @option{-Wenum-conversion}.
3477 @item -Wno-deprecated-enum-float-conversion @r{(C++ and Objective-C++ only)}
3478 @opindex Wdeprecated-enum-float-conversion
3479 @opindex Wno-deprecated-enum-float-conversion
3480 Disable the warning about the case when the usual arithmetic conversions
3481 are applied on operands where one is of enumeration type and the other is
3482 of a floating-point type.  This conversion was deprecated in C++20.  For
3483 example:
3485 @smallexample
3486 enum E1 @{ e @};
3487 enum E2 @{ f @};
3488 bool b = e <= 3.7;
3489 @end smallexample
3491 @option{-Wdeprecated-enum-float-conversion} is enabled by default with
3492 @option{-std=c++20}.  In pre-C++20 dialects, this warning can be enabled
3493 by @option{-Wenum-conversion}.
3495 @item -Wno-init-list-lifetime @r{(C++ and Objective-C++ only)}
3496 @opindex Winit-list-lifetime
3497 @opindex Wno-init-list-lifetime
3498 Do not warn about uses of @code{std::initializer_list} that are likely
3499 to result in dangling pointers.  Since the underlying array for an
3500 @code{initializer_list} is handled like a normal C++ temporary object,
3501 it is easy to inadvertently keep a pointer to the array past the end
3502 of the array's lifetime.  For example:
3504 @itemize @bullet
3505 @item
3506 If a function returns a temporary @code{initializer_list}, or a local
3507 @code{initializer_list} variable, the array's lifetime ends at the end
3508 of the return statement, so the value returned has a dangling pointer.
3510 @item
3511 If a new-expression creates an @code{initializer_list}, the array only
3512 lives until the end of the enclosing full-expression, so the
3513 @code{initializer_list} in the heap has a dangling pointer.
3515 @item
3516 When an @code{initializer_list} variable is assigned from a
3517 brace-enclosed initializer list, the temporary array created for the
3518 right side of the assignment only lives until the end of the
3519 full-expression, so at the next statement the @code{initializer_list}
3520 variable has a dangling pointer.
3522 @smallexample
3523 // li's initial underlying array lives as long as li
3524 std::initializer_list<int> li = @{ 1,2,3 @};
3525 // assignment changes li to point to a temporary array
3526 li = @{ 4, 5 @};
3527 // now the temporary is gone and li has a dangling pointer
3528 int i = li.begin()[0] // undefined behavior
3529 @end smallexample
3531 @item
3532 When a list constructor stores the @code{begin} pointer from the
3533 @code{initializer_list} argument, this doesn't extend the lifetime of
3534 the array, so if a class variable is constructed from a temporary
3535 @code{initializer_list}, the pointer is left dangling by the end of
3536 the variable declaration statement.
3538 @end itemize
3540 @item -Winvalid-imported-macros
3541 @opindex Winvalid-imported-macros
3542 @opindex Wno-invalid-imported-macros
3543 Verify all imported macro definitions are valid at the end of
3544 compilation.  This is not enabled by default, as it requires
3545 additional processing to determine.  It may be useful when preparing
3546 sets of header-units to ensure consistent macros.
3548 @item -Wno-literal-suffix @r{(C++ and Objective-C++ only)}
3549 @opindex Wliteral-suffix
3550 @opindex Wno-literal-suffix
3551 Do not warn when a string or character literal is followed by a
3552 ud-suffix which does not begin with an underscore.  As a conforming
3553 extension, GCC treats such suffixes as separate preprocessing tokens
3554 in order to maintain backwards compatibility with code that uses
3555 formatting macros from @code{<inttypes.h>}.  For example:
3557 @smallexample
3558 #define __STDC_FORMAT_MACROS
3559 #include <inttypes.h>
3560 #include <stdio.h>
3562 int main() @{
3563   int64_t i64 = 123;
3564   printf("My int64: %" PRId64"\n", i64);
3566 @end smallexample
3568 In this case, @code{PRId64} is treated as a separate preprocessing token.
3570 This option also controls warnings when a user-defined literal
3571 operator is declared with a literal suffix identifier that doesn't
3572 begin with an underscore. Literal suffix identifiers that don't begin
3573 with an underscore are reserved for future standardization.
3575 These warnings are enabled by default.
3577 @item -Wno-narrowing @r{(C++ and Objective-C++ only)}
3578 @opindex Wnarrowing
3579 @opindex Wno-narrowing
3580 For C++11 and later standards, narrowing conversions are diagnosed by default,
3581 as required by the standard.  A narrowing conversion from a constant produces
3582 an error, and a narrowing conversion from a non-constant produces a warning,
3583 but @option{-Wno-narrowing} suppresses the diagnostic.
3584 Note that this does not affect the meaning of well-formed code;
3585 narrowing conversions are still considered ill-formed in SFINAE contexts.
3587 With @option{-Wnarrowing} in C++98, warn when a narrowing
3588 conversion prohibited by C++11 occurs within
3589 @samp{@{ @}}, e.g.
3591 @smallexample
3592 int i = @{ 2.2 @}; // error: narrowing from double to int
3593 @end smallexample
3595 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
3597 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
3598 @opindex Wnoexcept
3599 @opindex Wno-noexcept
3600 Warn when a noexcept-expression evaluates to false because of a call
3601 to a function that does not have a non-throwing exception
3602 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
3603 the compiler to never throw an exception.
3605 @item -Wnoexcept-type @r{(C++ and Objective-C++ only)}
3606 @opindex Wnoexcept-type
3607 @opindex Wno-noexcept-type
3608 Warn if the C++17 feature making @code{noexcept} part of a function
3609 type changes the mangled name of a symbol relative to C++14.  Enabled
3610 by @option{-Wabi} and @option{-Wc++17-compat}.
3612 As an example:
3614 @smallexample
3615 template <class T> void f(T t) @{ t(); @};
3616 void g() noexcept;
3617 void h() @{ f(g); @} 
3618 @end smallexample
3620 @noindent
3621 In C++14, @code{f} calls @code{f<void(*)()>}, but in
3622 C++17 it calls @code{f<void(*)()noexcept>}.
3624 @item -Wclass-memaccess @r{(C++ and Objective-C++ only)}
3625 @opindex Wclass-memaccess
3626 @opindex Wno-class-memaccess
3627 Warn when the destination of a call to a raw memory function such as
3628 @code{memset} or @code{memcpy} is an object of class type, and when writing
3629 into such an object might bypass the class non-trivial or deleted constructor
3630 or copy assignment, violate const-correctness or encapsulation, or corrupt
3631 virtual table pointers.  Modifying the representation of such objects may
3632 violate invariants maintained by member functions of the class.  For example,
3633 the call to @code{memset} below is undefined because it modifies a non-trivial
3634 class object and is, therefore, diagnosed.  The safe way to either initialize
3635 or clear the storage of objects of such types is by using the appropriate
3636 constructor or assignment operator, if one is available.
3637 @smallexample
3638 std::string str = "abc";
3639 memset (&str, 0, sizeof str);
3640 @end smallexample
3641 The @option{-Wclass-memaccess} option is enabled by @option{-Wall}.
3642 Explicitly casting the pointer to the class object to @code{void *} or
3643 to a type that can be safely accessed by the raw memory function suppresses
3644 the warning.
3646 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
3647 @opindex Wnon-virtual-dtor
3648 @opindex Wno-non-virtual-dtor
3649 Warn when a class has virtual functions and an accessible non-virtual
3650 destructor itself or in an accessible polymorphic base class, in which
3651 case it is possible but unsafe to delete an instance of a derived
3652 class through a pointer to the class itself or base class.  This
3653 warning is automatically enabled if @option{-Weffc++} is specified.
3655 @item -Wregister @r{(C++ and Objective-C++ only)}
3656 @opindex Wregister
3657 @opindex Wno-register
3658 Warn on uses of the @code{register} storage class specifier, except
3659 when it is part of the GNU @ref{Explicit Register Variables} extension.
3660 The use of the @code{register} keyword as storage class specifier has
3661 been deprecated in C++11 and removed in C++17.
3662 Enabled by default with @option{-std=c++17}.
3664 @item -Wreorder @r{(C++ and Objective-C++ only)}
3665 @opindex Wreorder
3666 @opindex Wno-reorder
3667 @cindex reordering, warning
3668 @cindex warning for reordering of member initializers
3669 Warn when the order of member initializers given in the code does not
3670 match the order in which they must be executed.  For instance:
3672 @smallexample
3673 struct A @{
3674   int i;
3675   int j;
3676   A(): j (0), i (1) @{ @}
3678 @end smallexample
3680 @noindent
3681 The compiler rearranges the member initializers for @code{i}
3682 and @code{j} to match the declaration order of the members, emitting
3683 a warning to that effect.  This warning is enabled by @option{-Wall}.
3685 @item -Wno-pessimizing-move @r{(C++ and Objective-C++ only)}
3686 @opindex Wpessimizing-move
3687 @opindex Wno-pessimizing-move
3688 This warning warns when a call to @code{std::move} prevents copy
3689 elision.  A typical scenario when copy elision can occur is when returning in
3690 a function with a class return type, when the expression being returned is the
3691 name of a non-volatile automatic object, and is not a function parameter, and
3692 has the same type as the function return type.
3694 @smallexample
3695 struct T @{
3696 @dots{}
3698 T fn()
3700   T t;
3701   @dots{}
3702   return std::move (t);
3704 @end smallexample
3706 But in this example, the @code{std::move} call prevents copy elision.
3708 This warning is enabled by @option{-Wall}.
3710 @item -Wno-redundant-move @r{(C++ and Objective-C++ only)}
3711 @opindex Wredundant-move
3712 @opindex Wno-redundant-move
3713 This warning warns about redundant calls to @code{std::move}; that is, when
3714 a move operation would have been performed even without the @code{std::move}
3715 call.  This happens because the compiler is forced to treat the object as if
3716 it were an rvalue in certain situations such as returning a local variable,
3717 where copy elision isn't applicable.  Consider:
3719 @smallexample
3720 struct T @{
3721 @dots{}
3723 T fn(T t)
3725   @dots{}
3726   return std::move (t);
3728 @end smallexample
3730 Here, the @code{std::move} call is redundant.  Because G++ implements Core
3731 Issue 1579, another example is:
3733 @smallexample
3734 struct T @{ // convertible to U
3735 @dots{}
3737 struct U @{
3738 @dots{}
3740 U fn()
3742   T t;
3743   @dots{}
3744   return std::move (t);
3746 @end smallexample
3747 In this example, copy elision isn't applicable because the type of the
3748 expression being returned and the function return type differ, yet G++
3749 treats the return value as if it were designated by an rvalue.
3751 This warning is enabled by @option{-Wextra}.
3753 @item -Wrange-loop-construct @r{(C++ and Objective-C++ only)}
3754 @opindex Wrange-loop-construct
3755 @opindex Wno-range-loop-construct
3756 This warning warns when a C++ range-based for-loop is creating an unnecessary
3757 copy.  This can happen when the range declaration is not a reference, but
3758 probably should be.  For example:
3760 @smallexample
3761 struct S @{ char arr[128]; @};
3762 void fn () @{
3763   S arr[5];
3764   for (const auto x : arr) @{ @dots{} @}
3766 @end smallexample
3768 It does not warn when the type being copied is a trivially-copyable type whose
3769 size is less than 64 bytes.
3771 This warning also warns when a loop variable in a range-based for-loop is
3772 initialized with a value of a different type resulting in a copy.  For example:
3774 @smallexample
3775 void fn() @{
3776   int arr[10];
3777   for (const double &x : arr) @{ @dots{} @}
3779 @end smallexample
3781 In the example above, in every iteration of the loop a temporary value of
3782 type @code{double} is created and destroyed, to which the reference
3783 @code{const double &} is bound.
3785 This warning is enabled by @option{-Wall}.
3787 @item -Wredundant-tags @r{(C++ and Objective-C++ only)}
3788 @opindex Wredundant-tags
3789 @opindex Wno-redundant-tags
3790 Warn about redundant class-key and enum-key in references to class types
3791 and enumerated types in contexts where the key can be eliminated without
3792 causing an ambiguity.  For example:
3794 @smallexample
3795 struct foo;
3796 struct foo *p;   // warn that keyword struct can be eliminated
3797 @end smallexample
3799 @noindent
3800 On the other hand, in this example there is no warning:
3802 @smallexample
3803 struct foo;
3804 void foo ();   // "hides" struct foo
3805 void bar (struct foo&);  // no warning, keyword struct is necessary
3806 @end smallexample
3808 @item -Wno-subobject-linkage @r{(C++ and Objective-C++ only)}
3809 @opindex Wsubobject-linkage
3810 @opindex Wno-subobject-linkage
3811 Do not warn
3812 if a class type has a base or a field whose type uses the anonymous
3813 namespace or depends on a type with no linkage.  If a type A depends on
3814 a type B with no or internal linkage, defining it in multiple
3815 translation units would be an ODR violation because the meaning of B
3816 is different in each translation unit.  If A only appears in a single
3817 translation unit, the best way to silence the warning is to give it
3818 internal linkage by putting it in an anonymous namespace as well.  The
3819 compiler doesn't give this warning for types defined in the main .C
3820 file, as those are unlikely to have multiple definitions.
3821 @option{-Wsubobject-linkage} is enabled by default.
3823 @item -Weffc++ @r{(C++ and Objective-C++ only)}
3824 @opindex Weffc++
3825 @opindex Wno-effc++
3826 Warn about violations of the following style guidelines from Scott Meyers'
3827 @cite{Effective C++} series of books:
3829 @itemize @bullet
3830 @item
3831 Define a copy constructor and an assignment operator for classes
3832 with dynamically-allocated memory.
3834 @item
3835 Prefer initialization to assignment in constructors.
3837 @item
3838 Have @code{operator=} return a reference to @code{*this}.
3840 @item
3841 Don't try to return a reference when you must return an object.
3843 @item
3844 Distinguish between prefix and postfix forms of increment and
3845 decrement operators.
3847 @item
3848 Never overload @code{&&}, @code{||}, or @code{,}.
3850 @end itemize
3852 This option also enables @option{-Wnon-virtual-dtor}, which is also
3853 one of the effective C++ recommendations.  However, the check is
3854 extended to warn about the lack of virtual destructor in accessible
3855 non-polymorphic bases classes too.
3857 When selecting this option, be aware that the standard library
3858 headers do not obey all of these guidelines; use @samp{grep -v}
3859 to filter out those warnings.
3861 @item -Wno-exceptions @r{(C++ and Objective-C++ only)}
3862 @opindex Wexceptions
3863 @opindex Wno-exceptions
3864 Disable the warning about the case when an exception handler is shadowed by
3865 another handler, which can point out a wrong ordering of exception handlers.
3867 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
3868 @opindex Wstrict-null-sentinel
3869 @opindex Wno-strict-null-sentinel
3870 Warn about the use of an uncasted @code{NULL} as sentinel.  When
3871 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
3872 to @code{__null}.  Although it is a null pointer constant rather than a
3873 null pointer, it is guaranteed to be of the same size as a pointer.
3874 But this use is not portable across different compilers.
3876 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
3877 @opindex Wno-non-template-friend
3878 @opindex Wnon-template-friend
3879 Disable warnings when non-template friend functions are declared
3880 within a template.  In very old versions of GCC that predate implementation
3881 of the ISO standard, declarations such as 
3882 @samp{friend int foo(int)}, where the name of the friend is an unqualified-id,
3883 could be interpreted as a particular specialization of a template
3884 function; the warning exists to diagnose compatibility problems, 
3885 and is enabled by default.
3887 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
3888 @opindex Wold-style-cast
3889 @opindex Wno-old-style-cast
3890 Warn if an old-style (C-style) cast to a non-void type is used within
3891 a C++ program.  The new-style casts (@code{dynamic_cast},
3892 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
3893 less vulnerable to unintended effects and much easier to search for.
3895 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
3896 @opindex Woverloaded-virtual
3897 @opindex Wno-overloaded-virtual
3898 @cindex overloaded virtual function, warning
3899 @cindex warning for overloaded virtual function
3900 Warn when a function declaration hides virtual functions from a
3901 base class.  For example, in:
3903 @smallexample
3904 struct A @{
3905   virtual void f();
3908 struct B: public A @{
3909   void f(int);
3911 @end smallexample
3913 the @code{A} class version of @code{f} is hidden in @code{B}, and code
3914 like:
3916 @smallexample
3917 B* b;
3918 b->f();
3919 @end smallexample
3921 @noindent
3922 fails to compile.
3924 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
3925 @opindex Wno-pmf-conversions
3926 @opindex Wpmf-conversions
3927 Disable the diagnostic for converting a bound pointer to member function
3928 to a plain pointer.
3930 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
3931 @opindex Wsign-promo
3932 @opindex Wno-sign-promo
3933 Warn when overload resolution chooses a promotion from unsigned or
3934 enumerated type to a signed type, over a conversion to an unsigned type of
3935 the same size.  Previous versions of G++ tried to preserve
3936 unsignedness, but the standard mandates the current behavior.
3938 @item -Wtemplates @r{(C++ and Objective-C++ only)}
3939 @opindex Wtemplates
3940 @opindex Wno-templates
3941 Warn when a primary template declaration is encountered.  Some coding
3942 rules disallow templates, and this may be used to enforce that rule.
3943 The warning is inactive inside a system header file, such as the STL, so
3944 one can still use the STL.  One may also instantiate or specialize
3945 templates.
3947 @item -Wno-mismatched-new-delete @r{(C++ and Objective-C++ only)}
3948 @opindex Wmismatched-new-delete
3949 @opindex Wno-mismatched-new-delete
3950 Warn for mismatches between calls to @code{operator new} or @code{operator
3951 delete} and the corresponding call to the allocation or deallocation function.
3952 This includes invocations of C++ @code{operator delete} with pointers
3953 returned from either mismatched forms of @code{operator new}, or from other
3954 functions that allocate objects for which the @code{operator delete} isn't
3955 a suitable deallocator, as well as calls to other deallocation functions
3956 with pointers returned from @code{operator new} for which the deallocation
3957 function isn't suitable.
3959 For example, the @code{delete} expression in the function below is diagnosed
3960 because it doesn't match the array form of the @code{new} expression
3961 the pointer argument was returned from.  Similarly, the call to @code{free}
3962 is also diagnosed.
3964 @smallexample
3965 void f ()
3967   int *a = new int[n];
3968   delete a;   // warning: mismatch in array forms of expressions
3970   char *p = new char[n];
3971   free (p);   // warning: mismatch between new and free
3973 @end smallexample
3975 The related option @option{-Wmismatched-dealloc} diagnoses mismatches
3976 involving allocation and deallocation functions other than @code{operator
3977 new} and @code{operator delete}.
3979 @option{-Wmismatched-new-delete} is enabled by default.
3981 @item -Wmismatched-tags @r{(C++ and Objective-C++ only)}
3982 @opindex Wmismatched-tags
3983 @opindex Wno-mismatched-tags
3984 Warn for declarations of structs, classes, and class templates and their
3985 specializations with a class-key that does not match either the definition
3986 or the first declaration if no definition is provided.
3988 For example, the declaration of @code{struct Object} in the argument list
3989 of @code{draw} triggers the warning.  To avoid it, either remove the redundant
3990 class-key @code{struct} or replace it with @code{class} to match its definition.
3991 @smallexample
3992 class Object @{
3993 public:
3994   virtual ~Object () = 0;
3996 void draw (struct Object*);
3997 @end smallexample
3999 It is not wrong to declare a class with the class-key @code{struct} as
4000 the example above shows.  The @option{-Wmismatched-tags} option is intended
4001 to help achieve a consistent style of class declarations.  In code that is
4002 intended to be portable to Windows-based compilers the warning helps prevent
4003 unresolved references due to the difference in the mangling of symbols
4004 declared with different class-keys.  The option can be used either on its
4005 own or in conjunction with @option{-Wredundant-tags}.
4007 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
4008 @opindex Wmultiple-inheritance
4009 @opindex Wno-multiple-inheritance
4010 Warn when a class is defined with multiple direct base classes.  Some
4011 coding rules disallow multiple inheritance, and this may be used to
4012 enforce that rule.  The warning is inactive inside a system header file,
4013 such as the STL, so one can still use the STL.  One may also define
4014 classes that indirectly use multiple inheritance.
4016 @item -Wvirtual-inheritance
4017 @opindex Wvirtual-inheritance
4018 @opindex Wno-virtual-inheritance
4019 Warn when a class is defined with a virtual direct base class.  Some
4020 coding rules disallow multiple inheritance, and this may be used to
4021 enforce that rule.  The warning is inactive inside a system header file,
4022 such as the STL, so one can still use the STL.  One may also define
4023 classes that indirectly use virtual inheritance.
4025 @item -Wno-virtual-move-assign
4026 @opindex Wvirtual-move-assign
4027 @opindex Wno-virtual-move-assign
4028 Suppress warnings about inheriting from a virtual base with a
4029 non-trivial C++11 move assignment operator.  This is dangerous because
4030 if the virtual base is reachable along more than one path, it is
4031 moved multiple times, which can mean both objects end up in the
4032 moved-from state.  If the move assignment operator is written to avoid
4033 moving from a moved-from object, this warning can be disabled.
4035 @item -Wnamespaces
4036 @opindex Wnamespaces
4037 @opindex Wno-namespaces
4038 Warn when a namespace definition is opened.  Some coding rules disallow
4039 namespaces, and this may be used to enforce that rule.  The warning is
4040 inactive inside a system header file, such as the STL, so one can still
4041 use the STL.  One may also use using directives and qualified names.
4043 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
4044 @opindex Wterminate
4045 @opindex Wno-terminate
4046 Disable the warning about a throw-expression that will immediately
4047 result in a call to @code{terminate}.
4049 @item -Wno-vexing-parse @r{(C++ and Objective-C++ only)}
4050 @opindex Wvexing-parse
4051 @opindex Wno-vexing-parse
4052 Warn about the most vexing parse syntactic ambiguity.  This warns about
4053 the cases when a declaration looks like a variable definition, but the
4054 C++ language requires it to be interpreted as a function declaration.
4055 For instance:
4057 @smallexample
4058 void f(double a) @{
4059   int i();        // extern int i (void);
4060   int n(int(a));  // extern int n (int);
4062 @end smallexample
4064 Another example:
4066 @smallexample
4067 struct S @{ S(int); @};
4068 void f(double a) @{
4069   S x(int(a));   // extern struct S x (int);
4070   S y(int());    // extern struct S y (int (*) (void));
4071   S z();         // extern struct S z (void);
4073 @end smallexample
4075 The warning will suggest options how to deal with such an ambiguity; e.g.,
4076 it can suggest removing the parentheses or using braces instead.
4078 This warning is enabled by default.
4080 @item -Wno-class-conversion @r{(C++ and Objective-C++ only)}
4081 @opindex Wno-class-conversion
4082 @opindex Wclass-conversion
4083 Do not warn when a conversion function converts an
4084 object to the same type, to a base class of that type, or to void; such
4085 a conversion function will never be called.
4087 @item -Wvolatile @r{(C++ and Objective-C++ only)}
4088 @opindex Wvolatile
4089 @opindex Wno-volatile
4090 Warn about deprecated uses of the @code{volatile} qualifier.  This includes
4091 postfix and prefix @code{++} and @code{--} expressions of
4092 @code{volatile}-qualified types, using simple assignments where the left
4093 operand is a @code{volatile}-qualified non-class type for their value,
4094 compound assignments where the left operand is a @code{volatile}-qualified
4095 non-class type, @code{volatile}-qualified function return type,
4096 @code{volatile}-qualified parameter type, and structured bindings of a
4097 @code{volatile}-qualified type.  This usage was deprecated in C++20.
4099 Enabled by default with @option{-std=c++20}.
4101 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4102 @opindex Wzero-as-null-pointer-constant
4103 @opindex Wno-zero-as-null-pointer-constant
4104 Warn when a literal @samp{0} is used as null pointer constant.  This can
4105 be useful to facilitate the conversion to @code{nullptr} in C++11.
4107 @item -Waligned-new
4108 @opindex Waligned-new
4109 @opindex Wno-aligned-new
4110 Warn about a new-expression of a type that requires greater alignment
4111 than the @code{alignof(std::max_align_t)} but uses an allocation
4112 function without an explicit alignment parameter. This option is
4113 enabled by @option{-Wall}.
4115 Normally this only warns about global allocation functions, but
4116 @option{-Waligned-new=all} also warns about class member allocation
4117 functions.
4119 @item -Wno-placement-new
4120 @itemx -Wplacement-new=@var{n}
4121 @opindex Wplacement-new
4122 @opindex Wno-placement-new
4123 Warn about placement new expressions with undefined behavior, such as
4124 constructing an object in a buffer that is smaller than the type of
4125 the object.  For example, the placement new expression below is diagnosed
4126 because it attempts to construct an array of 64 integers in a buffer only
4127 64 bytes large.
4128 @smallexample
4129 char buf [64];
4130 new (buf) int[64];
4131 @end smallexample
4132 This warning is enabled by default.
4134 @table @gcctabopt
4135 @item -Wplacement-new=1
4136 This is the default warning level of @option{-Wplacement-new}.  At this
4137 level the warning is not issued for some strictly undefined constructs that
4138 GCC allows as extensions for compatibility with legacy code.  For example,
4139 the following @code{new} expression is not diagnosed at this level even
4140 though it has undefined behavior according to the C++ standard because
4141 it writes past the end of the one-element array.
4142 @smallexample
4143 struct S @{ int n, a[1]; @};
4144 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
4145 new (s->a)int [32]();
4146 @end smallexample
4148 @item -Wplacement-new=2
4149 At this level, in addition to diagnosing all the same constructs as at level
4150 1, a diagnostic is also issued for placement new expressions that construct
4151 an object in the last member of structure whose type is an array of a single
4152 element and whose size is less than the size of the object being constructed.
4153 While the previous example would be diagnosed, the following construct makes
4154 use of the flexible member array extension to avoid the warning at level 2.
4155 @smallexample
4156 struct S @{ int n, a[]; @};
4157 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
4158 new (s->a)int [32]();
4159 @end smallexample
4161 @end table
4163 @item -Wcatch-value
4164 @itemx -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)}
4165 @opindex Wcatch-value
4166 @opindex Wno-catch-value
4167 Warn about catch handlers that do not catch via reference.
4168 With @option{-Wcatch-value=1} (or @option{-Wcatch-value} for short)
4169 warn about polymorphic class types that are caught by value.
4170 With @option{-Wcatch-value=2} warn about all class types that are caught
4171 by value. With @option{-Wcatch-value=3} warn about all types that are
4172 not caught by reference. @option{-Wcatch-value} is enabled by @option{-Wall}.
4174 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4175 @opindex Wconditionally-supported
4176 @opindex Wno-conditionally-supported
4177 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4179 @item -Wno-delete-incomplete @r{(C++ and Objective-C++ only)}
4180 @opindex Wdelete-incomplete
4181 @opindex Wno-delete-incomplete
4182 Do not warn when deleting a pointer to incomplete type, which may cause
4183 undefined behavior at runtime.  This warning is enabled by default.
4185 @item -Wextra-semi @r{(C++, Objective-C++ only)}
4186 @opindex Wextra-semi
4187 @opindex Wno-extra-semi
4188 Warn about redundant semicolons after in-class function definitions.
4190 @item -Wno-inaccessible-base @r{(C++, Objective-C++ only)}
4191 @opindex Winaccessible-base
4192 @opindex Wno-inaccessible-base
4193 This option controls warnings
4194 when a base class is inaccessible in a class derived from it due to
4195 ambiguity.  The warning is enabled by default.
4196 Note that the warning for ambiguous virtual
4197 bases is enabled by the @option{-Wextra} option.
4198 @smallexample
4199 @group
4200 struct A @{ int a; @};
4202 struct B : A @{ @};
4204 struct C : B, A @{ @};
4205 @end group
4206 @end smallexample
4208 @item -Wno-inherited-variadic-ctor
4209 @opindex Winherited-variadic-ctor
4210 @opindex Wno-inherited-variadic-ctor
4211 Suppress warnings about use of C++11 inheriting constructors when the
4212 base class inherited from has a C variadic constructor; the warning is
4213 on by default because the ellipsis is not inherited.
4215 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4216 @opindex Wno-invalid-offsetof
4217 @opindex Winvalid-offsetof
4218 Suppress warnings from applying the @code{offsetof} macro to a non-POD
4219 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
4220 to a non-standard-layout type is undefined.  In existing C++ implementations,
4221 however, @code{offsetof} typically gives meaningful results.
4222 This flag is for users who are aware that they are
4223 writing nonportable code and who have deliberately chosen to ignore the
4224 warning about it.
4226 The restrictions on @code{offsetof} may be relaxed in a future version
4227 of the C++ standard.
4229 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
4230 @opindex Wsized-deallocation
4231 @opindex Wno-sized-deallocation
4232 Warn about a definition of an unsized deallocation function
4233 @smallexample
4234 void operator delete (void *) noexcept;
4235 void operator delete[] (void *) noexcept;
4236 @end smallexample
4237 without a definition of the corresponding sized deallocation function
4238 @smallexample
4239 void operator delete (void *, std::size_t) noexcept;
4240 void operator delete[] (void *, std::size_t) noexcept;
4241 @end smallexample
4242 or vice versa.  Enabled by @option{-Wextra} along with
4243 @option{-fsized-deallocation}.
4245 @item -Wsuggest-final-types
4246 @opindex Wno-suggest-final-types
4247 @opindex Wsuggest-final-types
4248 Warn about types with virtual methods where code quality would be improved
4249 if the type were declared with the C++11 @code{final} specifier,
4250 or, if possible,
4251 declared in an anonymous namespace. This allows GCC to more aggressively
4252 devirtualize the polymorphic calls. This warning is more effective with
4253 link-time optimization,
4254 where the information about the class hierarchy graph is
4255 more complete.
4257 @item -Wsuggest-final-methods
4258 @opindex Wno-suggest-final-methods
4259 @opindex Wsuggest-final-methods
4260 Warn about virtual methods where code quality would be improved if the method
4261 were declared with the C++11 @code{final} specifier,
4262 or, if possible, its type were
4263 declared in an anonymous namespace or with the @code{final} specifier.
4264 This warning is
4265 more effective with link-time optimization, where the information about the
4266 class hierarchy graph is more complete. It is recommended to first consider
4267 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
4268 annotations.
4270 @item -Wsuggest-override
4271 @opindex Wsuggest-override
4272 @opindex Wno-suggest-override
4273 Warn about overriding virtual functions that are not marked with the
4274 @code{override} keyword.
4276 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4277 @opindex Wuseless-cast
4278 @opindex Wno-useless-cast
4279 Warn when an expression is casted to its own type.
4281 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4282 @opindex Wconversion-null
4283 @opindex Wno-conversion-null
4284 Do not warn for conversions between @code{NULL} and non-pointer
4285 types. @option{-Wconversion-null} is enabled by default.
4287 @end table
4289 @node Objective-C and Objective-C++ Dialect Options
4290 @section Options Controlling Objective-C and Objective-C++ Dialects
4292 @cindex compiler options, Objective-C and Objective-C++
4293 @cindex Objective-C and Objective-C++ options, command-line
4294 @cindex options, Objective-C and Objective-C++
4295 (NOTE: This manual does not describe the Objective-C and Objective-C++
4296 languages themselves.  @xref{Standards,,Language Standards
4297 Supported by GCC}, for references.)
4299 This section describes the command-line options that are only meaningful
4300 for Objective-C and Objective-C++ programs.  You can also use most of
4301 the language-independent GNU compiler options.
4302 For example, you might compile a file @file{some_class.m} like this:
4304 @smallexample
4305 gcc -g -fgnu-runtime -O -c some_class.m
4306 @end smallexample
4308 @noindent
4309 In this example, @option{-fgnu-runtime} is an option meant only for
4310 Objective-C and Objective-C++ programs; you can use the other options with
4311 any language supported by GCC@.
4313 Note that since Objective-C is an extension of the C language, Objective-C
4314 compilations may also use options specific to the C front-end (e.g.,
4315 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
4316 C++-specific options (e.g., @option{-Wabi}).
4318 Here is a list of options that are @emph{only} for compiling Objective-C
4319 and Objective-C++ programs:
4321 @table @gcctabopt
4322 @item -fconstant-string-class=@var{class-name}
4323 @opindex fconstant-string-class
4324 Use @var{class-name} as the name of the class to instantiate for each
4325 literal string specified with the syntax @code{@@"@dots{}"}.  The default
4326 class name is @code{NXConstantString} if the GNU runtime is being used, and
4327 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
4328 @option{-fconstant-cfstrings} option, if also present, overrides the
4329 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
4330 to be laid out as constant CoreFoundation strings.
4332 @item -fgnu-runtime
4333 @opindex fgnu-runtime
4334 Generate object code compatible with the standard GNU Objective-C
4335 runtime.  This is the default for most types of systems.
4337 @item -fnext-runtime
4338 @opindex fnext-runtime
4339 Generate output compatible with the NeXT runtime.  This is the default
4340 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
4341 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
4342 used.
4344 @item -fno-nil-receivers
4345 @opindex fno-nil-receivers
4346 @opindex fnil-receivers
4347 Assume that all Objective-C message dispatches (@code{[receiver
4348 message:arg]}) in this translation unit ensure that the receiver is
4349 not @code{nil}.  This allows for more efficient entry points in the
4350 runtime to be used.  This option is only available in conjunction with
4351 the NeXT runtime and ABI version 0 or 1.
4353 @item -fobjc-abi-version=@var{n}
4354 @opindex fobjc-abi-version
4355 Use version @var{n} of the Objective-C ABI for the selected runtime.
4356 This option is currently supported only for the NeXT runtime.  In that
4357 case, Version 0 is the traditional (32-bit) ABI without support for
4358 properties and other Objective-C 2.0 additions.  Version 1 is the
4359 traditional (32-bit) ABI with support for properties and other
4360 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
4361 nothing is specified, the default is Version 0 on 32-bit target
4362 machines, and Version 2 on 64-bit target machines.
4364 @item -fobjc-call-cxx-cdtors
4365 @opindex fobjc-call-cxx-cdtors
4366 For each Objective-C class, check if any of its instance variables is a
4367 C++ object with a non-trivial default constructor.  If so, synthesize a
4368 special @code{- (id) .cxx_construct} instance method which runs
4369 non-trivial default constructors on any such instance variables, in order,
4370 and then return @code{self}.  Similarly, check if any instance variable
4371 is a C++ object with a non-trivial destructor, and if so, synthesize a
4372 special @code{- (void) .cxx_destruct} method which runs
4373 all such default destructors, in reverse order.
4375 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
4376 methods thusly generated only operate on instance variables
4377 declared in the current Objective-C class, and not those inherited
4378 from superclasses.  It is the responsibility of the Objective-C
4379 runtime to invoke all such methods in an object's inheritance
4380 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
4381 by the runtime immediately after a new object instance is allocated;
4382 the @code{- (void) .cxx_destruct} methods are invoked immediately
4383 before the runtime deallocates an object instance.
4385 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
4386 support for invoking the @code{- (id) .cxx_construct} and
4387 @code{- (void) .cxx_destruct} methods.
4389 @item -fobjc-direct-dispatch
4390 @opindex fobjc-direct-dispatch
4391 Allow fast jumps to the message dispatcher.  On Darwin this is
4392 accomplished via the comm page.
4394 @item -fobjc-exceptions
4395 @opindex fobjc-exceptions
4396 Enable syntactic support for structured exception handling in
4397 Objective-C, similar to what is offered by C++.  This option
4398 is required to use the Objective-C keywords @code{@@try},
4399 @code{@@throw}, @code{@@catch}, @code{@@finally} and
4400 @code{@@synchronized}.  This option is available with both the GNU
4401 runtime and the NeXT runtime (but not available in conjunction with
4402 the NeXT runtime on Mac OS X 10.2 and earlier).
4404 @item -fobjc-gc
4405 @opindex fobjc-gc
4406 Enable garbage collection (GC) in Objective-C and Objective-C++
4407 programs.  This option is only available with the NeXT runtime; the
4408 GNU runtime has a different garbage collection implementation that
4409 does not require special compiler flags.
4411 @item -fobjc-nilcheck
4412 @opindex fobjc-nilcheck
4413 For the NeXT runtime with version 2 of the ABI, check for a nil
4414 receiver in method invocations before doing the actual method call.
4415 This is the default and can be disabled using
4416 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
4417 checked for nil in this way no matter what this flag is set to.
4418 Currently this flag does nothing when the GNU runtime, or an older
4419 version of the NeXT runtime ABI, is used.
4421 @item -fobjc-std=objc1
4422 @opindex fobjc-std
4423 Conform to the language syntax of Objective-C 1.0, the language
4424 recognized by GCC 4.0.  This only affects the Objective-C additions to
4425 the C/C++ language; it does not affect conformance to C/C++ standards,
4426 which is controlled by the separate C/C++ dialect option flags.  When
4427 this option is used with the Objective-C or Objective-C++ compiler,
4428 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
4429 This is useful if you need to make sure that your Objective-C code can
4430 be compiled with older versions of GCC@.
4432 @item -freplace-objc-classes
4433 @opindex freplace-objc-classes
4434 Emit a special marker instructing @command{ld(1)} not to statically link in
4435 the resulting object file, and allow @command{dyld(1)} to load it in at
4436 run time instead.  This is used in conjunction with the Fix-and-Continue
4437 debugging mode, where the object file in question may be recompiled and
4438 dynamically reloaded in the course of program execution, without the need
4439 to restart the program itself.  Currently, Fix-and-Continue functionality
4440 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
4441 and later.
4443 @item -fzero-link
4444 @opindex fzero-link
4445 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
4446 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
4447 compile time) with static class references that get initialized at load time,
4448 which improves run-time performance.  Specifying the @option{-fzero-link} flag
4449 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
4450 to be retained.  This is useful in Zero-Link debugging mode, since it allows
4451 for individual class implementations to be modified during program execution.
4452 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
4453 regardless of command-line options.
4455 @item -fno-local-ivars
4456 @opindex fno-local-ivars
4457 @opindex flocal-ivars
4458 By default instance variables in Objective-C can be accessed as if
4459 they were local variables from within the methods of the class they're
4460 declared in.  This can lead to shadowing between instance variables
4461 and other variables declared either locally inside a class method or
4462 globally with the same name.  Specifying the @option{-fno-local-ivars}
4463 flag disables this behavior thus avoiding variable shadowing issues.
4465 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
4466 @opindex fivar-visibility
4467 Set the default instance variable visibility to the specified option
4468 so that instance variables declared outside the scope of any access
4469 modifier directives default to the specified visibility.
4471 @item -gen-decls
4472 @opindex gen-decls
4473 Dump interface declarations for all classes seen in the source file to a
4474 file named @file{@var{sourcename}.decl}.
4476 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
4477 @opindex Wassign-intercept
4478 @opindex Wno-assign-intercept
4479 Warn whenever an Objective-C assignment is being intercepted by the
4480 garbage collector.
4482 @item -Wno-property-assign-default @r{(Objective-C and Objective-C++ only)}
4483 @opindex Wproperty-assign-default
4484 @opindex Wno-property-assign-default
4485 Do not warn if a property for an Objective-C object has no assign
4486 semantics specified.
4488 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
4489 @opindex Wno-protocol
4490 @opindex Wprotocol
4491 If a class is declared to implement a protocol, a warning is issued for
4492 every method in the protocol that is not implemented by the class.  The
4493 default behavior is to issue a warning for every method not explicitly
4494 implemented in the class, even if a method implementation is inherited
4495 from the superclass.  If you use the @option{-Wno-protocol} option, then
4496 methods inherited from the superclass are considered to be implemented,
4497 and no warning is issued for them.
4499 @item -Wobjc-root-class @r{(Objective-C and Objective-C++ only)}
4500 @opindex Wobjc-root-class
4501 Warn if a class interface lacks a superclass. Most classes will inherit
4502 from @code{NSObject} (or @code{Object}) for example.  When declaring
4503 classes intended to be root classes, the warning can be suppressed by
4504 marking their interfaces with @code{__attribute__((objc_root_class))}.
4506 @item -Wselector @r{(Objective-C and Objective-C++ only)}
4507 @opindex Wselector
4508 @opindex Wno-selector
4509 Warn if multiple methods of different types for the same selector are
4510 found during compilation.  The check is performed on the list of methods
4511 in the final stage of compilation.  Additionally, a check is performed
4512 for each selector appearing in a @code{@@selector(@dots{})}
4513 expression, and a corresponding method for that selector has been found
4514 during compilation.  Because these checks scan the method table only at
4515 the end of compilation, these warnings are not produced if the final
4516 stage of compilation is not reached, for example because an error is
4517 found during compilation, or because the @option{-fsyntax-only} option is
4518 being used.
4520 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
4521 @opindex Wstrict-selector-match
4522 @opindex Wno-strict-selector-match
4523 Warn if multiple methods with differing argument and/or return types are
4524 found for a given selector when attempting to send a message using this
4525 selector to a receiver of type @code{id} or @code{Class}.  When this flag
4526 is off (which is the default behavior), the compiler omits such warnings
4527 if any differences found are confined to types that share the same size
4528 and alignment.
4530 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
4531 @opindex Wundeclared-selector
4532 @opindex Wno-undeclared-selector
4533 Warn if a @code{@@selector(@dots{})} expression referring to an
4534 undeclared selector is found.  A selector is considered undeclared if no
4535 method with that name has been declared before the
4536 @code{@@selector(@dots{})} expression, either explicitly in an
4537 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
4538 an @code{@@implementation} section.  This option always performs its
4539 checks as soon as a @code{@@selector(@dots{})} expression is found,
4540 while @option{-Wselector} only performs its checks in the final stage of
4541 compilation.  This also enforces the coding style convention
4542 that methods and selectors must be declared before being used.
4544 @item -print-objc-runtime-info
4545 @opindex print-objc-runtime-info
4546 Generate C header describing the largest structure that is passed by
4547 value, if any.
4549 @end table
4551 @node Diagnostic Message Formatting Options
4552 @section Options to Control Diagnostic Messages Formatting
4553 @cindex options to control diagnostics formatting
4554 @cindex diagnostic messages
4555 @cindex message formatting
4557 Traditionally, diagnostic messages have been formatted irrespective of
4558 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
4559 options described below
4560 to control the formatting algorithm for diagnostic messages, 
4561 e.g.@: how many characters per line, how often source location
4562 information should be reported.  Note that some language front ends may not
4563 honor these options.
4565 @table @gcctabopt
4566 @item -fmessage-length=@var{n}
4567 @opindex fmessage-length
4568 Try to format error messages so that they fit on lines of about
4569 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
4570 done; each error message appears on a single line.  This is the
4571 default for all front ends.
4573 Note - this option also affects the display of the @samp{#error} and
4574 @samp{#warning} pre-processor directives, and the @samp{deprecated}
4575 function/type/variable attribute.  It does not however affect the
4576 @samp{pragma GCC warning} and @samp{pragma GCC error} pragmas.
4578 @item -fdiagnostics-plain-output
4579 This option requests that diagnostic output look as plain as possible, which
4580 may be useful when running @command{dejagnu} or other utilities that need to
4581 parse diagnostics output and prefer that it remain more stable over time.
4582 @option{-fdiagnostics-plain-output} is currently equivalent to the following
4583 options:
4584 @gccoptlist{-fno-diagnostics-show-caret @gol
4585 -fno-diagnostics-show-line-numbers @gol
4586 -fdiagnostics-color=never @gol
4587 -fdiagnostics-urls=never @gol
4588 -fdiagnostics-path-format=separate-events}
4589 In the future, if GCC changes the default appearance of its diagnostics, the
4590 corresponding option to disable the new behavior will be added to this list.
4592 @item -fdiagnostics-show-location=once
4593 @opindex fdiagnostics-show-location
4594 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
4595 reporter to emit source location information @emph{once}; that is, in
4596 case the message is too long to fit on a single physical line and has to
4597 be wrapped, the source location won't be emitted (as prefix) again,
4598 over and over, in subsequent continuation lines.  This is the default
4599 behavior.
4601 @item -fdiagnostics-show-location=every-line
4602 Only meaningful in line-wrapping mode.  Instructs the diagnostic
4603 messages reporter to emit the same source location information (as
4604 prefix) for physical lines that result from the process of breaking
4605 a message which is too long to fit on a single line.
4607 @item -fdiagnostics-color[=@var{WHEN}]
4608 @itemx -fno-diagnostics-color
4609 @opindex fdiagnostics-color
4610 @cindex highlight, color
4611 @vindex GCC_COLORS @r{environment variable}
4612 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
4613 or @samp{auto}.  The default depends on how the compiler has been configured,
4614 it can be any of the above @var{WHEN} options or also @samp{never}
4615 if @env{GCC_COLORS} environment variable isn't present in the environment,
4616 and @samp{auto} otherwise.
4617 @samp{auto} makes GCC use color only when the standard error is a terminal,
4618 and when not executing in an emacs shell.
4619 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
4620 aliases for @option{-fdiagnostics-color=always} and
4621 @option{-fdiagnostics-color=never}, respectively.
4623 The colors are defined by the environment variable @env{GCC_COLORS}.
4624 Its value is a colon-separated list of capabilities and Select Graphic
4625 Rendition (SGR) substrings. SGR commands are interpreted by the
4626 terminal or terminal emulator.  (See the section in the documentation
4627 of your text terminal for permitted values and their meanings as
4628 character attributes.)  These substring values are integers in decimal
4629 representation and can be concatenated with semicolons.
4630 Common values to concatenate include
4631 @samp{1} for bold,
4632 @samp{4} for underline,
4633 @samp{5} for blink,
4634 @samp{7} for inverse,
4635 @samp{39} for default foreground color,
4636 @samp{30} to @samp{37} for foreground colors,
4637 @samp{90} to @samp{97} for 16-color mode foreground colors,
4638 @samp{38;5;0} to @samp{38;5;255}
4639 for 88-color and 256-color modes foreground colors,
4640 @samp{49} for default background color,
4641 @samp{40} to @samp{47} for background colors,
4642 @samp{100} to @samp{107} for 16-color mode background colors,
4643 and @samp{48;5;0} to @samp{48;5;255}
4644 for 88-color and 256-color modes background colors.
4646 The default @env{GCC_COLORS} is
4647 @smallexample
4648 error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\
4649 quote=01:path=01;36:fixit-insert=32:fixit-delete=31:\
4650 diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32:\
4651 type-diff=01;32
4652 @end smallexample
4653 @noindent
4654 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
4655 @samp{01;36} is bold cyan, @samp{32} is green, @samp{34} is blue,
4656 @samp{01} is bold, and @samp{31} is red.
4657 Setting @env{GCC_COLORS} to the empty string disables colors.
4658 Supported capabilities are as follows.
4660 @table @code
4661 @item error=
4662 @vindex error GCC_COLORS @r{capability}
4663 SGR substring for error: markers.
4665 @item warning=
4666 @vindex warning GCC_COLORS @r{capability}
4667 SGR substring for warning: markers.
4669 @item note=
4670 @vindex note GCC_COLORS @r{capability}
4671 SGR substring for note: markers.
4673 @item path=
4674 @vindex path GCC_COLORS @r{capability}
4675 SGR substring for colorizing paths of control-flow events as printed
4676 via @option{-fdiagnostics-path-format=}, such as the identifiers of
4677 individual events and lines indicating interprocedural calls and returns.
4679 @item range1=
4680 @vindex range1 GCC_COLORS @r{capability}
4681 SGR substring for first additional range.
4683 @item range2=
4684 @vindex range2 GCC_COLORS @r{capability}
4685 SGR substring for second additional range.
4687 @item locus=
4688 @vindex locus GCC_COLORS @r{capability}
4689 SGR substring for location information, @samp{file:line} or
4690 @samp{file:line:column} etc.
4692 @item quote=
4693 @vindex quote GCC_COLORS @r{capability}
4694 SGR substring for information printed within quotes.
4696 @item fixit-insert=
4697 @vindex fixit-insert GCC_COLORS @r{capability}
4698 SGR substring for fix-it hints suggesting text to
4699 be inserted or replaced.
4701 @item fixit-delete=
4702 @vindex fixit-delete GCC_COLORS @r{capability}
4703 SGR substring for fix-it hints suggesting text to
4704 be deleted.
4706 @item diff-filename=
4707 @vindex diff-filename GCC_COLORS @r{capability}
4708 SGR substring for filename headers within generated patches.
4710 @item diff-hunk=
4711 @vindex diff-hunk GCC_COLORS @r{capability}
4712 SGR substring for the starts of hunks within generated patches.
4714 @item diff-delete=
4715 @vindex diff-delete GCC_COLORS @r{capability}
4716 SGR substring for deleted lines within generated patches.
4718 @item diff-insert=
4719 @vindex diff-insert GCC_COLORS @r{capability}
4720 SGR substring for inserted lines within generated patches.
4722 @item type-diff=
4723 @vindex type-diff GCC_COLORS @r{capability}
4724 SGR substring for highlighting mismatching types within template
4725 arguments in the C++ frontend.
4726 @end table
4728 @item -fdiagnostics-urls[=@var{WHEN}]
4729 @opindex fdiagnostics-urls
4730 @cindex urls
4731 @vindex GCC_URLS @r{environment variable}
4732 @vindex TERM_URLS @r{environment variable}
4733 Use escape sequences to embed URLs in diagnostics.  For example, when
4734 @option{-fdiagnostics-show-option} emits text showing the command-line
4735 option controlling a diagnostic, embed a URL for documentation of that
4736 option.
4738 @var{WHEN} is @samp{never}, @samp{always}, or @samp{auto}.
4739 @samp{auto} makes GCC use URL escape sequences only when the standard error
4740 is a terminal, and when not executing in an emacs shell or any graphical
4741 terminal which is known to be incompatible with this feature, see below.
4743 The default depends on how the compiler has been configured.
4744 It can be any of the above @var{WHEN} options.
4746 GCC can also be configured (via the
4747 @option{--with-diagnostics-urls=auto-if-env} configure-time option)
4748 so that the default is affected by environment variables.
4749 Under such a configuration, GCC defaults to using @samp{auto}
4750 if either @env{GCC_URLS} or @env{TERM_URLS} environment variables are
4751 present and non-empty in the environment of the compiler, or @samp{never}
4752 if neither are.
4754 However, even with @option{-fdiagnostics-urls=always} the behavior is
4755 dependent on those environment variables:
4756 If @env{GCC_URLS} is set to empty or @samp{no}, do not embed URLs in
4757 diagnostics.  If set to @samp{st}, URLs use ST escape sequences.
4758 If set to @samp{bel}, the default, URLs use BEL escape sequences.
4759 Any other non-empty value enables the feature.
4760 If @env{GCC_URLS} is not set, use @env{TERM_URLS} as a fallback.
4761 Note: ST is an ANSI escape sequence, string terminator @samp{ESC \},
4762 BEL is an ASCII character, CTRL-G that usually sounds like a beep.
4764 At this time GCC tries to detect also a few terminals that are known to
4765 not implement the URL feature, and have bugs or at least had bugs in
4766 some versions that are still in use, where the URL escapes are likely
4767 to misbehave, i.e. print garbage on the screen.
4768 That list is currently xfce4-terminal, certain known to be buggy
4769 gnome-terminal versions, the linux console, and mingw.
4770 This check can be skipped with the @option{-fdiagnostics-urls=always}.
4772 @item -fno-diagnostics-show-option
4773 @opindex fno-diagnostics-show-option
4774 @opindex fdiagnostics-show-option
4775 By default, each diagnostic emitted includes text indicating the
4776 command-line option that directly controls the diagnostic (if such an
4777 option is known to the diagnostic machinery).  Specifying the
4778 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
4780 @item -fno-diagnostics-show-caret
4781 @opindex fno-diagnostics-show-caret
4782 @opindex fdiagnostics-show-caret
4783 By default, each diagnostic emitted includes the original source line
4784 and a caret @samp{^} indicating the column.  This option suppresses this
4785 information.  The source line is truncated to @var{n} characters, if
4786 the @option{-fmessage-length=n} option is given.  When the output is done
4787 to the terminal, the width is limited to the width given by the
4788 @env{COLUMNS} environment variable or, if not set, to the terminal width.
4790 @item -fno-diagnostics-show-labels
4791 @opindex fno-diagnostics-show-labels
4792 @opindex fdiagnostics-show-labels
4793 By default, when printing source code (via @option{-fdiagnostics-show-caret}),
4794 diagnostics can label ranges of source code with pertinent information, such
4795 as the types of expressions:
4797 @smallexample
4798     printf ("foo %s bar", long_i + long_j);
4799                  ~^       ~~~~~~~~~~~~~~~
4800                   |              |
4801                   char *         long int
4802 @end smallexample
4804 This option suppresses the printing of these labels (in the example above,
4805 the vertical bars and the ``char *'' and ``long int'' text).
4807 @item -fno-diagnostics-show-cwe
4808 @opindex fno-diagnostics-show-cwe
4809 @opindex fdiagnostics-show-cwe
4810 Diagnostic messages can optionally have an associated
4811 @url{https://cwe.mitre.org/index.html, CWE} identifier.
4812 GCC itself only provides such metadata for some of the @option{-fanalyzer}
4813 diagnostics.  GCC plugins may also provide diagnostics with such metadata.
4814 By default, if this information is present, it will be printed with
4815 the diagnostic.  This option suppresses the printing of this metadata.
4817 @item -fno-diagnostics-show-line-numbers
4818 @opindex fno-diagnostics-show-line-numbers
4819 @opindex fdiagnostics-show-line-numbers
4820 By default, when printing source code (via @option{-fdiagnostics-show-caret}),
4821 a left margin is printed, showing line numbers.  This option suppresses this
4822 left margin.
4824 @item -fdiagnostics-minimum-margin-width=@var{width}
4825 @opindex fdiagnostics-minimum-margin-width
4826 This option controls the minimum width of the left margin printed by
4827 @option{-fdiagnostics-show-line-numbers}.  It defaults to 6.
4829 @item -fdiagnostics-parseable-fixits
4830 @opindex fdiagnostics-parseable-fixits
4831 Emit fix-it hints in a machine-parseable format, suitable for consumption
4832 by IDEs.  For each fix-it, a line will be printed after the relevant
4833 diagnostic, starting with the string ``fix-it:''.  For example:
4835 @smallexample
4836 fix-it:"test.c":@{45:3-45:21@}:"gtk_widget_show_all"
4837 @end smallexample
4839 The location is expressed as a half-open range, expressed as a count of
4840 bytes, starting at byte 1 for the initial column.  In the above example,
4841 bytes 3 through 20 of line 45 of ``test.c'' are to be replaced with the
4842 given string:
4844 @smallexample
4845 00000000011111111112222222222
4846 12345678901234567890123456789
4847   gtk_widget_showall (dlg);
4848   ^^^^^^^^^^^^^^^^^^
4849   gtk_widget_show_all
4850 @end smallexample
4852 The filename and replacement string escape backslash as ``\\", tab as ``\t'',
4853 newline as ``\n'', double quotes as ``\"'', non-printable characters as octal
4854 (e.g. vertical tab as ``\013'').
4856 An empty replacement string indicates that the given range is to be removed.
4857 An empty range (e.g. ``45:3-45:3'') indicates that the string is to
4858 be inserted at the given position.
4860 @item -fdiagnostics-generate-patch
4861 @opindex fdiagnostics-generate-patch
4862 Print fix-it hints to stderr in unified diff format, after any diagnostics
4863 are printed.  For example:
4865 @smallexample
4866 --- test.c
4867 +++ test.c
4868 @@ -42,5 +42,5 @@
4870  void show_cb(GtkDialog *dlg)
4871  @{
4872 -  gtk_widget_showall(dlg);
4873 +  gtk_widget_show_all(dlg);
4874  @}
4876 @end smallexample
4878 The diff may or may not be colorized, following the same rules
4879 as for diagnostics (see @option{-fdiagnostics-color}).
4881 @item -fdiagnostics-show-template-tree
4882 @opindex fdiagnostics-show-template-tree
4884 In the C++ frontend, when printing diagnostics showing mismatching
4885 template types, such as:
4887 @smallexample
4888   could not convert 'std::map<int, std::vector<double> >()'
4889     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
4890 @end smallexample
4892 the @option{-fdiagnostics-show-template-tree} flag enables printing a
4893 tree-like structure showing the common and differing parts of the types,
4894 such as:
4896 @smallexample
4897   map<
4898     [...],
4899     vector<
4900       [double != float]>>
4901 @end smallexample
4903 The parts that differ are highlighted with color (``double'' and
4904 ``float'' in this case).
4906 @item -fno-elide-type
4907 @opindex fno-elide-type
4908 @opindex felide-type
4909 By default when the C++ frontend prints diagnostics showing mismatching
4910 template types, common parts of the types are printed as ``[...]'' to
4911 simplify the error message.  For example:
4913 @smallexample
4914   could not convert 'std::map<int, std::vector<double> >()'
4915     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
4916 @end smallexample
4918 Specifying the @option{-fno-elide-type} flag suppresses that behavior.
4919 This flag also affects the output of the
4920 @option{-fdiagnostics-show-template-tree} flag.
4922 @item -fdiagnostics-path-format=@var{KIND}
4923 @opindex fdiagnostics-path-format
4924 Specify how to print paths of control-flow events for diagnostics that
4925 have such a path associated with them.
4927 @var{KIND} is @samp{none}, @samp{separate-events}, or @samp{inline-events},
4928 the default.
4930 @samp{none} means to not print diagnostic paths.
4932 @samp{separate-events} means to print a separate ``note'' diagnostic for
4933 each event within the diagnostic.  For example:
4935 @smallexample
4936 test.c:29:5: error: passing NULL as argument 1 to 'PyList_Append' which requires a non-NULL parameter
4937 test.c:25:10: note: (1) when 'PyList_New' fails, returning NULL
4938 test.c:27:3: note: (2) when 'i < count'
4939 test.c:29:5: note: (3) when calling 'PyList_Append', passing NULL from (1) as argument 1
4940 @end smallexample
4942 @samp{inline-events} means to print the events ``inline'' within the source
4943 code.  This view attempts to consolidate the events into runs of
4944 sufficiently-close events, printing them as labelled ranges within the source.
4946 For example, the same events as above might be printed as:
4948 @smallexample
4949   'test': events 1-3
4950     |
4951     |   25 |   list = PyList_New(0);
4952     |      |          ^~~~~~~~~~~~~
4953     |      |          |
4954     |      |          (1) when 'PyList_New' fails, returning NULL
4955     |   26 |
4956     |   27 |   for (i = 0; i < count; i++) @{
4957     |      |   ~~~
4958     |      |   |
4959     |      |   (2) when 'i < count'
4960     |   28 |     item = PyLong_FromLong(random());
4961     |   29 |     PyList_Append(list, item);
4962     |      |     ~~~~~~~~~~~~~~~~~~~~~~~~~
4963     |      |     |
4964     |      |     (3) when calling 'PyList_Append', passing NULL from (1) as argument 1
4965     |
4966 @end smallexample
4968 Interprocedural control flow is shown by grouping the events by stack frame,
4969 and using indentation to show how stack frames are nested, pushed, and popped.
4971 For example:
4973 @smallexample
4974   'test': events 1-2
4975     |
4976     |  133 | @{
4977     |      | ^
4978     |      | |
4979     |      | (1) entering 'test'
4980     |  134 |   boxed_int *obj = make_boxed_int (i);
4981     |      |                    ~~~~~~~~~~~~~~~~~~
4982     |      |                    |
4983     |      |                    (2) calling 'make_boxed_int'
4984     |
4985     +--> 'make_boxed_int': events 3-4
4986            |
4987            |  120 | @{
4988            |      | ^
4989            |      | |
4990            |      | (3) entering 'make_boxed_int'
4991            |  121 |   boxed_int *result = (boxed_int *)wrapped_malloc (sizeof (boxed_int));
4992            |      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4993            |      |                                    |
4994            |      |                                    (4) calling 'wrapped_malloc'
4995            |
4996            +--> 'wrapped_malloc': events 5-6
4997                   |
4998                   |    7 | @{
4999                   |      | ^
5000                   |      | |
5001                   |      | (5) entering 'wrapped_malloc'
5002                   |    8 |   return malloc (size);
5003                   |      |          ~~~~~~~~~~~~~
5004                   |      |          |
5005                   |      |          (6) calling 'malloc'
5006                   |
5007     <-------------+
5008     |
5009  'test': event 7
5010     |
5011     |  138 |   free_boxed_int (obj);
5012     |      |   ^~~~~~~~~~~~~~~~~~~~
5013     |      |   |
5014     |      |   (7) calling 'free_boxed_int'
5015     |
5016 (etc)
5017 @end smallexample
5019 @item -fdiagnostics-show-path-depths
5020 @opindex fdiagnostics-show-path-depths
5021 This option provides additional information when printing control-flow paths
5022 associated with a diagnostic.
5024 If this is option is provided then the stack depth will be printed for
5025 each run of events within @option{-fdiagnostics-path-format=separate-events}.
5027 This is intended for use by GCC developers and plugin developers when
5028 debugging diagnostics that report interprocedural control flow.
5030 @item -fno-show-column
5031 @opindex fno-show-column
5032 @opindex fshow-column
5033 Do not print column numbers in diagnostics.  This may be necessary if
5034 diagnostics are being scanned by a program that does not understand the
5035 column numbers, such as @command{dejagnu}.
5037 @item -fdiagnostics-column-unit=@var{UNIT}
5038 @opindex fdiagnostics-column-unit
5039 Select the units for the column number.  This affects traditional diagnostics
5040 (in the absence of @option{-fno-show-column}), as well as JSON format
5041 diagnostics if requested.
5043 The default @var{UNIT}, @samp{display}, considers the number of display
5044 columns occupied by each character.  This may be larger than the number
5045 of bytes required to encode the character, in the case of tab
5046 characters, or it may be smaller, in the case of multibyte characters.
5047 For example, the character ``GREEK SMALL LETTER PI (U+03C0)'' occupies one
5048 display column, and its UTF-8 encoding requires two bytes; the character
5049 ``SLIGHTLY SMILING FACE (U+1F642)'' occupies two display columns, and
5050 its UTF-8 encoding requires four bytes.
5052 Setting @var{UNIT} to @samp{byte} changes the column number to the raw byte
5053 count in all cases, as was traditionally output by GCC prior to version 11.1.0.
5055 @item -fdiagnostics-column-origin=@var{ORIGIN}
5056 @opindex fdiagnostics-column-origin
5057 Select the origin for column numbers, i.e. the column number assigned to the
5058 first column.  The default value of 1 corresponds to traditional GCC
5059 behavior and to the GNU style guide.  Some utilities may perform better with an
5060 origin of 0; any non-negative value may be specified.
5062 @item -fdiagnostics-format=@var{FORMAT}
5063 @opindex fdiagnostics-format
5064 Select a different format for printing diagnostics.
5065 @var{FORMAT} is @samp{text} or @samp{json}.
5066 The default is @samp{text}.
5068 The @samp{json} format consists of a top-level JSON array containing JSON
5069 objects representing the diagnostics.
5071 The JSON is emitted as one line, without formatting; the examples below
5072 have been formatted for clarity.
5074 Diagnostics can have child diagnostics.  For example, this error and note:
5076 @smallexample
5077 misleading-indentation.c:15:3: warning: this 'if' clause does not
5078   guard... [-Wmisleading-indentation]
5079    15 |   if (flag)
5080       |   ^~
5081 misleading-indentation.c:17:5: note: ...this statement, but the latter
5082   is misleadingly indented as if it were guarded by the 'if'
5083    17 |     y = 2;
5084       |     ^
5085 @end smallexample
5087 @noindent
5088 might be printed in JSON form (after formatting) like this:
5090 @smallexample
5092     @{
5093         "kind": "warning",
5094         "locations": [
5095             @{
5096                 "caret": @{
5097                     "display-column": 3,
5098                     "byte-column": 3,
5099                     "column": 3,
5100                     "file": "misleading-indentation.c",
5101                     "line": 15
5102                 @},
5103                 "finish": @{
5104                     "display-column": 4,
5105                     "byte-column": 4,
5106                     "column": 4,
5107                     "file": "misleading-indentation.c",
5108                     "line": 15
5109                 @}
5110             @}
5111         ],
5112         "message": "this \u2018if\u2019 clause does not guard...",
5113         "option": "-Wmisleading-indentation",
5114         "option_url": "https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wmisleading-indentation",
5115         "children": [
5116             @{
5117                 "kind": "note",
5118                 "locations": [
5119                     @{
5120                         "caret": @{
5121                             "display-column": 5,
5122                             "byte-column": 5,
5123                             "column": 5,
5124                             "file": "misleading-indentation.c",
5125                             "line": 17
5126                         @}
5127                     @}
5128                 ],
5129                 "message": "...this statement, but the latter is @dots{}"
5130             @}
5131         ]
5132         "column-origin": 1,
5133     @},
5134     @dots{}
5136 @end smallexample
5138 @noindent
5139 where the @code{note} is a child of the @code{warning}.
5141 A diagnostic has a @code{kind}.  If this is @code{warning}, then there is
5142 an @code{option} key describing the command-line option controlling the
5143 warning.
5145 A diagnostic can contain zero or more locations.  Each location has an
5146 optional @code{label} string and up to three positions within it: a
5147 @code{caret} position and optional @code{start} and @code{finish} positions.
5148 A position is described by a @code{file} name, a @code{line} number, and
5149 three numbers indicating a column position:
5150 @itemize @bullet
5152 @item
5153 @code{display-column} counts display columns, accounting for tabs and
5154 multibyte characters.
5156 @item
5157 @code{byte-column} counts raw bytes.
5159 @item
5160 @code{column} is equal to one of
5161 the previous two, as dictated by the @option{-fdiagnostics-column-unit}
5162 option.
5164 @end itemize
5165 All three columns are relative to the origin specified by
5166 @option{-fdiagnostics-column-origin}, which is typically equal to 1 but may
5167 be set, for instance, to 0 for compatibility with other utilities that
5168 number columns from 0.  The column origin is recorded in the JSON output in
5169 the @code{column-origin} tag.  In the remaining examples below, the extra
5170 column number outputs have been omitted for brevity.
5172 For example, this error:
5174 @smallexample
5175 bad-binary-ops.c:64:23: error: invalid operands to binary + (have 'S' @{aka
5176    'struct s'@} and 'T' @{aka 'struct t'@})
5177    64 |   return callee_4a () + callee_4b ();
5178       |          ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
5179       |          |              |
5180       |          |              T @{aka struct t@}
5181       |          S @{aka struct s@}
5182 @end smallexample
5184 @noindent
5185 has three locations.  Its primary location is at the ``+'' token at column
5186 23.  It has two secondary locations, describing the left and right-hand sides
5187 of the expression, which have labels.  It might be printed in JSON form as:
5189 @smallexample
5190     @{
5191         "children": [],
5192         "kind": "error",
5193         "locations": [
5194             @{
5195                 "caret": @{
5196                     "column": 23, "file": "bad-binary-ops.c", "line": 64
5197                 @}
5198             @},
5199             @{
5200                 "caret": @{
5201                     "column": 10, "file": "bad-binary-ops.c", "line": 64
5202                 @},
5203                 "finish": @{
5204                     "column": 21, "file": "bad-binary-ops.c", "line": 64
5205                 @},
5206                 "label": "S @{aka struct s@}"
5207             @},
5208             @{
5209                 "caret": @{
5210                     "column": 25, "file": "bad-binary-ops.c", "line": 64
5211                 @},
5212                 "finish": @{
5213                     "column": 36, "file": "bad-binary-ops.c", "line": 64
5214                 @},
5215                 "label": "T @{aka struct t@}"
5216             @}
5217         ],
5218         "message": "invalid operands to binary + @dots{}"
5219     @}
5220 @end smallexample
5222 If a diagnostic contains fix-it hints, it has a @code{fixits} array,
5223 consisting of half-open intervals, similar to the output of
5224 @option{-fdiagnostics-parseable-fixits}.  For example, this diagnostic
5225 with a replacement fix-it hint:
5227 @smallexample
5228 demo.c:8:15: error: 'struct s' has no member named 'colour'; did you
5229   mean 'color'?
5230     8 |   return ptr->colour;
5231       |               ^~~~~~
5232       |               color
5233 @end smallexample
5235 @noindent
5236 might be printed in JSON form as:
5238 @smallexample
5239     @{
5240         "children": [],
5241         "fixits": [
5242             @{
5243                 "next": @{
5244                     "column": 21,
5245                     "file": "demo.c",
5246                     "line": 8
5247                 @},
5248                 "start": @{
5249                     "column": 15,
5250                     "file": "demo.c",
5251                     "line": 8
5252                 @},
5253                 "string": "color"
5254             @}
5255         ],
5256         "kind": "error",
5257         "locations": [
5258             @{
5259                 "caret": @{
5260                     "column": 15,
5261                     "file": "demo.c",
5262                     "line": 8
5263                 @},
5264                 "finish": @{
5265                     "column": 20,
5266                     "file": "demo.c",
5267                     "line": 8
5268                 @}
5269             @}
5270         ],
5271         "message": "\u2018struct s\u2019 has no member named @dots{}"
5272     @}
5273 @end smallexample
5275 @noindent
5276 where the fix-it hint suggests replacing the text from @code{start} up
5277 to but not including @code{next} with @code{string}'s value.  Deletions
5278 are expressed via an empty value for @code{string}, insertions by
5279 having @code{start} equal @code{next}.
5281 If the diagnostic has a path of control-flow events associated with it,
5282 it has a @code{path} array of objects representing the events.  Each
5283 event object has a @code{description} string, a @code{location} object,
5284 along with a @code{function} string and a @code{depth} number for
5285 representing interprocedural paths.  The @code{function} represents the
5286 current function at that event, and the @code{depth} represents the
5287 stack depth relative to some baseline: the higher, the more frames are
5288 within the stack.
5290 For example, the intraprocedural example shown for
5291 @option{-fdiagnostics-path-format=} might have this JSON for its path:
5293 @smallexample
5294     "path": [
5295         @{
5296             "depth": 0,
5297             "description": "when 'PyList_New' fails, returning NULL",
5298             "function": "test",
5299             "location": @{
5300                 "column": 10,
5301                 "file": "test.c",
5302                 "line": 25
5303             @}
5304         @},
5305         @{
5306             "depth": 0,
5307             "description": "when 'i < count'",
5308             "function": "test",
5309             "location": @{
5310                 "column": 3,
5311                 "file": "test.c",
5312                 "line": 27
5313             @}
5314         @},
5315         @{
5316             "depth": 0,
5317             "description": "when calling 'PyList_Append', passing NULL from (1) as argument 1",
5318             "function": "test",
5319             "location": @{
5320                 "column": 5,
5321                 "file": "test.c",
5322                 "line": 29
5323             @}
5324         @}
5325     ]
5326 @end smallexample
5328 @end table
5330 @node Warning Options
5331 @section Options to Request or Suppress Warnings
5332 @cindex options to control warnings
5333 @cindex warning messages
5334 @cindex messages, warning
5335 @cindex suppressing warnings
5337 Warnings are diagnostic messages that report constructions that
5338 are not inherently erroneous but that are risky or suggest there
5339 may have been an error.
5341 The following language-independent options do not enable specific
5342 warnings but control the kinds of diagnostics produced by GCC@.
5344 @table @gcctabopt
5345 @cindex syntax checking
5346 @item -fsyntax-only
5347 @opindex fsyntax-only
5348 Check the code for syntax errors, but don't do anything beyond that.
5350 @item -fmax-errors=@var{n}
5351 @opindex fmax-errors
5352 Limits the maximum number of error messages to @var{n}, at which point
5353 GCC bails out rather than attempting to continue processing the source
5354 code.  If @var{n} is 0 (the default), there is no limit on the number
5355 of error messages produced.  If @option{-Wfatal-errors} is also
5356 specified, then @option{-Wfatal-errors} takes precedence over this
5357 option.
5359 @item -w
5360 @opindex w
5361 Inhibit all warning messages.
5363 @item -Werror
5364 @opindex Werror
5365 @opindex Wno-error
5366 Make all warnings into errors.
5368 @item -Werror=
5369 @opindex Werror=
5370 @opindex Wno-error=
5371 Make the specified warning into an error.  The specifier for a warning
5372 is appended; for example @option{-Werror=switch} turns the warnings
5373 controlled by @option{-Wswitch} into errors.  This switch takes a
5374 negative form, to be used to negate @option{-Werror} for specific
5375 warnings; for example @option{-Wno-error=switch} makes
5376 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
5377 is in effect.
5379 The warning message for each controllable warning includes the
5380 option that controls the warning.  That option can then be used with
5381 @option{-Werror=} and @option{-Wno-error=} as described above.
5382 (Printing of the option in the warning message can be disabled using the
5383 @option{-fno-diagnostics-show-option} flag.)
5385 Note that specifying @option{-Werror=}@var{foo} automatically implies
5386 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
5387 imply anything.
5389 @item -Wfatal-errors
5390 @opindex Wfatal-errors
5391 @opindex Wno-fatal-errors
5392 This option causes the compiler to abort compilation on the first error
5393 occurred rather than trying to keep going and printing further error
5394 messages.
5396 @end table
5398 You can request many specific warnings with options beginning with
5399 @samp{-W}, for example @option{-Wimplicit} to request warnings on
5400 implicit declarations.  Each of these specific warning options also
5401 has a negative form beginning @samp{-Wno-} to turn off warnings; for
5402 example, @option{-Wno-implicit}.  This manual lists only one of the
5403 two forms, whichever is not the default.  For further
5404 language-specific options also refer to @ref{C++ Dialect Options} and
5405 @ref{Objective-C and Objective-C++ Dialect Options}.
5406 Additional warnings can be produced by enabling the static analyzer;
5407 @xref{Static Analyzer Options}.
5409 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
5410 options, such as @option{-Wunused}, which may turn on further options,
5411 such as @option{-Wunused-value}. The combined effect of positive and
5412 negative forms is that more specific options have priority over less
5413 specific ones, independently of their position in the command-line. For
5414 options of the same specificity, the last one takes effect. Options
5415 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
5416 as if they appeared at the end of the command-line.
5418 When an unrecognized warning option is requested (e.g.,
5419 @option{-Wunknown-warning}), GCC emits a diagnostic stating
5420 that the option is not recognized.  However, if the @option{-Wno-} form
5421 is used, the behavior is slightly different: no diagnostic is
5422 produced for @option{-Wno-unknown-warning} unless other diagnostics
5423 are being produced.  This allows the use of new @option{-Wno-} options
5424 with old compilers, but if something goes wrong, the compiler
5425 warns that an unrecognized option is present.
5427 The effectiveness of some warnings depends on optimizations also being
5428 enabled. For example @option{-Wsuggest-final-types} is more effective
5429 with link-time optimization and @option{-Wmaybe-uninitialized} does not
5430 warn at all unless optimization is enabled.
5432 @table @gcctabopt
5433 @item -Wpedantic
5434 @itemx -pedantic
5435 @opindex pedantic
5436 @opindex Wpedantic
5437 @opindex Wno-pedantic
5438 Issue all the warnings demanded by strict ISO C and ISO C++;
5439 reject all programs that use forbidden extensions, and some other
5440 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
5441 version of the ISO C standard specified by any @option{-std} option used.
5443 Valid ISO C and ISO C++ programs should compile properly with or without
5444 this option (though a rare few require @option{-ansi} or a
5445 @option{-std} option specifying the required version of ISO C)@.  However,
5446 without this option, certain GNU extensions and traditional C and C++
5447 features are supported as well.  With this option, they are rejected.
5449 @option{-Wpedantic} does not cause warning messages for use of the
5450 alternate keywords whose names begin and end with @samp{__}.  This alternate
5451 format can also be used to disable warnings for non-ISO @samp{__intN} types,
5452 i.e. @samp{__intN__}.
5453 Pedantic warnings are also disabled in the expression that follows
5454 @code{__extension__}.  However, only system header files should use
5455 these escape routes; application programs should avoid them.
5456 @xref{Alternate Keywords}.
5458 Some users try to use @option{-Wpedantic} to check programs for strict ISO
5459 C conformance.  They soon find that it does not do quite what they want:
5460 it finds some non-ISO practices, but not all---only those for which
5461 ISO C @emph{requires} a diagnostic, and some others for which
5462 diagnostics have been added.
5464 A feature to report any failure to conform to ISO C might be useful in
5465 some instances, but would require considerable additional work and would
5466 be quite different from @option{-Wpedantic}.  We don't have plans to
5467 support such a feature in the near future.
5469 Where the standard specified with @option{-std} represents a GNU
5470 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
5471 corresponding @dfn{base standard}, the version of ISO C on which the GNU
5472 extended dialect is based.  Warnings from @option{-Wpedantic} are given
5473 where they are required by the base standard.  (It does not make sense
5474 for such warnings to be given only for features not in the specified GNU
5475 C dialect, since by definition the GNU dialects of C include all
5476 features the compiler supports with the given option, and there would be
5477 nothing to warn about.)
5479 @item -pedantic-errors
5480 @opindex pedantic-errors
5481 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
5482 requires a diagnostic, in some cases where there is undefined behavior
5483 at compile-time and in some other cases that do not prevent compilation
5484 of programs that are valid according to the standard. This is not
5485 equivalent to @option{-Werror=pedantic}, since there are errors enabled
5486 by this option and not enabled by the latter and vice versa.
5488 @item -Wall
5489 @opindex Wall
5490 @opindex Wno-all
5491 This enables all the warnings about constructions that some users
5492 consider questionable, and that are easy to avoid (or modify to
5493 prevent the warning), even in conjunction with macros.  This also
5494 enables some language-specific warnings described in @ref{C++ Dialect
5495 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
5497 @option{-Wall} turns on the following warning flags:
5499 @gccoptlist{-Waddress   @gol
5500 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
5501 -Warray-parameter=2 @r{(C and Objective-C only)} @gol
5502 -Wbool-compare  @gol
5503 -Wbool-operation  @gol
5504 -Wc++11-compat  -Wc++14-compat  @gol
5505 -Wcatch-value @r{(C++ and Objective-C++ only)}  @gol
5506 -Wchar-subscripts  @gol
5507 -Wcomment  @gol
5508 -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
5509 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
5510 -Wformat   @gol
5511 -Wformat-overflow  @gol
5512 -Wformat-truncation  @gol
5513 -Wint-in-bool-context  @gol
5514 -Wimplicit @r{(C and Objective-C only)} @gol
5515 -Wimplicit-int @r{(C and Objective-C only)} @gol
5516 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
5517 -Winit-self @r{(only for C++)} @gol
5518 -Wlogical-not-parentheses @gol
5519 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
5520 -Wmaybe-uninitialized @gol
5521 -Wmemset-elt-size @gol
5522 -Wmemset-transposed-args @gol
5523 -Wmisleading-indentation @r{(only for C/C++)} @gol
5524 -Wmissing-attributes @gol
5525 -Wmissing-braces @r{(only for C/ObjC)} @gol
5526 -Wmultistatement-macros  @gol
5527 -Wnarrowing @r{(only for C++)}  @gol
5528 -Wnonnull  @gol
5529 -Wnonnull-compare  @gol
5530 -Wopenmp-simd @gol
5531 -Wparentheses  @gol
5532 -Wpessimizing-move @r{(only for C++)}  @gol
5533 -Wpointer-sign  @gol
5534 -Wrange-loop-construct @r{(only for C++)}  @gol
5535 -Wreorder   @gol
5536 -Wrestrict   @gol
5537 -Wreturn-type  @gol
5538 -Wsequence-point  @gol
5539 -Wsign-compare @r{(only in C++)}  @gol
5540 -Wsizeof-array-div @gol
5541 -Wsizeof-pointer-div @gol
5542 -Wsizeof-pointer-memaccess @gol
5543 -Wstrict-aliasing  @gol
5544 -Wstrict-overflow=1  @gol
5545 -Wswitch  @gol
5546 -Wtautological-compare  @gol
5547 -Wtrigraphs  @gol
5548 -Wuninitialized  @gol
5549 -Wunknown-pragmas  @gol
5550 -Wunused-function  @gol
5551 -Wunused-label     @gol
5552 -Wunused-value     @gol
5553 -Wunused-variable  @gol
5554 -Wvla-parameter @r{(C and Objective-C only)} @gol
5555 -Wvolatile-register-var  @gol
5556 -Wzero-length-bounds}
5558 Note that some warning flags are not implied by @option{-Wall}.  Some of
5559 them warn about constructions that users generally do not consider
5560 questionable, but which occasionally you might wish to check for;
5561 others warn about constructions that are necessary or hard to avoid in
5562 some cases, and there is no simple way to modify the code to suppress
5563 the warning. Some of them are enabled by @option{-Wextra} but many of
5564 them must be enabled individually.
5566 @item -Wextra
5567 @opindex W
5568 @opindex Wextra
5569 @opindex Wno-extra
5570 This enables some extra warning flags that are not enabled by
5571 @option{-Wall}. (This option used to be called @option{-W}.  The older
5572 name is still supported, but the newer name is more descriptive.)
5574 @gccoptlist{-Wclobbered  @gol
5575 -Wcast-function-type  @gol
5576 -Wdeprecated-copy @r{(C++ only)} @gol
5577 -Wempty-body  @gol
5578 -Wenum-conversion @r{(C only)} @gol
5579 -Wignored-qualifiers @gol
5580 -Wimplicit-fallthrough=3 @gol
5581 -Wmissing-field-initializers  @gol
5582 -Wmissing-parameter-type @r{(C only)}  @gol
5583 -Wold-style-declaration @r{(C only)}  @gol
5584 -Woverride-init  @gol
5585 -Wsign-compare @r{(C only)} @gol
5586 -Wstring-compare @gol
5587 -Wredundant-move @r{(only for C++)}  @gol
5588 -Wtype-limits  @gol
5589 -Wuninitialized  @gol
5590 -Wshift-negative-value @r{(in C++03 and in C99 and newer)}  @gol
5591 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
5592 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}}
5595 The option @option{-Wextra} also prints warning messages for the
5596 following cases:
5598 @itemize @bullet
5600 @item
5601 A pointer is compared against integer zero with @code{<}, @code{<=},
5602 @code{>}, or @code{>=}.
5604 @item
5605 (C++ only) An enumerator and a non-enumerator both appear in a
5606 conditional expression.
5608 @item
5609 (C++ only) Ambiguous virtual bases.
5611 @item
5612 (C++ only) Subscripting an array that has been declared @code{register}.
5614 @item
5615 (C++ only) Taking the address of a variable that has been declared
5616 @code{register}.
5618 @item
5619 (C++ only) A base class is not initialized in the copy constructor
5620 of a derived class.
5622 @end itemize
5624 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
5625 @opindex Wabi
5626 @opindex Wno-abi
5628 Warn about code affected by ABI changes.  This includes code that may
5629 not be compatible with the vendor-neutral C++ ABI as well as the psABI
5630 for the particular target.
5632 Since G++ now defaults to updating the ABI with each major release,
5633 normally @option{-Wabi} warns only about C++ ABI compatibility
5634 problems if there is a check added later in a release series for an
5635 ABI issue discovered since the initial release.  @option{-Wabi} warns
5636 about more things if an older ABI version is selected (with
5637 @option{-fabi-version=@var{n}}).
5639 @option{-Wabi} can also be used with an explicit version number to
5640 warn about C++ ABI compatibility with a particular @option{-fabi-version}
5641 level, e.g.@: @option{-Wabi=2} to warn about changes relative to
5642 @option{-fabi-version=2}.
5644 If an explicit version number is provided and
5645 @option{-fabi-compat-version} is not specified, the version number
5646 from this option is used for compatibility aliases.  If no explicit
5647 version number is provided with this option, but
5648 @option{-fabi-compat-version} is specified, that version number is
5649 used for C++ ABI warnings.
5651 Although an effort has been made to warn about
5652 all such cases, there are probably some cases that are not warned about,
5653 even though G++ is generating incompatible code.  There may also be
5654 cases where warnings are emitted even though the code that is generated
5655 is compatible.
5657 You should rewrite your code to avoid these warnings if you are
5658 concerned about the fact that code generated by G++ may not be binary
5659 compatible with code generated by other compilers.
5661 Known incompatibilities in @option{-fabi-version=2} (which was the
5662 default from GCC 3.4 to 4.9) include:
5664 @itemize @bullet
5666 @item
5667 A template with a non-type template parameter of reference type was
5668 mangled incorrectly:
5669 @smallexample
5670 extern int N;
5671 template <int &> struct S @{@};
5672 void n (S<N>) @{2@}
5673 @end smallexample
5675 This was fixed in @option{-fabi-version=3}.
5677 @item
5678 SIMD vector types declared using @code{__attribute ((vector_size))} were
5679 mangled in a non-standard way that does not allow for overloading of
5680 functions taking vectors of different sizes.
5682 The mangling was changed in @option{-fabi-version=4}.
5684 @item
5685 @code{__attribute ((const))} and @code{noreturn} were mangled as type
5686 qualifiers, and @code{decltype} of a plain declaration was folded away.
5688 These mangling issues were fixed in @option{-fabi-version=5}.
5690 @item
5691 Scoped enumerators passed as arguments to a variadic function are
5692 promoted like unscoped enumerators, causing @code{va_arg} to complain.
5693 On most targets this does not actually affect the parameter passing
5694 ABI, as there is no way to pass an argument smaller than @code{int}.
5696 Also, the ABI changed the mangling of template argument packs,
5697 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
5698 a class scope function used as a template argument.
5700 These issues were corrected in @option{-fabi-version=6}.
5702 @item
5703 Lambdas in default argument scope were mangled incorrectly, and the
5704 ABI changed the mangling of @code{nullptr_t}.
5706 These issues were corrected in @option{-fabi-version=7}.
5708 @item
5709 When mangling a function type with function-cv-qualifiers, the
5710 un-qualified function type was incorrectly treated as a substitution
5711 candidate.
5713 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
5715 @item
5716 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
5717 unaligned accesses.  Note that this did not affect the ABI of a
5718 function with a @code{nullptr_t} parameter, as parameters have a
5719 minimum alignment.
5721 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
5723 @item
5724 Target-specific attributes that affect the identity of a type, such as
5725 ia32 calling conventions on a function type (stdcall, regparm, etc.),
5726 did not affect the mangled name, leading to name collisions when
5727 function pointers were used as template arguments.
5729 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
5731 @end itemize
5733 This option also enables warnings about psABI-related changes.
5734 The known psABI changes at this point include:
5736 @itemize @bullet
5738 @item
5739 For SysV/x86-64, unions with @code{long double} members are
5740 passed in memory as specified in psABI.  Prior to GCC 4.4, this was not
5741 the case.  For example:
5743 @smallexample
5744 union U @{
5745   long double ld;
5746   int i;
5748 @end smallexample
5750 @noindent
5751 @code{union U} is now always passed in memory.
5753 @end itemize
5755 @item -Wchar-subscripts
5756 @opindex Wchar-subscripts
5757 @opindex Wno-char-subscripts
5758 Warn if an array subscript has type @code{char}.  This is a common cause
5759 of error, as programmers often forget that this type is signed on some
5760 machines.
5761 This warning is enabled by @option{-Wall}.
5763 @item -Wno-coverage-mismatch
5764 @opindex Wno-coverage-mismatch
5765 @opindex Wcoverage-mismatch
5766 Warn if feedback profiles do not match when using the
5767 @option{-fprofile-use} option.
5768 If a source file is changed between compiling with @option{-fprofile-generate}
5769 and with @option{-fprofile-use}, the files with the profile feedback can fail
5770 to match the source file and GCC cannot use the profile feedback
5771 information.  By default, this warning is enabled and is treated as an
5772 error.  @option{-Wno-coverage-mismatch} can be used to disable the
5773 warning or @option{-Wno-error=coverage-mismatch} can be used to
5774 disable the error.  Disabling the error for this warning can result in
5775 poorly optimized code and is useful only in the
5776 case of very minor changes such as bug fixes to an existing code-base.
5777 Completely disabling the warning is not recommended.
5779 @item -Wno-cpp
5780 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
5781 @opindex Wno-cpp
5782 @opindex Wcpp
5783 Suppress warning messages emitted by @code{#warning} directives.
5785 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
5786 @opindex Wdouble-promotion
5787 @opindex Wno-double-promotion
5788 Give a warning when a value of type @code{float} is implicitly
5789 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
5790 floating-point unit implement @code{float} in hardware, but emulate
5791 @code{double} in software.  On such a machine, doing computations
5792 using @code{double} values is much more expensive because of the
5793 overhead required for software emulation.
5795 It is easy to accidentally do computations with @code{double} because
5796 floating-point literals are implicitly of type @code{double}.  For
5797 example, in:
5798 @smallexample
5799 @group
5800 float area(float radius)
5802    return 3.14159 * radius * radius;
5804 @end group
5805 @end smallexample
5806 the compiler performs the entire computation with @code{double}
5807 because the floating-point literal is a @code{double}.
5809 @item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
5810 @opindex Wduplicate-decl-specifier
5811 @opindex Wno-duplicate-decl-specifier
5812 Warn if a declaration has duplicate @code{const}, @code{volatile},
5813 @code{restrict} or @code{_Atomic} specifier.  This warning is enabled by
5814 @option{-Wall}.
5816 @item -Wformat
5817 @itemx -Wformat=@var{n}
5818 @opindex Wformat
5819 @opindex Wno-format
5820 @opindex ffreestanding
5821 @opindex fno-builtin
5822 @opindex Wformat=
5823 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
5824 the arguments supplied have types appropriate to the format string
5825 specified, and that the conversions specified in the format string make
5826 sense.  This includes standard functions, and others specified by format
5827 attributes (@pxref{Function Attributes}), in the @code{printf},
5828 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
5829 not in the C standard) families (or other target-specific families).
5830 Which functions are checked without format attributes having been
5831 specified depends on the standard version selected, and such checks of
5832 functions without the attribute specified are disabled by
5833 @option{-ffreestanding} or @option{-fno-builtin}.
5835 The formats are checked against the format features supported by GNU
5836 libc version 2.2.  These include all ISO C90 and C99 features, as well
5837 as features from the Single Unix Specification and some BSD and GNU
5838 extensions.  Other library implementations may not support all these
5839 features; GCC does not support warning about features that go beyond a
5840 particular library's limitations.  However, if @option{-Wpedantic} is used
5841 with @option{-Wformat}, warnings are given about format features not
5842 in the selected standard version (but not for @code{strfmon} formats,
5843 since those are not in any version of the C standard).  @xref{C Dialect
5844 Options,,Options Controlling C Dialect}.
5846 @table @gcctabopt
5847 @item -Wformat=1
5848 @itemx -Wformat
5849 @opindex Wformat
5850 @opindex Wformat=1
5851 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
5852 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
5853 @option{-Wformat} also checks for null format arguments for several
5854 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
5855 aspects of this level of format checking can be disabled by the
5856 options: @option{-Wno-format-contains-nul},
5857 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
5858 @option{-Wformat} is enabled by @option{-Wall}.
5860 @item -Wformat=2
5861 @opindex Wformat=2
5862 Enable @option{-Wformat} plus additional format checks.  Currently
5863 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
5864 -Wformat-y2k}.
5865 @end table
5867 @item -Wno-format-contains-nul
5868 @opindex Wno-format-contains-nul
5869 @opindex Wformat-contains-nul
5870 If @option{-Wformat} is specified, do not warn about format strings that
5871 contain NUL bytes.
5873 @item -Wno-format-extra-args
5874 @opindex Wno-format-extra-args
5875 @opindex Wformat-extra-args
5876 If @option{-Wformat} is specified, do not warn about excess arguments to a
5877 @code{printf} or @code{scanf} format function.  The C standard specifies
5878 that such arguments are ignored.
5880 Where the unused arguments lie between used arguments that are
5881 specified with @samp{$} operand number specifications, normally
5882 warnings are still given, since the implementation could not know what
5883 type to pass to @code{va_arg} to skip the unused arguments.  However,
5884 in the case of @code{scanf} formats, this option suppresses the
5885 warning if the unused arguments are all pointers, since the Single
5886 Unix Specification says that such unused arguments are allowed.
5888 @item -Wformat-overflow
5889 @itemx -Wformat-overflow=@var{level}
5890 @opindex Wformat-overflow
5891 @opindex Wno-format-overflow
5892 Warn about calls to formatted input/output functions such as @code{sprintf}
5893 and @code{vsprintf} that might overflow the destination buffer.  When the
5894 exact number of bytes written by a format directive cannot be determined
5895 at compile-time it is estimated based on heuristics that depend on the
5896 @var{level} argument and on optimization.  While enabling optimization
5897 will in most cases improve the accuracy of the warning, it may also
5898 result in false positives.
5900 @table @gcctabopt
5901 @item -Wformat-overflow
5902 @itemx -Wformat-overflow=1
5903 @opindex Wformat-overflow
5904 @opindex Wno-format-overflow
5905 Level @var{1} of @option{-Wformat-overflow} enabled by @option{-Wformat}
5906 employs a conservative approach that warns only about calls that most
5907 likely overflow the buffer.  At this level, numeric arguments to format
5908 directives with unknown values are assumed to have the value of one, and
5909 strings of unknown length to be empty.  Numeric arguments that are known
5910 to be bounded to a subrange of their type, or string arguments whose output
5911 is bounded either by their directive's precision or by a finite set of
5912 string literals, are assumed to take on the value within the range that
5913 results in the most bytes on output.  For example, the call to @code{sprintf}
5914 below is diagnosed because even with both @var{a} and @var{b} equal to zero,
5915 the terminating NUL character (@code{'\0'}) appended by the function
5916 to the destination buffer will be written past its end.  Increasing
5917 the size of the buffer by a single byte is sufficient to avoid the
5918 warning, though it may not be sufficient to avoid the overflow.
5920 @smallexample
5921 void f (int a, int b)
5923   char buf [13];
5924   sprintf (buf, "a = %i, b = %i\n", a, b);
5926 @end smallexample
5928 @item -Wformat-overflow=2
5929 Level @var{2} warns also about calls that might overflow the destination
5930 buffer given an argument of sufficient length or magnitude.  At level
5931 @var{2}, unknown numeric arguments are assumed to have the minimum
5932 representable value for signed types with a precision greater than 1, and
5933 the maximum representable value otherwise.  Unknown string arguments whose
5934 length cannot be assumed to be bounded either by the directive's precision,
5935 or by a finite set of string literals they may evaluate to, or the character
5936 array they may point to, are assumed to be 1 character long.
5938 At level @var{2}, the call in the example above is again diagnosed, but
5939 this time because with @var{a} equal to a 32-bit @code{INT_MIN} the first
5940 @code{%i} directive will write some of its digits beyond the end of
5941 the destination buffer.  To make the call safe regardless of the values
5942 of the two variables, the size of the destination buffer must be increased
5943 to at least 34 bytes.  GCC includes the minimum size of the buffer in
5944 an informational note following the warning.
5946 An alternative to increasing the size of the destination buffer is to
5947 constrain the range of formatted values.  The maximum length of string
5948 arguments can be bounded by specifying the precision in the format
5949 directive.  When numeric arguments of format directives can be assumed
5950 to be bounded by less than the precision of their type, choosing
5951 an appropriate length modifier to the format specifier will reduce
5952 the required buffer size.  For example, if @var{a} and @var{b} in the
5953 example above can be assumed to be within the precision of
5954 the @code{short int} type then using either the @code{%hi} format
5955 directive or casting the argument to @code{short} reduces the maximum
5956 required size of the buffer to 24 bytes.
5958 @smallexample
5959 void f (int a, int b)
5961   char buf [23];
5962   sprintf (buf, "a = %hi, b = %i\n", a, (short)b);
5964 @end smallexample
5965 @end table
5967 @item -Wno-format-zero-length
5968 @opindex Wno-format-zero-length
5969 @opindex Wformat-zero-length
5970 If @option{-Wformat} is specified, do not warn about zero-length formats.
5971 The C standard specifies that zero-length formats are allowed.
5973 @item -Wformat-nonliteral
5974 @opindex Wformat-nonliteral
5975 @opindex Wno-format-nonliteral
5976 If @option{-Wformat} is specified, also warn if the format string is not a
5977 string literal and so cannot be checked, unless the format function
5978 takes its format arguments as a @code{va_list}.
5980 @item -Wformat-security
5981 @opindex Wformat-security
5982 @opindex Wno-format-security
5983 If @option{-Wformat} is specified, also warn about uses of format
5984 functions that represent possible security problems.  At present, this
5985 warns about calls to @code{printf} and @code{scanf} functions where the
5986 format string is not a string literal and there are no format arguments,
5987 as in @code{printf (foo);}.  This may be a security hole if the format
5988 string came from untrusted input and contains @samp{%n}.  (This is
5989 currently a subset of what @option{-Wformat-nonliteral} warns about, but
5990 in future warnings may be added to @option{-Wformat-security} that are not
5991 included in @option{-Wformat-nonliteral}.)
5993 @item -Wformat-signedness
5994 @opindex Wformat-signedness
5995 @opindex Wno-format-signedness
5996 If @option{-Wformat} is specified, also warn if the format string
5997 requires an unsigned argument and the argument is signed and vice versa.
5999 @item -Wformat-truncation
6000 @itemx -Wformat-truncation=@var{level}
6001 @opindex Wformat-truncation
6002 @opindex Wno-format-truncation
6003 Warn about calls to formatted input/output functions such as @code{snprintf}
6004 and @code{vsnprintf} that might result in output truncation.  When the exact
6005 number of bytes written by a format directive cannot be determined at
6006 compile-time it is estimated based on heuristics that depend on
6007 the @var{level} argument and on optimization.  While enabling optimization
6008 will in most cases improve the accuracy of the warning, it may also result
6009 in false positives.  Except as noted otherwise, the option uses the same
6010 logic @option{-Wformat-overflow}.
6012 @table @gcctabopt
6013 @item -Wformat-truncation
6014 @itemx -Wformat-truncation=1
6015 @opindex Wformat-truncation
6016 @opindex Wno-format-truncation
6017 Level @var{1} of @option{-Wformat-truncation} enabled by @option{-Wformat}
6018 employs a conservative approach that warns only about calls to bounded
6019 functions whose return value is unused and that will most likely result
6020 in output truncation.
6022 @item -Wformat-truncation=2
6023 Level @var{2} warns also about calls to bounded functions whose return
6024 value is used and that might result in truncation given an argument of
6025 sufficient length or magnitude.
6026 @end table
6028 @item -Wformat-y2k
6029 @opindex Wformat-y2k
6030 @opindex Wno-format-y2k
6031 If @option{-Wformat} is specified, also warn about @code{strftime}
6032 formats that may yield only a two-digit year.
6034 @item -Wnonnull
6035 @opindex Wnonnull
6036 @opindex Wno-nonnull
6037 Warn about passing a null pointer for arguments marked as
6038 requiring a non-null value by the @code{nonnull} function attribute.
6040 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
6041 can be disabled with the @option{-Wno-nonnull} option.
6043 @item -Wnonnull-compare
6044 @opindex Wnonnull-compare
6045 @opindex Wno-nonnull-compare
6046 Warn when comparing an argument marked with the @code{nonnull}
6047 function attribute against null inside the function.
6049 @option{-Wnonnull-compare} is included in @option{-Wall}.  It
6050 can be disabled with the @option{-Wno-nonnull-compare} option.
6052 @item -Wnull-dereference
6053 @opindex Wnull-dereference
6054 @opindex Wno-null-dereference
6055 Warn if the compiler detects paths that trigger erroneous or
6056 undefined behavior due to dereferencing a null pointer.  This option
6057 is only active when @option{-fdelete-null-pointer-checks} is active,
6058 which is enabled by optimizations in most targets.  The precision of
6059 the warnings depends on the optimization options used.
6061 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
6062 @opindex Winit-self
6063 @opindex Wno-init-self
6064 Warn about uninitialized variables that are initialized with themselves.
6065 Note this option can only be used with the @option{-Wuninitialized} option.
6067 For example, GCC warns about @code{i} being uninitialized in the
6068 following snippet only when @option{-Winit-self} has been specified:
6069 @smallexample
6070 @group
6071 int f()
6073   int i = i;
6074   return i;
6076 @end group
6077 @end smallexample
6079 This warning is enabled by @option{-Wall} in C++.
6081 @item -Wno-implicit-int @r{(C and Objective-C only)}
6082 @opindex Wimplicit-int
6083 @opindex Wno-implicit-int
6084 This option controls warnings when a declaration does not specify a type.
6085 This warning is enabled by default in C99 and later dialects of C,
6086 and also by @option{-Wall}.
6088 @item -Wno-implicit-function-declaration @r{(C and Objective-C only)}
6089 @opindex Wimplicit-function-declaration
6090 @opindex Wno-implicit-function-declaration
6091 This option controls warnings when a function is used before being declared.
6092 This warning is enabled by default in C99 and later dialects of C,
6093 and also by @option{-Wall}.
6094 The warning is made into an error by @option{-pedantic-errors}.
6096 @item -Wimplicit @r{(C and Objective-C only)}
6097 @opindex Wimplicit
6098 @opindex Wno-implicit
6099 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
6100 This warning is enabled by @option{-Wall}.
6102 @item -Wimplicit-fallthrough
6103 @opindex Wimplicit-fallthrough
6104 @opindex Wno-implicit-fallthrough
6105 @option{-Wimplicit-fallthrough} is the same as @option{-Wimplicit-fallthrough=3}
6106 and @option{-Wno-implicit-fallthrough} is the same as
6107 @option{-Wimplicit-fallthrough=0}.
6109 @item -Wimplicit-fallthrough=@var{n}
6110 @opindex Wimplicit-fallthrough=
6111 Warn when a switch case falls through.  For example:
6113 @smallexample
6114 @group
6115 switch (cond)
6116   @{
6117   case 1:
6118     a = 1;
6119     break;
6120   case 2:
6121     a = 2;
6122   case 3:
6123     a = 3;
6124     break;
6125   @}
6126 @end group
6127 @end smallexample
6129 This warning does not warn when the last statement of a case cannot
6130 fall through, e.g. when there is a return statement or a call to function
6131 declared with the noreturn attribute.  @option{-Wimplicit-fallthrough=}
6132 also takes into account control flow statements, such as ifs, and only
6133 warns when appropriate.  E.g.@:
6135 @smallexample
6136 @group
6137 switch (cond)
6138   @{
6139   case 1:
6140     if (i > 3) @{
6141       bar (5);
6142       break;
6143     @} else if (i < 1) @{
6144       bar (0);
6145     @} else
6146       return;
6147   default:
6148     @dots{}
6149   @}
6150 @end group
6151 @end smallexample
6153 Since there are occasions where a switch case fall through is desirable,
6154 GCC provides an attribute, @code{__attribute__ ((fallthrough))}, that is
6155 to be used along with a null statement to suppress this warning that
6156 would normally occur:
6158 @smallexample
6159 @group
6160 switch (cond)
6161   @{
6162   case 1:
6163     bar (0);
6164     __attribute__ ((fallthrough));
6165   default:
6166     @dots{}
6167   @}
6168 @end group
6169 @end smallexample
6171 C++17 provides a standard way to suppress the @option{-Wimplicit-fallthrough}
6172 warning using @code{[[fallthrough]];} instead of the GNU attribute.  In C++11
6173 or C++14 users can use @code{[[gnu::fallthrough]];}, which is a GNU extension.
6174 Instead of these attributes, it is also possible to add a fallthrough comment
6175 to silence the warning.  The whole body of the C or C++ style comment should
6176 match the given regular expressions listed below.  The option argument @var{n}
6177 specifies what kind of comments are accepted:
6179 @itemize @bullet
6181 @item @option{-Wimplicit-fallthrough=0} disables the warning altogether.
6183 @item @option{-Wimplicit-fallthrough=1} matches @code{.*} regular
6184 expression, any comment is used as fallthrough comment.
6186 @item @option{-Wimplicit-fallthrough=2} case insensitively matches
6187 @code{.*falls?[ \t-]*thr(ough|u).*} regular expression.
6189 @item @option{-Wimplicit-fallthrough=3} case sensitively matches one of the
6190 following regular expressions:
6192 @itemize @bullet
6194 @item @code{-fallthrough}
6196 @item @code{@@fallthrough@@}
6198 @item @code{lint -fallthrough[ \t]*}
6200 @item @code{[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?@*FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?}
6202 @item @code{[ \t.!]*(Else,? |Intentional(ly)? )?@*Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?}
6204 @item @code{[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?@*fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?}
6206 @end itemize
6208 @item @option{-Wimplicit-fallthrough=4} case sensitively matches one of the
6209 following regular expressions:
6211 @itemize @bullet
6213 @item @code{-fallthrough}
6215 @item @code{@@fallthrough@@}
6217 @item @code{lint -fallthrough[ \t]*}
6219 @item @code{[ \t]*FALLTHR(OUGH|U)[ \t]*}
6221 @end itemize
6223 @item @option{-Wimplicit-fallthrough=5} doesn't recognize any comments as
6224 fallthrough comments, only attributes disable the warning.
6226 @end itemize
6228 The comment needs to be followed after optional whitespace and other comments
6229 by @code{case} or @code{default} keywords or by a user label that precedes some
6230 @code{case} or @code{default} label.
6232 @smallexample
6233 @group
6234 switch (cond)
6235   @{
6236   case 1:
6237     bar (0);
6238     /* FALLTHRU */
6239   default:
6240     @dots{}
6241   @}
6242 @end group
6243 @end smallexample
6245 The @option{-Wimplicit-fallthrough=3} warning is enabled by @option{-Wextra}.
6247 @item -Wno-if-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
6248 @opindex Wif-not-aligned
6249 @opindex Wno-if-not-aligned
6250 Control if warnings triggered by the @code{warn_if_not_aligned} attribute
6251 should be issued.  These warnings are enabled by default.
6253 @item -Wignored-qualifiers @r{(C and C++ only)}
6254 @opindex Wignored-qualifiers
6255 @opindex Wno-ignored-qualifiers
6256 Warn if the return type of a function has a type qualifier
6257 such as @code{const}.  For ISO C such a type qualifier has no effect,
6258 since the value returned by a function is not an lvalue.
6259 For C++, the warning is only emitted for scalar types or @code{void}.
6260 ISO C prohibits qualified @code{void} return types on function
6261 definitions, so such return types always receive a warning
6262 even without this option.
6264 This warning is also enabled by @option{-Wextra}.
6266 @item -Wno-ignored-attributes @r{(C and C++ only)}
6267 @opindex Wignored-attributes
6268 @opindex Wno-ignored-attributes
6269 This option controls warnings when an attribute is ignored.
6270 This is different from the
6271 @option{-Wattributes} option in that it warns whenever the compiler decides
6272 to drop an attribute, not that the attribute is either unknown, used in a
6273 wrong place, etc.  This warning is enabled by default.
6275 @item -Wmain
6276 @opindex Wmain
6277 @opindex Wno-main
6278 Warn if the type of @code{main} is suspicious.  @code{main} should be
6279 a function with external linkage, returning int, taking either zero
6280 arguments, two, or three arguments of appropriate types.  This warning
6281 is enabled by default in C++ and is enabled by either @option{-Wall}
6282 or @option{-Wpedantic}.
6284 @item -Wmisleading-indentation @r{(C and C++ only)}
6285 @opindex Wmisleading-indentation
6286 @opindex Wno-misleading-indentation
6287 Warn when the indentation of the code does not reflect the block structure.
6288 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
6289 @code{for} clauses with a guarded statement that does not use braces,
6290 followed by an unguarded statement with the same indentation.
6292 In the following example, the call to ``bar'' is misleadingly indented as
6293 if it were guarded by the ``if'' conditional.
6295 @smallexample
6296   if (some_condition ())
6297     foo ();
6298     bar ();  /* Gotcha: this is not guarded by the "if".  */
6299 @end smallexample
6301 In the case of mixed tabs and spaces, the warning uses the
6302 @option{-ftabstop=} option to determine if the statements line up
6303 (defaulting to 8).
6305 The warning is not issued for code involving multiline preprocessor logic
6306 such as the following example.
6308 @smallexample
6309   if (flagA)
6310     foo (0);
6311 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
6312   if (flagB)
6313 #endif
6314     foo (1);
6315 @end smallexample
6317 The warning is not issued after a @code{#line} directive, since this
6318 typically indicates autogenerated code, and no assumptions can be made
6319 about the layout of the file that the directive references.
6321 This warning is enabled by @option{-Wall} in C and C++.
6323 @item -Wmissing-attributes
6324 @opindex Wmissing-attributes
6325 @opindex Wno-missing-attributes
6326 Warn when a declaration of a function is missing one or more attributes
6327 that a related function is declared with and whose absence may adversely
6328 affect the correctness or efficiency of generated code.  For example,
6329 the warning is issued for declarations of aliases that use attributes
6330 to specify less restrictive requirements than those of their targets.
6331 This typically represents a potential optimization opportunity.
6332 By contrast, the @option{-Wattribute-alias=2} option controls warnings
6333 issued when the alias is more restrictive than the target, which could
6334 lead to incorrect code generation.
6335 Attributes considered include @code{alloc_align}, @code{alloc_size},
6336 @code{cold}, @code{const}, @code{hot}, @code{leaf}, @code{malloc},
6337 @code{nonnull}, @code{noreturn}, @code{nothrow}, @code{pure},
6338 @code{returns_nonnull}, and @code{returns_twice}.
6340 In C++, the warning is issued when an explicit specialization of a primary
6341 template declared with attribute @code{alloc_align}, @code{alloc_size},
6342 @code{assume_aligned}, @code{format}, @code{format_arg}, @code{malloc},
6343 or @code{nonnull} is declared without it.  Attributes @code{deprecated},
6344 @code{error}, and @code{warning} suppress the warning.
6345 (@pxref{Function Attributes}).
6347 You can use the @code{copy} attribute to apply the same
6348 set of attributes to a declaration as that on another declaration without
6349 explicitly enumerating the attributes. This attribute can be applied
6350 to declarations of functions (@pxref{Common Function Attributes}),
6351 variables (@pxref{Common Variable Attributes}), or types
6352 (@pxref{Common Type Attributes}).
6354 @option{-Wmissing-attributes} is enabled by @option{-Wall}.
6356 For example, since the declaration of the primary function template
6357 below makes use of both attribute @code{malloc} and @code{alloc_size}
6358 the declaration of the explicit specialization of the template is
6359 diagnosed because it is missing one of the attributes.
6361 @smallexample
6362 template <class T>
6363 T* __attribute__ ((malloc, alloc_size (1)))
6364 allocate (size_t);
6366 template <>
6367 void* __attribute__ ((malloc))   // missing alloc_size
6368 allocate<void> (size_t);
6369 @end smallexample
6371 @item -Wmissing-braces
6372 @opindex Wmissing-braces
6373 @opindex Wno-missing-braces
6374 Warn if an aggregate or union initializer is not fully bracketed.  In
6375 the following example, the initializer for @code{a} is not fully
6376 bracketed, but that for @code{b} is fully bracketed.
6378 @smallexample
6379 int a[2][2] = @{ 0, 1, 2, 3 @};
6380 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
6381 @end smallexample
6383 This warning is enabled by @option{-Wall}.
6385 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
6386 @opindex Wmissing-include-dirs
6387 @opindex Wno-missing-include-dirs
6388 Warn if a user-supplied include directory does not exist.
6390 @item -Wno-missing-profile
6391 @opindex Wmissing-profile
6392 @opindex Wno-missing-profile
6393 This option controls warnings if feedback profiles are missing when using the
6394 @option{-fprofile-use} option.
6395 This option diagnoses those cases where a new function or a new file is added
6396 between compiling with @option{-fprofile-generate} and with
6397 @option{-fprofile-use}, without regenerating the profiles.
6398 In these cases, the profile feedback data files do not contain any
6399 profile feedback information for
6400 the newly added function or file respectively.  Also, in the case when profile
6401 count data (.gcda) files are removed, GCC cannot use any profile feedback
6402 information.  In all these cases, warnings are issued to inform you that a
6403 profile generation step is due.
6404 Ignoring the warning can result in poorly optimized code.
6405 @option{-Wno-missing-profile} can be used to
6406 disable the warning, but this is not recommended and should be done only
6407 when non-existent profile data is justified.
6409 @item -Wno-mismatched-dealloc
6410 @opindex Wmismatched-dealloc
6411 @opindex Wno-mismatched-dealloc
6413 Warn for calls to deallocation functions with pointer arguments returned
6414 from from allocations functions for which the former isn't a suitable
6415 deallocator.  A pair of functions can be associated as matching allocators
6416 and deallocators by use of attribute @code{malloc}.  Unless disabled by
6417 the @option{-fno-builtin} option the standard functions @code{calloc},
6418 @code{malloc}, @code{realloc}, and @code{free}, as well as the corresponding
6419 forms of C++ @code{operator new} and @code{operator delete} are implicitly
6420 associated as matching allocators and deallocators.  In the following
6421 example @code{mydealloc} is the deallocator for pointers returned from
6422 @code{myalloc}.
6424 @smallexample
6425 void mydealloc (void*);
6427 __attribute__ ((malloc (mydealloc, 1))) void*
6428 myalloc (size_t);
6430 void f (void)
6432   void *p = myalloc (32);
6433   // @dots{}use p@dots{}
6434   free (p);   // warning: not a matching deallocator for myalloc
6435   mydealloc (p);   // ok
6437 @end smallexample
6439 In C++, the related option @option{-Wmismatched-new-delete} diagnoses
6440 mismatches involving either @code{operator new} or @code{operator delete}.
6442 Option @option{-Wmismatched-dealloc} is enabled by default.
6444 @item -Wmultistatement-macros
6445 @opindex Wmultistatement-macros
6446 @opindex Wno-multistatement-macros
6447 Warn about unsafe multiple statement macros that appear to be guarded
6448 by a clause such as @code{if}, @code{else}, @code{for}, @code{switch}, or
6449 @code{while}, in which only the first statement is actually guarded after
6450 the macro is expanded.
6452 For example:
6454 @smallexample
6455 #define DOIT x++; y++
6456 if (c)
6457   DOIT;
6458 @end smallexample
6460 will increment @code{y} unconditionally, not just when @code{c} holds.
6461 The can usually be fixed by wrapping the macro in a do-while loop:
6462 @smallexample
6463 #define DOIT do @{ x++; y++; @} while (0)
6464 if (c)
6465   DOIT;
6466 @end smallexample
6468 This warning is enabled by @option{-Wall} in C and C++.
6470 @item -Wparentheses
6471 @opindex Wparentheses
6472 @opindex Wno-parentheses
6473 Warn if parentheses are omitted in certain contexts, such
6474 as when there is an assignment in a context where a truth value
6475 is expected, or when operators are nested whose precedence people
6476 often get confused about.
6478 Also warn if a comparison like @code{x<=y<=z} appears; this is
6479 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
6480 interpretation from that of ordinary mathematical notation.
6482 Also warn for dangerous uses of the GNU extension to
6483 @code{?:} with omitted middle operand. When the condition
6484 in the @code{?}: operator is a boolean expression, the omitted value is
6485 always 1.  Often programmers expect it to be a value computed
6486 inside the conditional expression instead.
6488 For C++ this also warns for some cases of unnecessary parentheses in
6489 declarations, which can indicate an attempt at a function call instead
6490 of a declaration:
6491 @smallexample
6493   // Declares a local variable called mymutex.
6494   std::unique_lock<std::mutex> (mymutex);
6495   // User meant std::unique_lock<std::mutex> lock (mymutex);
6497 @end smallexample
6499 This warning is enabled by @option{-Wall}.
6501 @item -Wsequence-point
6502 @opindex Wsequence-point
6503 @opindex Wno-sequence-point
6504 Warn about code that may have undefined semantics because of violations
6505 of sequence point rules in the C and C++ standards.
6507 The C and C++ standards define the order in which expressions in a C/C++
6508 program are evaluated in terms of @dfn{sequence points}, which represent
6509 a partial ordering between the execution of parts of the program: those
6510 executed before the sequence point, and those executed after it.  These
6511 occur after the evaluation of a full expression (one which is not part
6512 of a larger expression), after the evaluation of the first operand of a
6513 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
6514 function is called (but after the evaluation of its arguments and the
6515 expression denoting the called function), and in certain other places.
6516 Other than as expressed by the sequence point rules, the order of
6517 evaluation of subexpressions of an expression is not specified.  All
6518 these rules describe only a partial order rather than a total order,
6519 since, for example, if two functions are called within one expression
6520 with no sequence point between them, the order in which the functions
6521 are called is not specified.  However, the standards committee have
6522 ruled that function calls do not overlap.
6524 It is not specified when between sequence points modifications to the
6525 values of objects take effect.  Programs whose behavior depends on this
6526 have undefined behavior; the C and C++ standards specify that ``Between
6527 the previous and next sequence point an object shall have its stored
6528 value modified at most once by the evaluation of an expression.
6529 Furthermore, the prior value shall be read only to determine the value
6530 to be stored.''.  If a program breaks these rules, the results on any
6531 particular implementation are entirely unpredictable.
6533 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
6534 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
6535 diagnosed by this option, and it may give an occasional false positive
6536 result, but in general it has been found fairly effective at detecting
6537 this sort of problem in programs.
6539 The C++17 standard will define the order of evaluation of operands in
6540 more cases: in particular it requires that the right-hand side of an
6541 assignment be evaluated before the left-hand side, so the above
6542 examples are no longer undefined.  But this option will still warn
6543 about them, to help people avoid writing code that is undefined in C
6544 and earlier revisions of C++.
6546 The standard is worded confusingly, therefore there is some debate
6547 over the precise meaning of the sequence point rules in subtle cases.
6548 Links to discussions of the problem, including proposed formal
6549 definitions, may be found on the GCC readings page, at
6550 @uref{http://gcc.gnu.org/@/readings.html}.
6552 This warning is enabled by @option{-Wall} for C and C++.
6554 @item -Wno-return-local-addr
6555 @opindex Wno-return-local-addr
6556 @opindex Wreturn-local-addr
6557 Do not warn about returning a pointer (or in C++, a reference) to a
6558 variable that goes out of scope after the function returns.
6560 @item -Wreturn-type
6561 @opindex Wreturn-type
6562 @opindex Wno-return-type
6563 Warn whenever a function is defined with a return type that defaults
6564 to @code{int}.  Also warn about any @code{return} statement with no
6565 return value in a function whose return type is not @code{void}
6566 (falling off the end of the function body is considered returning
6567 without a value).
6569 For C only, warn about a @code{return} statement with an expression in a
6570 function whose return type is @code{void}, unless the expression type is
6571 also @code{void}.  As a GNU extension, the latter case is accepted
6572 without a warning unless @option{-Wpedantic} is used.  Attempting
6573 to use the return value of a non-@code{void} function other than @code{main}
6574 that flows off the end by reaching the closing curly brace that terminates
6575 the function is undefined.
6577 Unlike in C, in C++, flowing off the end of a non-@code{void} function other
6578 than @code{main} results in undefined behavior even when the value of
6579 the function is not used.
6581 This warning is enabled by default in C++ and by @option{-Wall} otherwise.
6583 @item -Wno-shift-count-negative
6584 @opindex Wshift-count-negative
6585 @opindex Wno-shift-count-negative
6586 Controls warnings if a shift count is negative.
6587 This warning is enabled by default.
6589 @item -Wno-shift-count-overflow
6590 @opindex Wshift-count-overflow
6591 @opindex Wno-shift-count-overflow
6592 Controls warnings if a shift count is greater than or equal to the bit width
6593 of the type.  This warning is enabled by default.
6595 @item -Wshift-negative-value
6596 @opindex Wshift-negative-value
6597 @opindex Wno-shift-negative-value
6598 Warn if left shifting a negative value.  This warning is enabled by
6599 @option{-Wextra} in C99 and C++11 modes (and newer).
6601 @item -Wno-shift-overflow
6602 @itemx -Wshift-overflow=@var{n}
6603 @opindex Wshift-overflow
6604 @opindex Wno-shift-overflow
6605 These options control warnings about left shift overflows.
6607 @table @gcctabopt
6608 @item -Wshift-overflow=1
6609 This is the warning level of @option{-Wshift-overflow} and is enabled
6610 by default in C99 and C++11 modes (and newer).  This warning level does
6611 not warn about left-shifting 1 into the sign bit.  (However, in C, such
6612 an overflow is still rejected in contexts where an integer constant expression
6613 is required.)  No warning is emitted in C++20 mode (and newer), as signed left
6614 shifts always wrap.
6616 @item -Wshift-overflow=2
6617 This warning level also warns about left-shifting 1 into the sign bit,
6618 unless C++14 mode (or newer) is active.
6619 @end table
6621 @item -Wswitch
6622 @opindex Wswitch
6623 @opindex Wno-switch
6624 Warn whenever a @code{switch} statement has an index of enumerated type
6625 and lacks a @code{case} for one or more of the named codes of that
6626 enumeration.  (The presence of a @code{default} label prevents this
6627 warning.)  @code{case} labels outside the enumeration range also
6628 provoke warnings when this option is used (even if there is a
6629 @code{default} label).
6630 This warning is enabled by @option{-Wall}.
6632 @item -Wswitch-default
6633 @opindex Wswitch-default
6634 @opindex Wno-switch-default
6635 Warn whenever a @code{switch} statement does not have a @code{default}
6636 case.
6638 @item -Wswitch-enum
6639 @opindex Wswitch-enum
6640 @opindex Wno-switch-enum
6641 Warn whenever a @code{switch} statement has an index of enumerated type
6642 and lacks a @code{case} for one or more of the named codes of that
6643 enumeration.  @code{case} labels outside the enumeration range also
6644 provoke warnings when this option is used.  The only difference
6645 between @option{-Wswitch} and this option is that this option gives a
6646 warning about an omitted enumeration code even if there is a
6647 @code{default} label.
6649 @item -Wno-switch-bool
6650 @opindex Wswitch-bool
6651 @opindex Wno-switch-bool
6652 Do not warn when a @code{switch} statement has an index of boolean type
6653 and the case values are outside the range of a boolean type.
6654 It is possible to suppress this warning by casting the controlling
6655 expression to a type other than @code{bool}.  For example:
6656 @smallexample
6657 @group
6658 switch ((int) (a == 4))
6659   @{
6660   @dots{}
6661   @}
6662 @end group
6663 @end smallexample
6664 This warning is enabled by default for C and C++ programs.
6666 @item -Wno-switch-outside-range
6667 @opindex Wswitch-outside-range
6668 @opindex Wno-switch-outside-range
6669 This option controls warnings when a @code{switch} case has a value
6670 that is outside of its
6671 respective type range.  This warning is enabled by default for
6672 C and C++ programs.
6674 @item -Wno-switch-unreachable
6675 @opindex Wswitch-unreachable
6676 @opindex Wno-switch-unreachable
6677 Do not warn when a @code{switch} statement contains statements between the
6678 controlling expression and the first case label, which will never be
6679 executed.  For example:
6680 @smallexample
6681 @group
6682 switch (cond)
6683   @{
6684    i = 15;
6685   @dots{}
6686    case 5:
6687   @dots{}
6688   @}
6689 @end group
6690 @end smallexample
6691 @option{-Wswitch-unreachable} does not warn if the statement between the
6692 controlling expression and the first case label is just a declaration:
6693 @smallexample
6694 @group
6695 switch (cond)
6696   @{
6697    int i;
6698   @dots{}
6699    case 5:
6700    i = 5;
6701   @dots{}
6702   @}
6703 @end group
6704 @end smallexample
6705 This warning is enabled by default for C and C++ programs.
6707 @item -Wsync-nand @r{(C and C++ only)}
6708 @opindex Wsync-nand
6709 @opindex Wno-sync-nand
6710 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
6711 built-in functions are used.  These functions changed semantics in GCC 4.4.
6713 @item -Wunused-but-set-parameter
6714 @opindex Wunused-but-set-parameter
6715 @opindex Wno-unused-but-set-parameter
6716 Warn whenever a function parameter is assigned to, but otherwise unused
6717 (aside from its declaration).
6719 To suppress this warning use the @code{unused} attribute
6720 (@pxref{Variable Attributes}).
6722 This warning is also enabled by @option{-Wunused} together with
6723 @option{-Wextra}.
6725 @item -Wunused-but-set-variable
6726 @opindex Wunused-but-set-variable
6727 @opindex Wno-unused-but-set-variable
6728 Warn whenever a local variable is assigned to, but otherwise unused
6729 (aside from its declaration).
6730 This warning is enabled by @option{-Wall}.
6732 To suppress this warning use the @code{unused} attribute
6733 (@pxref{Variable Attributes}).
6735 This warning is also enabled by @option{-Wunused}, which is enabled
6736 by @option{-Wall}.
6738 @item -Wunused-function
6739 @opindex Wunused-function
6740 @opindex Wno-unused-function
6741 Warn whenever a static function is declared but not defined or a
6742 non-inline static function is unused.
6743 This warning is enabled by @option{-Wall}.
6745 @item -Wunused-label
6746 @opindex Wunused-label
6747 @opindex Wno-unused-label
6748 Warn whenever a label is declared but not used.
6749 This warning is enabled by @option{-Wall}.
6751 To suppress this warning use the @code{unused} attribute
6752 (@pxref{Variable Attributes}).
6754 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
6755 @opindex Wunused-local-typedefs
6756 @opindex Wno-unused-local-typedefs
6757 Warn when a typedef locally defined in a function is not used.
6758 This warning is enabled by @option{-Wall}.
6760 @item -Wunused-parameter
6761 @opindex Wunused-parameter
6762 @opindex Wno-unused-parameter
6763 Warn whenever a function parameter is unused aside from its declaration.
6765 To suppress this warning use the @code{unused} attribute
6766 (@pxref{Variable Attributes}).
6768 @item -Wno-unused-result
6769 @opindex Wunused-result
6770 @opindex Wno-unused-result
6771 Do not warn if a caller of a function marked with attribute
6772 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
6773 its return value. The default is @option{-Wunused-result}.
6775 @item -Wunused-variable
6776 @opindex Wunused-variable
6777 @opindex Wno-unused-variable
6778 Warn whenever a local or static variable is unused aside from its
6779 declaration. This option implies @option{-Wunused-const-variable=1} for C,
6780 but not for C++. This warning is enabled by @option{-Wall}.
6782 To suppress this warning use the @code{unused} attribute
6783 (@pxref{Variable Attributes}).
6785 @item -Wunused-const-variable
6786 @itemx -Wunused-const-variable=@var{n}
6787 @opindex Wunused-const-variable
6788 @opindex Wno-unused-const-variable
6789 Warn whenever a constant static variable is unused aside from its declaration.
6790 @option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
6791 for C, but not for C++. In C this declares variable storage, but in C++ this
6792 is not an error since const variables take the place of @code{#define}s.
6794 To suppress this warning use the @code{unused} attribute
6795 (@pxref{Variable Attributes}).
6797 @table @gcctabopt
6798 @item -Wunused-const-variable=1
6799 This is the warning level that is enabled by @option{-Wunused-variable} for
6800 C.  It warns only about unused static const variables defined in the main
6801 compilation unit, but not about static const variables declared in any
6802 header included.
6804 @item -Wunused-const-variable=2
6805 This warning level also warns for unused constant static variables in
6806 headers (excluding system headers).  This is the warning level of
6807 @option{-Wunused-const-variable} and must be explicitly requested since
6808 in C++ this isn't an error and in C it might be harder to clean up all
6809 headers included.
6810 @end table
6812 @item -Wunused-value
6813 @opindex Wunused-value
6814 @opindex Wno-unused-value
6815 Warn whenever a statement computes a result that is explicitly not
6816 used. To suppress this warning cast the unused expression to
6817 @code{void}. This includes an expression-statement or the left-hand
6818 side of a comma expression that contains no side effects. For example,
6819 an expression such as @code{x[i,j]} causes a warning, while
6820 @code{x[(void)i,j]} does not.
6822 This warning is enabled by @option{-Wall}.
6824 @item -Wunused
6825 @opindex Wunused
6826 @opindex Wno-unused
6827 All the above @option{-Wunused} options combined.
6829 In order to get a warning about an unused function parameter, you must
6830 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
6831 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
6833 @item -Wuninitialized
6834 @opindex Wuninitialized
6835 @opindex Wno-uninitialized
6836 Warn if an object with automatic or allocated storage duration is used
6837 without having been initialized.  In C++, also warn if a non-static
6838 reference or non-static @code{const} member appears in a class without
6839 constructors.
6841 In addition, passing a pointer (or in C++, a reference) to an uninitialized
6842 object to a @code{const}-qualified argument of a built-in function known to
6843 read the object is also diagnosed by this warning.
6844 (@option{-Wmaybe-uninitialized} is issued for ordinary functions.)
6846 If you want to warn about code that uses the uninitialized value of the
6847 variable in its own initializer, use the @option{-Winit-self} option.
6849 These warnings occur for individual uninitialized elements of
6850 structure, union or array variables as well as for variables that are
6851 uninitialized as a whole.  They do not occur for variables or elements
6852 declared @code{volatile}.  Because these warnings depend on
6853 optimization, the exact variables or elements for which there are
6854 warnings depend on the precise optimization options and version of GCC
6855 used.
6857 Note that there may be no warning about a variable that is used only
6858 to compute a value that itself is never used, because such
6859 computations may be deleted by data flow analysis before the warnings
6860 are printed.
6862 @item -Wno-invalid-memory-model
6863 @opindex Winvalid-memory-model
6864 @opindex Wno-invalid-memory-model
6865 This option controls warnings
6866 for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
6867 and the C11 atomic generic functions with a memory consistency argument
6868 that is either invalid for the operation or outside the range of values
6869 of the @code{memory_order} enumeration.  For example, since the
6870 @code{__atomic_store} and @code{__atomic_store_n} built-ins are only
6871 defined for the relaxed, release, and sequentially consistent memory
6872 orders the following code is diagnosed:
6874 @smallexample
6875 void store (int *i)
6877   __atomic_store_n (i, 0, memory_order_consume);
6879 @end smallexample
6881 @option{-Winvalid-memory-model} is enabled by default.
6883 @item -Wmaybe-uninitialized
6884 @opindex Wmaybe-uninitialized
6885 @opindex Wno-maybe-uninitialized
6886 For an object with automatic or allocated storage duration, if there exists
6887 a path from the function entry to a use of the object that is initialized,
6888 but there exist some other paths for which the object is not initialized,
6889 the compiler emits a warning if it cannot prove the uninitialized paths
6890 are not executed at run time.
6892 In addition, passing a pointer (or in C++, a reference) to an uninitialized
6893 object to a @code{const}-qualified function argument is also diagnosed by
6894 this warning.  (@option{-Wuninitialized} is issued for built-in functions
6895 known to read the object.)  Annotating the function with attribute
6896 @code{access (none)} indicates that the argument isn't used to access
6897 the object and avoids the warning (@pxref{Common Function Attributes}).
6899 These warnings are only possible in optimizing compilation, because otherwise
6900 GCC does not keep track of the state of variables.
6902 These warnings are made optional because GCC may not be able to determine when
6903 the code is correct in spite of appearing to have an error.  Here is one
6904 example of how this can happen:
6906 @smallexample
6907 @group
6909   int x;
6910   switch (y)
6911     @{
6912     case 1: x = 1;
6913       break;
6914     case 2: x = 4;
6915       break;
6916     case 3: x = 5;
6917     @}
6918   foo (x);
6920 @end group
6921 @end smallexample
6923 @noindent
6924 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
6925 always initialized, but GCC doesn't know this. To suppress the
6926 warning, you need to provide a default case with assert(0) or
6927 similar code.
6929 @cindex @code{longjmp} warnings
6930 This option also warns when a non-volatile automatic variable might be
6931 changed by a call to @code{longjmp}.
6932 The compiler sees only the calls to @code{setjmp}.  It cannot know
6933 where @code{longjmp} will be called; in fact, a signal handler could
6934 call it at any point in the code.  As a result, you may get a warning
6935 even when there is in fact no problem because @code{longjmp} cannot
6936 in fact be called at the place that would cause a problem.
6938 Some spurious warnings can be avoided if you declare all the functions
6939 you use that never return as @code{noreturn}.  @xref{Function
6940 Attributes}.
6942 This warning is enabled by @option{-Wall} or @option{-Wextra}.
6944 @item -Wunknown-pragmas
6945 @opindex Wunknown-pragmas
6946 @opindex Wno-unknown-pragmas
6947 @cindex warning for unknown pragmas
6948 @cindex unknown pragmas, warning
6949 @cindex pragmas, warning of unknown
6950 Warn when a @code{#pragma} directive is encountered that is not understood by 
6951 GCC@.  If this command-line option is used, warnings are even issued
6952 for unknown pragmas in system header files.  This is not the case if
6953 the warnings are only enabled by the @option{-Wall} command-line option.
6955 @item -Wno-pragmas
6956 @opindex Wno-pragmas
6957 @opindex Wpragmas
6958 Do not warn about misuses of pragmas, such as incorrect parameters,
6959 invalid syntax, or conflicts between pragmas.  See also
6960 @option{-Wunknown-pragmas}.
6962 @item -Wno-prio-ctor-dtor
6963 @opindex Wno-prio-ctor-dtor
6964 @opindex Wprio-ctor-dtor
6965 Do not warn if a priority from 0 to 100 is used for constructor or destructor.
6966 The use of constructor and destructor attributes allow you to assign a
6967 priority to the constructor/destructor to control its order of execution
6968 before @code{main} is called or after it returns.  The priority values must be
6969 greater than 100 as the compiler reserves priority values between 0--100 for
6970 the implementation.
6972 @item -Wstrict-aliasing
6973 @opindex Wstrict-aliasing
6974 @opindex Wno-strict-aliasing
6975 This option is only active when @option{-fstrict-aliasing} is active.
6976 It warns about code that might break the strict aliasing rules that the
6977 compiler is using for optimization.  The warning does not catch all
6978 cases, but does attempt to catch the more common pitfalls.  It is
6979 included in @option{-Wall}.
6980 It is equivalent to @option{-Wstrict-aliasing=3}
6982 @item -Wstrict-aliasing=n
6983 @opindex Wstrict-aliasing=n
6984 This option is only active when @option{-fstrict-aliasing} is active.
6985 It warns about code that might break the strict aliasing rules that the
6986 compiler is using for optimization.
6987 Higher levels correspond to higher accuracy (fewer false positives).
6988 Higher levels also correspond to more effort, similar to the way @option{-O} 
6989 works.
6990 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
6992 Level 1: Most aggressive, quick, least accurate.
6993 Possibly useful when higher levels
6994 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
6995 false negatives.  However, it has many false positives.
6996 Warns for all pointer conversions between possibly incompatible types,
6997 even if never dereferenced.  Runs in the front end only.
6999 Level 2: Aggressive, quick, not too precise.
7000 May still have many false positives (not as many as level 1 though),
7001 and few false negatives (but possibly more than level 1).
7002 Unlike level 1, it only warns when an address is taken.  Warns about
7003 incomplete types.  Runs in the front end only.
7005 Level 3 (default for @option{-Wstrict-aliasing}):
7006 Should have very few false positives and few false
7007 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
7008 Takes care of the common pun+dereference pattern in the front end:
7009 @code{*(int*)&some_float}.
7010 If optimization is enabled, it also runs in the back end, where it deals
7011 with multiple statement cases using flow-sensitive points-to information.
7012 Only warns when the converted pointer is dereferenced.
7013 Does not warn about incomplete types.
7015 @item -Wstrict-overflow
7016 @itemx -Wstrict-overflow=@var{n}
7017 @opindex Wstrict-overflow
7018 @opindex Wno-strict-overflow
7019 This option is only active when signed overflow is undefined.
7020 It warns about cases where the compiler optimizes based on the
7021 assumption that signed overflow does not occur.  Note that it does not
7022 warn about all cases where the code might overflow: it only warns
7023 about cases where the compiler implements some optimization.  Thus
7024 this warning depends on the optimization level.
7026 An optimization that assumes that signed overflow does not occur is
7027 perfectly safe if the values of the variables involved are such that
7028 overflow never does, in fact, occur.  Therefore this warning can
7029 easily give a false positive: a warning about code that is not
7030 actually a problem.  To help focus on important issues, several
7031 warning levels are defined.  No warnings are issued for the use of
7032 undefined signed overflow when estimating how many iterations a loop
7033 requires, in particular when determining whether a loop will be
7034 executed at all.
7036 @table @gcctabopt
7037 @item -Wstrict-overflow=1
7038 Warn about cases that are both questionable and easy to avoid.  For
7039 example the compiler simplifies
7040 @code{x + 1 > x} to @code{1}.  This level of
7041 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
7042 are not, and must be explicitly requested.
7044 @item -Wstrict-overflow=2
7045 Also warn about other cases where a comparison is simplified to a
7046 constant.  For example: @code{abs (x) >= 0}.  This can only be
7047 simplified when signed integer overflow is undefined, because
7048 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
7049 zero.  @option{-Wstrict-overflow} (with no level) is the same as
7050 @option{-Wstrict-overflow=2}.
7052 @item -Wstrict-overflow=3
7053 Also warn about other cases where a comparison is simplified.  For
7054 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
7056 @item -Wstrict-overflow=4
7057 Also warn about other simplifications not covered by the above cases.
7058 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
7060 @item -Wstrict-overflow=5
7061 Also warn about cases where the compiler reduces the magnitude of a
7062 constant involved in a comparison.  For example: @code{x + 2 > y} is
7063 simplified to @code{x + 1 >= y}.  This is reported only at the
7064 highest warning level because this simplification applies to many
7065 comparisons, so this warning level gives a very large number of
7066 false positives.
7067 @end table
7069 @item -Wstring-compare
7070 @opindex Wstring-compare
7071 @opindex Wno-string-compare
7072 Warn for calls to @code{strcmp} and @code{strncmp} whose result is
7073 determined to be either zero or non-zero in tests for such equality
7074 owing to the length of one argument being greater than the size of
7075 the array the other argument is stored in (or the bound in the case
7076 of @code{strncmp}).  Such calls could be mistakes.  For example,
7077 the call to @code{strcmp} below is diagnosed because its result is
7078 necessarily non-zero irrespective of the contents of the array @code{a}.
7080 @smallexample
7081 extern char a[4];
7082 void f (char *d)
7084   strcpy (d, "string");
7085   @dots{}
7086   if (0 == strcmp (a, d))   // cannot be true
7087     puts ("a and d are the same");
7089 @end smallexample
7091 @option{-Wstring-compare} is enabled by @option{-Wextra}.
7093 @item -Wno-stringop-overflow
7094 @item -Wstringop-overflow
7095 @itemx -Wstringop-overflow=@var{type}
7096 @opindex Wstringop-overflow
7097 @opindex Wno-stringop-overflow
7098 Warn for calls to string manipulation functions such as @code{memcpy} and
7099 @code{strcpy} that are determined to overflow the destination buffer.  The
7100 optional argument is one greater than the type of Object Size Checking to
7101 perform to determine the size of the destination.  @xref{Object Size Checking}.
7102 The argument is meaningful only for functions that operate on character arrays
7103 but not for raw memory functions like @code{memcpy} which always make use
7104 of Object Size type-0.  The option also warns for calls that specify a size
7105 in excess of the largest possible object or at most @code{SIZE_MAX / 2} bytes.
7106 The option produces the best results with optimization enabled but can detect
7107 a small subset of simple buffer overflows even without optimization in
7108 calls to the GCC built-in functions like @code{__builtin_memcpy} that
7109 correspond to the standard functions.  In any case, the option warns about
7110 just a subset of buffer overflows detected by the corresponding overflow
7111 checking built-ins.  For example, the option issues a warning for
7112 the @code{strcpy} call below because it copies at least 5 characters
7113 (the string @code{"blue"} including the terminating NUL) into the buffer
7114 of size 4.
7116 @smallexample
7117 enum Color @{ blue, purple, yellow @};
7118 const char* f (enum Color clr)
7120   static char buf [4];
7121   const char *str;
7122   switch (clr)
7123     @{
7124       case blue: str = "blue"; break;
7125       case purple: str = "purple"; break;
7126       case yellow: str = "yellow"; break;
7127     @}
7129   return strcpy (buf, str);   // warning here
7131 @end smallexample
7133 Option @option{-Wstringop-overflow=2} is enabled by default.
7135 @table @gcctabopt
7136 @item -Wstringop-overflow
7137 @itemx -Wstringop-overflow=1
7138 @opindex Wstringop-overflow
7139 @opindex Wno-stringop-overflow
7140 The @option{-Wstringop-overflow=1} option uses type-zero Object Size Checking
7141 to determine the sizes of destination objects.  At this setting the option
7142 does not warn for writes past the end of subobjects of larger objects accessed
7143 by pointers unless the size of the largest surrounding object is known.  When
7144 the destination may be one of several objects it is assumed to be the largest
7145 one of them.  On Linux systems, when optimization is enabled at this setting
7146 the option warns for the same code as when the @code{_FORTIFY_SOURCE} macro
7147 is defined to a non-zero value.
7149 @item -Wstringop-overflow=2
7150 The @option{-Wstringop-overflow=2} option uses type-one Object Size Checking
7151 to determine the sizes of destination objects.  At this setting the option
7152 warns about overflows when writing to members of the largest complete
7153 objects whose exact size is known.  However, it does not warn for excessive
7154 writes to the same members of unknown objects referenced by pointers since
7155 they may point to arrays containing unknown numbers of elements.  This is
7156 the default setting of the option.
7158 @item -Wstringop-overflow=3
7159 The @option{-Wstringop-overflow=3} option uses type-two Object Size Checking
7160 to determine the sizes of destination objects.  At this setting the option
7161 warns about overflowing the smallest object or data member.  This is the
7162 most restrictive setting of the option that may result in warnings for safe
7163 code.
7165 @item -Wstringop-overflow=4
7166 The @option{-Wstringop-overflow=4} option uses type-three Object Size Checking
7167 to determine the sizes of destination objects.  At this setting the option
7168 warns about overflowing any data members, and when the destination is
7169 one of several objects it uses the size of the largest of them to decide
7170 whether to issue a warning.  Similarly to @option{-Wstringop-overflow=3} this
7171 setting of the option may result in warnings for benign code.
7172 @end table
7174 @item -Wno-stringop-overread
7175 @opindex Wstringop-overread
7176 @opindex Wno-stringop-overread
7177 Warn for calls to string manipulation functions such as @code{memchr}, or
7178 @code{strcpy} that are determined to read past the end of the source
7179 sequence.
7181 Option @option{-Wstringop-overread} is enabled by default.
7183 @item -Wno-stringop-truncation
7184 @opindex Wstringop-truncation
7185 @opindex Wno-stringop-truncation
7186 Do not warn for calls to bounded string manipulation functions
7187 such as @code{strncat},
7188 @code{strncpy}, and @code{stpncpy} that may either truncate the copied string
7189 or leave the destination unchanged.
7191 In the following example, the call to @code{strncat} specifies a bound that
7192 is less than the length of the source string.  As a result, the copy of
7193 the source will be truncated and so the call is diagnosed.  To avoid the
7194 warning use @code{bufsize - strlen (buf) - 1)} as the bound.
7196 @smallexample
7197 void append (char *buf, size_t bufsize)
7199   strncat (buf, ".txt", 3);
7201 @end smallexample
7203 As another example, the following call to @code{strncpy} results in copying
7204 to @code{d} just the characters preceding the terminating NUL, without
7205 appending the NUL to the end.  Assuming the result of @code{strncpy} is
7206 necessarily a NUL-terminated string is a common mistake, and so the call
7207 is diagnosed.  To avoid the warning when the result is not expected to be
7208 NUL-terminated, call @code{memcpy} instead.
7210 @smallexample
7211 void copy (char *d, const char *s)
7213   strncpy (d, s, strlen (s));
7215 @end smallexample
7217 In the following example, the call to @code{strncpy} specifies the size
7218 of the destination buffer as the bound.  If the length of the source
7219 string is equal to or greater than this size the result of the copy will
7220 not be NUL-terminated.  Therefore, the call is also diagnosed.  To avoid
7221 the warning, specify @code{sizeof buf - 1} as the bound and set the last
7222 element of the buffer to @code{NUL}.
7224 @smallexample
7225 void copy (const char *s)
7227   char buf[80];
7228   strncpy (buf, s, sizeof buf);
7229   @dots{}
7231 @end smallexample
7233 In situations where a character array is intended to store a sequence
7234 of bytes with no terminating @code{NUL} such an array may be annotated
7235 with attribute @code{nonstring} to avoid this warning.  Such arrays,
7236 however, are not suitable arguments to functions that expect
7237 @code{NUL}-terminated strings.  To help detect accidental misuses of
7238 such arrays GCC issues warnings unless it can prove that the use is
7239 safe.  @xref{Common Variable Attributes}.
7241 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}cold@r{|}malloc@r{]}
7242 @opindex Wsuggest-attribute=
7243 @opindex Wno-suggest-attribute=
7244 Warn for cases where adding an attribute may be beneficial. The
7245 attributes currently supported are listed below.
7247 @table @gcctabopt
7248 @item -Wsuggest-attribute=pure
7249 @itemx -Wsuggest-attribute=const
7250 @itemx -Wsuggest-attribute=noreturn
7251 @itemx -Wmissing-noreturn
7252 @itemx -Wsuggest-attribute=malloc
7253 @opindex Wsuggest-attribute=pure
7254 @opindex Wno-suggest-attribute=pure
7255 @opindex Wsuggest-attribute=const
7256 @opindex Wno-suggest-attribute=const
7257 @opindex Wsuggest-attribute=noreturn
7258 @opindex Wno-suggest-attribute=noreturn
7259 @opindex Wmissing-noreturn
7260 @opindex Wno-missing-noreturn
7261 @opindex Wsuggest-attribute=malloc
7262 @opindex Wno-suggest-attribute=malloc
7264 Warn about functions that might be candidates for attributes
7265 @code{pure}, @code{const} or @code{noreturn} or @code{malloc}. The compiler
7266 only warns for functions visible in other compilation units or (in the case of
7267 @code{pure} and @code{const}) if it cannot prove that the function returns
7268 normally. A function returns normally if it doesn't contain an infinite loop or
7269 return abnormally by throwing, calling @code{abort} or trapping.  This analysis
7270 requires option @option{-fipa-pure-const}, which is enabled by default at
7271 @option{-O} and higher.  Higher optimization levels improve the accuracy
7272 of the analysis.
7274 @item -Wsuggest-attribute=format
7275 @itemx -Wmissing-format-attribute
7276 @opindex Wsuggest-attribute=format
7277 @opindex Wmissing-format-attribute
7278 @opindex Wno-suggest-attribute=format
7279 @opindex Wno-missing-format-attribute
7280 @opindex Wformat
7281 @opindex Wno-format
7283 Warn about function pointers that might be candidates for @code{format}
7284 attributes.  Note these are only possible candidates, not absolute ones.
7285 GCC guesses that function pointers with @code{format} attributes that
7286 are used in assignment, initialization, parameter passing or return
7287 statements should have a corresponding @code{format} attribute in the
7288 resulting type.  I.e.@: the left-hand side of the assignment or
7289 initialization, the type of the parameter variable, or the return type
7290 of the containing function respectively should also have a @code{format}
7291 attribute to avoid the warning.
7293 GCC also warns about function definitions that might be
7294 candidates for @code{format} attributes.  Again, these are only
7295 possible candidates.  GCC guesses that @code{format} attributes
7296 might be appropriate for any function that calls a function like
7297 @code{vprintf} or @code{vscanf}, but this might not always be the
7298 case, and some functions for which @code{format} attributes are
7299 appropriate may not be detected.
7301 @item -Wsuggest-attribute=cold
7302 @opindex Wsuggest-attribute=cold
7303 @opindex Wno-suggest-attribute=cold
7305 Warn about functions that might be candidates for @code{cold} attribute.  This
7306 is based on static detection and generally only warns about functions which
7307 always leads to a call to another @code{cold} function such as wrappers of
7308 C++ @code{throw} or fatal error reporting functions leading to @code{abort}.
7309 @end table
7311 @item -Walloc-zero
7312 @opindex Wno-alloc-zero
7313 @opindex Walloc-zero
7314 Warn about calls to allocation functions decorated with attribute
7315 @code{alloc_size} that specify zero bytes, including those to the built-in
7316 forms of the functions @code{aligned_alloc}, @code{alloca}, @code{calloc},
7317 @code{malloc}, and @code{realloc}.  Because the behavior of these functions
7318 when called with a zero size differs among implementations (and in the case
7319 of @code{realloc} has been deprecated) relying on it may result in subtle
7320 portability bugs and should be avoided.
7322 @item -Walloc-size-larger-than=@var{byte-size}
7323 @opindex Walloc-size-larger-than=
7324 @opindex Wno-alloc-size-larger-than
7325 Warn about calls to functions decorated with attribute @code{alloc_size}
7326 that attempt to allocate objects larger than the specified number of bytes,
7327 or where the result of the size computation in an integer type with infinite
7328 precision would exceed the value of @samp{PTRDIFF_MAX} on the target.
7329 @option{-Walloc-size-larger-than=}@samp{PTRDIFF_MAX} is enabled by default.
7330 Warnings controlled by the option can be disabled either by specifying
7331 @var{byte-size} of @samp{SIZE_MAX} or more or by
7332 @option{-Wno-alloc-size-larger-than}.
7333 @xref{Function Attributes}.
7335 @item -Wno-alloc-size-larger-than
7336 @opindex Wno-alloc-size-larger-than
7337 Disable @option{-Walloc-size-larger-than=} warnings.  The option is
7338 equivalent to @option{-Walloc-size-larger-than=}@samp{SIZE_MAX} or
7339 larger.
7341 @item -Walloca
7342 @opindex Wno-alloca
7343 @opindex Walloca
7344 This option warns on all uses of @code{alloca} in the source.
7346 @item -Walloca-larger-than=@var{byte-size}
7347 @opindex Walloca-larger-than=
7348 @opindex Wno-alloca-larger-than
7349 This option warns on calls to @code{alloca} with an integer argument whose
7350 value is either zero, or that is not bounded by a controlling predicate
7351 that limits its value to at most @var{byte-size}.  It also warns for calls
7352 to @code{alloca} where the bound value is unknown.  Arguments of non-integer
7353 types are considered unbounded even if they appear to be constrained to
7354 the expected range.
7356 For example, a bounded case of @code{alloca} could be:
7358 @smallexample
7359 void func (size_t n)
7361   void *p;
7362   if (n <= 1000)
7363     p = alloca (n);
7364   else
7365     p = malloc (n);
7366   f (p);
7368 @end smallexample
7370 In the above example, passing @code{-Walloca-larger-than=1000} would not
7371 issue a warning because the call to @code{alloca} is known to be at most
7372 1000 bytes.  However, if @code{-Walloca-larger-than=500} were passed,
7373 the compiler would emit a warning.
7375 Unbounded uses, on the other hand, are uses of @code{alloca} with no
7376 controlling predicate constraining its integer argument.  For example:
7378 @smallexample
7379 void func ()
7381   void *p = alloca (n);
7382   f (p);
7384 @end smallexample
7386 If @code{-Walloca-larger-than=500} were passed, the above would trigger
7387 a warning, but this time because of the lack of bounds checking.
7389 Note, that even seemingly correct code involving signed integers could
7390 cause a warning:
7392 @smallexample
7393 void func (signed int n)
7395   if (n < 500)
7396     @{
7397       p = alloca (n);
7398       f (p);
7399     @}
7401 @end smallexample
7403 In the above example, @var{n} could be negative, causing a larger than
7404 expected argument to be implicitly cast into the @code{alloca} call.
7406 This option also warns when @code{alloca} is used in a loop.
7408 @option{-Walloca-larger-than=}@samp{PTRDIFF_MAX} is enabled by default
7409 but is usually only effective  when @option{-ftree-vrp} is active (default
7410 for @option{-O2} and above).
7412 See also @option{-Wvla-larger-than=}@samp{byte-size}.
7414 @item -Wno-alloca-larger-than
7415 @opindex Wno-alloca-larger-than
7416 Disable @option{-Walloca-larger-than=} warnings.  The option is
7417 equivalent to @option{-Walloca-larger-than=}@samp{SIZE_MAX} or larger.
7419 @item -Warith-conversion
7420 @opindex Warith-conversion
7421 @opindex Wno-arith-conversion
7422 Do warn about implicit conversions from arithmetic operations even
7423 when conversion of the operands to the same type cannot change their
7424 values.  This affects warnings from @option{-Wconversion},
7425 @option{-Wfloat-conversion}, and @option{-Wsign-conversion}.
7427 @smallexample
7428 @group
7429 void f (char c, int i)
7431   c = c + i; // warns with @option{-Wconversion}
7432   c = c + 1; // only warns with @option{-Warith-conversion}
7434 @end group
7435 @end smallexample
7437 @item -Warray-bounds
7438 @itemx -Warray-bounds=@var{n}
7439 @opindex Wno-array-bounds
7440 @opindex Warray-bounds
7441 This option is only active when @option{-ftree-vrp} is active
7442 (default for @option{-O2} and above). It warns about subscripts to arrays
7443 that are always out of bounds. This warning is enabled by @option{-Wall}.
7445 @table @gcctabopt
7446 @item -Warray-bounds=1
7447 This is the warning level of @option{-Warray-bounds} and is enabled
7448 by @option{-Wall}; higher levels are not, and must be explicitly requested.
7450 @item -Warray-bounds=2
7451 This warning level also warns about out of bounds access for
7452 arrays at the end of a struct and for arrays accessed through
7453 pointers. This warning level may give a larger number of
7454 false positives and is deactivated by default.
7455 @end table
7457 @item -Warray-parameter
7458 @itemx -Warray-parameter=@var{n}
7459 @opindex Wno-array-parameter
7460 Warn about redeclarations of functions involving arguments of array or
7461 pointer types of inconsistent kinds or forms, and enable the detection
7462 of out-of-bounds accesses to such parameters by warnings such as
7463 @option{-Warray-bounds}.
7465 If the first function declaration uses the array form the bound specified
7466 in the array is assumed to be the minimum number of elements expected to
7467 be provided in calls to the function and the maximum number of elements
7468 accessed by it.  Failing to provide arguments of sufficient size or accessing
7469 more than the maximum number of elements may be diagnosed by warnings such
7470 as @option{-Warray-bounds}.  At level 1 the warning diagnoses inconsistencies
7471 involving array parameters declared using the @code{T[static N]} form.
7473 For example, the warning triggers for the following redeclarations because
7474 the first one allows an array of any size to be passed to @code{f} while
7475 the second one with the keyword @code{static} specifies that the array
7476 argument must have at least four elements.
7478 @smallexample
7479 void f (int[static 4]);
7480 void f (int[]);           // warning (inconsistent array form)
7482 void g (void)
7484   int *p = (int *)malloc (4);
7485   f (p);                  // warning (array too small)
7486   @dots{}
7488 @end smallexample
7490 At level 2 the warning also triggers for redeclarations involving any other
7491 inconsistency in array or pointer argument forms denoting array sizes.
7492 Pointers and arrays of unspecified bound are considered equivalent and do
7493 not trigger a warning.
7495 @smallexample
7496 void g (int*);
7497 void g (int[]);     // no warning
7498 void g (int[8]);    // warning (inconsistent array bound)
7499 @end smallexample
7501 @option{-Warray-parameter=2} is included in @option{-Wall}.  The
7502 @option{-Wvla-parameter} option triggers warnings for similar inconsistencies
7503 involving Variable Length Array arguments.
7505 @item -Wattribute-alias=@var{n}
7506 @itemx -Wno-attribute-alias
7507 @opindex Wattribute-alias
7508 @opindex Wno-attribute-alias
7509 Warn about declarations using the @code{alias} and similar attributes whose
7510 target is incompatible with the type of the alias.
7511 @xref{Function Attributes,,Declaring Attributes of Functions}.
7513 @table @gcctabopt
7514 @item -Wattribute-alias=1
7515 The default warning level of the @option{-Wattribute-alias} option diagnoses
7516 incompatibilities between the type of the alias declaration and that of its
7517 target.  Such incompatibilities are typically indicative of bugs.
7519 @item -Wattribute-alias=2
7521 At this level @option{-Wattribute-alias} also diagnoses cases where
7522 the attributes of the alias declaration are more restrictive than the
7523 attributes applied to its target.  These mismatches can potentially
7524 result in incorrect code generation.  In other cases they may be
7525 benign and could be resolved simply by adding the missing attribute to
7526 the target.  For comparison, see the @option{-Wmissing-attributes}
7527 option, which controls diagnostics when the alias declaration is less
7528 restrictive than the target, rather than more restrictive.
7530 Attributes considered include @code{alloc_align}, @code{alloc_size},
7531 @code{cold}, @code{const}, @code{hot}, @code{leaf}, @code{malloc},
7532 @code{nonnull}, @code{noreturn}, @code{nothrow}, @code{pure},
7533 @code{returns_nonnull}, and @code{returns_twice}.
7534 @end table
7536 @option{-Wattribute-alias} is equivalent to @option{-Wattribute-alias=1}.
7537 This is the default.  You can disable these warnings with either
7538 @option{-Wno-attribute-alias} or @option{-Wattribute-alias=0}.
7540 @item -Wbool-compare
7541 @opindex Wno-bool-compare
7542 @opindex Wbool-compare
7543 Warn about boolean expression compared with an integer value different from
7544 @code{true}/@code{false}.  For instance, the following comparison is
7545 always false:
7546 @smallexample
7547 int n = 5;
7548 @dots{}
7549 if ((n > 1) == 2) @{ @dots{} @}
7550 @end smallexample
7551 This warning is enabled by @option{-Wall}.
7553 @item -Wbool-operation
7554 @opindex Wno-bool-operation
7555 @opindex Wbool-operation
7556 Warn about suspicious operations on expressions of a boolean type.  For
7557 instance, bitwise negation of a boolean is very likely a bug in the program.
7558 For C, this warning also warns about incrementing or decrementing a boolean,
7559 which rarely makes sense.  (In C++, decrementing a boolean is always invalid.
7560 Incrementing a boolean is invalid in C++17, and deprecated otherwise.)
7562 This warning is enabled by @option{-Wall}.
7564 @item -Wduplicated-branches
7565 @opindex Wno-duplicated-branches
7566 @opindex Wduplicated-branches
7567 Warn when an if-else has identical branches.  This warning detects cases like
7568 @smallexample
7569 if (p != NULL)
7570   return 0;
7571 else
7572   return 0;
7573 @end smallexample
7574 It doesn't warn when both branches contain just a null statement.  This warning
7575 also warn for conditional operators:
7576 @smallexample
7577   int i = x ? *p : *p;
7578 @end smallexample
7580 @item -Wduplicated-cond
7581 @opindex Wno-duplicated-cond
7582 @opindex Wduplicated-cond
7583 Warn about duplicated conditions in an if-else-if chain.  For instance,
7584 warn for the following code:
7585 @smallexample
7586 if (p->q != NULL) @{ @dots{} @}
7587 else if (p->q != NULL) @{ @dots{} @}
7588 @end smallexample
7590 @item -Wframe-address
7591 @opindex Wno-frame-address
7592 @opindex Wframe-address
7593 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
7594 is called with an argument greater than 0.  Such calls may return indeterminate
7595 values or crash the program.  The warning is included in @option{-Wall}.
7597 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
7598 @opindex Wno-discarded-qualifiers
7599 @opindex Wdiscarded-qualifiers
7600 Do not warn if type qualifiers on pointers are being discarded.
7601 Typically, the compiler warns if a @code{const char *} variable is
7602 passed to a function that takes a @code{char *} parameter.  This option
7603 can be used to suppress such a warning.
7605 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
7606 @opindex Wno-discarded-array-qualifiers
7607 @opindex Wdiscarded-array-qualifiers
7608 Do not warn if type qualifiers on arrays which are pointer targets
7609 are being discarded.  Typically, the compiler warns if a
7610 @code{const int (*)[]} variable is passed to a function that
7611 takes a @code{int (*)[]} parameter.  This option can be used to
7612 suppress such a warning.
7614 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
7615 @opindex Wno-incompatible-pointer-types
7616 @opindex Wincompatible-pointer-types
7617 Do not warn when there is a conversion between pointers that have incompatible
7618 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
7619 which warns for pointer argument passing or assignment with different
7620 signedness.
7622 @item -Wno-int-conversion @r{(C and Objective-C only)}
7623 @opindex Wno-int-conversion
7624 @opindex Wint-conversion
7625 Do not warn about incompatible integer to pointer and pointer to integer
7626 conversions.  This warning is about implicit conversions; for explicit
7627 conversions the warnings @option{-Wno-int-to-pointer-cast} and
7628 @option{-Wno-pointer-to-int-cast} may be used.
7630 @item -Wzero-length-bounds
7631 @opindex Wzero-length-bounds
7632 @opindex Wzero-length-bounds
7633 Warn about accesses to elements of zero-length array members that might
7634 overlap other members of the same object.  Declaring interior zero-length
7635 arrays is discouraged because accesses to them are undefined.  See
7636 @xref{Zero Length}.
7638 For example, the first two stores in function @code{bad} are diagnosed
7639 because the array elements overlap the subsequent members @code{b} and
7640 @code{c}.  The third store is diagnosed by @option{-Warray-bounds}
7641 because it is beyond the bounds of the enclosing object.
7643 @smallexample
7644 struct X @{ int a[0]; int b, c; @};
7645 struct X x;
7647 void bad (void)
7649   x.a[0] = 0;   // -Wzero-length-bounds
7650   x.a[1] = 1;   // -Wzero-length-bounds
7651   x.a[2] = 2;   // -Warray-bounds
7653 @end smallexample
7655 Option @option{-Wzero-length-bounds} is enabled by @option{-Warray-bounds}.
7657 @item -Wno-div-by-zero
7658 @opindex Wno-div-by-zero
7659 @opindex Wdiv-by-zero
7660 Do not warn about compile-time integer division by zero.  Floating-point
7661 division by zero is not warned about, as it can be a legitimate way of
7662 obtaining infinities and NaNs.
7664 @item -Wsystem-headers
7665 @opindex Wsystem-headers
7666 @opindex Wno-system-headers
7667 @cindex warnings from system headers
7668 @cindex system headers, warnings from
7669 Print warning messages for constructs found in system header files.
7670 Warnings from system headers are normally suppressed, on the assumption
7671 that they usually do not indicate real problems and would only make the
7672 compiler output harder to read.  Using this command-line option tells
7673 GCC to emit warnings from system headers as if they occurred in user
7674 code.  However, note that using @option{-Wall} in conjunction with this
7675 option does @emph{not} warn about unknown pragmas in system
7676 headers---for that, @option{-Wunknown-pragmas} must also be used.
7678 @item -Wtautological-compare
7679 @opindex Wtautological-compare
7680 @opindex Wno-tautological-compare
7681 Warn if a self-comparison always evaluates to true or false.  This
7682 warning detects various mistakes such as:
7683 @smallexample
7684 int i = 1;
7685 @dots{}
7686 if (i > i) @{ @dots{} @}
7687 @end smallexample
7689 This warning also warns about bitwise comparisons that always evaluate
7690 to true or false, for instance:
7691 @smallexample
7692 if ((a & 16) == 10) @{ @dots{} @}
7693 @end smallexample
7694 will always be false.
7696 This warning is enabled by @option{-Wall}.
7698 @item -Wtrampolines
7699 @opindex Wtrampolines
7700 @opindex Wno-trampolines
7701 Warn about trampolines generated for pointers to nested functions.
7702 A trampoline is a small piece of data or code that is created at run
7703 time on the stack when the address of a nested function is taken, and is
7704 used to call the nested function indirectly.  For some targets, it is
7705 made up of data only and thus requires no special treatment.  But, for
7706 most targets, it is made up of code and thus requires the stack to be
7707 made executable in order for the program to work properly.
7709 @item -Wfloat-equal
7710 @opindex Wfloat-equal
7711 @opindex Wno-float-equal
7712 Warn if floating-point values are used in equality comparisons.
7714 The idea behind this is that sometimes it is convenient (for the
7715 programmer) to consider floating-point values as approximations to
7716 infinitely precise real numbers.  If you are doing this, then you need
7717 to compute (by analyzing the code, or in some other way) the maximum or
7718 likely maximum error that the computation introduces, and allow for it
7719 when performing comparisons (and when producing output, but that's a
7720 different problem).  In particular, instead of testing for equality, you
7721 should check to see whether the two values have ranges that overlap; and
7722 this is done with the relational operators, so equality comparisons are
7723 probably mistaken.
7725 @item -Wtraditional @r{(C and Objective-C only)}
7726 @opindex Wtraditional
7727 @opindex Wno-traditional
7728 Warn about certain constructs that behave differently in traditional and
7729 ISO C@.  Also warn about ISO C constructs that have no traditional C
7730 equivalent, and/or problematic constructs that should be avoided.
7732 @itemize @bullet
7733 @item
7734 Macro parameters that appear within string literals in the macro body.
7735 In traditional C macro replacement takes place within string literals,
7736 but in ISO C it does not.
7738 @item
7739 In traditional C, some preprocessor directives did not exist.
7740 Traditional preprocessors only considered a line to be a directive
7741 if the @samp{#} appeared in column 1 on the line.  Therefore
7742 @option{-Wtraditional} warns about directives that traditional C
7743 understands but ignores because the @samp{#} does not appear as the
7744 first character on the line.  It also suggests you hide directives like
7745 @code{#pragma} not understood by traditional C by indenting them.  Some
7746 traditional implementations do not recognize @code{#elif}, so this option
7747 suggests avoiding it altogether.
7749 @item
7750 A function-like macro that appears without arguments.
7752 @item
7753 The unary plus operator.
7755 @item
7756 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
7757 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
7758 constants.)  Note, these suffixes appear in macros defined in the system
7759 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
7760 Use of these macros in user code might normally lead to spurious
7761 warnings, however GCC's integrated preprocessor has enough context to
7762 avoid warning in these cases.
7764 @item
7765 A function declared external in one block and then used after the end of
7766 the block.
7768 @item
7769 A @code{switch} statement has an operand of type @code{long}.
7771 @item
7772 A non-@code{static} function declaration follows a @code{static} one.
7773 This construct is not accepted by some traditional C compilers.
7775 @item
7776 The ISO type of an integer constant has a different width or
7777 signedness from its traditional type.  This warning is only issued if
7778 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
7779 typically represent bit patterns, are not warned about.
7781 @item
7782 Usage of ISO string concatenation is detected.
7784 @item
7785 Initialization of automatic aggregates.
7787 @item
7788 Identifier conflicts with labels.  Traditional C lacks a separate
7789 namespace for labels.
7791 @item
7792 Initialization of unions.  If the initializer is zero, the warning is
7793 omitted.  This is done under the assumption that the zero initializer in
7794 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
7795 initializer warnings and relies on default initialization to zero in the
7796 traditional C case.
7798 @item
7799 Conversions by prototypes between fixed/floating-point values and vice
7800 versa.  The absence of these prototypes when compiling with traditional
7801 C causes serious problems.  This is a subset of the possible
7802 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
7804 @item
7805 Use of ISO C style function definitions.  This warning intentionally is
7806 @emph{not} issued for prototype declarations or variadic functions
7807 because these ISO C features appear in your code when using
7808 libiberty's traditional C compatibility macros, @code{PARAMS} and
7809 @code{VPARAMS}.  This warning is also bypassed for nested functions
7810 because that feature is already a GCC extension and thus not relevant to
7811 traditional C compatibility.
7812 @end itemize
7814 @item -Wtraditional-conversion @r{(C and Objective-C only)}
7815 @opindex Wtraditional-conversion
7816 @opindex Wno-traditional-conversion
7817 Warn if a prototype causes a type conversion that is different from what
7818 would happen to the same argument in the absence of a prototype.  This
7819 includes conversions of fixed point to floating and vice versa, and
7820 conversions changing the width or signedness of a fixed-point argument
7821 except when the same as the default promotion.
7823 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
7824 @opindex Wdeclaration-after-statement
7825 @opindex Wno-declaration-after-statement
7826 Warn when a declaration is found after a statement in a block.  This
7827 construct, known from C++, was introduced with ISO C99 and is by default
7828 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Labels and Declarations}.
7830 @item -Wshadow
7831 @opindex Wshadow
7832 @opindex Wno-shadow
7833 Warn whenever a local variable or type declaration shadows another
7834 variable, parameter, type, class member (in C++), or instance variable
7835 (in Objective-C) or whenever a built-in function is shadowed.  Note
7836 that in C++, the compiler warns if a local variable shadows an
7837 explicit typedef, but not if it shadows a struct/class/enum.
7838 If this warning is enabled, it includes also all instances of
7839 local shadowing.  This means that @option{-Wno-shadow=local}
7840 and @option{-Wno-shadow=compatible-local} are ignored when
7841 @option{-Wshadow} is used.
7842 Same as @option{-Wshadow=global}.
7844 @item -Wno-shadow-ivar @r{(Objective-C only)}
7845 @opindex Wno-shadow-ivar
7846 @opindex Wshadow-ivar
7847 Do not warn whenever a local variable shadows an instance variable in an
7848 Objective-C method.
7850 @item -Wshadow=global
7851 @opindex Wshadow=global
7852 Warn for any shadowing.
7853 Same as @option{-Wshadow}.
7855 @item -Wshadow=local
7856 @opindex Wshadow=local
7857 Warn when a local variable shadows another local variable or parameter.
7859 @item -Wshadow=compatible-local
7860 @opindex Wshadow=compatible-local
7861 Warn when a local variable shadows another local variable or parameter
7862 whose type is compatible with that of the shadowing variable.  In C++,
7863 type compatibility here means the type of the shadowing variable can be
7864 converted to that of the shadowed variable.  The creation of this flag
7865 (in addition to @option{-Wshadow=local}) is based on the idea that when
7866 a local variable shadows another one of incompatible type, it is most
7867 likely intentional, not a bug or typo, as shown in the following example:
7869 @smallexample
7870 @group
7871 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
7873   for (int i = 0; i < N; ++i)
7874   @{
7875     ...
7876   @}
7877   ...
7879 @end group
7880 @end smallexample
7882 Since the two variable @code{i} in the example above have incompatible types,
7883 enabling only @option{-Wshadow=compatible-local} does not emit a warning.
7884 Because their types are incompatible, if a programmer accidentally uses one
7885 in place of the other, type checking is expected to catch that and emit an
7886 error or warning.  Use of this flag instead of @option{-Wshadow=local} can
7887 possibly reduce the number of warnings triggered by intentional shadowing.
7888 Note that this also means that shadowing @code{const char *i} by
7889 @code{char *i} does not emit a warning.
7891 This warning is also enabled by @option{-Wshadow=local}.
7893 @item -Wlarger-than=@var{byte-size}
7894 @opindex Wlarger-than=
7895 @opindex Wlarger-than-@var{byte-size}
7896 Warn whenever an object is defined whose size exceeds @var{byte-size}.
7897 @option{-Wlarger-than=}@samp{PTRDIFF_MAX} is enabled by default.
7898 Warnings controlled by the option can be disabled either by specifying
7899 @var{byte-size} of @samp{SIZE_MAX} or more or by @option{-Wno-larger-than}.
7901 Also warn for calls to bounded functions such as @code{memchr} or
7902 @code{strnlen} that specify a bound greater than the largest possible
7903 object, which is @samp{PTRDIFF_MAX} bytes by default.  These warnings
7904 can only be disabled by @option{-Wno-larger-than}.
7906 @item -Wno-larger-than
7907 @opindex Wno-larger-than
7908 Disable @option{-Wlarger-than=} warnings.  The option is equivalent
7909 to @option{-Wlarger-than=}@samp{SIZE_MAX} or larger.
7911 @item -Wframe-larger-than=@var{byte-size}
7912 @opindex Wframe-larger-than=
7913 @opindex Wno-frame-larger-than
7914 Warn if the size of a function frame exceeds @var{byte-size}.
7915 The computation done to determine the stack frame size is approximate
7916 and not conservative.
7917 The actual requirements may be somewhat greater than @var{byte-size}
7918 even if you do not get a warning.  In addition, any space allocated
7919 via @code{alloca}, variable-length arrays, or related constructs
7920 is not included by the compiler when determining
7921 whether or not to issue a warning.
7922 @option{-Wframe-larger-than=}@samp{PTRDIFF_MAX} is enabled by default.
7923 Warnings controlled by the option can be disabled either by specifying
7924 @var{byte-size} of @samp{SIZE_MAX} or more or by
7925 @option{-Wno-frame-larger-than}.
7927 @item -Wno-frame-larger-than
7928 @opindex Wno-frame-larger-than
7929 Disable @option{-Wframe-larger-than=} warnings.  The option is equivalent
7930 to @option{-Wframe-larger-than=}@samp{SIZE_MAX} or larger.
7932 @item -Wno-free-nonheap-object
7933 @opindex Wno-free-nonheap-object
7934 @opindex Wfree-nonheap-object
7935 Warn when attempting to deallocate an object that was either not allocated
7936 on the heap, or by using a pointer that was not returned from a prior call
7937 to the corresponding allocation function.  For example, because the call
7938 to @code{stpcpy} returns a pointer to the terminating nul character and
7939 not to the begginning of the object, the call to @code{free} below is
7940 diagnosed.
7942 @smallexample
7943 void f (char *p)
7945   p = stpcpy (p, "abc");
7946   // ...
7947   free (p);   // warning
7949 @end smallexample
7951 @option{-Wfree-nonheap-object} is enabled by default.
7953 @item -Wstack-usage=@var{byte-size}
7954 @opindex Wstack-usage
7955 @opindex Wno-stack-usage
7956 Warn if the stack usage of a function might exceed @var{byte-size}.
7957 The computation done to determine the stack usage is conservative.
7958 Any space allocated via @code{alloca}, variable-length arrays, or related
7959 constructs is included by the compiler when determining whether or not to
7960 issue a warning.
7962 The message is in keeping with the output of @option{-fstack-usage}.
7964 @itemize
7965 @item
7966 If the stack usage is fully static but exceeds the specified amount, it's:
7968 @smallexample
7969   warning: stack usage is 1120 bytes
7970 @end smallexample
7971 @item
7972 If the stack usage is (partly) dynamic but bounded, it's:
7974 @smallexample
7975   warning: stack usage might be 1648 bytes
7976 @end smallexample
7977 @item
7978 If the stack usage is (partly) dynamic and not bounded, it's:
7980 @smallexample
7981   warning: stack usage might be unbounded
7982 @end smallexample
7983 @end itemize
7985 @option{-Wstack-usage=}@samp{PTRDIFF_MAX} is enabled by default.
7986 Warnings controlled by the option can be disabled either by specifying
7987 @var{byte-size} of @samp{SIZE_MAX} or more or by
7988 @option{-Wno-stack-usage}.
7990 @item -Wno-stack-usage
7991 @opindex Wno-stack-usage
7992 Disable @option{-Wstack-usage=} warnings.  The option is equivalent
7993 to @option{-Wstack-usage=}@samp{SIZE_MAX} or larger.
7995 @item -Wunsafe-loop-optimizations
7996 @opindex Wunsafe-loop-optimizations
7997 @opindex Wno-unsafe-loop-optimizations
7998 Warn if the loop cannot be optimized because the compiler cannot
7999 assume anything on the bounds of the loop indices.  With
8000 @option{-funsafe-loop-optimizations} warn if the compiler makes
8001 such assumptions.
8003 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
8004 @opindex Wno-pedantic-ms-format
8005 @opindex Wpedantic-ms-format
8006 When used in combination with @option{-Wformat}
8007 and @option{-pedantic} without GNU extensions, this option
8008 disables the warnings about non-ISO @code{printf} / @code{scanf} format
8009 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
8010 which depend on the MS runtime.
8012 @item -Wpointer-arith
8013 @opindex Wpointer-arith
8014 @opindex Wno-pointer-arith
8015 Warn about anything that depends on the ``size of'' a function type or
8016 of @code{void}.  GNU C assigns these types a size of 1, for
8017 convenience in calculations with @code{void *} pointers and pointers
8018 to functions.  In C++, warn also when an arithmetic operation involves
8019 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
8021 @item -Wno-pointer-compare
8022 @opindex Wpointer-compare
8023 @opindex Wno-pointer-compare
8024 Do not warn if a pointer is compared with a zero character constant.
8025 This usually
8026 means that the pointer was meant to be dereferenced.  For example:
8028 @smallexample
8029 const char *p = foo ();
8030 if (p == '\0')
8031   return 42;
8032 @end smallexample
8034 Note that the code above is invalid in C++11.
8036 This warning is enabled by default.
8038 @item -Wtsan
8039 @opindex Wtsan
8040 @opindex Wno-tsan
8041 Warn about unsupported features in ThreadSanitizer.
8043 ThreadSanitizer does not support @code{std::atomic_thread_fence} and
8044 can report false positives.
8046 This warning is enabled by default.
8048 @item -Wtype-limits
8049 @opindex Wtype-limits
8050 @opindex Wno-type-limits
8051 Warn if a comparison is always true or always false due to the limited
8052 range of the data type, but do not warn for constant expressions.  For
8053 example, warn if an unsigned variable is compared against zero with
8054 @code{<} or @code{>=}.  This warning is also enabled by
8055 @option{-Wextra}.
8057 @item -Wabsolute-value @r{(C and Objective-C only)}
8058 @opindex Wabsolute-value
8059 @opindex Wno-absolute-value
8060 Warn for calls to standard functions that compute the absolute value
8061 of an argument when a more appropriate standard function is available.
8062 For example, calling @code{abs(3.14)} triggers the warning because the
8063 appropriate function to call to compute the absolute value of a double
8064 argument is @code{fabs}.  The option also triggers warnings when the
8065 argument in a call to such a function has an unsigned type.  This
8066 warning can be suppressed with an explicit type cast and it is also
8067 enabled by @option{-Wextra}.
8069 @include cppwarnopts.texi
8071 @item -Wbad-function-cast @r{(C and Objective-C only)}
8072 @opindex Wbad-function-cast
8073 @opindex Wno-bad-function-cast
8074 Warn when a function call is cast to a non-matching type.
8075 For example, warn if a call to a function returning an integer type 
8076 is cast to a pointer type.
8078 @item -Wc90-c99-compat @r{(C and Objective-C only)}
8079 @opindex Wc90-c99-compat
8080 @opindex Wno-c90-c99-compat
8081 Warn about features not present in ISO C90, but present in ISO C99.
8082 For instance, warn about use of variable length arrays, @code{long long}
8083 type, @code{bool} type, compound literals, designated initializers, and so
8084 on.  This option is independent of the standards mode.  Warnings are disabled
8085 in the expression that follows @code{__extension__}.
8087 @item -Wc99-c11-compat @r{(C and Objective-C only)}
8088 @opindex Wc99-c11-compat
8089 @opindex Wno-c99-c11-compat
8090 Warn about features not present in ISO C99, but present in ISO C11.
8091 For instance, warn about use of anonymous structures and unions,
8092 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
8093 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
8094 and so on.  This option is independent of the standards mode.  Warnings are
8095 disabled in the expression that follows @code{__extension__}.
8097 @item -Wc11-c2x-compat @r{(C and Objective-C only)}
8098 @opindex Wc11-c2x-compat
8099 @opindex Wno-c11-c2x-compat
8100 Warn about features not present in ISO C11, but present in ISO C2X.
8101 For instance, warn about omitting the string in @code{_Static_assert},
8102 use of @samp{[[]]} syntax for attributes, use of decimal
8103 floating-point types, and so on.  This option is independent of the
8104 standards mode.  Warnings are disabled in the expression that follows
8105 @code{__extension__}.
8107 @item -Wc++-compat @r{(C and Objective-C only)}
8108 @opindex Wc++-compat
8109 @opindex Wno-c++-compat
8110 Warn about ISO C constructs that are outside of the common subset of
8111 ISO C and ISO C++, e.g.@: request for implicit conversion from
8112 @code{void *} to a pointer to non-@code{void} type.
8114 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
8115 @opindex Wc++11-compat
8116 @opindex Wno-c++11-compat
8117 Warn about C++ constructs whose meaning differs between ISO C++ 1998
8118 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
8119 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
8120 enabled by @option{-Wall}.
8122 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
8123 @opindex Wc++14-compat
8124 @opindex Wno-c++14-compat
8125 Warn about C++ constructs whose meaning differs between ISO C++ 2011
8126 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
8128 @item -Wc++17-compat @r{(C++ and Objective-C++ only)}
8129 @opindex Wc++17-compat
8130 @opindex Wno-c++17-compat
8131 Warn about C++ constructs whose meaning differs between ISO C++ 2014
8132 and ISO C++ 2017.  This warning is enabled by @option{-Wall}.
8134 @item -Wc++20-compat @r{(C++ and Objective-C++ only)}
8135 @opindex Wc++20-compat
8136 @opindex Wno-c++20-compat
8137 Warn about C++ constructs whose meaning differs between ISO C++ 2017
8138 and ISO C++ 2020.  This warning is enabled by @option{-Wall}.
8140 @item -Wcast-qual
8141 @opindex Wcast-qual
8142 @opindex Wno-cast-qual
8143 Warn whenever a pointer is cast so as to remove a type qualifier from
8144 the target type.  For example, warn if a @code{const char *} is cast
8145 to an ordinary @code{char *}.
8147 Also warn when making a cast that introduces a type qualifier in an
8148 unsafe way.  For example, casting @code{char **} to @code{const char **}
8149 is unsafe, as in this example:
8151 @smallexample
8152   /* p is char ** value.  */
8153   const char **q = (const char **) p;
8154   /* Assignment of readonly string to const char * is OK.  */
8155   *q = "string";
8156   /* Now char** pointer points to read-only memory.  */
8157   **p = 'b';
8158 @end smallexample
8160 @item -Wcast-align
8161 @opindex Wcast-align
8162 @opindex Wno-cast-align
8163 Warn whenever a pointer is cast such that the required alignment of the
8164 target is increased.  For example, warn if a @code{char *} is cast to
8165 an @code{int *} on machines where integers can only be accessed at
8166 two- or four-byte boundaries.
8168 @item -Wcast-align=strict
8169 @opindex Wcast-align=strict
8170 Warn whenever a pointer is cast such that the required alignment of the
8171 target is increased.  For example, warn if a @code{char *} is cast to
8172 an @code{int *} regardless of the target machine.
8174 @item -Wcast-function-type
8175 @opindex Wcast-function-type
8176 @opindex Wno-cast-function-type
8177 Warn when a function pointer is cast to an incompatible function pointer.
8178 In a cast involving function types with a variable argument list only
8179 the types of initial arguments that are provided are considered.
8180 Any parameter of pointer-type matches any other pointer-type.  Any benign
8181 differences in integral types are ignored, like @code{int} vs.@: @code{long}
8182 on ILP32 targets.  Likewise type qualifiers are ignored.  The function
8183 type @code{void (*) (void)} is special and matches everything, which can
8184 be used to suppress this warning.
8185 In a cast involving pointer to member types this warning warns whenever
8186 the type cast is changing the pointer to member type.
8187 This warning is enabled by @option{-Wextra}.
8189 @item -Wwrite-strings
8190 @opindex Wwrite-strings
8191 @opindex Wno-write-strings
8192 When compiling C, give string constants the type @code{const
8193 char[@var{length}]} so that copying the address of one into a
8194 non-@code{const} @code{char *} pointer produces a warning.  These
8195 warnings help you find at compile time code that can try to write
8196 into a string constant, but only if you have been very careful about
8197 using @code{const} in declarations and prototypes.  Otherwise, it is
8198 just a nuisance. This is why we did not make @option{-Wall} request
8199 these warnings.
8201 When compiling C++, warn about the deprecated conversion from string
8202 literals to @code{char *}.  This warning is enabled by default for C++
8203 programs.
8205 @item -Wclobbered
8206 @opindex Wclobbered
8207 @opindex Wno-clobbered
8208 Warn for variables that might be changed by @code{longjmp} or
8209 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
8211 @item -Wconversion
8212 @opindex Wconversion
8213 @opindex Wno-conversion
8214 Warn for implicit conversions that may alter a value. This includes
8215 conversions between real and integer, like @code{abs (x)} when
8216 @code{x} is @code{double}; conversions between signed and unsigned,
8217 like @code{unsigned ui = -1}; and conversions to smaller types, like
8218 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
8219 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
8220 changed by the conversion like in @code{abs (2.0)}.  Warnings about
8221 conversions between signed and unsigned integers can be disabled by
8222 using @option{-Wno-sign-conversion}.
8224 For C++, also warn for confusing overload resolution for user-defined
8225 conversions; and conversions that never use a type conversion
8226 operator: conversions to @code{void}, the same type, a base class or a
8227 reference to them. Warnings about conversions between signed and
8228 unsigned integers are disabled by default in C++ unless
8229 @option{-Wsign-conversion} is explicitly enabled.
8231 Warnings about conversion from arithmetic on a small type back to that
8232 type are only given with @option{-Warith-conversion}.
8234 @item -Wdangling-else
8235 @opindex Wdangling-else
8236 @opindex Wno-dangling-else
8237 Warn about constructions where there may be confusion to which
8238 @code{if} statement an @code{else} branch belongs.  Here is an example of
8239 such a case:
8241 @smallexample
8242 @group
8244   if (a)
8245     if (b)
8246       foo ();
8247   else
8248     bar ();
8250 @end group
8251 @end smallexample
8253 In C/C++, every @code{else} branch belongs to the innermost possible
8254 @code{if} statement, which in this example is @code{if (b)}.  This is
8255 often not what the programmer expected, as illustrated in the above
8256 example by indentation the programmer chose.  When there is the
8257 potential for this confusion, GCC issues a warning when this flag
8258 is specified.  To eliminate the warning, add explicit braces around
8259 the innermost @code{if} statement so there is no way the @code{else}
8260 can belong to the enclosing @code{if}.  The resulting code
8261 looks like this:
8263 @smallexample
8264 @group
8266   if (a)
8267     @{
8268       if (b)
8269         foo ();
8270       else
8271         bar ();
8272     @}
8274 @end group
8275 @end smallexample
8277 This warning is enabled by @option{-Wparentheses}.
8279 @item -Wdate-time
8280 @opindex Wdate-time
8281 @opindex Wno-date-time
8282 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
8283 are encountered as they might prevent bit-wise-identical reproducible
8284 compilations.
8286 @item -Wempty-body
8287 @opindex Wempty-body
8288 @opindex Wno-empty-body
8289 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
8290 while} statement.  This warning is also enabled by @option{-Wextra}.
8292 @item -Wno-endif-labels
8293 @opindex Wendif-labels
8294 @opindex Wno-endif-labels
8295 Do not warn about stray tokens after @code{#else} and @code{#endif}.
8297 @item -Wenum-compare
8298 @opindex Wenum-compare
8299 @opindex Wno-enum-compare
8300 Warn about a comparison between values of different enumerated types.
8301 In C++ enumerated type mismatches in conditional expressions are also
8302 diagnosed and the warning is enabled by default.  In C this warning is 
8303 enabled by @option{-Wall}.
8305 @item -Wenum-conversion
8306 @opindex Wenum-conversion
8307 @opindex Wno-enum-conversion
8308 Warn when a value of enumerated type is implicitly converted to a 
8309 different enumerated type.  This warning is enabled by @option{-Wextra}
8310 in C@.
8312 @item -Wjump-misses-init @r{(C, Objective-C only)}
8313 @opindex Wjump-misses-init
8314 @opindex Wno-jump-misses-init
8315 Warn if a @code{goto} statement or a @code{switch} statement jumps
8316 forward across the initialization of a variable, or jumps backward to a
8317 label after the variable has been initialized.  This only warns about
8318 variables that are initialized when they are declared.  This warning is
8319 only supported for C and Objective-C; in C++ this sort of branch is an
8320 error in any case.
8322 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
8323 can be disabled with the @option{-Wno-jump-misses-init} option.
8325 @item -Wsign-compare
8326 @opindex Wsign-compare
8327 @opindex Wno-sign-compare
8328 @cindex warning for comparison of signed and unsigned values
8329 @cindex comparison of signed and unsigned values, warning
8330 @cindex signed and unsigned values, comparison warning
8331 Warn when a comparison between signed and unsigned values could produce
8332 an incorrect result when the signed value is converted to unsigned.
8333 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
8334 also enabled by @option{-Wextra}.
8336 @item -Wsign-conversion
8337 @opindex Wsign-conversion
8338 @opindex Wno-sign-conversion
8339 Warn for implicit conversions that may change the sign of an integer
8340 value, like assigning a signed integer expression to an unsigned
8341 integer variable. An explicit cast silences the warning. In C, this
8342 option is enabled also by @option{-Wconversion}.
8344 @item -Wfloat-conversion
8345 @opindex Wfloat-conversion
8346 @opindex Wno-float-conversion
8347 Warn for implicit conversions that reduce the precision of a real value.
8348 This includes conversions from real to integer, and from higher precision
8349 real to lower precision real values.  This option is also enabled by
8350 @option{-Wconversion}.
8352 @item -Wno-scalar-storage-order
8353 @opindex Wno-scalar-storage-order
8354 @opindex Wscalar-storage-order
8355 Do not warn on suspicious constructs involving reverse scalar storage order.
8357 @item -Wsizeof-array-div
8358 @opindex Wsizeof-array-div
8359 @opindex Wno-sizeof-array-div
8360 Warn about divisions of two sizeof operators when the first one is applied
8361 to an array and the divisor does not equal the size of the array element.
8362 In such a case, the computation will not yield the number of elements in the
8363 array, which is likely what the user intended.  This warning warns e.g. about
8364 @smallexample
8365 int fn ()
8367   int arr[10];
8368   return sizeof (arr) / sizeof (short);
8370 @end smallexample
8372 This warning is enabled by @option{-Wall}.
8374 @item -Wsizeof-pointer-div
8375 @opindex Wsizeof-pointer-div
8376 @opindex Wno-sizeof-pointer-div
8377 Warn for suspicious divisions of two sizeof expressions that divide
8378 the pointer size by the element size, which is the usual way to compute
8379 the array size but won't work out correctly with pointers.  This warning
8380 warns e.g.@: about @code{sizeof (ptr) / sizeof (ptr[0])} if @code{ptr} is
8381 not an array, but a pointer.  This warning is enabled by @option{-Wall}.
8383 @item -Wsizeof-pointer-memaccess
8384 @opindex Wsizeof-pointer-memaccess
8385 @opindex Wno-sizeof-pointer-memaccess
8386 Warn for suspicious length parameters to certain string and memory built-in
8387 functions if the argument uses @code{sizeof}.  This warning triggers for
8388 example for @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not
8389 an array, but a pointer, and suggests a possible fix, or about
8390 @code{memcpy (&foo, ptr, sizeof (&foo));}.  @option{-Wsizeof-pointer-memaccess}
8391 also warns about calls to bounded string copy functions like @code{strncat}
8392 or @code{strncpy} that specify as the bound a @code{sizeof} expression of
8393 the source array.  For example, in the following function the call to
8394 @code{strncat} specifies the size of the source string as the bound.  That
8395 is almost certainly a mistake and so the call is diagnosed.
8396 @smallexample
8397 void make_file (const char *name)
8399   char path[PATH_MAX];
8400   strncpy (path, name, sizeof path - 1);
8401   strncat (path, ".text", sizeof ".text");
8402   @dots{}
8404 @end smallexample
8406 The @option{-Wsizeof-pointer-memaccess} option is enabled by @option{-Wall}.
8408 @item -Wno-sizeof-array-argument
8409 @opindex Wsizeof-array-argument
8410 @opindex Wno-sizeof-array-argument
8411 Do not warn when the @code{sizeof} operator is applied to a parameter that is
8412 declared as an array in a function definition.  This warning is enabled by
8413 default for C and C++ programs.
8415 @item -Wmemset-elt-size
8416 @opindex Wmemset-elt-size
8417 @opindex Wno-memset-elt-size
8418 Warn for suspicious calls to the @code{memset} built-in function, if the
8419 first argument references an array, and the third argument is a number
8420 equal to the number of elements, but not equal to the size of the array
8421 in memory.  This indicates that the user has omitted a multiplication by
8422 the element size.  This warning is enabled by @option{-Wall}.
8424 @item -Wmemset-transposed-args
8425 @opindex Wmemset-transposed-args
8426 @opindex Wno-memset-transposed-args
8427 Warn for suspicious calls to the @code{memset} built-in function where
8428 the second argument is not zero and the third argument is zero.  For
8429 example, the call @code{memset (buf, sizeof buf, 0)} is diagnosed because
8430 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostic
8431 is only emitted if the third argument is a literal zero.  Otherwise, if
8432 it is an expression that is folded to zero, or a cast of zero to some
8433 type, it is far less likely that the arguments have been mistakenly
8434 transposed and no warning is emitted.  This warning is enabled
8435 by @option{-Wall}.
8437 @item -Waddress
8438 @opindex Waddress
8439 @opindex Wno-address
8440 Warn about suspicious uses of memory addresses. These include using
8441 the address of a function in a conditional expression, such as
8442 @code{void func(void); if (func)}, and comparisons against the memory
8443 address of a string literal, such as @code{if (x == "abc")}.  Such
8444 uses typically indicate a programmer error: the address of a function
8445 always evaluates to true, so their use in a conditional usually
8446 indicate that the programmer forgot the parentheses in a function
8447 call; and comparisons against string literals result in unspecified
8448 behavior and are not portable in C, so they usually indicate that the
8449 programmer intended to use @code{strcmp}.  This warning is enabled by
8450 @option{-Wall}.
8452 @item -Wno-address-of-packed-member
8453 @opindex Waddress-of-packed-member
8454 @opindex Wno-address-of-packed-member
8455 Do not warn when the address of packed member of struct or union is taken,
8456 which usually results in an unaligned pointer value.  This is
8457 enabled by default.
8459 @item -Wlogical-op
8460 @opindex Wlogical-op
8461 @opindex Wno-logical-op
8462 Warn about suspicious uses of logical operators in expressions.
8463 This includes using logical operators in contexts where a
8464 bit-wise operator is likely to be expected.  Also warns when
8465 the operands of a logical operator are the same:
8466 @smallexample
8467 extern int a;
8468 if (a < 0 && a < 0) @{ @dots{} @}
8469 @end smallexample
8471 @item -Wlogical-not-parentheses
8472 @opindex Wlogical-not-parentheses
8473 @opindex Wno-logical-not-parentheses
8474 Warn about logical not used on the left hand side operand of a comparison.
8475 This option does not warn if the right operand is considered to be a boolean
8476 expression.  Its purpose is to detect suspicious code like the following:
8477 @smallexample
8478 int a;
8479 @dots{}
8480 if (!a > 1) @{ @dots{} @}
8481 @end smallexample
8483 It is possible to suppress the warning by wrapping the LHS into
8484 parentheses:
8485 @smallexample
8486 if ((!a) > 1) @{ @dots{} @}
8487 @end smallexample
8489 This warning is enabled by @option{-Wall}.
8491 @item -Waggregate-return
8492 @opindex Waggregate-return
8493 @opindex Wno-aggregate-return
8494 Warn if any functions that return structures or unions are defined or
8495 called.  (In languages where you can return an array, this also elicits
8496 a warning.)
8498 @item -Wno-aggressive-loop-optimizations
8499 @opindex Wno-aggressive-loop-optimizations
8500 @opindex Waggressive-loop-optimizations
8501 Warn if in a loop with constant number of iterations the compiler detects
8502 undefined behavior in some statement during one or more of the iterations.
8504 @item -Wno-attributes
8505 @opindex Wno-attributes
8506 @opindex Wattributes
8507 Do not warn if an unexpected @code{__attribute__} is used, such as
8508 unrecognized attributes, function attributes applied to variables,
8509 etc.  This does not stop errors for incorrect use of supported
8510 attributes.
8512 @item -Wno-builtin-declaration-mismatch
8513 @opindex Wno-builtin-declaration-mismatch
8514 @opindex Wbuiltin-declaration-mismatch
8515 Warn if a built-in function is declared with an incompatible signature
8516 or as a non-function, or when a built-in function declared with a type
8517 that does not include a prototype is called with arguments whose promoted
8518 types do not match those expected by the function.  When @option{-Wextra}
8519 is specified, also warn when a built-in function that takes arguments is
8520 declared without a prototype.  The @option{-Wbuiltin-declaration-mismatch}
8521 warning is enabled by default.  To avoid the warning include the appropriate
8522 header to bring the prototypes of built-in functions into scope.
8524 For example, the call to @code{memset} below is diagnosed by the warning
8525 because the function expects a value of type @code{size_t} as its argument
8526 but the type of @code{32} is @code{int}.  With @option{-Wextra},
8527 the declaration of the function is diagnosed as well.
8528 @smallexample
8529 extern void* memset ();
8530 void f (void *d)
8532   memset (d, '\0', 32);
8534 @end smallexample
8536 @item -Wno-builtin-macro-redefined
8537 @opindex Wno-builtin-macro-redefined
8538 @opindex Wbuiltin-macro-redefined
8539 Do not warn if certain built-in macros are redefined.  This suppresses
8540 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
8541 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
8543 @item -Wstrict-prototypes @r{(C and Objective-C only)}
8544 @opindex Wstrict-prototypes
8545 @opindex Wno-strict-prototypes
8546 Warn if a function is declared or defined without specifying the
8547 argument types.  (An old-style function definition is permitted without
8548 a warning if preceded by a declaration that specifies the argument
8549 types.)
8551 @item -Wold-style-declaration @r{(C and Objective-C only)}
8552 @opindex Wold-style-declaration
8553 @opindex Wno-old-style-declaration
8554 Warn for obsolescent usages, according to the C Standard, in a
8555 declaration. For example, warn if storage-class specifiers like
8556 @code{static} are not the first things in a declaration.  This warning
8557 is also enabled by @option{-Wextra}.
8559 @item -Wold-style-definition @r{(C and Objective-C only)}
8560 @opindex Wold-style-definition
8561 @opindex Wno-old-style-definition
8562 Warn if an old-style function definition is used.  A warning is given
8563 even if there is a previous prototype.  A definition using @samp{()}
8564 is not considered an old-style definition in C2X mode, because it is
8565 equivalent to @samp{(void)} in that case, but is considered an
8566 old-style definition for older standards.
8568 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
8569 @opindex Wmissing-parameter-type
8570 @opindex Wno-missing-parameter-type
8571 A function parameter is declared without a type specifier in K&R-style
8572 functions:
8574 @smallexample
8575 void foo(bar) @{ @}
8576 @end smallexample
8578 This warning is also enabled by @option{-Wextra}.
8580 @item -Wmissing-prototypes @r{(C and Objective-C only)}
8581 @opindex Wmissing-prototypes
8582 @opindex Wno-missing-prototypes
8583 Warn if a global function is defined without a previous prototype
8584 declaration.  This warning is issued even if the definition itself
8585 provides a prototype.  Use this option to detect global functions
8586 that do not have a matching prototype declaration in a header file.
8587 This option is not valid for C++ because all function declarations
8588 provide prototypes and a non-matching declaration declares an
8589 overload rather than conflict with an earlier declaration.
8590 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
8592 @item -Wmissing-declarations
8593 @opindex Wmissing-declarations
8594 @opindex Wno-missing-declarations
8595 Warn if a global function is defined without a previous declaration.
8596 Do so even if the definition itself provides a prototype.
8597 Use this option to detect global functions that are not declared in
8598 header files.  In C, no warnings are issued for functions with previous
8599 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
8600 missing prototypes.  In C++, no warnings are issued for function templates,
8601 or for inline functions, or for functions in anonymous namespaces.
8603 @item -Wmissing-field-initializers
8604 @opindex Wmissing-field-initializers
8605 @opindex Wno-missing-field-initializers
8606 @opindex W
8607 @opindex Wextra
8608 @opindex Wno-extra
8609 Warn if a structure's initializer has some fields missing.  For
8610 example, the following code causes such a warning, because
8611 @code{x.h} is implicitly zero:
8613 @smallexample
8614 struct s @{ int f, g, h; @};
8615 struct s x = @{ 3, 4 @};
8616 @end smallexample
8618 This option does not warn about designated initializers, so the following
8619 modification does not trigger a warning:
8621 @smallexample
8622 struct s @{ int f, g, h; @};
8623 struct s x = @{ .f = 3, .g = 4 @};
8624 @end smallexample
8626 In C this option does not warn about the universal zero initializer
8627 @samp{@{ 0 @}}:
8629 @smallexample
8630 struct s @{ int f, g, h; @};
8631 struct s x = @{ 0 @};
8632 @end smallexample
8634 Likewise, in C++ this option does not warn about the empty @{ @}
8635 initializer, for example:
8637 @smallexample
8638 struct s @{ int f, g, h; @};
8639 s x = @{ @};
8640 @end smallexample
8642 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
8643 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
8645 @item -Wno-multichar
8646 @opindex Wno-multichar
8647 @opindex Wmultichar
8648 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
8649 Usually they indicate a typo in the user's code, as they have
8650 implementation-defined values, and should not be used in portable code.
8652 @item -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]}
8653 @opindex Wnormalized=
8654 @opindex Wnormalized
8655 @opindex Wno-normalized
8656 @cindex NFC
8657 @cindex NFKC
8658 @cindex character set, input normalization
8659 In ISO C and ISO C++, two identifiers are different if they are
8660 different sequences of characters.  However, sometimes when characters
8661 outside the basic ASCII character set are used, you can have two
8662 different character sequences that look the same.  To avoid confusion,
8663 the ISO 10646 standard sets out some @dfn{normalization rules} which
8664 when applied ensure that two sequences that look the same are turned into
8665 the same sequence.  GCC can warn you if you are using identifiers that
8666 have not been normalized; this option controls that warning.
8668 There are four levels of warning supported by GCC@.  The default is
8669 @option{-Wnormalized=nfc}, which warns about any identifier that is
8670 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
8671 recommended form for most uses.  It is equivalent to
8672 @option{-Wnormalized}.
8674 Unfortunately, there are some characters allowed in identifiers by
8675 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
8676 identifiers.  That is, there's no way to use these symbols in portable
8677 ISO C or C++ and have all your identifiers in NFC@.
8678 @option{-Wnormalized=id} suppresses the warning for these characters.
8679 It is hoped that future versions of the standards involved will correct
8680 this, which is why this option is not the default.
8682 You can switch the warning off for all characters by writing
8683 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
8684 only do this if you are using some other normalization scheme (like
8685 ``D''), because otherwise you can easily create bugs that are
8686 literally impossible to see.
8688 Some characters in ISO 10646 have distinct meanings but look identical
8689 in some fonts or display methodologies, especially once formatting has
8690 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
8691 LETTER N'', displays just like a regular @code{n} that has been
8692 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
8693 normalization scheme to convert all these into a standard form as
8694 well, and GCC warns if your code is not in NFKC if you use
8695 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
8696 about every identifier that contains the letter O because it might be
8697 confused with the digit 0, and so is not the default, but may be
8698 useful as a local coding convention if the programming environment 
8699 cannot be fixed to display these characters distinctly.
8701 @item -Wno-attribute-warning
8702 @opindex Wno-attribute-warning
8703 @opindex Wattribute-warning
8704 Do not warn about usage of functions (@pxref{Function Attributes})
8705 declared with @code{warning} attribute.  By default, this warning is
8706 enabled.  @option{-Wno-attribute-warning} can be used to disable the
8707 warning or @option{-Wno-error=attribute-warning} can be used to
8708 disable the error when compiled with @option{-Werror} flag.
8710 @item -Wno-deprecated
8711 @opindex Wno-deprecated
8712 @opindex Wdeprecated
8713 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
8715 @item -Wno-deprecated-declarations
8716 @opindex Wno-deprecated-declarations
8717 @opindex Wdeprecated-declarations
8718 Do not warn about uses of functions (@pxref{Function Attributes}),
8719 variables (@pxref{Variable Attributes}), and types (@pxref{Type
8720 Attributes}) marked as deprecated by using the @code{deprecated}
8721 attribute.
8723 @item -Wno-overflow
8724 @opindex Wno-overflow
8725 @opindex Woverflow
8726 Do not warn about compile-time overflow in constant expressions.
8728 @item -Wno-odr
8729 @opindex Wno-odr
8730 @opindex Wodr
8731 Warn about One Definition Rule violations during link-time optimization.
8732 Enabled by default.
8734 @item -Wopenmp-simd
8735 @opindex Wopenmp-simd
8736 @opindex Wno-openmp-simd
8737 Warn if the vectorizer cost model overrides the OpenMP
8738 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
8739 option can be used to relax the cost model.
8741 @item -Woverride-init @r{(C and Objective-C only)}
8742 @opindex Woverride-init
8743 @opindex Wno-override-init
8744 @opindex W
8745 @opindex Wextra
8746 @opindex Wno-extra
8747 Warn if an initialized field without side effects is overridden when
8748 using designated initializers (@pxref{Designated Inits, , Designated
8749 Initializers}).
8751 This warning is included in @option{-Wextra}.  To get other
8752 @option{-Wextra} warnings without this one, use @option{-Wextra
8753 -Wno-override-init}.
8755 @item -Wno-override-init-side-effects @r{(C and Objective-C only)}
8756 @opindex Woverride-init-side-effects
8757 @opindex Wno-override-init-side-effects
8758 Do not warn if an initialized field with side effects is overridden when
8759 using designated initializers (@pxref{Designated Inits, , Designated
8760 Initializers}).  This warning is enabled by default.
8762 @item -Wpacked
8763 @opindex Wpacked
8764 @opindex Wno-packed
8765 Warn if a structure is given the packed attribute, but the packed
8766 attribute has no effect on the layout or size of the structure.
8767 Such structures may be mis-aligned for little benefit.  For
8768 instance, in this code, the variable @code{f.x} in @code{struct bar}
8769 is misaligned even though @code{struct bar} does not itself
8770 have the packed attribute:
8772 @smallexample
8773 @group
8774 struct foo @{
8775   int x;
8776   char a, b, c, d;
8777 @} __attribute__((packed));
8778 struct bar @{
8779   char z;
8780   struct foo f;
8782 @end group
8783 @end smallexample
8785 @item -Wnopacked-bitfield-compat
8786 @opindex Wpacked-bitfield-compat
8787 @opindex Wno-packed-bitfield-compat
8788 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
8789 on bit-fields of type @code{char}.  This was fixed in GCC 4.4 but
8790 the change can lead to differences in the structure layout.  GCC
8791 informs you when the offset of such a field has changed in GCC 4.4.
8792 For example there is no longer a 4-bit padding between field @code{a}
8793 and @code{b} in this structure:
8795 @smallexample
8796 struct foo
8798   char a:4;
8799   char b:8;
8800 @} __attribute__ ((packed));
8801 @end smallexample
8803 This warning is enabled by default.  Use
8804 @option{-Wno-packed-bitfield-compat} to disable this warning.
8806 @item -Wpacked-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
8807 @opindex Wpacked-not-aligned
8808 @opindex Wno-packed-not-aligned
8809 Warn if a structure field with explicitly specified alignment in a
8810 packed struct or union is misaligned.  For example, a warning will
8811 be issued on @code{struct S}, like, @code{warning: alignment 1 of
8812 'struct S' is less than 8}, in this code:
8814 @smallexample
8815 @group
8816 struct __attribute__ ((aligned (8))) S8 @{ char a[8]; @};
8817 struct __attribute__ ((packed)) S @{
8818   struct S8 s8;
8820 @end group
8821 @end smallexample
8823 This warning is enabled by @option{-Wall}.
8825 @item -Wpadded
8826 @opindex Wpadded
8827 @opindex Wno-padded
8828 Warn if padding is included in a structure, either to align an element
8829 of the structure or to align the whole structure.  Sometimes when this
8830 happens it is possible to rearrange the fields of the structure to
8831 reduce the padding and so make the structure smaller.
8833 @item -Wredundant-decls
8834 @opindex Wredundant-decls
8835 @opindex Wno-redundant-decls
8836 Warn if anything is declared more than once in the same scope, even in
8837 cases where multiple declaration is valid and changes nothing.
8839 @item -Wrestrict
8840 @opindex Wrestrict
8841 @opindex Wno-restrict
8842 Warn when an object referenced by a @code{restrict}-qualified parameter
8843 (or, in C++, a @code{__restrict}-qualified parameter) is aliased by another
8844 argument, or when copies between such objects overlap.  For example,
8845 the call to the @code{strcpy} function below attempts to truncate the string
8846 by replacing its initial characters with the last four.  However, because
8847 the call writes the terminating NUL into @code{a[4]}, the copies overlap and
8848 the call is diagnosed.
8850 @smallexample
8851 void foo (void)
8853   char a[] = "abcd1234";
8854   strcpy (a, a + 4);
8855   @dots{}
8857 @end smallexample
8858 The @option{-Wrestrict} option detects some instances of simple overlap
8859 even without optimization but works best at @option{-O2} and above.  It
8860 is included in @option{-Wall}.
8862 @item -Wnested-externs @r{(C and Objective-C only)}
8863 @opindex Wnested-externs
8864 @opindex Wno-nested-externs
8865 Warn if an @code{extern} declaration is encountered within a function.
8867 @item -Winline
8868 @opindex Winline
8869 @opindex Wno-inline
8870 Warn if a function that is declared as inline cannot be inlined.
8871 Even with this option, the compiler does not warn about failures to
8872 inline functions declared in system headers.
8874 The compiler uses a variety of heuristics to determine whether or not
8875 to inline a function.  For example, the compiler takes into account
8876 the size of the function being inlined and the amount of inlining
8877 that has already been done in the current function.  Therefore,
8878 seemingly insignificant changes in the source program can cause the
8879 warnings produced by @option{-Winline} to appear or disappear.
8881 @item -Wint-in-bool-context
8882 @opindex Wint-in-bool-context
8883 @opindex Wno-int-in-bool-context
8884 Warn for suspicious use of integer values where boolean values are expected,
8885 such as conditional expressions (?:) using non-boolean integer constants in
8886 boolean context, like @code{if (a <= b ? 2 : 3)}.  Or left shifting of signed
8887 integers in boolean context, like @code{for (a = 0; 1 << a; a++);}.  Likewise
8888 for all kinds of multiplications regardless of the data type.
8889 This warning is enabled by @option{-Wall}.
8891 @item -Wno-int-to-pointer-cast
8892 @opindex Wno-int-to-pointer-cast
8893 @opindex Wint-to-pointer-cast
8894 Suppress warnings from casts to pointer type of an integer of a
8895 different size. In C++, casting to a pointer type of smaller size is
8896 an error. @option{Wint-to-pointer-cast} is enabled by default.
8899 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
8900 @opindex Wno-pointer-to-int-cast
8901 @opindex Wpointer-to-int-cast
8902 Suppress warnings from casts from a pointer to an integer type of a
8903 different size.
8905 @item -Winvalid-pch
8906 @opindex Winvalid-pch
8907 @opindex Wno-invalid-pch
8908 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
8909 the search path but cannot be used.
8911 @item -Wlong-long
8912 @opindex Wlong-long
8913 @opindex Wno-long-long
8914 Warn if @code{long long} type is used.  This is enabled by either
8915 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
8916 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
8918 @item -Wvariadic-macros
8919 @opindex Wvariadic-macros
8920 @opindex Wno-variadic-macros
8921 Warn if variadic macros are used in ISO C90 mode, or if the GNU
8922 alternate syntax is used in ISO C99 mode.  This is enabled by either
8923 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
8924 messages, use @option{-Wno-variadic-macros}.
8926 @item -Wno-varargs
8927 @opindex Wvarargs
8928 @opindex Wno-varargs
8929 Do not warn upon questionable usage of the macros used to handle variable
8930 arguments like @code{va_start}.  These warnings are enabled by default.
8932 @item -Wvector-operation-performance
8933 @opindex Wvector-operation-performance
8934 @opindex Wno-vector-operation-performance
8935 Warn if vector operation is not implemented via SIMD capabilities of the
8936 architecture.  Mainly useful for the performance tuning.
8937 Vector operation can be implemented @code{piecewise}, which means that the
8938 scalar operation is performed on every vector element; 
8939 @code{in parallel}, which means that the vector operation is implemented
8940 using scalars of wider type, which normally is more performance efficient;
8941 and @code{as a single scalar}, which means that vector fits into a
8942 scalar type.
8944 @item -Wvla
8945 @opindex Wvla
8946 @opindex Wno-vla
8947 Warn if a variable-length array is used in the code.
8948 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
8949 the variable-length array.
8951 @item -Wvla-larger-than=@var{byte-size}
8952 @opindex Wvla-larger-than=
8953 @opindex Wno-vla-larger-than
8954 If this option is used, the compiler warns for declarations of
8955 variable-length arrays whose size is either unbounded, or bounded
8956 by an argument that allows the array size to exceed @var{byte-size}
8957 bytes.  This is similar to how @option{-Walloca-larger-than=}@var{byte-size}
8958 works, but with variable-length arrays.
8960 Note that GCC may optimize small variable-length arrays of a known
8961 value into plain arrays, so this warning may not get triggered for
8962 such arrays.
8964 @option{-Wvla-larger-than=}@samp{PTRDIFF_MAX} is enabled by default but
8965 is typically only effective when @option{-ftree-vrp} is active (default
8966 for @option{-O2} and above).
8968 See also @option{-Walloca-larger-than=@var{byte-size}}.
8970 @item -Wno-vla-larger-than
8971 @opindex Wno-vla-larger-than
8972 Disable @option{-Wvla-larger-than=} warnings.  The option is equivalent
8973 to @option{-Wvla-larger-than=}@samp{SIZE_MAX} or larger.
8975 @item -Wvla-parameter
8976 @opindex Wno-vla-parameter
8977 Warn about redeclarations of functions involving arguments of Variable
8978 Length Array types of inconsistent kinds or forms, and enable the detection
8979 of out-of-bounds accesses to such parameters by warnings such as
8980 @option{-Warray-bounds}.
8982 If the first function declaration uses the VLA form the bound specified
8983 in the array is assumed to be the minimum number of elements expected to
8984 be provided in calls to the function and the maximum number of elements
8985 accessed by it.  Failing to provide arguments of sufficient size or
8986 accessing more than the maximum number of elements may be diagnosed.
8988 For example, the warning triggers for the following redeclarations because
8989 the first one allows an array of any size to be passed to @code{f} while
8990 the second one specifies that the array argument must have at least @code{n}
8991 elements.  In addition, calling @code{f} with the assotiated VLA bound
8992 parameter in excess of the actual VLA bound triggers a warning as well.
8994 @smallexample
8995 void f (int n, int[n]);
8996 void f (int, int[]);     // warning: argument 2 previously declared as a VLA
8998 void g (int n)
9000     if (n > 4)
9001       return;
9002     int a[n];
9003     f (sizeof a, a);     // warning: access to a by f may be out of bounds
9004   @dots{}
9007 @end smallexample
9009 @option{-Wvla-parameter} is included in @option{-Wall}.  The
9010 @option{-Warray-parameter} option triggers warnings for similar problems
9011 involving ordinary array arguments.
9013 @item -Wvolatile-register-var
9014 @opindex Wvolatile-register-var
9015 @opindex Wno-volatile-register-var
9016 Warn if a register variable is declared volatile.  The volatile
9017 modifier does not inhibit all optimizations that may eliminate reads
9018 and/or writes to register variables.  This warning is enabled by
9019 @option{-Wall}.
9021 @item -Wdisabled-optimization
9022 @opindex Wdisabled-optimization
9023 @opindex Wno-disabled-optimization
9024 Warn if a requested optimization pass is disabled.  This warning does
9025 not generally indicate that there is anything wrong with your code; it
9026 merely indicates that GCC's optimizers are unable to handle the code
9027 effectively.  Often, the problem is that your code is too big or too
9028 complex; GCC refuses to optimize programs when the optimization
9029 itself is likely to take inordinate amounts of time.
9031 @item -Wpointer-sign @r{(C and Objective-C only)}
9032 @opindex Wpointer-sign
9033 @opindex Wno-pointer-sign
9034 Warn for pointer argument passing or assignment with different signedness.
9035 This option is only supported for C and Objective-C@.  It is implied by
9036 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
9037 @option{-Wno-pointer-sign}.
9039 @item -Wstack-protector
9040 @opindex Wstack-protector
9041 @opindex Wno-stack-protector
9042 This option is only active when @option{-fstack-protector} is active.  It
9043 warns about functions that are not protected against stack smashing.
9045 @item -Woverlength-strings
9046 @opindex Woverlength-strings
9047 @opindex Wno-overlength-strings
9048 Warn about string constants that are longer than the ``minimum
9049 maximum'' length specified in the C standard.  Modern compilers
9050 generally allow string constants that are much longer than the
9051 standard's minimum limit, but very portable programs should avoid
9052 using longer strings.
9054 The limit applies @emph{after} string constant concatenation, and does
9055 not count the trailing NUL@.  In C90, the limit was 509 characters; in
9056 C99, it was raised to 4095.  C++98 does not specify a normative
9057 minimum maximum, so we do not diagnose overlength strings in C++@.
9059 This option is implied by @option{-Wpedantic}, and can be disabled with
9060 @option{-Wno-overlength-strings}.
9062 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
9063 @opindex Wunsuffixed-float-constants
9064 @opindex Wno-unsuffixed-float-constants
9066 Issue a warning for any floating constant that does not have
9067 a suffix.  When used together with @option{-Wsystem-headers} it
9068 warns about such constants in system header files.  This can be useful
9069 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
9070 from the decimal floating-point extension to C99.
9072 @item -Wno-lto-type-mismatch
9073 @opindex Wlto-type-mismatch
9074 @opindex Wno-lto-type-mismatch
9076 During the link-time optimization, do not warn about type mismatches in
9077 global declarations from different compilation units.
9078 Requires @option{-flto} to be enabled.  Enabled by default.
9080 @item -Wno-designated-init @r{(C and Objective-C only)}
9081 @opindex Wdesignated-init
9082 @opindex Wno-designated-init
9083 Suppress warnings when a positional initializer is used to initialize
9084 a structure that has been marked with the @code{designated_init}
9085 attribute.
9087 @end table
9089 @node Static Analyzer Options
9090 @section Options That Control Static Analysis
9092 @table @gcctabopt
9093 @item -fanalyzer
9094 @opindex analyzer
9095 @opindex fanalyzer
9096 @opindex fno-analyzer
9097 This option enables an static analysis of program flow which looks
9098 for ``interesting'' interprocedural paths through the
9099 code, and issues warnings for problems found on them.
9101 This analysis is much more expensive than other GCC warnings.
9103 Enabling this option effectively enables the following warnings:
9105 @gccoptlist{ @gol
9106 -Wanalyzer-double-fclose @gol
9107 -Wanalyzer-double-free @gol
9108 -Wanalyzer-exposure-through-output-file @gol
9109 -Wanalyzer-file-leak @gol
9110 -Wanalyzer-free-of-non-heap @gol
9111 -Wanalyzer-malloc-leak @gol
9112 -Wanalyzer-mismatching-deallocation @gol
9113 -Wanalyzer-possible-null-argument @gol
9114 -Wanalyzer-possible-null-dereference @gol
9115 -Wanalyzer-null-argument @gol
9116 -Wanalyzer-null-dereference @gol
9117 -Wanalyzer-shift-count-negative @gol
9118 -Wanalyzer-shift-count-overflow @gol
9119 -Wanalyzer-stale-setjmp-buffer @gol
9120 -Wanalyzer-tainted-array-index @gol
9121 -Wanalyzer-unsafe-call-within-signal-handler @gol
9122 -Wanalyzer-use-after-free @gol
9123 -Wanalyzer-use-of-pointer-in-stale-stack-frame @gol
9124 -Wanalyzer-write-to-const @gol
9125 -Wanalyzer-write-to-string-literal @gol
9128 This option is only available if GCC was configured with analyzer
9129 support enabled.
9131 @item -Wanalyzer-too-complex
9132 @opindex Wanalyzer-too-complex
9133 @opindex Wno-analyzer-too-complex
9134 If @option{-fanalyzer} is enabled, the analyzer uses various heuristics
9135 to attempt to explore the control flow and data flow in the program,
9136 but these can be defeated by sufficiently complicated code.
9138 By default, the analysis silently stops if the code is too
9139 complicated for the analyzer to fully explore and it reaches an internal
9140 limit.  The @option{-Wanalyzer-too-complex} option warns if this occurs.
9142 @item -Wno-analyzer-double-fclose
9143 @opindex Wanalyzer-double-fclose
9144 @opindex Wno-analyzer-double-fclose
9145 This warning requires @option{-fanalyzer}, which enables it; use
9146 @option{-Wno-analyzer-double-fclose} to disable it.
9148 This diagnostic warns for paths through the code in which a @code{FILE *}
9149 can have @code{fclose} called on it more than once.
9151 @item -Wno-analyzer-double-free
9152 @opindex Wanalyzer-double-free
9153 @opindex Wno-analyzer-double-free
9154 This warning requires @option{-fanalyzer}, which enables it; use
9155 @option{-Wno-analyzer-double-free} to disable it.
9157 This diagnostic warns for paths through the code in which a pointer
9158 can have @code{free} called on it more than once.
9160 @item -Wno-analyzer-exposure-through-output-file
9161 @opindex Wanalyzer-exposure-through-output-file
9162 @opindex Wno-analyzer-exposure-through-output-file
9163 This warning requires @option{-fanalyzer}, which enables it; use
9164 @option{-Wno-analyzer-exposure-through-output-file}
9165 to disable it.
9167 This diagnostic warns for paths through the code in which a
9168 security-sensitive value is written to an output file
9169 (such as writing a password to a log file).
9171 @item -Wno-analyzer-file-leak
9172 @opindex Wanalyzer-file-leak
9173 @opindex Wno-analyzer-file-leak
9174 This warning requires @option{-fanalyzer}, which enables it; use
9175 @option{-Wno-analyzer-file-leak}
9176 to disable it.
9178 This diagnostic warns for paths through the code in which a
9179 @code{<stdio.h>} @code{FILE *} stream object is leaked.
9181 @item -Wno-analyzer-free-of-non-heap
9182 @opindex Wanalyzer-free-of-non-heap
9183 @opindex Wno-analyzer-free-of-non-heap
9184 This warning requires @option{-fanalyzer}, which enables it; use
9185 @option{-Wno-analyzer-free-of-non-heap}
9186 to disable it.
9188 This diagnostic warns for paths through the code in which @code{free}
9189 is called on a non-heap pointer (e.g. an on-stack buffer, or a global).
9191 @item -Wno-analyzer-malloc-leak
9192 @opindex Wanalyzer-malloc-leak
9193 @opindex Wno-analyzer-malloc-leak
9194 This warning requires @option{-fanalyzer}, which enables it; use
9195 @option{-Wno-analyzer-malloc-leak}
9196 to disable it.
9198 This diagnostic warns for paths through the code in which a
9199 pointer allocated via @code{malloc} is leaked.
9201 @item -Wno-analyzer-mismatching-deallocation
9202 @opindex Wanalyzer-mismatching-deallocation
9203 @opindex Wno-analyzer-mismatching-deallocation
9204 This warning requires @option{-fanalyzer}, which enables it; use
9205 @option{-Wno-analyzer-mismatching-deallocation}
9206 to disable it.
9208 This diagnostic warns for paths through the code in which the
9209 wrong deallocation function is called on a pointer value, based on
9210 which function was used to allocate the pointer value.
9212 @item -Wno-analyzer-possible-null-argument
9213 @opindex Wanalyzer-possible-null-argument
9214 @opindex Wno-analyzer-possible-null-argument
9215 This warning requires @option{-fanalyzer}, which enables it; use
9216 @option{-Wno-analyzer-possible-null-argument} to disable it.
9218 This diagnostic warns for paths through the code in which a
9219 possibly-NULL value is passed to a function argument marked
9220 with @code{__attribute__((nonnull))} as requiring a non-NULL
9221 value.
9223 @item -Wno-analyzer-possible-null-dereference
9224 @opindex Wanalyzer-possible-null-dereference
9225 @opindex Wno-analyzer-possible-null-dereference
9226 This warning requires @option{-fanalyzer}, which enables it; use
9227 @option{-Wno-analyzer-possible-null-dereference} to disable it.
9229 This diagnostic warns for paths through the code in which a
9230 possibly-NULL value is dereferenced.
9232 @item -Wno-analyzer-null-argument
9233 @opindex Wanalyzer-null-argument
9234 @opindex Wno-analyzer-null-argument
9235 This warning requires @option{-fanalyzer}, which enables it; use
9236 @option{-Wno-analyzer-null-argument} to disable it.
9238 This diagnostic warns for paths through the code in which a
9239 value known to be NULL is passed to a function argument marked
9240 with @code{__attribute__((nonnull))} as requiring a non-NULL
9241 value.
9243 @item -Wno-analyzer-null-dereference
9244 @opindex Wanalyzer-null-dereference
9245 @opindex Wno-analyzer-null-dereference
9246 This warning requires @option{-fanalyzer}, which enables it; use
9247 @option{-Wno-analyzer-null-dereference} to disable it.
9249 This diagnostic warns for paths through the code in which a
9250 value known to be NULL is dereferenced.
9252 @item -Wno-analyzer-shift-count-negative
9253 @opindex Wanalyzer-shift-count-negative
9254 @opindex Wno-analyzer-shift-count-negative
9255 This warning requires @option{-fanalyzer}, which enables it; use
9256 @option{-Wno-analyzer-shift-count-negative} to disable it.
9258 This diagnostic warns for paths through the code in which a
9259 shift is attempted with a negative count.  It is analogous to
9260 the @option{-Wshift-count-negative} diagnostic implemented in
9261 the C/C++ front ends, but is implemented based on analyzing
9262 interprocedural paths, rather than merely parsing the syntax tree.
9263 However, the analyzer does not prioritize detection of such paths, so
9264 false negatives are more likely relative to other warnings.
9266 @item -Wno-analyzer-shift-count-overflow
9267 @opindex Wanalyzer-shift-count-overflow
9268 @opindex Wno-analyzer-shift-count-overflow
9269 This warning requires @option{-fanalyzer}, which enables it; use
9270 @option{-Wno-analyzer-shift-count-overflow} to disable it.
9272 This diagnostic warns for paths through the code in which a
9273 shift is attempted with a count greater than or equal to the
9274 precision of the operand's type.  It is analogous to
9275 the @option{-Wshift-count-overflow} diagnostic implemented in
9276 the C/C++ front ends, but is implemented based on analyzing
9277 interprocedural paths, rather than merely parsing the syntax tree.
9278 However, the analyzer does not prioritize detection of such paths, so
9279 false negatives are more likely relative to other warnings.
9281 @item -Wno-analyzer-stale-setjmp-buffer
9282 @opindex Wanalyzer-stale-setjmp-buffer
9283 @opindex Wno-analyzer-stale-setjmp-buffer
9284 This warning requires @option{-fanalyzer}, which enables it; use
9285 @option{-Wno-analyzer-stale-setjmp-buffer} to disable it.
9287 This diagnostic warns for paths through the code in which
9288 @code{longjmp} is called to rewind to a @code{jmp_buf} relating
9289 to a @code{setjmp} call in a function that has returned.
9291 When @code{setjmp} is called on a @code{jmp_buf} to record a rewind
9292 location, it records the stack frame.  The stack frame becomes invalid
9293 when the function containing the @code{setjmp} call returns.  Attempting
9294 to rewind to it via @code{longjmp} would reference a stack frame that
9295 no longer exists, and likely lead to a crash (or worse).
9297 @item -Wno-analyzer-tainted-array-index
9298 @opindex Wanalyzer-tainted-array-index
9299 @opindex Wno-analyzer-tainted-array-index
9300 This warning requires both @option{-fanalyzer} and
9301 @option{-fanalyzer-checker=taint} to enable it;
9302 use @option{-Wno-analyzer-tainted-array-index} to disable it.
9304 This diagnostic warns for paths through the code in which a value
9305 that could be under an attacker's control is used as the index
9306 of an array access without being sanitized.
9308 @item -Wno-analyzer-unsafe-call-within-signal-handler
9309 @opindex Wanalyzer-unsafe-call-within-signal-handler
9310 @opindex Wno-analyzer-unsafe-call-within-signal-handler
9311 This warning requires @option{-fanalyzer}, which enables it; use
9312 @option{-Wno-analyzer-unsafe-call-within-signal-handler} to disable it.
9314 This diagnostic warns for paths through the code in which a
9315 function known to be async-signal-unsafe (such as @code{fprintf}) is
9316 called from a signal handler.
9318 @item -Wno-analyzer-use-after-free
9319 @opindex Wanalyzer-use-after-free
9320 @opindex Wno-analyzer-use-after-free
9321 This warning requires @option{-fanalyzer}, which enables it; use
9322 @option{-Wno-analyzer-use-after-free} to disable it.
9324 This diagnostic warns for paths through the code in which a
9325 pointer is used after @code{free} is called on it.
9327 @item -Wno-analyzer-use-of-pointer-in-stale-stack-frame
9328 @opindex Wanalyzer-use-of-pointer-in-stale-stack-frame
9329 @opindex Wno-analyzer-use-of-pointer-in-stale-stack-frame
9330 This warning requires @option{-fanalyzer}, which enables it; use
9331 @option{-Wno-analyzer-use-of-pointer-in-stale-stack-frame}
9332 to disable it.
9334 This diagnostic warns for paths through the code in which a pointer
9335 is dereferenced that points to a variable in a stale stack frame.
9337 @item -Wno-analyzer-write-to-const
9338 @opindex Wanalyzer-write-to-const
9339 @opindex Wno-analyzer-write-to-const
9340 This warning requires @option{-fanalyzer}, which enables it; use
9341 @option{-Wno-analyzer-write-to-const}
9342 to disable it.
9344 This diagnostic warns for paths through the code in which the analyzer
9345 detects an attempt to write through a pointer to a @code{const} object.
9346 However, the analyzer does not prioritize detection of such paths, so
9347 false negatives are more likely relative to other warnings.
9349 @item -Wno-analyzer-write-to-string-literal
9350 @opindex Wanalyzer-write-to-string-literal
9351 @opindex Wno-analyzer-write-to-string-literal
9352 This warning requires @option{-fanalyzer}, which enables it; use
9353 @option{-Wno-analyzer-write-to-string-literal}
9354 to disable it.
9356 This diagnostic warns for paths through the code in which the analyzer
9357 detects an attempt to write through a pointer to a string literal.
9358 However, the analyzer does not prioritize detection of such paths, so
9359 false negatives are more likely relative to other warnings.
9361 @end table
9363 Pertinent parameters for controlling the exploration are:
9364 @option{--param analyzer-bb-explosion-factor=@var{value}},
9365 @option{--param analyzer-max-enodes-per-program-point=@var{value}},
9366 @option{--param analyzer-max-recursion-depth=@var{value}}, and
9367 @option{--param analyzer-min-snodes-for-call-summary=@var{value}}.
9369 The following options control the analyzer.
9371 @table @gcctabopt
9373 @item -fanalyzer-call-summaries
9374 @opindex fanalyzer-call-summaries
9375 @opindex fno-analyzer-call-summaries
9376 Simplify interprocedural analysis by computing the effect of certain calls,
9377 rather than exploring all paths through the function from callsite to each
9378 possible return.
9380 If enabled, call summaries are only used for functions with more than one
9381 call site, and that are sufficiently complicated (as per
9382 @option{--param analyzer-min-snodes-for-call-summary=@var{value}}).
9384 @item -fanalyzer-checker=@var{name}
9385 @opindex fanalyzer-checker
9386 Restrict the analyzer to run just the named checker, and enable it.
9388 Some checkers are disabled by default (even with @option{-fanalyzer}),
9389 such as the @code{taint} checker that implements
9390 @option{-Wanalyzer-tainted-array-index}, and this option is required
9391 to enable them.
9393 @item -fno-analyzer-feasibility
9394 @opindex fanalyzer-feasibility
9395 @opindex fno-analyzer-feasibility
9396 This option is intended for analyzer developers.
9398 By default the analyzer verifies that there is a feasible control flow path
9399 for each diagnostic it emits: that the conditions that hold are not mutually
9400 exclusive.  Diagnostics for which no feasible path can be found are rejected.
9401 This filtering can be suppressed with @option{-fno-analyzer-feasibility}, for
9402 debugging issues in this code.
9404 @item -fanalyzer-fine-grained
9405 @opindex fanalyzer-fine-grained
9406 @opindex fno-analyzer-fine-grained
9407 This option is intended for analyzer developers.
9409 Internally the analyzer builds an ``exploded graph'' that combines
9410 control flow graphs with data flow information.
9412 By default, an edge in this graph can contain the effects of a run
9413 of multiple statements within a basic block.  With
9414 @option{-fanalyzer-fine-grained}, each statement gets its own edge.
9416 @item -fanalyzer-show-duplicate-count
9417 @opindex fanalyzer-show-duplicate-count
9418 @opindex fno-analyzer-show-duplicate-count
9419 This option is intended for analyzer developers: if multiple diagnostics
9420 have been detected as being duplicates of each other, it emits a note when
9421 reporting the best diagnostic, giving the number of additional diagnostics
9422 that were suppressed by the deduplication logic.
9424 @item -fno-analyzer-state-merge
9425 @opindex fanalyzer-state-merge
9426 @opindex fno-analyzer-state-merge
9427 This option is intended for analyzer developers.
9429 By default the analyzer attempts to simplify analysis by merging
9430 sufficiently similar states at each program point as it builds its
9431 ``exploded graph''.  With @option{-fno-analyzer-state-merge} this
9432 merging can be suppressed, for debugging state-handling issues.
9434 @item -fno-analyzer-state-purge
9435 @opindex fanalyzer-state-purge
9436 @opindex fno-analyzer-state-purge
9437 This option is intended for analyzer developers.
9439 By default the analyzer attempts to simplify analysis by purging
9440 aspects of state at a program point that appear to no longer be relevant
9441 e.g. the values of locals that aren't accessed later in the function
9442 and which aren't relevant to leak analysis.
9444 With @option{-fno-analyzer-state-purge} this purging of state can
9445 be suppressed, for debugging state-handling issues.
9447 @item -fanalyzer-transitivity
9448 @opindex fanalyzer-transitivity
9449 @opindex fno-analyzer-transitivity
9450 This option enables transitivity of constraints within the analyzer.
9452 @item -fanalyzer-verbose-edges
9453 This option is intended for analyzer developers.  It enables more
9454 verbose, lower-level detail in the descriptions of control flow
9455 within diagnostic paths.
9457 @item -fanalyzer-verbose-state-changes
9458 This option is intended for analyzer developers.  It enables more
9459 verbose, lower-level detail in the descriptions of events relating
9460 to state machines within diagnostic paths.
9462 @item -fanalyzer-verbosity=@var{level}
9463 This option controls the complexity of the control flow paths that are
9464 emitted for analyzer diagnostics.
9466 The @var{level} can be one of:
9468 @table @samp
9469 @item 0
9470 At this level, interprocedural call and return events are displayed,
9471 along with the most pertinent state-change events relating to
9472 a diagnostic.  For example, for a double-@code{free} diagnostic,
9473 both calls to @code{free} will be shown.
9475 @item 1
9476 As per the previous level, but also show events for the entry
9477 to each function.
9479 @item 2
9480 As per the previous level, but also show events relating to
9481 control flow that are significant to triggering the issue
9482 (e.g. ``true path taken'' at a conditional).
9484 This level is the default.
9486 @item 3
9487 As per the previous level, but show all control flow events, not
9488 just significant ones.
9490 @item 4
9491 This level is intended for analyzer developers; it adds various
9492 other events intended for debugging the analyzer.
9494 @end table
9496 @item -fdump-analyzer
9497 @opindex fdump-analyzer
9498 Dump internal details about what the analyzer is doing to
9499 @file{@var{file}.analyzer.txt}.
9500 This option is overridden by @option{-fdump-analyzer-stderr}.
9502 @item -fdump-analyzer-stderr
9503 @opindex fdump-analyzer-stderr
9504 Dump internal details about what the analyzer is doing to stderr.
9505 This option overrides @option{-fdump-analyzer}.
9507 @item -fdump-analyzer-callgraph
9508 @opindex fdump-analyzer-callgraph
9509 Dump a representation of the call graph suitable for viewing with
9510 GraphViz to @file{@var{file}.callgraph.dot}.
9512 @item -fdump-analyzer-exploded-graph
9513 @opindex fdump-analyzer-exploded-graph
9514 Dump a representation of the ``exploded graph'' suitable for viewing with
9515 GraphViz to @file{@var{file}.eg.dot}.
9516 Nodes are color-coded based on state-machine states to emphasize
9517 state changes.
9519 @item -fdump-analyzer-exploded-nodes
9520 @opindex dump-analyzer-exploded-nodes
9521 Emit diagnostics showing where nodes in the ``exploded graph'' are
9522 in relation to the program source.
9524 @item -fdump-analyzer-exploded-nodes-2
9525 @opindex dump-analyzer-exploded-nodes-2
9526 Dump a textual representation of the ``exploded graph'' to
9527 @file{@var{file}.eg.txt}.
9529 @item -fdump-analyzer-exploded-nodes-3
9530 @opindex dump-analyzer-exploded-nodes-3
9531 Dump a textual representation of the ``exploded graph'' to
9532 one dump file per node, to @file{@var{file}.eg-@var{id}.txt}.
9533 This is typically a large number of dump files.
9535 @item -fdump-analyzer-json
9536 @opindex fdump-analyzer-json
9537 Dump a compressed JSON representation of analyzer internals to
9538 @file{@var{file}.analyzer.json.gz}.  The precise format is subject
9539 to change.
9541 @item -fdump-analyzer-state-purge
9542 @opindex fdump-analyzer-state-purge
9543 As per @option{-fdump-analyzer-supergraph}, dump a representation of the
9544 ``supergraph'' suitable for viewing with GraphViz, but annotate the
9545 graph with information on what state will be purged at each node.
9546 The graph is written to @file{@var{file}.state-purge.dot}.
9548 @item -fdump-analyzer-supergraph
9549 @opindex fdump-analyzer-supergraph
9550 Dump representations of the ``supergraph'' suitable for viewing with
9551 GraphViz to @file{@var{file}.supergraph.dot} and to
9552 @file{@var{file}.supergraph-eg.dot}.  These show all of the
9553 control flow graphs in the program, with interprocedural edges for
9554 calls and returns.  The second dump contains annotations showing nodes
9555 in the ``exploded graph'' and diagnostics associated with them.
9557 @end table
9559 @node Debugging Options
9560 @section Options for Debugging Your Program
9561 @cindex options, debugging
9562 @cindex debugging information options
9564 To tell GCC to emit extra information for use by a debugger, in almost 
9565 all cases you need only to add @option{-g} to your other options.
9567 GCC allows you to use @option{-g} with
9568 @option{-O}.  The shortcuts taken by optimized code may occasionally
9569 be surprising: some variables you declared may not exist
9570 at all; flow of control may briefly move where you did not expect it;
9571 some statements may not be executed because they compute constant
9572 results or their values are already at hand; some statements may
9573 execute in different places because they have been moved out of loops.
9574 Nevertheless it is possible to debug optimized output.  This makes
9575 it reasonable to use the optimizer for programs that might have bugs.
9577 If you are not using some other optimization option, consider
9578 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
9579 With no @option{-O} option at all, some compiler passes that collect
9580 information useful for debugging do not run at all, so that
9581 @option{-Og} may result in a better debugging experience.
9583 @table @gcctabopt
9584 @item -g
9585 @opindex g
9586 Produce debugging information in the operating system's native format
9587 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
9588 information.
9590 On most systems that use stabs format, @option{-g} enables use of extra
9591 debugging information that only GDB can use; this extra information
9592 makes debugging work better in GDB but probably makes other debuggers
9593 crash or
9594 refuse to read the program.  If you want to control for certain whether
9595 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
9596 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
9598 @item -ggdb
9599 @opindex ggdb
9600 Produce debugging information for use by GDB@.  This means to use the
9601 most expressive format available (DWARF, stabs, or the native format
9602 if neither of those are supported), including GDB extensions if at all
9603 possible.
9605 @item -gdwarf
9606 @itemx -gdwarf-@var{version}
9607 @opindex gdwarf
9608 Produce debugging information in DWARF format (if that is supported).
9609 The value of @var{version} may be either 2, 3, 4 or 5; the default version
9610 for most targets is 4.  DWARF Version 5 is only experimental.
9612 Note that with DWARF Version 2, some ports require and always
9613 use some non-conflicting DWARF 3 extensions in the unwind tables.
9615 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
9616 for maximum benefit.
9618 GCC no longer supports DWARF Version 1, which is substantially
9619 different than Version 2 and later.  For historical reasons, some
9620 other DWARF-related options such as
9621 @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
9622 in their names, but apply to all currently-supported versions of DWARF.
9624 @item -gstabs
9625 @opindex gstabs
9626 Produce debugging information in stabs format (if that is supported),
9627 without GDB extensions.  This is the format used by DBX on most BSD
9628 systems.  On MIPS, Alpha and System V Release 4 systems this option
9629 produces stabs debugging output that is not understood by DBX@.
9630 On System V Release 4 systems this option requires the GNU assembler.
9632 @item -gstabs+
9633 @opindex gstabs+
9634 Produce debugging information in stabs format (if that is supported),
9635 using GNU extensions understood only by the GNU debugger (GDB)@.  The
9636 use of these extensions is likely to make other debuggers crash or
9637 refuse to read the program.
9639 @item -gxcoff
9640 @opindex gxcoff
9641 Produce debugging information in XCOFF format (if that is supported).
9642 This is the format used by the DBX debugger on IBM RS/6000 systems.
9644 @item -gxcoff+
9645 @opindex gxcoff+
9646 Produce debugging information in XCOFF format (if that is supported),
9647 using GNU extensions understood only by the GNU debugger (GDB)@.  The
9648 use of these extensions is likely to make other debuggers crash or
9649 refuse to read the program, and may cause assemblers other than the GNU
9650 assembler (GAS) to fail with an error.
9652 @item -gvms
9653 @opindex gvms
9654 Produce debugging information in Alpha/VMS debug format (if that is
9655 supported).  This is the format used by DEBUG on Alpha/VMS systems.
9657 @item -g@var{level}
9658 @itemx -ggdb@var{level}
9659 @itemx -gstabs@var{level}
9660 @itemx -gxcoff@var{level}
9661 @itemx -gvms@var{level}
9662 Request debugging information and also use @var{level} to specify how
9663 much information.  The default level is 2.
9665 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
9666 @option{-g}.
9668 Level 1 produces minimal information, enough for making backtraces in
9669 parts of the program that you don't plan to debug.  This includes
9670 descriptions of functions and external variables, and line number
9671 tables, but no information about local variables.
9673 Level 3 includes extra information, such as all the macro definitions
9674 present in the program.  Some debuggers support macro expansion when
9675 you use @option{-g3}.
9677 If you use multiple @option{-g} options, with or without level numbers,
9678 the last such option is the one that is effective.
9680 @option{-gdwarf} does not accept a concatenated debug level, to avoid
9681 confusion with @option{-gdwarf-@var{level}}.
9682 Instead use an additional @option{-g@var{level}} option to change the
9683 debug level for DWARF.
9685 @item -fno-eliminate-unused-debug-symbols
9686 @opindex feliminate-unused-debug-symbols
9687 @opindex fno-eliminate-unused-debug-symbols
9688 By default, no debug information is produced for symbols that are not actually
9689 used. Use this option if you want debug information for all symbols.
9691 @item -femit-class-debug-always
9692 @opindex femit-class-debug-always
9693 Instead of emitting debugging information for a C++ class in only one
9694 object file, emit it in all object files using the class.  This option
9695 should be used only with debuggers that are unable to handle the way GCC
9696 normally emits debugging information for classes because using this
9697 option increases the size of debugging information by as much as a
9698 factor of two.
9700 @item -fno-merge-debug-strings
9701 @opindex fmerge-debug-strings
9702 @opindex fno-merge-debug-strings
9703 Direct the linker to not merge together strings in the debugging
9704 information that are identical in different object files.  Merging is
9705 not supported by all assemblers or linkers.  Merging decreases the size
9706 of the debug information in the output file at the cost of increasing
9707 link processing time.  Merging is enabled by default.
9709 @item -fdebug-prefix-map=@var{old}=@var{new}
9710 @opindex fdebug-prefix-map
9711 When compiling files residing in directory @file{@var{old}}, record
9712 debugging information describing them as if the files resided in
9713 directory @file{@var{new}} instead.  This can be used to replace a
9714 build-time path with an install-time path in the debug info.  It can
9715 also be used to change an absolute path to a relative path by using
9716 @file{.} for @var{new}.  This can give more reproducible builds, which
9717 are location independent, but may require an extra command to tell GDB
9718 where to find the source files. See also @option{-ffile-prefix-map}.
9720 @item -fvar-tracking
9721 @opindex fvar-tracking
9722 Run variable tracking pass.  It computes where variables are stored at each
9723 position in code.  Better debugging information is then generated
9724 (if the debugging information format supports this information).
9726 It is enabled by default when compiling with optimization (@option{-Os},
9727 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
9728 the debug info format supports it.
9730 @item -fvar-tracking-assignments
9731 @opindex fvar-tracking-assignments
9732 @opindex fno-var-tracking-assignments
9733 Annotate assignments to user variables early in the compilation and
9734 attempt to carry the annotations over throughout the compilation all the
9735 way to the end, in an attempt to improve debug information while
9736 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
9738 It can be enabled even if var-tracking is disabled, in which case
9739 annotations are created and maintained, but discarded at the end.
9740 By default, this flag is enabled together with @option{-fvar-tracking},
9741 except when selective scheduling is enabled.
9743 @item -gsplit-dwarf
9744 @opindex gsplit-dwarf
9745 If DWARF debugging information is enabled, separate as much debugging
9746 information as possible into a separate output file with the extension
9747 @file{.dwo}.  This option allows the build system to avoid linking files with
9748 debug information.  To be useful, this option requires a debugger capable of
9749 reading @file{.dwo} files.
9751 @item -gdwarf32
9752 @itemx -gdwarf64
9753 @opindex gdwarf32
9754 @opindex gdwarf64
9755 If DWARF debugging information is enabled, the @option{-gdwarf32} selects
9756 the 32-bit DWARF format and the @option{-gdwarf64} selects the 64-bit
9757 DWARF format.  The default is target specific, on most targets it is
9758 @option{-gdwarf32} though.  The 32-bit DWARF format is smaller, but
9759 can't support more than 2GiB of debug information in any of the DWARF
9760 debug information sections.  The 64-bit DWARF format allows larger debug
9761 information and might not be well supported by all consumers yet.
9763 @item -gdescribe-dies
9764 @opindex gdescribe-dies
9765 Add description attributes to some DWARF DIEs that have no name attribute,
9766 such as artificial variables, external references and call site
9767 parameter DIEs.
9769 @item -gpubnames
9770 @opindex gpubnames
9771 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
9773 @item -ggnu-pubnames
9774 @opindex ggnu-pubnames
9775 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
9776 suitable for conversion into a GDB@ index.  This option is only useful
9777 with a linker that can produce GDB@ index version 7.
9779 @item -fdebug-types-section
9780 @opindex fdebug-types-section
9781 @opindex fno-debug-types-section
9782 When using DWARF Version 4 or higher, type DIEs can be put into
9783 their own @code{.debug_types} section instead of making them part of the
9784 @code{.debug_info} section.  It is more efficient to put them in a separate
9785 comdat section since the linker can then remove duplicates.
9786 But not all DWARF consumers support @code{.debug_types} sections yet
9787 and on some objects @code{.debug_types} produces larger instead of smaller
9788 debugging information.
9790 @item -grecord-gcc-switches
9791 @itemx -gno-record-gcc-switches
9792 @opindex grecord-gcc-switches
9793 @opindex gno-record-gcc-switches
9794 This switch causes the command-line options used to invoke the
9795 compiler that may affect code generation to be appended to the
9796 DW_AT_producer attribute in DWARF debugging information.  The options
9797 are concatenated with spaces separating them from each other and from
9798 the compiler version.  
9799 It is enabled by default.
9800 See also @option{-frecord-gcc-switches} for another
9801 way of storing compiler options into the object file.  
9803 @item -gstrict-dwarf
9804 @opindex gstrict-dwarf
9805 Disallow using extensions of later DWARF standard version than selected
9806 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
9807 DWARF extensions from later standard versions is allowed.
9809 @item -gno-strict-dwarf
9810 @opindex gno-strict-dwarf
9811 Allow using extensions of later DWARF standard version than selected with
9812 @option{-gdwarf-@var{version}}.
9814 @item -gas-loc-support
9815 @opindex gas-loc-support
9816 Inform the compiler that the assembler supports @code{.loc} directives.
9817 It may then use them for the assembler to generate DWARF2+ line number
9818 tables.
9820 This is generally desirable, because assembler-generated line-number
9821 tables are a lot more compact than those the compiler can generate
9822 itself.
9824 This option will be enabled by default if, at GCC configure time, the
9825 assembler was found to support such directives.
9827 @item -gno-as-loc-support
9828 @opindex gno-as-loc-support
9829 Force GCC to generate DWARF2+ line number tables internally, if DWARF2+
9830 line number tables are to be generated.
9832 @item -gas-locview-support
9833 @opindex gas-locview-support
9834 Inform the compiler that the assembler supports @code{view} assignment
9835 and reset assertion checking in @code{.loc} directives.
9837 This option will be enabled by default if, at GCC configure time, the
9838 assembler was found to support them.
9840 @item -gno-as-locview-support
9841 Force GCC to assign view numbers internally, if
9842 @option{-gvariable-location-views} are explicitly requested.
9844 @item -gcolumn-info
9845 @itemx -gno-column-info
9846 @opindex gcolumn-info
9847 @opindex gno-column-info
9848 Emit location column information into DWARF debugging information, rather
9849 than just file and line.
9850 This option is enabled by default.
9852 @item -gstatement-frontiers
9853 @itemx -gno-statement-frontiers
9854 @opindex gstatement-frontiers
9855 @opindex gno-statement-frontiers
9856 This option causes GCC to create markers in the internal representation
9857 at the beginning of statements, and to keep them roughly in place
9858 throughout compilation, using them to guide the output of @code{is_stmt}
9859 markers in the line number table.  This is enabled by default when
9860 compiling with optimization (@option{-Os}, @option{-O}, @option{-O2},
9861 @dots{}), and outputting DWARF 2 debug information at the normal level.
9863 @item -gvariable-location-views
9864 @itemx -gvariable-location-views=incompat5
9865 @itemx -gno-variable-location-views
9866 @opindex gvariable-location-views
9867 @opindex gvariable-location-views=incompat5
9868 @opindex gno-variable-location-views
9869 Augment variable location lists with progressive view numbers implied
9870 from the line number table.  This enables debug information consumers to
9871 inspect state at certain points of the program, even if no instructions
9872 associated with the corresponding source locations are present at that
9873 point.  If the assembler lacks support for view numbers in line number
9874 tables, this will cause the compiler to emit the line number table,
9875 which generally makes them somewhat less compact.  The augmented line
9876 number tables and location lists are fully backward-compatible, so they
9877 can be consumed by debug information consumers that are not aware of
9878 these augmentations, but they won't derive any benefit from them either.
9880 This is enabled by default when outputting DWARF 2 debug information at
9881 the normal level, as long as there is assembler support,
9882 @option{-fvar-tracking-assignments} is enabled and
9883 @option{-gstrict-dwarf} is not.  When assembler support is not
9884 available, this may still be enabled, but it will force GCC to output
9885 internal line number tables, and if
9886 @option{-ginternal-reset-location-views} is not enabled, that will most
9887 certainly lead to silently mismatching location views.
9889 There is a proposed representation for view numbers that is not backward
9890 compatible with the location list format introduced in DWARF 5, that can
9891 be enabled with @option{-gvariable-location-views=incompat5}.  This
9892 option may be removed in the future, is only provided as a reference
9893 implementation of the proposed representation.  Debug information
9894 consumers are not expected to support this extended format, and they
9895 would be rendered unable to decode location lists using it.
9897 @item -ginternal-reset-location-views
9898 @itemx -gno-internal-reset-location-views
9899 @opindex ginternal-reset-location-views
9900 @opindex gno-internal-reset-location-views
9901 Attempt to determine location views that can be omitted from location
9902 view lists.  This requires the compiler to have very accurate insn
9903 length estimates, which isn't always the case, and it may cause
9904 incorrect view lists to be generated silently when using an assembler
9905 that does not support location view lists.  The GNU assembler will flag
9906 any such error as a @code{view number mismatch}.  This is only enabled
9907 on ports that define a reliable estimation function.
9909 @item -ginline-points
9910 @itemx -gno-inline-points
9911 @opindex ginline-points
9912 @opindex gno-inline-points
9913 Generate extended debug information for inlined functions.  Location
9914 view tracking markers are inserted at inlined entry points, so that
9915 address and view numbers can be computed and output in debug
9916 information.  This can be enabled independently of location views, in
9917 which case the view numbers won't be output, but it can only be enabled
9918 along with statement frontiers, and it is only enabled by default if
9919 location views are enabled.
9921 @item -gz@r{[}=@var{type}@r{]}
9922 @opindex gz
9923 Produce compressed debug sections in DWARF format, if that is supported.
9924 If @var{type} is not given, the default type depends on the capabilities
9925 of the assembler and linker used.  @var{type} may be one of
9926 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
9927 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
9928 compression in traditional GNU format).  If the linker doesn't support
9929 writing compressed debug sections, the option is rejected.  Otherwise,
9930 if the assembler does not support them, @option{-gz} is silently ignored
9931 when producing object files.
9933 @item -femit-struct-debug-baseonly
9934 @opindex femit-struct-debug-baseonly
9935 Emit debug information for struct-like types
9936 only when the base name of the compilation source file
9937 matches the base name of file in which the struct is defined.
9939 This option substantially reduces the size of debugging information,
9940 but at significant potential loss in type information to the debugger.
9941 See @option{-femit-struct-debug-reduced} for a less aggressive option.
9942 See @option{-femit-struct-debug-detailed} for more detailed control.
9944 This option works only with DWARF debug output.
9946 @item -femit-struct-debug-reduced
9947 @opindex femit-struct-debug-reduced
9948 Emit debug information for struct-like types
9949 only when the base name of the compilation source file
9950 matches the base name of file in which the type is defined,
9951 unless the struct is a template or defined in a system header.
9953 This option significantly reduces the size of debugging information,
9954 with some potential loss in type information to the debugger.
9955 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
9956 See @option{-femit-struct-debug-detailed} for more detailed control.
9958 This option works only with DWARF debug output.
9960 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
9961 @opindex femit-struct-debug-detailed
9962 Specify the struct-like types
9963 for which the compiler generates debug information.
9964 The intent is to reduce duplicate struct debug information
9965 between different object files within the same program.
9967 This option is a detailed version of
9968 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
9969 which serves for most needs.
9971 A specification has the syntax@*
9972 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
9974 The optional first word limits the specification to
9975 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
9976 A struct type is used directly when it is the type of a variable, member.
9977 Indirect uses arise through pointers to structs.
9978 That is, when use of an incomplete struct is valid, the use is indirect.
9979 An example is
9980 @samp{struct one direct; struct two * indirect;}.
9982 The optional second word limits the specification to
9983 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
9984 Generic structs are a bit complicated to explain.
9985 For C++, these are non-explicit specializations of template classes,
9986 or non-template classes within the above.
9987 Other programming languages have generics,
9988 but @option{-femit-struct-debug-detailed} does not yet implement them.
9990 The third word specifies the source files for those
9991 structs for which the compiler should emit debug information.
9992 The values @samp{none} and @samp{any} have the normal meaning.
9993 The value @samp{base} means that
9994 the base of name of the file in which the type declaration appears
9995 must match the base of the name of the main compilation file.
9996 In practice, this means that when compiling @file{foo.c}, debug information
9997 is generated for types declared in that file and @file{foo.h},
9998 but not other header files.
9999 The value @samp{sys} means those types satisfying @samp{base}
10000 or declared in system or compiler headers.
10002 You may need to experiment to determine the best settings for your application.
10004 The default is @option{-femit-struct-debug-detailed=all}.
10006 This option works only with DWARF debug output.
10008 @item -fno-dwarf2-cfi-asm
10009 @opindex fdwarf2-cfi-asm
10010 @opindex fno-dwarf2-cfi-asm
10011 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
10012 instead of using GAS @code{.cfi_*} directives.
10014 @item -fno-eliminate-unused-debug-types
10015 @opindex feliminate-unused-debug-types
10016 @opindex fno-eliminate-unused-debug-types
10017 Normally, when producing DWARF output, GCC avoids producing debug symbol 
10018 output for types that are nowhere used in the source file being compiled.
10019 Sometimes it is useful to have GCC emit debugging
10020 information for all types declared in a compilation
10021 unit, regardless of whether or not they are actually used
10022 in that compilation unit, for example 
10023 if, in the debugger, you want to cast a value to a type that is
10024 not actually used in your program (but is declared).  More often,
10025 however, this results in a significant amount of wasted space.
10026 @end table
10028 @node Optimize Options
10029 @section Options That Control Optimization
10030 @cindex optimize options
10031 @cindex options, optimization
10033 These options control various sorts of optimizations.
10035 Without any optimization option, the compiler's goal is to reduce the
10036 cost of compilation and to make debugging produce the expected
10037 results.  Statements are independent: if you stop the program with a
10038 breakpoint between statements, you can then assign a new value to any
10039 variable or change the program counter to any other statement in the
10040 function and get exactly the results you expect from the source
10041 code.
10043 Turning on optimization flags makes the compiler attempt to improve
10044 the performance and/or code size at the expense of compilation time
10045 and possibly the ability to debug the program.
10047 The compiler performs optimization based on the knowledge it has of the
10048 program.  Compiling multiple files at once to a single output file mode allows
10049 the compiler to use information gained from all of the files when compiling
10050 each of them.
10052 Not all optimizations are controlled directly by a flag.  Only
10053 optimizations that have a flag are listed in this section.
10055 Most optimizations are completely disabled at @option{-O0} or if an
10056 @option{-O} level is not set on the command line, even if individual
10057 optimization flags are specified.  Similarly, @option{-Og} suppresses
10058 many optimization passes.
10060 Depending on the target and how GCC was configured, a slightly different
10061 set of optimizations may be enabled at each @option{-O} level than
10062 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
10063 to find out the exact set of optimizations that are enabled at each level.
10064 @xref{Overall Options}, for examples.
10066 @table @gcctabopt
10067 @item -O
10068 @itemx -O1
10069 @opindex O
10070 @opindex O1
10071 Optimize.  Optimizing compilation takes somewhat more time, and a lot
10072 more memory for a large function.
10074 With @option{-O}, the compiler tries to reduce code size and execution
10075 time, without performing any optimizations that take a great deal of
10076 compilation time.
10078 @c Note that in addition to the default_options_table list in opts.c,
10079 @c several optimization flags default to true but control optimization
10080 @c passes that are explicitly disabled at -O0.
10082 @option{-O} turns on the following optimization flags:
10084 @c Please keep the following list alphabetized.
10085 @gccoptlist{-fauto-inc-dec @gol
10086 -fbranch-count-reg @gol
10087 -fcombine-stack-adjustments @gol
10088 -fcompare-elim @gol
10089 -fcprop-registers @gol
10090 -fdce @gol
10091 -fdefer-pop @gol
10092 -fdelayed-branch @gol
10093 -fdse @gol
10094 -fforward-propagate @gol
10095 -fguess-branch-probability @gol
10096 -fif-conversion @gol
10097 -fif-conversion2 @gol
10098 -finline-functions-called-once @gol
10099 -fipa-modref @gol
10100 -fipa-profile @gol
10101 -fipa-pure-const @gol
10102 -fipa-reference @gol
10103 -fipa-reference-addressable @gol
10104 -fmerge-constants @gol
10105 -fmove-loop-invariants @gol
10106 -fomit-frame-pointer @gol
10107 -freorder-blocks @gol
10108 -fshrink-wrap @gol
10109 -fshrink-wrap-separate @gol
10110 -fsplit-wide-types @gol
10111 -fssa-backprop @gol
10112 -fssa-phiopt @gol
10113 -ftree-bit-ccp @gol
10114 -ftree-ccp @gol
10115 -ftree-ch @gol
10116 -ftree-coalesce-vars @gol
10117 -ftree-copy-prop @gol
10118 -ftree-dce @gol
10119 -ftree-dominator-opts @gol
10120 -ftree-dse @gol
10121 -ftree-forwprop @gol
10122 -ftree-fre @gol
10123 -ftree-phiprop @gol
10124 -ftree-pta @gol
10125 -ftree-scev-cprop @gol
10126 -ftree-sink @gol
10127 -ftree-slsr @gol
10128 -ftree-sra @gol
10129 -ftree-ter @gol
10130 -funit-at-a-time}
10132 @item -O2
10133 @opindex O2
10134 Optimize even more.  GCC performs nearly all supported optimizations
10135 that do not involve a space-speed tradeoff.
10136 As compared to @option{-O}, this option increases both compilation time
10137 and the performance of the generated code.
10139 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
10140 also turns on the following optimization flags:
10142 @c Please keep the following list alphabetized!
10143 @gccoptlist{-falign-functions  -falign-jumps @gol
10144 -falign-labels  -falign-loops @gol
10145 -fcaller-saves @gol
10146 -fcode-hoisting @gol
10147 -fcrossjumping @gol
10148 -fcse-follow-jumps  -fcse-skip-blocks @gol
10149 -fdelete-null-pointer-checks @gol
10150 -fdevirtualize  -fdevirtualize-speculatively @gol
10151 -fexpensive-optimizations @gol
10152 -ffinite-loops @gol
10153 -fgcse  -fgcse-lm  @gol
10154 -fhoist-adjacent-loads @gol
10155 -finline-functions @gol
10156 -finline-small-functions @gol
10157 -findirect-inlining @gol
10158 -fipa-bit-cp  -fipa-cp  -fipa-icf @gol
10159 -fipa-ra  -fipa-sra  -fipa-vrp @gol
10160 -fisolate-erroneous-paths-dereference @gol
10161 -flra-remat @gol
10162 -foptimize-sibling-calls @gol
10163 -foptimize-strlen @gol
10164 -fpartial-inlining @gol
10165 -fpeephole2 @gol
10166 -freorder-blocks-algorithm=stc @gol
10167 -freorder-blocks-and-partition  -freorder-functions @gol
10168 -frerun-cse-after-loop  @gol
10169 -fschedule-insns  -fschedule-insns2 @gol
10170 -fsched-interblock  -fsched-spec @gol
10171 -fstore-merging @gol
10172 -fstrict-aliasing @gol
10173 -fthread-jumps @gol
10174 -ftree-builtin-call-dce @gol
10175 -ftree-pre @gol
10176 -ftree-switch-conversion  -ftree-tail-merge @gol
10177 -ftree-vrp}
10179 Please note the warning under @option{-fgcse} about
10180 invoking @option{-O2} on programs that use computed gotos.
10182 @item -O3
10183 @opindex O3
10184 Optimize yet more.  @option{-O3} turns on all optimizations specified
10185 by @option{-O2} and also turns on the following optimization flags:
10187 @c Please keep the following list alphabetized!
10188 @gccoptlist{-fgcse-after-reload @gol
10189 -fipa-cp-clone
10190 -floop-interchange @gol
10191 -floop-unroll-and-jam @gol
10192 -fpeel-loops @gol
10193 -fpredictive-commoning @gol
10194 -fsplit-loops @gol
10195 -fsplit-paths @gol
10196 -ftree-loop-distribution @gol
10197 -ftree-loop-vectorize @gol
10198 -ftree-partial-pre @gol
10199 -ftree-slp-vectorize @gol
10200 -funswitch-loops @gol
10201 -fvect-cost-model @gol
10202 -fvect-cost-model=dynamic @gol
10203 -fversion-loops-for-strides}
10205 @item -O0
10206 @opindex O0
10207 Reduce compilation time and make debugging produce the expected
10208 results.  This is the default.
10210 @item -Os
10211 @opindex Os
10212 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations 
10213 except those that often increase code size:
10215 @gccoptlist{-falign-functions  -falign-jumps @gol
10216 -falign-labels  -falign-loops @gol
10217 -fprefetch-loop-arrays  -freorder-blocks-algorithm=stc}
10219 It also enables @option{-finline-functions}, causes the compiler to tune for
10220 code size rather than execution speed, and performs further optimizations
10221 designed to reduce code size.
10223 @item -Ofast
10224 @opindex Ofast
10225 Disregard strict standards compliance.  @option{-Ofast} enables all
10226 @option{-O3} optimizations.  It also enables optimizations that are not
10227 valid for all standard-compliant programs.
10228 It turns on @option{-ffast-math}, @option{-fallow-store-data-races}
10229 and the Fortran-specific @option{-fstack-arrays}, unless
10230 @option{-fmax-stack-var-size} is specified, and @option{-fno-protect-parens}.
10232 @item -Og
10233 @opindex Og
10234 Optimize debugging experience.  @option{-Og} should be the optimization
10235 level of choice for the standard edit-compile-debug cycle, offering
10236 a reasonable level of optimization while maintaining fast compilation
10237 and a good debugging experience.  It is a better choice than @option{-O0}
10238 for producing debuggable code because some compiler passes
10239 that collect debug information are disabled at @option{-O0}.
10241 Like @option{-O0}, @option{-Og} completely disables a number of 
10242 optimization passes so that individual options controlling them have
10243 no effect.  Otherwise @option{-Og} enables all @option{-O1} 
10244 optimization flags except for those that may interfere with debugging:
10246 @gccoptlist{-fbranch-count-reg  -fdelayed-branch @gol
10247 -fdse  -fif-conversion  -fif-conversion2  @gol
10248 -finline-functions-called-once @gol
10249 -fmove-loop-invariants  -fssa-phiopt @gol
10250 -ftree-bit-ccp  -ftree-dse  -ftree-pta  -ftree-sra}
10252 @end table
10254 If you use multiple @option{-O} options, with or without level numbers,
10255 the last such option is the one that is effective.
10257 Options of the form @option{-f@var{flag}} specify machine-independent
10258 flags.  Most flags have both positive and negative forms; the negative
10259 form of @option{-ffoo} is @option{-fno-foo}.  In the table
10260 below, only one of the forms is listed---the one you typically 
10261 use.  You can figure out the other form by either removing @samp{no-}
10262 or adding it.
10264 The following options control specific optimizations.  They are either
10265 activated by @option{-O} options or are related to ones that are.  You
10266 can use the following flags in the rare cases when ``fine-tuning'' of
10267 optimizations to be performed is desired.
10269 @table @gcctabopt
10270 @item -fno-defer-pop
10271 @opindex fno-defer-pop
10272 @opindex fdefer-pop
10273 For machines that must pop arguments after a function call, always pop 
10274 the arguments as soon as each function returns.  
10275 At levels @option{-O1} and higher, @option{-fdefer-pop} is the default;
10276 this allows the compiler to let arguments accumulate on the stack for several
10277 function calls and pop them all at once.
10279 @item -fforward-propagate
10280 @opindex fforward-propagate
10281 Perform a forward propagation pass on RTL@.  The pass tries to combine two
10282 instructions and checks if the result can be simplified.  If loop unrolling
10283 is active, two passes are performed and the second is scheduled after
10284 loop unrolling.
10286 This option is enabled by default at optimization levels @option{-O},
10287 @option{-O2}, @option{-O3}, @option{-Os}.
10289 @item -ffp-contract=@var{style}
10290 @opindex ffp-contract
10291 @option{-ffp-contract=off} disables floating-point expression contraction.
10292 @option{-ffp-contract=fast} enables floating-point expression contraction
10293 such as forming of fused multiply-add operations if the target has
10294 native support for them.
10295 @option{-ffp-contract=on} enables floating-point expression contraction
10296 if allowed by the language standard.  This is currently not implemented
10297 and treated equal to @option{-ffp-contract=off}.
10299 The default is @option{-ffp-contract=fast}.
10301 @item -fomit-frame-pointer
10302 @opindex fomit-frame-pointer
10303 Omit the frame pointer in functions that don't need one.  This avoids the
10304 instructions to save, set up and restore the frame pointer; on many targets
10305 it also makes an extra register available.
10307 On some targets this flag has no effect because the standard calling sequence
10308 always uses a frame pointer, so it cannot be omitted.
10310 Note that @option{-fno-omit-frame-pointer} doesn't guarantee the frame pointer
10311 is used in all functions.  Several targets always omit the frame pointer in
10312 leaf functions.
10314 Enabled by default at @option{-O} and higher.
10316 @item -foptimize-sibling-calls
10317 @opindex foptimize-sibling-calls
10318 Optimize sibling and tail recursive calls.
10320 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10322 @item -foptimize-strlen
10323 @opindex foptimize-strlen
10324 Optimize various standard C string functions (e.g.@: @code{strlen},
10325 @code{strchr} or @code{strcpy}) and
10326 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
10328 Enabled at levels @option{-O2}, @option{-O3}.
10330 @item -fno-inline
10331 @opindex fno-inline
10332 @opindex finline
10333 Do not expand any functions inline apart from those marked with
10334 the @code{always_inline} attribute.  This is the default when not
10335 optimizing.
10337 Single functions can be exempted from inlining by marking them
10338 with the @code{noinline} attribute.
10340 @item -finline-small-functions
10341 @opindex finline-small-functions
10342 Integrate functions into their callers when their body is smaller than expected
10343 function call code (so overall size of program gets smaller).  The compiler
10344 heuristically decides which functions are simple enough to be worth integrating
10345 in this way.  This inlining applies to all functions, even those not declared
10346 inline.
10348 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10350 @item -findirect-inlining
10351 @opindex findirect-inlining
10352 Inline also indirect calls that are discovered to be known at compile
10353 time thanks to previous inlining.  This option has any effect only
10354 when inlining itself is turned on by the @option{-finline-functions}
10355 or @option{-finline-small-functions} options.
10357 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10359 @item -finline-functions
10360 @opindex finline-functions
10361 Consider all functions for inlining, even if they are not declared inline.
10362 The compiler heuristically decides which functions are worth integrating
10363 in this way.
10365 If all calls to a given function are integrated, and the function is
10366 declared @code{static}, then the function is normally not output as
10367 assembler code in its own right.
10369 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.  Also enabled
10370 by @option{-fprofile-use} and @option{-fauto-profile}.
10372 @item -finline-functions-called-once
10373 @opindex finline-functions-called-once
10374 Consider all @code{static} functions called once for inlining into their
10375 caller even if they are not marked @code{inline}.  If a call to a given
10376 function is integrated, then the function is not output as assembler code
10377 in its own right.
10379 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os},
10380 but not @option{-Og}.
10382 @item -fearly-inlining
10383 @opindex fearly-inlining
10384 Inline functions marked by @code{always_inline} and functions whose body seems
10385 smaller than the function call overhead early before doing
10386 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
10387 makes profiling significantly cheaper and usually inlining faster on programs
10388 having large chains of nested wrapper functions.
10390 Enabled by default.
10392 @item -fipa-sra
10393 @opindex fipa-sra
10394 Perform interprocedural scalar replacement of aggregates, removal of
10395 unused parameters and replacement of parameters passed by reference
10396 by parameters passed by value.
10398 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
10400 @item -finline-limit=@var{n}
10401 @opindex finline-limit
10402 By default, GCC limits the size of functions that can be inlined.  This flag
10403 allows coarse control of this limit.  @var{n} is the size of functions that
10404 can be inlined in number of pseudo instructions.
10406 Inlining is actually controlled by a number of parameters, which may be
10407 specified individually by using @option{--param @var{name}=@var{value}}.
10408 The @option{-finline-limit=@var{n}} option sets some of these parameters
10409 as follows:
10411 @table @gcctabopt
10412 @item max-inline-insns-single
10413 is set to @var{n}/2.
10414 @item max-inline-insns-auto
10415 is set to @var{n}/2.
10416 @end table
10418 See below for a documentation of the individual
10419 parameters controlling inlining and for the defaults of these parameters.
10421 @emph{Note:} there may be no value to @option{-finline-limit} that results
10422 in default behavior.
10424 @emph{Note:} pseudo instruction represents, in this particular context, an
10425 abstract measurement of function's size.  In no way does it represent a count
10426 of assembly instructions and as such its exact meaning might change from one
10427 release to an another.
10429 @item -fno-keep-inline-dllexport
10430 @opindex fno-keep-inline-dllexport
10431 @opindex fkeep-inline-dllexport
10432 This is a more fine-grained version of @option{-fkeep-inline-functions},
10433 which applies only to functions that are declared using the @code{dllexport}
10434 attribute or declspec.  @xref{Function Attributes,,Declaring Attributes of
10435 Functions}.
10437 @item -fkeep-inline-functions
10438 @opindex fkeep-inline-functions
10439 In C, emit @code{static} functions that are declared @code{inline}
10440 into the object file, even if the function has been inlined into all
10441 of its callers.  This switch does not affect functions using the
10442 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
10443 inline functions into the object file.
10445 @item -fkeep-static-functions
10446 @opindex fkeep-static-functions
10447 Emit @code{static} functions into the object file, even if the function
10448 is never used.
10450 @item -fkeep-static-consts
10451 @opindex fkeep-static-consts
10452 Emit variables declared @code{static const} when optimization isn't turned
10453 on, even if the variables aren't referenced.
10455 GCC enables this option by default.  If you want to force the compiler to
10456 check if a variable is referenced, regardless of whether or not
10457 optimization is turned on, use the @option{-fno-keep-static-consts} option.
10459 @item -fmerge-constants
10460 @opindex fmerge-constants
10461 Attempt to merge identical constants (string constants and floating-point
10462 constants) across compilation units.
10464 This option is the default for optimized compilation if the assembler and
10465 linker support it.  Use @option{-fno-merge-constants} to inhibit this
10466 behavior.
10468 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
10470 @item -fmerge-all-constants
10471 @opindex fmerge-all-constants
10472 Attempt to merge identical constants and identical variables.
10474 This option implies @option{-fmerge-constants}.  In addition to
10475 @option{-fmerge-constants} this considers e.g.@: even constant initialized
10476 arrays or initialized constant variables with integral or floating-point
10477 types.  Languages like C or C++ require each variable, including multiple
10478 instances of the same variable in recursive calls, to have distinct locations,
10479 so using this option results in non-conforming
10480 behavior.
10482 @item -fmodulo-sched
10483 @opindex fmodulo-sched
10484 Perform swing modulo scheduling immediately before the first scheduling
10485 pass.  This pass looks at innermost loops and reorders their
10486 instructions by overlapping different iterations.
10488 @item -fmodulo-sched-allow-regmoves
10489 @opindex fmodulo-sched-allow-regmoves
10490 Perform more aggressive SMS-based modulo scheduling with register moves
10491 allowed.  By setting this flag certain anti-dependences edges are
10492 deleted, which triggers the generation of reg-moves based on the
10493 life-range analysis.  This option is effective only with
10494 @option{-fmodulo-sched} enabled.
10496 @item -fno-branch-count-reg
10497 @opindex fno-branch-count-reg
10498 @opindex fbranch-count-reg
10499 Disable the optimization pass that scans for opportunities to use 
10500 ``decrement and branch'' instructions on a count register instead of
10501 instruction sequences that decrement a register, compare it against zero, and
10502 then branch based upon the result.  This option is only meaningful on
10503 architectures that support such instructions, which include x86, PowerPC,
10504 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
10505 doesn't remove the decrement and branch instructions from the generated
10506 instruction stream introduced by other optimization passes.
10508 The default is @option{-fbranch-count-reg} at @option{-O1} and higher,
10509 except for @option{-Og}.
10511 @item -fno-function-cse
10512 @opindex fno-function-cse
10513 @opindex ffunction-cse
10514 Do not put function addresses in registers; make each instruction that
10515 calls a constant function contain the function's address explicitly.
10517 This option results in less efficient code, but some strange hacks
10518 that alter the assembler output may be confused by the optimizations
10519 performed when this option is not used.
10521 The default is @option{-ffunction-cse}
10523 @item -fno-zero-initialized-in-bss
10524 @opindex fno-zero-initialized-in-bss
10525 @opindex fzero-initialized-in-bss
10526 If the target supports a BSS section, GCC by default puts variables that
10527 are initialized to zero into BSS@.  This can save space in the resulting
10528 code.
10530 This option turns off this behavior because some programs explicitly
10531 rely on variables going to the data section---e.g., so that the
10532 resulting executable can find the beginning of that section and/or make
10533 assumptions based on that.
10535 The default is @option{-fzero-initialized-in-bss}.
10537 @item -fthread-jumps
10538 @opindex fthread-jumps
10539 Perform optimizations that check to see if a jump branches to a
10540 location where another comparison subsumed by the first is found.  If
10541 so, the first branch is redirected to either the destination of the
10542 second branch or a point immediately following it, depending on whether
10543 the condition is known to be true or false.
10545 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10547 @item -fsplit-wide-types
10548 @opindex fsplit-wide-types
10549 When using a type that occupies multiple registers, such as @code{long
10550 long} on a 32-bit system, split the registers apart and allocate them
10551 independently.  This normally generates better code for those types,
10552 but may make debugging more difficult.
10554 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
10555 @option{-Os}.
10557 @item -fsplit-wide-types-early
10558 @opindex fsplit-wide-types-early
10559 Fully split wide types early, instead of very late.
10560 This option has no effect unless @option{-fsplit-wide-types} is turned on.
10562 This is the default on some targets.
10564 @item -fcse-follow-jumps
10565 @opindex fcse-follow-jumps
10566 In common subexpression elimination (CSE), scan through jump instructions
10567 when the target of the jump is not reached by any other path.  For
10568 example, when CSE encounters an @code{if} statement with an
10569 @code{else} clause, CSE follows the jump when the condition
10570 tested is false.
10572 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10574 @item -fcse-skip-blocks
10575 @opindex fcse-skip-blocks
10576 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
10577 follow jumps that conditionally skip over blocks.  When CSE
10578 encounters a simple @code{if} statement with no else clause,
10579 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
10580 body of the @code{if}.
10582 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10584 @item -frerun-cse-after-loop
10585 @opindex frerun-cse-after-loop
10586 Re-run common subexpression elimination after loop optimizations are
10587 performed.
10589 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10591 @item -fgcse
10592 @opindex fgcse
10593 Perform a global common subexpression elimination pass.
10594 This pass also performs global constant and copy propagation.
10596 @emph{Note:} When compiling a program using computed gotos, a GCC
10597 extension, you may get better run-time performance if you disable
10598 the global common subexpression elimination pass by adding
10599 @option{-fno-gcse} to the command line.
10601 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10603 @item -fgcse-lm
10604 @opindex fgcse-lm
10605 When @option{-fgcse-lm} is enabled, global common subexpression elimination
10606 attempts to move loads that are only killed by stores into themselves.  This
10607 allows a loop containing a load/store sequence to be changed to a load outside
10608 the loop, and a copy/store within the loop.
10610 Enabled by default when @option{-fgcse} is enabled.
10612 @item -fgcse-sm
10613 @opindex fgcse-sm
10614 When @option{-fgcse-sm} is enabled, a store motion pass is run after
10615 global common subexpression elimination.  This pass attempts to move
10616 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
10617 loops containing a load/store sequence can be changed to a load before
10618 the loop and a store after the loop.
10620 Not enabled at any optimization level.
10622 @item -fgcse-las
10623 @opindex fgcse-las
10624 When @option{-fgcse-las} is enabled, the global common subexpression
10625 elimination pass eliminates redundant loads that come after stores to the
10626 same memory location (both partial and full redundancies).
10628 Not enabled at any optimization level.
10630 @item -fgcse-after-reload
10631 @opindex fgcse-after-reload
10632 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
10633 pass is performed after reload.  The purpose of this pass is to clean up
10634 redundant spilling.
10636 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10638 @item -faggressive-loop-optimizations
10639 @opindex faggressive-loop-optimizations
10640 This option tells the loop optimizer to use language constraints to
10641 derive bounds for the number of iterations of a loop.  This assumes that
10642 loop code does not invoke undefined behavior by for example causing signed
10643 integer overflows or out-of-bound array accesses.  The bounds for the
10644 number of iterations of a loop are used to guide loop unrolling and peeling
10645 and loop exit test optimizations.
10646 This option is enabled by default.
10648 @item -funconstrained-commons
10649 @opindex funconstrained-commons
10650 This option tells the compiler that variables declared in common blocks
10651 (e.g.@: Fortran) may later be overridden with longer trailing arrays. This
10652 prevents certain optimizations that depend on knowing the array bounds.
10654 @item -fcrossjumping
10655 @opindex fcrossjumping
10656 Perform cross-jumping transformation.
10657 This transformation unifies equivalent code and saves code size.  The
10658 resulting code may or may not perform better than without cross-jumping.
10660 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10662 @item -fauto-inc-dec
10663 @opindex fauto-inc-dec
10664 Combine increments or decrements of addresses with memory accesses.
10665 This pass is always skipped on architectures that do not have
10666 instructions to support this.  Enabled by default at @option{-O} and
10667 higher on architectures that support this.
10669 @item -fdce
10670 @opindex fdce
10671 Perform dead code elimination (DCE) on RTL@.
10672 Enabled by default at @option{-O} and higher.
10674 @item -fdse
10675 @opindex fdse
10676 Perform dead store elimination (DSE) on RTL@.
10677 Enabled by default at @option{-O} and higher.
10679 @item -fif-conversion
10680 @opindex fif-conversion
10681 Attempt to transform conditional jumps into branch-less equivalents.  This
10682 includes use of conditional moves, min, max, set flags and abs instructions, and
10683 some tricks doable by standard arithmetics.  The use of conditional execution
10684 on chips where it is available is controlled by @option{-fif-conversion2}.
10686 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}, but
10687 not with @option{-Og}.
10689 @item -fif-conversion2
10690 @opindex fif-conversion2
10691 Use conditional execution (where available) to transform conditional jumps into
10692 branch-less equivalents.
10694 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}, but
10695 not with @option{-Og}.
10697 @item -fdeclone-ctor-dtor
10698 @opindex fdeclone-ctor-dtor
10699 The C++ ABI requires multiple entry points for constructors and
10700 destructors: one for a base subobject, one for a complete object, and
10701 one for a virtual destructor that calls operator delete afterwards.
10702 For a hierarchy with virtual bases, the base and complete variants are
10703 clones, which means two copies of the function.  With this option, the
10704 base and complete variants are changed to be thunks that call a common
10705 implementation.
10707 Enabled by @option{-Os}.
10709 @item -fdelete-null-pointer-checks
10710 @opindex fdelete-null-pointer-checks
10711 Assume that programs cannot safely dereference null pointers, and that
10712 no code or data element resides at address zero.
10713 This option enables simple constant
10714 folding optimizations at all optimization levels.  In addition, other
10715 optimization passes in GCC use this flag to control global dataflow
10716 analyses that eliminate useless checks for null pointers; these assume
10717 that a memory access to address zero always results in a trap, so
10718 that if a pointer is checked after it has already been dereferenced,
10719 it cannot be null.
10721 Note however that in some environments this assumption is not true.
10722 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
10723 for programs that depend on that behavior.
10725 This option is enabled by default on most targets.  On Nios II ELF, it
10726 defaults to off.  On AVR, CR16, and MSP430, this option is completely disabled.
10728 Passes that use the dataflow information
10729 are enabled independently at different optimization levels.
10731 @item -fdevirtualize
10732 @opindex fdevirtualize
10733 Attempt to convert calls to virtual functions to direct calls.  This
10734 is done both within a procedure and interprocedurally as part of
10735 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
10736 propagation (@option{-fipa-cp}).
10737 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10739 @item -fdevirtualize-speculatively
10740 @opindex fdevirtualize-speculatively
10741 Attempt to convert calls to virtual functions to speculative direct calls.
10742 Based on the analysis of the type inheritance graph, determine for a given call
10743 the set of likely targets. If the set is small, preferably of size 1, change
10744 the call into a conditional deciding between direct and indirect calls.  The
10745 speculative calls enable more optimizations, such as inlining.  When they seem
10746 useless after further optimization, they are converted back into original form.
10748 @item -fdevirtualize-at-ltrans
10749 @opindex fdevirtualize-at-ltrans
10750 Stream extra information needed for aggressive devirtualization when running
10751 the link-time optimizer in local transformation mode.  
10752 This option enables more devirtualization but
10753 significantly increases the size of streamed data. For this reason it is
10754 disabled by default.
10756 @item -fexpensive-optimizations
10757 @opindex fexpensive-optimizations
10758 Perform a number of minor optimizations that are relatively expensive.
10760 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10762 @item -free
10763 @opindex free
10764 Attempt to remove redundant extension instructions.  This is especially
10765 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
10766 registers after writing to their lower 32-bit half.
10768 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
10769 @option{-O3}, @option{-Os}.
10771 @item -fno-lifetime-dse
10772 @opindex fno-lifetime-dse
10773 @opindex flifetime-dse
10774 In C++ the value of an object is only affected by changes within its
10775 lifetime: when the constructor begins, the object has an indeterminate
10776 value, and any changes during the lifetime of the object are dead when
10777 the object is destroyed.  Normally dead store elimination will take
10778 advantage of this; if your code relies on the value of the object
10779 storage persisting beyond the lifetime of the object, you can use this
10780 flag to disable this optimization.  To preserve stores before the
10781 constructor starts (e.g.@: because your operator new clears the object
10782 storage) but still treat the object as dead after the destructor, you
10783 can use @option{-flifetime-dse=1}.  The default behavior can be
10784 explicitly selected with @option{-flifetime-dse=2}.
10785 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
10787 @item -flive-range-shrinkage
10788 @opindex flive-range-shrinkage
10789 Attempt to decrease register pressure through register live range
10790 shrinkage.  This is helpful for fast processors with small or moderate
10791 size register sets.
10793 @item -fira-algorithm=@var{algorithm}
10794 @opindex fira-algorithm
10795 Use the specified coloring algorithm for the integrated register
10796 allocator.  The @var{algorithm} argument can be @samp{priority}, which
10797 specifies Chow's priority coloring, or @samp{CB}, which specifies
10798 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
10799 for all architectures, but for those targets that do support it, it is
10800 the default because it generates better code.
10802 @item -fira-region=@var{region}
10803 @opindex fira-region
10804 Use specified regions for the integrated register allocator.  The
10805 @var{region} argument should be one of the following:
10807 @table @samp
10809 @item all
10810 Use all loops as register allocation regions.
10811 This can give the best results for machines with a small and/or
10812 irregular register set.
10814 @item mixed
10815 Use all loops except for loops with small register pressure 
10816 as the regions.  This value usually gives
10817 the best results in most cases and for most architectures,
10818 and is enabled by default when compiling with optimization for speed
10819 (@option{-O}, @option{-O2}, @dots{}).
10821 @item one
10822 Use all functions as a single region.  
10823 This typically results in the smallest code size, and is enabled by default for
10824 @option{-Os} or @option{-O0}.
10826 @end table
10828 @item -fira-hoist-pressure
10829 @opindex fira-hoist-pressure
10830 Use IRA to evaluate register pressure in the code hoisting pass for
10831 decisions to hoist expressions.  This option usually results in smaller
10832 code, but it can slow the compiler down.
10834 This option is enabled at level @option{-Os} for all targets.
10836 @item -fira-loop-pressure
10837 @opindex fira-loop-pressure
10838 Use IRA to evaluate register pressure in loops for decisions to move
10839 loop invariants.  This option usually results in generation
10840 of faster and smaller code on machines with large register files (>= 32
10841 registers), but it can slow the compiler down.
10843 This option is enabled at level @option{-O3} for some targets.
10845 @item -fno-ira-share-save-slots
10846 @opindex fno-ira-share-save-slots
10847 @opindex fira-share-save-slots
10848 Disable sharing of stack slots used for saving call-used hard
10849 registers living through a call.  Each hard register gets a
10850 separate stack slot, and as a result function stack frames are
10851 larger.
10853 @item -fno-ira-share-spill-slots
10854 @opindex fno-ira-share-spill-slots
10855 @opindex fira-share-spill-slots
10856 Disable sharing of stack slots allocated for pseudo-registers.  Each
10857 pseudo-register that does not get a hard register gets a separate
10858 stack slot, and as a result function stack frames are larger.
10860 @item -flra-remat
10861 @opindex flra-remat
10862 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
10863 values of spilled pseudos, LRA tries to rematerialize (recalculate)
10864 values if it is profitable.
10866 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10868 @item -fdelayed-branch
10869 @opindex fdelayed-branch
10870 If supported for the target machine, attempt to reorder instructions
10871 to exploit instruction slots available after delayed branch
10872 instructions.
10874 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os},
10875 but not at @option{-Og}.
10877 @item -fschedule-insns
10878 @opindex fschedule-insns
10879 If supported for the target machine, attempt to reorder instructions to
10880 eliminate execution stalls due to required data being unavailable.  This
10881 helps machines that have slow floating point or memory load instructions
10882 by allowing other instructions to be issued until the result of the load
10883 or floating-point instruction is required.
10885 Enabled at levels @option{-O2}, @option{-O3}.
10887 @item -fschedule-insns2
10888 @opindex fschedule-insns2
10889 Similar to @option{-fschedule-insns}, but requests an additional pass of
10890 instruction scheduling after register allocation has been done.  This is
10891 especially useful on machines with a relatively small number of
10892 registers and where memory load instructions take more than one cycle.
10894 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10896 @item -fno-sched-interblock
10897 @opindex fno-sched-interblock
10898 @opindex fsched-interblock
10899 Disable instruction scheduling across basic blocks, which
10900 is normally enabled when scheduling before register allocation, i.e.@:
10901 with @option{-fschedule-insns} or at @option{-O2} or higher.
10903 @item -fno-sched-spec
10904 @opindex fno-sched-spec
10905 @opindex fsched-spec
10906 Disable speculative motion of non-load instructions, which
10907 is normally enabled when scheduling before register allocation, i.e.@:
10908 with @option{-fschedule-insns} or at @option{-O2} or higher.
10910 @item -fsched-pressure
10911 @opindex fsched-pressure
10912 Enable register pressure sensitive insn scheduling before register
10913 allocation.  This only makes sense when scheduling before register
10914 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
10915 @option{-O2} or higher.  Usage of this option can improve the
10916 generated code and decrease its size by preventing register pressure
10917 increase above the number of available hard registers and subsequent
10918 spills in register allocation.
10920 @item -fsched-spec-load
10921 @opindex fsched-spec-load
10922 Allow speculative motion of some load instructions.  This only makes
10923 sense when scheduling before register allocation, i.e.@: with
10924 @option{-fschedule-insns} or at @option{-O2} or higher.
10926 @item -fsched-spec-load-dangerous
10927 @opindex fsched-spec-load-dangerous
10928 Allow speculative motion of more load instructions.  This only makes
10929 sense when scheduling before register allocation, i.e.@: with
10930 @option{-fschedule-insns} or at @option{-O2} or higher.
10932 @item -fsched-stalled-insns
10933 @itemx -fsched-stalled-insns=@var{n}
10934 @opindex fsched-stalled-insns
10935 Define how many insns (if any) can be moved prematurely from the queue
10936 of stalled insns into the ready list during the second scheduling pass.
10937 @option{-fno-sched-stalled-insns} means that no insns are moved
10938 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
10939 on how many queued insns can be moved prematurely.
10940 @option{-fsched-stalled-insns} without a value is equivalent to
10941 @option{-fsched-stalled-insns=1}.
10943 @item -fsched-stalled-insns-dep
10944 @itemx -fsched-stalled-insns-dep=@var{n}
10945 @opindex fsched-stalled-insns-dep
10946 Define how many insn groups (cycles) are examined for a dependency
10947 on a stalled insn that is a candidate for premature removal from the queue
10948 of stalled insns.  This has an effect only during the second scheduling pass,
10949 and only if @option{-fsched-stalled-insns} is used.
10950 @option{-fno-sched-stalled-insns-dep} is equivalent to
10951 @option{-fsched-stalled-insns-dep=0}.
10952 @option{-fsched-stalled-insns-dep} without a value is equivalent to
10953 @option{-fsched-stalled-insns-dep=1}.
10955 @item -fsched2-use-superblocks
10956 @opindex fsched2-use-superblocks
10957 When scheduling after register allocation, use superblock scheduling.
10958 This allows motion across basic block boundaries,
10959 resulting in faster schedules.  This option is experimental, as not all machine
10960 descriptions used by GCC model the CPU closely enough to avoid unreliable
10961 results from the algorithm.
10963 This only makes sense when scheduling after register allocation, i.e.@: with
10964 @option{-fschedule-insns2} or at @option{-O2} or higher.
10966 @item -fsched-group-heuristic
10967 @opindex fsched-group-heuristic
10968 Enable the group heuristic in the scheduler.  This heuristic favors
10969 the instruction that belongs to a schedule group.  This is enabled
10970 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
10971 or @option{-fschedule-insns2} or at @option{-O2} or higher.
10973 @item -fsched-critical-path-heuristic
10974 @opindex fsched-critical-path-heuristic
10975 Enable the critical-path heuristic in the scheduler.  This heuristic favors
10976 instructions on the critical path.  This is enabled by default when
10977 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
10978 or @option{-fschedule-insns2} or at @option{-O2} or higher.
10980 @item -fsched-spec-insn-heuristic
10981 @opindex fsched-spec-insn-heuristic
10982 Enable the speculative instruction heuristic in the scheduler.  This
10983 heuristic favors speculative instructions with greater dependency weakness.
10984 This is enabled by default when scheduling is enabled, i.e.@:
10985 with @option{-fschedule-insns} or @option{-fschedule-insns2}
10986 or at @option{-O2} or higher.
10988 @item -fsched-rank-heuristic
10989 @opindex fsched-rank-heuristic
10990 Enable the rank heuristic in the scheduler.  This heuristic favors
10991 the instruction belonging to a basic block with greater size or frequency.
10992 This is enabled by default when scheduling is enabled, i.e.@:
10993 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
10994 at @option{-O2} or higher.
10996 @item -fsched-last-insn-heuristic
10997 @opindex fsched-last-insn-heuristic
10998 Enable the last-instruction heuristic in the scheduler.  This heuristic
10999 favors the instruction that is less dependent on the last instruction
11000 scheduled.  This is enabled by default when scheduling is enabled,
11001 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
11002 at @option{-O2} or higher.
11004 @item -fsched-dep-count-heuristic
11005 @opindex fsched-dep-count-heuristic
11006 Enable the dependent-count heuristic in the scheduler.  This heuristic
11007 favors the instruction that has more instructions depending on it.
11008 This is enabled by default when scheduling is enabled, i.e.@:
11009 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
11010 at @option{-O2} or higher.
11012 @item -freschedule-modulo-scheduled-loops
11013 @opindex freschedule-modulo-scheduled-loops
11014 Modulo scheduling is performed before traditional scheduling.  If a loop
11015 is modulo scheduled, later scheduling passes may change its schedule.  
11016 Use this option to control that behavior.
11018 @item -fselective-scheduling
11019 @opindex fselective-scheduling
11020 Schedule instructions using selective scheduling algorithm.  Selective
11021 scheduling runs instead of the first scheduler pass.
11023 @item -fselective-scheduling2
11024 @opindex fselective-scheduling2
11025 Schedule instructions using selective scheduling algorithm.  Selective
11026 scheduling runs instead of the second scheduler pass.
11028 @item -fsel-sched-pipelining
11029 @opindex fsel-sched-pipelining
11030 Enable software pipelining of innermost loops during selective scheduling.
11031 This option has no effect unless one of @option{-fselective-scheduling} or
11032 @option{-fselective-scheduling2} is turned on.
11034 @item -fsel-sched-pipelining-outer-loops
11035 @opindex fsel-sched-pipelining-outer-loops
11036 When pipelining loops during selective scheduling, also pipeline outer loops.
11037 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
11039 @item -fsemantic-interposition
11040 @opindex fsemantic-interposition
11041 Some object formats, like ELF, allow interposing of symbols by the 
11042 dynamic linker.
11043 This means that for symbols exported from the DSO, the compiler cannot perform
11044 interprocedural propagation, inlining and other optimizations in anticipation
11045 that the function or variable in question may change. While this feature is
11046 useful, for example, to rewrite memory allocation functions by a debugging
11047 implementation, it is expensive in the terms of code quality.
11048 With @option{-fno-semantic-interposition} the compiler assumes that 
11049 if interposition happens for functions the overwriting function will have 
11050 precisely the same semantics (and side effects). 
11051 Similarly if interposition happens
11052 for variables, the constructor of the variable will be the same. The flag
11053 has no effect for functions explicitly declared inline 
11054 (where it is never allowed for interposition to change semantics) 
11055 and for symbols explicitly declared weak.
11057 @item -fshrink-wrap
11058 @opindex fshrink-wrap
11059 Emit function prologues only before parts of the function that need it,
11060 rather than at the top of the function.  This flag is enabled by default at
11061 @option{-O} and higher.
11063 @item -fshrink-wrap-separate
11064 @opindex fshrink-wrap-separate
11065 Shrink-wrap separate parts of the prologue and epilogue separately, so that
11066 those parts are only executed when needed.
11067 This option is on by default, but has no effect unless @option{-fshrink-wrap}
11068 is also turned on and the target supports this.
11070 @item -fcaller-saves
11071 @opindex fcaller-saves
11072 Enable allocation of values to registers that are clobbered by
11073 function calls, by emitting extra instructions to save and restore the
11074 registers around such calls.  Such allocation is done only when it
11075 seems to result in better code.
11077 This option is always enabled by default on certain machines, usually
11078 those which have no call-preserved registers to use instead.
11080 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
11082 @item -fcombine-stack-adjustments
11083 @opindex fcombine-stack-adjustments
11084 Tracks stack adjustments (pushes and pops) and stack memory references
11085 and then tries to find ways to combine them.
11087 Enabled by default at @option{-O1} and higher.
11089 @item -fipa-ra
11090 @opindex fipa-ra
11091 Use caller save registers for allocation if those registers are not used by
11092 any called function.  In that case it is not necessary to save and restore
11093 them around calls.  This is only possible if called functions are part of
11094 same compilation unit as current function and they are compiled before it.
11096 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}, however the option
11097 is disabled if generated code will be instrumented for profiling
11098 (@option{-p}, or @option{-pg}) or if callee's register usage cannot be known
11099 exactly (this happens on targets that do not expose prologues
11100 and epilogues in RTL).
11102 @item -fconserve-stack
11103 @opindex fconserve-stack
11104 Attempt to minimize stack usage.  The compiler attempts to use less
11105 stack space, even if that makes the program slower.  This option
11106 implies setting the @option{large-stack-frame} parameter to 100
11107 and the @option{large-stack-frame-growth} parameter to 400.
11109 @item -ftree-reassoc
11110 @opindex ftree-reassoc
11111 Perform reassociation on trees.  This flag is enabled by default
11112 at @option{-O} and higher.
11114 @item -fcode-hoisting
11115 @opindex fcode-hoisting
11116 Perform code hoisting.  Code hoisting tries to move the
11117 evaluation of expressions executed on all paths to the function exit
11118 as early as possible.  This is especially useful as a code size
11119 optimization, but it often helps for code speed as well.
11120 This flag is enabled by default at @option{-O2} and higher.
11122 @item -ftree-pre
11123 @opindex ftree-pre
11124 Perform partial redundancy elimination (PRE) on trees.  This flag is
11125 enabled by default at @option{-O2} and @option{-O3}.
11127 @item -ftree-partial-pre
11128 @opindex ftree-partial-pre
11129 Make partial redundancy elimination (PRE) more aggressive.  This flag is
11130 enabled by default at @option{-O3}.
11132 @item -ftree-forwprop
11133 @opindex ftree-forwprop
11134 Perform forward propagation on trees.  This flag is enabled by default
11135 at @option{-O} and higher.
11137 @item -ftree-fre
11138 @opindex ftree-fre
11139 Perform full redundancy elimination (FRE) on trees.  The difference
11140 between FRE and PRE is that FRE only considers expressions
11141 that are computed on all paths leading to the redundant computation.
11142 This analysis is faster than PRE, though it exposes fewer redundancies.
11143 This flag is enabled by default at @option{-O} and higher.
11145 @item -ftree-phiprop
11146 @opindex ftree-phiprop
11147 Perform hoisting of loads from conditional pointers on trees.  This
11148 pass is enabled by default at @option{-O} and higher.
11150 @item -fhoist-adjacent-loads
11151 @opindex fhoist-adjacent-loads
11152 Speculatively hoist loads from both branches of an if-then-else if the
11153 loads are from adjacent locations in the same structure and the target
11154 architecture has a conditional move instruction.  This flag is enabled
11155 by default at @option{-O2} and higher.
11157 @item -ftree-copy-prop
11158 @opindex ftree-copy-prop
11159 Perform copy propagation on trees.  This pass eliminates unnecessary
11160 copy operations.  This flag is enabled by default at @option{-O} and
11161 higher.
11163 @item -fipa-pure-const
11164 @opindex fipa-pure-const
11165 Discover which functions are pure or constant.
11166 Enabled by default at @option{-O} and higher.
11168 @item -fipa-reference
11169 @opindex fipa-reference
11170 Discover which static variables do not escape the
11171 compilation unit.
11172 Enabled by default at @option{-O} and higher.
11174 @item -fipa-reference-addressable
11175 @opindex fipa-reference-addressable
11176 Discover read-only, write-only and non-addressable static variables.
11177 Enabled by default at @option{-O} and higher.
11179 @item -fipa-stack-alignment
11180 @opindex fipa-stack-alignment
11181 Reduce stack alignment on call sites if possible.
11182 Enabled by default.
11184 @item -fipa-pta
11185 @opindex fipa-pta
11186 Perform interprocedural pointer analysis and interprocedural modification
11187 and reference analysis.  This option can cause excessive memory and
11188 compile-time usage on large compilation units.  It is not enabled by
11189 default at any optimization level.
11191 @item -fipa-profile
11192 @opindex fipa-profile
11193 Perform interprocedural profile propagation.  The functions called only from
11194 cold functions are marked as cold. Also functions executed once (such as
11195 @code{cold}, @code{noreturn}, static constructors or destructors) are
11196 identified. Cold functions and loop less parts of functions executed once are
11197 then optimized for size.
11198 Enabled by default at @option{-O} and higher.
11200 @item -fipa-modref
11201 @opindex fipa-modref
11202 Perform interprocedural mod/ref analysis.  This optimization analyzes the side
11203 effects of functions (memory locations that are modified or referenced) and
11204 enables better optimization across the function call boundary.  This flag is
11205 enabled by default at @option{-O} and higher.
11207 @item -fipa-cp
11208 @opindex fipa-cp
11209 Perform interprocedural constant propagation.
11210 This optimization analyzes the program to determine when values passed
11211 to functions are constants and then optimizes accordingly.
11212 This optimization can substantially increase performance
11213 if the application has constants passed to functions.
11214 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
11215 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11217 @item -fipa-cp-clone
11218 @opindex fipa-cp-clone
11219 Perform function cloning to make interprocedural constant propagation stronger.
11220 When enabled, interprocedural constant propagation performs function cloning
11221 when externally visible function can be called with constant arguments.
11222 Because this optimization can create multiple copies of functions,
11223 it may significantly increase code size
11224 (see @option{--param ipa-cp-unit-growth=@var{value}}).
11225 This flag is enabled by default at @option{-O3}.
11226 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11228 @item -fipa-bit-cp
11229 @opindex fipa-bit-cp
11230 When enabled, perform interprocedural bitwise constant
11231 propagation. This flag is enabled by default at @option{-O2} and
11232 by @option{-fprofile-use} and @option{-fauto-profile}.
11233 It requires that @option{-fipa-cp} is enabled.  
11235 @item -fipa-vrp
11236 @opindex fipa-vrp
11237 When enabled, perform interprocedural propagation of value
11238 ranges. This flag is enabled by default at @option{-O2}. It requires
11239 that @option{-fipa-cp} is enabled.
11241 @item -fipa-icf
11242 @opindex fipa-icf
11243 Perform Identical Code Folding for functions and read-only variables.
11244 The optimization reduces code size and may disturb unwind stacks by replacing
11245 a function by equivalent one with a different name. The optimization works
11246 more effectively with link-time optimization enabled.
11248 Although the behavior is similar to the Gold Linker's ICF optimization, GCC ICF
11249 works on different levels and thus the optimizations are not same - there are
11250 equivalences that are found only by GCC and equivalences found only by Gold.
11252 This flag is enabled by default at @option{-O2} and @option{-Os}.
11254 @item -flive-patching=@var{level}
11255 @opindex flive-patching
11256 Control GCC's optimizations to produce output suitable for live-patching.
11258 If the compiler's optimization uses a function's body or information extracted
11259 from its body to optimize/change another function, the latter is called an
11260 impacted function of the former.  If a function is patched, its impacted
11261 functions should be patched too.
11263 The impacted functions are determined by the compiler's interprocedural
11264 optimizations.  For example, a caller is impacted when inlining a function
11265 into its caller,
11266 cloning a function and changing its caller to call this new clone,
11267 or extracting a function's pureness/constness information to optimize
11268 its direct or indirect callers, etc.
11270 Usually, the more IPA optimizations enabled, the larger the number of
11271 impacted functions for each function.  In order to control the number of
11272 impacted functions and more easily compute the list of impacted function,
11273 IPA optimizations can be partially enabled at two different levels.
11275 The @var{level} argument should be one of the following:
11277 @table @samp
11279 @item inline-clone
11281 Only enable inlining and cloning optimizations, which includes inlining,
11282 cloning, interprocedural scalar replacement of aggregates and partial inlining.
11283 As a result, when patching a function, all its callers and its clones'
11284 callers are impacted, therefore need to be patched as well.
11286 @option{-flive-patching=inline-clone} disables the following optimization flags:
11287 @gccoptlist{-fwhole-program  -fipa-pta  -fipa-reference  -fipa-ra @gol
11288 -fipa-icf  -fipa-icf-functions  -fipa-icf-variables @gol
11289 -fipa-bit-cp  -fipa-vrp  -fipa-pure-const  -fipa-reference-addressable @gol
11290 -fipa-stack-alignment -fipa-modref}
11292 @item inline-only-static
11294 Only enable inlining of static functions.
11295 As a result, when patching a static function, all its callers are impacted
11296 and so need to be patched as well.
11298 In addition to all the flags that @option{-flive-patching=inline-clone}
11299 disables,
11300 @option{-flive-patching=inline-only-static} disables the following additional
11301 optimization flags:
11302 @gccoptlist{-fipa-cp-clone  -fipa-sra  -fpartial-inlining  -fipa-cp}
11304 @end table
11306 When @option{-flive-patching} is specified without any value, the default value
11307 is @var{inline-clone}.
11309 This flag is disabled by default.
11311 Note that @option{-flive-patching} is not supported with link-time optimization
11312 (@option{-flto}).
11314 @item -fisolate-erroneous-paths-dereference
11315 @opindex fisolate-erroneous-paths-dereference
11316 Detect paths that trigger erroneous or undefined behavior due to
11317 dereferencing a null pointer.  Isolate those paths from the main control
11318 flow and turn the statement with erroneous or undefined behavior into a trap.
11319 This flag is enabled by default at @option{-O2} and higher and depends on
11320 @option{-fdelete-null-pointer-checks} also being enabled.
11322 @item -fisolate-erroneous-paths-attribute
11323 @opindex fisolate-erroneous-paths-attribute
11324 Detect paths that trigger erroneous or undefined behavior due to a null value
11325 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
11326 attribute.  Isolate those paths from the main control flow and turn the
11327 statement with erroneous or undefined behavior into a trap.  This is not
11328 currently enabled, but may be enabled by @option{-O2} in the future.
11330 @item -ftree-sink
11331 @opindex ftree-sink
11332 Perform forward store motion on trees.  This flag is
11333 enabled by default at @option{-O} and higher.
11335 @item -ftree-bit-ccp
11336 @opindex ftree-bit-ccp
11337 Perform sparse conditional bit constant propagation on trees and propagate
11338 pointer alignment information.
11339 This pass only operates on local scalar variables and is enabled by default
11340 at @option{-O1} and higher, except for @option{-Og}.
11341 It requires that @option{-ftree-ccp} is enabled.
11343 @item -ftree-ccp
11344 @opindex ftree-ccp
11345 Perform sparse conditional constant propagation (CCP) on trees.  This
11346 pass only operates on local scalar variables and is enabled by default
11347 at @option{-O} and higher.
11349 @item -fssa-backprop
11350 @opindex fssa-backprop
11351 Propagate information about uses of a value up the definition chain
11352 in order to simplify the definitions.  For example, this pass strips
11353 sign operations if the sign of a value never matters.  The flag is
11354 enabled by default at @option{-O} and higher.
11356 @item -fssa-phiopt
11357 @opindex fssa-phiopt
11358 Perform pattern matching on SSA PHI nodes to optimize conditional
11359 code.  This pass is enabled by default at @option{-O1} and higher,
11360 except for @option{-Og}.
11362 @item -ftree-switch-conversion
11363 @opindex ftree-switch-conversion
11364 Perform conversion of simple initializations in a switch to
11365 initializations from a scalar array.  This flag is enabled by default
11366 at @option{-O2} and higher.
11368 @item -ftree-tail-merge
11369 @opindex ftree-tail-merge
11370 Look for identical code sequences.  When found, replace one with a jump to the
11371 other.  This optimization is known as tail merging or cross jumping.  This flag
11372 is enabled by default at @option{-O2} and higher.  The compilation time
11373 in this pass can
11374 be limited using @option{max-tail-merge-comparisons} parameter and
11375 @option{max-tail-merge-iterations} parameter.
11377 @item -ftree-dce
11378 @opindex ftree-dce
11379 Perform dead code elimination (DCE) on trees.  This flag is enabled by
11380 default at @option{-O} and higher.
11382 @item -ftree-builtin-call-dce
11383 @opindex ftree-builtin-call-dce
11384 Perform conditional dead code elimination (DCE) for calls to built-in functions
11385 that may set @code{errno} but are otherwise free of side effects.  This flag is
11386 enabled by default at @option{-O2} and higher if @option{-Os} is not also
11387 specified.
11389 @item -ffinite-loops
11390 @opindex ffinite-loops
11391 @opindex fno-finite-loops
11392 Assume that a loop with an exit will eventually take the exit and not loop
11393 indefinitely.  This allows the compiler to remove loops that otherwise have
11394 no side-effects, not considering eventual endless looping as such.
11396 This option is enabled by default at @option{-O2} for C++ with -std=c++11
11397 or higher.
11399 @item -ftree-dominator-opts
11400 @opindex ftree-dominator-opts
11401 Perform a variety of simple scalar cleanups (constant/copy
11402 propagation, redundancy elimination, range propagation and expression
11403 simplification) based on a dominator tree traversal.  This also
11404 performs jump threading (to reduce jumps to jumps). This flag is
11405 enabled by default at @option{-O} and higher.
11407 @item -ftree-dse
11408 @opindex ftree-dse
11409 Perform dead store elimination (DSE) on trees.  A dead store is a store into
11410 a memory location that is later overwritten by another store without
11411 any intervening loads.  In this case the earlier store can be deleted.  This
11412 flag is enabled by default at @option{-O} and higher.
11414 @item -ftree-ch
11415 @opindex ftree-ch
11416 Perform loop header copying on trees.  This is beneficial since it increases
11417 effectiveness of code motion optimizations.  It also saves one jump.  This flag
11418 is enabled by default at @option{-O} and higher.  It is not enabled
11419 for @option{-Os}, since it usually increases code size.
11421 @item -ftree-loop-optimize
11422 @opindex ftree-loop-optimize
11423 Perform loop optimizations on trees.  This flag is enabled by default
11424 at @option{-O} and higher.
11426 @item -ftree-loop-linear
11427 @itemx -floop-strip-mine
11428 @itemx -floop-block
11429 @opindex ftree-loop-linear
11430 @opindex floop-strip-mine
11431 @opindex floop-block
11432 Perform loop nest optimizations.  Same as
11433 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
11434 to be configured with @option{--with-isl} to enable the Graphite loop
11435 transformation infrastructure.
11437 @item -fgraphite-identity
11438 @opindex fgraphite-identity
11439 Enable the identity transformation for graphite.  For every SCoP we generate
11440 the polyhedral representation and transform it back to gimple.  Using
11441 @option{-fgraphite-identity} we can check the costs or benefits of the
11442 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
11443 are also performed by the code generator isl, like index splitting and
11444 dead code elimination in loops.
11446 @item -floop-nest-optimize
11447 @opindex floop-nest-optimize
11448 Enable the isl based loop nest optimizer.  This is a generic loop nest
11449 optimizer based on the Pluto optimization algorithms.  It calculates a loop
11450 structure optimized for data-locality and parallelism.  This option
11451 is experimental.
11453 @item -floop-parallelize-all
11454 @opindex floop-parallelize-all
11455 Use the Graphite data dependence analysis to identify loops that can
11456 be parallelized.  Parallelize all the loops that can be analyzed to
11457 not contain loop carried dependences without checking that it is
11458 profitable to parallelize the loops.
11460 @item -ftree-coalesce-vars
11461 @opindex ftree-coalesce-vars
11462 While transforming the program out of the SSA representation, attempt to
11463 reduce copying by coalescing versions of different user-defined
11464 variables, instead of just compiler temporaries.  This may severely
11465 limit the ability to debug an optimized program compiled with
11466 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
11467 prevents SSA coalescing of user variables.  This option is enabled by
11468 default if optimization is enabled, and it does very little otherwise.
11470 @item -ftree-loop-if-convert
11471 @opindex ftree-loop-if-convert
11472 Attempt to transform conditional jumps in the innermost loops to
11473 branch-less equivalents.  The intent is to remove control-flow from
11474 the innermost loops in order to improve the ability of the
11475 vectorization pass to handle these loops.  This is enabled by default
11476 if vectorization is enabled.
11478 @item -ftree-loop-distribution
11479 @opindex ftree-loop-distribution
11480 Perform loop distribution.  This flag can improve cache performance on
11481 big loop bodies and allow further loop optimizations, like
11482 parallelization or vectorization, to take place.  For example, the loop
11483 @smallexample
11484 DO I = 1, N
11485   A(I) = B(I) + C
11486   D(I) = E(I) * F
11487 ENDDO
11488 @end smallexample
11489 is transformed to
11490 @smallexample
11491 DO I = 1, N
11492    A(I) = B(I) + C
11493 ENDDO
11494 DO I = 1, N
11495    D(I) = E(I) * F
11496 ENDDO
11497 @end smallexample
11498 This flag is enabled by default at @option{-O3}.
11499 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11501 @item -ftree-loop-distribute-patterns
11502 @opindex ftree-loop-distribute-patterns
11503 Perform loop distribution of patterns that can be code generated with
11504 calls to a library.  This flag is enabled by default at @option{-O2} and
11505 higher, and by @option{-fprofile-use} and @option{-fauto-profile}.
11507 This pass distributes the initialization loops and generates a call to
11508 memset zero.  For example, the loop
11509 @smallexample
11510 DO I = 1, N
11511   A(I) = 0
11512   B(I) = A(I) + I
11513 ENDDO
11514 @end smallexample
11515 is transformed to
11516 @smallexample
11517 DO I = 1, N
11518    A(I) = 0
11519 ENDDO
11520 DO I = 1, N
11521    B(I) = A(I) + I
11522 ENDDO
11523 @end smallexample
11524 and the initialization loop is transformed into a call to memset zero.
11525 This flag is enabled by default at @option{-O3}.
11526 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11528 @item -floop-interchange
11529 @opindex floop-interchange
11530 Perform loop interchange outside of graphite.  This flag can improve cache
11531 performance on loop nest and allow further loop optimizations, like
11532 vectorization, to take place.  For example, the loop
11533 @smallexample
11534 for (int i = 0; i < N; i++)
11535   for (int j = 0; j < N; j++)
11536     for (int k = 0; k < N; k++)
11537       c[i][j] = c[i][j] + a[i][k]*b[k][j];
11538 @end smallexample
11539 is transformed to
11540 @smallexample
11541 for (int i = 0; i < N; i++)
11542   for (int k = 0; k < N; k++)
11543     for (int j = 0; j < N; j++)
11544       c[i][j] = c[i][j] + a[i][k]*b[k][j];
11545 @end smallexample
11546 This flag is enabled by default at @option{-O3}.
11547 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11549 @item -floop-unroll-and-jam
11550 @opindex floop-unroll-and-jam
11551 Apply unroll and jam transformations on feasible loops.  In a loop
11552 nest this unrolls the outer loop by some factor and fuses the resulting
11553 multiple inner loops.  This flag is enabled by default at @option{-O3}.
11554 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11556 @item -ftree-loop-im
11557 @opindex ftree-loop-im
11558 Perform loop invariant motion on trees.  This pass moves only invariants that
11559 are hard to handle at RTL level (function calls, operations that expand to
11560 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
11561 operands of conditions that are invariant out of the loop, so that we can use
11562 just trivial invariantness analysis in loop unswitching.  The pass also includes
11563 store motion.
11565 @item -ftree-loop-ivcanon
11566 @opindex ftree-loop-ivcanon
11567 Create a canonical counter for number of iterations in loops for which
11568 determining number of iterations requires complicated analysis.  Later
11569 optimizations then may determine the number easily.  Useful especially
11570 in connection with unrolling.
11572 @item -ftree-scev-cprop
11573 @opindex ftree-scev-cprop
11574 Perform final value replacement.  If a variable is modified in a loop
11575 in such a way that its value when exiting the loop can be determined using
11576 only its initial value and the number of loop iterations, replace uses of
11577 the final value by such a computation, provided it is sufficiently cheap.
11578 This reduces data dependencies and may allow further simplifications.
11579 Enabled by default at @option{-O} and higher.
11581 @item -fivopts
11582 @opindex fivopts
11583 Perform induction variable optimizations (strength reduction, induction
11584 variable merging and induction variable elimination) on trees.
11586 @item -ftree-parallelize-loops=n
11587 @opindex ftree-parallelize-loops
11588 Parallelize loops, i.e., split their iteration space to run in n threads.
11589 This is only possible for loops whose iterations are independent
11590 and can be arbitrarily reordered.  The optimization is only
11591 profitable on multiprocessor machines, for loops that are CPU-intensive,
11592 rather than constrained e.g.@: by memory bandwidth.  This option
11593 implies @option{-pthread}, and thus is only supported on targets
11594 that have support for @option{-pthread}.
11596 @item -ftree-pta
11597 @opindex ftree-pta
11598 Perform function-local points-to analysis on trees.  This flag is
11599 enabled by default at @option{-O1} and higher, except for @option{-Og}.
11601 @item -ftree-sra
11602 @opindex ftree-sra
11603 Perform scalar replacement of aggregates.  This pass replaces structure
11604 references with scalars to prevent committing structures to memory too
11605 early.  This flag is enabled by default at @option{-O1} and higher,
11606 except for @option{-Og}.
11608 @item -fstore-merging
11609 @opindex fstore-merging
11610 Perform merging of narrow stores to consecutive memory addresses.  This pass
11611 merges contiguous stores of immediate values narrower than a word into fewer
11612 wider stores to reduce the number of instructions.  This is enabled by default
11613 at @option{-O2} and higher as well as @option{-Os}.
11615 @item -ftree-ter
11616 @opindex ftree-ter
11617 Perform temporary expression replacement during the SSA->normal phase.  Single
11618 use/single def temporaries are replaced at their use location with their
11619 defining expression.  This results in non-GIMPLE code, but gives the expanders
11620 much more complex trees to work on resulting in better RTL generation.  This is
11621 enabled by default at @option{-O} and higher.
11623 @item -ftree-slsr
11624 @opindex ftree-slsr
11625 Perform straight-line strength reduction on trees.  This recognizes related
11626 expressions involving multiplications and replaces them by less expensive
11627 calculations when possible.  This is enabled by default at @option{-O} and
11628 higher.
11630 @item -ftree-vectorize
11631 @opindex ftree-vectorize
11632 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
11633 and @option{-ftree-slp-vectorize} if not explicitly specified.
11635 @item -ftree-loop-vectorize
11636 @opindex ftree-loop-vectorize
11637 Perform loop vectorization on trees. This flag is enabled by default at
11638 @option{-O3} and by @option{-ftree-vectorize}, @option{-fprofile-use},
11639 and @option{-fauto-profile}.
11641 @item -ftree-slp-vectorize
11642 @opindex ftree-slp-vectorize
11643 Perform basic block vectorization on trees. This flag is enabled by default at
11644 @option{-O3} and by @option{-ftree-vectorize}, @option{-fprofile-use},
11645 and @option{-fauto-profile}.
11647 @item -fvect-cost-model=@var{model}
11648 @opindex fvect-cost-model
11649 Alter the cost model used for vectorization.  The @var{model} argument
11650 should be one of @samp{unlimited}, @samp{dynamic}, @samp{cheap} or
11651 @samp{very-cheap}.
11652 With the @samp{unlimited} model the vectorized code-path is assumed
11653 to be profitable while with the @samp{dynamic} model a runtime check
11654 guards the vectorized code-path to enable it only for iteration
11655 counts that will likely execute faster than when executing the original
11656 scalar loop.  The @samp{cheap} model disables vectorization of
11657 loops where doing so would be cost prohibitive for example due to
11658 required runtime checks for data dependence or alignment but otherwise
11659 is equal to the @samp{dynamic} model.  The @samp{very-cheap} model only
11660 allows vectorization if the vector code would entirely replace the
11661 scalar code that is being vectorized.  For example, if each iteration
11662 of a vectorized loop would only be able to handle exactly four iterations
11663 of the scalar loop, the @samp{very-cheap} model would only allow
11664 vectorization if the scalar iteration count is known to be a multiple
11665 of four.
11667 The default cost model depends on other optimization flags and is
11668 either @samp{dynamic} or @samp{cheap}.
11670 @item -fsimd-cost-model=@var{model}
11671 @opindex fsimd-cost-model
11672 Alter the cost model used for vectorization of loops marked with the OpenMP
11673 simd directive.  The @var{model} argument should be one of
11674 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
11675 have the same meaning as described in @option{-fvect-cost-model} and by
11676 default a cost model defined with @option{-fvect-cost-model} is used.
11678 @item -ftree-vrp
11679 @opindex ftree-vrp
11680 Perform Value Range Propagation on trees.  This is similar to the
11681 constant propagation pass, but instead of values, ranges of values are
11682 propagated.  This allows the optimizers to remove unnecessary range
11683 checks like array bound checks and null pointer checks.  This is
11684 enabled by default at @option{-O2} and higher.  Null pointer check
11685 elimination is only done if @option{-fdelete-null-pointer-checks} is
11686 enabled.
11688 @item -fsplit-paths
11689 @opindex fsplit-paths
11690 Split paths leading to loop backedges.  This can improve dead code
11691 elimination and common subexpression elimination.  This is enabled by
11692 default at @option{-O3} and above.
11694 @item -fsplit-ivs-in-unroller
11695 @opindex fsplit-ivs-in-unroller
11696 Enables expression of values of induction variables in later iterations
11697 of the unrolled loop using the value in the first iteration.  This breaks
11698 long dependency chains, thus improving efficiency of the scheduling passes.
11700 A combination of @option{-fweb} and CSE is often sufficient to obtain the
11701 same effect.  However, that is not reliable in cases where the loop body
11702 is more complicated than a single basic block.  It also does not work at all
11703 on some architectures due to restrictions in the CSE pass.
11705 This optimization is enabled by default.
11707 @item -fvariable-expansion-in-unroller
11708 @opindex fvariable-expansion-in-unroller
11709 With this option, the compiler creates multiple copies of some
11710 local variables when unrolling a loop, which can result in superior code.
11712 This optimization is enabled by default for PowerPC targets, but disabled
11713 by default otherwise.
11715 @item -fpartial-inlining
11716 @opindex fpartial-inlining
11717 Inline parts of functions.  This option has any effect only
11718 when inlining itself is turned on by the @option{-finline-functions}
11719 or @option{-finline-small-functions} options.
11721 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
11723 @item -fpredictive-commoning
11724 @opindex fpredictive-commoning
11725 Perform predictive commoning optimization, i.e., reusing computations
11726 (especially memory loads and stores) performed in previous
11727 iterations of loops.
11729 This option is enabled at level @option{-O3}.
11730 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11732 @item -fprefetch-loop-arrays
11733 @opindex fprefetch-loop-arrays
11734 If supported by the target machine, generate instructions to prefetch
11735 memory to improve the performance of loops that access large arrays.
11737 This option may generate better or worse code; results are highly
11738 dependent on the structure of loops within the source code.
11740 Disabled at level @option{-Os}.
11742 @item -fno-printf-return-value
11743 @opindex fno-printf-return-value
11744 @opindex fprintf-return-value
11745 Do not substitute constants for known return value of formatted output
11746 functions such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and
11747 @code{vsnprintf} (but not @code{printf} of @code{fprintf}).  This
11748 transformation allows GCC to optimize or even eliminate branches based
11749 on the known return value of these functions called with arguments that
11750 are either constant, or whose values are known to be in a range that
11751 makes determining the exact return value possible.  For example, when
11752 @option{-fprintf-return-value} is in effect, both the branch and the
11753 body of the @code{if} statement (but not the call to @code{snprint})
11754 can be optimized away when @code{i} is a 32-bit or smaller integer
11755 because the return value is guaranteed to be at most 8.
11757 @smallexample
11758 char buf[9];
11759 if (snprintf (buf, "%08x", i) >= sizeof buf)
11760   @dots{}
11761 @end smallexample
11763 The @option{-fprintf-return-value} option relies on other optimizations
11764 and yields best results with @option{-O2} and above.  It works in tandem
11765 with the @option{-Wformat-overflow} and @option{-Wformat-truncation}
11766 options.  The @option{-fprintf-return-value} option is enabled by default.
11768 @item -fno-peephole
11769 @itemx -fno-peephole2
11770 @opindex fno-peephole
11771 @opindex fpeephole
11772 @opindex fno-peephole2
11773 @opindex fpeephole2
11774 Disable any machine-specific peephole optimizations.  The difference
11775 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
11776 are implemented in the compiler; some targets use one, some use the
11777 other, a few use both.
11779 @option{-fpeephole} is enabled by default.
11780 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
11782 @item -fno-guess-branch-probability
11783 @opindex fno-guess-branch-probability
11784 @opindex fguess-branch-probability
11785 Do not guess branch probabilities using heuristics.
11787 GCC uses heuristics to guess branch probabilities if they are
11788 not provided by profiling feedback (@option{-fprofile-arcs}).  These
11789 heuristics are based on the control flow graph.  If some branch probabilities
11790 are specified by @code{__builtin_expect}, then the heuristics are
11791 used to guess branch probabilities for the rest of the control flow graph,
11792 taking the @code{__builtin_expect} info into account.  The interactions
11793 between the heuristics and @code{__builtin_expect} can be complex, and in
11794 some cases, it may be useful to disable the heuristics so that the effects
11795 of @code{__builtin_expect} are easier to understand.
11797 It is also possible to specify expected probability of the expression
11798 with @code{__builtin_expect_with_probability} built-in function.
11800 The default is @option{-fguess-branch-probability} at levels
11801 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
11803 @item -freorder-blocks
11804 @opindex freorder-blocks
11805 Reorder basic blocks in the compiled function in order to reduce number of
11806 taken branches and improve code locality.
11808 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
11810 @item -freorder-blocks-algorithm=@var{algorithm}
11811 @opindex freorder-blocks-algorithm
11812 Use the specified algorithm for basic block reordering.  The
11813 @var{algorithm} argument can be @samp{simple}, which does not increase
11814 code size (except sometimes due to secondary effects like alignment),
11815 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
11816 put all often executed code together, minimizing the number of branches
11817 executed by making extra copies of code.
11819 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
11820 @samp{stc} at levels @option{-O2}, @option{-O3}.
11822 @item -freorder-blocks-and-partition
11823 @opindex freorder-blocks-and-partition
11824 In addition to reordering basic blocks in the compiled function, in order
11825 to reduce number of taken branches, partitions hot and cold basic blocks
11826 into separate sections of the assembly and @file{.o} files, to improve
11827 paging and cache locality performance.
11829 This optimization is automatically turned off in the presence of
11830 exception handling or unwind tables (on targets using setjump/longjump or target specific scheme), for linkonce sections, for functions with a user-defined
11831 section attribute and on any architecture that does not support named
11832 sections.  When @option{-fsplit-stack} is used this option is not
11833 enabled by default (to avoid linker errors), but may be enabled
11834 explicitly (if using a working linker).
11836 Enabled for x86 at levels @option{-O2}, @option{-O3}, @option{-Os}.
11838 @item -freorder-functions
11839 @opindex freorder-functions
11840 Reorder functions in the object file in order to
11841 improve code locality.  This is implemented by using special
11842 subsections @code{.text.hot} for most frequently executed functions and
11843 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
11844 the linker so object file format must support named sections and linker must
11845 place them in a reasonable way.
11847 This option isn't effective unless you either provide profile feedback
11848 (see @option{-fprofile-arcs} for details) or manually annotate functions with 
11849 @code{hot} or @code{cold} attributes (@pxref{Common Function Attributes}).
11851 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
11853 @item -fstrict-aliasing
11854 @opindex fstrict-aliasing
11855 Allow the compiler to assume the strictest aliasing rules applicable to
11856 the language being compiled.  For C (and C++), this activates
11857 optimizations based on the type of expressions.  In particular, an
11858 object of one type is assumed never to reside at the same address as an
11859 object of a different type, unless the types are almost the same.  For
11860 example, an @code{unsigned int} can alias an @code{int}, but not a
11861 @code{void*} or a @code{double}.  A character type may alias any other
11862 type.
11864 @anchor{Type-punning}Pay special attention to code like this:
11865 @smallexample
11866 union a_union @{
11867   int i;
11868   double d;
11871 int f() @{
11872   union a_union t;
11873   t.d = 3.0;
11874   return t.i;
11876 @end smallexample
11877 The practice of reading from a different union member than the one most
11878 recently written to (called ``type-punning'') is common.  Even with
11879 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
11880 is accessed through the union type.  So, the code above works as
11881 expected.  @xref{Structures unions enumerations and bit-fields
11882 implementation}.  However, this code might not:
11883 @smallexample
11884 int f() @{
11885   union a_union t;
11886   int* ip;
11887   t.d = 3.0;
11888   ip = &t.i;
11889   return *ip;
11891 @end smallexample
11893 Similarly, access by taking the address, casting the resulting pointer
11894 and dereferencing the result has undefined behavior, even if the cast
11895 uses a union type, e.g.:
11896 @smallexample
11897 int f() @{
11898   double d = 3.0;
11899   return ((union a_union *) &d)->i;
11901 @end smallexample
11903 The @option{-fstrict-aliasing} option is enabled at levels
11904 @option{-O2}, @option{-O3}, @option{-Os}.
11906 @item -falign-functions
11907 @itemx -falign-functions=@var{n}
11908 @itemx -falign-functions=@var{n}:@var{m}
11909 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}
11910 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}:@var{m2}
11911 @opindex falign-functions
11912 Align the start of functions to the next power-of-two greater than or
11913 equal to @var{n}, skipping up to @var{m}-1 bytes.  This ensures that at
11914 least the first @var{m} bytes of the function can be fetched by the CPU
11915 without crossing an @var{n}-byte alignment boundary.
11917 If @var{m} is not specified, it defaults to @var{n}.
11919 Examples: @option{-falign-functions=32} aligns functions to the next
11920 32-byte boundary, @option{-falign-functions=24} aligns to the next
11921 32-byte boundary only if this can be done by skipping 23 bytes or less,
11922 @option{-falign-functions=32:7} aligns to the next
11923 32-byte boundary only if this can be done by skipping 6 bytes or less.
11925 The second pair of @var{n2}:@var{m2} values allows you to specify
11926 a secondary alignment: @option{-falign-functions=64:7:32:3} aligns to
11927 the next 64-byte boundary if this can be done by skipping 6 bytes or less,
11928 otherwise aligns to the next 32-byte boundary if this can be done
11929 by skipping 2 bytes or less.
11930 If @var{m2} is not specified, it defaults to @var{n2}.
11932 Some assemblers only support this flag when @var{n} is a power of two;
11933 in that case, it is rounded up.
11935 @option{-fno-align-functions} and @option{-falign-functions=1} are
11936 equivalent and mean that functions are not aligned.
11938 If @var{n} is not specified or is zero, use a machine-dependent default.
11939 The maximum allowed @var{n} option value is 65536.
11941 Enabled at levels @option{-O2}, @option{-O3}.
11943 @item -flimit-function-alignment
11944 If this option is enabled, the compiler tries to avoid unnecessarily
11945 overaligning functions. It attempts to instruct the assembler to align
11946 by the amount specified by @option{-falign-functions}, but not to
11947 skip more bytes than the size of the function.
11949 @item -falign-labels
11950 @itemx -falign-labels=@var{n}
11951 @itemx -falign-labels=@var{n}:@var{m}
11952 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}
11953 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}:@var{m2}
11954 @opindex falign-labels
11955 Align all branch targets to a power-of-two boundary.
11957 Parameters of this option are analogous to the @option{-falign-functions} option.
11958 @option{-fno-align-labels} and @option{-falign-labels=1} are
11959 equivalent and mean that labels are not aligned.
11961 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
11962 are greater than this value, then their values are used instead.
11964 If @var{n} is not specified or is zero, use a machine-dependent default
11965 which is very likely to be @samp{1}, meaning no alignment.
11966 The maximum allowed @var{n} option value is 65536.
11968 Enabled at levels @option{-O2}, @option{-O3}.
11970 @item -falign-loops
11971 @itemx -falign-loops=@var{n}
11972 @itemx -falign-loops=@var{n}:@var{m}
11973 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}
11974 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}:@var{m2}
11975 @opindex falign-loops
11976 Align loops to a power-of-two boundary.  If the loops are executed
11977 many times, this makes up for any execution of the dummy padding
11978 instructions.
11980 If @option{-falign-labels} is greater than this value, then its value
11981 is used instead.
11983 Parameters of this option are analogous to the @option{-falign-functions} option.
11984 @option{-fno-align-loops} and @option{-falign-loops=1} are
11985 equivalent and mean that loops are not aligned.
11986 The maximum allowed @var{n} option value is 65536.
11988 If @var{n} is not specified or is zero, use a machine-dependent default.
11990 Enabled at levels @option{-O2}, @option{-O3}.
11992 @item -falign-jumps
11993 @itemx -falign-jumps=@var{n}
11994 @itemx -falign-jumps=@var{n}:@var{m}
11995 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}
11996 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}:@var{m2}
11997 @opindex falign-jumps
11998 Align branch targets to a power-of-two boundary, for branch targets
11999 where the targets can only be reached by jumping.  In this case,
12000 no dummy operations need be executed.
12002 If @option{-falign-labels} is greater than this value, then its value
12003 is used instead.
12005 Parameters of this option are analogous to the @option{-falign-functions} option.
12006 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
12007 equivalent and mean that loops are not aligned.
12009 If @var{n} is not specified or is zero, use a machine-dependent default.
12010 The maximum allowed @var{n} option value is 65536.
12012 Enabled at levels @option{-O2}, @option{-O3}.
12014 @item -fno-allocation-dce
12015 @opindex fno-allocation-dce
12016 Do not remove unused C++ allocations in dead code elimination.
12018 @item -fallow-store-data-races
12019 @opindex fallow-store-data-races
12020 Allow the compiler to perform optimizations that may introduce new data races
12021 on stores, without proving that the variable cannot be concurrently accessed
12022 by other threads.  Does not affect optimization of local data.  It is safe to
12023 use this option if it is known that global data will not be accessed by
12024 multiple threads.
12026 Examples of optimizations enabled by @option{-fallow-store-data-races} include
12027 hoisting or if-conversions that may cause a value that was already in memory
12028 to be re-written with that same value.  Such re-writing is safe in a single
12029 threaded context but may be unsafe in a multi-threaded context.  Note that on
12030 some processors, if-conversions may be required in order to enable
12031 vectorization.
12033 Enabled at level @option{-Ofast}.
12035 @item -funit-at-a-time
12036 @opindex funit-at-a-time
12037 This option is left for compatibility reasons. @option{-funit-at-a-time}
12038 has no effect, while @option{-fno-unit-at-a-time} implies
12039 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
12041 Enabled by default.
12043 @item -fno-toplevel-reorder
12044 @opindex fno-toplevel-reorder
12045 @opindex ftoplevel-reorder
12046 Do not reorder top-level functions, variables, and @code{asm}
12047 statements.  Output them in the same order that they appear in the
12048 input file.  When this option is used, unreferenced static variables
12049 are not removed.  This option is intended to support existing code
12050 that relies on a particular ordering.  For new code, it is better to
12051 use attributes when possible.
12053 @option{-ftoplevel-reorder} is the default at @option{-O1} and higher, and
12054 also at @option{-O0} if @option{-fsection-anchors} is explicitly requested.
12055 Additionally @option{-fno-toplevel-reorder} implies
12056 @option{-fno-section-anchors}.
12058 @item -fweb
12059 @opindex fweb
12060 Constructs webs as commonly used for register allocation purposes and assign
12061 each web individual pseudo register.  This allows the register allocation pass
12062 to operate on pseudos directly, but also strengthens several other optimization
12063 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
12064 however, make debugging impossible, since variables no longer stay in a
12065 ``home register''.
12067 Enabled by default with @option{-funroll-loops}.
12069 @item -fwhole-program
12070 @opindex fwhole-program
12071 Assume that the current compilation unit represents the whole program being
12072 compiled.  All public functions and variables with the exception of @code{main}
12073 and those merged by attribute @code{externally_visible} become static functions
12074 and in effect are optimized more aggressively by interprocedural optimizers.
12076 This option should not be used in combination with @option{-flto}.
12077 Instead relying on a linker plugin should provide safer and more precise
12078 information.
12080 @item -flto[=@var{n}]
12081 @opindex flto
12082 This option runs the standard link-time optimizer.  When invoked
12083 with source code, it generates GIMPLE (one of GCC's internal
12084 representations) and writes it to special ELF sections in the object
12085 file.  When the object files are linked together, all the function
12086 bodies are read from these ELF sections and instantiated as if they
12087 had been part of the same translation unit.
12089 To use the link-time optimizer, @option{-flto} and optimization
12090 options should be specified at compile time and during the final link.
12091 It is recommended that you compile all the files participating in the
12092 same link with the same options and also specify those options at
12093 link time.  
12094 For example:
12096 @smallexample
12097 gcc -c -O2 -flto foo.c
12098 gcc -c -O2 -flto bar.c
12099 gcc -o myprog -flto -O2 foo.o bar.o
12100 @end smallexample
12102 The first two invocations to GCC save a bytecode representation
12103 of GIMPLE into special ELF sections inside @file{foo.o} and
12104 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
12105 @file{foo.o} and @file{bar.o}, merges the two files into a single
12106 internal image, and compiles the result as usual.  Since both
12107 @file{foo.o} and @file{bar.o} are merged into a single image, this
12108 causes all the interprocedural analyses and optimizations in GCC to
12109 work across the two files as if they were a single one.  This means,
12110 for example, that the inliner is able to inline functions in
12111 @file{bar.o} into functions in @file{foo.o} and vice-versa.
12113 Another (simpler) way to enable link-time optimization is:
12115 @smallexample
12116 gcc -o myprog -flto -O2 foo.c bar.c
12117 @end smallexample
12119 The above generates bytecode for @file{foo.c} and @file{bar.c},
12120 merges them together into a single GIMPLE representation and optimizes
12121 them as usual to produce @file{myprog}.
12123 The important thing to keep in mind is that to enable link-time
12124 optimizations you need to use the GCC driver to perform the link step.
12125 GCC automatically performs link-time optimization if any of the
12126 objects involved were compiled with the @option{-flto} command-line option.  
12127 You can always override
12128 the automatic decision to do link-time optimization
12129 by passing @option{-fno-lto} to the link command.
12131 To make whole program optimization effective, it is necessary to make
12132 certain whole program assumptions.  The compiler needs to know
12133 what functions and variables can be accessed by libraries and runtime
12134 outside of the link-time optimized unit.  When supported by the linker,
12135 the linker plugin (see @option{-fuse-linker-plugin}) passes information
12136 to the compiler about used and externally visible symbols.  When
12137 the linker plugin is not available, @option{-fwhole-program} should be
12138 used to allow the compiler to make these assumptions, which leads
12139 to more aggressive optimization decisions.
12141 When a file is compiled with @option{-flto} without
12142 @option{-fuse-linker-plugin}, the generated object file is larger than
12143 a regular object file because it contains GIMPLE bytecodes and the usual
12144 final code (see @option{-ffat-lto-objects}).  This means that
12145 object files with LTO information can be linked as normal object
12146 files; if @option{-fno-lto} is passed to the linker, no
12147 interprocedural optimizations are applied.  Note that when
12148 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
12149 but you cannot perform a regular, non-LTO link on them.
12151 When producing the final binary, GCC only
12152 applies link-time optimizations to those files that contain bytecode.
12153 Therefore, you can mix and match object files and libraries with
12154 GIMPLE bytecodes and final object code.  GCC automatically selects
12155 which files to optimize in LTO mode and which files to link without
12156 further processing.
12158 Generally, options specified at link time override those
12159 specified at compile time, although in some cases GCC attempts to infer
12160 link-time options from the settings used to compile the input files.
12162 If you do not specify an optimization level option @option{-O} at
12163 link time, then GCC uses the highest optimization level 
12164 used when compiling the object files.  Note that it is generally 
12165 ineffective to specify an optimization level option only at link time and 
12166 not at compile time, for two reasons.  First, compiling without 
12167 optimization suppresses compiler passes that gather information 
12168 needed for effective optimization at link time.  Second, some early
12169 optimization passes can be performed only at compile time and 
12170 not at link time.
12172 There are some code generation flags preserved by GCC when
12173 generating bytecodes, as they need to be used during the final link.
12174 Currently, the following options and their settings are taken from
12175 the first object file that explicitly specifies them: 
12176 @option{-fcommon}, @option{-fexceptions}, @option{-fnon-call-exceptions},
12177 @option{-fgnu-tm} and all the @option{-m} target flags.
12179 The following options @option{-fPIC}, @option{-fpic}, @option{-fpie} and
12180 @option{-fPIE} are combined based on the following scheme:
12182 @smallexample
12183 @option{-fPIC} + @option{-fpic} = @option{-fpic}
12184 @option{-fPIC} + @option{-fno-pic} = @option{-fno-pic}
12185 @option{-fpic/-fPIC} + (no option) = (no option)
12186 @option{-fPIC} + @option{-fPIE} = @option{-fPIE}
12187 @option{-fpic} + @option{-fPIE} = @option{-fpie}
12188 @option{-fPIC/-fpic} + @option{-fpie} = @option{-fpie}
12189 @end smallexample
12191 Certain ABI-changing flags are required to match in all compilation units,
12192 and trying to override this at link time with a conflicting value
12193 is ignored.  This includes options such as @option{-freg-struct-return}
12194 and @option{-fpcc-struct-return}. 
12196 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
12197 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
12198 are passed through to the link stage and merged conservatively for
12199 conflicting translation units.  Specifically
12200 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
12201 precedence; and for example @option{-ffp-contract=off} takes precedence
12202 over @option{-ffp-contract=fast}.  You can override them at link time.
12204 Diagnostic options such as @option{-Wstringop-overflow} are passed
12205 through to the link stage and their setting matches that of the
12206 compile-step at function granularity.  Note that this matters only
12207 for diagnostics emitted during optimization.  Note that code
12208 transforms such as inlining can lead to warnings being enabled
12209 or disabled for regions if code not consistent with the setting
12210 at compile time.
12212 When you need to pass options to the assembler via @option{-Wa} or
12213 @option{-Xassembler} make sure to either compile such translation
12214 units with @option{-fno-lto} or consistently use the same assembler
12215 options on all translation units.  You can alternatively also
12216 specify assembler options at LTO link time.
12218 To enable debug info generation you need to supply @option{-g} at
12219 compile time.  If any of the input files at link time were built
12220 with debug info generation enabled the link will enable debug info
12221 generation as well.  Any elaborate debug info settings
12222 like the dwarf level @option{-gdwarf-5} need to be explicitly repeated
12223 at the linker command line and mixing different settings in different
12224 translation units is discouraged.
12226 If LTO encounters objects with C linkage declared with incompatible
12227 types in separate translation units to be linked together (undefined
12228 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
12229 issued.  The behavior is still undefined at run time.  Similar
12230 diagnostics may be raised for other languages.
12232 Another feature of LTO is that it is possible to apply interprocedural
12233 optimizations on files written in different languages:
12235 @smallexample
12236 gcc -c -flto foo.c
12237 g++ -c -flto bar.cc
12238 gfortran -c -flto baz.f90
12239 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
12240 @end smallexample
12242 Notice that the final link is done with @command{g++} to get the C++
12243 runtime libraries and @option{-lgfortran} is added to get the Fortran
12244 runtime libraries.  In general, when mixing languages in LTO mode, you
12245 should use the same link command options as when mixing languages in a
12246 regular (non-LTO) compilation.
12248 If object files containing GIMPLE bytecode are stored in a library archive, say
12249 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
12250 are using a linker with plugin support.  To create static libraries suitable
12251 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
12252 and @command{ranlib}; 
12253 to show the symbols of object files with GIMPLE bytecode, use
12254 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
12255 and @command{nm} have been compiled with plugin support.  At link time, use the
12256 flag @option{-fuse-linker-plugin} to ensure that the library participates in
12257 the LTO optimization process:
12259 @smallexample
12260 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
12261 @end smallexample
12263 With the linker plugin enabled, the linker extracts the needed
12264 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
12265 to make them part of the aggregated GIMPLE image to be optimized.
12267 If you are not using a linker with plugin support and/or do not
12268 enable the linker plugin, then the objects inside @file{libfoo.a}
12269 are extracted and linked as usual, but they do not participate
12270 in the LTO optimization process.  In order to make a static library suitable
12271 for both LTO optimization and usual linkage, compile its object files with
12272 @option{-flto} @option{-ffat-lto-objects}.
12274 Link-time optimizations do not require the presence of the whole program to
12275 operate.  If the program does not require any symbols to be exported, it is
12276 possible to combine @option{-flto} and @option{-fwhole-program} to allow
12277 the interprocedural optimizers to use more aggressive assumptions which may
12278 lead to improved optimization opportunities.
12279 Use of @option{-fwhole-program} is not needed when linker plugin is
12280 active (see @option{-fuse-linker-plugin}).
12282 The current implementation of LTO makes no
12283 attempt to generate bytecode that is portable between different
12284 types of hosts.  The bytecode files are versioned and there is a
12285 strict version check, so bytecode files generated in one version of
12286 GCC do not work with an older or newer version of GCC.
12288 Link-time optimization does not work well with generation of debugging
12289 information on systems other than those using a combination of ELF and
12290 DWARF.
12292 If you specify the optional @var{n}, the optimization and code
12293 generation done at link time is executed in parallel using @var{n}
12294 parallel jobs by utilizing an installed @command{make} program.  The
12295 environment variable @env{MAKE} may be used to override the program
12296 used.
12298 You can also specify @option{-flto=jobserver} to use GNU make's
12299 job server mode to determine the number of parallel jobs. This
12300 is useful when the Makefile calling GCC is already executing in parallel.
12301 You must prepend a @samp{+} to the command recipe in the parent Makefile
12302 for this to work.  This option likely only works if @env{MAKE} is
12303 GNU make.  Even without the option value, GCC tries to automatically
12304 detect a running GNU make's job server.
12306 Use @option{-flto=auto} to use GNU make's job server, if available,
12307 or otherwise fall back to autodetection of the number of CPU threads
12308 present in your system.
12310 @item -flto-partition=@var{alg}
12311 @opindex flto-partition
12312 Specify the partitioning algorithm used by the link-time optimizer.
12313 The value is either @samp{1to1} to specify a partitioning mirroring
12314 the original source files or @samp{balanced} to specify partitioning
12315 into equally sized chunks (whenever possible) or @samp{max} to create
12316 new partition for every symbol where possible.  Specifying @samp{none}
12317 as an algorithm disables partitioning and streaming completely. 
12318 The default value is @samp{balanced}. While @samp{1to1} can be used
12319 as an workaround for various code ordering issues, the @samp{max}
12320 partitioning is intended for internal testing only.
12321 The value @samp{one} specifies that exactly one partition should be
12322 used while the value @samp{none} bypasses partitioning and executes
12323 the link-time optimization step directly from the WPA phase.
12325 @item -flto-compression-level=@var{n}
12326 @opindex flto-compression-level
12327 This option specifies the level of compression used for intermediate
12328 language written to LTO object files, and is only meaningful in
12329 conjunction with LTO mode (@option{-flto}).  Valid
12330 values are 0 (no compression) to 9 (maximum compression).  Values
12331 outside this range are clamped to either 0 or 9.  If the option is not
12332 given, a default balanced compression setting is used.
12334 @item -fuse-linker-plugin
12335 @opindex fuse-linker-plugin
12336 Enables the use of a linker plugin during link-time optimization.  This
12337 option relies on plugin support in the linker, which is available in gold
12338 or in GNU ld 2.21 or newer.
12340 This option enables the extraction of object files with GIMPLE bytecode out
12341 of library archives. This improves the quality of optimization by exposing
12342 more code to the link-time optimizer.  This information specifies what
12343 symbols can be accessed externally (by non-LTO object or during dynamic
12344 linking).  Resulting code quality improvements on binaries (and shared
12345 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
12346 See @option{-flto} for a description of the effect of this flag and how to
12347 use it.
12349 This option is enabled by default when LTO support in GCC is enabled
12350 and GCC was configured for use with
12351 a linker supporting plugins (GNU ld 2.21 or newer or gold).
12353 @item -ffat-lto-objects
12354 @opindex ffat-lto-objects
12355 Fat LTO objects are object files that contain both the intermediate language
12356 and the object code. This makes them usable for both LTO linking and normal
12357 linking. This option is effective only when compiling with @option{-flto}
12358 and is ignored at link time.
12360 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
12361 requires the complete toolchain to be aware of LTO. It requires a linker with
12362 linker plugin support for basic functionality.  Additionally,
12363 @command{nm}, @command{ar} and @command{ranlib}
12364 need to support linker plugins to allow a full-featured build environment
12365 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
12366 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
12367 to these tools. With non fat LTO makefiles need to be modified to use them.
12369 Note that modern binutils provide plugin auto-load mechanism.
12370 Installing the linker plugin into @file{$libdir/bfd-plugins} has the same
12371 effect as usage of the command wrappers (@command{gcc-ar}, @command{gcc-nm} and
12372 @command{gcc-ranlib}).
12374 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
12375 support.
12377 @item -fcompare-elim
12378 @opindex fcompare-elim
12379 After register allocation and post-register allocation instruction splitting,
12380 identify arithmetic instructions that compute processor flags similar to a
12381 comparison operation based on that arithmetic.  If possible, eliminate the
12382 explicit comparison operation.
12384 This pass only applies to certain targets that cannot explicitly represent
12385 the comparison operation before register allocation is complete.
12387 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
12389 @item -fcprop-registers
12390 @opindex fcprop-registers
12391 After register allocation and post-register allocation instruction splitting,
12392 perform a copy-propagation pass to try to reduce scheduling dependencies
12393 and occasionally eliminate the copy.
12395 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
12397 @item -fprofile-correction
12398 @opindex fprofile-correction
12399 Profiles collected using an instrumented binary for multi-threaded programs may
12400 be inconsistent due to missed counter updates. When this option is specified,
12401 GCC uses heuristics to correct or smooth out such inconsistencies. By
12402 default, GCC emits an error message when an inconsistent profile is detected.
12404 This option is enabled by @option{-fauto-profile}.
12406 @item -fprofile-partial-training
12407 @opindex fprofile-partial-training
12408 With @code{-fprofile-use} all portions of programs not executed during train
12409 run are optimized agressively for size rather than speed.  In some cases it is
12410 not practical to train all possible hot paths in the program. (For
12411 example, program may contain functions specific for a given hardware and
12412 trianing may not cover all hardware configurations program is run on.)  With
12413 @code{-fprofile-partial-training} profile feedback will be ignored for all
12414 functions not executed during the train run leading them to be optimized as if
12415 they were compiled without profile feedback. This leads to better performance
12416 when train run is not representative but also leads to significantly bigger
12417 code.
12419 @item -fprofile-use
12420 @itemx -fprofile-use=@var{path}
12421 @opindex fprofile-use
12422 Enable profile feedback-directed optimizations, 
12423 and the following optimizations, many of which
12424 are generally profitable only with profile feedback available:
12426 @gccoptlist{-fbranch-probabilities  -fprofile-values @gol
12427 -funroll-loops  -fpeel-loops  -ftracer  -fvpt @gol
12428 -finline-functions  -fipa-cp  -fipa-cp-clone  -fipa-bit-cp @gol
12429 -fpredictive-commoning  -fsplit-loops  -funswitch-loops @gol
12430 -fgcse-after-reload  -ftree-loop-vectorize  -ftree-slp-vectorize @gol
12431 -fvect-cost-model=dynamic  -ftree-loop-distribute-patterns @gol
12432 -fprofile-reorder-functions}
12434 Before you can use this option, you must first generate profiling information.
12435 @xref{Instrumentation Options}, for information about the
12436 @option{-fprofile-generate} option.
12438 By default, GCC emits an error message if the feedback profiles do not
12439 match the source code.  This error can be turned into a warning by using
12440 @option{-Wno-error=coverage-mismatch}.  Note this may result in poorly
12441 optimized code.  Additionally, by default, GCC also emits a warning message if
12442 the feedback profiles do not exist (see @option{-Wmissing-profile}).
12444 If @var{path} is specified, GCC looks at the @var{path} to find
12445 the profile feedback data files. See @option{-fprofile-dir}.
12447 @item -fauto-profile
12448 @itemx -fauto-profile=@var{path}
12449 @opindex fauto-profile
12450 Enable sampling-based feedback-directed optimizations, 
12451 and the following optimizations,
12452 many of which are generally profitable only with profile feedback available:
12454 @gccoptlist{-fbranch-probabilities  -fprofile-values @gol
12455 -funroll-loops  -fpeel-loops  -ftracer  -fvpt @gol
12456 -finline-functions  -fipa-cp  -fipa-cp-clone  -fipa-bit-cp @gol
12457 -fpredictive-commoning  -fsplit-loops  -funswitch-loops @gol
12458 -fgcse-after-reload  -ftree-loop-vectorize  -ftree-slp-vectorize @gol
12459 -fvect-cost-model=dynamic  -ftree-loop-distribute-patterns @gol
12460 -fprofile-correction}
12462 @var{path} is the name of a file containing AutoFDO profile information.
12463 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
12465 Producing an AutoFDO profile data file requires running your program
12466 with the @command{perf} utility on a supported GNU/Linux target system.
12467 For more information, see @uref{https://perf.wiki.kernel.org/}.
12469 E.g.
12470 @smallexample
12471 perf record -e br_inst_retired:near_taken -b -o perf.data \
12472     -- your_program
12473 @end smallexample
12475 Then use the @command{create_gcov} tool to convert the raw profile data
12476 to a format that can be used by GCC.@  You must also supply the 
12477 unstripped binary for your program to this tool.  
12478 See @uref{https://github.com/google/autofdo}.
12480 E.g.
12481 @smallexample
12482 create_gcov --binary=your_program.unstripped --profile=perf.data \
12483     --gcov=profile.afdo
12484 @end smallexample
12485 @end table
12487 The following options control compiler behavior regarding floating-point 
12488 arithmetic.  These options trade off between speed and
12489 correctness.  All must be specifically enabled.
12491 @table @gcctabopt
12492 @item -ffloat-store
12493 @opindex ffloat-store
12494 Do not store floating-point variables in registers, and inhibit other
12495 options that might change whether a floating-point value is taken from a
12496 register or memory.
12498 @cindex floating-point precision
12499 This option prevents undesirable excess precision on machines such as
12500 the 68000 where the floating registers (of the 68881) keep more
12501 precision than a @code{double} is supposed to have.  Similarly for the
12502 x86 architecture.  For most programs, the excess precision does only
12503 good, but a few programs rely on the precise definition of IEEE floating
12504 point.  Use @option{-ffloat-store} for such programs, after modifying
12505 them to store all pertinent intermediate computations into variables.
12507 @item -fexcess-precision=@var{style}
12508 @opindex fexcess-precision
12509 This option allows further control over excess precision on machines
12510 where floating-point operations occur in a format with more precision or
12511 range than the IEEE standard and interchange floating-point types.  By
12512 default, @option{-fexcess-precision=fast} is in effect; this means that
12513 operations may be carried out in a wider precision than the types specified
12514 in the source if that would result in faster code, and it is unpredictable
12515 when rounding to the types specified in the source code takes place.
12516 When compiling C, if @option{-fexcess-precision=standard} is specified then
12517 excess precision follows the rules specified in ISO C99; in particular,
12518 both casts and assignments cause values to be rounded to their
12519 semantic types (whereas @option{-ffloat-store} only affects
12520 assignments).  This option is enabled by default for C if a strict
12521 conformance option such as @option{-std=c99} is used.
12522 @option{-ffast-math} enables @option{-fexcess-precision=fast} by default
12523 regardless of whether a strict conformance option is used.
12525 @opindex mfpmath
12526 @option{-fexcess-precision=standard} is not implemented for languages
12527 other than C.  On the x86, it has no effect if @option{-mfpmath=sse}
12528 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
12529 semantics apply without excess precision, and in the latter, rounding
12530 is unpredictable.
12532 @item -ffast-math
12533 @opindex ffast-math
12534 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
12535 @option{-ffinite-math-only}, @option{-fno-rounding-math},
12536 @option{-fno-signaling-nans}, @option{-fcx-limited-range} and
12537 @option{-fexcess-precision=fast}.
12539 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
12541 This option is not turned on by any @option{-O} option besides
12542 @option{-Ofast} since it can result in incorrect output for programs
12543 that depend on an exact implementation of IEEE or ISO rules/specifications
12544 for math functions. It may, however, yield faster code for programs
12545 that do not require the guarantees of these specifications.
12547 @item -fno-math-errno
12548 @opindex fno-math-errno
12549 @opindex fmath-errno
12550 Do not set @code{errno} after calling math functions that are executed
12551 with a single instruction, e.g., @code{sqrt}.  A program that relies on
12552 IEEE exceptions for math error handling may want to use this flag
12553 for speed while maintaining IEEE arithmetic compatibility.
12555 This option is not turned on by any @option{-O} option since
12556 it can result in incorrect output for programs that depend on
12557 an exact implementation of IEEE or ISO rules/specifications for
12558 math functions. It may, however, yield faster code for programs
12559 that do not require the guarantees of these specifications.
12561 The default is @option{-fmath-errno}.
12563 On Darwin systems, the math library never sets @code{errno}.  There is
12564 therefore no reason for the compiler to consider the possibility that
12565 it might, and @option{-fno-math-errno} is the default.
12567 @item -funsafe-math-optimizations
12568 @opindex funsafe-math-optimizations
12570 Allow optimizations for floating-point arithmetic that (a) assume
12571 that arguments and results are valid and (b) may violate IEEE or
12572 ANSI standards.  When used at link time, it may include libraries
12573 or startup files that change the default FPU control word or other
12574 similar optimizations.
12576 This option is not turned on by any @option{-O} option since
12577 it can result in incorrect output for programs that depend on
12578 an exact implementation of IEEE or ISO rules/specifications for
12579 math functions. It may, however, yield faster code for programs
12580 that do not require the guarantees of these specifications.
12581 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
12582 @option{-fassociative-math} and @option{-freciprocal-math}.
12584 The default is @option{-fno-unsafe-math-optimizations}.
12586 @item -fassociative-math
12587 @opindex fassociative-math
12589 Allow re-association of operands in series of floating-point operations.
12590 This violates the ISO C and C++ language standard by possibly changing
12591 computation result.  NOTE: re-ordering may change the sign of zero as
12592 well as ignore NaNs and inhibit or create underflow or overflow (and
12593 thus cannot be used on code that relies on rounding behavior like
12594 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
12595 and thus may not be used when ordered comparisons are required.
12596 This option requires that both @option{-fno-signed-zeros} and
12597 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
12598 much sense with @option{-frounding-math}. For Fortran the option
12599 is automatically enabled when both @option{-fno-signed-zeros} and
12600 @option{-fno-trapping-math} are in effect.
12602 The default is @option{-fno-associative-math}.
12604 @item -freciprocal-math
12605 @opindex freciprocal-math
12607 Allow the reciprocal of a value to be used instead of dividing by
12608 the value if this enables optimizations.  For example @code{x / y}
12609 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
12610 is subject to common subexpression elimination.  Note that this loses
12611 precision and increases the number of flops operating on the value.
12613 The default is @option{-fno-reciprocal-math}.
12615 @item -ffinite-math-only
12616 @opindex ffinite-math-only
12617 Allow optimizations for floating-point arithmetic that assume
12618 that arguments and results are not NaNs or +-Infs.
12620 This option is not turned on by any @option{-O} option since
12621 it can result in incorrect output for programs that depend on
12622 an exact implementation of IEEE or ISO rules/specifications for
12623 math functions. It may, however, yield faster code for programs
12624 that do not require the guarantees of these specifications.
12626 The default is @option{-fno-finite-math-only}.
12628 @item -fno-signed-zeros
12629 @opindex fno-signed-zeros
12630 @opindex fsigned-zeros
12631 Allow optimizations for floating-point arithmetic that ignore the
12632 signedness of zero.  IEEE arithmetic specifies the behavior of
12633 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
12634 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
12635 This option implies that the sign of a zero result isn't significant.
12637 The default is @option{-fsigned-zeros}.
12639 @item -fno-trapping-math
12640 @opindex fno-trapping-math
12641 @opindex ftrapping-math
12642 Compile code assuming that floating-point operations cannot generate
12643 user-visible traps.  These traps include division by zero, overflow,
12644 underflow, inexact result and invalid operation.  This option requires
12645 that @option{-fno-signaling-nans} be in effect.  Setting this option may
12646 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
12648 This option should never be turned on by any @option{-O} option since
12649 it can result in incorrect output for programs that depend on
12650 an exact implementation of IEEE or ISO rules/specifications for
12651 math functions.
12653 The default is @option{-ftrapping-math}.
12655 @item -frounding-math
12656 @opindex frounding-math
12657 Disable transformations and optimizations that assume default floating-point
12658 rounding behavior.  This is round-to-zero for all floating point
12659 to integer conversions, and round-to-nearest for all other arithmetic
12660 truncations.  This option should be specified for programs that change
12661 the FP rounding mode dynamically, or that may be executed with a
12662 non-default rounding mode.  This option disables constant folding of
12663 floating-point expressions at compile time (which may be affected by
12664 rounding mode) and arithmetic transformations that are unsafe in the
12665 presence of sign-dependent rounding modes.
12667 The default is @option{-fno-rounding-math}.
12669 This option is experimental and does not currently guarantee to
12670 disable all GCC optimizations that are affected by rounding mode.
12671 Future versions of GCC may provide finer control of this setting
12672 using C99's @code{FENV_ACCESS} pragma.  This command-line option
12673 will be used to specify the default state for @code{FENV_ACCESS}.
12675 @item -fsignaling-nans
12676 @opindex fsignaling-nans
12677 Compile code assuming that IEEE signaling NaNs may generate user-visible
12678 traps during floating-point operations.  Setting this option disables
12679 optimizations that may change the number of exceptions visible with
12680 signaling NaNs.  This option implies @option{-ftrapping-math}.
12682 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
12683 be defined.
12685 The default is @option{-fno-signaling-nans}.
12687 This option is experimental and does not currently guarantee to
12688 disable all GCC optimizations that affect signaling NaN behavior.
12690 @item -fno-fp-int-builtin-inexact
12691 @opindex fno-fp-int-builtin-inexact
12692 @opindex ffp-int-builtin-inexact
12693 Do not allow the built-in functions @code{ceil}, @code{floor},
12694 @code{round} and @code{trunc}, and their @code{float} and @code{long
12695 double} variants, to generate code that raises the ``inexact''
12696 floating-point exception for noninteger arguments.  ISO C99 and C11
12697 allow these functions to raise the ``inexact'' exception, but ISO/IEC
12698 TS 18661-1:2014, the C bindings to IEEE 754-2008, as integrated into
12699 ISO C2X, does not allow these functions to do so.
12701 The default is @option{-ffp-int-builtin-inexact}, allowing the
12702 exception to be raised, unless C2X or a later C standard is selected.
12703 This option does nothing unless @option{-ftrapping-math} is in effect.
12705 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
12706 generate a call to a library function then the ``inexact'' exception
12707 may be raised if the library implementation does not follow TS 18661.
12709 @item -fsingle-precision-constant
12710 @opindex fsingle-precision-constant
12711 Treat floating-point constants as single precision instead of
12712 implicitly converting them to double-precision constants.
12714 @item -fcx-limited-range
12715 @opindex fcx-limited-range
12716 When enabled, this option states that a range reduction step is not
12717 needed when performing complex division.  Also, there is no checking
12718 whether the result of a complex multiplication or division is @code{NaN
12719 + I*NaN}, with an attempt to rescue the situation in that case.  The
12720 default is @option{-fno-cx-limited-range}, but is enabled by
12721 @option{-ffast-math}.
12723 This option controls the default setting of the ISO C99
12724 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
12725 all languages.
12727 @item -fcx-fortran-rules
12728 @opindex fcx-fortran-rules
12729 Complex multiplication and division follow Fortran rules.  Range
12730 reduction is done as part of complex division, but there is no checking
12731 whether the result of a complex multiplication or division is @code{NaN
12732 + I*NaN}, with an attempt to rescue the situation in that case.
12734 The default is @option{-fno-cx-fortran-rules}.
12736 @end table
12738 The following options control optimizations that may improve
12739 performance, but are not enabled by any @option{-O} options.  This
12740 section includes experimental options that may produce broken code.
12742 @table @gcctabopt
12743 @item -fbranch-probabilities
12744 @opindex fbranch-probabilities
12745 After running a program compiled with @option{-fprofile-arcs}
12746 (@pxref{Instrumentation Options}),
12747 you can compile it a second time using
12748 @option{-fbranch-probabilities}, to improve optimizations based on
12749 the number of times each branch was taken.  When a program
12750 compiled with @option{-fprofile-arcs} exits, it saves arc execution
12751 counts to a file called @file{@var{sourcename}.gcda} for each source
12752 file.  The information in this data file is very dependent on the
12753 structure of the generated code, so you must use the same source code
12754 and the same optimization options for both compilations.
12756 With @option{-fbranch-probabilities}, GCC puts a
12757 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
12758 These can be used to improve optimization.  Currently, they are only
12759 used in one place: in @file{reorg.c}, instead of guessing which path a
12760 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
12761 exactly determine which path is taken more often.
12763 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
12765 @item -fprofile-values
12766 @opindex fprofile-values
12767 If combined with @option{-fprofile-arcs}, it adds code so that some
12768 data about values of expressions in the program is gathered.
12770 With @option{-fbranch-probabilities}, it reads back the data gathered
12771 from profiling values of expressions for usage in optimizations.
12773 Enabled by @option{-fprofile-generate}, @option{-fprofile-use}, and
12774 @option{-fauto-profile}.
12776 @item -fprofile-reorder-functions
12777 @opindex fprofile-reorder-functions
12778 Function reordering based on profile instrumentation collects
12779 first time of execution of a function and orders these functions
12780 in ascending order.
12782 Enabled with @option{-fprofile-use}.
12784 @item -fvpt
12785 @opindex fvpt
12786 If combined with @option{-fprofile-arcs}, this option instructs the compiler
12787 to add code to gather information about values of expressions.
12789 With @option{-fbranch-probabilities}, it reads back the data gathered
12790 and actually performs the optimizations based on them.
12791 Currently the optimizations include specialization of division operations
12792 using the knowledge about the value of the denominator.
12794 Enabled with @option{-fprofile-use} and @option{-fauto-profile}.
12796 @item -frename-registers
12797 @opindex frename-registers
12798 Attempt to avoid false dependencies in scheduled code by making use
12799 of registers left over after register allocation.  This optimization
12800 most benefits processors with lots of registers.  Depending on the
12801 debug information format adopted by the target, however, it can
12802 make debugging impossible, since variables no longer stay in
12803 a ``home register''.
12805 Enabled by default with @option{-funroll-loops}.
12807 @item -fschedule-fusion
12808 @opindex fschedule-fusion
12809 Performs a target dependent pass over the instruction stream to schedule
12810 instructions of same type together because target machine can execute them
12811 more efficiently if they are adjacent to each other in the instruction flow.
12813 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
12815 @item -ftracer
12816 @opindex ftracer
12817 Perform tail duplication to enlarge superblock size.  This transformation
12818 simplifies the control flow of the function allowing other optimizations to do
12819 a better job.
12821 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
12823 @item -funroll-loops
12824 @opindex funroll-loops
12825 Unroll loops whose number of iterations can be determined at compile time or
12826 upon entry to the loop.  @option{-funroll-loops} implies
12827 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
12828 It also turns on complete loop peeling (i.e.@: complete removal of loops with
12829 a small constant number of iterations).  This option makes code larger, and may
12830 or may not make it run faster.
12832 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
12834 @item -funroll-all-loops
12835 @opindex funroll-all-loops
12836 Unroll all loops, even if their number of iterations is uncertain when
12837 the loop is entered.  This usually makes programs run more slowly.
12838 @option{-funroll-all-loops} implies the same options as
12839 @option{-funroll-loops}.
12841 @item -fpeel-loops
12842 @opindex fpeel-loops
12843 Peels loops for which there is enough information that they do not
12844 roll much (from profile feedback or static analysis).  It also turns on
12845 complete loop peeling (i.e.@: complete removal of loops with small constant
12846 number of iterations).
12848 Enabled by @option{-O3}, @option{-fprofile-use}, and @option{-fauto-profile}.
12850 @item -fmove-loop-invariants
12851 @opindex fmove-loop-invariants
12852 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
12853 at level @option{-O1} and higher, except for @option{-Og}.
12855 @item -fsplit-loops
12856 @opindex fsplit-loops
12857 Split a loop into two if it contains a condition that's always true
12858 for one side of the iteration space and false for the other.
12860 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
12862 @item -funswitch-loops
12863 @opindex funswitch-loops
12864 Move branches with loop invariant conditions out of the loop, with duplicates
12865 of the loop on both branches (modified according to result of the condition).
12867 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
12869 @item -fversion-loops-for-strides
12870 @opindex fversion-loops-for-strides
12871 If a loop iterates over an array with a variable stride, create another
12872 version of the loop that assumes the stride is always one.  For example:
12874 @smallexample
12875 for (int i = 0; i < n; ++i)
12876   x[i * stride] = @dots{};
12877 @end smallexample
12879 becomes:
12881 @smallexample
12882 if (stride == 1)
12883   for (int i = 0; i < n; ++i)
12884     x[i] = @dots{};
12885 else
12886   for (int i = 0; i < n; ++i)
12887     x[i * stride] = @dots{};
12888 @end smallexample
12890 This is particularly useful for assumed-shape arrays in Fortran where
12891 (for example) it allows better vectorization assuming contiguous accesses.
12892 This flag is enabled by default at @option{-O3}.
12893 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
12895 @item -ffunction-sections
12896 @itemx -fdata-sections
12897 @opindex ffunction-sections
12898 @opindex fdata-sections
12899 Place each function or data item into its own section in the output
12900 file if the target supports arbitrary sections.  The name of the
12901 function or the name of the data item determines the section's name
12902 in the output file.
12904 Use these options on systems where the linker can perform optimizations to
12905 improve locality of reference in the instruction space.  Most systems using the
12906 ELF object format have linkers with such optimizations.  On AIX, the linker
12907 rearranges sections (CSECTs) based on the call graph.  The performance impact
12908 varies.
12910 Together with a linker garbage collection (linker @option{--gc-sections}
12911 option) these options may lead to smaller statically-linked executables (after
12912 stripping).
12914 On ELF/DWARF systems these options do not degenerate the quality of the debug
12915 information.  There could be issues with other object files/debug info formats.
12917 Only use these options when there are significant benefits from doing so.  When
12918 you specify these options, the assembler and linker create larger object and
12919 executable files and are also slower.  These options affect code generation.
12920 They prevent optimizations by the compiler and assembler using relative
12921 locations inside a translation unit since the locations are unknown until
12922 link time.  An example of such an optimization is relaxing calls to short call
12923 instructions.
12925 @item -fstdarg-opt
12926 @opindex fstdarg-opt
12927 Optimize the prologue of variadic argument functions with respect to usage of
12928 those arguments.
12930 @item -fsection-anchors
12931 @opindex fsection-anchors
12932 Try to reduce the number of symbolic address calculations by using
12933 shared ``anchor'' symbols to address nearby objects.  This transformation
12934 can help to reduce the number of GOT entries and GOT accesses on some
12935 targets.
12937 For example, the implementation of the following function @code{foo}:
12939 @smallexample
12940 static int a, b, c;
12941 int foo (void) @{ return a + b + c; @}
12942 @end smallexample
12944 @noindent
12945 usually calculates the addresses of all three variables, but if you
12946 compile it with @option{-fsection-anchors}, it accesses the variables
12947 from a common anchor point instead.  The effect is similar to the
12948 following pseudocode (which isn't valid C):
12950 @smallexample
12951 int foo (void)
12953   register int *xr = &x;
12954   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
12956 @end smallexample
12958 Not all targets support this option.
12960 @item -fzero-call-used-regs=@var{choice}
12961 @opindex fzero-call-used-regs
12962 Zero call-used registers at function return to increase program
12963 security by either mitigating Return-Oriented Programming (ROP)
12964 attacks or preventing information leakage through registers.
12966 The possible values of @var{choice} are the same as for the
12967 @code{zero_call_used_regs} attribute (@pxref{Function Attributes}).
12968 The default is @samp{skip}.
12970 You can control this behavior for a specific function by using the function
12971 attribute @code{zero_call_used_regs} (@pxref{Function Attributes}).
12973 @item --param @var{name}=@var{value}
12974 @opindex param
12975 In some places, GCC uses various constants to control the amount of
12976 optimization that is done.  For example, GCC does not inline functions
12977 that contain more than a certain number of instructions.  You can
12978 control some of these constants on the command line using the
12979 @option{--param} option.
12981 The names of specific parameters, and the meaning of the values, are
12982 tied to the internals of the compiler, and are subject to change
12983 without notice in future releases.
12985 In order to get minimal, maximal and default value of a parameter,
12986 one can use @option{--help=param -Q} options.
12988 In each case, the @var{value} is an integer.  The following choices
12989 of @var{name} are recognized for all targets:
12991 @table @gcctabopt
12992 @item predictable-branch-outcome
12993 When branch is predicted to be taken with probability lower than this threshold
12994 (in percent), then it is considered well predictable.
12996 @item max-rtl-if-conversion-insns
12997 RTL if-conversion tries to remove conditional branches around a block and
12998 replace them with conditionally executed instructions.  This parameter
12999 gives the maximum number of instructions in a block which should be
13000 considered for if-conversion.  The compiler will
13001 also use other heuristics to decide whether if-conversion is likely to be
13002 profitable.
13004 @item max-rtl-if-conversion-predictable-cost
13005 @itemx max-rtl-if-conversion-unpredictable-cost
13006 RTL if-conversion will try to remove conditional branches around a block
13007 and replace them with conditionally executed instructions.  These parameters
13008 give the maximum permissible cost for the sequence that would be generated
13009 by if-conversion depending on whether the branch is statically determined
13010 to be predictable or not.  The units for this parameter are the same as
13011 those for the GCC internal seq_cost metric.  The compiler will try to
13012 provide a reasonable default for this parameter using the BRANCH_COST
13013 target macro.
13015 @item max-crossjump-edges
13016 The maximum number of incoming edges to consider for cross-jumping.
13017 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
13018 the number of edges incoming to each block.  Increasing values mean
13019 more aggressive optimization, making the compilation time increase with
13020 probably small improvement in executable size.
13022 @item min-crossjump-insns
13023 The minimum number of instructions that must be matched at the end
13024 of two blocks before cross-jumping is performed on them.  This
13025 value is ignored in the case where all instructions in the block being
13026 cross-jumped from are matched.
13028 @item max-grow-copy-bb-insns
13029 The maximum code size expansion factor when copying basic blocks
13030 instead of jumping.  The expansion is relative to a jump instruction.
13032 @item max-goto-duplication-insns
13033 The maximum number of instructions to duplicate to a block that jumps
13034 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
13035 passes, GCC factors computed gotos early in the compilation process,
13036 and unfactors them as late as possible.  Only computed jumps at the
13037 end of a basic blocks with no more than max-goto-duplication-insns are
13038 unfactored.
13040 @item max-delay-slot-insn-search
13041 The maximum number of instructions to consider when looking for an
13042 instruction to fill a delay slot.  If more than this arbitrary number of
13043 instructions are searched, the time savings from filling the delay slot
13044 are minimal, so stop searching.  Increasing values mean more
13045 aggressive optimization, making the compilation time increase with probably
13046 small improvement in execution time.
13048 @item max-delay-slot-live-search
13049 When trying to fill delay slots, the maximum number of instructions to
13050 consider when searching for a block with valid live register
13051 information.  Increasing this arbitrarily chosen value means more
13052 aggressive optimization, increasing the compilation time.  This parameter
13053 should be removed when the delay slot code is rewritten to maintain the
13054 control-flow graph.
13056 @item max-gcse-memory
13057 The approximate maximum amount of memory that can be allocated in
13058 order to perform the global common subexpression elimination
13059 optimization.  If more memory than specified is required, the
13060 optimization is not done.
13062 @item max-gcse-insertion-ratio
13063 If the ratio of expression insertions to deletions is larger than this value
13064 for any expression, then RTL PRE inserts or removes the expression and thus
13065 leaves partially redundant computations in the instruction stream.
13067 @item max-pending-list-length
13068 The maximum number of pending dependencies scheduling allows
13069 before flushing the current state and starting over.  Large functions
13070 with few branches or calls can create excessively large lists which
13071 needlessly consume memory and resources.
13073 @item max-modulo-backtrack-attempts
13074 The maximum number of backtrack attempts the scheduler should make
13075 when modulo scheduling a loop.  Larger values can exponentially increase
13076 compilation time.
13078 @item max-inline-insns-single
13079 Several parameters control the tree inliner used in GCC@.  This number sets the
13080 maximum number of instructions (counted in GCC's internal representation) in a
13081 single function that the tree inliner considers for inlining.  This only
13082 affects functions declared inline and methods implemented in a class
13083 declaration (C++). 
13086 @item max-inline-insns-auto
13087 When you use @option{-finline-functions} (included in @option{-O3}),
13088 a lot of functions that would otherwise not be considered for inlining
13089 by the compiler are investigated.  To those functions, a different
13090 (more restrictive) limit compared to functions declared inline can
13091 be applied (@option{--param max-inline-insns-auto}).
13093 @item max-inline-insns-small
13094 This is bound applied to calls which are considered relevant with
13095 @option{-finline-small-functions}.
13097 @item max-inline-insns-size
13098 This is bound applied to calls which are optimized for size. Small growth
13099 may be desirable to anticipate optimization oppurtunities exposed by inlining.
13101 @item uninlined-function-insns
13102 Number of instructions accounted by inliner for function overhead such as
13103 function prologue and epilogue.
13105 @item uninlined-function-time
13106 Extra time accounted by inliner for function overhead such as time needed to
13107 execute function prologue and epilogue
13109 @item inline-heuristics-hint-percent
13110 The scale (in percents) applied to @option{inline-insns-single},
13111 @option{inline-insns-single-O2}, @option{inline-insns-auto}
13112 when inline heuristics hints that inlining is
13113 very profitable (will enable later optimizations).
13115 @item uninlined-thunk-insns
13116 @item uninlined-thunk-time
13117 Same as @option{--param uninlined-function-insns} and
13118 @option{--param uninlined-function-time} but applied to function thunks
13120 @item inline-min-speedup
13121 When estimated performance improvement of caller + callee runtime exceeds this
13122 threshold (in percent), the function can be inlined regardless of the limit on
13123 @option{--param max-inline-insns-single} and @option{--param
13124 max-inline-insns-auto}.
13126 @item large-function-insns
13127 The limit specifying really large functions.  For functions larger than this
13128 limit after inlining, inlining is constrained by
13129 @option{--param large-function-growth}.  This parameter is useful primarily
13130 to avoid extreme compilation time caused by non-linear algorithms used by the
13131 back end.
13133 @item large-function-growth
13134 Specifies maximal growth of large function caused by inlining in percents.
13135 For example, parameter value 100 limits large function growth to 2.0 times
13136 the original size.
13138 @item large-unit-insns
13139 The limit specifying large translation unit.  Growth caused by inlining of
13140 units larger than this limit is limited by @option{--param inline-unit-growth}.
13141 For small units this might be too tight.
13142 For example, consider a unit consisting of function A
13143 that is inline and B that just calls A three times.  If B is small relative to
13144 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
13145 large units consisting of small inlineable functions, however, the overall unit
13146 growth limit is needed to avoid exponential explosion of code size.  Thus for
13147 smaller units, the size is increased to @option{--param large-unit-insns}
13148 before applying @option{--param inline-unit-growth}.
13150 @item lazy-modules
13151 Maximum number of concurrently open C++ module files when lazy loading.
13153 @item inline-unit-growth
13154 Specifies maximal overall growth of the compilation unit caused by inlining.
13155 For example, parameter value 20 limits unit growth to 1.2 times the original
13156 size. Cold functions (either marked cold via an attribute or by profile
13157 feedback) are not accounted into the unit size.
13159 @item ipa-cp-unit-growth
13160 Specifies maximal overall growth of the compilation unit caused by
13161 interprocedural constant propagation.  For example, parameter value 10 limits
13162 unit growth to 1.1 times the original size.
13164 @item ipa-cp-large-unit-insns
13165 The size of translation unit that IPA-CP pass considers large.
13167 @item large-stack-frame
13168 The limit specifying large stack frames.  While inlining the algorithm is trying
13169 to not grow past this limit too much.
13171 @item large-stack-frame-growth
13172 Specifies maximal growth of large stack frames caused by inlining in percents.
13173 For example, parameter value 1000 limits large stack frame growth to 11 times
13174 the original size.
13176 @item max-inline-insns-recursive
13177 @itemx max-inline-insns-recursive-auto
13178 Specifies the maximum number of instructions an out-of-line copy of a
13179 self-recursive inline
13180 function can grow into by performing recursive inlining.
13182 @option{--param max-inline-insns-recursive} applies to functions
13183 declared inline.
13184 For functions not declared inline, recursive inlining
13185 happens only when @option{-finline-functions} (included in @option{-O3}) is
13186 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.
13188 @item max-inline-recursive-depth
13189 @itemx max-inline-recursive-depth-auto
13190 Specifies the maximum recursion depth used for recursive inlining.
13192 @option{--param max-inline-recursive-depth} applies to functions
13193 declared inline.  For functions not declared inline, recursive inlining
13194 happens only when @option{-finline-functions} (included in @option{-O3}) is
13195 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.
13197 @item min-inline-recursive-probability
13198 Recursive inlining is profitable only for function having deep recursion
13199 in average and can hurt for function having little recursion depth by
13200 increasing the prologue size or complexity of function body to other
13201 optimizers.
13203 When profile feedback is available (see @option{-fprofile-generate}) the actual
13204 recursion depth can be guessed from the probability that function recurses
13205 via a given call expression.  This parameter limits inlining only to call
13206 expressions whose probability exceeds the given threshold (in percents).
13208 @item early-inlining-insns
13209 Specify growth that the early inliner can make.  In effect it increases
13210 the amount of inlining for code having a large abstraction penalty.
13212 @item max-early-inliner-iterations
13213 Limit of iterations of the early inliner.  This basically bounds
13214 the number of nested indirect calls the early inliner can resolve.
13215 Deeper chains are still handled by late inlining.
13217 @item comdat-sharing-probability
13218 Probability (in percent) that C++ inline function with comdat visibility
13219 are shared across multiple compilation units.
13221 @item modref-max-bases
13222 @item modref-max-refs
13223 @item modref-max-accesses
13224 Specifies the maximal number of base pointers, referneces and accesses stored
13225 for a single function by mod/ref analysis.
13227 @item modref-max-tests
13228 Specifies the maxmal number of tests alias oracle can perform to disambiguate
13229 memory locations using the mod/ref information.  This parameter ought to be
13230 bigger than @option{--param modref-max-bases} and @option{--param
13231 modref-max-refs}.
13233 @item modref-max-depth
13234 Specifies the maximum depth of DFS walk used by modref escape analysis.
13235 Setting to 0 disables the analysis completely.
13237 @item modref-max-escape-points
13238 Specifies the maximum number of escape points tracked by modref per SSA-name.
13240 @item profile-func-internal-id
13241 A parameter to control whether to use function internal id in profile
13242 database lookup. If the value is 0, the compiler uses an id that
13243 is based on function assembler name and filename, which makes old profile
13244 data more tolerant to source changes such as function reordering etc.
13246 @item min-vect-loop-bound
13247 The minimum number of iterations under which loops are not vectorized
13248 when @option{-ftree-vectorize} is used.  The number of iterations after
13249 vectorization needs to be greater than the value specified by this option
13250 to allow vectorization.
13252 @item gcse-cost-distance-ratio
13253 Scaling factor in calculation of maximum distance an expression
13254 can be moved by GCSE optimizations.  This is currently supported only in the
13255 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
13256 is with simple expressions, i.e., the expressions that have cost
13257 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
13258 hoisting of simple expressions.
13260 @item gcse-unrestricted-cost
13261 Cost, roughly measured as the cost of a single typical machine
13262 instruction, at which GCSE optimizations do not constrain
13263 the distance an expression can travel.  This is currently
13264 supported only in the code hoisting pass.  The lesser the cost,
13265 the more aggressive code hoisting is.  Specifying 0 
13266 allows all expressions to travel unrestricted distances.
13268 @item max-hoist-depth
13269 The depth of search in the dominator tree for expressions to hoist.
13270 This is used to avoid quadratic behavior in hoisting algorithm.
13271 The value of 0 does not limit on the search, but may slow down compilation
13272 of huge functions.
13274 @item max-tail-merge-comparisons
13275 The maximum amount of similar bbs to compare a bb with.  This is used to
13276 avoid quadratic behavior in tree tail merging.
13278 @item max-tail-merge-iterations
13279 The maximum amount of iterations of the pass over the function.  This is used to
13280 limit compilation time in tree tail merging.
13282 @item store-merging-allow-unaligned
13283 Allow the store merging pass to introduce unaligned stores if it is legal to
13284 do so.
13286 @item max-stores-to-merge
13287 The maximum number of stores to attempt to merge into wider stores in the store
13288 merging pass.
13290 @item max-unrolled-insns
13291 The maximum number of instructions that a loop may have to be unrolled.
13292 If a loop is unrolled, this parameter also determines how many times
13293 the loop code is unrolled.
13295 @item max-average-unrolled-insns
13296 The maximum number of instructions biased by probabilities of their execution
13297 that a loop may have to be unrolled.  If a loop is unrolled,
13298 this parameter also determines how many times the loop code is unrolled.
13300 @item max-unroll-times
13301 The maximum number of unrollings of a single loop.
13303 @item max-peeled-insns
13304 The maximum number of instructions that a loop may have to be peeled.
13305 If a loop is peeled, this parameter also determines how many times
13306 the loop code is peeled.
13308 @item max-peel-times
13309 The maximum number of peelings of a single loop.
13311 @item max-peel-branches
13312 The maximum number of branches on the hot path through the peeled sequence.
13314 @item max-completely-peeled-insns
13315 The maximum number of insns of a completely peeled loop.
13317 @item max-completely-peel-times
13318 The maximum number of iterations of a loop to be suitable for complete peeling.
13320 @item max-completely-peel-loop-nest-depth
13321 The maximum depth of a loop nest suitable for complete peeling.
13323 @item max-unswitch-insns
13324 The maximum number of insns of an unswitched loop.
13326 @item max-unswitch-level
13327 The maximum number of branches unswitched in a single loop.
13329 @item lim-expensive
13330 The minimum cost of an expensive expression in the loop invariant motion.
13332 @item min-loop-cond-split-prob
13333 When FDO profile information is available, @option{min-loop-cond-split-prob}
13334 specifies minimum threshold for probability of semi-invariant condition
13335 statement to trigger loop split.
13337 @item iv-consider-all-candidates-bound
13338 Bound on number of candidates for induction variables, below which
13339 all candidates are considered for each use in induction variable
13340 optimizations.  If there are more candidates than this,
13341 only the most relevant ones are considered to avoid quadratic time complexity.
13343 @item iv-max-considered-uses
13344 The induction variable optimizations give up on loops that contain more
13345 induction variable uses.
13347 @item iv-always-prune-cand-set-bound
13348 If the number of candidates in the set is smaller than this value,
13349 always try to remove unnecessary ivs from the set
13350 when adding a new one.
13352 @item avg-loop-niter
13353 Average number of iterations of a loop.
13355 @item dse-max-object-size
13356 Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
13357 Larger values may result in larger compilation times.
13359 @item dse-max-alias-queries-per-store
13360 Maximum number of queries into the alias oracle per store.
13361 Larger values result in larger compilation times and may result in more
13362 removed dead stores.
13364 @item scev-max-expr-size
13365 Bound on size of expressions used in the scalar evolutions analyzer.
13366 Large expressions slow the analyzer.
13368 @item scev-max-expr-complexity
13369 Bound on the complexity of the expressions in the scalar evolutions analyzer.
13370 Complex expressions slow the analyzer.
13372 @item max-tree-if-conversion-phi-args
13373 Maximum number of arguments in a PHI supported by TREE if conversion
13374 unless the loop is marked with simd pragma.
13376 @item vect-max-version-for-alignment-checks
13377 The maximum number of run-time checks that can be performed when
13378 doing loop versioning for alignment in the vectorizer.
13380 @item vect-max-version-for-alias-checks
13381 The maximum number of run-time checks that can be performed when
13382 doing loop versioning for alias in the vectorizer.
13384 @item vect-max-peeling-for-alignment
13385 The maximum number of loop peels to enhance access alignment
13386 for vectorizer. Value -1 means no limit.
13388 @item max-iterations-to-track
13389 The maximum number of iterations of a loop the brute-force algorithm
13390 for analysis of the number of iterations of the loop tries to evaluate.
13392 @item hot-bb-count-fraction
13393 The denominator n of fraction 1/n of the maximal execution count of a
13394 basic block in the entire program that a basic block needs to at least
13395 have in order to be considered hot.  The default is 10000, which means
13396 that a basic block is considered hot if its execution count is greater
13397 than 1/10000 of the maximal execution count.  0 means that it is never
13398 considered hot.  Used in non-LTO mode.
13400 @item hot-bb-count-ws-permille
13401 The number of most executed permilles, ranging from 0 to 1000, of the
13402 profiled execution of the entire program to which the execution count
13403 of a basic block must be part of in order to be considered hot.  The
13404 default is 990, which means that a basic block is considered hot if
13405 its execution count contributes to the upper 990 permilles, or 99.0%,
13406 of the profiled execution of the entire program.  0 means that it is
13407 never considered hot.  Used in LTO mode.
13409 @item hot-bb-frequency-fraction
13410 The denominator n of fraction 1/n of the execution frequency of the
13411 entry block of a function that a basic block of this function needs
13412 to at least have in order to be considered hot.  The default is 1000,
13413 which means that a basic block is considered hot in a function if it
13414 is executed more frequently than 1/1000 of the frequency of the entry
13415 block of the function.  0 means that it is never considered hot.
13417 @item unlikely-bb-count-fraction
13418 The denominator n of fraction 1/n of the number of profiled runs of
13419 the entire program below which the execution count of a basic block
13420 must be in order for the basic block to be considered unlikely executed.
13421 The default is 20, which means that a basic block is considered unlikely
13422 executed if it is executed in fewer than 1/20, or 5%, of the runs of
13423 the program.  0 means that it is always considered unlikely executed.
13425 @item max-predicted-iterations
13426 The maximum number of loop iterations we predict statically.  This is useful
13427 in cases where a function contains a single loop with known bound and
13428 another loop with unknown bound.
13429 The known number of iterations is predicted correctly, while
13430 the unknown number of iterations average to roughly 10.  This means that the
13431 loop without bounds appears artificially cold relative to the other one.
13433 @item builtin-expect-probability
13434 Control the probability of the expression having the specified value. This
13435 parameter takes a percentage (i.e.@: 0 ... 100) as input.
13437 @item builtin-string-cmp-inline-length
13438 The maximum length of a constant string for a builtin string cmp call 
13439 eligible for inlining.
13441 @item align-threshold
13443 Select fraction of the maximal frequency of executions of a basic block in
13444 a function to align the basic block.
13446 @item align-loop-iterations
13448 A loop expected to iterate at least the selected number of iterations is
13449 aligned.
13451 @item tracer-dynamic-coverage
13452 @itemx tracer-dynamic-coverage-feedback
13454 This value is used to limit superblock formation once the given percentage of
13455 executed instructions is covered.  This limits unnecessary code size
13456 expansion.
13458 The @option{tracer-dynamic-coverage-feedback} parameter
13459 is used only when profile
13460 feedback is available.  The real profiles (as opposed to statically estimated
13461 ones) are much less balanced allowing the threshold to be larger value.
13463 @item tracer-max-code-growth
13464 Stop tail duplication once code growth has reached given percentage.  This is
13465 a rather artificial limit, as most of the duplicates are eliminated later in
13466 cross jumping, so it may be set to much higher values than is the desired code
13467 growth.
13469 @item tracer-min-branch-ratio
13471 Stop reverse growth when the reverse probability of best edge is less than this
13472 threshold (in percent).
13474 @item tracer-min-branch-probability
13475 @itemx tracer-min-branch-probability-feedback
13477 Stop forward growth if the best edge has probability lower than this
13478 threshold.
13480 Similarly to @option{tracer-dynamic-coverage} two parameters are
13481 provided.  @option{tracer-min-branch-probability-feedback} is used for
13482 compilation with profile feedback and @option{tracer-min-branch-probability}
13483 compilation without.  The value for compilation with profile feedback
13484 needs to be more conservative (higher) in order to make tracer
13485 effective.
13487 @item stack-clash-protection-guard-size
13488 Specify the size of the operating system provided stack guard as
13489 2 raised to @var{num} bytes.  Higher values may reduce the
13490 number of explicit probes, but a value larger than the operating system
13491 provided guard will leave code vulnerable to stack clash style attacks.
13493 @item stack-clash-protection-probe-interval
13494 Stack clash protection involves probing stack space as it is allocated.  This
13495 param controls the maximum distance between probes into the stack as 2 raised
13496 to @var{num} bytes.  Higher values may reduce the number of explicit probes, but a value
13497 larger than the operating system provided guard will leave code vulnerable to
13498 stack clash style attacks.
13500 @item max-cse-path-length
13502 The maximum number of basic blocks on path that CSE considers.
13504 @item max-cse-insns
13505 The maximum number of instructions CSE processes before flushing.
13507 @item ggc-min-expand
13509 GCC uses a garbage collector to manage its own memory allocation.  This
13510 parameter specifies the minimum percentage by which the garbage
13511 collector's heap should be allowed to expand between collections.
13512 Tuning this may improve compilation speed; it has no effect on code
13513 generation.
13515 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
13516 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
13517 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
13518 GCC is not able to calculate RAM on a particular platform, the lower
13519 bound of 30% is used.  Setting this parameter and
13520 @option{ggc-min-heapsize} to zero causes a full collection to occur at
13521 every opportunity.  This is extremely slow, but can be useful for
13522 debugging.
13524 @item ggc-min-heapsize
13526 Minimum size of the garbage collector's heap before it begins bothering
13527 to collect garbage.  The first collection occurs after the heap expands
13528 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
13529 tuning this may improve compilation speed, and has no effect on code
13530 generation.
13532 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
13533 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
13534 with a lower bound of 4096 (four megabytes) and an upper bound of
13535 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
13536 particular platform, the lower bound is used.  Setting this parameter
13537 very large effectively disables garbage collection.  Setting this
13538 parameter and @option{ggc-min-expand} to zero causes a full collection
13539 to occur at every opportunity.
13541 @item max-reload-search-insns
13542 The maximum number of instruction reload should look backward for equivalent
13543 register.  Increasing values mean more aggressive optimization, making the
13544 compilation time increase with probably slightly better performance.
13546 @item max-cselib-memory-locations
13547 The maximum number of memory locations cselib should take into account.
13548 Increasing values mean more aggressive optimization, making the compilation time
13549 increase with probably slightly better performance.
13551 @item max-sched-ready-insns
13552 The maximum number of instructions ready to be issued the scheduler should
13553 consider at any given time during the first scheduling pass.  Increasing
13554 values mean more thorough searches, making the compilation time increase
13555 with probably little benefit.
13557 @item max-sched-region-blocks
13558 The maximum number of blocks in a region to be considered for
13559 interblock scheduling.
13561 @item max-pipeline-region-blocks
13562 The maximum number of blocks in a region to be considered for
13563 pipelining in the selective scheduler.
13565 @item max-sched-region-insns
13566 The maximum number of insns in a region to be considered for
13567 interblock scheduling.
13569 @item max-pipeline-region-insns
13570 The maximum number of insns in a region to be considered for
13571 pipelining in the selective scheduler.
13573 @item min-spec-prob
13574 The minimum probability (in percents) of reaching a source block
13575 for interblock speculative scheduling.
13577 @item max-sched-extend-regions-iters
13578 The maximum number of iterations through CFG to extend regions.
13579 A value of 0 disables region extensions.
13581 @item max-sched-insn-conflict-delay
13582 The maximum conflict delay for an insn to be considered for speculative motion.
13584 @item sched-spec-prob-cutoff
13585 The minimal probability of speculation success (in percents), so that
13586 speculative insns are scheduled.
13588 @item sched-state-edge-prob-cutoff
13589 The minimum probability an edge must have for the scheduler to save its
13590 state across it.
13592 @item sched-mem-true-dep-cost
13593 Minimal distance (in CPU cycles) between store and load targeting same
13594 memory locations.
13596 @item selsched-max-lookahead
13597 The maximum size of the lookahead window of selective scheduling.  It is a
13598 depth of search for available instructions.
13600 @item selsched-max-sched-times
13601 The maximum number of times that an instruction is scheduled during
13602 selective scheduling.  This is the limit on the number of iterations
13603 through which the instruction may be pipelined.
13605 @item selsched-insns-to-rename
13606 The maximum number of best instructions in the ready list that are considered
13607 for renaming in the selective scheduler.
13609 @item sms-min-sc
13610 The minimum value of stage count that swing modulo scheduler
13611 generates.
13613 @item max-last-value-rtl
13614 The maximum size measured as number of RTLs that can be recorded in an expression
13615 in combiner for a pseudo register as last known value of that register.
13617 @item max-combine-insns
13618 The maximum number of instructions the RTL combiner tries to combine.
13620 @item integer-share-limit
13621 Small integer constants can use a shared data structure, reducing the
13622 compiler's memory usage and increasing its speed.  This sets the maximum
13623 value of a shared integer constant.
13625 @item ssp-buffer-size
13626 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
13627 protection when @option{-fstack-protection} is used.
13629 @item min-size-for-stack-sharing
13630 The minimum size of variables taking part in stack slot sharing when not
13631 optimizing.
13633 @item max-jump-thread-duplication-stmts
13634 Maximum number of statements allowed in a block that needs to be
13635 duplicated when threading jumps.
13637 @item max-fields-for-field-sensitive
13638 Maximum number of fields in a structure treated in
13639 a field sensitive manner during pointer analysis.
13641 @item prefetch-latency
13642 Estimate on average number of instructions that are executed before
13643 prefetch finishes.  The distance prefetched ahead is proportional
13644 to this constant.  Increasing this number may also lead to less
13645 streams being prefetched (see @option{simultaneous-prefetches}).
13647 @item simultaneous-prefetches
13648 Maximum number of prefetches that can run at the same time.
13650 @item l1-cache-line-size
13651 The size of cache line in L1 data cache, in bytes.
13653 @item l1-cache-size
13654 The size of L1 data cache, in kilobytes.
13656 @item l2-cache-size
13657 The size of L2 data cache, in kilobytes.
13659 @item prefetch-dynamic-strides
13660 Whether the loop array prefetch pass should issue software prefetch hints
13661 for strides that are non-constant.  In some cases this may be
13662 beneficial, though the fact the stride is non-constant may make it
13663 hard to predict when there is clear benefit to issuing these hints.
13665 Set to 1 if the prefetch hints should be issued for non-constant
13666 strides.  Set to 0 if prefetch hints should be issued only for strides that
13667 are known to be constant and below @option{prefetch-minimum-stride}.
13669 @item prefetch-minimum-stride
13670 Minimum constant stride, in bytes, to start using prefetch hints for.  If
13671 the stride is less than this threshold, prefetch hints will not be issued.
13673 This setting is useful for processors that have hardware prefetchers, in
13674 which case there may be conflicts between the hardware prefetchers and
13675 the software prefetchers.  If the hardware prefetchers have a maximum
13676 stride they can handle, it should be used here to improve the use of
13677 software prefetchers.
13679 A value of -1 means we don't have a threshold and therefore
13680 prefetch hints can be issued for any constant stride.
13682 This setting is only useful for strides that are known and constant.
13684 @item loop-interchange-max-num-stmts
13685 The maximum number of stmts in a loop to be interchanged.
13687 @item loop-interchange-stride-ratio
13688 The minimum ratio between stride of two loops for interchange to be profitable.
13690 @item min-insn-to-prefetch-ratio
13691 The minimum ratio between the number of instructions and the
13692 number of prefetches to enable prefetching in a loop.
13694 @item prefetch-min-insn-to-mem-ratio
13695 The minimum ratio between the number of instructions and the
13696 number of memory references to enable prefetching in a loop.
13698 @item use-canonical-types
13699 Whether the compiler should use the ``canonical'' type system.
13700 Should always be 1, which uses a more efficient internal
13701 mechanism for comparing types in C++ and Objective-C++.  However, if
13702 bugs in the canonical type system are causing compilation failures,
13703 set this value to 0 to disable canonical types.
13705 @item switch-conversion-max-branch-ratio
13706 Switch initialization conversion refuses to create arrays that are
13707 bigger than @option{switch-conversion-max-branch-ratio} times the number of
13708 branches in the switch.
13710 @item max-partial-antic-length
13711 Maximum length of the partial antic set computed during the tree
13712 partial redundancy elimination optimization (@option{-ftree-pre}) when
13713 optimizing at @option{-O3} and above.  For some sorts of source code
13714 the enhanced partial redundancy elimination optimization can run away,
13715 consuming all of the memory available on the host machine.  This
13716 parameter sets a limit on the length of the sets that are computed,
13717 which prevents the runaway behavior.  Setting a value of 0 for
13718 this parameter allows an unlimited set length.
13720 @item rpo-vn-max-loop-depth
13721 Maximum loop depth that is value-numbered optimistically.
13722 When the limit hits the innermost
13723 @var{rpo-vn-max-loop-depth} loops and the outermost loop in the
13724 loop nest are value-numbered optimistically and the remaining ones not.
13726 @item sccvn-max-alias-queries-per-access
13727 Maximum number of alias-oracle queries we perform when looking for
13728 redundancies for loads and stores.  If this limit is hit the search
13729 is aborted and the load or store is not considered redundant.  The
13730 number of queries is algorithmically limited to the number of
13731 stores on all paths from the load to the function entry.
13733 @item ira-max-loops-num
13734 IRA uses regional register allocation by default.  If a function
13735 contains more loops than the number given by this parameter, only at most
13736 the given number of the most frequently-executed loops form regions
13737 for regional register allocation.
13739 @item ira-max-conflict-table-size 
13740 Although IRA uses a sophisticated algorithm to compress the conflict
13741 table, the table can still require excessive amounts of memory for
13742 huge functions.  If the conflict table for a function could be more
13743 than the size in MB given by this parameter, the register allocator
13744 instead uses a faster, simpler, and lower-quality
13745 algorithm that does not require building a pseudo-register conflict table.  
13747 @item ira-loop-reserved-regs
13748 IRA can be used to evaluate more accurate register pressure in loops
13749 for decisions to move loop invariants (see @option{-O3}).  The number
13750 of available registers reserved for some other purposes is given
13751 by this parameter.  Default of the parameter
13752 is the best found from numerous experiments.
13754 @item lra-inheritance-ebb-probability-cutoff
13755 LRA tries to reuse values reloaded in registers in subsequent insns.
13756 This optimization is called inheritance.  EBB is used as a region to
13757 do this optimization.  The parameter defines a minimal fall-through
13758 edge probability in percentage used to add BB to inheritance EBB in
13759 LRA.  The default value was chosen
13760 from numerous runs of SPEC2000 on x86-64.
13762 @item loop-invariant-max-bbs-in-loop
13763 Loop invariant motion can be very expensive, both in compilation time and
13764 in amount of needed compile-time memory, with very large loops.  Loops
13765 with more basic blocks than this parameter won't have loop invariant
13766 motion optimization performed on them.
13768 @item loop-max-datarefs-for-datadeps
13769 Building data dependencies is expensive for very large loops.  This
13770 parameter limits the number of data references in loops that are
13771 considered for data dependence analysis.  These large loops are no
13772 handled by the optimizations using loop data dependencies.
13774 @item max-vartrack-size
13775 Sets a maximum number of hash table slots to use during variable
13776 tracking dataflow analysis of any function.  If this limit is exceeded
13777 with variable tracking at assignments enabled, analysis for that
13778 function is retried without it, after removing all debug insns from
13779 the function.  If the limit is exceeded even without debug insns, var
13780 tracking analysis is completely disabled for the function.  Setting
13781 the parameter to zero makes it unlimited.
13783 @item max-vartrack-expr-depth
13784 Sets a maximum number of recursion levels when attempting to map
13785 variable names or debug temporaries to value expressions.  This trades
13786 compilation time for more complete debug information.  If this is set too
13787 low, value expressions that are available and could be represented in
13788 debug information may end up not being used; setting this higher may
13789 enable the compiler to find more complex debug expressions, but compile
13790 time and memory use may grow.
13792 @item max-debug-marker-count
13793 Sets a threshold on the number of debug markers (e.g.@: begin stmt
13794 markers) to avoid complexity explosion at inlining or expanding to RTL.
13795 If a function has more such gimple stmts than the set limit, such stmts
13796 will be dropped from the inlined copy of a function, and from its RTL
13797 expansion.
13799 @item min-nondebug-insn-uid
13800 Use uids starting at this parameter for nondebug insns.  The range below
13801 the parameter is reserved exclusively for debug insns created by
13802 @option{-fvar-tracking-assignments}, but debug insns may get
13803 (non-overlapping) uids above it if the reserved range is exhausted.
13805 @item ipa-sra-ptr-growth-factor
13806 IPA-SRA replaces a pointer to an aggregate with one or more new
13807 parameters only when their cumulative size is less or equal to
13808 @option{ipa-sra-ptr-growth-factor} times the size of the original
13809 pointer parameter.
13811 @item ipa-sra-max-replacements
13812 Maximum pieces of an aggregate that IPA-SRA tracks.  As a
13813 consequence, it is also the maximum number of replacements of a formal
13814 parameter.
13816 @item sra-max-scalarization-size-Ospeed
13817 @itemx sra-max-scalarization-size-Osize
13818 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
13819 replace scalar parts of aggregates with uses of independent scalar
13820 variables.  These parameters control the maximum size, in storage units,
13821 of aggregate which is considered for replacement when compiling for
13822 speed
13823 (@option{sra-max-scalarization-size-Ospeed}) or size
13824 (@option{sra-max-scalarization-size-Osize}) respectively.
13826 @item sra-max-propagations
13827 The maximum number of artificial accesses that Scalar Replacement of
13828 Aggregates (SRA) will track, per one local variable, in order to
13829 facilitate copy propagation.
13831 @item tm-max-aggregate-size
13832 When making copies of thread-local variables in a transaction, this
13833 parameter specifies the size in bytes after which variables are
13834 saved with the logging functions as opposed to save/restore code
13835 sequence pairs.  This option only applies when using
13836 @option{-fgnu-tm}.
13838 @item graphite-max-nb-scop-params
13839 To avoid exponential effects in the Graphite loop transforms, the
13840 number of parameters in a Static Control Part (SCoP) is bounded.
13841 A value of zero can be used to lift
13842 the bound.  A variable whose value is unknown at compilation time and
13843 defined outside a SCoP is a parameter of the SCoP.
13845 @item loop-block-tile-size
13846 Loop blocking or strip mining transforms, enabled with
13847 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
13848 loop in the loop nest by a given number of iterations.  The strip
13849 length can be changed using the @option{loop-block-tile-size}
13850 parameter.
13852 @item ipa-jump-function-lookups
13853 Specifies number of statements visited during jump function offset discovery.
13855 @item ipa-cp-value-list-size
13856 IPA-CP attempts to track all possible values and types passed to a function's
13857 parameter in order to propagate them and perform devirtualization.
13858 @option{ipa-cp-value-list-size} is the maximum number of values and types it
13859 stores per one formal parameter of a function.
13861 @item ipa-cp-eval-threshold
13862 IPA-CP calculates its own score of cloning profitability heuristics
13863 and performs those cloning opportunities with scores that exceed
13864 @option{ipa-cp-eval-threshold}.
13866 @item ipa-cp-max-recursive-depth
13867 Maximum depth of recursive cloning for self-recursive function.
13869 @item ipa-cp-min-recursive-probability
13870 Recursive cloning only when the probability of call being executed exceeds
13871 the parameter.
13873 @item ipa-cp-recursion-penalty
13874 Percentage penalty the recursive functions will receive when they
13875 are evaluated for cloning.
13877 @item ipa-cp-single-call-penalty
13878 Percentage penalty functions containing a single call to another
13879 function will receive when they are evaluated for cloning.
13881 @item ipa-max-agg-items
13882 IPA-CP is also capable to propagate a number of scalar values passed
13883 in an aggregate. @option{ipa-max-agg-items} controls the maximum
13884 number of such values per one parameter.
13886 @item ipa-cp-loop-hint-bonus
13887 When IPA-CP determines that a cloning candidate would make the number
13888 of iterations of a loop known, it adds a bonus of
13889 @option{ipa-cp-loop-hint-bonus} to the profitability score of
13890 the candidate.
13892 @item ipa-max-loop-predicates
13893 The maximum number of different predicates IPA will use to describe when
13894 loops in a function have known properties.
13896 @item ipa-max-aa-steps
13897 During its analysis of function bodies, IPA-CP employs alias analysis
13898 in order to track values pointed to by function parameters.  In order
13899 not spend too much time analyzing huge functions, it gives up and
13900 consider all memory clobbered after examining
13901 @option{ipa-max-aa-steps} statements modifying memory.
13903 @item ipa-max-switch-predicate-bounds
13904 Maximal number of boundary endpoints of case ranges of switch statement.
13905 For switch exceeding this limit, IPA-CP will not construct cloning cost
13906 predicate, which is used to estimate cloning benefit, for default case
13907 of the switch statement.
13909 @item ipa-max-param-expr-ops
13910 IPA-CP will analyze conditional statement that references some function
13911 parameter to estimate benefit for cloning upon certain constant value.
13912 But if number of operations in a parameter expression exceeds
13913 @option{ipa-max-param-expr-ops}, the expression is treated as complicated
13914 one, and is not handled by IPA analysis.
13916 @item lto-partitions
13917 Specify desired number of partitions produced during WHOPR compilation.
13918 The number of partitions should exceed the number of CPUs used for compilation.
13920 @item lto-min-partition
13921 Size of minimal partition for WHOPR (in estimated instructions).
13922 This prevents expenses of splitting very small programs into too many
13923 partitions.
13925 @item lto-max-partition
13926 Size of max partition for WHOPR (in estimated instructions).
13927 to provide an upper bound for individual size of partition.
13928 Meant to be used only with balanced partitioning.
13930 @item lto-max-streaming-parallelism
13931 Maximal number of parallel processes used for LTO streaming.
13933 @item cxx-max-namespaces-for-diagnostic-help
13934 The maximum number of namespaces to consult for suggestions when C++
13935 name lookup fails for an identifier.
13937 @item sink-frequency-threshold
13938 The maximum relative execution frequency (in percents) of the target block
13939 relative to a statement's original block to allow statement sinking of a
13940 statement.  Larger numbers result in more aggressive statement sinking.
13941 A small positive adjustment is applied for
13942 statements with memory operands as those are even more profitable so sink.
13944 @item max-stores-to-sink
13945 The maximum number of conditional store pairs that can be sunk.  Set to 0
13946 if either vectorization (@option{-ftree-vectorize}) or if-conversion
13947 (@option{-ftree-loop-if-convert}) is disabled.
13949 @item case-values-threshold
13950 The smallest number of different values for which it is best to use a
13951 jump-table instead of a tree of conditional branches.  If the value is
13952 0, use the default for the machine.
13954 @item jump-table-max-growth-ratio-for-size
13955 The maximum code size growth ratio when expanding
13956 into a jump table (in percent).  The parameter is used when
13957 optimizing for size.
13959 @item jump-table-max-growth-ratio-for-speed
13960 The maximum code size growth ratio when expanding
13961 into a jump table (in percent).  The parameter is used when
13962 optimizing for speed.
13964 @item tree-reassoc-width
13965 Set the maximum number of instructions executed in parallel in
13966 reassociated tree. This parameter overrides target dependent
13967 heuristics used by default if has non zero value.
13969 @item sched-pressure-algorithm
13970 Choose between the two available implementations of
13971 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
13972 and is the more likely to prevent instructions from being reordered.
13973 Algorithm 2 was designed to be a compromise between the relatively
13974 conservative approach taken by algorithm 1 and the rather aggressive
13975 approach taken by the default scheduler.  It relies more heavily on
13976 having a regular register file and accurate register pressure classes.
13977 See @file{haifa-sched.c} in the GCC sources for more details.
13979 The default choice depends on the target.
13981 @item max-slsr-cand-scan
13982 Set the maximum number of existing candidates that are considered when
13983 seeking a basis for a new straight-line strength reduction candidate.
13985 @item asan-globals
13986 Enable buffer overflow detection for global objects.  This kind
13987 of protection is enabled by default if you are using
13988 @option{-fsanitize=address} option.
13989 To disable global objects protection use @option{--param asan-globals=0}.
13991 @item asan-stack
13992 Enable buffer overflow detection for stack objects.  This kind of
13993 protection is enabled by default when using @option{-fsanitize=address}.
13994 To disable stack protection use @option{--param asan-stack=0} option.
13996 @item asan-instrument-reads
13997 Enable buffer overflow detection for memory reads.  This kind of
13998 protection is enabled by default when using @option{-fsanitize=address}.
13999 To disable memory reads protection use
14000 @option{--param asan-instrument-reads=0}.
14002 @item asan-instrument-writes
14003 Enable buffer overflow detection for memory writes.  This kind of
14004 protection is enabled by default when using @option{-fsanitize=address}.
14005 To disable memory writes protection use
14006 @option{--param asan-instrument-writes=0} option.
14008 @item asan-memintrin
14009 Enable detection for built-in functions.  This kind of protection
14010 is enabled by default when using @option{-fsanitize=address}.
14011 To disable built-in functions protection use
14012 @option{--param asan-memintrin=0}.
14014 @item asan-use-after-return
14015 Enable detection of use-after-return.  This kind of protection
14016 is enabled by default when using the @option{-fsanitize=address} option.
14017 To disable it use @option{--param asan-use-after-return=0}.
14019 Note: By default the check is disabled at run time.  To enable it,
14020 add @code{detect_stack_use_after_return=1} to the environment variable
14021 @env{ASAN_OPTIONS}.
14023 @item asan-instrumentation-with-call-threshold
14024 If number of memory accesses in function being instrumented
14025 is greater or equal to this number, use callbacks instead of inline checks.
14026 E.g. to disable inline code use
14027 @option{--param asan-instrumentation-with-call-threshold=0}.
14029 @item hwasan-instrument-stack
14030 Enable hwasan instrumentation of statically sized stack-allocated variables.
14031 This kind of instrumentation is enabled by default when using
14032 @option{-fsanitize=hwaddress} and disabled by default when using
14033 @option{-fsanitize=kernel-hwaddress}.
14034 To disable stack instrumentation use
14035 @option{--param hwasan-instrument-stack=0}, and to enable it use
14036 @option{--param hwasan-instrument-stack=1}.
14038 @item hwasan-random-frame-tag
14039 When using stack instrumentation, decide tags for stack variables using a
14040 deterministic sequence beginning at a random tag for each frame.  With this
14041 parameter unset tags are chosen using the same sequence but beginning from 1.
14042 This is enabled by default for @option{-fsanitize=hwaddress} and unavailable
14043 for @option{-fsanitize=kernel-hwaddress}.
14044 To disable it use @option{--param hwasan-random-frame-tag=0}.
14046 @item hwasan-instrument-allocas
14047 Enable hwasan instrumentation of dynamically sized stack-allocated variables.
14048 This kind of instrumentation is enabled by default when using
14049 @option{-fsanitize=hwaddress} and disabled by default when using
14050 @option{-fsanitize=kernel-hwaddress}.
14051 To disable instrumentation of such variables use
14052 @option{--param hwasan-instrument-allocas=0}, and to enable it use
14053 @option{--param hwasan-instrument-allocas=1}.
14055 @item hwasan-instrument-reads
14056 Enable hwasan checks on memory reads.  Instrumentation of reads is enabled by
14057 default for both @option{-fsanitize=hwaddress} and
14058 @option{-fsanitize=kernel-hwaddress}.
14059 To disable checking memory reads use
14060 @option{--param hwasan-instrument-reads=0}.
14062 @item hwasan-instrument-writes
14063 Enable hwasan checks on memory writes.  Instrumentation of writes is enabled by
14064 default for both @option{-fsanitize=hwaddress} and
14065 @option{-fsanitize=kernel-hwaddress}.
14066 To disable checking memory writes use
14067 @option{--param hwasan-instrument-writes=0}.
14069 @item hwasan-instrument-mem-intrinsics
14070 Enable hwasan instrumentation of builtin functions.  Instrumentation of these
14071 builtin functions is enabled by default for both @option{-fsanitize=hwaddress}
14072 and @option{-fsanitize=kernel-hwaddress}.
14073 To disable instrumentation of builtin functions use
14074 @option{--param hwasan-instrument-mem-intrinsics=0}.
14076 @item use-after-scope-direct-emission-threshold
14077 If the size of a local variable in bytes is smaller or equal to this
14078 number, directly poison (or unpoison) shadow memory instead of using
14079 run-time callbacks.
14081 @item tsan-distinguish-volatile
14082 Emit special instrumentation for accesses to volatiles.
14084 @item tsan-instrument-func-entry-exit
14085 Emit instrumentation calls to __tsan_func_entry() and __tsan_func_exit().
14087 @item max-fsm-thread-path-insns
14088 Maximum number of instructions to copy when duplicating blocks on a
14089 finite state automaton jump thread path.
14091 @item max-fsm-thread-length
14092 Maximum number of basic blocks on a finite state automaton jump thread
14093 path.
14095 @item max-fsm-thread-paths
14096 Maximum number of new jump thread paths to create for a finite state
14097 automaton.
14099 @item parloops-chunk-size
14100 Chunk size of omp schedule for loops parallelized by parloops.
14102 @item parloops-schedule
14103 Schedule type of omp schedule for loops parallelized by parloops (static,
14104 dynamic, guided, auto, runtime).
14106 @item parloops-min-per-thread
14107 The minimum number of iterations per thread of an innermost parallelized
14108 loop for which the parallelized variant is preferred over the single threaded
14109 one.  Note that for a parallelized loop nest the
14110 minimum number of iterations of the outermost loop per thread is two.
14112 @item max-ssa-name-query-depth
14113 Maximum depth of recursion when querying properties of SSA names in things
14114 like fold routines.  One level of recursion corresponds to following a
14115 use-def chain.
14117 @item max-speculative-devirt-maydefs
14118 The maximum number of may-defs we analyze when looking for a must-def
14119 specifying the dynamic type of an object that invokes a virtual call
14120 we may be able to devirtualize speculatively.
14122 @item max-vrp-switch-assertions
14123 The maximum number of assertions to add along the default edge of a switch
14124 statement during VRP.
14126 @item evrp-mode
14127 Specifies the mode Early VRP should operate in.
14129 @item unroll-jam-min-percent
14130 The minimum percentage of memory references that must be optimized
14131 away for the unroll-and-jam transformation to be considered profitable.
14133 @item unroll-jam-max-unroll
14134 The maximum number of times the outer loop should be unrolled by
14135 the unroll-and-jam transformation.
14137 @item max-rtl-if-conversion-unpredictable-cost
14138 Maximum permissible cost for the sequence that would be generated
14139 by the RTL if-conversion pass for a branch that is considered unpredictable.
14141 @item max-variable-expansions-in-unroller
14142 If @option{-fvariable-expansion-in-unroller} is used, the maximum number
14143 of times that an individual variable will be expanded during loop unrolling.
14145 @item tracer-min-branch-probability-feedback
14146 Stop forward growth if the probability of best edge is less than
14147 this threshold (in percent). Used when profile feedback is available.
14149 @item partial-inlining-entry-probability
14150 Maximum probability of the entry BB of split region
14151 (in percent relative to entry BB of the function)
14152 to make partial inlining happen.
14154 @item max-tracked-strlens
14155 Maximum number of strings for which strlen optimization pass will
14156 track string lengths.
14158 @item gcse-after-reload-partial-fraction
14159 The threshold ratio for performing partial redundancy
14160 elimination after reload.
14162 @item gcse-after-reload-critical-fraction
14163 The threshold ratio of critical edges execution count that
14164 permit performing redundancy elimination after reload.
14166 @item max-loop-header-insns
14167 The maximum number of insns in loop header duplicated
14168 by the copy loop headers pass.
14170 @item vect-epilogues-nomask
14171 Enable loop epilogue vectorization using smaller vector size.
14173 @item vect-partial-vector-usage
14174 Controls when the loop vectorizer considers using partial vector loads
14175 and stores as an alternative to falling back to scalar code.  0 stops
14176 the vectorizer from ever using partial vector loads and stores.  1 allows
14177 partial vector loads and stores if vectorization removes the need for the
14178 code to iterate.  2 allows partial vector loads and stores in all loops.
14179 The parameter only has an effect on targets that support partial
14180 vector loads and stores.
14182 @item avoid-fma-max-bits
14183 Maximum number of bits for which we avoid creating FMAs.
14185 @item sms-loop-average-count-threshold
14186 A threshold on the average loop count considered by the swing modulo scheduler.
14188 @item sms-dfa-history
14189 The number of cycles the swing modulo scheduler considers when checking
14190 conflicts using DFA.
14192 @item max-inline-insns-recursive-auto
14193 The maximum number of instructions non-inline function
14194 can grow to via recursive inlining.
14196 @item graphite-allow-codegen-errors
14197 Whether codegen errors should be ICEs when @option{-fchecking}.
14199 @item sms-max-ii-factor
14200 A factor for tuning the upper bound that swing modulo scheduler
14201 uses for scheduling a loop.
14203 @item lra-max-considered-reload-pseudos
14204 The max number of reload pseudos which are considered during
14205 spilling a non-reload pseudo.
14207 @item max-pow-sqrt-depth
14208 Maximum depth of sqrt chains to use when synthesizing exponentiation
14209 by a real constant.
14211 @item max-dse-active-local-stores
14212 Maximum number of active local stores in RTL dead store elimination.
14214 @item asan-instrument-allocas
14215 Enable asan allocas/VLAs protection.
14217 @item max-iterations-computation-cost
14218 Bound on the cost of an expression to compute the number of iterations.
14220 @item max-isl-operations
14221 Maximum number of isl operations, 0 means unlimited.
14223 @item graphite-max-arrays-per-scop
14224 Maximum number of arrays per scop.
14226 @item max-vartrack-reverse-op-size
14227 Max. size of loc list for which reverse ops should be added.
14229 @item tracer-dynamic-coverage-feedback
14230 The percentage of function, weighted by execution frequency,
14231 that must be covered by trace formation.
14232 Used when profile feedback is available.
14234 @item max-inline-recursive-depth-auto
14235 The maximum depth of recursive inlining for non-inline functions.
14237 @item fsm-scale-path-stmts
14238 Scale factor to apply to the number of statements in a threading path
14239 when comparing to the number of (scaled) blocks.
14241 @item fsm-maximum-phi-arguments
14242 Maximum number of arguments a PHI may have before the FSM threader
14243 will not try to thread through its block.
14245 @item uninit-control-dep-attempts
14246 Maximum number of nested calls to search for control dependencies
14247 during uninitialized variable analysis.
14249 @item sra-max-scalarization-size-Osize
14250 Maximum size, in storage units, of an aggregate
14251 which should be considered for scalarization when compiling for size.
14253 @item fsm-scale-path-blocks
14254 Scale factor to apply to the number of blocks in a threading path
14255 when comparing to the number of (scaled) statements.
14257 @item sched-autopref-queue-depth
14258 Hardware autoprefetcher scheduler model control flag.
14259 Number of lookahead cycles the model looks into; at '
14260 ' only enable instruction sorting heuristic.
14262 @item loop-versioning-max-inner-insns
14263 The maximum number of instructions that an inner loop can have
14264 before the loop versioning pass considers it too big to copy.
14266 @item loop-versioning-max-outer-insns
14267 The maximum number of instructions that an outer loop can have
14268 before the loop versioning pass considers it too big to copy,
14269 discounting any instructions in inner loops that directly benefit
14270 from versioning.
14272 @item ssa-name-def-chain-limit
14273 The maximum number of SSA_NAME assignments to follow in determining
14274 a property of a variable such as its value.  This limits the number
14275 of iterations or recursive calls GCC performs when optimizing certain
14276 statements or when determining their validity prior to issuing
14277 diagnostics.
14279 @item store-merging-max-size
14280 Maximum size of a single store merging region in bytes.
14282 @item hash-table-verification-limit
14283 The number of elements for which hash table verification is done
14284 for each searched element.
14286 @item max-find-base-term-values
14287 Maximum number of VALUEs handled during a single find_base_term call.
14289 @item analyzer-max-enodes-per-program-point
14290 The maximum number of exploded nodes per program point within
14291 the analyzer, before terminating analysis of that point.
14293 @item analyzer-max-constraints
14294 The maximum number of constraints per state.
14296 @item analyzer-min-snodes-for-call-summary
14297 The minimum number of supernodes within a function for the
14298 analyzer to consider summarizing its effects at call sites.
14300 @item analyzer-max-enodes-for-full-dump
14301 The maximum depth of exploded nodes that should appear in a dot dump
14302 before switching to a less verbose format.
14304 @item analyzer-max-recursion-depth
14305 The maximum number of times a callsite can appear in a call stack
14306 within the analyzer, before terminating analysis of a call that would
14307 recurse deeper.
14309 @item analyzer-max-svalue-depth
14310 The maximum depth of a symbolic value, before approximating
14311 the value as unknown.
14313 @item gimple-fe-computed-hot-bb-threshold
14314 The number of executions of a basic block which is considered hot.
14315 The parameter is used only in GIMPLE FE.
14317 @item analyzer-bb-explosion-factor
14318 The maximum number of 'after supernode' exploded nodes within the analyzer
14319 per supernode, before terminating analysis.
14321 @end table
14323 The following choices of @var{name} are available on AArch64 targets:
14325 @table @gcctabopt
14326 @item aarch64-sve-compare-costs
14327 When vectorizing for SVE, consider using ``unpacked'' vectors for
14328 smaller elements and use the cost model to pick the cheapest approach.
14329 Also use the cost model to choose between SVE and Advanced SIMD vectorization.
14331 Using unpacked vectors includes storing smaller elements in larger
14332 containers and accessing elements with extending loads and truncating
14333 stores.
14335 @item aarch64-float-recp-precision
14336 The number of Newton iterations for calculating the reciprocal for float type.
14337 The precision of division is proportional to this param when division
14338 approximation is enabled.  The default value is 1.
14340 @item aarch64-double-recp-precision
14341 The number of Newton iterations for calculating the reciprocal for double type.
14342 The precision of division is propotional to this param when division
14343 approximation is enabled.  The default value is 2.
14345 @item aarch64-autovec-preference
14346 Force an ISA selection strategy for auto-vectorization.  Accepts values from
14347 0 to 4, inclusive.
14348 @table @samp
14349 @item 0
14350 Use the default heuristics.
14351 @item 1
14352 Use only Advanced SIMD for auto-vectorization.
14353 @item 2
14354 Use only SVE for auto-vectorization.
14355 @item 3
14356 Use both Advanced SIMD and SVE.  Prefer Advanced SIMD when the costs are
14357 deemed equal.
14358 @item 4
14359 Use both Advanced SIMD and SVE.  Prefer SVE when the costs are deemed equal.
14360 @end table
14361 The default value is 0.
14363 @end table
14365 @end table
14367 @node Instrumentation Options
14368 @section Program Instrumentation Options
14369 @cindex instrumentation options
14370 @cindex program instrumentation options
14371 @cindex run-time error checking options
14372 @cindex profiling options
14373 @cindex options, program instrumentation
14374 @cindex options, run-time error checking
14375 @cindex options, profiling
14377 GCC supports a number of command-line options that control adding
14378 run-time instrumentation to the code it normally generates.  
14379 For example, one purpose of instrumentation is collect profiling
14380 statistics for use in finding program hot spots, code coverage
14381 analysis, or profile-guided optimizations.
14382 Another class of program instrumentation is adding run-time checking 
14383 to detect programming errors like invalid pointer
14384 dereferences or out-of-bounds array accesses, as well as deliberately
14385 hostile attacks such as stack smashing or C++ vtable hijacking.
14386 There is also a general hook which can be used to implement other
14387 forms of tracing or function-level instrumentation for debug or
14388 program analysis purposes.
14390 @table @gcctabopt
14391 @cindex @command{prof}
14392 @cindex @command{gprof}
14393 @item -p
14394 @itemx -pg
14395 @opindex p
14396 @opindex pg
14397 Generate extra code to write profile information suitable for the
14398 analysis program @command{prof} (for @option{-p}) or @command{gprof}
14399 (for @option{-pg}).  You must use this option when compiling
14400 the source files you want data about, and you must also use it when
14401 linking.
14403 You can use the function attribute @code{no_instrument_function} to
14404 suppress profiling of individual functions when compiling with these options.
14405 @xref{Common Function Attributes}.
14407 @item -fprofile-arcs
14408 @opindex fprofile-arcs
14409 Add code so that program flow @dfn{arcs} are instrumented.  During
14410 execution the program records how many times each branch and call is
14411 executed and how many times it is taken or returns.  On targets that support
14412 constructors with priority support, profiling properly handles constructors,
14413 destructors and C++ constructors (and destructors) of classes which are used
14414 as a type of a global variable.
14416 When the compiled
14417 program exits it saves this data to a file called
14418 @file{@var{auxname}.gcda} for each source file.  The data may be used for
14419 profile-directed optimizations (@option{-fbranch-probabilities}), or for
14420 test coverage analysis (@option{-ftest-coverage}).  Each object file's
14421 @var{auxname} is generated from the name of the output file, if
14422 explicitly specified and it is not the final executable, otherwise it is
14423 the basename of the source file.  In both cases any suffix is removed
14424 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
14425 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
14426 @xref{Cross-profiling}.
14428 @cindex @command{gcov}
14429 @item --coverage
14430 @opindex coverage
14432 This option is used to compile and link code instrumented for coverage
14433 analysis.  The option is a synonym for @option{-fprofile-arcs}
14434 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
14435 linking).  See the documentation for those options for more details.
14437 @itemize
14439 @item
14440 Compile the source files with @option{-fprofile-arcs} plus optimization
14441 and code generation options.  For test coverage analysis, use the
14442 additional @option{-ftest-coverage} option.  You do not need to profile
14443 every source file in a program.
14445 @item
14446 Compile the source files additionally with @option{-fprofile-abs-path}
14447 to create absolute path names in the @file{.gcno} files.  This allows
14448 @command{gcov} to find the correct sources in projects where compilations
14449 occur with different working directories.
14451 @item
14452 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
14453 (the latter implies the former).
14455 @item
14456 Run the program on a representative workload to generate the arc profile
14457 information.  This may be repeated any number of times.  You can run
14458 concurrent instances of your program, and provided that the file system
14459 supports locking, the data files will be correctly updated.  Unless
14460 a strict ISO C dialect option is in effect, @code{fork} calls are
14461 detected and correctly handled without double counting.
14463 @item
14464 For profile-directed optimizations, compile the source files again with
14465 the same optimization and code generation options plus
14466 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
14467 Control Optimization}).
14469 @item
14470 For test coverage analysis, use @command{gcov} to produce human readable
14471 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
14472 @command{gcov} documentation for further information.
14474 @end itemize
14476 With @option{-fprofile-arcs}, for each function of your program GCC
14477 creates a program flow graph, then finds a spanning tree for the graph.
14478 Only arcs that are not on the spanning tree have to be instrumented: the
14479 compiler adds code to count the number of times that these arcs are
14480 executed.  When an arc is the only exit or only entrance to a block, the
14481 instrumentation code can be added to the block; otherwise, a new basic
14482 block must be created to hold the instrumentation code.
14484 @need 2000
14485 @item -ftest-coverage
14486 @opindex ftest-coverage
14487 Produce a notes file that the @command{gcov} code-coverage utility
14488 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
14489 show program coverage.  Each source file's note file is called
14490 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
14491 above for a description of @var{auxname} and instructions on how to
14492 generate test coverage data.  Coverage data matches the source files
14493 more closely if you do not optimize.
14495 @item -fprofile-abs-path
14496 @opindex fprofile-abs-path
14497 Automatically convert relative source file names to absolute path names
14498 in the @file{.gcno} files.  This allows @command{gcov} to find the correct
14499 sources in projects where compilations occur with different working
14500 directories.
14502 @item -fprofile-dir=@var{path}
14503 @opindex fprofile-dir
14505 Set the directory to search for the profile data files in to @var{path}.
14506 This option affects only the profile data generated by
14507 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
14508 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
14509 and its related options.  Both absolute and relative paths can be used.
14510 By default, GCC uses the current directory as @var{path}, thus the
14511 profile data file appears in the same directory as the object file.
14512 In order to prevent the file name clashing, if the object file name is
14513 not an absolute path, we mangle the absolute path of the
14514 @file{@var{sourcename}.gcda} file and use it as the file name of a
14515 @file{.gcda} file.  See similar option @option{-fprofile-note}.
14517 When an executable is run in a massive parallel environment, it is recommended
14518 to save profile to different folders.  That can be done with variables
14519 in @var{path} that are exported during run-time:
14521 @table @gcctabopt
14523 @item %p
14524 process ID.
14526 @item %q@{VAR@}
14527 value of environment variable @var{VAR}
14529 @end table
14531 @item -fprofile-generate
14532 @itemx -fprofile-generate=@var{path}
14533 @opindex fprofile-generate
14535 Enable options usually used for instrumenting application to produce
14536 profile useful for later recompilation with profile feedback based
14537 optimization.  You must use @option{-fprofile-generate} both when
14538 compiling and when linking your program.
14540 The following options are enabled:
14541 @option{-fprofile-arcs}, @option{-fprofile-values},
14542 @option{-finline-functions}, and @option{-fipa-bit-cp}.
14544 If @var{path} is specified, GCC looks at the @var{path} to find
14545 the profile feedback data files. See @option{-fprofile-dir}.
14547 To optimize the program based on the collected profile information, use
14548 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
14550 @item -fprofile-info-section
14551 @itemx -fprofile-info-section=@var{name}
14552 @opindex fprofile-info-section
14554 Register the profile information in the specified section instead of using a
14555 constructor/destructor.  The section name is @var{name} if it is specified,
14556 otherwise the section name defaults to @code{.gcov_info}.  A pointer to the
14557 profile information generated by @option{-fprofile-arcs} or
14558 @option{-ftest-coverage} is placed in the specified section for each
14559 translation unit.  This option disables the profile information registration
14560 through a constructor and it disables the profile information processing
14561 through a destructor.  This option is not intended to be used in hosted
14562 environments such as GNU/Linux.  It targets systems with limited resources
14563 which do not support constructors and destructors.  The linker could collect
14564 the input sections in a continuous memory block and define start and end
14565 symbols.  The runtime support could dump the profiling information registered
14566 in this linker set during program termination to a serial line for example.  A
14567 GNU linker script example which defines a linker output section follows:
14569 @smallexample
14570   .gcov_info      :
14571   @{
14572     PROVIDE (__gcov_info_start = .);
14573     KEEP (*(.gcov_info))
14574     PROVIDE (__gcov_info_end = .);
14575   @}
14576 @end smallexample
14578 @item -fprofile-note=@var{path}
14579 @opindex fprofile-note
14581 If @var{path} is specified, GCC saves @file{.gcno} file into @var{path}
14582 location.  If you combine the option with multiple source files,
14583 the @file{.gcno} file will be overwritten.
14585 @item -fprofile-prefix-path=@var{path}
14586 @opindex fprofile-prefix-path
14588 This option can be used in combination with
14589 @option{profile-generate=}@var{profile_dir} and
14590 @option{profile-use=}@var{profile_dir} to inform GCC where is the base
14591 directory of built source tree.  By default @var{profile_dir} will contain
14592 files with mangled absolute paths of all object files in the built project.
14593 This is not desirable when directory used to build the instrumented binary
14594 differs from the directory used to build the binary optimized with profile
14595 feedback because the profile data will not be found during the optimized build.
14596 In such setups @option{-fprofile-prefix-path=}@var{path} with @var{path}
14597 pointing to the base directory of the build can be used to strip the irrelevant
14598 part of the path and keep all file names relative to the main build directory.
14600 @item -fprofile-update=@var{method}
14601 @opindex fprofile-update
14603 Alter the update method for an application instrumented for profile
14604 feedback based optimization.  The @var{method} argument should be one of
14605 @samp{single}, @samp{atomic} or @samp{prefer-atomic}.
14606 The first one is useful for single-threaded applications,
14607 while the second one prevents profile corruption by emitting thread-safe code.
14609 @strong{Warning:} When an application does not properly join all threads
14610 (or creates an detached thread), a profile file can be still corrupted.
14612 Using @samp{prefer-atomic} would be transformed either to @samp{atomic},
14613 when supported by a target, or to @samp{single} otherwise.  The GCC driver
14614 automatically selects @samp{prefer-atomic} when @option{-pthread}
14615 is present in the command line.
14617 @item -fprofile-filter-files=@var{regex}
14618 @opindex fprofile-filter-files
14620 Instrument only functions from files whose name matches
14621 any of the regular expressions (separated by semi-colons).
14623 For example, @option{-fprofile-filter-files=main\.c;module.*\.c} will instrument
14624 only @file{main.c} and all C files starting with 'module'.
14626 @item -fprofile-exclude-files=@var{regex}
14627 @opindex fprofile-exclude-files
14629 Instrument only functions from files whose name does not match
14630 any of the regular expressions (separated by semi-colons).
14632 For example, @option{-fprofile-exclude-files=/usr/.*} will prevent instrumentation
14633 of all files that are located in the @file{/usr/} folder.
14635 @item -fprofile-reproducible=@r{[}multithreaded@r{|}parallel-runs@r{|}serial@r{]}
14636 @opindex fprofile-reproducible
14637 Control level of reproducibility of profile gathered by
14638 @code{-fprofile-generate}.  This makes it possible to rebuild program
14639 with same outcome which is useful, for example, for distribution
14640 packages.
14642 With @option{-fprofile-reproducible=serial} the profile gathered by
14643 @option{-fprofile-generate} is reproducible provided the trained program
14644 behaves the same at each invocation of the train run, it is not
14645 multi-threaded and profile data streaming is always done in the same
14646 order.  Note that profile streaming happens at the end of program run but
14647 also before @code{fork} function is invoked.
14649 Note that it is quite common that execution counts of some part of
14650 programs depends, for example, on length of temporary file names or
14651 memory space randomization (that may affect hash-table collision rate).
14652 Such non-reproducible part of programs may be annotated by
14653 @code{no_instrument_function} function attribute. @command{gcov-dump} with
14654 @option{-l} can be used to dump gathered data and verify that they are
14655 indeed reproducible.
14657 With @option{-fprofile-reproducible=parallel-runs} collected profile
14658 stays reproducible regardless the order of streaming of the data into
14659 gcda files.  This setting makes it possible to run multiple instances of
14660 instrumented program in parallel (such as with @code{make -j}). This
14661 reduces quality of gathered data, in particular of indirect call
14662 profiling.
14664 @item -fsanitize=address
14665 @opindex fsanitize=address
14666 Enable AddressSanitizer, a fast memory error detector.
14667 Memory access instructions are instrumented to detect
14668 out-of-bounds and use-after-free bugs.
14669 The option enables @option{-fsanitize-address-use-after-scope}.
14670 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
14671 more details.  The run-time behavior can be influenced using the
14672 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
14673 the available options are shown at startup of the instrumented program.  See
14674 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
14675 for a list of supported options.
14676 The option cannot be combined with @option{-fsanitize=thread} or
14677 @option{-fsanitize=hwaddress}.  Note that the only target
14678 @option{-fsanitize=hwaddress} is currently supported on is AArch64.
14680 @item -fsanitize=kernel-address
14681 @opindex fsanitize=kernel-address
14682 Enable AddressSanitizer for Linux kernel.
14683 See @uref{https://github.com/google/kasan} for more details.
14685 @item -fsanitize=hwaddress
14686 @opindex fsanitize=hwaddress
14687 Enable Hardware-assisted AddressSanitizer, which uses a hardware ability to
14688 ignore the top byte of a pointer to allow the detection of memory errors with
14689 a low memory overhead.
14690 Memory access instructions are instrumented to detect out-of-bounds and
14691 use-after-free bugs.
14692 The option enables @option{-fsanitize-address-use-after-scope}.
14694 @uref{https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html}
14695 for more details.  The run-time behavior can be influenced using the
14696 @env{HWASAN_OPTIONS} environment variable.  When set to @code{help=1},
14697 the available options are shown at startup of the instrumented program.
14698 The option cannot be combined with @option{-fsanitize=thread} or
14699 @option{-fsanitize=address}, and is currently only available on AArch64.
14701 @item -fsanitize=kernel-hwaddress
14702 @opindex fsanitize=kernel-hwaddress
14703 Enable Hardware-assisted AddressSanitizer for compilation of the Linux kernel.
14704 Similar to @option{-fsanitize=kernel-address} but using an alternate
14705 instrumentation method, and similar to @option{-fsanitize=hwaddress} but with
14706 instrumentation differences necessary for compiling the Linux kernel.
14707 These differences are to avoid hwasan library initialization calls and to
14708 account for the stack pointer having a different value in its top byte.
14710 @emph{Note:} This option has different defaults to the @option{-fsanitize=hwaddress}.
14711 Instrumenting the stack and alloca calls are not on by default but are still
14712 possible by specifying the command-line options
14713 @option{--param hwasan-instrument-stack=1} and
14714 @option{--param hwasan-instrument-allocas=1} respectively. Using a random frame
14715 tag is not implemented for kernel instrumentation.
14717 @item -fsanitize=pointer-compare
14718 @opindex fsanitize=pointer-compare
14719 Instrument comparison operation (<, <=, >, >=) with pointer operands.
14720 The option must be combined with either @option{-fsanitize=kernel-address} or
14721 @option{-fsanitize=address}
14722 The option cannot be combined with @option{-fsanitize=thread}.
14723 Note: By default the check is disabled at run time.  To enable it,
14724 add @code{detect_invalid_pointer_pairs=2} to the environment variable
14725 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
14726 invalid operation only when both pointers are non-null.
14728 @item -fsanitize=pointer-subtract
14729 @opindex fsanitize=pointer-subtract
14730 Instrument subtraction with pointer operands.
14731 The option must be combined with either @option{-fsanitize=kernel-address} or
14732 @option{-fsanitize=address}
14733 The option cannot be combined with @option{-fsanitize=thread}.
14734 Note: By default the check is disabled at run time.  To enable it,
14735 add @code{detect_invalid_pointer_pairs=2} to the environment variable
14736 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
14737 invalid operation only when both pointers are non-null.
14739 @item -fsanitize=thread
14740 @opindex fsanitize=thread
14741 Enable ThreadSanitizer, a fast data race detector.
14742 Memory access instructions are instrumented to detect
14743 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
14744 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
14745 environment variable; see
14746 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
14747 supported options.
14748 The option cannot be combined with @option{-fsanitize=address},
14749 @option{-fsanitize=leak}.
14751 Note that sanitized atomic builtins cannot throw exceptions when
14752 operating on invalid memory addresses with non-call exceptions
14753 (@option{-fnon-call-exceptions}).
14755 @item -fsanitize=leak
14756 @opindex fsanitize=leak
14757 Enable LeakSanitizer, a memory leak detector.
14758 This option only matters for linking of executables and
14759 the executable is linked against a library that overrides @code{malloc}
14760 and other allocator functions.  See
14761 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
14762 details.  The run-time behavior can be influenced using the
14763 @env{LSAN_OPTIONS} environment variable.
14764 The option cannot be combined with @option{-fsanitize=thread}.
14766 @item -fsanitize=undefined
14767 @opindex fsanitize=undefined
14768 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
14769 Various computations are instrumented to detect undefined behavior
14770 at runtime.  Current suboptions are:
14772 @table @gcctabopt
14774 @item -fsanitize=shift
14775 @opindex fsanitize=shift
14776 This option enables checking that the result of a shift operation is
14777 not undefined.  Note that what exactly is considered undefined differs
14778 slightly between C and C++, as well as between ISO C90 and C99, etc.
14779 This option has two suboptions, @option{-fsanitize=shift-base} and
14780 @option{-fsanitize=shift-exponent}.
14782 @item -fsanitize=shift-exponent
14783 @opindex fsanitize=shift-exponent
14784 This option enables checking that the second argument of a shift operation
14785 is not negative and is smaller than the precision of the promoted first
14786 argument.
14788 @item -fsanitize=shift-base
14789 @opindex fsanitize=shift-base
14790 If the second argument of a shift operation is within range, check that the
14791 result of a shift operation is not undefined.  Note that what exactly is
14792 considered undefined differs slightly between C and C++, as well as between
14793 ISO C90 and C99, etc.
14795 @item -fsanitize=integer-divide-by-zero
14796 @opindex fsanitize=integer-divide-by-zero
14797 Detect integer division by zero as well as @code{INT_MIN / -1} division.
14799 @item -fsanitize=unreachable
14800 @opindex fsanitize=unreachable
14801 With this option, the compiler turns the @code{__builtin_unreachable}
14802 call into a diagnostics message call instead.  When reaching the
14803 @code{__builtin_unreachable} call, the behavior is undefined.
14805 @item -fsanitize=vla-bound
14806 @opindex fsanitize=vla-bound
14807 This option instructs the compiler to check that the size of a variable
14808 length array is positive.
14810 @item -fsanitize=null
14811 @opindex fsanitize=null
14812 This option enables pointer checking.  Particularly, the application
14813 built with this option turned on will issue an error message when it
14814 tries to dereference a NULL pointer, or if a reference (possibly an
14815 rvalue reference) is bound to a NULL pointer, or if a method is invoked
14816 on an object pointed by a NULL pointer.
14818 @item -fsanitize=return
14819 @opindex fsanitize=return
14820 This option enables return statement checking.  Programs
14821 built with this option turned on will issue an error message
14822 when the end of a non-void function is reached without actually
14823 returning a value.  This option works in C++ only.
14825 @item -fsanitize=signed-integer-overflow
14826 @opindex fsanitize=signed-integer-overflow
14827 This option enables signed integer overflow checking.  We check that
14828 the result of @code{+}, @code{*}, and both unary and binary @code{-}
14829 does not overflow in the signed arithmetics.  Note, integer promotion
14830 rules must be taken into account.  That is, the following is not an
14831 overflow:
14832 @smallexample
14833 signed char a = SCHAR_MAX;
14834 a++;
14835 @end smallexample
14837 @item -fsanitize=bounds
14838 @opindex fsanitize=bounds
14839 This option enables instrumentation of array bounds.  Various out of bounds
14840 accesses are detected.  Flexible array members, flexible array member-like
14841 arrays, and initializers of variables with static storage are not instrumented.
14843 @item -fsanitize=bounds-strict
14844 @opindex fsanitize=bounds-strict
14845 This option enables strict instrumentation of array bounds.  Most out of bounds
14846 accesses are detected, including flexible array members and flexible array
14847 member-like arrays.  Initializers of variables with static storage are not
14848 instrumented.
14850 @item -fsanitize=alignment
14851 @opindex fsanitize=alignment
14853 This option enables checking of alignment of pointers when they are
14854 dereferenced, or when a reference is bound to insufficiently aligned target,
14855 or when a method or constructor is invoked on insufficiently aligned object.
14857 @item -fsanitize=object-size
14858 @opindex fsanitize=object-size
14859 This option enables instrumentation of memory references using the
14860 @code{__builtin_object_size} function.  Various out of bounds pointer
14861 accesses are detected.
14863 @item -fsanitize=float-divide-by-zero
14864 @opindex fsanitize=float-divide-by-zero
14865 Detect floating-point division by zero.  Unlike other similar options,
14866 @option{-fsanitize=float-divide-by-zero} is not enabled by
14867 @option{-fsanitize=undefined}, since floating-point division by zero can
14868 be a legitimate way of obtaining infinities and NaNs.
14870 @item -fsanitize=float-cast-overflow
14871 @opindex fsanitize=float-cast-overflow
14872 This option enables floating-point type to integer conversion checking.
14873 We check that the result of the conversion does not overflow.
14874 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
14875 not enabled by @option{-fsanitize=undefined}.
14876 This option does not work well with @code{FE_INVALID} exceptions enabled.
14878 @item -fsanitize=nonnull-attribute
14879 @opindex fsanitize=nonnull-attribute
14881 This option enables instrumentation of calls, checking whether null values
14882 are not passed to arguments marked as requiring a non-null value by the
14883 @code{nonnull} function attribute.
14885 @item -fsanitize=returns-nonnull-attribute
14886 @opindex fsanitize=returns-nonnull-attribute
14888 This option enables instrumentation of return statements in functions
14889 marked with @code{returns_nonnull} function attribute, to detect returning
14890 of null values from such functions.
14892 @item -fsanitize=bool
14893 @opindex fsanitize=bool
14895 This option enables instrumentation of loads from bool.  If a value other
14896 than 0/1 is loaded, a run-time error is issued.
14898 @item -fsanitize=enum
14899 @opindex fsanitize=enum
14901 This option enables instrumentation of loads from an enum type.  If
14902 a value outside the range of values for the enum type is loaded,
14903 a run-time error is issued.
14905 @item -fsanitize=vptr
14906 @opindex fsanitize=vptr
14908 This option enables instrumentation of C++ member function calls, member
14909 accesses and some conversions between pointers to base and derived classes,
14910 to verify the referenced object has the correct dynamic type.
14912 @item -fsanitize=pointer-overflow
14913 @opindex fsanitize=pointer-overflow
14915 This option enables instrumentation of pointer arithmetics.  If the pointer
14916 arithmetics overflows, a run-time error is issued.
14918 @item -fsanitize=builtin
14919 @opindex fsanitize=builtin
14921 This option enables instrumentation of arguments to selected builtin
14922 functions.  If an invalid value is passed to such arguments, a run-time
14923 error is issued.  E.g.@ passing 0 as the argument to @code{__builtin_ctz}
14924 or @code{__builtin_clz} invokes undefined behavior and is diagnosed
14925 by this option.
14927 @end table
14929 While @option{-ftrapv} causes traps for signed overflows to be emitted,
14930 @option{-fsanitize=undefined} gives a diagnostic message.
14931 This currently works only for the C family of languages.
14933 @item -fno-sanitize=all
14934 @opindex fno-sanitize=all
14936 This option disables all previously enabled sanitizers.
14937 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
14938 together.
14940 @item -fasan-shadow-offset=@var{number}
14941 @opindex fasan-shadow-offset
14942 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
14943 It is useful for experimenting with different shadow memory layouts in
14944 Kernel AddressSanitizer.
14946 @item -fsanitize-sections=@var{s1},@var{s2},...
14947 @opindex fsanitize-sections
14948 Sanitize global variables in selected user-defined sections.  @var{si} may
14949 contain wildcards.
14951 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
14952 @opindex fsanitize-recover
14953 @opindex fno-sanitize-recover
14954 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
14955 mentioned in comma-separated list of @var{opts}.  Enabling this option
14956 for a sanitizer component causes it to attempt to continue
14957 running the program as if no error happened.  This means multiple
14958 runtime errors can be reported in a single program run, and the exit
14959 code of the program may indicate success even when errors
14960 have been reported.  The @option{-fno-sanitize-recover=} option
14961 can be used to alter
14962 this behavior: only the first detected error is reported
14963 and program then exits with a non-zero exit code.
14965 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
14966 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
14967 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
14968 @option{-fsanitize=bounds-strict},
14969 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
14970 For these sanitizers error recovery is turned on by default,
14971 except @option{-fsanitize=address}, for which this feature is experimental.
14972 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
14973 accepted, the former enables recovery for all sanitizers that support it,
14974 the latter disables recovery for all sanitizers that support it.
14976 Even if a recovery mode is turned on the compiler side, it needs to be also
14977 enabled on the runtime library side, otherwise the failures are still fatal.
14978 The runtime library defaults to @code{halt_on_error=0} for
14979 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
14980 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
14981 setting the @code{halt_on_error} flag in the corresponding environment variable.
14983 Syntax without an explicit @var{opts} parameter is deprecated.  It is
14984 equivalent to specifying an @var{opts} list of:
14986 @smallexample
14987 undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
14988 @end smallexample
14990 @item -fsanitize-address-use-after-scope
14991 @opindex fsanitize-address-use-after-scope
14992 Enable sanitization of local variables to detect use-after-scope bugs.
14993 The option sets @option{-fstack-reuse} to @samp{none}.
14995 @item -fsanitize-undefined-trap-on-error
14996 @opindex fsanitize-undefined-trap-on-error
14997 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
14998 report undefined behavior using @code{__builtin_trap} rather than
14999 a @code{libubsan} library routine.  The advantage of this is that the
15000 @code{libubsan} library is not needed and is not linked in, so this
15001 is usable even in freestanding environments.
15003 @item -fsanitize-coverage=trace-pc
15004 @opindex fsanitize-coverage=trace-pc
15005 Enable coverage-guided fuzzing code instrumentation.
15006 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
15008 @item -fsanitize-coverage=trace-cmp
15009 @opindex fsanitize-coverage=trace-cmp
15010 Enable dataflow guided fuzzing code instrumentation.
15011 Inserts a call to @code{__sanitizer_cov_trace_cmp1},
15012 @code{__sanitizer_cov_trace_cmp2}, @code{__sanitizer_cov_trace_cmp4} or
15013 @code{__sanitizer_cov_trace_cmp8} for integral comparison with both operands
15014 variable or @code{__sanitizer_cov_trace_const_cmp1},
15015 @code{__sanitizer_cov_trace_const_cmp2},
15016 @code{__sanitizer_cov_trace_const_cmp4} or
15017 @code{__sanitizer_cov_trace_const_cmp8} for integral comparison with one
15018 operand constant, @code{__sanitizer_cov_trace_cmpf} or
15019 @code{__sanitizer_cov_trace_cmpd} for float or double comparisons and
15020 @code{__sanitizer_cov_trace_switch} for switch statements.
15022 @item -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{|}check@r{]}
15023 @opindex fcf-protection
15024 Enable code instrumentation of control-flow transfers to increase
15025 program security by checking that target addresses of control-flow
15026 transfer instructions (such as indirect function call, function return,
15027 indirect jump) are valid.  This prevents diverting the flow of control
15028 to an unexpected target.  This is intended to protect against such
15029 threats as Return-oriented Programming (ROP), and similarly
15030 call/jmp-oriented programming (COP/JOP).
15032 The value @code{branch} tells the compiler to implement checking of
15033 validity of control-flow transfer at the point of indirect branch
15034 instructions, i.e.@: call/jmp instructions.  The value @code{return}
15035 implements checking of validity at the point of returning from a
15036 function.  The value @code{full} is an alias for specifying both
15037 @code{branch} and @code{return}. The value @code{none} turns off
15038 instrumentation.
15040 The value @code{check} is used for the final link with link-time
15041 optimization (LTO).  An error is issued if LTO object files are
15042 compiled with different @option{-fcf-protection} values.  The
15043 value @code{check} is ignored at the compile time.
15045 The macro @code{__CET__} is defined when @option{-fcf-protection} is
15046 used.  The first bit of @code{__CET__} is set to 1 for the value
15047 @code{branch} and the second bit of @code{__CET__} is set to 1 for
15048 the @code{return}.
15050 You can also use the @code{nocf_check} attribute to identify
15051 which functions and calls should be skipped from instrumentation
15052 (@pxref{Function Attributes}).
15054 Currently the x86 GNU/Linux target provides an implementation based
15055 on Intel Control-flow Enforcement Technology (CET).
15057 @item -fstack-protector
15058 @opindex fstack-protector
15059 Emit extra code to check for buffer overflows, such as stack smashing
15060 attacks.  This is done by adding a guard variable to functions with
15061 vulnerable objects.  This includes functions that call @code{alloca}, and
15062 functions with buffers larger than or equal to 8 bytes.  The guards are
15063 initialized when a function is entered and then checked when the function
15064 exits.  If a guard check fails, an error message is printed and the program
15065 exits.  Only variables that are actually allocated on the stack are
15066 considered, optimized away variables or variables allocated in registers
15067 don't count.
15069 @item -fstack-protector-all
15070 @opindex fstack-protector-all
15071 Like @option{-fstack-protector} except that all functions are protected.
15073 @item -fstack-protector-strong
15074 @opindex fstack-protector-strong
15075 Like @option{-fstack-protector} but includes additional functions to
15076 be protected --- those that have local array definitions, or have
15077 references to local frame addresses.  Only variables that are actually
15078 allocated on the stack are considered, optimized away variables or variables
15079 allocated in registers don't count.
15081 @item -fstack-protector-explicit
15082 @opindex fstack-protector-explicit
15083 Like @option{-fstack-protector} but only protects those functions which
15084 have the @code{stack_protect} attribute.
15086 @item -fstack-check
15087 @opindex fstack-check
15088 Generate code to verify that you do not go beyond the boundary of the
15089 stack.  You should specify this flag if you are running in an
15090 environment with multiple threads, but you only rarely need to specify it in
15091 a single-threaded environment since stack overflow is automatically
15092 detected on nearly all systems if there is only one stack.
15094 Note that this switch does not actually cause checking to be done; the
15095 operating system or the language runtime must do that.  The switch causes
15096 generation of code to ensure that they see the stack being extended.
15098 You can additionally specify a string parameter: @samp{no} means no
15099 checking, @samp{generic} means force the use of old-style checking,
15100 @samp{specific} means use the best checking method and is equivalent
15101 to bare @option{-fstack-check}.
15103 Old-style checking is a generic mechanism that requires no specific
15104 target support in the compiler but comes with the following drawbacks:
15106 @enumerate
15107 @item
15108 Modified allocation strategy for large objects: they are always
15109 allocated dynamically if their size exceeds a fixed threshold.  Note this
15110 may change the semantics of some code.
15112 @item
15113 Fixed limit on the size of the static frame of functions: when it is
15114 topped by a particular function, stack checking is not reliable and
15115 a warning is issued by the compiler.
15117 @item
15118 Inefficiency: because of both the modified allocation strategy and the
15119 generic implementation, code performance is hampered.
15120 @end enumerate
15122 Note that old-style stack checking is also the fallback method for
15123 @samp{specific} if no target support has been added in the compiler.
15125 @samp{-fstack-check=} is designed for Ada's needs to detect infinite recursion
15126 and stack overflows.  @samp{specific} is an excellent choice when compiling
15127 Ada code.  It is not generally sufficient to protect against stack-clash
15128 attacks.  To protect against those you want @samp{-fstack-clash-protection}.
15130 @item -fstack-clash-protection
15131 @opindex fstack-clash-protection
15132 Generate code to prevent stack clash style attacks.  When this option is
15133 enabled, the compiler will only allocate one page of stack space at a time
15134 and each page is accessed immediately after allocation.  Thus, it prevents
15135 allocations from jumping over any stack guard page provided by the
15136 operating system.
15138 Most targets do not fully support stack clash protection.  However, on
15139 those targets @option{-fstack-clash-protection} will protect dynamic stack
15140 allocations.  @option{-fstack-clash-protection} may also provide limited
15141 protection for static stack allocations if the target supports
15142 @option{-fstack-check=specific}.
15144 @item -fstack-limit-register=@var{reg}
15145 @itemx -fstack-limit-symbol=@var{sym}
15146 @itemx -fno-stack-limit
15147 @opindex fstack-limit-register
15148 @opindex fstack-limit-symbol
15149 @opindex fno-stack-limit
15150 Generate code to ensure that the stack does not grow beyond a certain value,
15151 either the value of a register or the address of a symbol.  If a larger
15152 stack is required, a signal is raised at run time.  For most targets,
15153 the signal is raised before the stack overruns the boundary, so
15154 it is possible to catch the signal without taking special precautions.
15156 For instance, if the stack starts at absolute address @samp{0x80000000}
15157 and grows downwards, you can use the flags
15158 @option{-fstack-limit-symbol=__stack_limit} and
15159 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
15160 of 128KB@.  Note that this may only work with the GNU linker.
15162 You can locally override stack limit checking by using the
15163 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
15165 @item -fsplit-stack
15166 @opindex fsplit-stack
15167 Generate code to automatically split the stack before it overflows.
15168 The resulting program has a discontiguous stack which can only
15169 overflow if the program is unable to allocate any more memory.  This
15170 is most useful when running threaded programs, as it is no longer
15171 necessary to calculate a good stack size to use for each thread.  This
15172 is currently only implemented for the x86 targets running
15173 GNU/Linux.
15175 When code compiled with @option{-fsplit-stack} calls code compiled
15176 without @option{-fsplit-stack}, there may not be much stack space
15177 available for the latter code to run.  If compiling all code,
15178 including library code, with @option{-fsplit-stack} is not an option,
15179 then the linker can fix up these calls so that the code compiled
15180 without @option{-fsplit-stack} always has a large stack.  Support for
15181 this is implemented in the gold linker in GNU binutils release 2.21
15182 and later.
15184 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
15185 @opindex fvtable-verify
15186 This option is only available when compiling C++ code.
15187 It turns on (or off, if using @option{-fvtable-verify=none}) the security
15188 feature that verifies at run time, for every virtual call, that
15189 the vtable pointer through which the call is made is valid for the type of
15190 the object, and has not been corrupted or overwritten.  If an invalid vtable
15191 pointer is detected at run time, an error is reported and execution of the
15192 program is immediately halted.
15194 This option causes run-time data structures to be built at program startup,
15195 which are used for verifying the vtable pointers.  
15196 The options @samp{std} and @samp{preinit}
15197 control the timing of when these data structures are built.  In both cases the
15198 data structures are built before execution reaches @code{main}.  Using
15199 @option{-fvtable-verify=std} causes the data structures to be built after
15200 shared libraries have been loaded and initialized.
15201 @option{-fvtable-verify=preinit} causes them to be built before shared
15202 libraries have been loaded and initialized.
15204 If this option appears multiple times in the command line with different
15205 values specified, @samp{none} takes highest priority over both @samp{std} and
15206 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
15208 @item -fvtv-debug
15209 @opindex fvtv-debug
15210 When used in conjunction with @option{-fvtable-verify=std} or 
15211 @option{-fvtable-verify=preinit}, causes debug versions of the 
15212 runtime functions for the vtable verification feature to be called.  
15213 This flag also causes the compiler to log information about which 
15214 vtable pointers it finds for each class.
15215 This information is written to a file named @file{vtv_set_ptr_data.log} 
15216 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
15217 if that is defined or the current working directory otherwise.
15219 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
15220 file, be sure to delete any existing one.
15222 @item -fvtv-counts
15223 @opindex fvtv-counts
15224 This is a debugging flag.  When used in conjunction with
15225 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
15226 causes the compiler to keep track of the total number of virtual calls
15227 it encounters and the number of verifications it inserts.  It also
15228 counts the number of calls to certain run-time library functions
15229 that it inserts and logs this information for each compilation unit.
15230 The compiler writes this information to a file named
15231 @file{vtv_count_data.log} in the directory named by the environment
15232 variable @env{VTV_LOGS_DIR} if that is defined or the current working
15233 directory otherwise.  It also counts the size of the vtable pointer sets
15234 for each class, and writes this information to @file{vtv_class_set_sizes.log}
15235 in the same directory.
15237 Note:  This feature @emph{appends} data to the log files.  To get fresh log
15238 files, be sure to delete any existing ones.
15240 @item -finstrument-functions
15241 @opindex finstrument-functions
15242 Generate instrumentation calls for entry and exit to functions.  Just
15243 after function entry and just before function exit, the following
15244 profiling functions are called with the address of the current
15245 function and its call site.  (On some platforms,
15246 @code{__builtin_return_address} does not work beyond the current
15247 function, so the call site information may not be available to the
15248 profiling functions otherwise.)
15250 @smallexample
15251 void __cyg_profile_func_enter (void *this_fn,
15252                                void *call_site);
15253 void __cyg_profile_func_exit  (void *this_fn,
15254                                void *call_site);
15255 @end smallexample
15257 The first argument is the address of the start of the current function,
15258 which may be looked up exactly in the symbol table.
15260 This instrumentation is also done for functions expanded inline in other
15261 functions.  The profiling calls indicate where, conceptually, the
15262 inline function is entered and exited.  This means that addressable
15263 versions of such functions must be available.  If all your uses of a
15264 function are expanded inline, this may mean an additional expansion of
15265 code size.  If you use @code{extern inline} in your C code, an
15266 addressable version of such functions must be provided.  (This is
15267 normally the case anyway, but if you get lucky and the optimizer always
15268 expands the functions inline, you might have gotten away without
15269 providing static copies.)
15271 A function may be given the attribute @code{no_instrument_function}, in
15272 which case this instrumentation is not done.  This can be used, for
15273 example, for the profiling functions listed above, high-priority
15274 interrupt routines, and any functions from which the profiling functions
15275 cannot safely be called (perhaps signal handlers, if the profiling
15276 routines generate output or allocate memory).
15277 @xref{Common Function Attributes}.
15279 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
15280 @opindex finstrument-functions-exclude-file-list
15282 Set the list of functions that are excluded from instrumentation (see
15283 the description of @option{-finstrument-functions}).  If the file that
15284 contains a function definition matches with one of @var{file}, then
15285 that function is not instrumented.  The match is done on substrings:
15286 if the @var{file} parameter is a substring of the file name, it is
15287 considered to be a match.
15289 For example:
15291 @smallexample
15292 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
15293 @end smallexample
15295 @noindent
15296 excludes any inline function defined in files whose pathnames
15297 contain @file{/bits/stl} or @file{include/sys}.
15299 If, for some reason, you want to include letter @samp{,} in one of
15300 @var{sym}, write @samp{\,}. For example,
15301 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
15302 (note the single quote surrounding the option).
15304 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
15305 @opindex finstrument-functions-exclude-function-list
15307 This is similar to @option{-finstrument-functions-exclude-file-list},
15308 but this option sets the list of function names to be excluded from
15309 instrumentation.  The function name to be matched is its user-visible
15310 name, such as @code{vector<int> blah(const vector<int> &)}, not the
15311 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
15312 match is done on substrings: if the @var{sym} parameter is a substring
15313 of the function name, it is considered to be a match.  For C99 and C++
15314 extended identifiers, the function name must be given in UTF-8, not
15315 using universal character names.
15317 @item -fpatchable-function-entry=@var{N}[,@var{M}]
15318 @opindex fpatchable-function-entry
15319 Generate @var{N} NOPs right at the beginning
15320 of each function, with the function entry point before the @var{M}th NOP.
15321 If @var{M} is omitted, it defaults to @code{0} so the
15322 function entry points to the address just at the first NOP.
15323 The NOP instructions reserve extra space which can be used to patch in
15324 any desired instrumentation at run time, provided that the code segment
15325 is writable.  The amount of space is controllable indirectly via
15326 the number of NOPs; the NOP instruction used corresponds to the instruction
15327 emitted by the internal GCC back-end interface @code{gen_nop}.  This behavior
15328 is target-specific and may also depend on the architecture variant and/or
15329 other compilation options.
15331 For run-time identification, the starting addresses of these areas,
15332 which correspond to their respective function entries minus @var{M},
15333 are additionally collected in the @code{__patchable_function_entries}
15334 section of the resulting binary.
15336 Note that the value of @code{__attribute__ ((patchable_function_entry
15337 (N,M)))} takes precedence over command-line option
15338 @option{-fpatchable-function-entry=N,M}.  This can be used to increase
15339 the area size or to remove it completely on a single function.
15340 If @code{N=0}, no pad location is recorded.
15342 The NOP instructions are inserted at---and maybe before, depending on
15343 @var{M}---the function entry address, even before the prologue.
15345 The maximum value of @var{N} and @var{M} is 65535.
15346 @end table
15349 @node Preprocessor Options
15350 @section Options Controlling the Preprocessor
15351 @cindex preprocessor options
15352 @cindex options, preprocessor
15354 These options control the C preprocessor, which is run on each C source
15355 file before actual compilation.
15357 If you use the @option{-E} option, nothing is done except preprocessing.
15358 Some of these options make sense only together with @option{-E} because
15359 they cause the preprocessor output to be unsuitable for actual
15360 compilation.
15362 In addition to the options listed here, there are a number of options 
15363 to control search paths for include files documented in 
15364 @ref{Directory Options}.  
15365 Options to control preprocessor diagnostics are listed in 
15366 @ref{Warning Options}.
15368 @table @gcctabopt
15369 @include cppopts.texi
15371 @item -Wp,@var{option}
15372 @opindex Wp
15373 You can use @option{-Wp,@var{option}} to bypass the compiler driver
15374 and pass @var{option} directly through to the preprocessor.  If
15375 @var{option} contains commas, it is split into multiple options at the
15376 commas.  However, many options are modified, translated or interpreted
15377 by the compiler driver before being passed to the preprocessor, and
15378 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
15379 interface is undocumented and subject to change, so whenever possible
15380 you should avoid using @option{-Wp} and let the driver handle the
15381 options instead.
15383 @item -Xpreprocessor @var{option}
15384 @opindex Xpreprocessor
15385 Pass @var{option} as an option to the preprocessor.  You can use this to
15386 supply system-specific preprocessor options that GCC does not 
15387 recognize.
15389 If you want to pass an option that takes an argument, you must use
15390 @option{-Xpreprocessor} twice, once for the option and once for the argument.
15392 @item -no-integrated-cpp
15393 @opindex no-integrated-cpp
15394 Perform preprocessing as a separate pass before compilation.
15395 By default, GCC performs preprocessing as an integrated part of
15396 input tokenization and parsing.
15397 If this option is provided, the appropriate language front end
15398 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
15399 and Objective-C, respectively) is instead invoked twice,
15400 once for preprocessing only and once for actual compilation
15401 of the preprocessed input.
15402 This option may be useful in conjunction with the @option{-B} or
15403 @option{-wrapper} options to specify an alternate preprocessor or
15404 perform additional processing of the program source between
15405 normal preprocessing and compilation.
15407 @item -flarge-source-files
15408 @opindex flarge-source-files
15409 Adjust GCC to expect large source files, at the expense of slower
15410 compilation and higher memory usage.
15412 Specifically, GCC normally tracks both column numbers and line numbers
15413 within source files and it normally prints both of these numbers in
15414 diagnostics.  However, once it has processed a certain number of source
15415 lines, it stops tracking column numbers and only tracks line numbers.
15416 This means that diagnostics for later lines do not include column numbers.
15417 It also means that options like @option{-Wmisleading-indentation} cease to work
15418 at that point, although the compiler prints a note if this happens.
15419 Passing @option{-flarge-source-files} significantly increases the number
15420 of source lines that GCC can process before it stops tracking columns.
15422 @end table
15424 @node Assembler Options
15425 @section Passing Options to the Assembler
15427 @c prevent bad page break with this line
15428 You can pass options to the assembler.
15430 @table @gcctabopt
15431 @item -Wa,@var{option}
15432 @opindex Wa
15433 Pass @var{option} as an option to the assembler.  If @var{option}
15434 contains commas, it is split into multiple options at the commas.
15436 @item -Xassembler @var{option}
15437 @opindex Xassembler
15438 Pass @var{option} as an option to the assembler.  You can use this to
15439 supply system-specific assembler options that GCC does not
15440 recognize.
15442 If you want to pass an option that takes an argument, you must use
15443 @option{-Xassembler} twice, once for the option and once for the argument.
15445 @end table
15447 @node Link Options
15448 @section Options for Linking
15449 @cindex link options
15450 @cindex options, linking
15452 These options come into play when the compiler links object files into
15453 an executable output file.  They are meaningless if the compiler is
15454 not doing a link step.
15456 @table @gcctabopt
15457 @cindex file names
15458 @item @var{object-file-name}
15459 A file name that does not end in a special recognized suffix is
15460 considered to name an object file or library.  (Object files are
15461 distinguished from libraries by the linker according to the file
15462 contents.)  If linking is done, these object files are used as input
15463 to the linker.
15465 @item -c
15466 @itemx -S
15467 @itemx -E
15468 @opindex c
15469 @opindex S
15470 @opindex E
15471 If any of these options is used, then the linker is not run, and
15472 object file names should not be used as arguments.  @xref{Overall
15473 Options}.
15475 @item -flinker-output=@var{type}
15476 @opindex flinker-output
15477 This option controls code generation of the link-time optimizer.  By
15478 default the linker output is automatically determined by the linker
15479 plugin.  For debugging the compiler and if incremental linking with a 
15480 non-LTO object file is desired, it may be useful to control the type
15481 manually.
15483 If @var{type} is @samp{exec}, code generation produces a static
15484 binary. In this case @option{-fpic} and @option{-fpie} are both
15485 disabled.
15487 If @var{type} is @samp{dyn}, code generation produces a shared
15488 library.  In this case @option{-fpic} or @option{-fPIC} is preserved,
15489 but not enabled automatically.  This allows to build shared libraries
15490 without position-independent code on architectures where this is
15491 possible, i.e.@: on x86.
15493 If @var{type} is @samp{pie}, code generation produces an @option{-fpie}
15494 executable. This results in similar optimizations as @samp{exec}
15495 except that @option{-fpie} is not disabled if specified at compilation
15496 time.
15498 If @var{type} is @samp{rel}, the compiler assumes that incremental linking is
15499 done.  The sections containing intermediate code for link-time optimization are
15500 merged, pre-optimized, and output to the resulting object file. In addition, if
15501 @option{-ffat-lto-objects} is specified, binary code is produced for future
15502 non-LTO linking. The object file produced by incremental linking is smaller
15503 than a static library produced from the same object files.  At link time the
15504 result of incremental linking also loads faster than a static
15505 library assuming that the majority of objects in the library are used.
15507 Finally @samp{nolto-rel} configures the compiler for incremental linking where
15508 code generation is forced, a final binary is produced, and the intermediate
15509 code for later link-time optimization is stripped. When multiple object files
15510 are linked together the resulting code is better optimized than with
15511 link-time optimizations disabled (for example, cross-module inlining 
15512 happens), but most of benefits of whole program optimizations are lost. 
15514 During the incremental link (by @option{-r}) the linker plugin defaults to
15515 @option{rel}. With current interfaces to GNU Binutils it is however not
15516 possible to incrementally link LTO objects and non-LTO objects into a single
15517 mixed object file.  If any of object files in incremental link cannot
15518 be used for link-time optimization, the linker plugin issues a warning and
15519 uses @samp{nolto-rel}. To maintain whole program optimization, it is
15520 recommended to link such objects into static library instead. Alternatively it
15521 is possible to use H.J. Lu's binutils with support for mixed objects.
15523 @item -fuse-ld=bfd
15524 @opindex fuse-ld=bfd
15525 Use the @command{bfd} linker instead of the default linker.
15527 @item -fuse-ld=gold
15528 @opindex fuse-ld=gold
15529 Use the @command{gold} linker instead of the default linker.
15531 @item -fuse-ld=lld
15532 @opindex fuse-ld=lld
15533 Use the LLVM @command{lld} linker instead of the default linker.
15535 @cindex Libraries
15536 @item -l@var{library}
15537 @itemx -l @var{library}
15538 @opindex l
15539 Search the library named @var{library} when linking.  (The second
15540 alternative with the library as a separate argument is only for
15541 POSIX compliance and is not recommended.)
15543 The @option{-l} option is passed directly to the linker by GCC.  Refer
15544 to your linker documentation for exact details.  The general
15545 description below applies to the GNU linker.  
15547 The linker searches a standard list of directories for the library.
15548 The directories searched include several standard system directories
15549 plus any that you specify with @option{-L}.
15551 Static libraries are archives of object files, and have file names
15552 like @file{lib@var{library}.a}.  Some targets also support shared
15553 libraries, which typically have names like @file{lib@var{library}.so}.
15554 If both static and shared libraries are found, the linker gives
15555 preference to linking with the shared library unless the
15556 @option{-static} option is used.
15558 It makes a difference where in the command you write this option; the
15559 linker searches and processes libraries and object files in the order they
15560 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
15561 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
15562 to functions in @samp{z}, those functions may not be loaded.
15564 @item -lobjc
15565 @opindex lobjc
15566 You need this special case of the @option{-l} option in order to
15567 link an Objective-C or Objective-C++ program.
15569 @item -nostartfiles
15570 @opindex nostartfiles
15571 Do not use the standard system startup files when linking.
15572 The standard system libraries are used normally, unless @option{-nostdlib},
15573 @option{-nolibc}, or @option{-nodefaultlibs} is used.
15575 @item -nodefaultlibs
15576 @opindex nodefaultlibs
15577 Do not use the standard system libraries when linking.
15578 Only the libraries you specify are passed to the linker, and options
15579 specifying linkage of the system libraries, such as @option{-static-libgcc}
15580 or @option{-shared-libgcc}, are ignored.  
15581 The standard startup files are used normally, unless @option{-nostartfiles}
15582 is used.  
15584 The compiler may generate calls to @code{memcmp},
15585 @code{memset}, @code{memcpy} and @code{memmove}.
15586 These entries are usually resolved by entries in
15587 libc.  These entry points should be supplied through some other
15588 mechanism when this option is specified.
15590 @item -nolibc
15591 @opindex nolibc
15592 Do not use the C library or system libraries tightly coupled with it when
15593 linking.  Still link with the startup files, @file{libgcc} or toolchain
15594 provided language support libraries such as @file{libgnat}, @file{libgfortran}
15595 or @file{libstdc++} unless options preventing their inclusion are used as
15596 well.  This typically removes @option{-lc} from the link command line, as well
15597 as system libraries that normally go with it and become meaningless when
15598 absence of a C library is assumed, for example @option{-lpthread} or
15599 @option{-lm} in some configurations.  This is intended for bare-board
15600 targets when there is indeed no C library available.
15602 @item -nostdlib
15603 @opindex nostdlib
15604 Do not use the standard system startup files or libraries when linking.
15605 No startup files and only the libraries you specify are passed to
15606 the linker, and options specifying linkage of the system libraries, such as
15607 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
15609 The compiler may generate calls to @code{memcmp}, @code{memset},
15610 @code{memcpy} and @code{memmove}.
15611 These entries are usually resolved by entries in
15612 libc.  These entry points should be supplied through some other
15613 mechanism when this option is specified.
15615 @cindex @option{-lgcc}, use with @option{-nostdlib}
15616 @cindex @option{-nostdlib} and unresolved references
15617 @cindex unresolved references and @option{-nostdlib}
15618 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
15619 @cindex @option{-nodefaultlibs} and unresolved references
15620 @cindex unresolved references and @option{-nodefaultlibs}
15621 One of the standard libraries bypassed by @option{-nostdlib} and
15622 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
15623 which GCC uses to overcome shortcomings of particular machines, or special
15624 needs for some languages.
15625 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
15626 Collection (GCC) Internals},
15627 for more discussion of @file{libgcc.a}.)
15628 In most cases, you need @file{libgcc.a} even when you want to avoid
15629 other standard libraries.  In other words, when you specify @option{-nostdlib}
15630 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
15631 This ensures that you have no unresolved references to internal GCC
15632 library subroutines.
15633 (An example of such an internal subroutine is @code{__main}, used to ensure C++
15634 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
15635 GNU Compiler Collection (GCC) Internals}.)
15637 @item -e @var{entry}
15638 @itemx --entry=@var{entry}
15639 @opindex e
15640 @opindex entry
15642 Specify that the program entry point is @var{entry}.  The argument is
15643 interpreted by the linker; the GNU linker accepts either a symbol name
15644 or an address.
15646 @item -pie
15647 @opindex pie
15648 Produce a dynamically linked position independent executable on targets
15649 that support it.  For predictable results, you must also specify the same
15650 set of options used for compilation (@option{-fpie}, @option{-fPIE},
15651 or model suboptions) when you specify this linker option.
15653 @item -no-pie
15654 @opindex no-pie
15655 Don't produce a dynamically linked position independent executable.
15657 @item -static-pie
15658 @opindex static-pie
15659 Produce a static position independent executable on targets that support
15660 it.  A static position independent executable is similar to a static
15661 executable, but can be loaded at any address without a dynamic linker.
15662 For predictable results, you must also specify the same set of options
15663 used for compilation (@option{-fpie}, @option{-fPIE}, or model
15664 suboptions) when you specify this linker option.
15666 @item -pthread
15667 @opindex pthread
15668 Link with the POSIX threads library.  This option is supported on 
15669 GNU/Linux targets, most other Unix derivatives, and also on 
15670 x86 Cygwin and MinGW targets.  On some targets this option also sets 
15671 flags for the preprocessor, so it should be used consistently for both
15672 compilation and linking.
15674 @item -r
15675 @opindex r
15676 Produce a relocatable object as output.  This is also known as partial
15677 linking.
15679 @item -rdynamic
15680 @opindex rdynamic
15681 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
15682 that support it. This instructs the linker to add all symbols, not
15683 only used ones, to the dynamic symbol table. This option is needed
15684 for some uses of @code{dlopen} or to allow obtaining backtraces
15685 from within a program.
15687 @item -s
15688 @opindex s
15689 Remove all symbol table and relocation information from the executable.
15691 @item -static
15692 @opindex static
15693 On systems that support dynamic linking, this overrides @option{-pie}
15694 and prevents linking with the shared libraries.  On other systems, this
15695 option has no effect.
15697 @item -shared
15698 @opindex shared
15699 Produce a shared object which can then be linked with other objects to
15700 form an executable.  Not all systems support this option.  For predictable
15701 results, you must also specify the same set of options used for compilation
15702 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
15703 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
15704 needs to build supplementary stub code for constructors to work.  On
15705 multi-libbed systems, @samp{gcc -shared} must select the correct support
15706 libraries to link against.  Failing to supply the correct flags may lead
15707 to subtle defects.  Supplying them in cases where they are not necessary
15708 is innocuous.}
15710 @item -shared-libgcc
15711 @itemx -static-libgcc
15712 @opindex shared-libgcc
15713 @opindex static-libgcc
15714 On systems that provide @file{libgcc} as a shared library, these options
15715 force the use of either the shared or static version, respectively.
15716 If no shared version of @file{libgcc} was built when the compiler was
15717 configured, these options have no effect.
15719 There are several situations in which an application should use the
15720 shared @file{libgcc} instead of the static version.  The most common
15721 of these is when the application wishes to throw and catch exceptions
15722 across different shared libraries.  In that case, each of the libraries
15723 as well as the application itself should use the shared @file{libgcc}.
15725 Therefore, the G++ driver automatically adds @option{-shared-libgcc}
15726 whenever you build a shared library or a main executable, because C++
15727 programs typically use exceptions, so this is the right thing to do.
15729 If, instead, you use the GCC driver to create shared libraries, you may
15730 find that they are not always linked with the shared @file{libgcc}.
15731 If GCC finds, at its configuration time, that you have a non-GNU linker
15732 or a GNU linker that does not support option @option{--eh-frame-hdr},
15733 it links the shared version of @file{libgcc} into shared libraries
15734 by default.  Otherwise, it takes advantage of the linker and optimizes
15735 away the linking with the shared version of @file{libgcc}, linking with
15736 the static version of libgcc by default.  This allows exceptions to
15737 propagate through such shared libraries, without incurring relocation
15738 costs at library load time.
15740 However, if a library or main executable is supposed to throw or catch
15741 exceptions, you must link it using the G++ driver, or using the option
15742 @option{-shared-libgcc}, such that it is linked with the shared
15743 @file{libgcc}.
15745 @item -static-libasan
15746 @opindex static-libasan
15747 When the @option{-fsanitize=address} option is used to link a program,
15748 the GCC driver automatically links against @option{libasan}.  If
15749 @file{libasan} is available as a shared library, and the @option{-static}
15750 option is not used, then this links against the shared version of
15751 @file{libasan}.  The @option{-static-libasan} option directs the GCC
15752 driver to link @file{libasan} statically, without necessarily linking
15753 other libraries statically.
15755 @item -static-libtsan
15756 @opindex static-libtsan
15757 When the @option{-fsanitize=thread} option is used to link a program,
15758 the GCC driver automatically links against @option{libtsan}.  If
15759 @file{libtsan} is available as a shared library, and the @option{-static}
15760 option is not used, then this links against the shared version of
15761 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
15762 driver to link @file{libtsan} statically, without necessarily linking
15763 other libraries statically.
15765 @item -static-liblsan
15766 @opindex static-liblsan
15767 When the @option{-fsanitize=leak} option is used to link a program,
15768 the GCC driver automatically links against @option{liblsan}.  If
15769 @file{liblsan} is available as a shared library, and the @option{-static}
15770 option is not used, then this links against the shared version of
15771 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
15772 driver to link @file{liblsan} statically, without necessarily linking
15773 other libraries statically.
15775 @item -static-libubsan
15776 @opindex static-libubsan
15777 When the @option{-fsanitize=undefined} option is used to link a program,
15778 the GCC driver automatically links against @option{libubsan}.  If
15779 @file{libubsan} is available as a shared library, and the @option{-static}
15780 option is not used, then this links against the shared version of
15781 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
15782 driver to link @file{libubsan} statically, without necessarily linking
15783 other libraries statically.
15785 @item -static-libstdc++
15786 @opindex static-libstdc++
15787 When the @command{g++} program is used to link a C++ program, it
15788 normally automatically links against @option{libstdc++}.  If
15789 @file{libstdc++} is available as a shared library, and the
15790 @option{-static} option is not used, then this links against the
15791 shared version of @file{libstdc++}.  That is normally fine.  However, it
15792 is sometimes useful to freeze the version of @file{libstdc++} used by
15793 the program without going all the way to a fully static link.  The
15794 @option{-static-libstdc++} option directs the @command{g++} driver to
15795 link @file{libstdc++} statically, without necessarily linking other
15796 libraries statically.
15798 @item -symbolic
15799 @opindex symbolic
15800 Bind references to global symbols when building a shared object.  Warn
15801 about any unresolved references (unless overridden by the link editor
15802 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
15803 this option.
15805 @item -T @var{script}
15806 @opindex T
15807 @cindex linker script
15808 Use @var{script} as the linker script.  This option is supported by most
15809 systems using the GNU linker.  On some targets, such as bare-board
15810 targets without an operating system, the @option{-T} option may be required
15811 when linking to avoid references to undefined symbols.
15813 @item -Xlinker @var{option}
15814 @opindex Xlinker
15815 Pass @var{option} as an option to the linker.  You can use this to
15816 supply system-specific linker options that GCC does not recognize.
15818 If you want to pass an option that takes a separate argument, you must use
15819 @option{-Xlinker} twice, once for the option and once for the argument.
15820 For example, to pass @option{-assert definitions}, you must write
15821 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
15822 @option{-Xlinker "-assert definitions"}, because this passes the entire
15823 string as a single argument, which is not what the linker expects.
15825 When using the GNU linker, it is usually more convenient to pass
15826 arguments to linker options using the @option{@var{option}=@var{value}}
15827 syntax than as separate arguments.  For example, you can specify
15828 @option{-Xlinker -Map=output.map} rather than
15829 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
15830 this syntax for command-line options.
15832 @item -Wl,@var{option}
15833 @opindex Wl
15834 Pass @var{option} as an option to the linker.  If @var{option} contains
15835 commas, it is split into multiple options at the commas.  You can use this
15836 syntax to pass an argument to the option.
15837 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
15838 linker.  When using the GNU linker, you can also get the same effect with
15839 @option{-Wl,-Map=output.map}.
15841 @item -u @var{symbol}
15842 @opindex u
15843 Pretend the symbol @var{symbol} is undefined, to force linking of
15844 library modules to define it.  You can use @option{-u} multiple times with
15845 different symbols to force loading of additional library modules.
15847 @item -z @var{keyword}
15848 @opindex z
15849 @option{-z} is passed directly on to the linker along with the keyword
15850 @var{keyword}. See the section in the documentation of your linker for
15851 permitted values and their meanings.
15852 @end table
15854 @node Directory Options
15855 @section Options for Directory Search
15856 @cindex directory options
15857 @cindex options, directory search
15858 @cindex search path
15860 These options specify directories to search for header files, for
15861 libraries and for parts of the compiler:
15863 @table @gcctabopt
15864 @include cppdiropts.texi
15866 @item -iplugindir=@var{dir}
15867 @opindex iplugindir=
15868 Set the directory to search for plugins that are passed
15869 by @option{-fplugin=@var{name}} instead of
15870 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
15871 to be used by the user, but only passed by the driver.
15873 @item -L@var{dir}
15874 @opindex L
15875 Add directory @var{dir} to the list of directories to be searched
15876 for @option{-l}.
15878 @item -B@var{prefix}
15879 @opindex B
15880 This option specifies where to find the executables, libraries,
15881 include files, and data files of the compiler itself.
15883 The compiler driver program runs one or more of the subprograms
15884 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
15885 @var{prefix} as a prefix for each program it tries to run, both with and
15886 without @samp{@var{machine}/@var{version}/} for the corresponding target
15887 machine and compiler version.
15889 For each subprogram to be run, the compiler driver first tries the
15890 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
15891 is not specified, the driver tries two standard prefixes, 
15892 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
15893 those results in a file name that is found, the unmodified program
15894 name is searched for using the directories specified in your
15895 @env{PATH} environment variable.
15897 The compiler checks to see if the path provided by @option{-B}
15898 refers to a directory, and if necessary it adds a directory
15899 separator character at the end of the path.
15901 @option{-B} prefixes that effectively specify directory names also apply
15902 to libraries in the linker, because the compiler translates these
15903 options into @option{-L} options for the linker.  They also apply to
15904 include files in the preprocessor, because the compiler translates these
15905 options into @option{-isystem} options for the preprocessor.  In this case,
15906 the compiler appends @samp{include} to the prefix.
15908 The runtime support file @file{libgcc.a} can also be searched for using
15909 the @option{-B} prefix, if needed.  If it is not found there, the two
15910 standard prefixes above are tried, and that is all.  The file is left
15911 out of the link if it is not found by those means.
15913 Another way to specify a prefix much like the @option{-B} prefix is to use
15914 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
15915 Variables}.
15917 As a special kludge, if the path provided by @option{-B} is
15918 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
15919 9, then it is replaced by @file{[dir/]include}.  This is to help
15920 with boot-strapping the compiler.
15922 @item -no-canonical-prefixes
15923 @opindex no-canonical-prefixes
15924 Do not expand any symbolic links, resolve references to @samp{/../}
15925 or @samp{/./}, or make the path absolute when generating a relative
15926 prefix.
15928 @item --sysroot=@var{dir}
15929 @opindex sysroot
15930 Use @var{dir} as the logical root directory for headers and libraries.
15931 For example, if the compiler normally searches for headers in
15932 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
15933 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
15935 If you use both this option and the @option{-isysroot} option, then
15936 the @option{--sysroot} option applies to libraries, but the
15937 @option{-isysroot} option applies to header files.
15939 The GNU linker (beginning with version 2.16) has the necessary support
15940 for this option.  If your linker does not support this option, the
15941 header file aspect of @option{--sysroot} still works, but the
15942 library aspect does not.
15944 @item --no-sysroot-suffix
15945 @opindex no-sysroot-suffix
15946 For some targets, a suffix is added to the root directory specified
15947 with @option{--sysroot}, depending on the other options used, so that
15948 headers may for example be found in
15949 @file{@var{dir}/@var{suffix}/usr/include} instead of
15950 @file{@var{dir}/usr/include}.  This option disables the addition of
15951 such a suffix.
15953 @end table
15955 @node Code Gen Options
15956 @section Options for Code Generation Conventions
15957 @cindex code generation conventions
15958 @cindex options, code generation
15959 @cindex run-time options
15961 These machine-independent options control the interface conventions
15962 used in code generation.
15964 Most of them have both positive and negative forms; the negative form
15965 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
15966 one of the forms is listed---the one that is not the default.  You
15967 can figure out the other form by either removing @samp{no-} or adding
15970 @table @gcctabopt
15971 @item -fstack-reuse=@var{reuse-level}
15972 @opindex fstack_reuse
15973 This option controls stack space reuse for user declared local/auto variables
15974 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
15975 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
15976 local variables and temporaries, @samp{named_vars} enables the reuse only for
15977 user defined local variables with names, and @samp{none} disables stack reuse
15978 completely. The default value is @samp{all}. The option is needed when the
15979 program extends the lifetime of a scoped local variable or a compiler generated
15980 temporary beyond the end point defined by the language.  When a lifetime of
15981 a variable ends, and if the variable lives in memory, the optimizing compiler
15982 has the freedom to reuse its stack space with other temporaries or scoped
15983 local variables whose live range does not overlap with it. Legacy code extending
15984 local lifetime is likely to break with the stack reuse optimization.
15986 For example,
15988 @smallexample
15989    int *p;
15990    @{
15991      int local1;
15993      p = &local1;
15994      local1 = 10;
15995      ....
15996    @}
15997    @{
15998       int local2;
15999       local2 = 20;
16000       ...
16001    @}
16003    if (*p == 10)  // out of scope use of local1
16004      @{
16006      @}
16007 @end smallexample
16009 Another example:
16010 @smallexample
16012    struct A
16013    @{
16014        A(int k) : i(k), j(k) @{ @}
16015        int i;
16016        int j;
16017    @};
16019    A *ap;
16021    void foo(const A& ar)
16022    @{
16023       ap = &ar;
16024    @}
16026    void bar()
16027    @{
16028       foo(A(10)); // temp object's lifetime ends when foo returns
16030       @{
16031         A a(20);
16032         ....
16033       @}
16034       ap->i+= 10;  // ap references out of scope temp whose space
16035                    // is reused with a. What is the value of ap->i?
16036    @}
16038 @end smallexample
16040 The lifetime of a compiler generated temporary is well defined by the C++
16041 standard. When a lifetime of a temporary ends, and if the temporary lives
16042 in memory, the optimizing compiler has the freedom to reuse its stack
16043 space with other temporaries or scoped local variables whose live range
16044 does not overlap with it. However some of the legacy code relies on
16045 the behavior of older compilers in which temporaries' stack space is
16046 not reused, the aggressive stack reuse can lead to runtime errors. This
16047 option is used to control the temporary stack reuse optimization.
16049 @item -ftrapv
16050 @opindex ftrapv
16051 This option generates traps for signed overflow on addition, subtraction,
16052 multiplication operations.
16053 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
16054 @option{-ftrapv} @option{-fwrapv} on the command-line results in
16055 @option{-fwrapv} being effective.  Note that only active options override, so
16056 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
16057 results in @option{-ftrapv} being effective.
16059 @item -fwrapv
16060 @opindex fwrapv
16061 This option instructs the compiler to assume that signed arithmetic
16062 overflow of addition, subtraction and multiplication wraps around
16063 using twos-complement representation.  This flag enables some optimizations
16064 and disables others.
16065 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
16066 @option{-ftrapv} @option{-fwrapv} on the command-line results in
16067 @option{-fwrapv} being effective.  Note that only active options override, so
16068 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
16069 results in @option{-ftrapv} being effective.
16071 @item -fwrapv-pointer
16072 @opindex fwrapv-pointer
16073 This option instructs the compiler to assume that pointer arithmetic
16074 overflow on addition and subtraction wraps around using twos-complement
16075 representation.  This flag disables some optimizations which assume
16076 pointer overflow is invalid.
16078 @item -fstrict-overflow
16079 @opindex fstrict-overflow
16080 This option implies @option{-fno-wrapv} @option{-fno-wrapv-pointer} and when
16081 negated implies @option{-fwrapv} @option{-fwrapv-pointer}.
16083 @item -fexceptions
16084 @opindex fexceptions
16085 Enable exception handling.  Generates extra code needed to propagate
16086 exceptions.  For some targets, this implies GCC generates frame
16087 unwind information for all functions, which can produce significant data
16088 size overhead, although it does not affect execution.  If you do not
16089 specify this option, GCC enables it by default for languages like
16090 C++ that normally require exception handling, and disables it for
16091 languages like C that do not normally require it.  However, you may need
16092 to enable this option when compiling C code that needs to interoperate
16093 properly with exception handlers written in C++.  You may also wish to
16094 disable this option if you are compiling older C++ programs that don't
16095 use exception handling.
16097 @item -fnon-call-exceptions
16098 @opindex fnon-call-exceptions
16099 Generate code that allows trapping instructions to throw exceptions.
16100 Note that this requires platform-specific runtime support that does
16101 not exist everywhere.  Moreover, it only allows @emph{trapping}
16102 instructions to throw exceptions, i.e.@: memory references or floating-point
16103 instructions.  It does not allow exceptions to be thrown from
16104 arbitrary signal handlers such as @code{SIGALRM}.
16106 @item -fdelete-dead-exceptions
16107 @opindex fdelete-dead-exceptions
16108 Consider that instructions that may throw exceptions but don't otherwise
16109 contribute to the execution of the program can be optimized away.
16110 This option is enabled by default for the Ada front end, as permitted by
16111 the Ada language specification.
16112 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
16114 @item -funwind-tables
16115 @opindex funwind-tables
16116 Similar to @option{-fexceptions}, except that it just generates any needed
16117 static data, but does not affect the generated code in any other way.
16118 You normally do not need to enable this option; instead, a language processor
16119 that needs this handling enables it on your behalf.
16121 @item -fasynchronous-unwind-tables
16122 @opindex fasynchronous-unwind-tables
16123 Generate unwind table in DWARF format, if supported by target machine.  The
16124 table is exact at each instruction boundary, so it can be used for stack
16125 unwinding from asynchronous events (such as debugger or garbage collector).
16127 @item -fno-gnu-unique
16128 @opindex fno-gnu-unique
16129 @opindex fgnu-unique
16130 On systems with recent GNU assembler and C library, the C++ compiler
16131 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
16132 of template static data members and static local variables in inline
16133 functions are unique even in the presence of @code{RTLD_LOCAL}; this
16134 is necessary to avoid problems with a library used by two different
16135 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
16136 therefore disagreeing with the other one about the binding of the
16137 symbol.  But this causes @code{dlclose} to be ignored for affected
16138 DSOs; if your program relies on reinitialization of a DSO via
16139 @code{dlclose} and @code{dlopen}, you can use
16140 @option{-fno-gnu-unique}.
16142 @item -fpcc-struct-return
16143 @opindex fpcc-struct-return
16144 Return ``short'' @code{struct} and @code{union} values in memory like
16145 longer ones, rather than in registers.  This convention is less
16146 efficient, but it has the advantage of allowing intercallability between
16147 GCC-compiled files and files compiled with other compilers, particularly
16148 the Portable C Compiler (pcc).
16150 The precise convention for returning structures in memory depends
16151 on the target configuration macros.
16153 Short structures and unions are those whose size and alignment match
16154 that of some integer type.
16156 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
16157 switch is not binary compatible with code compiled with the
16158 @option{-freg-struct-return} switch.
16159 Use it to conform to a non-default application binary interface.
16161 @item -freg-struct-return
16162 @opindex freg-struct-return
16163 Return @code{struct} and @code{union} values in registers when possible.
16164 This is more efficient for small structures than
16165 @option{-fpcc-struct-return}.
16167 If you specify neither @option{-fpcc-struct-return} nor
16168 @option{-freg-struct-return}, GCC defaults to whichever convention is
16169 standard for the target.  If there is no standard convention, GCC
16170 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
16171 the principal compiler.  In those cases, we can choose the standard, and
16172 we chose the more efficient register return alternative.
16174 @strong{Warning:} code compiled with the @option{-freg-struct-return}
16175 switch is not binary compatible with code compiled with the
16176 @option{-fpcc-struct-return} switch.
16177 Use it to conform to a non-default application binary interface.
16179 @item -fshort-enums
16180 @opindex fshort-enums
16181 Allocate to an @code{enum} type only as many bytes as it needs for the
16182 declared range of possible values.  Specifically, the @code{enum} type
16183 is equivalent to the smallest integer type that has enough room.
16185 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
16186 code that is not binary compatible with code generated without that switch.
16187 Use it to conform to a non-default application binary interface.
16189 @item -fshort-wchar
16190 @opindex fshort-wchar
16191 Override the underlying type for @code{wchar_t} to be @code{short
16192 unsigned int} instead of the default for the target.  This option is
16193 useful for building programs to run under WINE@.
16195 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
16196 code that is not binary compatible with code generated without that switch.
16197 Use it to conform to a non-default application binary interface.
16199 @item -fcommon
16200 @opindex fcommon
16201 @opindex fno-common
16202 @cindex tentative definitions
16203 In C code, this option controls the placement of global variables
16204 defined without an initializer, known as @dfn{tentative definitions}
16205 in the C standard.  Tentative definitions are distinct from declarations
16206 of a variable with the @code{extern} keyword, which do not allocate storage.
16208 The default is @option{-fno-common}, which specifies that the compiler places
16209 uninitialized global variables in the BSS section of the object file.
16210 This inhibits the merging of tentative definitions by the linker so you get a
16211 multiple-definition error if the same variable is accidentally defined in more
16212 than one compilation unit.
16214 The @option{-fcommon} places uninitialized global variables in a common block.
16215 This allows the linker to resolve all tentative definitions of the same variable
16216 in different compilation units to the same object, or to a non-tentative
16217 definition.  This behavior is inconsistent with C++, and on many targets implies
16218 a speed and code size penalty on global variable references.  It is mainly
16219 useful to enable legacy code to link without errors.
16221 @item -fno-ident
16222 @opindex fno-ident
16223 @opindex fident
16224 Ignore the @code{#ident} directive.
16226 @item -finhibit-size-directive
16227 @opindex finhibit-size-directive
16228 Don't output a @code{.size} assembler directive, or anything else that
16229 would cause trouble if the function is split in the middle, and the
16230 two halves are placed at locations far apart in memory.  This option is
16231 used when compiling @file{crtstuff.c}; you should not need to use it
16232 for anything else.
16234 @item -fverbose-asm
16235 @opindex fverbose-asm
16236 Put extra commentary information in the generated assembly code to
16237 make it more readable.  This option is generally only of use to those
16238 who actually need to read the generated assembly code (perhaps while
16239 debugging the compiler itself).
16241 @option{-fno-verbose-asm}, the default, causes the
16242 extra information to be omitted and is useful when comparing two assembler
16243 files.
16245 The added comments include:
16247 @itemize @bullet
16249 @item
16250 information on the compiler version and command-line options,
16252 @item
16253 the source code lines associated with the assembly instructions,
16254 in the form FILENAME:LINENUMBER:CONTENT OF LINE,
16256 @item
16257 hints on which high-level expressions correspond to
16258 the various assembly instruction operands.
16260 @end itemize
16262 For example, given this C source file:
16264 @smallexample
16265 int test (int n)
16267   int i;
16268   int total = 0;
16270   for (i = 0; i < n; i++)
16271     total += i * i;
16273   return total;
16275 @end smallexample
16277 compiling to (x86_64) assembly via @option{-S} and emitting the result
16278 direct to stdout via @option{-o} @option{-}
16280 @smallexample
16281 gcc -S test.c -fverbose-asm -Os -o -
16282 @end smallexample
16284 gives output similar to this:
16286 @smallexample
16287         .file   "test.c"
16288 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
16289   [...snip...]
16290 # options passed:
16291   [...snip...]
16293         .text
16294         .globl  test
16295         .type   test, @@function
16296 test:
16297 .LFB0:
16298         .cfi_startproc
16299 # test.c:4:   int total = 0;
16300         xorl    %eax, %eax      # <retval>
16301 # test.c:6:   for (i = 0; i < n; i++)
16302         xorl    %edx, %edx      # i
16303 .L2:
16304 # test.c:6:   for (i = 0; i < n; i++)
16305         cmpl    %edi, %edx      # n, i
16306         jge     .L5     #,
16307 # test.c:7:     total += i * i;
16308         movl    %edx, %ecx      # i, tmp92
16309         imull   %edx, %ecx      # i, tmp92
16310 # test.c:6:   for (i = 0; i < n; i++)
16311         incl    %edx    # i
16312 # test.c:7:     total += i * i;
16313         addl    %ecx, %eax      # tmp92, <retval>
16314         jmp     .L2     #
16315 .L5:
16316 # test.c:10: @}
16317         ret
16318         .cfi_endproc
16319 .LFE0:
16320         .size   test, .-test
16321         .ident  "GCC: (GNU) 7.0.0 20160809 (experimental)"
16322         .section        .note.GNU-stack,"",@@progbits
16323 @end smallexample
16325 The comments are intended for humans rather than machines and hence the
16326 precise format of the comments is subject to change.
16328 @item -frecord-gcc-switches
16329 @opindex frecord-gcc-switches
16330 This switch causes the command line used to invoke the
16331 compiler to be recorded into the object file that is being created.
16332 This switch is only implemented on some targets and the exact format
16333 of the recording is target and binary file format dependent, but it
16334 usually takes the form of a section containing ASCII text.  This
16335 switch is related to the @option{-fverbose-asm} switch, but that
16336 switch only records information in the assembler output file as
16337 comments, so it never reaches the object file.
16338 See also @option{-grecord-gcc-switches} for another
16339 way of storing compiler options into the object file.
16341 @item -fpic
16342 @opindex fpic
16343 @cindex global offset table
16344 @cindex PIC
16345 Generate position-independent code (PIC) suitable for use in a shared
16346 library, if supported for the target machine.  Such code accesses all
16347 constant addresses through a global offset table (GOT)@.  The dynamic
16348 loader resolves the GOT entries when the program starts (the dynamic
16349 loader is not part of GCC; it is part of the operating system).  If
16350 the GOT size for the linked executable exceeds a machine-specific
16351 maximum size, you get an error message from the linker indicating that
16352 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
16353 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
16354 on the m68k and RS/6000.  The x86 has no such limit.)
16356 Position-independent code requires special support, and therefore works
16357 only on certain machines.  For the x86, GCC supports PIC for System V
16358 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
16359 position-independent.
16361 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
16362 are defined to 1.
16364 @item -fPIC
16365 @opindex fPIC
16366 If supported for the target machine, emit position-independent code,
16367 suitable for dynamic linking and avoiding any limit on the size of the
16368 global offset table.  This option makes a difference on AArch64, m68k,
16369 PowerPC and SPARC@.
16371 Position-independent code requires special support, and therefore works
16372 only on certain machines.
16374 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
16375 are defined to 2.
16377 @item -fpie
16378 @itemx -fPIE
16379 @opindex fpie
16380 @opindex fPIE
16381 These options are similar to @option{-fpic} and @option{-fPIC}, but the
16382 generated position-independent code can be only linked into executables.
16383 Usually these options are used to compile code that will be linked using
16384 the @option{-pie} GCC option.
16386 @option{-fpie} and @option{-fPIE} both define the macros
16387 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
16388 for @option{-fpie} and 2 for @option{-fPIE}.
16390 @item -fno-plt
16391 @opindex fno-plt
16392 @opindex fplt
16393 Do not use the PLT for external function calls in position-independent code.
16394 Instead, load the callee address at call sites from the GOT and branch to it.
16395 This leads to more efficient code by eliminating PLT stubs and exposing
16396 GOT loads to optimizations.  On architectures such as 32-bit x86 where
16397 PLT stubs expect the GOT pointer in a specific register, this gives more
16398 register allocation freedom to the compiler.
16399 Lazy binding requires use of the PLT; 
16400 with @option{-fno-plt} all external symbols are resolved at load time.
16402 Alternatively, the function attribute @code{noplt} can be used to avoid calls
16403 through the PLT for specific external functions.
16405 In position-dependent code, a few targets also convert calls to
16406 functions that are marked to not use the PLT to use the GOT instead.
16408 @item -fno-jump-tables
16409 @opindex fno-jump-tables
16410 @opindex fjump-tables
16411 Do not use jump tables for switch statements even where it would be
16412 more efficient than other code generation strategies.  This option is
16413 of use in conjunction with @option{-fpic} or @option{-fPIC} for
16414 building code that forms part of a dynamic linker and cannot
16415 reference the address of a jump table.  On some targets, jump tables
16416 do not require a GOT and this option is not needed.
16418 @item -fno-bit-tests
16419 @opindex fno-bit-tests
16420 @opindex fbit-tests
16421 Do not use bit tests for switch statements even where it would be
16422 more efficient than other code generation strategies.
16424 @item -ffixed-@var{reg}
16425 @opindex ffixed
16426 Treat the register named @var{reg} as a fixed register; generated code
16427 should never refer to it (except perhaps as a stack pointer, frame
16428 pointer or in some other fixed role).
16430 @var{reg} must be the name of a register.  The register names accepted
16431 are machine-specific and are defined in the @code{REGISTER_NAMES}
16432 macro in the machine description macro file.
16434 This flag does not have a negative form, because it specifies a
16435 three-way choice.
16437 @item -fcall-used-@var{reg}
16438 @opindex fcall-used
16439 Treat the register named @var{reg} as an allocable register that is
16440 clobbered by function calls.  It may be allocated for temporaries or
16441 variables that do not live across a call.  Functions compiled this way
16442 do not save and restore the register @var{reg}.
16444 It is an error to use this flag with the frame pointer or stack pointer.
16445 Use of this flag for other registers that have fixed pervasive roles in
16446 the machine's execution model produces disastrous results.
16448 This flag does not have a negative form, because it specifies a
16449 three-way choice.
16451 @item -fcall-saved-@var{reg}
16452 @opindex fcall-saved
16453 Treat the register named @var{reg} as an allocable register saved by
16454 functions.  It may be allocated even for temporaries or variables that
16455 live across a call.  Functions compiled this way save and restore
16456 the register @var{reg} if they use it.
16458 It is an error to use this flag with the frame pointer or stack pointer.
16459 Use of this flag for other registers that have fixed pervasive roles in
16460 the machine's execution model produces disastrous results.
16462 A different sort of disaster results from the use of this flag for
16463 a register in which function values may be returned.
16465 This flag does not have a negative form, because it specifies a
16466 three-way choice.
16468 @item -fpack-struct[=@var{n}]
16469 @opindex fpack-struct
16470 Without a value specified, pack all structure members together without
16471 holes.  When a value is specified (which must be a small power of two), pack
16472 structure members according to this value, representing the maximum
16473 alignment (that is, objects with default alignment requirements larger than
16474 this are output potentially unaligned at the next fitting location.
16476 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
16477 code that is not binary compatible with code generated without that switch.
16478 Additionally, it makes the code suboptimal.
16479 Use it to conform to a non-default application binary interface.
16481 @item -fleading-underscore
16482 @opindex fleading-underscore
16483 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
16484 change the way C symbols are represented in the object file.  One use
16485 is to help link with legacy assembly code.
16487 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
16488 generate code that is not binary compatible with code generated without that
16489 switch.  Use it to conform to a non-default application binary interface.
16490 Not all targets provide complete support for this switch.
16492 @item -ftls-model=@var{model}
16493 @opindex ftls-model
16494 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
16495 The @var{model} argument should be one of @samp{global-dynamic},
16496 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
16497 Note that the choice is subject to optimization: the compiler may use
16498 a more efficient model for symbols not visible outside of the translation
16499 unit, or if @option{-fpic} is not given on the command line.
16501 The default without @option{-fpic} is @samp{initial-exec}; with
16502 @option{-fpic} the default is @samp{global-dynamic}.
16504 @item -ftrampolines
16505 @opindex ftrampolines
16506 For targets that normally need trampolines for nested functions, always
16507 generate them instead of using descriptors.  Otherwise, for targets that
16508 do not need them, like for example HP-PA or IA-64, do nothing.
16510 A trampoline is a small piece of code that is created at run time on the
16511 stack when the address of a nested function is taken, and is used to call
16512 the nested function indirectly.  Therefore, it requires the stack to be
16513 made executable in order for the program to work properly.
16515 @option{-fno-trampolines} is enabled by default on a language by language
16516 basis to let the compiler avoid generating them, if it computes that this
16517 is safe, and replace them with descriptors.  Descriptors are made up of data
16518 only, but the generated code must be prepared to deal with them.  As of this
16519 writing, @option{-fno-trampolines} is enabled by default only for Ada.
16521 Moreover, code compiled with @option{-ftrampolines} and code compiled with
16522 @option{-fno-trampolines} are not binary compatible if nested functions are
16523 present.  This option must therefore be used on a program-wide basis and be
16524 manipulated with extreme care.
16526 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
16527 @opindex fvisibility
16528 Set the default ELF image symbol visibility to the specified option---all
16529 symbols are marked with this unless overridden within the code.
16530 Using this feature can very substantially improve linking and
16531 load times of shared object libraries, produce more optimized
16532 code, provide near-perfect API export and prevent symbol clashes.
16533 It is @strong{strongly} recommended that you use this in any shared objects
16534 you distribute.
16536 Despite the nomenclature, @samp{default} always means public; i.e.,
16537 available to be linked against from outside the shared object.
16538 @samp{protected} and @samp{internal} are pretty useless in real-world
16539 usage so the only other commonly used option is @samp{hidden}.
16540 The default if @option{-fvisibility} isn't specified is
16541 @samp{default}, i.e., make every symbol public.
16543 A good explanation of the benefits offered by ensuring ELF
16544 symbols have the correct visibility is given by ``How To Write
16545 Shared Libraries'' by Ulrich Drepper (which can be found at
16546 @w{@uref{https://www.akkadia.org/drepper/}})---however a superior
16547 solution made possible by this option to marking things hidden when
16548 the default is public is to make the default hidden and mark things
16549 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
16550 and @code{__attribute__ ((visibility("default")))} instead of
16551 @code{__declspec(dllexport)} you get almost identical semantics with
16552 identical syntax.  This is a great boon to those working with
16553 cross-platform projects.
16555 For those adding visibility support to existing code, you may find
16556 @code{#pragma GCC visibility} of use.  This works by you enclosing
16557 the declarations you wish to set visibility for with (for example)
16558 @code{#pragma GCC visibility push(hidden)} and
16559 @code{#pragma GCC visibility pop}.
16560 Bear in mind that symbol visibility should be viewed @strong{as
16561 part of the API interface contract} and thus all new code should
16562 always specify visibility when it is not the default; i.e., declarations
16563 only for use within the local DSO should @strong{always} be marked explicitly
16564 as hidden as so to avoid PLT indirection overheads---making this
16565 abundantly clear also aids readability and self-documentation of the code.
16566 Note that due to ISO C++ specification requirements, @code{operator new} and
16567 @code{operator delete} must always be of default visibility.
16569 Be aware that headers from outside your project, in particular system
16570 headers and headers from any other library you use, may not be
16571 expecting to be compiled with visibility other than the default.  You
16572 may need to explicitly say @code{#pragma GCC visibility push(default)}
16573 before including any such headers.
16575 @code{extern} declarations are not affected by @option{-fvisibility}, so
16576 a lot of code can be recompiled with @option{-fvisibility=hidden} with
16577 no modifications.  However, this means that calls to @code{extern}
16578 functions with no explicit visibility use the PLT, so it is more
16579 effective to use @code{__attribute ((visibility))} and/or
16580 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
16581 declarations should be treated as hidden.
16583 Note that @option{-fvisibility} does affect C++ vague linkage
16584 entities. This means that, for instance, an exception class that is
16585 be thrown between DSOs must be explicitly marked with default
16586 visibility so that the @samp{type_info} nodes are unified between
16587 the DSOs.
16589 An overview of these techniques, their benefits and how to use them
16590 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
16592 @item -fstrict-volatile-bitfields
16593 @opindex fstrict-volatile-bitfields
16594 This option should be used if accesses to volatile bit-fields (or other
16595 structure fields, although the compiler usually honors those types
16596 anyway) should use a single access of the width of the
16597 field's type, aligned to a natural alignment if possible.  For
16598 example, targets with memory-mapped peripheral registers might require
16599 all such accesses to be 16 bits wide; with this flag you can
16600 declare all peripheral bit-fields as @code{unsigned short} (assuming short
16601 is 16 bits on these targets) to force GCC to use 16-bit accesses
16602 instead of, perhaps, a more efficient 32-bit access.
16604 If this option is disabled, the compiler uses the most efficient
16605 instruction.  In the previous example, that might be a 32-bit load
16606 instruction, even though that accesses bytes that do not contain
16607 any portion of the bit-field, or memory-mapped registers unrelated to
16608 the one being updated.
16610 In some cases, such as when the @code{packed} attribute is applied to a 
16611 structure field, it may not be possible to access the field with a single
16612 read or write that is correctly aligned for the target machine.  In this
16613 case GCC falls back to generating multiple accesses rather than code that 
16614 will fault or truncate the result at run time.
16616 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
16617 not allowed to touch non bit-field members.  It is therefore recommended
16618 to define all bits of the field's type as bit-field members.
16620 The default value of this option is determined by the application binary
16621 interface for the target processor.
16623 @item -fsync-libcalls
16624 @opindex fsync-libcalls
16625 This option controls whether any out-of-line instance of the @code{__sync}
16626 family of functions may be used to implement the C++11 @code{__atomic}
16627 family of functions.
16629 The default value of this option is enabled, thus the only useful form
16630 of the option is @option{-fno-sync-libcalls}.  This option is used in
16631 the implementation of the @file{libatomic} runtime library.
16633 @end table
16635 @node Developer Options
16636 @section GCC Developer Options
16637 @cindex developer options
16638 @cindex debugging GCC
16639 @cindex debug dump options
16640 @cindex dump options
16641 @cindex compilation statistics
16643 This section describes command-line options that are primarily of
16644 interest to GCC developers, including options to support compiler
16645 testing and investigation of compiler bugs and compile-time
16646 performance problems.  This includes options that produce debug dumps
16647 at various points in the compilation; that print statistics such as
16648 memory use and execution time; and that print information about GCC's
16649 configuration, such as where it searches for libraries.  You should
16650 rarely need to use any of these options for ordinary compilation and
16651 linking tasks.
16653 Many developer options that cause GCC to dump output to a file take an
16654 optional @samp{=@var{filename}} suffix. You can specify @samp{stdout}
16655 or @samp{-} to dump to standard output, and @samp{stderr} for standard
16656 error.
16658 If @samp{=@var{filename}} is omitted, a default dump file name is
16659 constructed by concatenating the base dump file name, a pass number,
16660 phase letter, and pass name.  The base dump file name is the name of
16661 output file produced by the compiler if explicitly specified and not
16662 an executable; otherwise it is the source file name.
16663 The pass number is determined by the order passes are registered with
16664 the compiler's pass manager. 
16665 This is generally the same as the order of execution, but passes
16666 registered by plugins, target-specific passes, or passes that are
16667 otherwise registered late are numbered higher than the pass named
16668 @samp{final}, even if they are executed earlier.  The phase letter is
16669 one of @samp{i} (inter-procedural analysis), @samp{l}
16670 (language-specific), @samp{r} (RTL), or @samp{t} (tree). 
16671 The files are created in the directory of the output file. 
16673 @table @gcctabopt
16675 @item -fcallgraph-info
16676 @itemx -fcallgraph-info=@var{MARKERS}
16677 @opindex fcallgraph-info
16678 Makes the compiler output callgraph information for the program, on a
16679 per-object-file basis.  The information is generated in the common VCG
16680 format.  It can be decorated with additional, per-node and/or per-edge
16681 information, if a list of comma-separated markers is additionally
16682 specified.  When the @code{su} marker is specified, the callgraph is
16683 decorated with stack usage information; it is equivalent to
16684 @option{-fstack-usage}.  When the @code{da} marker is specified, the
16685 callgraph is decorated with information about dynamically allocated
16686 objects.
16688 When compiling with @option{-flto}, no callgraph information is output
16689 along with the object file.  At LTO link time, @option{-fcallgraph-info}
16690 may generate multiple callgraph information files next to intermediate
16691 LTO output files.
16693 @item -d@var{letters}
16694 @itemx -fdump-rtl-@var{pass}
16695 @itemx -fdump-rtl-@var{pass}=@var{filename}
16696 @opindex d
16697 @opindex fdump-rtl-@var{pass}
16698 Says to make debugging dumps during compilation at times specified by
16699 @var{letters}.  This is used for debugging the RTL-based passes of the
16700 compiler.
16702 Some @option{-d@var{letters}} switches have different meaning when
16703 @option{-E} is used for preprocessing.  @xref{Preprocessor Options},
16704 for information about preprocessor-specific dump options.
16706 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
16707 @option{-d} option @var{letters}.  Here are the possible
16708 letters for use in @var{pass} and @var{letters}, and their meanings:
16710 @table @gcctabopt
16712 @item -fdump-rtl-alignments
16713 @opindex fdump-rtl-alignments
16714 Dump after branch alignments have been computed.
16716 @item -fdump-rtl-asmcons
16717 @opindex fdump-rtl-asmcons
16718 Dump after fixing rtl statements that have unsatisfied in/out constraints.
16720 @item -fdump-rtl-auto_inc_dec
16721 @opindex fdump-rtl-auto_inc_dec
16722 Dump after auto-inc-dec discovery.  This pass is only run on
16723 architectures that have auto inc or auto dec instructions.
16725 @item -fdump-rtl-barriers
16726 @opindex fdump-rtl-barriers
16727 Dump after cleaning up the barrier instructions.
16729 @item -fdump-rtl-bbpart
16730 @opindex fdump-rtl-bbpart
16731 Dump after partitioning hot and cold basic blocks.
16733 @item -fdump-rtl-bbro
16734 @opindex fdump-rtl-bbro
16735 Dump after block reordering.
16737 @item -fdump-rtl-btl1
16738 @itemx -fdump-rtl-btl2
16739 @opindex fdump-rtl-btl2
16740 @opindex fdump-rtl-btl2
16741 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
16742 after the two branch
16743 target load optimization passes.
16745 @item -fdump-rtl-bypass
16746 @opindex fdump-rtl-bypass
16747 Dump after jump bypassing and control flow optimizations.
16749 @item -fdump-rtl-combine
16750 @opindex fdump-rtl-combine
16751 Dump after the RTL instruction combination pass.
16753 @item -fdump-rtl-compgotos
16754 @opindex fdump-rtl-compgotos
16755 Dump after duplicating the computed gotos.
16757 @item -fdump-rtl-ce1
16758 @itemx -fdump-rtl-ce2
16759 @itemx -fdump-rtl-ce3
16760 @opindex fdump-rtl-ce1
16761 @opindex fdump-rtl-ce2
16762 @opindex fdump-rtl-ce3
16763 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
16764 @option{-fdump-rtl-ce3} enable dumping after the three
16765 if conversion passes.
16767 @item -fdump-rtl-cprop_hardreg
16768 @opindex fdump-rtl-cprop_hardreg
16769 Dump after hard register copy propagation.
16771 @item -fdump-rtl-csa
16772 @opindex fdump-rtl-csa
16773 Dump after combining stack adjustments.
16775 @item -fdump-rtl-cse1
16776 @itemx -fdump-rtl-cse2
16777 @opindex fdump-rtl-cse1
16778 @opindex fdump-rtl-cse2
16779 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
16780 the two common subexpression elimination passes.
16782 @item -fdump-rtl-dce
16783 @opindex fdump-rtl-dce
16784 Dump after the standalone dead code elimination passes.
16786 @item -fdump-rtl-dbr
16787 @opindex fdump-rtl-dbr
16788 Dump after delayed branch scheduling.
16790 @item -fdump-rtl-dce1
16791 @itemx -fdump-rtl-dce2
16792 @opindex fdump-rtl-dce1
16793 @opindex fdump-rtl-dce2
16794 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
16795 the two dead store elimination passes.
16797 @item -fdump-rtl-eh
16798 @opindex fdump-rtl-eh
16799 Dump after finalization of EH handling code.
16801 @item -fdump-rtl-eh_ranges
16802 @opindex fdump-rtl-eh_ranges
16803 Dump after conversion of EH handling range regions.
16805 @item -fdump-rtl-expand
16806 @opindex fdump-rtl-expand
16807 Dump after RTL generation.
16809 @item -fdump-rtl-fwprop1
16810 @itemx -fdump-rtl-fwprop2
16811 @opindex fdump-rtl-fwprop1
16812 @opindex fdump-rtl-fwprop2
16813 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
16814 dumping after the two forward propagation passes.
16816 @item -fdump-rtl-gcse1
16817 @itemx -fdump-rtl-gcse2
16818 @opindex fdump-rtl-gcse1
16819 @opindex fdump-rtl-gcse2
16820 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
16821 after global common subexpression elimination.
16823 @item -fdump-rtl-init-regs
16824 @opindex fdump-rtl-init-regs
16825 Dump after the initialization of the registers.
16827 @item -fdump-rtl-initvals
16828 @opindex fdump-rtl-initvals
16829 Dump after the computation of the initial value sets.
16831 @item -fdump-rtl-into_cfglayout
16832 @opindex fdump-rtl-into_cfglayout
16833 Dump after converting to cfglayout mode.
16835 @item -fdump-rtl-ira
16836 @opindex fdump-rtl-ira
16837 Dump after iterated register allocation.
16839 @item -fdump-rtl-jump
16840 @opindex fdump-rtl-jump
16841 Dump after the second jump optimization.
16843 @item -fdump-rtl-loop2
16844 @opindex fdump-rtl-loop2
16845 @option{-fdump-rtl-loop2} enables dumping after the rtl
16846 loop optimization passes.
16848 @item -fdump-rtl-mach
16849 @opindex fdump-rtl-mach
16850 Dump after performing the machine dependent reorganization pass, if that
16851 pass exists.
16853 @item -fdump-rtl-mode_sw
16854 @opindex fdump-rtl-mode_sw
16855 Dump after removing redundant mode switches.
16857 @item -fdump-rtl-rnreg
16858 @opindex fdump-rtl-rnreg
16859 Dump after register renumbering.
16861 @item -fdump-rtl-outof_cfglayout
16862 @opindex fdump-rtl-outof_cfglayout
16863 Dump after converting from cfglayout mode.
16865 @item -fdump-rtl-peephole2
16866 @opindex fdump-rtl-peephole2
16867 Dump after the peephole pass.
16869 @item -fdump-rtl-postreload
16870 @opindex fdump-rtl-postreload
16871 Dump after post-reload optimizations.
16873 @item -fdump-rtl-pro_and_epilogue
16874 @opindex fdump-rtl-pro_and_epilogue
16875 Dump after generating the function prologues and epilogues.
16877 @item -fdump-rtl-sched1
16878 @itemx -fdump-rtl-sched2
16879 @opindex fdump-rtl-sched1
16880 @opindex fdump-rtl-sched2
16881 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
16882 after the basic block scheduling passes.
16884 @item -fdump-rtl-ree
16885 @opindex fdump-rtl-ree
16886 Dump after sign/zero extension elimination.
16888 @item -fdump-rtl-seqabstr
16889 @opindex fdump-rtl-seqabstr
16890 Dump after common sequence discovery.
16892 @item -fdump-rtl-shorten
16893 @opindex fdump-rtl-shorten
16894 Dump after shortening branches.
16896 @item -fdump-rtl-sibling
16897 @opindex fdump-rtl-sibling
16898 Dump after sibling call optimizations.
16900 @item -fdump-rtl-split1
16901 @itemx -fdump-rtl-split2
16902 @itemx -fdump-rtl-split3
16903 @itemx -fdump-rtl-split4
16904 @itemx -fdump-rtl-split5
16905 @opindex fdump-rtl-split1
16906 @opindex fdump-rtl-split2
16907 @opindex fdump-rtl-split3
16908 @opindex fdump-rtl-split4
16909 @opindex fdump-rtl-split5
16910 These options enable dumping after five rounds of
16911 instruction splitting.
16913 @item -fdump-rtl-sms
16914 @opindex fdump-rtl-sms
16915 Dump after modulo scheduling.  This pass is only run on some
16916 architectures.
16918 @item -fdump-rtl-stack
16919 @opindex fdump-rtl-stack
16920 Dump after conversion from GCC's ``flat register file'' registers to the
16921 x87's stack-like registers.  This pass is only run on x86 variants.
16923 @item -fdump-rtl-subreg1
16924 @itemx -fdump-rtl-subreg2
16925 @opindex fdump-rtl-subreg1
16926 @opindex fdump-rtl-subreg2
16927 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
16928 the two subreg expansion passes.
16930 @item -fdump-rtl-unshare
16931 @opindex fdump-rtl-unshare
16932 Dump after all rtl has been unshared.
16934 @item -fdump-rtl-vartrack
16935 @opindex fdump-rtl-vartrack
16936 Dump after variable tracking.
16938 @item -fdump-rtl-vregs
16939 @opindex fdump-rtl-vregs
16940 Dump after converting virtual registers to hard registers.
16942 @item -fdump-rtl-web
16943 @opindex fdump-rtl-web
16944 Dump after live range splitting.
16946 @item -fdump-rtl-regclass
16947 @itemx -fdump-rtl-subregs_of_mode_init
16948 @itemx -fdump-rtl-subregs_of_mode_finish
16949 @itemx -fdump-rtl-dfinit
16950 @itemx -fdump-rtl-dfinish
16951 @opindex fdump-rtl-regclass
16952 @opindex fdump-rtl-subregs_of_mode_init
16953 @opindex fdump-rtl-subregs_of_mode_finish
16954 @opindex fdump-rtl-dfinit
16955 @opindex fdump-rtl-dfinish
16956 These dumps are defined but always produce empty files.
16958 @item -da
16959 @itemx -fdump-rtl-all
16960 @opindex da
16961 @opindex fdump-rtl-all
16962 Produce all the dumps listed above.
16964 @item -dA
16965 @opindex dA
16966 Annotate the assembler output with miscellaneous debugging information.
16968 @item -dD
16969 @opindex dD
16970 Dump all macro definitions, at the end of preprocessing, in addition to
16971 normal output.
16973 @item -dH
16974 @opindex dH
16975 Produce a core dump whenever an error occurs.
16977 @item -dp
16978 @opindex dp
16979 Annotate the assembler output with a comment indicating which
16980 pattern and alternative is used.  The length and cost of each instruction are
16981 also printed.
16983 @item -dP
16984 @opindex dP
16985 Dump the RTL in the assembler output as a comment before each instruction.
16986 Also turns on @option{-dp} annotation.
16988 @item -dx
16989 @opindex dx
16990 Just generate RTL for a function instead of compiling it.  Usually used
16991 with @option{-fdump-rtl-expand}.
16992 @end table
16994 @item -fdump-debug
16995 @opindex fdump-debug
16996 Dump debugging information generated during the debug
16997 generation phase.
16999 @item -fdump-earlydebug
17000 @opindex fdump-earlydebug
17001 Dump debugging information generated during the early debug
17002 generation phase.
17004 @item -fdump-noaddr
17005 @opindex fdump-noaddr
17006 When doing debugging dumps, suppress address output.  This makes it more
17007 feasible to use diff on debugging dumps for compiler invocations with
17008 different compiler binaries and/or different
17009 text / bss / data / heap / stack / dso start locations.
17011 @item -freport-bug
17012 @opindex freport-bug
17013 Collect and dump debug information into a temporary file if an
17014 internal compiler error (ICE) occurs.
17016 @item -fdump-unnumbered
17017 @opindex fdump-unnumbered
17018 When doing debugging dumps, suppress instruction numbers and address output.
17019 This makes it more feasible to use diff on debugging dumps for compiler
17020 invocations with different options, in particular with and without
17021 @option{-g}.
17023 @item -fdump-unnumbered-links
17024 @opindex fdump-unnumbered-links
17025 When doing debugging dumps (see @option{-d} option above), suppress
17026 instruction numbers for the links to the previous and next instructions
17027 in a sequence.
17029 @item -fdump-ipa-@var{switch}
17030 @itemx -fdump-ipa-@var{switch}-@var{options}
17031 @opindex fdump-ipa
17032 Control the dumping at various stages of inter-procedural analysis
17033 language tree to a file.  The file name is generated by appending a
17034 switch specific suffix to the source file name, and the file is created
17035 in the same directory as the output file.  The following dumps are
17036 possible:
17038 @table @samp
17039 @item all
17040 Enables all inter-procedural analysis dumps.
17042 @item cgraph
17043 Dumps information about call-graph optimization, unused function removal,
17044 and inlining decisions.
17046 @item inline
17047 Dump after function inlining.
17049 @end table
17051 Additionally, the options @option{-optimized}, @option{-missed},
17052 @option{-note}, and @option{-all} can be provided, with the same meaning
17053 as for @option{-fopt-info}, defaulting to @option{-optimized}.
17055 For example, @option{-fdump-ipa-inline-optimized-missed} will emit
17056 information on callsites that were inlined, along with callsites
17057 that were not inlined.
17059 By default, the dump will contain messages about successful
17060 optimizations (equivalent to @option{-optimized}) together with
17061 low-level details about the analysis.
17063 @item -fdump-lang
17064 @opindex fdump-lang
17065 Dump language-specific information.  The file name is made by appending
17066 @file{.lang} to the source file name.
17068 @item -fdump-lang-all
17069 @itemx -fdump-lang-@var{switch}
17070 @itemx -fdump-lang-@var{switch}-@var{options}
17071 @itemx -fdump-lang-@var{switch}-@var{options}=@var{filename}
17072 @opindex fdump-lang-all
17073 @opindex fdump-lang
17074 Control the dumping of language-specific information.  The @var{options}
17075 and @var{filename} portions behave as described in the
17076 @option{-fdump-tree} option.  The following @var{switch} values are
17077 accepted:
17079 @table @samp
17080 @item all
17082 Enable all language-specific dumps.
17084 @item class
17085 Dump class hierarchy information.  Virtual table information is emitted
17086 unless '@option{slim}' is specified.  This option is applicable to C++ only.
17088 @item module
17089 Dump module information.  Options @option{lineno} (locations),
17090 @option{graph} (reachability), @option{blocks} (clusters),
17091 @option{uid} (serialization), @option{alias} (mergeable),
17092 @option{asmname} (Elrond), @option{eh} (mapper) & @option{vops}
17093 (macros) may provide additional information.  This option is
17094 applicable to C++ only.
17096 @item raw
17097 Dump the raw internal tree data.  This option is applicable to C++ only.
17099 @end table
17101 @item -fdump-passes
17102 @opindex fdump-passes
17103 Print on @file{stderr} the list of optimization passes that are turned
17104 on and off by the current command-line options.
17106 @item -fdump-statistics-@var{option}
17107 @opindex fdump-statistics
17108 Enable and control dumping of pass statistics in a separate file.  The
17109 file name is generated by appending a suffix ending in
17110 @samp{.statistics} to the source file name, and the file is created in
17111 the same directory as the output file.  If the @samp{-@var{option}}
17112 form is used, @samp{-stats} causes counters to be summed over the
17113 whole compilation unit while @samp{-details} dumps every event as
17114 the passes generate them.  The default with no option is to sum
17115 counters for each function compiled.
17117 @item -fdump-tree-all
17118 @itemx -fdump-tree-@var{switch}
17119 @itemx -fdump-tree-@var{switch}-@var{options}
17120 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
17121 @opindex fdump-tree-all
17122 @opindex fdump-tree
17123 Control the dumping at various stages of processing the intermediate
17124 language tree to a file.  If the @samp{-@var{options}}
17125 form is used, @var{options} is a list of @samp{-} separated options
17126 which control the details of the dump.  Not all options are applicable
17127 to all dumps; those that are not meaningful are ignored.  The
17128 following options are available
17130 @table @samp
17131 @item address
17132 Print the address of each node.  Usually this is not meaningful as it
17133 changes according to the environment and source file.  Its primary use
17134 is for tying up a dump file with a debug environment.
17135 @item asmname
17136 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
17137 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
17138 use working backward from mangled names in the assembly file.
17139 @item slim
17140 When dumping front-end intermediate representations, inhibit dumping
17141 of members of a scope or body of a function merely because that scope
17142 has been reached.  Only dump such items when they are directly reachable
17143 by some other path.
17145 When dumping pretty-printed trees, this option inhibits dumping the
17146 bodies of control structures.
17148 When dumping RTL, print the RTL in slim (condensed) form instead of
17149 the default LISP-like representation.
17150 @item raw
17151 Print a raw representation of the tree.  By default, trees are
17152 pretty-printed into a C-like representation.
17153 @item details
17154 Enable more detailed dumps (not honored by every dump option). Also
17155 include information from the optimization passes.
17156 @item stats
17157 Enable dumping various statistics about the pass (not honored by every dump
17158 option).
17159 @item blocks
17160 Enable showing basic block boundaries (disabled in raw dumps).
17161 @item graph
17162 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
17163 dump a representation of the control flow graph suitable for viewing with
17164 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
17165 the file is pretty-printed as a subgraph, so that GraphViz can render them
17166 all in a single plot.
17168 This option currently only works for RTL dumps, and the RTL is always
17169 dumped in slim form.
17170 @item vops
17171 Enable showing virtual operands for every statement.
17172 @item lineno
17173 Enable showing line numbers for statements.
17174 @item uid
17175 Enable showing the unique ID (@code{DECL_UID}) for each variable.
17176 @item verbose
17177 Enable showing the tree dump for each statement.
17178 @item eh
17179 Enable showing the EH region number holding each statement.
17180 @item scev
17181 Enable showing scalar evolution analysis details.
17182 @item optimized
17183 Enable showing optimization information (only available in certain
17184 passes).
17185 @item missed
17186 Enable showing missed optimization information (only available in certain
17187 passes).
17188 @item note
17189 Enable other detailed optimization information (only available in
17190 certain passes).
17191 @item all
17192 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
17193 and @option{lineno}.
17194 @item optall
17195 Turn on all optimization options, i.e., @option{optimized},
17196 @option{missed}, and @option{note}.
17197 @end table
17199 To determine what tree dumps are available or find the dump for a pass
17200 of interest follow the steps below.
17202 @enumerate
17203 @item
17204 Invoke GCC with @option{-fdump-passes} and in the @file{stderr} output
17205 look for a code that corresponds to the pass you are interested in.
17206 For example, the codes @code{tree-evrp}, @code{tree-vrp1}, and
17207 @code{tree-vrp2} correspond to the three Value Range Propagation passes.
17208 The number at the end distinguishes distinct invocations of the same pass.
17209 @item
17210 To enable the creation of the dump file, append the pass code to
17211 the @option{-fdump-} option prefix and invoke GCC with it.  For example,
17212 to enable the dump from the Early Value Range Propagation pass, invoke
17213 GCC with the @option{-fdump-tree-evrp} option.  Optionally, you may
17214 specify the name of the dump file.  If you don't specify one, GCC
17215 creates as described below.
17216 @item
17217 Find the pass dump in a file whose name is composed of three components
17218 separated by a period: the name of the source file GCC was invoked to
17219 compile, a numeric suffix indicating the pass number followed by the
17220 letter @samp{t} for tree passes (and the letter @samp{r} for RTL passes),
17221 and finally the pass code.  For example, the Early VRP pass dump might
17222 be in a file named @file{myfile.c.038t.evrp} in the current working
17223 directory.  Note that the numeric codes are not stable and may change
17224 from one version of GCC to another.
17225 @end enumerate
17227 @item -fopt-info
17228 @itemx -fopt-info-@var{options}
17229 @itemx -fopt-info-@var{options}=@var{filename}
17230 @opindex fopt-info
17231 Controls optimization dumps from various optimization passes. If the
17232 @samp{-@var{options}} form is used, @var{options} is a list of
17233 @samp{-} separated option keywords to select the dump details and
17234 optimizations.  
17236 The @var{options} can be divided into three groups:
17237 @enumerate
17238 @item
17239 options describing what kinds of messages should be emitted,
17240 @item
17241 options describing the verbosity of the dump, and
17242 @item
17243 options describing which optimizations should be included.
17244 @end enumerate
17245 The options from each group can be freely mixed as they are
17246 non-overlapping. However, in case of any conflicts,
17247 the later options override the earlier options on the command
17248 line. 
17250 The following options control which kinds of messages should be emitted:
17252 @table @samp
17253 @item optimized
17254 Print information when an optimization is successfully applied. It is
17255 up to a pass to decide which information is relevant. For example, the
17256 vectorizer passes print the source location of loops which are
17257 successfully vectorized.
17258 @item missed
17259 Print information about missed optimizations. Individual passes
17260 control which information to include in the output. 
17261 @item note
17262 Print verbose information about optimizations, such as certain
17263 transformations, more detailed messages about decisions etc.
17264 @item all
17265 Print detailed optimization information. This includes
17266 @samp{optimized}, @samp{missed}, and @samp{note}.
17267 @end table
17269 The following option controls the dump verbosity:
17271 @table @samp
17272 @item internals
17273 By default, only ``high-level'' messages are emitted. This option enables
17274 additional, more detailed, messages, which are likely to only be of interest
17275 to GCC developers.
17276 @end table
17278 One or more of the following option keywords can be used to describe a
17279 group of optimizations:
17281 @table @samp
17282 @item ipa
17283 Enable dumps from all interprocedural optimizations.
17284 @item loop
17285 Enable dumps from all loop optimizations.
17286 @item inline
17287 Enable dumps from all inlining optimizations.
17288 @item omp
17289 Enable dumps from all OMP (Offloading and Multi Processing) optimizations.
17290 @item vec
17291 Enable dumps from all vectorization optimizations.
17292 @item optall
17293 Enable dumps from all optimizations. This is a superset of
17294 the optimization groups listed above.
17295 @end table
17297 If @var{options} is
17298 omitted, it defaults to @samp{optimized-optall}, which means to dump messages
17299 about successful optimizations from all the passes, omitting messages
17300 that are treated as ``internals''.
17302 If the @var{filename} is provided, then the dumps from all the
17303 applicable optimizations are concatenated into the @var{filename}.
17304 Otherwise the dump is output onto @file{stderr}. Though multiple
17305 @option{-fopt-info} options are accepted, only one of them can include
17306 a @var{filename}. If other filenames are provided then all but the
17307 first such option are ignored.
17309 Note that the output @var{filename} is overwritten
17310 in case of multiple translation units. If a combined output from
17311 multiple translation units is desired, @file{stderr} should be used
17312 instead.
17314 In the following example, the optimization info is output to
17315 @file{stderr}:
17317 @smallexample
17318 gcc -O3 -fopt-info
17319 @end smallexample
17321 This example:
17322 @smallexample
17323 gcc -O3 -fopt-info-missed=missed.all
17324 @end smallexample
17326 @noindent
17327 outputs missed optimization report from all the passes into
17328 @file{missed.all}, and this one:
17330 @smallexample
17331 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
17332 @end smallexample
17334 @noindent
17335 prints information about missed optimization opportunities from
17336 vectorization passes on @file{stderr}.  
17337 Note that @option{-fopt-info-vec-missed} is equivalent to 
17338 @option{-fopt-info-missed-vec}.  The order of the optimization group
17339 names and message types listed after @option{-fopt-info} does not matter.
17341 As another example,
17342 @smallexample
17343 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
17344 @end smallexample
17346 @noindent
17347 outputs information about missed optimizations as well as
17348 optimized locations from all the inlining passes into
17349 @file{inline.txt}.
17351 Finally, consider:
17353 @smallexample
17354 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
17355 @end smallexample
17357 @noindent
17358 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
17359 in conflict since only one output file is allowed. In this case, only
17360 the first option takes effect and the subsequent options are
17361 ignored. Thus only @file{vec.miss} is produced which contains
17362 dumps from the vectorizer about missed opportunities.
17364 @item -fsave-optimization-record
17365 @opindex fsave-optimization-record
17366 Write a SRCFILE.opt-record.json.gz file detailing what optimizations
17367 were performed, for those optimizations that support @option{-fopt-info}.
17369 This option is experimental and the format of the data within the
17370 compressed JSON file is subject to change.
17372 It is roughly equivalent to a machine-readable version of
17373 @option{-fopt-info-all}, as a collection of messages with source file,
17374 line number and column number, with the following additional data for
17375 each message:
17377 @itemize @bullet
17379 @item
17380 the execution count of the code being optimized, along with metadata about
17381 whether this was from actual profile data, or just an estimate, allowing
17382 consumers to prioritize messages by code hotness,
17384 @item
17385 the function name of the code being optimized, where applicable,
17387 @item
17388 the ``inlining chain'' for the code being optimized, so that when
17389 a function is inlined into several different places (which might
17390 themselves be inlined), the reader can distinguish between the copies,
17392 @item
17393 objects identifying those parts of the message that refer to expressions,
17394 statements or symbol-table nodes, which of these categories they are, and,
17395 when available, their source code location,
17397 @item
17398 the GCC pass that emitted the message, and
17400 @item
17401 the location in GCC's own code from which the message was emitted
17403 @end itemize
17405 Additionally, some messages are logically nested within other
17406 messages, reflecting implementation details of the optimization
17407 passes.
17409 @item -fsched-verbose=@var{n}
17410 @opindex fsched-verbose
17411 On targets that use instruction scheduling, this option controls the
17412 amount of debugging output the scheduler prints to the dump files.
17414 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
17415 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
17416 For @var{n} greater than one, it also output basic block probabilities,
17417 detailed ready list information and unit/insn info.  For @var{n} greater
17418 than two, it includes RTL at abort point, control-flow and regions info.
17419 And for @var{n} over four, @option{-fsched-verbose} also includes
17420 dependence info.
17424 @item -fenable-@var{kind}-@var{pass}
17425 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
17426 @opindex fdisable-
17427 @opindex fenable-
17429 This is a set of options that are used to explicitly disable/enable
17430 optimization passes.  These options are intended for use for debugging GCC.
17431 Compiler users should use regular options for enabling/disabling
17432 passes instead.
17434 @table @gcctabopt
17436 @item -fdisable-ipa-@var{pass}
17437 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
17438 statically invoked in the compiler multiple times, the pass name should be
17439 appended with a sequential number starting from 1.
17441 @item -fdisable-rtl-@var{pass}
17442 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
17443 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
17444 statically invoked in the compiler multiple times, the pass name should be
17445 appended with a sequential number starting from 1.  @var{range-list} is a 
17446 comma-separated list of function ranges or assembler names.  Each range is a number
17447 pair separated by a colon.  The range is inclusive in both ends.  If the range
17448 is trivial, the number pair can be simplified as a single number.  If the
17449 function's call graph node's @var{uid} falls within one of the specified ranges,
17450 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
17451 function header of a dump file, and the pass names can be dumped by using
17452 option @option{-fdump-passes}.
17454 @item -fdisable-tree-@var{pass}
17455 @itemx -fdisable-tree-@var{pass}=@var{range-list}
17456 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
17457 option arguments.
17459 @item -fenable-ipa-@var{pass}
17460 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
17461 statically invoked in the compiler multiple times, the pass name should be
17462 appended with a sequential number starting from 1.
17464 @item -fenable-rtl-@var{pass}
17465 @itemx -fenable-rtl-@var{pass}=@var{range-list}
17466 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
17467 description and examples.
17469 @item -fenable-tree-@var{pass}
17470 @itemx -fenable-tree-@var{pass}=@var{range-list}
17471 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
17472 of option arguments.
17474 @end table
17476 Here are some examples showing uses of these options.
17478 @smallexample
17480 # disable ccp1 for all functions
17481    -fdisable-tree-ccp1
17482 # disable complete unroll for function whose cgraph node uid is 1
17483    -fenable-tree-cunroll=1
17484 # disable gcse2 for functions at the following ranges [1,1],
17485 # [300,400], and [400,1000]
17486 # disable gcse2 for functions foo and foo2
17487    -fdisable-rtl-gcse2=foo,foo2
17488 # disable early inlining
17489    -fdisable-tree-einline
17490 # disable ipa inlining
17491    -fdisable-ipa-inline
17492 # enable tree full unroll
17493    -fenable-tree-unroll
17495 @end smallexample
17497 @item -fchecking
17498 @itemx -fchecking=@var{n}
17499 @opindex fchecking
17500 @opindex fno-checking
17501 Enable internal consistency checking.  The default depends on
17502 the compiler configuration.  @option{-fchecking=2} enables further
17503 internal consistency checking that might affect code generation.
17505 @item -frandom-seed=@var{string}
17506 @opindex frandom-seed
17507 This option provides a seed that GCC uses in place of
17508 random numbers in generating certain symbol names
17509 that have to be different in every compiled file.  It is also used to
17510 place unique stamps in coverage data files and the object files that
17511 produce them.  You can use the @option{-frandom-seed} option to produce
17512 reproducibly identical object files.
17514 The @var{string} can either be a number (decimal, octal or hex) or an
17515 arbitrary string (in which case it's converted to a number by
17516 computing CRC32).
17518 The @var{string} should be different for every file you compile.
17520 @item -save-temps
17521 @opindex save-temps
17522 Store the usual ``temporary'' intermediate files permanently; name them
17523 as auxiliary output files, as specified described under
17524 @option{-dumpbase} and @option{-dumpdir}.
17526 When used in combination with the @option{-x} command-line option,
17527 @option{-save-temps} is sensible enough to avoid overwriting an
17528 input source file with the same extension as an intermediate file.
17529 The corresponding intermediate file may be obtained by renaming the
17530 source file before using @option{-save-temps}.
17532 @item -save-temps=cwd
17533 @opindex save-temps=cwd
17534 Equivalent to @option{-save-temps -dumpdir ./}.
17536 @item -save-temps=obj
17537 @opindex save-temps=obj
17538 Equivalent to @option{-save-temps -dumpdir @file{outdir/}}, where
17539 @file{outdir/} is the directory of the output file specified after the
17540 @option{-o} option, including any directory separators.  If the
17541 @option{-o} option is not used, the @option{-save-temps=obj} switch
17542 behaves like @option{-save-temps=cwd}.
17544 @item -time@r{[}=@var{file}@r{]}
17545 @opindex time
17546 Report the CPU time taken by each subprocess in the compilation
17547 sequence.  For C source files, this is the compiler proper and assembler
17548 (plus the linker if linking is done).
17550 Without the specification of an output file, the output looks like this:
17552 @smallexample
17553 # cc1 0.12 0.01
17554 # as 0.00 0.01
17555 @end smallexample
17557 The first number on each line is the ``user time'', that is time spent
17558 executing the program itself.  The second number is ``system time'',
17559 time spent executing operating system routines on behalf of the program.
17560 Both numbers are in seconds.
17562 With the specification of an output file, the output is appended to the
17563 named file, and it looks like this:
17565 @smallexample
17566 0.12 0.01 cc1 @var{options}
17567 0.00 0.01 as @var{options}
17568 @end smallexample
17570 The ``user time'' and the ``system time'' are moved before the program
17571 name, and the options passed to the program are displayed, so that one
17572 can later tell what file was being compiled, and with which options.
17574 @item -fdump-final-insns@r{[}=@var{file}@r{]}
17575 @opindex fdump-final-insns
17576 Dump the final internal representation (RTL) to @var{file}.  If the
17577 optional argument is omitted (or if @var{file} is @code{.}), the name
17578 of the dump file is determined by appending @code{.gkd} to the
17579 dump base name, see @option{-dumpbase}.
17581 @item -fcompare-debug@r{[}=@var{opts}@r{]}
17582 @opindex fcompare-debug
17583 @opindex fno-compare-debug
17584 If no error occurs during compilation, run the compiler a second time,
17585 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
17586 passed to the second compilation.  Dump the final internal
17587 representation in both compilations, and print an error if they differ.
17589 If the equal sign is omitted, the default @option{-gtoggle} is used.
17591 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
17592 and nonzero, implicitly enables @option{-fcompare-debug}.  If
17593 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
17594 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
17595 is used.
17597 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
17598 is equivalent to @option{-fno-compare-debug}, which disables the dumping
17599 of the final representation and the second compilation, preventing even
17600 @env{GCC_COMPARE_DEBUG} from taking effect.
17602 To verify full coverage during @option{-fcompare-debug} testing, set
17603 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
17604 which GCC rejects as an invalid option in any actual compilation
17605 (rather than preprocessing, assembly or linking).  To get just a
17606 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
17607 not overridden} will do.
17609 @item -fcompare-debug-second
17610 @opindex fcompare-debug-second
17611 This option is implicitly passed to the compiler for the second
17612 compilation requested by @option{-fcompare-debug}, along with options to
17613 silence warnings, and omitting other options that would cause the compiler
17614 to produce output to files or to standard output as a side effect.  Dump
17615 files and preserved temporary files are renamed so as to contain the
17616 @code{.gk} additional extension during the second compilation, to avoid
17617 overwriting those generated by the first.
17619 When this option is passed to the compiler driver, it causes the
17620 @emph{first} compilation to be skipped, which makes it useful for little
17621 other than debugging the compiler proper.
17623 @item -gtoggle
17624 @opindex gtoggle
17625 Turn off generation of debug info, if leaving out this option
17626 generates it, or turn it on at level 2 otherwise.  The position of this
17627 argument in the command line does not matter; it takes effect after all
17628 other options are processed, and it does so only once, no matter how
17629 many times it is given.  This is mainly intended to be used with
17630 @option{-fcompare-debug}.
17632 @item -fvar-tracking-assignments-toggle
17633 @opindex fvar-tracking-assignments-toggle
17634 @opindex fno-var-tracking-assignments-toggle
17635 Toggle @option{-fvar-tracking-assignments}, in the same way that
17636 @option{-gtoggle} toggles @option{-g}.
17638 @item -Q
17639 @opindex Q
17640 Makes the compiler print out each function name as it is compiled, and
17641 print some statistics about each pass when it finishes.
17643 @item -ftime-report
17644 @opindex ftime-report
17645 Makes the compiler print some statistics about the time consumed by each
17646 pass when it finishes.
17648 @item -ftime-report-details
17649 @opindex ftime-report-details
17650 Record the time consumed by infrastructure parts separately for each pass.
17652 @item -fira-verbose=@var{n}
17653 @opindex fira-verbose
17654 Control the verbosity of the dump file for the integrated register allocator.
17655 The default value is 5.  If the value @var{n} is greater or equal to 10,
17656 the dump output is sent to stderr using the same format as @var{n} minus 10.
17658 @item -flto-report
17659 @opindex flto-report
17660 Prints a report with internal details on the workings of the link-time
17661 optimizer.  The contents of this report vary from version to version.
17662 It is meant to be useful to GCC developers when processing object
17663 files in LTO mode (via @option{-flto}).
17665 Disabled by default.
17667 @item -flto-report-wpa
17668 @opindex flto-report-wpa
17669 Like @option{-flto-report}, but only print for the WPA phase of link-time
17670 optimization.
17672 @item -fmem-report
17673 @opindex fmem-report
17674 Makes the compiler print some statistics about permanent memory
17675 allocation when it finishes.
17677 @item -fmem-report-wpa
17678 @opindex fmem-report-wpa
17679 Makes the compiler print some statistics about permanent memory
17680 allocation for the WPA phase only.
17682 @item -fpre-ipa-mem-report
17683 @opindex fpre-ipa-mem-report
17684 @item -fpost-ipa-mem-report
17685 @opindex fpost-ipa-mem-report
17686 Makes the compiler print some statistics about permanent memory
17687 allocation before or after interprocedural optimization.
17689 @item -fprofile-report
17690 @opindex fprofile-report
17691 Makes the compiler print some statistics about consistency of the
17692 (estimated) profile and effect of individual passes.
17694 @item -fstack-usage
17695 @opindex fstack-usage
17696 Makes the compiler output stack usage information for the program, on a
17697 per-function basis.  The filename for the dump is made by appending
17698 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
17699 the output file, if explicitly specified and it is not an executable,
17700 otherwise it is the basename of the source file.  An entry is made up
17701 of three fields:
17703 @itemize
17704 @item
17705 The name of the function.
17706 @item
17707 A number of bytes.
17708 @item
17709 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
17710 @end itemize
17712 The qualifier @code{static} means that the function manipulates the stack
17713 statically: a fixed number of bytes are allocated for the frame on function
17714 entry and released on function exit; no stack adjustments are otherwise made
17715 in the function.  The second field is this fixed number of bytes.
17717 The qualifier @code{dynamic} means that the function manipulates the stack
17718 dynamically: in addition to the static allocation described above, stack
17719 adjustments are made in the body of the function, for example to push/pop
17720 arguments around function calls.  If the qualifier @code{bounded} is also
17721 present, the amount of these adjustments is bounded at compile time and
17722 the second field is an upper bound of the total amount of stack used by
17723 the function.  If it is not present, the amount of these adjustments is
17724 not bounded at compile time and the second field only represents the
17725 bounded part.
17727 @item -fstats
17728 @opindex fstats
17729 Emit statistics about front-end processing at the end of the compilation.
17730 This option is supported only by the C++ front end, and
17731 the information is generally only useful to the G++ development team.
17733 @item -fdbg-cnt-list
17734 @opindex fdbg-cnt-list
17735 Print the name and the counter upper bound for all debug counters.
17738 @item -fdbg-cnt=@var{counter-value-list}
17739 @opindex fdbg-cnt
17740 Set the internal debug counter lower and upper bound.  @var{counter-value-list}
17741 is a comma-separated list of @var{name}:@var{lower_bound1}-@var{upper_bound1}
17742 [:@var{lower_bound2}-@var{upper_bound2}...] tuples which sets
17743 the name of the counter and list of closed intervals.
17744 The @var{lower_bound} is optional and is zero
17745 initialized if not set.
17746 For example, with @option{-fdbg-cnt=dce:2-4:10-11,tail_call:10},
17747 @code{dbg_cnt(dce)} returns true only for second, third, fourth, tenth and
17748 eleventh invocation.
17749 For @code{dbg_cnt(tail_call)} true is returned for first 10 invocations.
17751 @item -print-file-name=@var{library}
17752 @opindex print-file-name
17753 Print the full absolute name of the library file @var{library} that
17754 would be used when linking---and don't do anything else.  With this
17755 option, GCC does not compile or link anything; it just prints the
17756 file name.
17758 @item -print-multi-directory
17759 @opindex print-multi-directory
17760 Print the directory name corresponding to the multilib selected by any
17761 other switches present in the command line.  This directory is supposed
17762 to exist in @env{GCC_EXEC_PREFIX}.
17764 @item -print-multi-lib
17765 @opindex print-multi-lib
17766 Print the mapping from multilib directory names to compiler switches
17767 that enable them.  The directory name is separated from the switches by
17768 @samp{;}, and each switch starts with an @samp{@@} instead of the
17769 @samp{-}, without spaces between multiple switches.  This is supposed to
17770 ease shell processing.
17772 @item -print-multi-os-directory
17773 @opindex print-multi-os-directory
17774 Print the path to OS libraries for the selected
17775 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
17776 present in the @file{lib} subdirectory and no multilibs are used, this is
17777 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
17778 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
17779 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
17780 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
17782 @item -print-multiarch
17783 @opindex print-multiarch
17784 Print the path to OS libraries for the selected multiarch,
17785 relative to some @file{lib} subdirectory.
17787 @item -print-prog-name=@var{program}
17788 @opindex print-prog-name
17789 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
17791 @item -print-libgcc-file-name
17792 @opindex print-libgcc-file-name
17793 Same as @option{-print-file-name=libgcc.a}.
17795 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
17796 but you do want to link with @file{libgcc.a}.  You can do:
17798 @smallexample
17799 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
17800 @end smallexample
17802 @item -print-search-dirs
17803 @opindex print-search-dirs
17804 Print the name of the configured installation directory and a list of
17805 program and library directories @command{gcc} searches---and don't do anything else.
17807 This is useful when @command{gcc} prints the error message
17808 @samp{installation problem, cannot exec cpp0: No such file or directory}.
17809 To resolve this you either need to put @file{cpp0} and the other compiler
17810 components where @command{gcc} expects to find them, or you can set the environment
17811 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
17812 Don't forget the trailing @samp{/}.
17813 @xref{Environment Variables}.
17815 @item -print-sysroot
17816 @opindex print-sysroot
17817 Print the target sysroot directory that is used during
17818 compilation.  This is the target sysroot specified either at configure
17819 time or using the @option{--sysroot} option, possibly with an extra
17820 suffix that depends on compilation options.  If no target sysroot is
17821 specified, the option prints nothing.
17823 @item -print-sysroot-headers-suffix
17824 @opindex print-sysroot-headers-suffix
17825 Print the suffix added to the target sysroot when searching for
17826 headers, or give an error if the compiler is not configured with such
17827 a suffix---and don't do anything else.
17829 @item -dumpmachine
17830 @opindex dumpmachine
17831 Print the compiler's target machine (for example,
17832 @samp{i686-pc-linux-gnu})---and don't do anything else.
17834 @item -dumpversion
17835 @opindex dumpversion
17836 Print the compiler version (for example, @code{3.0}, @code{6.3.0} or @code{7})---and don't do
17837 anything else.  This is the compiler version used in filesystem paths and
17838 specs. Depending on how the compiler has been configured it can be just
17839 a single number (major version), two numbers separated by a dot (major and
17840 minor version) or three numbers separated by dots (major, minor and patchlevel
17841 version).
17843 @item -dumpfullversion
17844 @opindex dumpfullversion
17845 Print the full compiler version---and don't do anything else. The output is
17846 always three numbers separated by dots, major, minor and patchlevel version.
17848 @item -dumpspecs
17849 @opindex dumpspecs
17850 Print the compiler's built-in specs---and don't do anything else.  (This
17851 is used when GCC itself is being built.)  @xref{Spec Files}.
17852 @end table
17854 @node Submodel Options
17855 @section Machine-Dependent Options
17856 @cindex submodel options
17857 @cindex specifying hardware config
17858 @cindex hardware models and configurations, specifying
17859 @cindex target-dependent options
17860 @cindex machine-dependent options
17862 Each target machine supported by GCC can have its own options---for
17863 example, to allow you to compile for a particular processor variant or
17864 ABI, or to control optimizations specific to that machine.  By
17865 convention, the names of machine-specific options start with
17866 @samp{-m}.
17868 Some configurations of the compiler also support additional target-specific
17869 options, usually for compatibility with other compilers on the same
17870 platform.
17872 @c This list is ordered alphanumerically by subsection name.
17873 @c It should be the same order and spelling as these options are listed
17874 @c in Machine Dependent Options
17876 @menu
17877 * AArch64 Options::
17878 * Adapteva Epiphany Options::
17879 * AMD GCN Options::
17880 * ARC Options::
17881 * ARM Options::
17882 * AVR Options::
17883 * Blackfin Options::
17884 * C6X Options::
17885 * CRIS Options::
17886 * CR16 Options::
17887 * C-SKY Options::
17888 * Darwin Options::
17889 * DEC Alpha Options::
17890 * eBPF Options::
17891 * FR30 Options::
17892 * FT32 Options::
17893 * FRV Options::
17894 * GNU/Linux Options::
17895 * H8/300 Options::
17896 * HPPA Options::
17897 * IA-64 Options::
17898 * LM32 Options::
17899 * M32C Options::
17900 * M32R/D Options::
17901 * M680x0 Options::
17902 * MCore Options::
17903 * MeP Options::
17904 * MicroBlaze Options::
17905 * MIPS Options::
17906 * MMIX Options::
17907 * MN10300 Options::
17908 * Moxie Options::
17909 * MSP430 Options::
17910 * NDS32 Options::
17911 * Nios II Options::
17912 * Nvidia PTX Options::
17913 * OpenRISC Options::
17914 * PDP-11 Options::
17915 * picoChip Options::
17916 * PowerPC Options::
17917 * PRU Options::
17918 * RISC-V Options::
17919 * RL78 Options::
17920 * RS/6000 and PowerPC Options::
17921 * RX Options::
17922 * S/390 and zSeries Options::
17923 * Score Options::
17924 * SH Options::
17925 * Solaris 2 Options::
17926 * SPARC Options::
17927 * System V Options::
17928 * TILE-Gx Options::
17929 * TILEPro Options::
17930 * V850 Options::
17931 * VAX Options::
17932 * Visium Options::
17933 * VMS Options::
17934 * VxWorks Options::
17935 * x86 Options::
17936 * x86 Windows Options::
17937 * Xstormy16 Options::
17938 * Xtensa Options::
17939 * zSeries Options::
17940 @end menu
17942 @node AArch64 Options
17943 @subsection AArch64 Options
17944 @cindex AArch64 Options
17946 These options are defined for AArch64 implementations:
17948 @table @gcctabopt
17950 @item -mabi=@var{name}
17951 @opindex mabi
17952 Generate code for the specified data model.  Permissible values
17953 are @samp{ilp32} for SysV-like data model where int, long int and pointers
17954 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
17955 but long int and pointers are 64 bits.
17957 The default depends on the specific target configuration.  Note that
17958 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
17959 entire program with the same ABI, and link with a compatible set of libraries.
17961 @item -mbig-endian
17962 @opindex mbig-endian
17963 Generate big-endian code.  This is the default when GCC is configured for an
17964 @samp{aarch64_be-*-*} target.
17966 @item -mgeneral-regs-only
17967 @opindex mgeneral-regs-only
17968 Generate code which uses only the general-purpose registers.  This will prevent
17969 the compiler from using floating-point and Advanced SIMD registers but will not
17970 impose any restrictions on the assembler.
17972 @item -mlittle-endian
17973 @opindex mlittle-endian
17974 Generate little-endian code.  This is the default when GCC is configured for an
17975 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
17977 @item -mcmodel=tiny
17978 @opindex mcmodel=tiny
17979 Generate code for the tiny code model.  The program and its statically defined
17980 symbols must be within 1MB of each other.  Programs can be statically or
17981 dynamically linked.
17983 @item -mcmodel=small
17984 @opindex mcmodel=small
17985 Generate code for the small code model.  The program and its statically defined
17986 symbols must be within 4GB of each other.  Programs can be statically or
17987 dynamically linked.  This is the default code model.
17989 @item -mcmodel=large
17990 @opindex mcmodel=large
17991 Generate code for the large code model.  This makes no assumptions about
17992 addresses and sizes of sections.  Programs can be statically linked only.  The
17993 @option{-mcmodel=large} option is incompatible with @option{-mabi=ilp32},
17994 @option{-fpic} and @option{-fPIC}.
17996 @item -mstrict-align
17997 @itemx -mno-strict-align
17998 @opindex mstrict-align
17999 @opindex mno-strict-align
18000 Avoid or allow generating memory accesses that may not be aligned on a natural
18001 object boundary as described in the architecture specification.
18003 @item -momit-leaf-frame-pointer
18004 @itemx -mno-omit-leaf-frame-pointer
18005 @opindex momit-leaf-frame-pointer
18006 @opindex mno-omit-leaf-frame-pointer
18007 Omit or keep the frame pointer in leaf functions.  The former behavior is the
18008 default.
18010 @item -mstack-protector-guard=@var{guard}
18011 @itemx -mstack-protector-guard-reg=@var{reg}
18012 @itemx -mstack-protector-guard-offset=@var{offset}
18013 @opindex mstack-protector-guard
18014 @opindex mstack-protector-guard-reg
18015 @opindex mstack-protector-guard-offset
18016 Generate stack protection code using canary at @var{guard}.  Supported
18017 locations are @samp{global} for a global canary or @samp{sysreg} for a
18018 canary in an appropriate system register.
18020 With the latter choice the options
18021 @option{-mstack-protector-guard-reg=@var{reg}} and
18022 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
18023 which system register to use as base register for reading the canary,
18024 and from what offset from that base register. There is no default
18025 register or offset as this is entirely for use within the Linux
18026 kernel.
18028 @item -mtls-dialect=desc
18029 @opindex mtls-dialect=desc
18030 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
18031 of TLS variables.  This is the default.
18033 @item -mtls-dialect=traditional
18034 @opindex mtls-dialect=traditional
18035 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
18036 of TLS variables.
18038 @item -mtls-size=@var{size}
18039 @opindex mtls-size
18040 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
18041 This option requires binutils 2.26 or newer.
18043 @item -mfix-cortex-a53-835769
18044 @itemx -mno-fix-cortex-a53-835769
18045 @opindex mfix-cortex-a53-835769
18046 @opindex mno-fix-cortex-a53-835769
18047 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
18048 This involves inserting a NOP instruction between memory instructions and
18049 64-bit integer multiply-accumulate instructions.
18051 @item -mfix-cortex-a53-843419
18052 @itemx -mno-fix-cortex-a53-843419
18053 @opindex mfix-cortex-a53-843419
18054 @opindex mno-fix-cortex-a53-843419
18055 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
18056 This erratum workaround is made at link time and this will only pass the
18057 corresponding flag to the linker.
18059 @item -mlow-precision-recip-sqrt
18060 @itemx -mno-low-precision-recip-sqrt
18061 @opindex mlow-precision-recip-sqrt
18062 @opindex mno-low-precision-recip-sqrt
18063 Enable or disable the reciprocal square root approximation.
18064 This option only has an effect if @option{-ffast-math} or
18065 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
18066 precision of reciprocal square root results to about 16 bits for
18067 single precision and to 32 bits for double precision.
18069 @item -mlow-precision-sqrt
18070 @itemx -mno-low-precision-sqrt
18071 @opindex mlow-precision-sqrt
18072 @opindex mno-low-precision-sqrt
18073 Enable or disable the square root approximation.
18074 This option only has an effect if @option{-ffast-math} or
18075 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
18076 precision of square root results to about 16 bits for
18077 single precision and to 32 bits for double precision.
18078 If enabled, it implies @option{-mlow-precision-recip-sqrt}.
18080 @item -mlow-precision-div
18081 @itemx -mno-low-precision-div
18082 @opindex mlow-precision-div
18083 @opindex mno-low-precision-div
18084 Enable or disable the division approximation.
18085 This option only has an effect if @option{-ffast-math} or
18086 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
18087 precision of division results to about 16 bits for
18088 single precision and to 32 bits for double precision.
18090 @item -mtrack-speculation
18091 @itemx -mno-track-speculation
18092 Enable or disable generation of additional code to track speculative
18093 execution through conditional branches.  The tracking state can then
18094 be used by the compiler when expanding calls to
18095 @code{__builtin_speculation_safe_copy} to permit a more efficient code
18096 sequence to be generated.
18098 @item -moutline-atomics
18099 @itemx -mno-outline-atomics
18100 Enable or disable calls to out-of-line helpers to implement atomic operations.
18101 These helpers will, at runtime, determine if the LSE instructions from
18102 ARMv8.1-A can be used; if not, they will use the load/store-exclusive
18103 instructions that are present in the base ARMv8.0 ISA.
18105 This option is only applicable when compiling for the base ARMv8.0
18106 instruction set.  If using a later revision, e.g. @option{-march=armv8.1-a}
18107 or @option{-march=armv8-a+lse}, the ARMv8.1-Atomics instructions will be
18108 used directly.  The same applies when using @option{-mcpu=} when the
18109 selected cpu supports the @samp{lse} feature.
18110 This option is on by default.
18112 @item -march=@var{name}
18113 @opindex march
18114 Specify the name of the target architecture and, optionally, one or
18115 more feature modifiers.  This option has the form
18116 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
18118 The table below summarizes the permissible values for @var{arch}
18119 and the features that they enable by default:
18121 @multitable @columnfractions 0.20 0.20 0.60
18122 @headitem @var{arch} value @tab Architecture @tab Includes by default
18123 @item @samp{armv8-a} @tab Armv8-A @tab @samp{+fp}, @samp{+simd}
18124 @item @samp{armv8.1-a} @tab Armv8.1-A @tab @samp{armv8-a}, @samp{+crc}, @samp{+lse}, @samp{+rdma}
18125 @item @samp{armv8.2-a} @tab Armv8.2-A @tab @samp{armv8.1-a}
18126 @item @samp{armv8.3-a} @tab Armv8.3-A @tab @samp{armv8.2-a}, @samp{+pauth}
18127 @item @samp{armv8.4-a} @tab Armv8.4-A @tab @samp{armv8.3-a}, @samp{+flagm}, @samp{+fp16fml}, @samp{+dotprod}
18128 @item @samp{armv8.5-a} @tab Armv8.5-A @tab @samp{armv8.4-a}, @samp{+sb}, @samp{+ssbs}, @samp{+predres}
18129 @item @samp{armv8.6-a} @tab Armv8.6-A @tab @samp{armv8.5-a}, @samp{+bf16}, @samp{+i8mm}
18130 @item @samp{armv8-r} @tab Armv8-R @tab @samp{armv8-r}
18131 @end multitable
18133 The value @samp{native} is available on native AArch64 GNU/Linux and
18134 causes the compiler to pick the architecture of the host system.  This
18135 option has no effect if the compiler is unable to recognize the
18136 architecture of the host system,
18138 The permissible values for @var{feature} are listed in the sub-section
18139 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
18140 Feature Modifiers}.  Where conflicting feature modifiers are
18141 specified, the right-most feature is used.
18143 GCC uses @var{name} to determine what kind of instructions it can emit
18144 when generating assembly code.  If @option{-march} is specified
18145 without either of @option{-mtune} or @option{-mcpu} also being
18146 specified, the code is tuned to perform well across a range of target
18147 processors implementing the target architecture.
18149 @item -mtune=@var{name}
18150 @opindex mtune
18151 Specify the name of the target processor for which GCC should tune the
18152 performance of the code.  Permissible values for this option are:
18153 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
18154 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
18155 @samp{cortex-a76}, @samp{cortex-a76ae}, @samp{cortex-a77},
18156 @samp{cortex-a65}, @samp{cortex-a65ae}, @samp{cortex-a34},
18157 @samp{cortex-a78}, @samp{cortex-a78ae}, @samp{cortex-a78c},
18158 @samp{ares}, @samp{exynos-m1}, @samp{emag}, @samp{falkor},
18159 @samp{neoverse-e1}, @samp{neoverse-n1}, @samp{neoverse-n2},
18160 @samp{neoverse-v1}, @samp{qdf24xx}, @samp{saphira},
18161 @samp{phecda}, @samp{xgene1}, @samp{vulcan}, @samp{octeontx},
18162 @samp{octeontx81},  @samp{octeontx83},
18163 @samp{octeontx2}, @samp{octeontx2t98}, @samp{octeontx2t96}
18164 @samp{octeontx2t93}, @samp{octeontx2f95}, @samp{octeontx2f95n},
18165 @samp{octeontx2f95mm},
18166 @samp{a64fx},
18167 @samp{thunderx}, @samp{thunderxt88},
18168 @samp{thunderxt88p1}, @samp{thunderxt81}, @samp{tsv110},
18169 @samp{thunderxt83}, @samp{thunderx2t99}, @samp{thunderx3t110}, @samp{zeus},
18170 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
18171 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
18172 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55},
18173 @samp{cortex-r82}, @samp{cortex-x1}, @samp{native}.
18175 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
18176 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
18177 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55} specify that GCC
18178 should tune for a big.LITTLE system.
18180 Additionally on native AArch64 GNU/Linux systems the value
18181 @samp{native} tunes performance to the host system.  This option has no effect
18182 if the compiler is unable to recognize the processor of the host system.
18184 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
18185 are specified, the code is tuned to perform well across a range
18186 of target processors.
18188 This option cannot be suffixed by feature modifiers.
18190 @item -mcpu=@var{name}
18191 @opindex mcpu
18192 Specify the name of the target processor, optionally suffixed by one
18193 or more feature modifiers.  This option has the form
18194 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
18195 the permissible values for @var{cpu} are the same as those available
18196 for @option{-mtune}.  The permissible values for @var{feature} are
18197 documented in the sub-section on
18198 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
18199 Feature Modifiers}.  Where conflicting feature modifiers are
18200 specified, the right-most feature is used.
18202 GCC uses @var{name} to determine what kind of instructions it can emit when
18203 generating assembly code (as if by @option{-march}) and to determine
18204 the target processor for which to tune for performance (as if
18205 by @option{-mtune}).  Where this option is used in conjunction
18206 with @option{-march} or @option{-mtune}, those options take precedence
18207 over the appropriate part of this option.
18209 @item -moverride=@var{string}
18210 @opindex moverride
18211 Override tuning decisions made by the back-end in response to a
18212 @option{-mtune=} switch.  The syntax, semantics, and accepted values
18213 for @var{string} in this option are not guaranteed to be consistent
18214 across releases.
18216 This option is only intended to be useful when developing GCC.
18218 @item -mverbose-cost-dump
18219 @opindex mverbose-cost-dump
18220 Enable verbose cost model dumping in the debug dump files.  This option is
18221 provided for use in debugging the compiler.
18223 @item -mpc-relative-literal-loads
18224 @itemx -mno-pc-relative-literal-loads
18225 @opindex mpc-relative-literal-loads
18226 @opindex mno-pc-relative-literal-loads
18227 Enable or disable PC-relative literal loads.  With this option literal pools are
18228 accessed using a single instruction and emitted after each function.  This
18229 limits the maximum size of functions to 1MB.  This is enabled by default for
18230 @option{-mcmodel=tiny}.
18232 @item -msign-return-address=@var{scope}
18233 @opindex msign-return-address
18234 Select the function scope on which return address signing will be applied.
18235 Permissible values are @samp{none}, which disables return address signing,
18236 @samp{non-leaf}, which enables pointer signing for functions which are not leaf
18237 functions, and @samp{all}, which enables pointer signing for all functions.  The
18238 default value is @samp{none}. This option has been deprecated by
18239 -mbranch-protection.
18241 @item -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}+@var{b-key}]|@var{bti}
18242 @opindex mbranch-protection
18243 Select the branch protection features to use.
18244 @samp{none} is the default and turns off all types of branch protection.
18245 @samp{standard} turns on all types of branch protection features.  If a feature
18246 has additional tuning options, then @samp{standard} sets it to its standard
18247 level.
18248 @samp{pac-ret[+@var{leaf}]} turns on return address signing to its standard
18249 level: signing functions that save the return address to memory (non-leaf
18250 functions will practically always do this) using the a-key.  The optional
18251 argument @samp{leaf} can be used to extend the signing to include leaf
18252 functions.  The optional argument @samp{b-key} can be used to sign the functions
18253 with the B-key instead of the A-key.
18254 @samp{bti} turns on branch target identification mechanism.
18256 @item -mharden-sls=@var{opts}
18257 @opindex mharden-sls
18258 Enable compiler hardening against straight line speculation (SLS).
18259 @var{opts} is a comma-separated list of the following options:
18260 @table @samp
18261 @item retbr
18262 @item blr
18263 @end table
18264 In addition, @samp{-mharden-sls=all} enables all SLS hardening while
18265 @samp{-mharden-sls=none} disables all SLS hardening.
18267 @item -msve-vector-bits=@var{bits}
18268 @opindex msve-vector-bits
18269 Specify the number of bits in an SVE vector register.  This option only has
18270 an effect when SVE is enabled.
18272 GCC supports two forms of SVE code generation: ``vector-length
18273 agnostic'' output that works with any size of vector register and
18274 ``vector-length specific'' output that allows GCC to make assumptions
18275 about the vector length when it is useful for optimization reasons.
18276 The possible values of @samp{bits} are: @samp{scalable}, @samp{128},
18277 @samp{256}, @samp{512}, @samp{1024} and @samp{2048}.
18278 Specifying @samp{scalable} selects vector-length agnostic
18279 output.  At present @samp{-msve-vector-bits=128} also generates vector-length
18280 agnostic output for big-endian targets.  All other values generate
18281 vector-length specific code.  The behavior of these values may change
18282 in future releases and no value except @samp{scalable} should be
18283 relied on for producing code that is portable across different
18284 hardware SVE vector lengths.
18286 The default is @samp{-msve-vector-bits=scalable}, which produces
18287 vector-length agnostic code.
18288 @end table
18290 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
18291 @anchor{aarch64-feature-modifiers}
18292 @cindex @option{-march} feature modifiers
18293 @cindex @option{-mcpu} feature modifiers
18294 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
18295 the following and their inverses @option{no@var{feature}}:
18297 @table @samp
18298 @item crc
18299 Enable CRC extension.  This is on by default for
18300 @option{-march=armv8.1-a}.
18301 @item crypto
18302 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
18303 instructions.
18304 @item fp
18305 Enable floating-point instructions.  This is on by default for all possible
18306 values for options @option{-march} and @option{-mcpu}.
18307 @item simd
18308 Enable Advanced SIMD instructions.  This also enables floating-point
18309 instructions.  This is on by default for all possible values for options
18310 @option{-march} and @option{-mcpu}.
18311 @item sve
18312 Enable Scalable Vector Extension instructions.  This also enables Advanced
18313 SIMD and floating-point instructions.
18314 @item lse
18315 Enable Large System Extension instructions.  This is on by default for
18316 @option{-march=armv8.1-a}.
18317 @item rdma
18318 Enable Round Double Multiply Accumulate instructions.  This is on by default
18319 for @option{-march=armv8.1-a}.
18320 @item fp16
18321 Enable FP16 extension.  This also enables floating-point instructions.
18322 @item fp16fml
18323 Enable FP16 fmla extension.  This also enables FP16 extensions and
18324 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.
18326 @item rcpc
18327 Enable the RcPc extension.  This does not change code generation from GCC,
18328 but is passed on to the assembler, enabling inline asm statements to use
18329 instructions from the RcPc extension.
18330 @item dotprod
18331 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
18332 @item aes
18333 Enable the Armv8-a aes and pmull crypto extension.  This also enables Advanced
18334 SIMD instructions.
18335 @item sha2
18336 Enable the Armv8-a sha2 crypto extension.  This also enables Advanced SIMD instructions.
18337 @item sha3
18338 Enable the sha512 and sha3 crypto extension.  This also enables Advanced SIMD
18339 instructions. Use of this option with architectures prior to Armv8.2-A is not supported.
18340 @item sm4
18341 Enable the sm3 and sm4 crypto extension.  This also enables Advanced SIMD instructions.
18342 Use of this option with architectures prior to Armv8.2-A is not supported.
18343 @item profile
18344 Enable the Statistical Profiling extension.  This option is only to enable the
18345 extension at the assembler level and does not affect code generation.
18346 @item rng
18347 Enable the Armv8.5-a Random Number instructions.  This option is only to
18348 enable the extension at the assembler level and does not affect code
18349 generation.
18350 @item memtag
18351 Enable the Armv8.5-a Memory Tagging Extensions.
18352 Use of this option with architectures prior to Armv8.5-A is not supported.
18353 @item sb
18354 Enable the Armv8-a Speculation Barrier instruction.  This option is only to
18355 enable the extension at the assembler level and does not affect code
18356 generation.  This option is enabled by default for @option{-march=armv8.5-a}.
18357 @item ssbs
18358 Enable the Armv8-a Speculative Store Bypass Safe instruction.  This option
18359 is only to enable the extension at the assembler level and does not affect code
18360 generation.  This option is enabled by default for @option{-march=armv8.5-a}.
18361 @item predres
18362 Enable the Armv8-a Execution and Data Prediction Restriction instructions.
18363 This option is only to enable the extension at the assembler level and does
18364 not affect code generation.  This option is enabled by default for
18365 @option{-march=armv8.5-a}.
18366 @item sve2
18367 Enable the Armv8-a Scalable Vector Extension 2.  This also enables SVE
18368 instructions.
18369 @item sve2-bitperm
18370 Enable SVE2 bitperm instructions.  This also enables SVE2 instructions.
18371 @item sve2-sm4
18372 Enable SVE2 sm4 instructions.  This also enables SVE2 instructions.
18373 @item sve2-aes
18374 Enable SVE2 aes instructions.  This also enables SVE2 instructions.
18375 @item sve2-sha3
18376 Enable SVE2 sha3 instructions.  This also enables SVE2 instructions.
18377 @item tme
18378 Enable the Transactional Memory Extension.
18379 @item i8mm
18380 Enable 8-bit Integer Matrix Multiply instructions.  This also enables
18381 Advanced SIMD and floating-point instructions.  This option is enabled by
18382 default for @option{-march=armv8.6-a}.  Use of this option with architectures
18383 prior to Armv8.2-A is not supported.
18384 @item f32mm
18385 Enable 32-bit Floating point Matrix Multiply instructions.  This also enables
18386 SVE instructions.  Use of this option with architectures prior to Armv8.2-A is
18387 not supported.
18388 @item f64mm
18389 Enable 64-bit Floating point Matrix Multiply instructions.  This also enables
18390 SVE instructions.  Use of this option with architectures prior to Armv8.2-A is
18391 not supported.
18392 @item bf16
18393 Enable brain half-precision floating-point instructions.  This also enables
18394 Advanced SIMD and floating-point instructions.  This option is enabled by
18395 default for @option{-march=armv8.6-a}.  Use of this option with architectures
18396 prior to Armv8.2-A is not supported.
18397 @item flagm
18398 Enable the Flag Manipulation instructions Extension.
18399 @item pauth
18400 Enable the Pointer Authentication Extension.
18402 @end table
18404 Feature @option{crypto} implies @option{aes}, @option{sha2}, and @option{simd},
18405 which implies @option{fp}.
18406 Conversely, @option{nofp} implies @option{nosimd}, which implies
18407 @option{nocrypto}, @option{noaes} and @option{nosha2}.
18409 @node Adapteva Epiphany Options
18410 @subsection Adapteva Epiphany Options
18412 These @samp{-m} options are defined for Adapteva Epiphany:
18414 @table @gcctabopt
18415 @item -mhalf-reg-file
18416 @opindex mhalf-reg-file
18417 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
18418 That allows code to run on hardware variants that lack these registers.
18420 @item -mprefer-short-insn-regs
18421 @opindex mprefer-short-insn-regs
18422 Preferentially allocate registers that allow short instruction generation.
18423 This can result in increased instruction count, so this may either reduce or
18424 increase overall code size.
18426 @item -mbranch-cost=@var{num}
18427 @opindex mbranch-cost
18428 Set the cost of branches to roughly @var{num} ``simple'' instructions.
18429 This cost is only a heuristic and is not guaranteed to produce
18430 consistent results across releases.
18432 @item -mcmove
18433 @opindex mcmove
18434 Enable the generation of conditional moves.
18436 @item -mnops=@var{num}
18437 @opindex mnops
18438 Emit @var{num} NOPs before every other generated instruction.
18440 @item -mno-soft-cmpsf
18441 @opindex mno-soft-cmpsf
18442 @opindex msoft-cmpsf
18443 For single-precision floating-point comparisons, emit an @code{fsub} instruction
18444 and test the flags.  This is faster than a software comparison, but can
18445 get incorrect results in the presence of NaNs, or when two different small
18446 numbers are compared such that their difference is calculated as zero.
18447 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
18448 software comparisons.
18450 @item -mstack-offset=@var{num}
18451 @opindex mstack-offset
18452 Set the offset between the top of the stack and the stack pointer.
18453 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
18454 can be used by leaf functions without stack allocation.
18455 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
18456 Note also that this option changes the ABI; compiling a program with a
18457 different stack offset than the libraries have been compiled with
18458 generally does not work.
18459 This option can be useful if you want to evaluate if a different stack
18460 offset would give you better code, but to actually use a different stack
18461 offset to build working programs, it is recommended to configure the
18462 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
18464 @item -mno-round-nearest
18465 @opindex mno-round-nearest
18466 @opindex mround-nearest
18467 Make the scheduler assume that the rounding mode has been set to
18468 truncating.  The default is @option{-mround-nearest}.
18470 @item -mlong-calls
18471 @opindex mlong-calls
18472 If not otherwise specified by an attribute, assume all calls might be beyond
18473 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
18474 function address into a register before performing a (otherwise direct) call.
18475 This is the default.
18477 @item -mshort-calls
18478 @opindex short-calls
18479 If not otherwise specified by an attribute, assume all direct calls are
18480 in the range of the @code{b} / @code{bl} instructions, so use these instructions
18481 for direct calls.  The default is @option{-mlong-calls}.
18483 @item -msmall16
18484 @opindex msmall16
18485 Assume addresses can be loaded as 16-bit unsigned values.  This does not
18486 apply to function addresses for which @option{-mlong-calls} semantics
18487 are in effect.
18489 @item -mfp-mode=@var{mode}
18490 @opindex mfp-mode
18491 Set the prevailing mode of the floating-point unit.
18492 This determines the floating-point mode that is provided and expected
18493 at function call and return time.  Making this mode match the mode you
18494 predominantly need at function start can make your programs smaller and
18495 faster by avoiding unnecessary mode switches.
18497 @var{mode} can be set to one the following values:
18499 @table @samp
18500 @item caller
18501 Any mode at function entry is valid, and retained or restored when
18502 the function returns, and when it calls other functions.
18503 This mode is useful for compiling libraries or other compilation units
18504 you might want to incorporate into different programs with different
18505 prevailing FPU modes, and the convenience of being able to use a single
18506 object file outweighs the size and speed overhead for any extra
18507 mode switching that might be needed, compared with what would be needed
18508 with a more specific choice of prevailing FPU mode.
18510 @item truncate
18511 This is the mode used for floating-point calculations with
18512 truncating (i.e.@: round towards zero) rounding mode.  That includes
18513 conversion from floating point to integer.
18515 @item round-nearest
18516 This is the mode used for floating-point calculations with
18517 round-to-nearest-or-even rounding mode.
18519 @item int
18520 This is the mode used to perform integer calculations in the FPU, e.g.@:
18521 integer multiply, or integer multiply-and-accumulate.
18522 @end table
18524 The default is @option{-mfp-mode=caller}
18526 @item -mno-split-lohi
18527 @itemx -mno-postinc
18528 @itemx -mno-postmodify
18529 @opindex mno-split-lohi
18530 @opindex msplit-lohi
18531 @opindex mno-postinc
18532 @opindex mpostinc
18533 @opindex mno-postmodify
18534 @opindex mpostmodify
18535 Code generation tweaks that disable, respectively, splitting of 32-bit
18536 loads, generation of post-increment addresses, and generation of
18537 post-modify addresses.  The defaults are @option{msplit-lohi},
18538 @option{-mpost-inc}, and @option{-mpost-modify}.
18540 @item -mnovect-double
18541 @opindex mno-vect-double
18542 @opindex mvect-double
18543 Change the preferred SIMD mode to SImode.  The default is
18544 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
18546 @item -max-vect-align=@var{num}
18547 @opindex max-vect-align
18548 The maximum alignment for SIMD vector mode types.
18549 @var{num} may be 4 or 8.  The default is 8.
18550 Note that this is an ABI change, even though many library function
18551 interfaces are unaffected if they don't use SIMD vector modes
18552 in places that affect size and/or alignment of relevant types.
18554 @item -msplit-vecmove-early
18555 @opindex msplit-vecmove-early
18556 Split vector moves into single word moves before reload.  In theory this
18557 can give better register allocation, but so far the reverse seems to be
18558 generally the case.
18560 @item -m1reg-@var{reg}
18561 @opindex m1reg-
18562 Specify a register to hold the constant @minus{}1, which makes loading small negative
18563 constants and certain bitmasks faster.
18564 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
18565 which specify use of that register as a fixed register,
18566 and @samp{none}, which means that no register is used for this
18567 purpose.  The default is @option{-m1reg-none}.
18569 @end table
18571 @node AMD GCN Options
18572 @subsection AMD GCN Options
18573 @cindex AMD GCN Options
18575 These options are defined specifically for the AMD GCN port.
18577 @table @gcctabopt
18579 @item -march=@var{gpu}
18580 @opindex march
18581 @itemx -mtune=@var{gpu}
18582 @opindex mtune
18583 Set architecture type or tuning for @var{gpu}. Supported values for @var{gpu}
18586 @table @samp
18587 @opindex fiji
18588 @item fiji
18589 Compile for GCN3 Fiji devices (gfx803).
18591 @item gfx900
18592 Compile for GCN5 Vega 10 devices (gfx900).
18594 @item gfx906
18595 Compile for GCN5 Vega 20 devices (gfx906).
18597 @end table
18599 @item -mstack-size=@var{bytes}
18600 @opindex mstack-size
18601 Specify how many @var{bytes} of stack space will be requested for each GPU
18602 thread (wave-front).  Beware that there may be many threads and limited memory
18603 available.  The size of the stack allocation may also have an impact on
18604 run-time performance.  The default is 32KB when using OpenACC or OpenMP, and
18605 1MB otherwise.
18607 @end table
18609 @node ARC Options
18610 @subsection ARC Options
18611 @cindex ARC options
18613 The following options control the architecture variant for which code
18614 is being compiled:
18616 @c architecture variants
18617 @table @gcctabopt
18619 @item -mbarrel-shifter
18620 @opindex mbarrel-shifter
18621 Generate instructions supported by barrel shifter.  This is the default
18622 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
18624 @item -mjli-always
18625 @opindex mjli-alawys
18626 Force to call a function using jli_s instruction.  This option is
18627 valid only for ARCv2 architecture.
18629 @item -mcpu=@var{cpu}
18630 @opindex mcpu
18631 Set architecture type, register usage, and instruction scheduling
18632 parameters for @var{cpu}.  There are also shortcut alias options
18633 available for backward compatibility and convenience.  Supported
18634 values for @var{cpu} are
18636 @table @samp
18637 @opindex mA6
18638 @opindex mARC600
18639 @item arc600
18640 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
18642 @item arc601
18643 @opindex mARC601
18644 Compile for ARC601.  Alias: @option{-mARC601}.
18646 @item arc700
18647 @opindex mA7
18648 @opindex mARC700
18649 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
18650 This is the default when configured with @option{--with-cpu=arc700}@.
18652 @item arcem
18653 Compile for ARC EM.
18655 @item archs
18656 Compile for ARC HS.
18658 @item em
18659 Compile for ARC EM CPU with no hardware extensions.
18661 @item em4
18662 Compile for ARC EM4 CPU.
18664 @item em4_dmips
18665 Compile for ARC EM4 DMIPS CPU.
18667 @item em4_fpus
18668 Compile for ARC EM4 DMIPS CPU with the single-precision floating-point
18669 extension.
18671 @item em4_fpuda
18672 Compile for ARC EM4 DMIPS CPU with single-precision floating-point and
18673 double assist instructions.
18675 @item hs
18676 Compile for ARC HS CPU with no hardware extensions except the atomic
18677 instructions.
18679 @item hs34
18680 Compile for ARC HS34 CPU.
18682 @item hs38
18683 Compile for ARC HS38 CPU.
18685 @item hs38_linux
18686 Compile for ARC HS38 CPU with all hardware extensions on.
18688 @item arc600_norm
18689 Compile for ARC 600 CPU with @code{norm} instructions enabled.
18691 @item arc600_mul32x16
18692 Compile for ARC 600 CPU with @code{norm} and 32x16-bit multiply 
18693 instructions enabled.
18695 @item arc600_mul64
18696 Compile for ARC 600 CPU with @code{norm} and @code{mul64}-family 
18697 instructions enabled.
18699 @item arc601_norm
18700 Compile for ARC 601 CPU with @code{norm} instructions enabled.
18702 @item arc601_mul32x16
18703 Compile for ARC 601 CPU with @code{norm} and 32x16-bit multiply
18704 instructions enabled.
18706 @item arc601_mul64
18707 Compile for ARC 601 CPU with @code{norm} and @code{mul64}-family
18708 instructions enabled.
18710 @item nps400
18711 Compile for ARC 700 on NPS400 chip.
18713 @item em_mini
18714 Compile for ARC EM minimalist configuration featuring reduced register
18715 set.
18717 @end table
18719 @item -mdpfp
18720 @opindex mdpfp
18721 @itemx -mdpfp-compact
18722 @opindex mdpfp-compact
18723 Generate double-precision FPX instructions, tuned for the compact
18724 implementation.
18726 @item -mdpfp-fast
18727 @opindex mdpfp-fast
18728 Generate double-precision FPX instructions, tuned for the fast
18729 implementation.
18731 @item -mno-dpfp-lrsr
18732 @opindex mno-dpfp-lrsr
18733 Disable @code{lr} and @code{sr} instructions from using FPX extension
18734 aux registers.
18736 @item -mea
18737 @opindex mea
18738 Generate extended arithmetic instructions.  Currently only
18739 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
18740 supported.  Only valid for @option{-mcpu=ARC700}.
18742 @item -mno-mpy
18743 @opindex mno-mpy
18744 @opindex mmpy
18745 Do not generate @code{mpy}-family instructions for ARC700.  This option is
18746 deprecated.
18748 @item -mmul32x16
18749 @opindex mmul32x16
18750 Generate 32x16-bit multiply and multiply-accumulate instructions.
18752 @item -mmul64
18753 @opindex mmul64
18754 Generate @code{mul64} and @code{mulu64} instructions.  
18755 Only valid for @option{-mcpu=ARC600}.
18757 @item -mnorm
18758 @opindex mnorm
18759 Generate @code{norm} instructions.  This is the default if @option{-mcpu=ARC700}
18760 is in effect.
18762 @item -mspfp
18763 @opindex mspfp
18764 @itemx -mspfp-compact
18765 @opindex mspfp-compact
18766 Generate single-precision FPX instructions, tuned for the compact
18767 implementation.
18769 @item -mspfp-fast
18770 @opindex mspfp-fast
18771 Generate single-precision FPX instructions, tuned for the fast
18772 implementation.
18774 @item -msimd
18775 @opindex msimd
18776 Enable generation of ARC SIMD instructions via target-specific
18777 builtins.  Only valid for @option{-mcpu=ARC700}.
18779 @item -msoft-float
18780 @opindex msoft-float
18781 This option ignored; it is provided for compatibility purposes only.
18782 Software floating-point code is emitted by default, and this default
18783 can overridden by FPX options; @option{-mspfp}, @option{-mspfp-compact}, or
18784 @option{-mspfp-fast} for single precision, and @option{-mdpfp},
18785 @option{-mdpfp-compact}, or @option{-mdpfp-fast} for double precision.
18787 @item -mswap
18788 @opindex mswap
18789 Generate @code{swap} instructions.
18791 @item -matomic
18792 @opindex matomic
18793 This enables use of the locked load/store conditional extension to implement
18794 atomic memory built-in functions.  Not available for ARC 6xx or ARC
18795 EM cores.
18797 @item -mdiv-rem
18798 @opindex mdiv-rem
18799 Enable @code{div} and @code{rem} instructions for ARCv2 cores.
18801 @item -mcode-density
18802 @opindex mcode-density
18803 Enable code density instructions for ARC EM.  
18804 This option is on by default for ARC HS.
18806 @item -mll64
18807 @opindex mll64
18808 Enable double load/store operations for ARC HS cores.
18810 @item -mtp-regno=@var{regno}
18811 @opindex mtp-regno
18812 Specify thread pointer register number.
18814 @item -mmpy-option=@var{multo}
18815 @opindex mmpy-option
18816 Compile ARCv2 code with a multiplier design option.  You can specify 
18817 the option using either a string or numeric value for @var{multo}.  
18818 @samp{wlh1} is the default value.  The recognized values are:
18820 @table @samp
18821 @item 0
18822 @itemx none
18823 No multiplier available.
18825 @item 1
18826 @itemx w
18827 16x16 multiplier, fully pipelined.
18828 The following instructions are enabled: @code{mpyw} and @code{mpyuw}.
18830 @item 2
18831 @itemx wlh1
18832 32x32 multiplier, fully
18833 pipelined (1 stage).  The following instructions are additionally
18834 enabled: @code{mpy}, @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
18836 @item 3
18837 @itemx wlh2
18838 32x32 multiplier, fully pipelined
18839 (2 stages).  The following instructions are additionally enabled: @code{mpy},
18840 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
18842 @item 4
18843 @itemx wlh3
18844 Two 16x16 multipliers, blocking,
18845 sequential.  The following instructions are additionally enabled: @code{mpy},
18846 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
18848 @item 5
18849 @itemx wlh4
18850 One 16x16 multiplier, blocking,
18851 sequential.  The following instructions are additionally enabled: @code{mpy},
18852 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
18854 @item 6
18855 @itemx wlh5
18856 One 32x4 multiplier, blocking,
18857 sequential.  The following instructions are additionally enabled: @code{mpy},
18858 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
18860 @item 7
18861 @itemx plus_dmpy
18862 ARC HS SIMD support.
18864 @item 8
18865 @itemx plus_macd
18866 ARC HS SIMD support.
18868 @item 9
18869 @itemx plus_qmacw
18870 ARC HS SIMD support.
18872 @end table
18874 This option is only available for ARCv2 cores@.
18876 @item -mfpu=@var{fpu}
18877 @opindex mfpu
18878 Enables support for specific floating-point hardware extensions for ARCv2
18879 cores.  Supported values for @var{fpu} are:
18881 @table @samp
18883 @item fpus
18884 Enables support for single-precision floating-point hardware
18885 extensions@.
18887 @item fpud
18888 Enables support for double-precision floating-point hardware
18889 extensions.  The single-precision floating-point extension is also
18890 enabled.  Not available for ARC EM@.
18892 @item fpuda
18893 Enables support for double-precision floating-point hardware
18894 extensions using double-precision assist instructions.  The single-precision
18895 floating-point extension is also enabled.  This option is
18896 only available for ARC EM@.
18898 @item fpuda_div
18899 Enables support for double-precision floating-point hardware
18900 extensions using double-precision assist instructions.
18901 The single-precision floating-point, square-root, and divide 
18902 extensions are also enabled.  This option is
18903 only available for ARC EM@.
18905 @item fpuda_fma
18906 Enables support for double-precision floating-point hardware
18907 extensions using double-precision assist instructions.
18908 The single-precision floating-point and fused multiply and add 
18909 hardware extensions are also enabled.  This option is
18910 only available for ARC EM@.
18912 @item fpuda_all
18913 Enables support for double-precision floating-point hardware
18914 extensions using double-precision assist instructions.
18915 All single-precision floating-point hardware extensions are also
18916 enabled.  This option is only available for ARC EM@.
18918 @item fpus_div
18919 Enables support for single-precision floating-point, square-root and divide 
18920 hardware extensions@.
18922 @item fpud_div
18923 Enables support for double-precision floating-point, square-root and divide 
18924 hardware extensions.  This option
18925 includes option @samp{fpus_div}. Not available for ARC EM@.
18927 @item fpus_fma
18928 Enables support for single-precision floating-point and 
18929 fused multiply and add hardware extensions@.
18931 @item fpud_fma
18932 Enables support for double-precision floating-point and 
18933 fused multiply and add hardware extensions.  This option
18934 includes option @samp{fpus_fma}.  Not available for ARC EM@.
18936 @item fpus_all
18937 Enables support for all single-precision floating-point hardware
18938 extensions@.
18940 @item fpud_all
18941 Enables support for all single- and double-precision floating-point
18942 hardware extensions.  Not available for ARC EM@.
18944 @end table
18946 @item -mirq-ctrl-saved=@var{register-range}, @var{blink}, @var{lp_count}
18947 @opindex mirq-ctrl-saved
18948 Specifies general-purposes registers that the processor automatically
18949 saves/restores on interrupt entry and exit.  @var{register-range} is
18950 specified as two registers separated by a dash.  The register range
18951 always starts with @code{r0}, the upper limit is @code{fp} register.
18952 @var{blink} and @var{lp_count} are optional.  This option is only
18953 valid for ARC EM and ARC HS cores.
18955 @item -mrgf-banked-regs=@var{number}
18956 @opindex mrgf-banked-regs
18957 Specifies the number of registers replicated in second register bank
18958 on entry to fast interrupt.  Fast interrupts are interrupts with the
18959 highest priority level P0.  These interrupts save only PC and STATUS32
18960 registers to avoid memory transactions during interrupt entry and exit
18961 sequences.  Use this option when you are using fast interrupts in an
18962 ARC V2 family processor.  Permitted values are 4, 8, 16, and 32.
18964 @item -mlpc-width=@var{width}
18965 @opindex mlpc-width
18966 Specify the width of the @code{lp_count} register.  Valid values for
18967 @var{width} are 8, 16, 20, 24, 28 and 32 bits.  The default width is
18968 fixed to 32 bits.  If the width is less than 32, the compiler does not
18969 attempt to transform loops in your program to use the zero-delay loop
18970 mechanism unless it is known that the @code{lp_count} register can
18971 hold the required loop-counter value.  Depending on the width
18972 specified, the compiler and run-time library might continue to use the
18973 loop mechanism for various needs.  This option defines macro
18974 @code{__ARC_LPC_WIDTH__} with the value of @var{width}.
18976 @item -mrf16
18977 @opindex mrf16
18978 This option instructs the compiler to generate code for a 16-entry
18979 register file.  This option defines the @code{__ARC_RF16__}
18980 preprocessor macro.
18982 @item -mbranch-index
18983 @opindex mbranch-index
18984 Enable use of @code{bi} or @code{bih} instructions to implement jump
18985 tables.
18987 @end table
18989 The following options are passed through to the assembler, and also
18990 define preprocessor macro symbols.
18992 @c Flags used by the assembler, but for which we define preprocessor
18993 @c macro symbols as well.
18994 @table @gcctabopt
18995 @item -mdsp-packa
18996 @opindex mdsp-packa
18997 Passed down to the assembler to enable the DSP Pack A extensions.
18998 Also sets the preprocessor symbol @code{__Xdsp_packa}.  This option is
18999 deprecated.
19001 @item -mdvbf
19002 @opindex mdvbf
19003 Passed down to the assembler to enable the dual Viterbi butterfly
19004 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.  This
19005 option is deprecated.
19007 @c ARC700 4.10 extension instruction
19008 @item -mlock
19009 @opindex mlock
19010 Passed down to the assembler to enable the locked load/store
19011 conditional extension.  Also sets the preprocessor symbol
19012 @code{__Xlock}.
19014 @item -mmac-d16
19015 @opindex mmac-d16
19016 Passed down to the assembler.  Also sets the preprocessor symbol
19017 @code{__Xxmac_d16}.  This option is deprecated.
19019 @item -mmac-24
19020 @opindex mmac-24
19021 Passed down to the assembler.  Also sets the preprocessor symbol
19022 @code{__Xxmac_24}.  This option is deprecated.
19024 @c ARC700 4.10 extension instruction
19025 @item -mrtsc
19026 @opindex mrtsc
19027 Passed down to the assembler to enable the 64-bit time-stamp counter
19028 extension instruction.  Also sets the preprocessor symbol
19029 @code{__Xrtsc}.  This option is deprecated.
19031 @c ARC700 4.10 extension instruction
19032 @item -mswape
19033 @opindex mswape
19034 Passed down to the assembler to enable the swap byte ordering
19035 extension instruction.  Also sets the preprocessor symbol
19036 @code{__Xswape}.
19038 @item -mtelephony
19039 @opindex mtelephony
19040 Passed down to the assembler to enable dual- and single-operand
19041 instructions for telephony.  Also sets the preprocessor symbol
19042 @code{__Xtelephony}.  This option is deprecated.
19044 @item -mxy
19045 @opindex mxy
19046 Passed down to the assembler to enable the XY memory extension.  Also
19047 sets the preprocessor symbol @code{__Xxy}.
19049 @end table
19051 The following options control how the assembly code is annotated:
19053 @c Assembly annotation options
19054 @table @gcctabopt
19055 @item -misize
19056 @opindex misize
19057 Annotate assembler instructions with estimated addresses.
19059 @item -mannotate-align
19060 @opindex mannotate-align
19061 Explain what alignment considerations lead to the decision to make an
19062 instruction short or long.
19064 @end table
19066 The following options are passed through to the linker:
19068 @c options passed through to the linker
19069 @table @gcctabopt
19070 @item -marclinux
19071 @opindex marclinux
19072 Passed through to the linker, to specify use of the @code{arclinux} emulation.
19073 This option is enabled by default in tool chains built for
19074 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
19075 when profiling is not requested.
19077 @item -marclinux_prof
19078 @opindex marclinux_prof
19079 Passed through to the linker, to specify use of the
19080 @code{arclinux_prof} emulation.  This option is enabled by default in
19081 tool chains built for @w{@code{arc-linux-uclibc}} and
19082 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
19084 @end table
19086 The following options control the semantics of generated code:
19088 @c semantically relevant code generation options
19089 @table @gcctabopt
19090 @item -mlong-calls
19091 @opindex mlong-calls
19092 Generate calls as register indirect calls, thus providing access
19093 to the full 32-bit address range.
19095 @item -mmedium-calls
19096 @opindex mmedium-calls
19097 Don't use less than 25-bit addressing range for calls, which is the
19098 offset available for an unconditional branch-and-link
19099 instruction.  Conditional execution of function calls is suppressed, to
19100 allow use of the 25-bit range, rather than the 21-bit range with
19101 conditional branch-and-link.  This is the default for tool chains built
19102 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
19104 @item -G @var{num}
19105 @opindex G
19106 Put definitions of externally-visible data in a small data section if
19107 that data is no bigger than @var{num} bytes.  The default value of
19108 @var{num} is 4 for any ARC configuration, or 8 when we have double
19109 load/store operations.
19111 @item -mno-sdata
19112 @opindex mno-sdata
19113 @opindex msdata
19114 Do not generate sdata references.  This is the default for tool chains
19115 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
19116 targets.
19118 @item -mvolatile-cache
19119 @opindex mvolatile-cache
19120 Use ordinarily cached memory accesses for volatile references.  This is the
19121 default.
19123 @item -mno-volatile-cache
19124 @opindex mno-volatile-cache
19125 @opindex mvolatile-cache
19126 Enable cache bypass for volatile references.
19128 @end table
19130 The following options fine tune code generation:
19131 @c code generation tuning options
19132 @table @gcctabopt
19133 @item -malign-call
19134 @opindex malign-call
19135 Do alignment optimizations for call instructions.
19137 @item -mauto-modify-reg
19138 @opindex mauto-modify-reg
19139 Enable the use of pre/post modify with register displacement.
19141 @item -mbbit-peephole
19142 @opindex mbbit-peephole
19143 Enable bbit peephole2.
19145 @item -mno-brcc
19146 @opindex mno-brcc
19147 This option disables a target-specific pass in @file{arc_reorg} to
19148 generate compare-and-branch (@code{br@var{cc}}) instructions.  
19149 It has no effect on
19150 generation of these instructions driven by the combiner pass.
19152 @item -mcase-vector-pcrel
19153 @opindex mcase-vector-pcrel
19154 Use PC-relative switch case tables to enable case table shortening.
19155 This is the default for @option{-Os}.
19157 @item -mcompact-casesi
19158 @opindex mcompact-casesi
19159 Enable compact @code{casesi} pattern.  This is the default for @option{-Os},
19160 and only available for ARCv1 cores.  This option is deprecated.
19162 @item -mno-cond-exec
19163 @opindex mno-cond-exec
19164 Disable the ARCompact-specific pass to generate conditional 
19165 execution instructions.
19167 Due to delay slot scheduling and interactions between operand numbers,
19168 literal sizes, instruction lengths, and the support for conditional execution,
19169 the target-independent pass to generate conditional execution is often lacking,
19170 so the ARC port has kept a special pass around that tries to find more
19171 conditional execution generation opportunities after register allocation,
19172 branch shortening, and delay slot scheduling have been done.  This pass
19173 generally, but not always, improves performance and code size, at the cost of
19174 extra compilation time, which is why there is an option to switch it off.
19175 If you have a problem with call instructions exceeding their allowable
19176 offset range because they are conditionalized, you should consider using
19177 @option{-mmedium-calls} instead.
19179 @item -mearly-cbranchsi
19180 @opindex mearly-cbranchsi
19181 Enable pre-reload use of the @code{cbranchsi} pattern.
19183 @item -mexpand-adddi
19184 @opindex mexpand-adddi
19185 Expand @code{adddi3} and @code{subdi3} at RTL generation time into
19186 @code{add.f}, @code{adc} etc.  This option is deprecated.
19188 @item -mindexed-loads
19189 @opindex mindexed-loads
19190 Enable the use of indexed loads.  This can be problematic because some
19191 optimizers then assume that indexed stores exist, which is not
19192 the case.
19194 @item -mlra
19195 @opindex mlra
19196 Enable Local Register Allocation.  This is still experimental for ARC,
19197 so by default the compiler uses standard reload
19198 (i.e.@: @option{-mno-lra}).
19200 @item -mlra-priority-none
19201 @opindex mlra-priority-none
19202 Don't indicate any priority for target registers.
19204 @item -mlra-priority-compact
19205 @opindex mlra-priority-compact
19206 Indicate target register priority for r0..r3 / r12..r15.
19208 @item -mlra-priority-noncompact
19209 @opindex mlra-priority-noncompact
19210 Reduce target register priority for r0..r3 / r12..r15.
19212 @item -mmillicode
19213 @opindex mmillicode
19214 When optimizing for size (using @option{-Os}), prologues and epilogues
19215 that have to save or restore a large number of registers are often
19216 shortened by using call to a special function in libgcc; this is
19217 referred to as a @emph{millicode} call.  As these calls can pose
19218 performance issues, and/or cause linking issues when linking in a
19219 nonstandard way, this option is provided to turn on or off millicode
19220 call generation.
19222 @item -mcode-density-frame
19223 @opindex mcode-density-frame
19224 This option enable the compiler to emit @code{enter} and @code{leave}
19225 instructions.  These instructions are only valid for CPUs with
19226 code-density feature.
19228 @item -mmixed-code
19229 @opindex mmixed-code
19230 Tweak register allocation to help 16-bit instruction generation.
19231 This generally has the effect of decreasing the average instruction size
19232 while increasing the instruction count.
19234 @item -mq-class
19235 @opindex mq-class
19236 Ths option is deprecated.  Enable @samp{q} instruction alternatives.
19237 This is the default for @option{-Os}.
19239 @item -mRcq
19240 @opindex mRcq
19241 Enable @samp{Rcq} constraint handling.  
19242 Most short code generation depends on this.
19243 This is the default.
19245 @item -mRcw
19246 @opindex mRcw
19247 Enable @samp{Rcw} constraint handling.  
19248 Most ccfsm condexec mostly depends on this.
19249 This is the default.
19251 @item -msize-level=@var{level}
19252 @opindex msize-level
19253 Fine-tune size optimization with regards to instruction lengths and alignment.
19254 The recognized values for @var{level} are:
19255 @table @samp
19256 @item 0
19257 No size optimization.  This level is deprecated and treated like @samp{1}.
19259 @item 1
19260 Short instructions are used opportunistically.
19262 @item 2
19263 In addition, alignment of loops and of code after barriers are dropped.
19265 @item 3
19266 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
19268 @end table
19270 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
19271 the behavior when this is not set is equivalent to level @samp{1}.
19273 @item -mtune=@var{cpu}
19274 @opindex mtune
19275 Set instruction scheduling parameters for @var{cpu}, overriding any implied
19276 by @option{-mcpu=}.
19278 Supported values for @var{cpu} are
19280 @table @samp
19281 @item ARC600
19282 Tune for ARC600 CPU.
19284 @item ARC601
19285 Tune for ARC601 CPU.
19287 @item ARC700
19288 Tune for ARC700 CPU with standard multiplier block.
19290 @item ARC700-xmac
19291 Tune for ARC700 CPU with XMAC block.
19293 @item ARC725D
19294 Tune for ARC725D CPU.
19296 @item ARC750D
19297 Tune for ARC750D CPU.
19299 @end table
19301 @item -mmultcost=@var{num}
19302 @opindex mmultcost
19303 Cost to assume for a multiply instruction, with @samp{4} being equal to a
19304 normal instruction.
19306 @item -munalign-prob-threshold=@var{probability}
19307 @opindex munalign-prob-threshold
19308 Set probability threshold for unaligning branches.
19309 When tuning for @samp{ARC700} and optimizing for speed, branches without
19310 filled delay slot are preferably emitted unaligned and long, unless
19311 profiling indicates that the probability for the branch to be taken
19312 is below @var{probability}.  @xref{Cross-profiling}.
19313 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
19315 @end table
19317 The following options are maintained for backward compatibility, but
19318 are now deprecated and will be removed in a future release:
19320 @c Deprecated options
19321 @table @gcctabopt
19323 @item -margonaut
19324 @opindex margonaut
19325 Obsolete FPX.
19327 @item -mbig-endian
19328 @opindex mbig-endian
19329 @itemx -EB
19330 @opindex EB
19331 Compile code for big-endian targets.  Use of these options is now
19332 deprecated.  Big-endian code is supported by configuring GCC to build
19333 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets,
19334 for which big endian is the default.
19336 @item -mlittle-endian
19337 @opindex mlittle-endian
19338 @itemx -EL
19339 @opindex EL
19340 Compile code for little-endian targets.  Use of these options is now
19341 deprecated.  Little-endian code is supported by configuring GCC to build 
19342 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets,
19343 for which little endian is the default.
19345 @item -mbarrel_shifter
19346 @opindex mbarrel_shifter
19347 Replaced by @option{-mbarrel-shifter}.
19349 @item -mdpfp_compact
19350 @opindex mdpfp_compact
19351 Replaced by @option{-mdpfp-compact}.
19353 @item -mdpfp_fast
19354 @opindex mdpfp_fast
19355 Replaced by @option{-mdpfp-fast}.
19357 @item -mdsp_packa
19358 @opindex mdsp_packa
19359 Replaced by @option{-mdsp-packa}.
19361 @item -mEA
19362 @opindex mEA
19363 Replaced by @option{-mea}.
19365 @item -mmac_24
19366 @opindex mmac_24
19367 Replaced by @option{-mmac-24}.
19369 @item -mmac_d16
19370 @opindex mmac_d16
19371 Replaced by @option{-mmac-d16}.
19373 @item -mspfp_compact
19374 @opindex mspfp_compact
19375 Replaced by @option{-mspfp-compact}.
19377 @item -mspfp_fast
19378 @opindex mspfp_fast
19379 Replaced by @option{-mspfp-fast}.
19381 @item -mtune=@var{cpu}
19382 @opindex mtune
19383 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
19384 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
19385 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively.
19387 @item -multcost=@var{num}
19388 @opindex multcost
19389 Replaced by @option{-mmultcost}.
19391 @end table
19393 @node ARM Options
19394 @subsection ARM Options
19395 @cindex ARM options
19397 These @samp{-m} options are defined for the ARM port:
19399 @table @gcctabopt
19400 @item -mabi=@var{name}
19401 @opindex mabi
19402 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
19403 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
19405 @item -mapcs-frame
19406 @opindex mapcs-frame
19407 Generate a stack frame that is compliant with the ARM Procedure Call
19408 Standard for all functions, even if this is not strictly necessary for
19409 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
19410 with this option causes the stack frames not to be generated for
19411 leaf functions.  The default is @option{-mno-apcs-frame}.
19412 This option is deprecated.
19414 @item -mapcs
19415 @opindex mapcs
19416 This is a synonym for @option{-mapcs-frame} and is deprecated.
19418 @ignore
19419 @c not currently implemented
19420 @item -mapcs-stack-check
19421 @opindex mapcs-stack-check
19422 Generate code to check the amount of stack space available upon entry to
19423 every function (that actually uses some stack space).  If there is
19424 insufficient space available then either the function
19425 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
19426 called, depending upon the amount of stack space required.  The runtime
19427 system is required to provide these functions.  The default is
19428 @option{-mno-apcs-stack-check}, since this produces smaller code.
19430 @c not currently implemented
19431 @item -mapcs-reentrant
19432 @opindex mapcs-reentrant
19433 Generate reentrant, position-independent code.  The default is
19434 @option{-mno-apcs-reentrant}.
19435 @end ignore
19437 @item -mthumb-interwork
19438 @opindex mthumb-interwork
19439 Generate code that supports calling between the ARM and Thumb
19440 instruction sets.  Without this option, on pre-v5 architectures, the
19441 two instruction sets cannot be reliably used inside one program.  The
19442 default is @option{-mno-thumb-interwork}, since slightly larger code
19443 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
19444 configurations this option is meaningless.
19446 @item -mno-sched-prolog
19447 @opindex mno-sched-prolog
19448 @opindex msched-prolog
19449 Prevent the reordering of instructions in the function prologue, or the
19450 merging of those instruction with the instructions in the function's
19451 body.  This means that all functions start with a recognizable set
19452 of instructions (or in fact one of a choice from a small set of
19453 different function prologues), and this information can be used to
19454 locate the start of functions inside an executable piece of code.  The
19455 default is @option{-msched-prolog}.
19457 @item -mfloat-abi=@var{name}
19458 @opindex mfloat-abi
19459 Specifies which floating-point ABI to use.  Permissible values
19460 are: @samp{soft}, @samp{softfp} and @samp{hard}.
19462 Specifying @samp{soft} causes GCC to generate output containing
19463 library calls for floating-point operations.
19464 @samp{softfp} allows the generation of code using hardware floating-point
19465 instructions, but still uses the soft-float calling conventions.
19466 @samp{hard} allows generation of floating-point instructions
19467 and uses FPU-specific calling conventions.
19469 The default depends on the specific target configuration.  Note that
19470 the hard-float and soft-float ABIs are not link-compatible; you must
19471 compile your entire program with the same ABI, and link with a
19472 compatible set of libraries.
19474 @item -mgeneral-regs-only
19475 @opindex mgeneral-regs-only
19476 Generate code which uses only the general-purpose registers.  This will prevent
19477 the compiler from using floating-point and Advanced SIMD registers but will not
19478 impose any restrictions on the assembler.
19480 @item -mlittle-endian
19481 @opindex mlittle-endian
19482 Generate code for a processor running in little-endian mode.  This is
19483 the default for all standard configurations.
19485 @item -mbig-endian
19486 @opindex mbig-endian
19487 Generate code for a processor running in big-endian mode; the default is
19488 to compile code for a little-endian processor.
19490 @item -mbe8
19491 @itemx -mbe32
19492 @opindex mbe8
19493 When linking a big-endian image select between BE8 and BE32 formats.
19494 The option has no effect for little-endian images and is ignored.  The
19495 default is dependent on the selected target architecture.  For ARMv6
19496 and later architectures the default is BE8, for older architectures
19497 the default is BE32.  BE32 format has been deprecated by ARM.
19499 @item -march=@var{name}@r{[}+extension@dots{}@r{]}
19500 @opindex march
19501 This specifies the name of the target ARM architecture.  GCC uses this
19502 name to determine what kind of instructions it can emit when generating
19503 assembly code.  This option can be used in conjunction with or instead
19504 of the @option{-mcpu=} option.
19506 Permissible names are:
19507 @samp{armv4t},
19508 @samp{armv5t}, @samp{armv5te},
19509 @samp{armv6}, @samp{armv6j}, @samp{armv6k}, @samp{armv6kz}, @samp{armv6t2},
19510 @samp{armv6z}, @samp{armv6zk},
19511 @samp{armv7}, @samp{armv7-a}, @samp{armv7ve}, 
19512 @samp{armv8-a}, @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a},
19513 @samp{armv8.4-a},
19514 @samp{armv8.5-a},
19515 @samp{armv8.6-a},
19516 @samp{armv7-r},
19517 @samp{armv8-r},
19518 @samp{armv6-m}, @samp{armv6s-m},
19519 @samp{armv7-m}, @samp{armv7e-m},
19520 @samp{armv8-m.base}, @samp{armv8-m.main},
19521 @samp{armv8.1-m.main},
19522 @samp{iwmmxt} and @samp{iwmmxt2}.
19524 Additionally, the following architectures, which lack support for the
19525 Thumb execution state, are recognized but support is deprecated: @samp{armv4}.
19527 Many of the architectures support extensions.  These can be added by
19528 appending @samp{+@var{extension}} to the architecture name.  Extension
19529 options are processed in order and capabilities accumulate.  An extension
19530 will also enable any necessary base extensions
19531 upon which it depends.  For example, the @samp{+crypto} extension
19532 will always enable the @samp{+simd} extension.  The exception to the
19533 additive construction is for extensions that are prefixed with
19534 @samp{+no@dots{}}: these extensions disable the specified option and
19535 any other extensions that may depend on the presence of that
19536 extension.
19538 For example, @samp{-march=armv7-a+simd+nofp+vfpv4} is equivalent to
19539 writing @samp{-march=armv7-a+vfpv4} since the @samp{+simd} option is
19540 entirely disabled by the @samp{+nofp} option that follows it.
19542 Most extension names are generically named, but have an effect that is
19543 dependent upon the architecture to which it is applied.  For example,
19544 the @samp{+simd} option can be applied to both @samp{armv7-a} and
19545 @samp{armv8-a} architectures, but will enable the original ARMv7-A
19546 Advanced SIMD (Neon) extensions for @samp{armv7-a} and the ARMv8-A
19547 variant for @samp{armv8-a}.
19549 The table below lists the supported extensions for each architecture.
19550 Architectures not mentioned do not support any extensions.
19552 @table @samp
19553 @item armv5te
19554 @itemx armv6
19555 @itemx armv6j
19556 @itemx armv6k
19557 @itemx armv6kz
19558 @itemx armv6t2
19559 @itemx armv6z
19560 @itemx armv6zk
19561 @table @samp
19562 @item +fp
19563 The VFPv2 floating-point instructions.  The extension @samp{+vfpv2} can be
19564 used as an alias for this extension.
19566 @item +nofp
19567 Disable the floating-point instructions.
19568 @end table
19570 @item armv7
19571 The common subset of the ARMv7-A, ARMv7-R and ARMv7-M architectures.
19572 @table @samp
19573 @item +fp
19574 The VFPv3 floating-point instructions, with 16 double-precision
19575 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
19576 for this extension.  Note that floating-point is not supported by the
19577 base ARMv7-M architecture, but is compatible with both the ARMv7-A and
19578 ARMv7-R architectures.
19580 @item +nofp
19581 Disable the floating-point instructions.
19582 @end table
19584 @item armv7-a
19585 @table @samp
19586 @item +mp
19587 The multiprocessing extension.
19589 @item +sec
19590 The security extension.
19592 @item +fp
19593 The VFPv3 floating-point instructions, with 16 double-precision
19594 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
19595 for this extension.
19597 @item +simd
19598 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
19599 The extensions @samp{+neon} and @samp{+neon-vfpv3} can be used as aliases
19600 for this extension.
19602 @item +vfpv3
19603 The VFPv3 floating-point instructions, with 32 double-precision
19604 registers.
19606 @item +vfpv3-d16-fp16
19607 The VFPv3 floating-point instructions, with 16 double-precision
19608 registers and the half-precision floating-point conversion operations.
19610 @item +vfpv3-fp16
19611 The VFPv3 floating-point instructions, with 32 double-precision
19612 registers and the half-precision floating-point conversion operations.
19614 @item +vfpv4-d16
19615 The VFPv4 floating-point instructions, with 16 double-precision
19616 registers.
19618 @item +vfpv4
19619 The VFPv4 floating-point instructions, with 32 double-precision
19620 registers.
19622 @item +neon-fp16
19623 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
19624 the half-precision floating-point conversion operations.
19626 @item +neon-vfpv4
19627 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.
19629 @item +nosimd
19630 Disable the Advanced SIMD instructions (does not disable floating point).
19632 @item +nofp
19633 Disable the floating-point and Advanced SIMD instructions.
19634 @end table
19636 @item armv7ve
19637 The extended version of the ARMv7-A architecture with support for
19638 virtualization.
19639 @table @samp
19640 @item +fp
19641 The VFPv4 floating-point instructions, with 16 double-precision registers.
19642 The extension @samp{+vfpv4-d16} can be used as an alias for this extension.
19644 @item +simd
19645 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.  The
19646 extension @samp{+neon-vfpv4} can be used as an alias for this extension.
19648 @item +vfpv3-d16
19649 The VFPv3 floating-point instructions, with 16 double-precision
19650 registers.
19652 @item +vfpv3
19653 The VFPv3 floating-point instructions, with 32 double-precision
19654 registers.
19656 @item +vfpv3-d16-fp16
19657 The VFPv3 floating-point instructions, with 16 double-precision
19658 registers and the half-precision floating-point conversion operations.
19660 @item +vfpv3-fp16
19661 The VFPv3 floating-point instructions, with 32 double-precision
19662 registers and the half-precision floating-point conversion operations.
19664 @item +vfpv4-d16
19665 The VFPv4 floating-point instructions, with 16 double-precision
19666 registers.
19668 @item +vfpv4
19669 The VFPv4 floating-point instructions, with 32 double-precision
19670 registers.
19672 @item +neon
19673 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
19674 The extension @samp{+neon-vfpv3} can be used as an alias for this extension.
19676 @item +neon-fp16
19677 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
19678 the half-precision floating-point conversion operations.
19680 @item +nosimd
19681 Disable the Advanced SIMD instructions (does not disable floating point).
19683 @item +nofp
19684 Disable the floating-point and Advanced SIMD instructions.
19685 @end table
19687 @item armv8-a
19688 @table @samp
19689 @item +crc
19690 The Cyclic Redundancy Check (CRC) instructions.
19691 @item +simd
19692 The ARMv8-A Advanced SIMD and floating-point instructions.
19693 @item +crypto
19694 The cryptographic instructions.
19695 @item +nocrypto
19696 Disable the cryptographic instructions.
19697 @item +nofp
19698 Disable the floating-point, Advanced SIMD and cryptographic instructions.
19699 @item +sb
19700 Speculation Barrier Instruction.
19701 @item +predres
19702 Execution and Data Prediction Restriction Instructions.
19703 @end table
19705 @item armv8.1-a
19706 @table @samp
19707 @item +simd
19708 The ARMv8.1-A Advanced SIMD and floating-point instructions.
19710 @item +crypto
19711 The cryptographic instructions.  This also enables the Advanced SIMD and
19712 floating-point instructions.
19714 @item +nocrypto
19715 Disable the cryptographic instructions.
19717 @item +nofp
19718 Disable the floating-point, Advanced SIMD and cryptographic instructions.
19720 @item +sb
19721 Speculation Barrier Instruction.
19723 @item +predres
19724 Execution and Data Prediction Restriction Instructions.
19725 @end table
19727 @item armv8.2-a
19728 @itemx armv8.3-a
19729 @table @samp
19730 @item +fp16
19731 The half-precision floating-point data processing instructions.
19732 This also enables the Advanced SIMD and floating-point instructions.
19734 @item +fp16fml
19735 The half-precision floating-point fmla extension.  This also enables
19736 the half-precision floating-point extension and Advanced SIMD and
19737 floating-point instructions.
19739 @item +simd
19740 The ARMv8.1-A Advanced SIMD and floating-point instructions.
19742 @item +crypto
19743 The cryptographic instructions.  This also enables the Advanced SIMD and
19744 floating-point instructions.
19746 @item +dotprod
19747 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
19749 @item +nocrypto
19750 Disable the cryptographic extension.
19752 @item +nofp
19753 Disable the floating-point, Advanced SIMD and cryptographic instructions.
19755 @item +sb
19756 Speculation Barrier Instruction.
19758 @item +predres
19759 Execution and Data Prediction Restriction Instructions.
19761 @item +i8mm
19762 8-bit Integer Matrix Multiply instructions.
19763 This also enables Advanced SIMD and floating-point instructions.
19765 @item +bf16
19766 Brain half-precision floating-point instructions.
19767 This also enables Advanced SIMD and floating-point instructions.
19768 @end table
19770 @item armv8.4-a
19771 @table @samp
19772 @item +fp16
19773 The half-precision floating-point data processing instructions.
19774 This also enables the Advanced SIMD and floating-point instructions as well
19775 as the Dot Product extension and the half-precision floating-point fmla
19776 extension.
19778 @item +simd
19779 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
19780 Dot Product extension.
19782 @item +crypto
19783 The cryptographic instructions.  This also enables the Advanced SIMD and
19784 floating-point instructions as well as the Dot Product extension.
19786 @item +nocrypto
19787 Disable the cryptographic extension.
19789 @item +nofp
19790 Disable the floating-point, Advanced SIMD and cryptographic instructions.
19792 @item +sb
19793 Speculation Barrier Instruction.
19795 @item +predres
19796 Execution and Data Prediction Restriction Instructions.
19798 @item +i8mm
19799 8-bit Integer Matrix Multiply instructions.
19800 This also enables Advanced SIMD and floating-point instructions.
19802 @item +bf16
19803 Brain half-precision floating-point instructions.
19804 This also enables Advanced SIMD and floating-point instructions.
19805 @end table
19807 @item armv8.5-a
19808 @table @samp
19809 @item +fp16
19810 The half-precision floating-point data processing instructions.
19811 This also enables the Advanced SIMD and floating-point instructions as well
19812 as the Dot Product extension and the half-precision floating-point fmla
19813 extension.
19815 @item +simd
19816 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
19817 Dot Product extension.
19819 @item +crypto
19820 The cryptographic instructions.  This also enables the Advanced SIMD and
19821 floating-point instructions as well as the Dot Product extension.
19823 @item +nocrypto
19824 Disable the cryptographic extension.
19826 @item +nofp
19827 Disable the floating-point, Advanced SIMD and cryptographic instructions.
19829 @item +i8mm
19830 8-bit Integer Matrix Multiply instructions.
19831 This also enables Advanced SIMD and floating-point instructions.
19833 @item +bf16
19834 Brain half-precision floating-point instructions.
19835 This also enables Advanced SIMD and floating-point instructions.
19836 @end table
19838 @item armv8.6-a
19839 @table @samp
19840 @item +fp16
19841 The half-precision floating-point data processing instructions.
19842 This also enables the Advanced SIMD and floating-point instructions as well
19843 as the Dot Product extension and the half-precision floating-point fmla
19844 extension.
19846 @item +simd
19847 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
19848 Dot Product extension.
19850 @item +crypto
19851 The cryptographic instructions.  This also enables the Advanced SIMD and
19852 floating-point instructions as well as the Dot Product extension.
19854 @item +nocrypto
19855 Disable the cryptographic extension.
19857 @item +nofp
19858 Disable the floating-point, Advanced SIMD and cryptographic instructions.
19860 @item +i8mm
19861 8-bit Integer Matrix Multiply instructions.
19862 This also enables Advanced SIMD and floating-point instructions.
19864 @item +bf16
19865 Brain half-precision floating-point instructions.
19866 This also enables Advanced SIMD and floating-point instructions.
19867 @end table
19869 @item armv7-r
19870 @table @samp
19871 @item +fp.sp
19872 The single-precision VFPv3 floating-point instructions.  The extension
19873 @samp{+vfpv3xd} can be used as an alias for this extension.
19875 @item +fp
19876 The VFPv3 floating-point instructions with 16 double-precision registers.
19877 The extension +vfpv3-d16 can be used as an alias for this extension.
19879 @item +vfpv3xd-d16-fp16
19880 The single-precision VFPv3 floating-point instructions with 16 double-precision
19881 registers and the half-precision floating-point conversion operations.
19883 @item +vfpv3-d16-fp16
19884 The VFPv3 floating-point instructions with 16 double-precision
19885 registers and the half-precision floating-point conversion operations.
19887 @item +nofp
19888 Disable the floating-point extension.
19890 @item +idiv
19891 The ARM-state integer division instructions.
19893 @item +noidiv
19894 Disable the ARM-state integer division extension.
19895 @end table
19897 @item armv7e-m
19898 @table @samp
19899 @item +fp
19900 The single-precision VFPv4 floating-point instructions.
19902 @item +fpv5
19903 The single-precision FPv5 floating-point instructions.
19905 @item +fp.dp
19906 The single- and double-precision FPv5 floating-point instructions.
19908 @item +nofp
19909 Disable the floating-point extensions.
19910 @end table
19912 @item  armv8.1-m.main
19913 @table @samp
19915 @item +dsp
19916 The DSP instructions.
19918 @item +mve
19919 The M-Profile Vector Extension (MVE) integer instructions.
19921 @item +mve.fp
19922 The M-Profile Vector Extension (MVE) integer and single precision
19923 floating-point instructions.
19925 @item +fp
19926 The single-precision floating-point instructions.
19928 @item +fp.dp
19929 The single- and double-precision floating-point instructions.
19931 @item +nofp
19932 Disable the floating-point extension.
19934 @item +cdecp0, +cdecp1, ... , +cdecp7
19935 Enable the Custom Datapath Extension (CDE) on selected coprocessors according
19936 to the numbers given in the options in the range 0 to 7.
19937 @end table
19939 @item  armv8-m.main
19940 @table @samp
19941 @item +dsp
19942 The DSP instructions.
19944 @item +nodsp
19945 Disable the DSP extension.
19947 @item +fp
19948 The single-precision floating-point instructions.
19950 @item +fp.dp
19951 The single- and double-precision floating-point instructions.
19953 @item +nofp
19954 Disable the floating-point extension.
19956 @item +cdecp0, +cdecp1, ... , +cdecp7
19957 Enable the Custom Datapath Extension (CDE) on selected coprocessors according
19958 to the numbers given in the options in the range 0 to 7.
19959 @end table
19961 @item armv8-r
19962 @table @samp
19963 @item +crc
19964 The Cyclic Redundancy Check (CRC) instructions.
19965 @item +fp.sp
19966 The single-precision FPv5 floating-point instructions.
19967 @item +simd
19968 The ARMv8-A Advanced SIMD and floating-point instructions.
19969 @item +crypto
19970 The cryptographic instructions.
19971 @item +nocrypto
19972 Disable the cryptographic instructions.
19973 @item +nofp
19974 Disable the floating-point, Advanced SIMD and cryptographic instructions.
19975 @end table
19977 @end table
19979 @option{-march=native} causes the compiler to auto-detect the architecture
19980 of the build computer.  At present, this feature is only supported on
19981 GNU/Linux, and not all architectures are recognized.  If the auto-detect
19982 is unsuccessful the option has no effect.
19984 @item -mtune=@var{name}
19985 @opindex mtune
19986 This option specifies the name of the target ARM processor for
19987 which GCC should tune the performance of the code.
19988 For some ARM implementations better performance can be obtained by using
19989 this option.
19990 Permissible names are: @samp{arm7tdmi}, @samp{arm7tdmi-s}, @samp{arm710t},
19991 @samp{arm720t}, @samp{arm740t}, @samp{strongarm}, @samp{strongarm110},
19992 @samp{strongarm1100}, 0@samp{strongarm1110}, @samp{arm8}, @samp{arm810},
19993 @samp{arm9}, @samp{arm9e}, @samp{arm920}, @samp{arm920t}, @samp{arm922t},
19994 @samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm926ej-s},
19995 @samp{arm940t}, @samp{arm9tdmi}, @samp{arm10tdmi}, @samp{arm1020t},
19996 @samp{arm1026ej-s}, @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
19997 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
19998 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
19999 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
20000 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
20001 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
20002 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
20003 @samp{cortex-a76}, @samp{cortex-a76ae}, @samp{cortex-a77},
20004 @samp{cortex-a78}, @samp{cortex-a78ae}, @samp{cortex-a78c},
20005 @samp{ares}, @samp{cortex-r4}, @samp{cortex-r4f},
20006 @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8}, @samp{cortex-r52},
20007 @samp{cortex-m0}, @samp{cortex-m0plus}, @samp{cortex-m1}, @samp{cortex-m3},
20008 @samp{cortex-m4}, @samp{cortex-m7}, @samp{cortex-m23}, @samp{cortex-m33},
20009 @samp{cortex-m35p}, @samp{cortex-m55}, @samp{cortex-x1},
20010 @samp{cortex-m1.small-multiply}, @samp{cortex-m0.small-multiply},
20011 @samp{cortex-m0plus.small-multiply}, @samp{exynos-m1}, @samp{marvell-pj4},
20012 @samp{neoverse-n1}, @samp{neoverse-n2}, @samp{neoverse-v1}, @samp{xscale},
20013 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}, @samp{fa526}, @samp{fa626},
20014 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}, @samp{xgene1}.
20016 Additionally, this option can specify that GCC should tune the performance
20017 of the code for a big.LITTLE system.  Permissible names are:
20018 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
20019 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
20020 @samp{cortex-a72.cortex-a35}, @samp{cortex-a73.cortex-a53},
20021 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55}.
20023 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
20024 performance for a blend of processors within architecture @var{arch}.
20025 The aim is to generate code that run well on the current most popular
20026 processors, balancing between optimizations that benefit some CPUs in the
20027 range, and avoiding performance pitfalls of other CPUs.  The effects of
20028 this option may change in future GCC versions as CPU models come and go.
20030 @option{-mtune} permits the same extension options as @option{-mcpu}, but
20031 the extension options do not affect the tuning of the generated code.
20033 @option{-mtune=native} causes the compiler to auto-detect the CPU
20034 of the build computer.  At present, this feature is only supported on
20035 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
20036 unsuccessful the option has no effect.
20038 @item -mcpu=@var{name}@r{[}+extension@dots{}@r{]}
20039 @opindex mcpu
20040 This specifies the name of the target ARM processor.  GCC uses this name
20041 to derive the name of the target ARM architecture (as if specified
20042 by @option{-march}) and the ARM processor type for which to tune for
20043 performance (as if specified by @option{-mtune}).  Where this option
20044 is used in conjunction with @option{-march} or @option{-mtune},
20045 those options take precedence over the appropriate part of this option.
20047 Many of the supported CPUs implement optional architectural
20048 extensions.  Where this is so the architectural extensions are
20049 normally enabled by default.  If implementations that lack the
20050 extension exist, then the extension syntax can be used to disable
20051 those extensions that have been omitted.  For floating-point and
20052 Advanced SIMD (Neon) instructions, the settings of the options
20053 @option{-mfloat-abi} and @option{-mfpu} must also be considered:
20054 floating-point and Advanced SIMD instructions will only be used if
20055 @option{-mfloat-abi} is not set to @samp{soft}; and any setting of
20056 @option{-mfpu} other than @samp{auto} will override the available
20057 floating-point and SIMD extension instructions.
20059 For example, @samp{cortex-a9} can be found in three major
20060 configurations: integer only, with just a floating-point unit or with
20061 floating-point and Advanced SIMD.  The default is to enable all the
20062 instructions, but the extensions @samp{+nosimd} and @samp{+nofp} can
20063 be used to disable just the SIMD or both the SIMD and floating-point
20064 instructions respectively.
20066 Permissible names for this option are the same as those for
20067 @option{-mtune}.
20069 The following extension options are common to the listed CPUs:
20071 @table @samp
20072 @item +nodsp
20073 Disable the DSP instructions on @samp{cortex-m33}, @samp{cortex-m35p}.
20075 @item  +nofp
20076 Disables the floating-point instructions on @samp{arm9e},
20077 @samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm10e},
20078 @samp{arm1020e}, @samp{arm1022e}, @samp{arm926ej-s},
20079 @samp{arm1026ej-s}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
20080 @samp{cortex-m4}, @samp{cortex-m7}, @samp{cortex-m33} and @samp{cortex-m35p}.
20081 Disables the floating-point and SIMD instructions on
20082 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7},
20083 @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a12},
20084 @samp{cortex-a15}, @samp{cortex-a17}, @samp{cortex-a15.cortex-a7},
20085 @samp{cortex-a17.cortex-a7}, @samp{cortex-a32}, @samp{cortex-a35},
20086 @samp{cortex-a53} and @samp{cortex-a55}.
20088 @item +nofp.dp
20089 Disables the double-precision component of the floating-point instructions
20090 on @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8}, @samp{cortex-r52} and
20091 @samp{cortex-m7}.
20093 @item +nosimd
20094 Disables the SIMD (but not floating-point) instructions on
20095 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}
20096 and @samp{cortex-a9}.
20098 @item +crypto
20099 Enables the cryptographic instructions on @samp{cortex-a32},
20100 @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55}, @samp{cortex-a57},
20101 @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75}, @samp{exynos-m1},
20102 @samp{xgene1}, @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
20103 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53} and
20104 @samp{cortex-a75.cortex-a55}.
20105 @end table
20107 Additionally the @samp{generic-armv7-a} pseudo target defaults to
20108 VFPv3 with 16 double-precision registers.  It supports the following
20109 extension options: @samp{mp}, @samp{sec}, @samp{vfpv3-d16},
20110 @samp{vfpv3}, @samp{vfpv3-d16-fp16}, @samp{vfpv3-fp16},
20111 @samp{vfpv4-d16}, @samp{vfpv4}, @samp{neon}, @samp{neon-vfpv3},
20112 @samp{neon-fp16}, @samp{neon-vfpv4}.  The meanings are the same as for
20113 the extensions to @option{-march=armv7-a}.
20115 @option{-mcpu=generic-@var{arch}} is also permissible, and is
20116 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
20117 See @option{-mtune} for more information.
20119 @option{-mcpu=native} causes the compiler to auto-detect the CPU
20120 of the build computer.  At present, this feature is only supported on
20121 GNU/Linux, and not all architectures are recognized.  If the auto-detect
20122 is unsuccessful the option has no effect.
20124 @item -mfpu=@var{name}
20125 @opindex mfpu
20126 This specifies what floating-point hardware (or hardware emulation) is
20127 available on the target.  Permissible names are: @samp{auto}, @samp{vfpv2},
20128 @samp{vfpv3},
20129 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
20130 @samp{vfpv3xd-fp16}, @samp{neon-vfpv3}, @samp{neon-fp16}, @samp{vfpv4},
20131 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
20132 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
20133 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
20134 Note that @samp{neon} is an alias for @samp{neon-vfpv3} and @samp{vfp}
20135 is an alias for @samp{vfpv2}.
20137 The setting @samp{auto} is the default and is special.  It causes the
20138 compiler to select the floating-point and Advanced SIMD instructions
20139 based on the settings of @option{-mcpu} and @option{-march}.
20141 If the selected floating-point hardware includes the NEON extension
20142 (e.g.@: @option{-mfpu=neon}), note that floating-point
20143 operations are not generated by GCC's auto-vectorization pass unless
20144 @option{-funsafe-math-optimizations} is also specified.  This is
20145 because NEON hardware does not fully implement the IEEE 754 standard for
20146 floating-point arithmetic (in particular denormal values are treated as
20147 zero), so the use of NEON instructions may lead to a loss of precision.
20149 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}).
20151 @item -mfp16-format=@var{name}
20152 @opindex mfp16-format
20153 Specify the format of the @code{__fp16} half-precision floating-point type.
20154 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
20155 the default is @samp{none}, in which case the @code{__fp16} type is not
20156 defined.  @xref{Half-Precision}, for more information.
20158 @item -mstructure-size-boundary=@var{n}
20159 @opindex mstructure-size-boundary
20160 The sizes of all structures and unions are rounded up to a multiple
20161 of the number of bits set by this option.  Permissible values are 8, 32
20162 and 64.  The default value varies for different toolchains.  For the COFF
20163 targeted toolchain the default value is 8.  A value of 64 is only allowed
20164 if the underlying ABI supports it.
20166 Specifying a larger number can produce faster, more efficient code, but
20167 can also increase the size of the program.  Different values are potentially
20168 incompatible.  Code compiled with one value cannot necessarily expect to
20169 work with code or libraries compiled with another value, if they exchange
20170 information using structures or unions.
20172 This option is deprecated.
20174 @item -mabort-on-noreturn
20175 @opindex mabort-on-noreturn
20176 Generate a call to the function @code{abort} at the end of a
20177 @code{noreturn} function.  It is executed if the function tries to
20178 return.
20180 @item -mlong-calls
20181 @itemx -mno-long-calls
20182 @opindex mlong-calls
20183 @opindex mno-long-calls
20184 Tells the compiler to perform function calls by first loading the
20185 address of the function into a register and then performing a subroutine
20186 call on this register.  This switch is needed if the target function
20187 lies outside of the 64-megabyte addressing range of the offset-based
20188 version of subroutine call instruction.
20190 Even if this switch is enabled, not all function calls are turned
20191 into long calls.  The heuristic is that static functions, functions
20192 that have the @code{short_call} attribute, functions that are inside
20193 the scope of a @code{#pragma no_long_calls} directive, and functions whose
20194 definitions have already been compiled within the current compilation
20195 unit are not turned into long calls.  The exceptions to this rule are
20196 that weak function definitions, functions with the @code{long_call}
20197 attribute or the @code{section} attribute, and functions that are within
20198 the scope of a @code{#pragma long_calls} directive are always
20199 turned into long calls.
20201 This feature is not enabled by default.  Specifying
20202 @option{-mno-long-calls} restores the default behavior, as does
20203 placing the function calls within the scope of a @code{#pragma
20204 long_calls_off} directive.  Note these switches have no effect on how
20205 the compiler generates code to handle function calls via function
20206 pointers.
20208 @item -msingle-pic-base
20209 @opindex msingle-pic-base
20210 Treat the register used for PIC addressing as read-only, rather than
20211 loading it in the prologue for each function.  The runtime system is
20212 responsible for initializing this register with an appropriate value
20213 before execution begins.
20215 @item -mpic-register=@var{reg}
20216 @opindex mpic-register
20217 Specify the register to be used for PIC addressing.
20218 For standard PIC base case, the default is any suitable register
20219 determined by compiler.  For single PIC base case, the default is
20220 @samp{R9} if target is EABI based or stack-checking is enabled,
20221 otherwise the default is @samp{R10}.
20223 @item -mpic-data-is-text-relative
20224 @opindex mpic-data-is-text-relative
20225 Assume that the displacement between the text and data segments is fixed
20226 at static link time.  This permits using PC-relative addressing
20227 operations to access data known to be in the data segment.  For
20228 non-VxWorks RTP targets, this option is enabled by default.  When
20229 disabled on such targets, it will enable @option{-msingle-pic-base} by
20230 default.
20232 @item -mpoke-function-name
20233 @opindex mpoke-function-name
20234 Write the name of each function into the text section, directly
20235 preceding the function prologue.  The generated code is similar to this:
20237 @smallexample
20238      t0
20239          .ascii "arm_poke_function_name", 0
20240          .align
20241      t1
20242          .word 0xff000000 + (t1 - t0)
20243      arm_poke_function_name
20244          mov     ip, sp
20245          stmfd   sp!, @{fp, ip, lr, pc@}
20246          sub     fp, ip, #4
20247 @end smallexample
20249 When performing a stack backtrace, code can inspect the value of
20250 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
20251 location @code{pc - 12} and the top 8 bits are set, then we know that
20252 there is a function name embedded immediately preceding this location
20253 and has length @code{((pc[-3]) & 0xff000000)}.
20255 @item -mthumb
20256 @itemx -marm
20257 @opindex marm
20258 @opindex mthumb
20260 Select between generating code that executes in ARM and Thumb
20261 states.  The default for most configurations is to generate code
20262 that executes in ARM state, but the default can be changed by
20263 configuring GCC with the @option{--with-mode=}@var{state}
20264 configure option.
20266 You can also override the ARM and Thumb mode for each function
20267 by using the @code{target("thumb")} and @code{target("arm")} function attributes
20268 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
20270 @item -mflip-thumb 
20271 @opindex mflip-thumb
20272 Switch ARM/Thumb modes on alternating functions.
20273 This option is provided for regression testing of mixed Thumb/ARM code
20274 generation, and is not intended for ordinary use in compiling code.
20276 @item -mtpcs-frame
20277 @opindex mtpcs-frame
20278 Generate a stack frame that is compliant with the Thumb Procedure Call
20279 Standard for all non-leaf functions.  (A leaf function is one that does
20280 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
20282 @item -mtpcs-leaf-frame
20283 @opindex mtpcs-leaf-frame
20284 Generate a stack frame that is compliant with the Thumb Procedure Call
20285 Standard for all leaf functions.  (A leaf function is one that does
20286 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
20288 @item -mcallee-super-interworking
20289 @opindex mcallee-super-interworking
20290 Gives all externally visible functions in the file being compiled an ARM
20291 instruction set header which switches to Thumb mode before executing the
20292 rest of the function.  This allows these functions to be called from
20293 non-interworking code.  This option is not valid in AAPCS configurations
20294 because interworking is enabled by default.
20296 @item -mcaller-super-interworking
20297 @opindex mcaller-super-interworking
20298 Allows calls via function pointers (including virtual functions) to
20299 execute correctly regardless of whether the target code has been
20300 compiled for interworking or not.  There is a small overhead in the cost
20301 of executing a function pointer if this option is enabled.  This option
20302 is not valid in AAPCS configurations because interworking is enabled
20303 by default.
20305 @item -mtp=@var{name}
20306 @opindex mtp
20307 Specify the access model for the thread local storage pointer.  The valid
20308 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
20309 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
20310 (supported in the arm6k architecture), and @samp{auto}, which uses the
20311 best available method for the selected processor.  The default setting is
20312 @samp{auto}.
20314 @item -mtls-dialect=@var{dialect}
20315 @opindex mtls-dialect
20316 Specify the dialect to use for accessing thread local storage.  Two
20317 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
20318 @samp{gnu} dialect selects the original GNU scheme for supporting
20319 local and global dynamic TLS models.  The @samp{gnu2} dialect
20320 selects the GNU descriptor scheme, which provides better performance
20321 for shared libraries.  The GNU descriptor scheme is compatible with
20322 the original scheme, but does require new assembler, linker and
20323 library support.  Initial and local exec TLS models are unaffected by
20324 this option and always use the original scheme.
20326 @item -mword-relocations
20327 @opindex mword-relocations
20328 Only generate absolute relocations on word-sized values (i.e.@: R_ARM_ABS32).
20329 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
20330 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
20331 is specified. This option conflicts with @option{-mslow-flash-data}.
20333 @item -mfix-cortex-m3-ldrd
20334 @opindex mfix-cortex-m3-ldrd
20335 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
20336 with overlapping destination and base registers are used.  This option avoids
20337 generating these instructions.  This option is enabled by default when
20338 @option{-mcpu=cortex-m3} is specified.
20340 @item -munaligned-access
20341 @itemx -mno-unaligned-access
20342 @opindex munaligned-access
20343 @opindex mno-unaligned-access
20344 Enables (or disables) reading and writing of 16- and 32- bit values
20345 from addresses that are not 16- or 32- bit aligned.  By default
20346 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
20347 ARMv8-M Baseline architectures, and enabled for all other
20348 architectures.  If unaligned access is not enabled then words in packed
20349 data structures are accessed a byte at a time.
20351 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
20352 generated object file to either true or false, depending upon the
20353 setting of this option.  If unaligned access is enabled then the
20354 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
20355 defined.
20357 @item -mneon-for-64bits
20358 @opindex mneon-for-64bits
20359 This option is deprecated and has no effect.
20361 @item -mslow-flash-data
20362 @opindex mslow-flash-data
20363 Assume loading data from flash is slower than fetching instruction.
20364 Therefore literal load is minimized for better performance.
20365 This option is only supported when compiling for ARMv7 M-profile and
20366 off by default. It conflicts with @option{-mword-relocations}.
20368 @item -masm-syntax-unified
20369 @opindex masm-syntax-unified
20370 Assume inline assembler is using unified asm syntax.  The default is
20371 currently off which implies divided syntax.  This option has no impact
20372 on Thumb2. However, this may change in future releases of GCC.
20373 Divided syntax should be considered deprecated.
20375 @item -mrestrict-it
20376 @opindex mrestrict-it
20377 Restricts generation of IT blocks to conform to the rules of ARMv8-A.
20378 IT blocks can only contain a single 16-bit instruction from a select
20379 set of instructions. This option is on by default for ARMv8-A Thumb mode.
20381 @item -mprint-tune-info
20382 @opindex mprint-tune-info
20383 Print CPU tuning information as comment in assembler file.  This is
20384 an option used only for regression testing of the compiler and not
20385 intended for ordinary use in compiling code.  This option is disabled
20386 by default.
20388 @item -mverbose-cost-dump
20389 @opindex mverbose-cost-dump
20390 Enable verbose cost model dumping in the debug dump files.  This option is
20391 provided for use in debugging the compiler.
20393 @item -mpure-code
20394 @opindex mpure-code
20395 Do not allow constant data to be placed in code sections.
20396 Additionally, when compiling for ELF object format give all text sections the
20397 ELF processor-specific section attribute @code{SHF_ARM_PURECODE}.  This option
20398 is only available when generating non-pic code for M-profile targets.
20400 @item -mcmse
20401 @opindex mcmse
20402 Generate secure code as per the "ARMv8-M Security Extensions: Requirements on
20403 Development Tools Engineering Specification", which can be found on
20404 @url{https://developer.arm.com/documentation/ecm0359818/latest/}.
20406 @item -mfdpic
20407 @itemx -mno-fdpic
20408 @opindex mfdpic
20409 @opindex mno-fdpic
20410 Select the FDPIC ABI, which uses 64-bit function descriptors to
20411 represent pointers to functions.  When the compiler is configured for
20412 @code{arm-*-uclinuxfdpiceabi} targets, this option is on by default
20413 and implies @option{-fPIE} if none of the PIC/PIE-related options is
20414 provided.  On other targets, it only enables the FDPIC-specific code
20415 generation features, and the user should explicitly provide the
20416 PIC/PIE-related options as needed.
20418 Note that static linking is not supported because it would still
20419 involve the dynamic linker when the program self-relocates.  If such
20420 behavior is acceptable, use -static and -Wl,-dynamic-linker options.
20422 The opposite @option{-mno-fdpic} option is useful (and required) to
20423 build the Linux kernel using the same (@code{arm-*-uclinuxfdpiceabi})
20424 toolchain as the one used to build the userland programs.
20426 @end table
20428 @node AVR Options
20429 @subsection AVR Options
20430 @cindex AVR Options
20432 These options are defined for AVR implementations:
20434 @table @gcctabopt
20435 @item -mmcu=@var{mcu}
20436 @opindex mmcu
20437 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
20439 The default for this option is@tie{}@samp{avr2}.
20441 GCC supports the following AVR devices and ISAs:
20443 @include avr-mmcu.texi
20445 @item -mabsdata
20446 @opindex mabsdata
20448 Assume that all data in static storage can be accessed by LDS / STS
20449 instructions.  This option has only an effect on reduced Tiny devices like
20450 ATtiny40.  See also the @code{absdata}
20451 @ref{AVR Variable Attributes,variable attribute}.
20453 @item -maccumulate-args
20454 @opindex maccumulate-args
20455 Accumulate outgoing function arguments and acquire/release the needed
20456 stack space for outgoing function arguments once in function
20457 prologue/epilogue.  Without this option, outgoing arguments are pushed
20458 before calling a function and popped afterwards.
20460 Popping the arguments after the function call can be expensive on
20461 AVR so that accumulating the stack space might lead to smaller
20462 executables because arguments need not be removed from the
20463 stack after such a function call.
20465 This option can lead to reduced code size for functions that perform
20466 several calls to functions that get their arguments on the stack like
20467 calls to printf-like functions.
20469 @item -mbranch-cost=@var{cost}
20470 @opindex mbranch-cost
20471 Set the branch costs for conditional branch instructions to
20472 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
20473 integers. The default branch cost is 0.
20475 @item -mcall-prologues
20476 @opindex mcall-prologues
20477 Functions prologues/epilogues are expanded as calls to appropriate
20478 subroutines.  Code size is smaller.
20480 @item -mdouble=@var{bits}
20481 @itemx -mlong-double=@var{bits}
20482 @opindex mdouble
20483 @opindex mlong-double
20484 Set the size (in bits) of the @code{double} or @code{long double} type,
20485 respectively.  Possible values for @var{bits} are 32 and 64.
20486 Whether or not a specific value for @var{bits} is allowed depends on
20487 the @code{--with-double=} and @code{--with-long-double=}
20488 @w{@uref{https://gcc.gnu.org/install/configure.html#avr,configure options}},
20489 and the same applies for the default values of the options.
20491 @item -mgas-isr-prologues
20492 @opindex mgas-isr-prologues
20493 Interrupt service routines (ISRs) may use the @code{__gcc_isr} pseudo
20494 instruction supported by GNU Binutils.
20495 If this option is on, the feature can still be disabled for individual
20496 ISRs by means of the @ref{AVR Function Attributes,,@code{no_gccisr}}
20497 function attribute.  This feature is activated per default
20498 if optimization is on (but not with @option{-Og}, @pxref{Optimize Options}),
20499 and if GNU Binutils support @w{@uref{https://sourceware.org/PR21683,PR21683}}.
20501 @item -mint8
20502 @opindex mint8
20503 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
20504 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
20505 and @code{long long} is 4 bytes.  Please note that this option does not
20506 conform to the C standards, but it results in smaller code
20507 size.
20509 @item -mmain-is-OS_task
20510 @opindex mmain-is-OS_task
20511 Do not save registers in @code{main}.  The effect is the same like
20512 attaching attribute @ref{AVR Function Attributes,,@code{OS_task}}
20513 to @code{main}. It is activated per default if optimization is on.
20515 @item -mn-flash=@var{num}
20516 @opindex mn-flash
20517 Assume that the flash memory has a size of 
20518 @var{num} times 64@tie{}KiB.
20520 @item -mno-interrupts
20521 @opindex mno-interrupts
20522 Generated code is not compatible with hardware interrupts.
20523 Code size is smaller.
20525 @item -mrelax
20526 @opindex mrelax
20527 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
20528 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
20529 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
20530 the assembler's command line and the @option{--relax} option to the
20531 linker's command line.
20533 Jump relaxing is performed by the linker because jump offsets are not
20534 known before code is located. Therefore, the assembler code generated by the
20535 compiler is the same, but the instructions in the executable may
20536 differ from instructions in the assembler code.
20538 Relaxing must be turned on if linker stubs are needed, see the
20539 section on @code{EIND} and linker stubs below.
20541 @item -mrmw
20542 @opindex mrmw
20543 Assume that the device supports the Read-Modify-Write
20544 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
20546 @item -mshort-calls
20547 @opindex mshort-calls
20549 Assume that @code{RJMP} and @code{RCALL} can target the whole
20550 program memory.
20552 This option is used internally for multilib selection.  It is
20553 not an optimization option, and you don't need to set it by hand.
20555 @item -msp8
20556 @opindex msp8
20557 Treat the stack pointer register as an 8-bit register,
20558 i.e.@: assume the high byte of the stack pointer is zero.
20559 In general, you don't need to set this option by hand.
20561 This option is used internally by the compiler to select and
20562 build multilibs for architectures @code{avr2} and @code{avr25}.
20563 These architectures mix devices with and without @code{SPH}.
20564 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
20565 the compiler driver adds or removes this option from the compiler
20566 proper's command line, because the compiler then knows if the device
20567 or architecture has an 8-bit stack pointer and thus no @code{SPH}
20568 register or not.
20570 @item -mstrict-X
20571 @opindex mstrict-X
20572 Use address register @code{X} in a way proposed by the hardware.  This means
20573 that @code{X} is only used in indirect, post-increment or
20574 pre-decrement addressing.
20576 Without this option, the @code{X} register may be used in the same way
20577 as @code{Y} or @code{Z} which then is emulated by additional
20578 instructions.  
20579 For example, loading a value with @code{X+const} addressing with a
20580 small non-negative @code{const < 64} to a register @var{Rn} is
20581 performed as
20583 @example
20584 adiw r26, const   ; X += const
20585 ld   @var{Rn}, X        ; @var{Rn} = *X
20586 sbiw r26, const   ; X -= const
20587 @end example
20589 @item -mtiny-stack
20590 @opindex mtiny-stack
20591 Only change the lower 8@tie{}bits of the stack pointer.
20593 @item -mfract-convert-truncate
20594 @opindex mfract-convert-truncate
20595 Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
20597 @item -nodevicelib
20598 @opindex nodevicelib
20599 Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
20601 @item -nodevicespecs
20602 @opindex nodevicespecs
20603 Don't add @option{-specs=device-specs/specs-@var{mcu}} to the compiler driver's
20604 command line.  The user takes responsibility for supplying the sub-processes
20605 like compiler proper, assembler and linker with appropriate command line
20606 options.  This means that the user has to supply her private device specs
20607 file by means of @option{-specs=@var{path-to-specs-file}}.  There is no
20608 more need for option @option{-mmcu=@var{mcu}}.
20610 This option can also serve as a replacement for the older way of
20611 specifying custom device-specs files that needed @option{-B @var{some-path}} to point to a directory
20612 which contains a folder named @code{device-specs} which contains a specs file named
20613 @code{specs-@var{mcu}}, where @var{mcu} was specified by @option{-mmcu=@var{mcu}}.
20615 @item -Waddr-space-convert
20616 @opindex Waddr-space-convert
20617 @opindex Wno-addr-space-convert
20618 Warn about conversions between address spaces in the case where the
20619 resulting address space is not contained in the incoming address space.
20621 @item -Wmisspelled-isr
20622 @opindex Wmisspelled-isr
20623 @opindex Wno-misspelled-isr
20624 Warn if the ISR is misspelled, i.e.@: without __vector prefix.
20625 Enabled by default.
20626 @end table
20628 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
20629 @cindex @code{EIND}
20630 Pointers in the implementation are 16@tie{}bits wide.
20631 The address of a function or label is represented as word address so
20632 that indirect jumps and calls can target any code address in the
20633 range of 64@tie{}Ki words.
20635 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
20636 bytes of program memory space, there is a special function register called
20637 @code{EIND} that serves as most significant part of the target address
20638 when @code{EICALL} or @code{EIJMP} instructions are used.
20640 Indirect jumps and calls on these devices are handled as follows by
20641 the compiler and are subject to some limitations:
20643 @itemize @bullet
20645 @item
20646 The compiler never sets @code{EIND}.
20648 @item
20649 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
20650 instructions or might read @code{EIND} directly in order to emulate an
20651 indirect call/jump by means of a @code{RET} instruction.
20653 @item
20654 The compiler assumes that @code{EIND} never changes during the startup
20655 code or during the application. In particular, @code{EIND} is not
20656 saved/restored in function or interrupt service routine
20657 prologue/epilogue.
20659 @item
20660 For indirect calls to functions and computed goto, the linker
20661 generates @emph{stubs}. Stubs are jump pads sometimes also called
20662 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
20663 The stub contains a direct jump to the desired address.
20665 @item
20666 Linker relaxation must be turned on so that the linker generates
20667 the stubs correctly in all situations. See the compiler option
20668 @option{-mrelax} and the linker option @option{--relax}.
20669 There are corner cases where the linker is supposed to generate stubs
20670 but aborts without relaxation and without a helpful error message.
20672 @item
20673 The default linker script is arranged for code with @code{EIND = 0}.
20674 If code is supposed to work for a setup with @code{EIND != 0}, a custom
20675 linker script has to be used in order to place the sections whose
20676 name start with @code{.trampolines} into the segment where @code{EIND}
20677 points to.
20679 @item
20680 The startup code from libgcc never sets @code{EIND}.
20681 Notice that startup code is a blend of code from libgcc and AVR-LibC.
20682 For the impact of AVR-LibC on @code{EIND}, see the
20683 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
20685 @item
20686 It is legitimate for user-specific startup code to set up @code{EIND}
20687 early, for example by means of initialization code located in
20688 section @code{.init3}. Such code runs prior to general startup code
20689 that initializes RAM and calls constructors, but after the bit
20690 of startup code from AVR-LibC that sets @code{EIND} to the segment
20691 where the vector table is located.
20692 @example
20693 #include <avr/io.h>
20695 static void
20696 __attribute__((section(".init3"),naked,used,no_instrument_function))
20697 init3_set_eind (void)
20699   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
20700                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
20702 @end example
20704 @noindent
20705 The @code{__trampolines_start} symbol is defined in the linker script.
20707 @item
20708 Stubs are generated automatically by the linker if
20709 the following two conditions are met:
20710 @itemize @minus
20712 @item The address of a label is taken by means of the @code{gs} modifier
20713 (short for @emph{generate stubs}) like so:
20714 @example
20715 LDI r24, lo8(gs(@var{func}))
20716 LDI r25, hi8(gs(@var{func}))
20717 @end example
20718 @item The final location of that label is in a code segment
20719 @emph{outside} the segment where the stubs are located.
20720 @end itemize
20722 @item
20723 The compiler emits such @code{gs} modifiers for code labels in the
20724 following situations:
20725 @itemize @minus
20726 @item Taking address of a function or code label.
20727 @item Computed goto.
20728 @item If prologue-save function is used, see @option{-mcall-prologues}
20729 command-line option.
20730 @item Switch/case dispatch tables. If you do not want such dispatch
20731 tables you can specify the @option{-fno-jump-tables} command-line option.
20732 @item C and C++ constructors/destructors called during startup/shutdown.
20733 @item If the tools hit a @code{gs()} modifier explained above.
20734 @end itemize
20736 @item
20737 Jumping to non-symbolic addresses like so is @emph{not} supported:
20739 @example
20740 int main (void)
20742     /* Call function at word address 0x2 */
20743     return ((int(*)(void)) 0x2)();
20745 @end example
20747 Instead, a stub has to be set up, i.e.@: the function has to be called
20748 through a symbol (@code{func_4} in the example):
20750 @example
20751 int main (void)
20753     extern int func_4 (void);
20755     /* Call function at byte address 0x4 */
20756     return func_4();
20758 @end example
20760 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
20761 Alternatively, @code{func_4} can be defined in the linker script.
20762 @end itemize
20764 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
20765 @cindex @code{RAMPD}
20766 @cindex @code{RAMPX}
20767 @cindex @code{RAMPY}
20768 @cindex @code{RAMPZ}
20769 Some AVR devices support memories larger than the 64@tie{}KiB range
20770 that can be accessed with 16-bit pointers.  To access memory locations
20771 outside this 64@tie{}KiB range, the content of a @code{RAMP}
20772 register is used as high part of the address:
20773 The @code{X}, @code{Y}, @code{Z} address register is concatenated
20774 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
20775 register, respectively, to get a wide address. Similarly,
20776 @code{RAMPD} is used together with direct addressing.
20778 @itemize
20779 @item
20780 The startup code initializes the @code{RAMP} special function
20781 registers with zero.
20783 @item
20784 If a @ref{AVR Named Address Spaces,named address space} other than
20785 generic or @code{__flash} is used, then @code{RAMPZ} is set
20786 as needed before the operation.
20788 @item
20789 If the device supports RAM larger than 64@tie{}KiB and the compiler
20790 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
20791 is reset to zero after the operation.
20793 @item
20794 If the device comes with a specific @code{RAMP} register, the ISR
20795 prologue/epilogue saves/restores that SFR and initializes it with
20796 zero in case the ISR code might (implicitly) use it.
20798 @item
20799 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
20800 If you use inline assembler to read from locations outside the
20801 16-bit address range and change one of the @code{RAMP} registers,
20802 you must reset it to zero after the access.
20804 @end itemize
20806 @subsubsection AVR Built-in Macros
20808 GCC defines several built-in macros so that the user code can test
20809 for the presence or absence of features.  Almost any of the following
20810 built-in macros are deduced from device capabilities and thus
20811 triggered by the @option{-mmcu=} command-line option.
20813 For even more AVR-specific built-in macros see
20814 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
20816 @table @code
20818 @item __AVR_ARCH__
20819 Build-in macro that resolves to a decimal number that identifies the
20820 architecture and depends on the @option{-mmcu=@var{mcu}} option.
20821 Possible values are:
20823 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
20824 @code{4}, @code{5}, @code{51}, @code{6}
20826 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
20827 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
20829 respectively and
20831 @code{100},
20832 @code{102}, @code{103}, @code{104},
20833 @code{105}, @code{106}, @code{107}
20835 for @var{mcu}=@code{avrtiny},
20836 @code{avrxmega2}, @code{avrxmega3}, @code{avrxmega4},
20837 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
20838 If @var{mcu} specifies a device, this built-in macro is set
20839 accordingly. For example, with @option{-mmcu=atmega8} the macro is
20840 defined to @code{4}.
20842 @item __AVR_@var{Device}__
20843 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
20844 the device's name. For example, @option{-mmcu=atmega8} defines the
20845 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
20846 @code{__AVR_ATtiny261A__}, etc.
20848 The built-in macros' names follow
20849 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
20850 the device name as from the AVR user manual. The difference between
20851 @var{Device} in the built-in macro and @var{device} in
20852 @option{-mmcu=@var{device}} is that the latter is always lowercase.
20854 If @var{device} is not a device but only a core architecture like
20855 @samp{avr51}, this macro is not defined.
20857 @item __AVR_DEVICE_NAME__
20858 Setting @option{-mmcu=@var{device}} defines this built-in macro to
20859 the device's name. For example, with @option{-mmcu=atmega8} the macro
20860 is defined to @code{atmega8}.
20862 If @var{device} is not a device but only a core architecture like
20863 @samp{avr51}, this macro is not defined.
20865 @item __AVR_XMEGA__
20866 The device / architecture belongs to the XMEGA family of devices.
20868 @item __AVR_HAVE_ELPM__
20869 The device has the @code{ELPM} instruction.
20871 @item __AVR_HAVE_ELPMX__
20872 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
20873 R@var{n},Z+} instructions.
20875 @item __AVR_HAVE_MOVW__
20876 The device has the @code{MOVW} instruction to perform 16-bit
20877 register-register moves.
20879 @item __AVR_HAVE_LPMX__
20880 The device has the @code{LPM R@var{n},Z} and
20881 @code{LPM R@var{n},Z+} instructions.
20883 @item __AVR_HAVE_MUL__
20884 The device has a hardware multiplier. 
20886 @item __AVR_HAVE_JMP_CALL__
20887 The device has the @code{JMP} and @code{CALL} instructions.
20888 This is the case for devices with more than 8@tie{}KiB of program
20889 memory.
20891 @item __AVR_HAVE_EIJMP_EICALL__
20892 @itemx __AVR_3_BYTE_PC__
20893 The device has the @code{EIJMP} and @code{EICALL} instructions.
20894 This is the case for devices with more than 128@tie{}KiB of program memory.
20895 This also means that the program counter
20896 (PC) is 3@tie{}bytes wide.
20898 @item __AVR_2_BYTE_PC__
20899 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
20900 with up to 128@tie{}KiB of program memory.
20902 @item __AVR_HAVE_8BIT_SP__
20903 @itemx __AVR_HAVE_16BIT_SP__
20904 The stack pointer (SP) register is treated as 8-bit respectively
20905 16-bit register by the compiler.
20906 The definition of these macros is affected by @option{-mtiny-stack}.
20908 @item __AVR_HAVE_SPH__
20909 @itemx __AVR_SP8__
20910 The device has the SPH (high part of stack pointer) special function
20911 register or has an 8-bit stack pointer, respectively.
20912 The definition of these macros is affected by @option{-mmcu=} and
20913 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
20914 by @option{-msp8}.
20916 @item __AVR_HAVE_RAMPD__
20917 @itemx __AVR_HAVE_RAMPX__
20918 @itemx __AVR_HAVE_RAMPY__
20919 @itemx __AVR_HAVE_RAMPZ__
20920 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
20921 @code{RAMPZ} special function register, respectively.
20923 @item __NO_INTERRUPTS__
20924 This macro reflects the @option{-mno-interrupts} command-line option.
20926 @item __AVR_ERRATA_SKIP__
20927 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
20928 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
20929 instructions because of a hardware erratum.  Skip instructions are
20930 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
20931 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
20932 set.
20934 @item __AVR_ISA_RMW__
20935 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
20937 @item __AVR_SFR_OFFSET__=@var{offset}
20938 Instructions that can address I/O special function registers directly
20939 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
20940 address as if addressed by an instruction to access RAM like @code{LD}
20941 or @code{STS}. This offset depends on the device architecture and has
20942 to be subtracted from the RAM address in order to get the
20943 respective I/O@tie{}address.
20945 @item __AVR_SHORT_CALLS__
20946 The @option{-mshort-calls} command line option is set.
20948 @item __AVR_PM_BASE_ADDRESS__=@var{addr}
20949 Some devices support reading from flash memory by means of @code{LD*}
20950 instructions.  The flash memory is seen in the data address space
20951 at an offset of @code{__AVR_PM_BASE_ADDRESS__}.  If this macro
20952 is not defined, this feature is not available.  If defined,
20953 the address space is linear and there is no need to put
20954 @code{.rodata} into RAM.  This is handled by the default linker
20955 description file, and is currently available for
20956 @code{avrtiny} and @code{avrxmega3}.  Even more convenient,
20957 there is no need to use address spaces like @code{__flash} or
20958 features like attribute @code{progmem} and @code{pgm_read_*}.
20960 @item __WITH_AVRLIBC__
20961 The compiler is configured to be used together with AVR-Libc.
20962 See the @option{--with-avrlibc} configure option.
20964 @item __HAVE_DOUBLE_MULTILIB__
20965 Defined if @option{-mdouble=} acts as a multilib option.
20967 @item __HAVE_DOUBLE32__
20968 @itemx __HAVE_DOUBLE64__
20969 Defined if the compiler supports 32-bit double resp. 64-bit double.
20970 The actual layout is specified by option @option{-mdouble=}.
20972 @item __DEFAULT_DOUBLE__
20973 The size in bits of @code{double} if @option{-mdouble=} is not set.
20974 To test the layout of @code{double} in a program, use the built-in
20975 macro @code{__SIZEOF_DOUBLE__}.
20977 @item __HAVE_LONG_DOUBLE32__
20978 @itemx __HAVE_LONG_DOUBLE64__
20979 @itemx __HAVE_LONG_DOUBLE_MULTILIB__
20980 @itemx __DEFAULT_LONG_DOUBLE__
20981 Same as above, but for @code{long double} instead of @code{double}.
20983 @item __WITH_DOUBLE_COMPARISON__
20984 Reflects the @code{--with-double-comparison=@{tristate|bool|libf7@}}
20985 @w{@uref{https://gcc.gnu.org/install/configure.html#avr,configure option}}
20986 and is defined to @code{2} or @code{3}.
20988 @item __WITH_LIBF7_LIBGCC__
20989 @itemx __WITH_LIBF7_MATH__
20990 @itemx __WITH_LIBF7_MATH_SYMBOLS__
20991 Reflects the @code{--with-libf7=@{libgcc|math|math-symbols@}}
20992 @w{@uref{https://gcc.gnu.org/install/configure.html#avr,configure option}}.
20994 @end table
20996 @node Blackfin Options
20997 @subsection Blackfin Options
20998 @cindex Blackfin Options
21000 @table @gcctabopt
21001 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
21002 @opindex mcpu=
21003 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
21004 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
21005 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
21006 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
21007 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
21008 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
21009 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
21010 @samp{bf561}, @samp{bf592}.
21012 The optional @var{sirevision} specifies the silicon revision of the target
21013 Blackfin processor.  Any workarounds available for the targeted silicon revision
21014 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
21015 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
21016 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
21017 hexadecimal digits representing the major and minor numbers in the silicon
21018 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
21019 is not defined.  If @var{sirevision} is @samp{any}, the
21020 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
21021 If this optional @var{sirevision} is not used, GCC assumes the latest known
21022 silicon revision of the targeted Blackfin processor.
21024 GCC defines a preprocessor macro for the specified @var{cpu}.
21025 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
21026 provided by libgloss to be linked in if @option{-msim} is not given.
21028 Without this option, @samp{bf532} is used as the processor by default.
21030 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
21031 only the preprocessor macro is defined.
21033 @item -msim
21034 @opindex msim
21035 Specifies that the program will be run on the simulator.  This causes
21036 the simulator BSP provided by libgloss to be linked in.  This option
21037 has effect only for @samp{bfin-elf} toolchain.
21038 Certain other options, such as @option{-mid-shared-library} and
21039 @option{-mfdpic}, imply @option{-msim}.
21041 @item -momit-leaf-frame-pointer
21042 @opindex momit-leaf-frame-pointer
21043 Don't keep the frame pointer in a register for leaf functions.  This
21044 avoids the instructions to save, set up and restore frame pointers and
21045 makes an extra register available in leaf functions.
21047 @item -mspecld-anomaly
21048 @opindex mspecld-anomaly
21049 When enabled, the compiler ensures that the generated code does not
21050 contain speculative loads after jump instructions. If this option is used,
21051 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
21053 @item -mno-specld-anomaly
21054 @opindex mno-specld-anomaly
21055 @opindex mspecld-anomaly
21056 Don't generate extra code to prevent speculative loads from occurring.
21058 @item -mcsync-anomaly
21059 @opindex mcsync-anomaly
21060 When enabled, the compiler ensures that the generated code does not
21061 contain CSYNC or SSYNC instructions too soon after conditional branches.
21062 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
21064 @item -mno-csync-anomaly
21065 @opindex mno-csync-anomaly
21066 @opindex mcsync-anomaly
21067 Don't generate extra code to prevent CSYNC or SSYNC instructions from
21068 occurring too soon after a conditional branch.
21070 @item -mlow64k
21071 @opindex mlow64k
21072 When enabled, the compiler is free to take advantage of the knowledge that
21073 the entire program fits into the low 64k of memory.
21075 @item -mno-low64k
21076 @opindex mno-low64k
21077 Assume that the program is arbitrarily large.  This is the default.
21079 @item -mstack-check-l1
21080 @opindex mstack-check-l1
21081 Do stack checking using information placed into L1 scratchpad memory by the
21082 uClinux kernel.
21084 @item -mid-shared-library
21085 @opindex mid-shared-library
21086 Generate code that supports shared libraries via the library ID method.
21087 This allows for execute in place and shared libraries in an environment
21088 without virtual memory management.  This option implies @option{-fPIC}.
21089 With a @samp{bfin-elf} target, this option implies @option{-msim}.
21091 @item -mno-id-shared-library
21092 @opindex mno-id-shared-library
21093 @opindex mid-shared-library
21094 Generate code that doesn't assume ID-based shared libraries are being used.
21095 This is the default.
21097 @item -mleaf-id-shared-library
21098 @opindex mleaf-id-shared-library
21099 Generate code that supports shared libraries via the library ID method,
21100 but assumes that this library or executable won't link against any other
21101 ID shared libraries.  That allows the compiler to use faster code for jumps
21102 and calls.
21104 @item -mno-leaf-id-shared-library
21105 @opindex mno-leaf-id-shared-library
21106 @opindex mleaf-id-shared-library
21107 Do not assume that the code being compiled won't link against any ID shared
21108 libraries.  Slower code is generated for jump and call insns.
21110 @item -mshared-library-id=n
21111 @opindex mshared-library-id
21112 Specifies the identification number of the ID-based shared library being
21113 compiled.  Specifying a value of 0 generates more compact code; specifying
21114 other values forces the allocation of that number to the current
21115 library but is no more space- or time-efficient than omitting this option.
21117 @item -msep-data
21118 @opindex msep-data
21119 Generate code that allows the data segment to be located in a different
21120 area of memory from the text segment.  This allows for execute in place in
21121 an environment without virtual memory management by eliminating relocations
21122 against the text section.
21124 @item -mno-sep-data
21125 @opindex mno-sep-data
21126 @opindex msep-data
21127 Generate code that assumes that the data segment follows the text segment.
21128 This is the default.
21130 @item -mlong-calls
21131 @itemx -mno-long-calls
21132 @opindex mlong-calls
21133 @opindex mno-long-calls
21134 Tells the compiler to perform function calls by first loading the
21135 address of the function into a register and then performing a subroutine
21136 call on this register.  This switch is needed if the target function
21137 lies outside of the 24-bit addressing range of the offset-based
21138 version of subroutine call instruction.
21140 This feature is not enabled by default.  Specifying
21141 @option{-mno-long-calls} restores the default behavior.  Note these
21142 switches have no effect on how the compiler generates code to handle
21143 function calls via function pointers.
21145 @item -mfast-fp
21146 @opindex mfast-fp
21147 Link with the fast floating-point library. This library relaxes some of
21148 the IEEE floating-point standard's rules for checking inputs against
21149 Not-a-Number (NAN), in the interest of performance.
21151 @item -minline-plt
21152 @opindex minline-plt
21153 Enable inlining of PLT entries in function calls to functions that are
21154 not known to bind locally.  It has no effect without @option{-mfdpic}.
21156 @item -mmulticore
21157 @opindex mmulticore
21158 Build a standalone application for multicore Blackfin processors. 
21159 This option causes proper start files and link scripts supporting 
21160 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
21161 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
21163 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
21164 selects the one-application-per-core programming model.  Without
21165 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
21166 programming model is used. In this model, the main function of Core B
21167 should be named as @code{coreb_main}.
21169 If this option is not used, the single-core application programming
21170 model is used.
21172 @item -mcorea
21173 @opindex mcorea
21174 Build a standalone application for Core A of BF561 when using
21175 the one-application-per-core programming model. Proper start files
21176 and link scripts are used to support Core A, and the macro
21177 @code{__BFIN_COREA} is defined.
21178 This option can only be used in conjunction with @option{-mmulticore}.
21180 @item -mcoreb
21181 @opindex mcoreb
21182 Build a standalone application for Core B of BF561 when using
21183 the one-application-per-core programming model. Proper start files
21184 and link scripts are used to support Core B, and the macro
21185 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
21186 should be used instead of @code{main}. 
21187 This option can only be used in conjunction with @option{-mmulticore}.
21189 @item -msdram
21190 @opindex msdram
21191 Build a standalone application for SDRAM. Proper start files and
21192 link scripts are used to put the application into SDRAM, and the macro
21193 @code{__BFIN_SDRAM} is defined.
21194 The loader should initialize SDRAM before loading the application.
21196 @item -micplb
21197 @opindex micplb
21198 Assume that ICPLBs are enabled at run time.  This has an effect on certain
21199 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
21200 are enabled; for standalone applications the default is off.
21201 @end table
21203 @node C6X Options
21204 @subsection C6X Options
21205 @cindex C6X Options
21207 @table @gcctabopt
21208 @item -march=@var{name}
21209 @opindex march
21210 This specifies the name of the target architecture.  GCC uses this
21211 name to determine what kind of instructions it can emit when generating
21212 assembly code.  Permissible names are: @samp{c62x},
21213 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
21215 @item -mbig-endian
21216 @opindex mbig-endian
21217 Generate code for a big-endian target.
21219 @item -mlittle-endian
21220 @opindex mlittle-endian
21221 Generate code for a little-endian target.  This is the default.
21223 @item -msim
21224 @opindex msim
21225 Choose startup files and linker script suitable for the simulator.
21227 @item -msdata=default
21228 @opindex msdata=default
21229 Put small global and static data in the @code{.neardata} section,
21230 which is pointed to by register @code{B14}.  Put small uninitialized
21231 global and static data in the @code{.bss} section, which is adjacent
21232 to the @code{.neardata} section.  Put small read-only data into the
21233 @code{.rodata} section.  The corresponding sections used for large
21234 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
21236 @item -msdata=all
21237 @opindex msdata=all
21238 Put all data, not just small objects, into the sections reserved for
21239 small data, and use addressing relative to the @code{B14} register to
21240 access them.
21242 @item -msdata=none
21243 @opindex msdata=none
21244 Make no use of the sections reserved for small data, and use absolute
21245 addresses to access all data.  Put all initialized global and static
21246 data in the @code{.fardata} section, and all uninitialized data in the
21247 @code{.far} section.  Put all constant data into the @code{.const}
21248 section.
21249 @end table
21251 @node CRIS Options
21252 @subsection CRIS Options
21253 @cindex CRIS Options
21255 These options are defined specifically for the CRIS ports.
21257 @table @gcctabopt
21258 @item -march=@var{architecture-type}
21259 @itemx -mcpu=@var{architecture-type}
21260 @opindex march
21261 @opindex mcpu
21262 Generate code for the specified architecture.  The choices for
21263 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
21264 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
21265 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
21266 @samp{v10}.
21268 @item -mtune=@var{architecture-type}
21269 @opindex mtune
21270 Tune to @var{architecture-type} everything applicable about the generated
21271 code, except for the ABI and the set of available instructions.  The
21272 choices for @var{architecture-type} are the same as for
21273 @option{-march=@var{architecture-type}}.
21275 @item -mmax-stack-frame=@var{n}
21276 @opindex mmax-stack-frame
21277 Warn when the stack frame of a function exceeds @var{n} bytes.
21279 @item -metrax4
21280 @itemx -metrax100
21281 @opindex metrax4
21282 @opindex metrax100
21283 The options @option{-metrax4} and @option{-metrax100} are synonyms for
21284 @option{-march=v3} and @option{-march=v8} respectively.
21286 @item -mmul-bug-workaround
21287 @itemx -mno-mul-bug-workaround
21288 @opindex mmul-bug-workaround
21289 @opindex mno-mul-bug-workaround
21290 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
21291 models where it applies.  This option is active by default.
21293 @item -mpdebug
21294 @opindex mpdebug
21295 Enable CRIS-specific verbose debug-related information in the assembly
21296 code.  This option also has the effect of turning off the @samp{#NO_APP}
21297 formatted-code indicator to the assembler at the beginning of the
21298 assembly file.
21300 @item -mcc-init
21301 @opindex mcc-init
21302 Do not use condition-code results from previous instruction; always emit
21303 compare and test instructions before use of condition codes.
21305 @item -mno-side-effects
21306 @opindex mno-side-effects
21307 @opindex mside-effects
21308 Do not emit instructions with side effects in addressing modes other than
21309 post-increment.
21311 @item -mstack-align
21312 @itemx -mno-stack-align
21313 @itemx -mdata-align
21314 @itemx -mno-data-align
21315 @itemx -mconst-align
21316 @itemx -mno-const-align
21317 @opindex mstack-align
21318 @opindex mno-stack-align
21319 @opindex mdata-align
21320 @opindex mno-data-align
21321 @opindex mconst-align
21322 @opindex mno-const-align
21323 These options (@samp{no-} options) arrange (eliminate arrangements) for the
21324 stack frame, individual data and constants to be aligned for the maximum
21325 single data access size for the chosen CPU model.  The default is to
21326 arrange for 32-bit alignment.  ABI details such as structure layout are
21327 not affected by these options.
21329 @item -m32-bit
21330 @itemx -m16-bit
21331 @itemx -m8-bit
21332 @opindex m32-bit
21333 @opindex m16-bit
21334 @opindex m8-bit
21335 Similar to the stack- data- and const-align options above, these options
21336 arrange for stack frame, writable data and constants to all be 32-bit,
21337 16-bit or 8-bit aligned.  The default is 32-bit alignment.
21339 @item -mno-prologue-epilogue
21340 @itemx -mprologue-epilogue
21341 @opindex mno-prologue-epilogue
21342 @opindex mprologue-epilogue
21343 With @option{-mno-prologue-epilogue}, the normal function prologue and
21344 epilogue which set up the stack frame are omitted and no return
21345 instructions or return sequences are generated in the code.  Use this
21346 option only together with visual inspection of the compiled code: no
21347 warnings or errors are generated when call-saved registers must be saved,
21348 or storage for local variables needs to be allocated.
21350 @item -mno-gotplt
21351 @itemx -mgotplt
21352 @opindex mno-gotplt
21353 @opindex mgotplt
21354 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
21355 instruction sequences that load addresses for functions from the PLT part
21356 of the GOT rather than (traditional on other architectures) calls to the
21357 PLT@.  The default is @option{-mgotplt}.
21359 @item -melf
21360 @opindex melf
21361 Legacy no-op option only recognized with the cris-axis-elf and
21362 cris-axis-linux-gnu targets.
21364 @item -mlinux
21365 @opindex mlinux
21366 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
21368 @item -sim
21369 @opindex sim
21370 This option, recognized for the cris-axis-elf, arranges
21371 to link with input-output functions from a simulator library.  Code,
21372 initialized data and zero-initialized data are allocated consecutively.
21374 @item -sim2
21375 @opindex sim2
21376 Like @option{-sim}, but pass linker options to locate initialized data at
21377 0x40000000 and zero-initialized data at 0x80000000.
21378 @end table
21380 @node CR16 Options
21381 @subsection CR16 Options
21382 @cindex CR16 Options
21384 These options are defined specifically for the CR16 ports.
21386 @table @gcctabopt
21388 @item -mmac
21389 @opindex mmac
21390 Enable the use of multiply-accumulate instructions. Disabled by default.
21392 @item -mcr16cplus
21393 @itemx -mcr16c
21394 @opindex mcr16cplus
21395 @opindex mcr16c
21396 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
21397 is default.
21399 @item -msim
21400 @opindex msim
21401 Links the library libsim.a which is in compatible with simulator. Applicable
21402 to ELF compiler only.
21404 @item -mint32
21405 @opindex mint32
21406 Choose integer type as 32-bit wide.
21408 @item -mbit-ops
21409 @opindex mbit-ops
21410 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
21412 @item -mdata-model=@var{model}
21413 @opindex mdata-model
21414 Choose a data model. The choices for @var{model} are @samp{near},
21415 @samp{far} or @samp{medium}. @samp{medium} is default.
21416 However, @samp{far} is not valid with @option{-mcr16c}, as the
21417 CR16C architecture does not support the far data model.
21418 @end table
21420 @node C-SKY Options
21421 @subsection C-SKY Options
21422 @cindex C-SKY Options
21424 GCC supports these options when compiling for C-SKY V2 processors.
21426 @table @gcctabopt
21428 @item -march=@var{arch}
21429 @opindex march=
21430 Specify the C-SKY target architecture.  Valid values for @var{arch} are:
21431 @samp{ck801}, @samp{ck802}, @samp{ck803}, @samp{ck807}, and @samp{ck810}.
21432 The default is @samp{ck810}.
21434 @item -mcpu=@var{cpu}
21435 @opindex mcpu=
21436 Specify the C-SKY target processor.  Valid values for @var{cpu} are:
21437 @samp{ck801}, @samp{ck801t},
21438 @samp{ck802}, @samp{ck802t}, @samp{ck802j},
21439 @samp{ck803}, @samp{ck803h}, @samp{ck803t}, @samp{ck803ht},
21440 @samp{ck803f}, @samp{ck803fh}, @samp{ck803e}, @samp{ck803eh},
21441 @samp{ck803et}, @samp{ck803eht}, @samp{ck803ef}, @samp{ck803efh},
21442 @samp{ck803ft}, @samp{ck803eft}, @samp{ck803efht}, @samp{ck803r1},
21443 @samp{ck803hr1}, @samp{ck803tr1}, @samp{ck803htr1}, @samp{ck803fr1},
21444 @samp{ck803fhr1}, @samp{ck803er1}, @samp{ck803ehr1}, @samp{ck803etr1},
21445 @samp{ck803ehtr1}, @samp{ck803efr1}, @samp{ck803efhr1}, @samp{ck803ftr1},
21446 @samp{ck803eftr1}, @samp{ck803efhtr1},
21447 @samp{ck803s}, @samp{ck803st}, @samp{ck803se}, @samp{ck803sf},
21448 @samp{ck803sef}, @samp{ck803seft},
21449 @samp{ck807e}, @samp{ck807ef}, @samp{ck807}, @samp{ck807f},
21450 @samp{ck810e}, @samp{ck810et}, @samp{ck810ef}, @samp{ck810eft},
21451 @samp{ck810}, @samp{ck810v}, @samp{ck810f}, @samp{ck810t}, @samp{ck810fv},
21452 @samp{ck810tv}, @samp{ck810ft}, and @samp{ck810ftv}.
21454 @item -mbig-endian
21455 @opindex mbig-endian
21456 @itemx -EB
21457 @opindex EB
21458 @itemx -mlittle-endian
21459 @opindex mlittle-endian
21460 @itemx -EL
21461 @opindex EL
21463 Select big- or little-endian code.  The default is little-endian.
21465 @item -mfloat-abi=@var{name}
21466 @opindex mfloat-abi
21467 Specifies which floating-point ABI to use.  Permissible values
21468 are: @samp{soft}, @samp{softfp} and @samp{hard}.
21470 Specifying @samp{soft} causes GCC to generate output containing
21471 library calls for floating-point operations.
21472 @samp{softfp} allows the generation of code using hardware floating-point
21473 instructions, but still uses the soft-float calling conventions.
21474 @samp{hard} allows generation of floating-point instructions
21475 and uses FPU-specific calling conventions.
21477 The default depends on the specific target configuration.  Note that
21478 the hard-float and soft-float ABIs are not link-compatible; you must
21479 compile your entire program with the same ABI, and link with a
21480 compatible set of libraries.
21482 @item -mhard-float
21483 @opindex mhard-float
21484 @itemx -msoft-float
21485 @opindex msoft-float
21487 Select hardware or software floating-point implementations.
21488 The default is soft float.
21490 @item -mdouble-float
21491 @itemx -mno-double-float
21492 @opindex mdouble-float
21493 When @option{-mhard-float} is in effect, enable generation of
21494 double-precision float instructions.  This is the default except
21495 when compiling for CK803.
21497 @item -mfdivdu
21498 @itemx -mno-fdivdu
21499 @opindex mfdivdu
21500 When @option{-mhard-float} is in effect, enable generation of
21501 @code{frecipd}, @code{fsqrtd}, and @code{fdivd} instructions.
21502 This is the default except when compiling for CK803.
21504 @item -mfpu=@var{fpu}
21505 @opindex mfpu=
21506 Select the floating-point processor.  This option can only be used with
21507 @option{-mhard-float}.
21508 Values for @var{fpu} are
21509 @samp{fpv2_sf} (equivalent to @samp{-mno-double-float -mno-fdivdu}),
21510 @samp{fpv2} (@samp{-mdouble-float -mno-divdu}), and
21511 @samp{fpv2_divd} (@samp{-mdouble-float -mdivdu}).
21513 @item -melrw
21514 @itemx -mno-elrw
21515 @opindex melrw
21516 Enable the extended @code{lrw} instruction.  This option defaults to on
21517 for CK801 and off otherwise.
21519 @item -mistack
21520 @itemx -mno-istack
21521 @opindex mistack
21522 Enable interrupt stack instructions; the default is off.
21524 The @option{-mistack} option is required to handle the
21525 @code{interrupt} and @code{isr} function attributes
21526 (@pxref{C-SKY Function Attributes}).
21528 @item -mmp
21529 @opindex mmp
21530 Enable multiprocessor instructions; the default is off.
21532 @item -mcp
21533 @opindex mcp
21534 Enable coprocessor instructions; the default is off.
21536 @item -mcache
21537 @opindex mcache
21538 Enable coprocessor instructions; the default is off.
21540 @item -msecurity
21541 @opindex msecurity
21542 Enable C-SKY security instructions; the default is off.
21544 @item -mtrust
21545 @opindex mtrust
21546 Enable C-SKY trust instructions; the default is off.
21548 @item -mdsp
21549 @opindex mdsp
21550 @itemx -medsp
21551 @opindex medsp
21552 @itemx -mvdsp
21553 @opindex mvdsp
21554 Enable C-SKY DSP, Enhanced DSP, or Vector DSP instructions, respectively.
21555 All of these options default to off.
21557 @item -mdiv
21558 @itemx -mno-div
21559 @opindex mdiv
21560 Generate divide instructions.  Default is off.
21562 @item -msmart
21563 @itemx -mno-smart
21564 @opindex msmart
21565 Generate code for Smart Mode, using only registers numbered 0-7 to allow
21566 use of 16-bit instructions.  This option is ignored for CK801 where this
21567 is the required behavior, and it defaults to on for CK802.
21568 For other targets, the default is off.
21570 @item -mhigh-registers
21571 @itemx -mno-high-registers
21572 @opindex mhigh-registers
21573 Generate code using the high registers numbered 16-31.  This option
21574 is not supported on CK801, CK802, or CK803, and is enabled by default
21575 for other processors.
21577 @item -manchor
21578 @itemx -mno-anchor
21579 @opindex manchor
21580 Generate code using global anchor symbol addresses.
21582 @item -mpushpop
21583 @itemx -mno-pushpop
21584 @opindex mpushpop
21585 Generate code using @code{push} and @code{pop} instructions.  This option
21586 defaults to on.
21588 @item -mmultiple-stld
21589 @itemx -mstm
21590 @itemx -mno-multiple-stld
21591 @itemx -mno-stm
21592 @opindex mmultiple-stld
21593 Generate code using @code{stm} and @code{ldm} instructions.  This option
21594 isn't supported on CK801 but is enabled by default on other processors.
21596 @item -mconstpool
21597 @itemx -mno-constpool
21598 @opindex mconstpool
21599 Create constant pools in the compiler instead of deferring it to the
21600 assembler.  This option is the default and required for correct code
21601 generation on CK801 and CK802, and is optional on other processors.
21603 @item -mstack-size
21604 @item -mno-stack-size
21605 @opindex mstack-size
21606 Emit @code{.stack_size} directives for each function in the assembly
21607 output.  This option defaults to off.
21609 @item -mccrt
21610 @itemx -mno-ccrt
21611 @opindex mccrt
21612 Generate code for the C-SKY compiler runtime instead of libgcc.  This
21613 option defaults to off.
21615 @item -mbranch-cost=@var{n}
21616 @opindex mbranch-cost=
21617 Set the branch costs to roughly @code{n} instructions.  The default is 1.
21619 @item -msched-prolog
21620 @itemx -mno-sched-prolog
21621 @opindex msched-prolog
21622 Permit scheduling of function prologue and epilogue sequences.  Using
21623 this option can result in code that is not compliant with the C-SKY V2 ABI
21624 prologue requirements and that cannot be debugged or backtraced.
21625 It is disabled by default.
21627 @item -msim
21628 @opindex msim
21629 Links the library libsemi.a which is in compatible with simulator. Applicable
21630 to ELF compiler only.
21632 @end table
21634 @node Darwin Options
21635 @subsection Darwin Options
21636 @cindex Darwin options
21638 These options are defined for all architectures running the Darwin operating
21639 system.
21641 FSF GCC on Darwin does not create ``fat'' object files; it creates
21642 an object file for the single architecture that GCC was built to
21643 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
21644 @option{-arch} options are used; it does so by running the compiler or
21645 linker multiple times and joining the results together with
21646 @file{lipo}.
21648 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
21649 @samp{i686}) is determined by the flags that specify the ISA
21650 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
21651 @option{-force_cpusubtype_ALL} option can be used to override this.
21653 The Darwin tools vary in their behavior when presented with an ISA
21654 mismatch.  The assembler, @file{as}, only permits instructions to
21655 be used that are valid for the subtype of the file it is generating,
21656 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
21657 The linker for shared libraries, @file{/usr/bin/libtool}, fails
21658 and prints an error if asked to create a shared library with a less
21659 restrictive subtype than its input files (for instance, trying to put
21660 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
21661 for executables, @command{ld}, quietly gives the executable the most
21662 restrictive subtype of any of its input files.
21664 @table @gcctabopt
21665 @item -F@var{dir}
21666 @opindex F
21667 Add the framework directory @var{dir} to the head of the list of
21668 directories to be searched for header files.  These directories are
21669 interleaved with those specified by @option{-I} options and are
21670 scanned in a left-to-right order.
21672 A framework directory is a directory with frameworks in it.  A
21673 framework is a directory with a @file{Headers} and/or
21674 @file{PrivateHeaders} directory contained directly in it that ends
21675 in @file{.framework}.  The name of a framework is the name of this
21676 directory excluding the @file{.framework}.  Headers associated with
21677 the framework are found in one of those two directories, with
21678 @file{Headers} being searched first.  A subframework is a framework
21679 directory that is in a framework's @file{Frameworks} directory.
21680 Includes of subframework headers can only appear in a header of a
21681 framework that contains the subframework, or in a sibling subframework
21682 header.  Two subframeworks are siblings if they occur in the same
21683 framework.  A subframework should not have the same name as a
21684 framework; a warning is issued if this is violated.  Currently a
21685 subframework cannot have subframeworks; in the future, the mechanism
21686 may be extended to support this.  The standard frameworks can be found
21687 in @file{/System/Library/Frameworks} and
21688 @file{/Library/Frameworks}.  An example include looks like
21689 @code{#include <Framework/header.h>}, where @file{Framework} denotes
21690 the name of the framework and @file{header.h} is found in the
21691 @file{PrivateHeaders} or @file{Headers} directory.
21693 @item -iframework@var{dir}
21694 @opindex iframework
21695 Like @option{-F} except the directory is a treated as a system
21696 directory.  The main difference between this @option{-iframework} and
21697 @option{-F} is that with @option{-iframework} the compiler does not
21698 warn about constructs contained within header files found via
21699 @var{dir}.  This option is valid only for the C family of languages.
21701 @item -gused
21702 @opindex gused
21703 Emit debugging information for symbols that are used.  For stabs
21704 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
21705 This is by default ON@.
21707 @item -gfull
21708 @opindex gfull
21709 Emit debugging information for all symbols and types.
21711 @item -mmacosx-version-min=@var{version}
21712 The earliest version of MacOS X that this executable will run on
21713 is @var{version}.  Typical values of @var{version} include @code{10.1},
21714 @code{10.2}, and @code{10.3.9}.
21716 If the compiler was built to use the system's headers by default,
21717 then the default for this option is the system version on which the
21718 compiler is running, otherwise the default is to make choices that
21719 are compatible with as many systems and code bases as possible.
21721 @item -mkernel
21722 @opindex mkernel
21723 Enable kernel development mode.  The @option{-mkernel} option sets
21724 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
21725 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
21726 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
21727 applicable.  This mode also sets @option{-mno-altivec},
21728 @option{-msoft-float}, @option{-fno-builtin} and
21729 @option{-mlong-branch} for PowerPC targets.
21731 @item -mone-byte-bool
21732 @opindex mone-byte-bool
21733 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
21734 By default @code{sizeof(bool)} is @code{4} when compiling for
21735 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
21736 option has no effect on x86.
21738 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
21739 to generate code that is not binary compatible with code generated
21740 without that switch.  Using this switch may require recompiling all
21741 other modules in a program, including system libraries.  Use this
21742 switch to conform to a non-default data model.
21744 @item -mfix-and-continue
21745 @itemx -ffix-and-continue
21746 @itemx -findirect-data
21747 @opindex mfix-and-continue
21748 @opindex ffix-and-continue
21749 @opindex findirect-data
21750 Generate code suitable for fast turnaround development, such as to
21751 allow GDB to dynamically load @file{.o} files into already-running
21752 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
21753 are provided for backwards compatibility.
21755 @item -all_load
21756 @opindex all_load
21757 Loads all members of static archive libraries.
21758 See man ld(1) for more information.
21760 @item -arch_errors_fatal
21761 @opindex arch_errors_fatal
21762 Cause the errors having to do with files that have the wrong architecture
21763 to be fatal.
21765 @item -bind_at_load
21766 @opindex bind_at_load
21767 Causes the output file to be marked such that the dynamic linker will
21768 bind all undefined references when the file is loaded or launched.
21770 @item -bundle
21771 @opindex bundle
21772 Produce a Mach-o bundle format file.
21773 See man ld(1) for more information.
21775 @item -bundle_loader @var{executable}
21776 @opindex bundle_loader
21777 This option specifies the @var{executable} that will load the build
21778 output file being linked.  See man ld(1) for more information.
21780 @item -dynamiclib
21781 @opindex dynamiclib
21782 When passed this option, GCC produces a dynamic library instead of
21783 an executable when linking, using the Darwin @file{libtool} command.
21785 @item -force_cpusubtype_ALL
21786 @opindex force_cpusubtype_ALL
21787 This causes GCC's output file to have the @samp{ALL} subtype, instead of
21788 one controlled by the @option{-mcpu} or @option{-march} option.
21790 @item -allowable_client  @var{client_name}
21791 @itemx -client_name
21792 @itemx -compatibility_version
21793 @itemx -current_version
21794 @itemx -dead_strip
21795 @itemx -dependency-file
21796 @itemx -dylib_file
21797 @itemx -dylinker_install_name
21798 @itemx -dynamic
21799 @itemx -exported_symbols_list
21800 @itemx -filelist
21801 @need 800
21802 @itemx -flat_namespace
21803 @itemx -force_flat_namespace
21804 @itemx -headerpad_max_install_names
21805 @itemx -image_base
21806 @itemx -init
21807 @itemx -install_name
21808 @itemx -keep_private_externs
21809 @itemx -multi_module
21810 @itemx -multiply_defined
21811 @itemx -multiply_defined_unused
21812 @need 800
21813 @itemx -noall_load
21814 @itemx -no_dead_strip_inits_and_terms
21815 @itemx -nofixprebinding
21816 @itemx -nomultidefs
21817 @itemx -noprebind
21818 @itemx -noseglinkedit
21819 @itemx -pagezero_size
21820 @itemx -prebind
21821 @itemx -prebind_all_twolevel_modules
21822 @itemx -private_bundle
21823 @need 800
21824 @itemx -read_only_relocs
21825 @itemx -sectalign
21826 @itemx -sectobjectsymbols
21827 @itemx -whyload
21828 @itemx -seg1addr
21829 @itemx -sectcreate
21830 @itemx -sectobjectsymbols
21831 @itemx -sectorder
21832 @itemx -segaddr
21833 @itemx -segs_read_only_addr
21834 @need 800
21835 @itemx -segs_read_write_addr
21836 @itemx -seg_addr_table
21837 @itemx -seg_addr_table_filename
21838 @itemx -seglinkedit
21839 @itemx -segprot
21840 @itemx -segs_read_only_addr
21841 @itemx -segs_read_write_addr
21842 @itemx -single_module
21843 @itemx -static
21844 @itemx -sub_library
21845 @need 800
21846 @itemx -sub_umbrella
21847 @itemx -twolevel_namespace
21848 @itemx -umbrella
21849 @itemx -undefined
21850 @itemx -unexported_symbols_list
21851 @itemx -weak_reference_mismatches
21852 @itemx -whatsloaded
21853 @opindex allowable_client
21854 @opindex client_name
21855 @opindex compatibility_version
21856 @opindex current_version
21857 @opindex dead_strip
21858 @opindex dependency-file
21859 @opindex dylib_file
21860 @opindex dylinker_install_name
21861 @opindex dynamic
21862 @opindex exported_symbols_list
21863 @opindex filelist
21864 @opindex flat_namespace
21865 @opindex force_flat_namespace
21866 @opindex headerpad_max_install_names
21867 @opindex image_base
21868 @opindex init
21869 @opindex install_name
21870 @opindex keep_private_externs
21871 @opindex multi_module
21872 @opindex multiply_defined
21873 @opindex multiply_defined_unused
21874 @opindex noall_load
21875 @opindex no_dead_strip_inits_and_terms
21876 @opindex nofixprebinding
21877 @opindex nomultidefs
21878 @opindex noprebind
21879 @opindex noseglinkedit
21880 @opindex pagezero_size
21881 @opindex prebind
21882 @opindex prebind_all_twolevel_modules
21883 @opindex private_bundle
21884 @opindex read_only_relocs
21885 @opindex sectalign
21886 @opindex sectobjectsymbols
21887 @opindex whyload
21888 @opindex seg1addr
21889 @opindex sectcreate
21890 @opindex sectobjectsymbols
21891 @opindex sectorder
21892 @opindex segaddr
21893 @opindex segs_read_only_addr
21894 @opindex segs_read_write_addr
21895 @opindex seg_addr_table
21896 @opindex seg_addr_table_filename
21897 @opindex seglinkedit
21898 @opindex segprot
21899 @opindex segs_read_only_addr
21900 @opindex segs_read_write_addr
21901 @opindex single_module
21902 @opindex static
21903 @opindex sub_library
21904 @opindex sub_umbrella
21905 @opindex twolevel_namespace
21906 @opindex umbrella
21907 @opindex undefined
21908 @opindex unexported_symbols_list
21909 @opindex weak_reference_mismatches
21910 @opindex whatsloaded
21911 These options are passed to the Darwin linker.  The Darwin linker man page
21912 describes them in detail.
21913 @end table
21915 @node DEC Alpha Options
21916 @subsection DEC Alpha Options
21918 These @samp{-m} options are defined for the DEC Alpha implementations:
21920 @table @gcctabopt
21921 @item -mno-soft-float
21922 @itemx -msoft-float
21923 @opindex mno-soft-float
21924 @opindex msoft-float
21925 Use (do not use) the hardware floating-point instructions for
21926 floating-point operations.  When @option{-msoft-float} is specified,
21927 functions in @file{libgcc.a} are used to perform floating-point
21928 operations.  Unless they are replaced by routines that emulate the
21929 floating-point operations, or compiled in such a way as to call such
21930 emulations routines, these routines issue floating-point
21931 operations.   If you are compiling for an Alpha without floating-point
21932 operations, you must ensure that the library is built so as not to call
21933 them.
21935 Note that Alpha implementations without floating-point operations are
21936 required to have floating-point registers.
21938 @item -mfp-reg
21939 @itemx -mno-fp-regs
21940 @opindex mfp-reg
21941 @opindex mno-fp-regs
21942 Generate code that uses (does not use) the floating-point register set.
21943 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
21944 register set is not used, floating-point operands are passed in integer
21945 registers as if they were integers and floating-point results are passed
21946 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
21947 so any function with a floating-point argument or return value called by code
21948 compiled with @option{-mno-fp-regs} must also be compiled with that
21949 option.
21951 A typical use of this option is building a kernel that does not use,
21952 and hence need not save and restore, any floating-point registers.
21954 @item -mieee
21955 @opindex mieee
21956 The Alpha architecture implements floating-point hardware optimized for
21957 maximum performance.  It is mostly compliant with the IEEE floating-point
21958 standard.  However, for full compliance, software assistance is
21959 required.  This option generates code fully IEEE-compliant code
21960 @emph{except} that the @var{inexact-flag} is not maintained (see below).
21961 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
21962 defined during compilation.  The resulting code is less efficient but is
21963 able to correctly support denormalized numbers and exceptional IEEE
21964 values such as not-a-number and plus/minus infinity.  Other Alpha
21965 compilers call this option @option{-ieee_with_no_inexact}.
21967 @item -mieee-with-inexact
21968 @opindex mieee-with-inexact
21969 This is like @option{-mieee} except the generated code also maintains
21970 the IEEE @var{inexact-flag}.  Turning on this option causes the
21971 generated code to implement fully-compliant IEEE math.  In addition to
21972 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
21973 macro.  On some Alpha implementations the resulting code may execute
21974 significantly slower than the code generated by default.  Since there is
21975 very little code that depends on the @var{inexact-flag}, you should
21976 normally not specify this option.  Other Alpha compilers call this
21977 option @option{-ieee_with_inexact}.
21979 @item -mfp-trap-mode=@var{trap-mode}
21980 @opindex mfp-trap-mode
21981 This option controls what floating-point related traps are enabled.
21982 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
21983 The trap mode can be set to one of four values:
21985 @table @samp
21986 @item n
21987 This is the default (normal) setting.  The only traps that are enabled
21988 are the ones that cannot be disabled in software (e.g., division by zero
21989 trap).
21991 @item u
21992 In addition to the traps enabled by @samp{n}, underflow traps are enabled
21993 as well.
21995 @item su
21996 Like @samp{u}, but the instructions are marked to be safe for software
21997 completion (see Alpha architecture manual for details).
21999 @item sui
22000 Like @samp{su}, but inexact traps are enabled as well.
22001 @end table
22003 @item -mfp-rounding-mode=@var{rounding-mode}
22004 @opindex mfp-rounding-mode
22005 Selects the IEEE rounding mode.  Other Alpha compilers call this option
22006 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
22009 @table @samp
22010 @item n
22011 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
22012 the nearest machine number or towards the even machine number in case
22013 of a tie.
22015 @item m
22016 Round towards minus infinity.
22018 @item c
22019 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
22021 @item d
22022 Dynamic rounding mode.  A field in the floating-point control register
22023 (@var{fpcr}, see Alpha architecture reference manual) controls the
22024 rounding mode in effect.  The C library initializes this register for
22025 rounding towards plus infinity.  Thus, unless your program modifies the
22026 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
22027 @end table
22029 @item -mtrap-precision=@var{trap-precision}
22030 @opindex mtrap-precision
22031 In the Alpha architecture, floating-point traps are imprecise.  This
22032 means without software assistance it is impossible to recover from a
22033 floating trap and program execution normally needs to be terminated.
22034 GCC can generate code that can assist operating system trap handlers
22035 in determining the exact location that caused a floating-point trap.
22036 Depending on the requirements of an application, different levels of
22037 precisions can be selected:
22039 @table @samp
22040 @item p
22041 Program precision.  This option is the default and means a trap handler
22042 can only identify which program caused a floating-point exception.
22044 @item f
22045 Function precision.  The trap handler can determine the function that
22046 caused a floating-point exception.
22048 @item i
22049 Instruction precision.  The trap handler can determine the exact
22050 instruction that caused a floating-point exception.
22051 @end table
22053 Other Alpha compilers provide the equivalent options called
22054 @option{-scope_safe} and @option{-resumption_safe}.
22056 @item -mieee-conformant
22057 @opindex mieee-conformant
22058 This option marks the generated code as IEEE conformant.  You must not
22059 use this option unless you also specify @option{-mtrap-precision=i} and either
22060 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
22061 is to emit the line @samp{.eflag 48} in the function prologue of the
22062 generated assembly file.
22064 @item -mbuild-constants
22065 @opindex mbuild-constants
22066 Normally GCC examines a 32- or 64-bit integer constant to
22067 see if it can construct it from smaller constants in two or three
22068 instructions.  If it cannot, it outputs the constant as a literal and
22069 generates code to load it from the data segment at run time.
22071 Use this option to require GCC to construct @emph{all} integer constants
22072 using code, even if it takes more instructions (the maximum is six).
22074 You typically use this option to build a shared library dynamic
22075 loader.  Itself a shared library, it must relocate itself in memory
22076 before it can find the variables and constants in its own data segment.
22078 @item -mbwx
22079 @itemx -mno-bwx
22080 @itemx -mcix
22081 @itemx -mno-cix
22082 @itemx -mfix
22083 @itemx -mno-fix
22084 @itemx -mmax
22085 @itemx -mno-max
22086 @opindex mbwx
22087 @opindex mno-bwx
22088 @opindex mcix
22089 @opindex mno-cix
22090 @opindex mfix
22091 @opindex mno-fix
22092 @opindex mmax
22093 @opindex mno-max
22094 Indicate whether GCC should generate code to use the optional BWX,
22095 CIX, FIX and MAX instruction sets.  The default is to use the instruction
22096 sets supported by the CPU type specified via @option{-mcpu=} option or that
22097 of the CPU on which GCC was built if none is specified.
22099 @item -mfloat-vax
22100 @itemx -mfloat-ieee
22101 @opindex mfloat-vax
22102 @opindex mfloat-ieee
22103 Generate code that uses (does not use) VAX F and G floating-point
22104 arithmetic instead of IEEE single and double precision.
22106 @item -mexplicit-relocs
22107 @itemx -mno-explicit-relocs
22108 @opindex mexplicit-relocs
22109 @opindex mno-explicit-relocs
22110 Older Alpha assemblers provided no way to generate symbol relocations
22111 except via assembler macros.  Use of these macros does not allow
22112 optimal instruction scheduling.  GNU binutils as of version 2.12
22113 supports a new syntax that allows the compiler to explicitly mark
22114 which relocations should apply to which instructions.  This option
22115 is mostly useful for debugging, as GCC detects the capabilities of
22116 the assembler when it is built and sets the default accordingly.
22118 @item -msmall-data
22119 @itemx -mlarge-data
22120 @opindex msmall-data
22121 @opindex mlarge-data
22122 When @option{-mexplicit-relocs} is in effect, static data is
22123 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
22124 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
22125 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
22126 16-bit relocations off of the @code{$gp} register.  This limits the
22127 size of the small data area to 64KB, but allows the variables to be
22128 directly accessed via a single instruction.
22130 The default is @option{-mlarge-data}.  With this option the data area
22131 is limited to just below 2GB@.  Programs that require more than 2GB of
22132 data must use @code{malloc} or @code{mmap} to allocate the data in the
22133 heap instead of in the program's data segment.
22135 When generating code for shared libraries, @option{-fpic} implies
22136 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
22138 @item -msmall-text
22139 @itemx -mlarge-text
22140 @opindex msmall-text
22141 @opindex mlarge-text
22142 When @option{-msmall-text} is used, the compiler assumes that the
22143 code of the entire program (or shared library) fits in 4MB, and is
22144 thus reachable with a branch instruction.  When @option{-msmall-data}
22145 is used, the compiler can assume that all local symbols share the
22146 same @code{$gp} value, and thus reduce the number of instructions
22147 required for a function call from 4 to 1.
22149 The default is @option{-mlarge-text}.
22151 @item -mcpu=@var{cpu_type}
22152 @opindex mcpu
22153 Set the instruction set and instruction scheduling parameters for
22154 machine type @var{cpu_type}.  You can specify either the @samp{EV}
22155 style name or the corresponding chip number.  GCC supports scheduling
22156 parameters for the EV4, EV5 and EV6 family of processors and
22157 chooses the default values for the instruction set from the processor
22158 you specify.  If you do not specify a processor type, GCC defaults
22159 to the processor on which the compiler was built.
22161 Supported values for @var{cpu_type} are
22163 @table @samp
22164 @item ev4
22165 @itemx ev45
22166 @itemx 21064
22167 Schedules as an EV4 and has no instruction set extensions.
22169 @item ev5
22170 @itemx 21164
22171 Schedules as an EV5 and has no instruction set extensions.
22173 @item ev56
22174 @itemx 21164a
22175 Schedules as an EV5 and supports the BWX extension.
22177 @item pca56
22178 @itemx 21164pc
22179 @itemx 21164PC
22180 Schedules as an EV5 and supports the BWX and MAX extensions.
22182 @item ev6
22183 @itemx 21264
22184 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
22186 @item ev67
22187 @itemx 21264a
22188 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
22189 @end table
22191 Native toolchains also support the value @samp{native},
22192 which selects the best architecture option for the host processor.
22193 @option{-mcpu=native} has no effect if GCC does not recognize
22194 the processor.
22196 @item -mtune=@var{cpu_type}
22197 @opindex mtune
22198 Set only the instruction scheduling parameters for machine type
22199 @var{cpu_type}.  The instruction set is not changed.
22201 Native toolchains also support the value @samp{native},
22202 which selects the best architecture option for the host processor.
22203 @option{-mtune=native} has no effect if GCC does not recognize
22204 the processor.
22206 @item -mmemory-latency=@var{time}
22207 @opindex mmemory-latency
22208 Sets the latency the scheduler should assume for typical memory
22209 references as seen by the application.  This number is highly
22210 dependent on the memory access patterns used by the application
22211 and the size of the external cache on the machine.
22213 Valid options for @var{time} are
22215 @table @samp
22216 @item @var{number}
22217 A decimal number representing clock cycles.
22219 @item L1
22220 @itemx L2
22221 @itemx L3
22222 @itemx main
22223 The compiler contains estimates of the number of clock cycles for
22224 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
22225 (also called Dcache, Scache, and Bcache), as well as to main memory.
22226 Note that L3 is only valid for EV5.
22228 @end table
22229 @end table
22231 @node eBPF Options
22232 @subsection eBPF Options
22233 @cindex eBPF Options
22235 @table @gcctabopt
22236 @item -mframe-limit=@var{bytes}
22237 This specifies the hard limit for frame sizes, in bytes.  Currently,
22238 the value that can be specified should be less than or equal to
22239 @samp{32767}.  Defaults to whatever limit is imposed by the version of
22240 the Linux kernel targeted.
22242 @item -mkernel=@var{version}
22243 @opindex mkernel
22244 This specifies the minimum version of the kernel that will run the
22245 compiled program.  GCC uses this version to determine which
22246 instructions to use, what kernel helpers to allow, etc.  Currently,
22247 @var{version} can be one of @samp{4.0}, @samp{4.1}, @samp{4.2},
22248 @samp{4.3}, @samp{4.4}, @samp{4.5}, @samp{4.6}, @samp{4.7},
22249 @samp{4.8}, @samp{4.9}, @samp{4.10}, @samp{4.11}, @samp{4.12},
22250 @samp{4.13}, @samp{4.14}, @samp{4.15}, @samp{4.16}, @samp{4.17},
22251 @samp{4.18}, @samp{4.19}, @samp{4.20}, @samp{5.0}, @samp{5.1},
22252 @samp{5.2}, @samp{latest} and @samp{native}.
22254 @item -mbig-endian
22255 @opindex mbig-endian
22256 Generate code for a big-endian target.
22258 @item -mlittle-endian
22259 @opindex mlittle-endian
22260 Generate code for a little-endian target.  This is the default.
22262 @item -mxbpf
22263 Generate code for an expanded version of BPF, which relaxes some of
22264 the restrictions imposed by the BPF architecture:
22265 @itemize @minus
22266 @item Save and restore callee-saved registers at function entry and
22267 exit, respectively.
22268 @end itemize
22269 @end table
22271 @node FR30 Options
22272 @subsection FR30 Options
22273 @cindex FR30 Options
22275 These options are defined specifically for the FR30 port.
22277 @table @gcctabopt
22279 @item -msmall-model
22280 @opindex msmall-model
22281 Use the small address space model.  This can produce smaller code, but
22282 it does assume that all symbolic values and addresses fit into a
22283 20-bit range.
22285 @item -mno-lsim
22286 @opindex mno-lsim
22287 Assume that runtime support has been provided and so there is no need
22288 to include the simulator library (@file{libsim.a}) on the linker
22289 command line.
22291 @end table
22293 @node FT32 Options
22294 @subsection FT32 Options
22295 @cindex FT32 Options
22297 These options are defined specifically for the FT32 port.
22299 @table @gcctabopt
22301 @item -msim
22302 @opindex msim
22303 Specifies that the program will be run on the simulator.  This causes
22304 an alternate runtime startup and library to be linked.
22305 You must not use this option when generating programs that will run on
22306 real hardware; you must provide your own runtime library for whatever
22307 I/O functions are needed.
22309 @item -mlra
22310 @opindex mlra
22311 Enable Local Register Allocation.  This is still experimental for FT32,
22312 so by default the compiler uses standard reload.
22314 @item -mnodiv
22315 @opindex mnodiv
22316 Do not use div and mod instructions.
22318 @item -mft32b
22319 @opindex mft32b
22320 Enable use of the extended instructions of the FT32B processor.
22322 @item -mcompress
22323 @opindex mcompress
22324 Compress all code using the Ft32B code compression scheme.
22326 @item -mnopm
22327 @opindex  mnopm
22328 Do not generate code that reads program memory.
22330 @end table
22332 @node FRV Options
22333 @subsection FRV Options
22334 @cindex FRV Options
22336 @table @gcctabopt
22337 @item -mgpr-32
22338 @opindex mgpr-32
22340 Only use the first 32 general-purpose registers.
22342 @item -mgpr-64
22343 @opindex mgpr-64
22345 Use all 64 general-purpose registers.
22347 @item -mfpr-32
22348 @opindex mfpr-32
22350 Use only the first 32 floating-point registers.
22352 @item -mfpr-64
22353 @opindex mfpr-64
22355 Use all 64 floating-point registers.
22357 @item -mhard-float
22358 @opindex mhard-float
22360 Use hardware instructions for floating-point operations.
22362 @item -msoft-float
22363 @opindex msoft-float
22365 Use library routines for floating-point operations.
22367 @item -malloc-cc
22368 @opindex malloc-cc
22370 Dynamically allocate condition code registers.
22372 @item -mfixed-cc
22373 @opindex mfixed-cc
22375 Do not try to dynamically allocate condition code registers, only
22376 use @code{icc0} and @code{fcc0}.
22378 @item -mdword
22379 @opindex mdword
22381 Change ABI to use double word insns.
22383 @item -mno-dword
22384 @opindex mno-dword
22385 @opindex mdword
22387 Do not use double word instructions.
22389 @item -mdouble
22390 @opindex mdouble
22392 Use floating-point double instructions.
22394 @item -mno-double
22395 @opindex mno-double
22397 Do not use floating-point double instructions.
22399 @item -mmedia
22400 @opindex mmedia
22402 Use media instructions.
22404 @item -mno-media
22405 @opindex mno-media
22407 Do not use media instructions.
22409 @item -mmuladd
22410 @opindex mmuladd
22412 Use multiply and add/subtract instructions.
22414 @item -mno-muladd
22415 @opindex mno-muladd
22417 Do not use multiply and add/subtract instructions.
22419 @item -mfdpic
22420 @opindex mfdpic
22422 Select the FDPIC ABI, which uses function descriptors to represent
22423 pointers to functions.  Without any PIC/PIE-related options, it
22424 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
22425 assumes GOT entries and small data are within a 12-bit range from the
22426 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
22427 are computed with 32 bits.
22428 With a @samp{bfin-elf} target, this option implies @option{-msim}.
22430 @item -minline-plt
22431 @opindex minline-plt
22433 Enable inlining of PLT entries in function calls to functions that are
22434 not known to bind locally.  It has no effect without @option{-mfdpic}.
22435 It's enabled by default if optimizing for speed and compiling for
22436 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
22437 optimization option such as @option{-O3} or above is present in the
22438 command line.
22440 @item -mTLS
22441 @opindex mTLS
22443 Assume a large TLS segment when generating thread-local code.
22445 @item -mtls
22446 @opindex mtls
22448 Do not assume a large TLS segment when generating thread-local code.
22450 @item -mgprel-ro
22451 @opindex mgprel-ro
22453 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
22454 that is known to be in read-only sections.  It's enabled by default,
22455 except for @option{-fpic} or @option{-fpie}: even though it may help
22456 make the global offset table smaller, it trades 1 instruction for 4.
22457 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
22458 one of which may be shared by multiple symbols, and it avoids the need
22459 for a GOT entry for the referenced symbol, so it's more likely to be a
22460 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
22462 @item -multilib-library-pic
22463 @opindex multilib-library-pic
22465 Link with the (library, not FD) pic libraries.  It's implied by
22466 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
22467 @option{-fpic} without @option{-mfdpic}.  You should never have to use
22468 it explicitly.
22470 @item -mlinked-fp
22471 @opindex mlinked-fp
22473 Follow the EABI requirement of always creating a frame pointer whenever
22474 a stack frame is allocated.  This option is enabled by default and can
22475 be disabled with @option{-mno-linked-fp}.
22477 @item -mlong-calls
22478 @opindex mlong-calls
22480 Use indirect addressing to call functions outside the current
22481 compilation unit.  This allows the functions to be placed anywhere
22482 within the 32-bit address space.
22484 @item -malign-labels
22485 @opindex malign-labels
22487 Try to align labels to an 8-byte boundary by inserting NOPs into the
22488 previous packet.  This option only has an effect when VLIW packing
22489 is enabled.  It doesn't create new packets; it merely adds NOPs to
22490 existing ones.
22492 @item -mlibrary-pic
22493 @opindex mlibrary-pic
22495 Generate position-independent EABI code.
22497 @item -macc-4
22498 @opindex macc-4
22500 Use only the first four media accumulator registers.
22502 @item -macc-8
22503 @opindex macc-8
22505 Use all eight media accumulator registers.
22507 @item -mpack
22508 @opindex mpack
22510 Pack VLIW instructions.
22512 @item -mno-pack
22513 @opindex mno-pack
22515 Do not pack VLIW instructions.
22517 @item -mno-eflags
22518 @opindex mno-eflags
22520 Do not mark ABI switches in e_flags.
22522 @item -mcond-move
22523 @opindex mcond-move
22525 Enable the use of conditional-move instructions (default).
22527 This switch is mainly for debugging the compiler and will likely be removed
22528 in a future version.
22530 @item -mno-cond-move
22531 @opindex mno-cond-move
22533 Disable the use of conditional-move instructions.
22535 This switch is mainly for debugging the compiler and will likely be removed
22536 in a future version.
22538 @item -mscc
22539 @opindex mscc
22541 Enable the use of conditional set instructions (default).
22543 This switch is mainly for debugging the compiler and will likely be removed
22544 in a future version.
22546 @item -mno-scc
22547 @opindex mno-scc
22549 Disable the use of conditional set instructions.
22551 This switch is mainly for debugging the compiler and will likely be removed
22552 in a future version.
22554 @item -mcond-exec
22555 @opindex mcond-exec
22557 Enable the use of conditional execution (default).
22559 This switch is mainly for debugging the compiler and will likely be removed
22560 in a future version.
22562 @item -mno-cond-exec
22563 @opindex mno-cond-exec
22565 Disable the use of conditional execution.
22567 This switch is mainly for debugging the compiler and will likely be removed
22568 in a future version.
22570 @item -mvliw-branch
22571 @opindex mvliw-branch
22573 Run a pass to pack branches into VLIW instructions (default).
22575 This switch is mainly for debugging the compiler and will likely be removed
22576 in a future version.
22578 @item -mno-vliw-branch
22579 @opindex mno-vliw-branch
22581 Do not run a pass to pack branches into VLIW instructions.
22583 This switch is mainly for debugging the compiler and will likely be removed
22584 in a future version.
22586 @item -mmulti-cond-exec
22587 @opindex mmulti-cond-exec
22589 Enable optimization of @code{&&} and @code{||} in conditional execution
22590 (default).
22592 This switch is mainly for debugging the compiler and will likely be removed
22593 in a future version.
22595 @item -mno-multi-cond-exec
22596 @opindex mno-multi-cond-exec
22598 Disable optimization of @code{&&} and @code{||} in conditional execution.
22600 This switch is mainly for debugging the compiler and will likely be removed
22601 in a future version.
22603 @item -mnested-cond-exec
22604 @opindex mnested-cond-exec
22606 Enable nested conditional execution optimizations (default).
22608 This switch is mainly for debugging the compiler and will likely be removed
22609 in a future version.
22611 @item -mno-nested-cond-exec
22612 @opindex mno-nested-cond-exec
22614 Disable nested conditional execution optimizations.
22616 This switch is mainly for debugging the compiler and will likely be removed
22617 in a future version.
22619 @item -moptimize-membar
22620 @opindex moptimize-membar
22622 This switch removes redundant @code{membar} instructions from the
22623 compiler-generated code.  It is enabled by default.
22625 @item -mno-optimize-membar
22626 @opindex mno-optimize-membar
22627 @opindex moptimize-membar
22629 This switch disables the automatic removal of redundant @code{membar}
22630 instructions from the generated code.
22632 @item -mtomcat-stats
22633 @opindex mtomcat-stats
22635 Cause gas to print out tomcat statistics.
22637 @item -mcpu=@var{cpu}
22638 @opindex mcpu
22640 Select the processor type for which to generate code.  Possible values are
22641 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
22642 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
22644 @end table
22646 @node GNU/Linux Options
22647 @subsection GNU/Linux Options
22649 These @samp{-m} options are defined for GNU/Linux targets:
22651 @table @gcctabopt
22652 @item -mglibc
22653 @opindex mglibc
22654 Use the GNU C library.  This is the default except
22655 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
22656 @samp{*-*-linux-*android*} targets.
22658 @item -muclibc
22659 @opindex muclibc
22660 Use uClibc C library.  This is the default on
22661 @samp{*-*-linux-*uclibc*} targets.
22663 @item -mmusl
22664 @opindex mmusl
22665 Use the musl C library.  This is the default on
22666 @samp{*-*-linux-*musl*} targets.
22668 @item -mbionic
22669 @opindex mbionic
22670 Use Bionic C library.  This is the default on
22671 @samp{*-*-linux-*android*} targets.
22673 @item -mandroid
22674 @opindex mandroid
22675 Compile code compatible with Android platform.  This is the default on
22676 @samp{*-*-linux-*android*} targets.
22678 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
22679 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
22680 this option makes the GCC driver pass Android-specific options to the linker.
22681 Finally, this option causes the preprocessor macro @code{__ANDROID__}
22682 to be defined.
22684 @item -tno-android-cc
22685 @opindex tno-android-cc
22686 Disable compilation effects of @option{-mandroid}, i.e., do not enable
22687 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
22688 @option{-fno-rtti} by default.
22690 @item -tno-android-ld
22691 @opindex tno-android-ld
22692 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
22693 linking options to the linker.
22695 @end table
22697 @node H8/300 Options
22698 @subsection H8/300 Options
22700 These @samp{-m} options are defined for the H8/300 implementations:
22702 @table @gcctabopt
22703 @item -mrelax
22704 @opindex mrelax
22705 Shorten some address references at link time, when possible; uses the
22706 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
22707 ld, Using ld}, for a fuller description.
22709 @item -mh
22710 @opindex mh
22711 Generate code for the H8/300H@.
22713 @item -ms
22714 @opindex ms
22715 Generate code for the H8S@.
22717 @item -mn
22718 @opindex mn
22719 Generate code for the H8S and H8/300H in the normal mode.  This switch
22720 must be used either with @option{-mh} or @option{-ms}.
22722 @item -ms2600
22723 @opindex ms2600
22724 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
22726 @item -mexr
22727 @opindex mexr
22728 Extended registers are stored on stack before execution of function
22729 with monitor attribute. Default option is @option{-mexr}.
22730 This option is valid only for H8S targets.
22732 @item -mno-exr
22733 @opindex mno-exr
22734 @opindex mexr
22735 Extended registers are not stored on stack before execution of function 
22736 with monitor attribute. Default option is @option{-mno-exr}. 
22737 This option is valid only for H8S targets.
22739 @item -mint32
22740 @opindex mint32
22741 Make @code{int} data 32 bits by default.
22743 @item -malign-300
22744 @opindex malign-300
22745 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
22746 The default for the H8/300H and H8S is to align longs and floats on
22747 4-byte boundaries.
22748 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
22749 This option has no effect on the H8/300.
22750 @end table
22752 @node HPPA Options
22753 @subsection HPPA Options
22754 @cindex HPPA Options
22756 These @samp{-m} options are defined for the HPPA family of computers:
22758 @table @gcctabopt
22759 @item -march=@var{architecture-type}
22760 @opindex march
22761 Generate code for the specified architecture.  The choices for
22762 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
22763 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
22764 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
22765 architecture option for your machine.  Code compiled for lower numbered
22766 architectures runs on higher numbered architectures, but not the
22767 other way around.
22769 @item -mpa-risc-1-0
22770 @itemx -mpa-risc-1-1
22771 @itemx -mpa-risc-2-0
22772 @opindex mpa-risc-1-0
22773 @opindex mpa-risc-1-1
22774 @opindex mpa-risc-2-0
22775 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
22777 @item -mcaller-copies
22778 @opindex mcaller-copies
22779 The caller copies function arguments passed by hidden reference.  This
22780 option should be used with care as it is not compatible with the default
22781 32-bit runtime.  However, only aggregates larger than eight bytes are
22782 passed by hidden reference and the option provides better compatibility
22783 with OpenMP.
22785 @item -mjump-in-delay
22786 @opindex mjump-in-delay
22787 This option is ignored and provided for compatibility purposes only.
22789 @item -mdisable-fpregs
22790 @opindex mdisable-fpregs
22791 Prevent floating-point registers from being used in any manner.  This is
22792 necessary for compiling kernels that perform lazy context switching of
22793 floating-point registers.  If you use this option and attempt to perform
22794 floating-point operations, the compiler aborts.
22796 @item -mdisable-indexing
22797 @opindex mdisable-indexing
22798 Prevent the compiler from using indexing address modes.  This avoids some
22799 rather obscure problems when compiling MIG generated code under MACH@.
22801 @item -mno-space-regs
22802 @opindex mno-space-regs
22803 @opindex mspace-regs
22804 Generate code that assumes the target has no space registers.  This allows
22805 GCC to generate faster indirect calls and use unscaled index address modes.
22807 Such code is suitable for level 0 PA systems and kernels.
22809 @item -mfast-indirect-calls
22810 @opindex mfast-indirect-calls
22811 Generate code that assumes calls never cross space boundaries.  This
22812 allows GCC to emit code that performs faster indirect calls.
22814 This option does not work in the presence of shared libraries or nested
22815 functions.
22817 @item -mfixed-range=@var{register-range}
22818 @opindex mfixed-range
22819 Generate code treating the given register range as fixed registers.
22820 A fixed register is one that the register allocator cannot use.  This is
22821 useful when compiling kernel code.  A register range is specified as
22822 two registers separated by a dash.  Multiple register ranges can be
22823 specified separated by a comma.
22825 @item -mlong-load-store
22826 @opindex mlong-load-store
22827 Generate 3-instruction load and store sequences as sometimes required by
22828 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
22829 the HP compilers.
22831 @item -mportable-runtime
22832 @opindex mportable-runtime
22833 Use the portable calling conventions proposed by HP for ELF systems.
22835 @item -mgas
22836 @opindex mgas
22837 Enable the use of assembler directives only GAS understands.
22839 @item -mschedule=@var{cpu-type}
22840 @opindex mschedule
22841 Schedule code according to the constraints for the machine type
22842 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
22843 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
22844 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
22845 proper scheduling option for your machine.  The default scheduling is
22846 @samp{8000}.
22848 @item -mlinker-opt
22849 @opindex mlinker-opt
22850 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
22851 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
22852 linkers in which they give bogus error messages when linking some programs.
22854 @item -msoft-float
22855 @opindex msoft-float
22856 Generate output containing library calls for floating point.
22857 @strong{Warning:} the requisite libraries are not available for all HPPA
22858 targets.  Normally the facilities of the machine's usual C compiler are
22859 used, but this cannot be done directly in cross-compilation.  You must make
22860 your own arrangements to provide suitable library functions for
22861 cross-compilation.
22863 @option{-msoft-float} changes the calling convention in the output file;
22864 therefore, it is only useful if you compile @emph{all} of a program with
22865 this option.  In particular, you need to compile @file{libgcc.a}, the
22866 library that comes with GCC, with @option{-msoft-float} in order for
22867 this to work.
22869 @item -msio
22870 @opindex msio
22871 Generate the predefine, @code{_SIO}, for server IO@.  The default is
22872 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
22873 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
22874 options are available under HP-UX and HI-UX@.
22876 @item -mgnu-ld
22877 @opindex mgnu-ld
22878 Use options specific to GNU @command{ld}.
22879 This passes @option{-shared} to @command{ld} when
22880 building a shared library.  It is the default when GCC is configured,
22881 explicitly or implicitly, with the GNU linker.  This option does not
22882 affect which @command{ld} is called; it only changes what parameters
22883 are passed to that @command{ld}.
22884 The @command{ld} that is called is determined by the
22885 @option{--with-ld} configure option, GCC's program search path, and
22886 finally by the user's @env{PATH}.  The linker used by GCC can be printed
22887 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
22888 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
22890 @item -mhp-ld
22891 @opindex mhp-ld
22892 Use options specific to HP @command{ld}.
22893 This passes @option{-b} to @command{ld} when building
22894 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
22895 links.  It is the default when GCC is configured, explicitly or
22896 implicitly, with the HP linker.  This option does not affect
22897 which @command{ld} is called; it only changes what parameters are passed to that
22898 @command{ld}.
22899 The @command{ld} that is called is determined by the @option{--with-ld}
22900 configure option, GCC's program search path, and finally by the user's
22901 @env{PATH}.  The linker used by GCC can be printed using @samp{which
22902 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
22903 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
22905 @item -mlong-calls
22906 @opindex mno-long-calls
22907 @opindex mlong-calls
22908 Generate code that uses long call sequences.  This ensures that a call
22909 is always able to reach linker generated stubs.  The default is to generate
22910 long calls only when the distance from the call site to the beginning
22911 of the function or translation unit, as the case may be, exceeds a
22912 predefined limit set by the branch type being used.  The limits for
22913 normal calls are 7,600,000 and 240,000 bytes, respectively for the
22914 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
22915 240,000 bytes.
22917 Distances are measured from the beginning of functions when using the
22918 @option{-ffunction-sections} option, or when using the @option{-mgas}
22919 and @option{-mno-portable-runtime} options together under HP-UX with
22920 the SOM linker.
22922 It is normally not desirable to use this option as it degrades
22923 performance.  However, it may be useful in large applications,
22924 particularly when partial linking is used to build the application.
22926 The types of long calls used depends on the capabilities of the
22927 assembler and linker, and the type of code being generated.  The
22928 impact on systems that support long absolute calls, and long pic
22929 symbol-difference or pc-relative calls should be relatively small.
22930 However, an indirect call is used on 32-bit ELF systems in pic code
22931 and it is quite long.
22933 @item -munix=@var{unix-std}
22934 @opindex march
22935 Generate compiler predefines and select a startfile for the specified
22936 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
22937 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
22938 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
22939 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
22940 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
22941 and later.
22943 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
22944 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
22945 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
22946 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
22947 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
22948 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
22950 It is @emph{important} to note that this option changes the interfaces
22951 for various library routines.  It also affects the operational behavior
22952 of the C library.  Thus, @emph{extreme} care is needed in using this
22953 option.
22955 Library code that is intended to operate with more than one UNIX
22956 standard must test, set and restore the variable @code{__xpg4_extended_mask}
22957 as appropriate.  Most GNU software doesn't provide this capability.
22959 @item -nolibdld
22960 @opindex nolibdld
22961 Suppress the generation of link options to search libdld.sl when the
22962 @option{-static} option is specified on HP-UX 10 and later.
22964 @item -static
22965 @opindex static
22966 The HP-UX implementation of setlocale in libc has a dependency on
22967 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
22968 when the @option{-static} option is specified, special link options
22969 are needed to resolve this dependency.
22971 On HP-UX 10 and later, the GCC driver adds the necessary options to
22972 link with libdld.sl when the @option{-static} option is specified.
22973 This causes the resulting binary to be dynamic.  On the 64-bit port,
22974 the linkers generate dynamic binaries by default in any case.  The
22975 @option{-nolibdld} option can be used to prevent the GCC driver from
22976 adding these link options.
22978 @item -threads
22979 @opindex threads
22980 Add support for multithreading with the @dfn{dce thread} library
22981 under HP-UX@.  This option sets flags for both the preprocessor and
22982 linker.
22983 @end table
22985 @node IA-64 Options
22986 @subsection IA-64 Options
22987 @cindex IA-64 Options
22989 These are the @samp{-m} options defined for the Intel IA-64 architecture.
22991 @table @gcctabopt
22992 @item -mbig-endian
22993 @opindex mbig-endian
22994 Generate code for a big-endian target.  This is the default for HP-UX@.
22996 @item -mlittle-endian
22997 @opindex mlittle-endian
22998 Generate code for a little-endian target.  This is the default for AIX5
22999 and GNU/Linux.
23001 @item -mgnu-as
23002 @itemx -mno-gnu-as
23003 @opindex mgnu-as
23004 @opindex mno-gnu-as
23005 Generate (or don't) code for the GNU assembler.  This is the default.
23006 @c Also, this is the default if the configure option @option{--with-gnu-as}
23007 @c is used.
23009 @item -mgnu-ld
23010 @itemx -mno-gnu-ld
23011 @opindex mgnu-ld
23012 @opindex mno-gnu-ld
23013 Generate (or don't) code for the GNU linker.  This is the default.
23014 @c Also, this is the default if the configure option @option{--with-gnu-ld}
23015 @c is used.
23017 @item -mno-pic
23018 @opindex mno-pic
23019 Generate code that does not use a global pointer register.  The result
23020 is not position independent code, and violates the IA-64 ABI@.
23022 @item -mvolatile-asm-stop
23023 @itemx -mno-volatile-asm-stop
23024 @opindex mvolatile-asm-stop
23025 @opindex mno-volatile-asm-stop
23026 Generate (or don't) a stop bit immediately before and after volatile asm
23027 statements.
23029 @item -mregister-names
23030 @itemx -mno-register-names
23031 @opindex mregister-names
23032 @opindex mno-register-names
23033 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
23034 the stacked registers.  This may make assembler output more readable.
23036 @item -mno-sdata
23037 @itemx -msdata
23038 @opindex mno-sdata
23039 @opindex msdata
23040 Disable (or enable) optimizations that use the small data section.  This may
23041 be useful for working around optimizer bugs.
23043 @item -mconstant-gp
23044 @opindex mconstant-gp
23045 Generate code that uses a single constant global pointer value.  This is
23046 useful when compiling kernel code.
23048 @item -mauto-pic
23049 @opindex mauto-pic
23050 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
23051 This is useful when compiling firmware code.
23053 @item -minline-float-divide-min-latency
23054 @opindex minline-float-divide-min-latency
23055 Generate code for inline divides of floating-point values
23056 using the minimum latency algorithm.
23058 @item -minline-float-divide-max-throughput
23059 @opindex minline-float-divide-max-throughput
23060 Generate code for inline divides of floating-point values
23061 using the maximum throughput algorithm.
23063 @item -mno-inline-float-divide
23064 @opindex mno-inline-float-divide
23065 Do not generate inline code for divides of floating-point values.
23067 @item -minline-int-divide-min-latency
23068 @opindex minline-int-divide-min-latency
23069 Generate code for inline divides of integer values
23070 using the minimum latency algorithm.
23072 @item -minline-int-divide-max-throughput
23073 @opindex minline-int-divide-max-throughput
23074 Generate code for inline divides of integer values
23075 using the maximum throughput algorithm.
23077 @item -mno-inline-int-divide
23078 @opindex mno-inline-int-divide
23079 @opindex minline-int-divide
23080 Do not generate inline code for divides of integer values.
23082 @item -minline-sqrt-min-latency
23083 @opindex minline-sqrt-min-latency
23084 Generate code for inline square roots
23085 using the minimum latency algorithm.
23087 @item -minline-sqrt-max-throughput
23088 @opindex minline-sqrt-max-throughput
23089 Generate code for inline square roots
23090 using the maximum throughput algorithm.
23092 @item -mno-inline-sqrt
23093 @opindex mno-inline-sqrt
23094 Do not generate inline code for @code{sqrt}.
23096 @item -mfused-madd
23097 @itemx -mno-fused-madd
23098 @opindex mfused-madd
23099 @opindex mno-fused-madd
23100 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
23101 instructions.  The default is to use these instructions.
23103 @item -mno-dwarf2-asm
23104 @itemx -mdwarf2-asm
23105 @opindex mno-dwarf2-asm
23106 @opindex mdwarf2-asm
23107 Don't (or do) generate assembler code for the DWARF line number debugging
23108 info.  This may be useful when not using the GNU assembler.
23110 @item -mearly-stop-bits
23111 @itemx -mno-early-stop-bits
23112 @opindex mearly-stop-bits
23113 @opindex mno-early-stop-bits
23114 Allow stop bits to be placed earlier than immediately preceding the
23115 instruction that triggered the stop bit.  This can improve instruction
23116 scheduling, but does not always do so.
23118 @item -mfixed-range=@var{register-range}
23119 @opindex mfixed-range
23120 Generate code treating the given register range as fixed registers.
23121 A fixed register is one that the register allocator cannot use.  This is
23122 useful when compiling kernel code.  A register range is specified as
23123 two registers separated by a dash.  Multiple register ranges can be
23124 specified separated by a comma.
23126 @item -mtls-size=@var{tls-size}
23127 @opindex mtls-size
23128 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
23131 @item -mtune=@var{cpu-type}
23132 @opindex mtune
23133 Tune the instruction scheduling for a particular CPU, Valid values are
23134 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
23135 and @samp{mckinley}.
23137 @item -milp32
23138 @itemx -mlp64
23139 @opindex milp32
23140 @opindex mlp64
23141 Generate code for a 32-bit or 64-bit environment.
23142 The 32-bit environment sets int, long and pointer to 32 bits.
23143 The 64-bit environment sets int to 32 bits and long and pointer
23144 to 64 bits.  These are HP-UX specific flags.
23146 @item -mno-sched-br-data-spec
23147 @itemx -msched-br-data-spec
23148 @opindex mno-sched-br-data-spec
23149 @opindex msched-br-data-spec
23150 (Dis/En)able data speculative scheduling before reload.
23151 This results in generation of @code{ld.a} instructions and
23152 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
23153 The default setting is disabled.
23155 @item -msched-ar-data-spec
23156 @itemx -mno-sched-ar-data-spec
23157 @opindex msched-ar-data-spec
23158 @opindex mno-sched-ar-data-spec
23159 (En/Dis)able data speculative scheduling after reload.
23160 This results in generation of @code{ld.a} instructions and
23161 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
23162 The default setting is enabled.
23164 @item -mno-sched-control-spec
23165 @itemx -msched-control-spec
23166 @opindex mno-sched-control-spec
23167 @opindex msched-control-spec
23168 (Dis/En)able control speculative scheduling.  This feature is
23169 available only during region scheduling (i.e.@: before reload).
23170 This results in generation of the @code{ld.s} instructions and
23171 the corresponding check instructions @code{chk.s}.
23172 The default setting is disabled.
23174 @item -msched-br-in-data-spec
23175 @itemx -mno-sched-br-in-data-spec
23176 @opindex msched-br-in-data-spec
23177 @opindex mno-sched-br-in-data-spec
23178 (En/Dis)able speculative scheduling of the instructions that
23179 are dependent on the data speculative loads before reload.
23180 This is effective only with @option{-msched-br-data-spec} enabled.
23181 The default setting is enabled.
23183 @item -msched-ar-in-data-spec
23184 @itemx -mno-sched-ar-in-data-spec
23185 @opindex msched-ar-in-data-spec
23186 @opindex mno-sched-ar-in-data-spec
23187 (En/Dis)able speculative scheduling of the instructions that
23188 are dependent on the data speculative loads after reload.
23189 This is effective only with @option{-msched-ar-data-spec} enabled.
23190 The default setting is enabled.
23192 @item -msched-in-control-spec
23193 @itemx -mno-sched-in-control-spec
23194 @opindex msched-in-control-spec
23195 @opindex mno-sched-in-control-spec
23196 (En/Dis)able speculative scheduling of the instructions that
23197 are dependent on the control speculative loads.
23198 This is effective only with @option{-msched-control-spec} enabled.
23199 The default setting is enabled.
23201 @item -mno-sched-prefer-non-data-spec-insns
23202 @itemx -msched-prefer-non-data-spec-insns
23203 @opindex mno-sched-prefer-non-data-spec-insns
23204 @opindex msched-prefer-non-data-spec-insns
23205 If enabled, data-speculative instructions are chosen for schedule
23206 only if there are no other choices at the moment.  This makes
23207 the use of the data speculation much more conservative.
23208 The default setting is disabled.
23210 @item -mno-sched-prefer-non-control-spec-insns
23211 @itemx -msched-prefer-non-control-spec-insns
23212 @opindex mno-sched-prefer-non-control-spec-insns
23213 @opindex msched-prefer-non-control-spec-insns
23214 If enabled, control-speculative instructions are chosen for schedule
23215 only if there are no other choices at the moment.  This makes
23216 the use of the control speculation much more conservative.
23217 The default setting is disabled.
23219 @item -mno-sched-count-spec-in-critical-path
23220 @itemx -msched-count-spec-in-critical-path
23221 @opindex mno-sched-count-spec-in-critical-path
23222 @opindex msched-count-spec-in-critical-path
23223 If enabled, speculative dependencies are considered during
23224 computation of the instructions priorities.  This makes the use of the
23225 speculation a bit more conservative.
23226 The default setting is disabled.
23228 @item -msched-spec-ldc
23229 @opindex msched-spec-ldc
23230 Use a simple data speculation check.  This option is on by default.
23232 @item -msched-control-spec-ldc
23233 @opindex msched-spec-ldc
23234 Use a simple check for control speculation.  This option is on by default.
23236 @item -msched-stop-bits-after-every-cycle
23237 @opindex msched-stop-bits-after-every-cycle
23238 Place a stop bit after every cycle when scheduling.  This option is on
23239 by default.
23241 @item -msched-fp-mem-deps-zero-cost
23242 @opindex msched-fp-mem-deps-zero-cost
23243 Assume that floating-point stores and loads are not likely to cause a conflict
23244 when placed into the same instruction group.  This option is disabled by
23245 default.
23247 @item -msel-sched-dont-check-control-spec
23248 @opindex msel-sched-dont-check-control-spec
23249 Generate checks for control speculation in selective scheduling.
23250 This flag is disabled by default.
23252 @item -msched-max-memory-insns=@var{max-insns}
23253 @opindex msched-max-memory-insns
23254 Limit on the number of memory insns per instruction group, giving lower
23255 priority to subsequent memory insns attempting to schedule in the same
23256 instruction group. Frequently useful to prevent cache bank conflicts.
23257 The default value is 1.
23259 @item -msched-max-memory-insns-hard-limit
23260 @opindex msched-max-memory-insns-hard-limit
23261 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
23262 disallowing more than that number in an instruction group.
23263 Otherwise, the limit is ``soft'', meaning that non-memory operations
23264 are preferred when the limit is reached, but memory operations may still
23265 be scheduled.
23267 @end table
23269 @node LM32 Options
23270 @subsection LM32 Options
23271 @cindex LM32 options
23273 These @option{-m} options are defined for the LatticeMico32 architecture:
23275 @table @gcctabopt
23276 @item -mbarrel-shift-enabled
23277 @opindex mbarrel-shift-enabled
23278 Enable barrel-shift instructions.
23280 @item -mdivide-enabled
23281 @opindex mdivide-enabled
23282 Enable divide and modulus instructions.
23284 @item -mmultiply-enabled
23285 @opindex multiply-enabled
23286 Enable multiply instructions.
23288 @item -msign-extend-enabled
23289 @opindex msign-extend-enabled
23290 Enable sign extend instructions.
23292 @item -muser-enabled
23293 @opindex muser-enabled
23294 Enable user-defined instructions.
23296 @end table
23298 @node M32C Options
23299 @subsection M32C Options
23300 @cindex M32C options
23302 @table @gcctabopt
23303 @item -mcpu=@var{name}
23304 @opindex mcpu=
23305 Select the CPU for which code is generated.  @var{name} may be one of
23306 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
23307 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
23308 the M32C/80 series.
23310 @item -msim
23311 @opindex msim
23312 Specifies that the program will be run on the simulator.  This causes
23313 an alternate runtime library to be linked in which supports, for
23314 example, file I/O@.  You must not use this option when generating
23315 programs that will run on real hardware; you must provide your own
23316 runtime library for whatever I/O functions are needed.
23318 @item -memregs=@var{number}
23319 @opindex memregs=
23320 Specifies the number of memory-based pseudo-registers GCC uses
23321 during code generation.  These pseudo-registers are used like real
23322 registers, so there is a tradeoff between GCC's ability to fit the
23323 code into available registers, and the performance penalty of using
23324 memory instead of registers.  Note that all modules in a program must
23325 be compiled with the same value for this option.  Because of that, you
23326 must not use this option with GCC's default runtime libraries.
23328 @end table
23330 @node M32R/D Options
23331 @subsection M32R/D Options
23332 @cindex M32R/D options
23334 These @option{-m} options are defined for Renesas M32R/D architectures:
23336 @table @gcctabopt
23337 @item -m32r2
23338 @opindex m32r2
23339 Generate code for the M32R/2@.
23341 @item -m32rx
23342 @opindex m32rx
23343 Generate code for the M32R/X@.
23345 @item -m32r
23346 @opindex m32r
23347 Generate code for the M32R@.  This is the default.
23349 @item -mmodel=small
23350 @opindex mmodel=small
23351 Assume all objects live in the lower 16MB of memory (so that their addresses
23352 can be loaded with the @code{ld24} instruction), and assume all subroutines
23353 are reachable with the @code{bl} instruction.
23354 This is the default.
23356 The addressability of a particular object can be set with the
23357 @code{model} attribute.
23359 @item -mmodel=medium
23360 @opindex mmodel=medium
23361 Assume objects may be anywhere in the 32-bit address space (the compiler
23362 generates @code{seth/add3} instructions to load their addresses), and
23363 assume all subroutines are reachable with the @code{bl} instruction.
23365 @item -mmodel=large
23366 @opindex mmodel=large
23367 Assume objects may be anywhere in the 32-bit address space (the compiler
23368 generates @code{seth/add3} instructions to load their addresses), and
23369 assume subroutines may not be reachable with the @code{bl} instruction
23370 (the compiler generates the much slower @code{seth/add3/jl}
23371 instruction sequence).
23373 @item -msdata=none
23374 @opindex msdata=none
23375 Disable use of the small data area.  Variables are put into
23376 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
23377 @code{section} attribute has been specified).
23378 This is the default.
23380 The small data area consists of sections @code{.sdata} and @code{.sbss}.
23381 Objects may be explicitly put in the small data area with the
23382 @code{section} attribute using one of these sections.
23384 @item -msdata=sdata
23385 @opindex msdata=sdata
23386 Put small global and static data in the small data area, but do not
23387 generate special code to reference them.
23389 @item -msdata=use
23390 @opindex msdata=use
23391 Put small global and static data in the small data area, and generate
23392 special instructions to reference them.
23394 @item -G @var{num}
23395 @opindex G
23396 @cindex smaller data references
23397 Put global and static objects less than or equal to @var{num} bytes
23398 into the small data or BSS sections instead of the normal data or BSS
23399 sections.  The default value of @var{num} is 8.
23400 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
23401 for this option to have any effect.
23403 All modules should be compiled with the same @option{-G @var{num}} value.
23404 Compiling with different values of @var{num} may or may not work; if it
23405 doesn't the linker gives an error message---incorrect code is not
23406 generated.
23408 @item -mdebug
23409 @opindex mdebug
23410 Makes the M32R-specific code in the compiler display some statistics
23411 that might help in debugging programs.
23413 @item -malign-loops
23414 @opindex malign-loops
23415 Align all loops to a 32-byte boundary.
23417 @item -mno-align-loops
23418 @opindex mno-align-loops
23419 Do not enforce a 32-byte alignment for loops.  This is the default.
23421 @item -missue-rate=@var{number}
23422 @opindex missue-rate=@var{number}
23423 Issue @var{number} instructions per cycle.  @var{number} can only be 1
23424 or 2.
23426 @item -mbranch-cost=@var{number}
23427 @opindex mbranch-cost=@var{number}
23428 @var{number} can only be 1 or 2.  If it is 1 then branches are
23429 preferred over conditional code, if it is 2, then the opposite applies.
23431 @item -mflush-trap=@var{number}
23432 @opindex mflush-trap=@var{number}
23433 Specifies the trap number to use to flush the cache.  The default is
23434 12.  Valid numbers are between 0 and 15 inclusive.
23436 @item -mno-flush-trap
23437 @opindex mno-flush-trap
23438 Specifies that the cache cannot be flushed by using a trap.
23440 @item -mflush-func=@var{name}
23441 @opindex mflush-func=@var{name}
23442 Specifies the name of the operating system function to call to flush
23443 the cache.  The default is @samp{_flush_cache}, but a function call
23444 is only used if a trap is not available.
23446 @item -mno-flush-func
23447 @opindex mno-flush-func
23448 Indicates that there is no OS function for flushing the cache.
23450 @end table
23452 @node M680x0 Options
23453 @subsection M680x0 Options
23454 @cindex M680x0 options
23456 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
23457 The default settings depend on which architecture was selected when
23458 the compiler was configured; the defaults for the most common choices
23459 are given below.
23461 @table @gcctabopt
23462 @item -march=@var{arch}
23463 @opindex march
23464 Generate code for a specific M680x0 or ColdFire instruction set
23465 architecture.  Permissible values of @var{arch} for M680x0
23466 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
23467 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
23468 architectures are selected according to Freescale's ISA classification
23469 and the permissible values are: @samp{isaa}, @samp{isaaplus},
23470 @samp{isab} and @samp{isac}.
23472 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
23473 code for a ColdFire target.  The @var{arch} in this macro is one of the
23474 @option{-march} arguments given above.
23476 When used together, @option{-march} and @option{-mtune} select code
23477 that runs on a family of similar processors but that is optimized
23478 for a particular microarchitecture.
23480 @item -mcpu=@var{cpu}
23481 @opindex mcpu
23482 Generate code for a specific M680x0 or ColdFire processor.
23483 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
23484 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
23485 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
23486 below, which also classifies the CPUs into families:
23488 @multitable @columnfractions 0.20 0.80
23489 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
23490 @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}
23491 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
23492 @item @samp{5206e} @tab @samp{5206e}
23493 @item @samp{5208} @tab @samp{5207} @samp{5208}
23494 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
23495 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
23496 @item @samp{5216} @tab @samp{5214} @samp{5216}
23497 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
23498 @item @samp{5225} @tab @samp{5224} @samp{5225}
23499 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
23500 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
23501 @item @samp{5249} @tab @samp{5249}
23502 @item @samp{5250} @tab @samp{5250}
23503 @item @samp{5271} @tab @samp{5270} @samp{5271}
23504 @item @samp{5272} @tab @samp{5272}
23505 @item @samp{5275} @tab @samp{5274} @samp{5275}
23506 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
23507 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
23508 @item @samp{5307} @tab @samp{5307}
23509 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
23510 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
23511 @item @samp{5407} @tab @samp{5407}
23512 @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}
23513 @end multitable
23515 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
23516 @var{arch} is compatible with @var{cpu}.  Other combinations of
23517 @option{-mcpu} and @option{-march} are rejected.
23519 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
23520 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
23521 where the value of @var{family} is given by the table above.
23523 @item -mtune=@var{tune}
23524 @opindex mtune
23525 Tune the code for a particular microarchitecture within the
23526 constraints set by @option{-march} and @option{-mcpu}.
23527 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
23528 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
23529 and @samp{cpu32}.  The ColdFire microarchitectures
23530 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
23532 You can also use @option{-mtune=68020-40} for code that needs
23533 to run relatively well on 68020, 68030 and 68040 targets.
23534 @option{-mtune=68020-60} is similar but includes 68060 targets
23535 as well.  These two options select the same tuning decisions as
23536 @option{-m68020-40} and @option{-m68020-60} respectively.
23538 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
23539 when tuning for 680x0 architecture @var{arch}.  It also defines
23540 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
23541 option is used.  If GCC is tuning for a range of architectures,
23542 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
23543 it defines the macros for every architecture in the range.
23545 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
23546 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
23547 of the arguments given above.
23549 @item -m68000
23550 @itemx -mc68000
23551 @opindex m68000
23552 @opindex mc68000
23553 Generate output for a 68000.  This is the default
23554 when the compiler is configured for 68000-based systems.
23555 It is equivalent to @option{-march=68000}.
23557 Use this option for microcontrollers with a 68000 or EC000 core,
23558 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
23560 @item -m68010
23561 @opindex m68010
23562 Generate output for a 68010.  This is the default
23563 when the compiler is configured for 68010-based systems.
23564 It is equivalent to @option{-march=68010}.
23566 @item -m68020
23567 @itemx -mc68020
23568 @opindex m68020
23569 @opindex mc68020
23570 Generate output for a 68020.  This is the default
23571 when the compiler is configured for 68020-based systems.
23572 It is equivalent to @option{-march=68020}.
23574 @item -m68030
23575 @opindex m68030
23576 Generate output for a 68030.  This is the default when the compiler is
23577 configured for 68030-based systems.  It is equivalent to
23578 @option{-march=68030}.
23580 @item -m68040
23581 @opindex m68040
23582 Generate output for a 68040.  This is the default when the compiler is
23583 configured for 68040-based systems.  It is equivalent to
23584 @option{-march=68040}.
23586 This option inhibits the use of 68881/68882 instructions that have to be
23587 emulated by software on the 68040.  Use this option if your 68040 does not
23588 have code to emulate those instructions.
23590 @item -m68060
23591 @opindex m68060
23592 Generate output for a 68060.  This is the default when the compiler is
23593 configured for 68060-based systems.  It is equivalent to
23594 @option{-march=68060}.
23596 This option inhibits the use of 68020 and 68881/68882 instructions that
23597 have to be emulated by software on the 68060.  Use this option if your 68060
23598 does not have code to emulate those instructions.
23600 @item -mcpu32
23601 @opindex mcpu32
23602 Generate output for a CPU32.  This is the default
23603 when the compiler is configured for CPU32-based systems.
23604 It is equivalent to @option{-march=cpu32}.
23606 Use this option for microcontrollers with a
23607 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
23608 68336, 68340, 68341, 68349 and 68360.
23610 @item -m5200
23611 @opindex m5200
23612 Generate output for a 520X ColdFire CPU@.  This is the default
23613 when the compiler is configured for 520X-based systems.
23614 It is equivalent to @option{-mcpu=5206}, and is now deprecated
23615 in favor of that option.
23617 Use this option for microcontroller with a 5200 core, including
23618 the MCF5202, MCF5203, MCF5204 and MCF5206.
23620 @item -m5206e
23621 @opindex m5206e
23622 Generate output for a 5206e ColdFire CPU@.  The option is now
23623 deprecated in favor of the equivalent @option{-mcpu=5206e}.
23625 @item -m528x
23626 @opindex m528x
23627 Generate output for a member of the ColdFire 528X family.
23628 The option is now deprecated in favor of the equivalent
23629 @option{-mcpu=528x}.
23631 @item -m5307
23632 @opindex m5307
23633 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
23634 in favor of the equivalent @option{-mcpu=5307}.
23636 @item -m5407
23637 @opindex m5407
23638 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
23639 in favor of the equivalent @option{-mcpu=5407}.
23641 @item -mcfv4e
23642 @opindex mcfv4e
23643 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
23644 This includes use of hardware floating-point instructions.
23645 The option is equivalent to @option{-mcpu=547x}, and is now
23646 deprecated in favor of that option.
23648 @item -m68020-40
23649 @opindex m68020-40
23650 Generate output for a 68040, without using any of the new instructions.
23651 This results in code that can run relatively efficiently on either a
23652 68020/68881 or a 68030 or a 68040.  The generated code does use the
23653 68881 instructions that are emulated on the 68040.
23655 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
23657 @item -m68020-60
23658 @opindex m68020-60
23659 Generate output for a 68060, without using any of the new instructions.
23660 This results in code that can run relatively efficiently on either a
23661 68020/68881 or a 68030 or a 68040.  The generated code does use the
23662 68881 instructions that are emulated on the 68060.
23664 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
23666 @item -mhard-float
23667 @itemx -m68881
23668 @opindex mhard-float
23669 @opindex m68881
23670 Generate floating-point instructions.  This is the default for 68020
23671 and above, and for ColdFire devices that have an FPU@.  It defines the
23672 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
23673 on ColdFire targets.
23675 @item -msoft-float
23676 @opindex msoft-float
23677 Do not generate floating-point instructions; use library calls instead.
23678 This is the default for 68000, 68010, and 68832 targets.  It is also
23679 the default for ColdFire devices that have no FPU.
23681 @item -mdiv
23682 @itemx -mno-div
23683 @opindex mdiv
23684 @opindex mno-div
23685 Generate (do not generate) ColdFire hardware divide and remainder
23686 instructions.  If @option{-march} is used without @option{-mcpu},
23687 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
23688 architectures.  Otherwise, the default is taken from the target CPU
23689 (either the default CPU, or the one specified by @option{-mcpu}).  For
23690 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
23691 @option{-mcpu=5206e}.
23693 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
23695 @item -mshort
23696 @opindex mshort
23697 Consider type @code{int} to be 16 bits wide, like @code{short int}.
23698 Additionally, parameters passed on the stack are also aligned to a
23699 16-bit boundary even on targets whose API mandates promotion to 32-bit.
23701 @item -mno-short
23702 @opindex mno-short
23703 Do not consider type @code{int} to be 16 bits wide.  This is the default.
23705 @item -mnobitfield
23706 @itemx -mno-bitfield
23707 @opindex mnobitfield
23708 @opindex mno-bitfield
23709 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
23710 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
23712 @item -mbitfield
23713 @opindex mbitfield
23714 Do use the bit-field instructions.  The @option{-m68020} option implies
23715 @option{-mbitfield}.  This is the default if you use a configuration
23716 designed for a 68020.
23718 @item -mrtd
23719 @opindex mrtd
23720 Use a different function-calling convention, in which functions
23721 that take a fixed number of arguments return with the @code{rtd}
23722 instruction, which pops their arguments while returning.  This
23723 saves one instruction in the caller since there is no need to pop
23724 the arguments there.
23726 This calling convention is incompatible with the one normally
23727 used on Unix, so you cannot use it if you need to call libraries
23728 compiled with the Unix compiler.
23730 Also, you must provide function prototypes for all functions that
23731 take variable numbers of arguments (including @code{printf});
23732 otherwise incorrect code is generated for calls to those
23733 functions.
23735 In addition, seriously incorrect code results if you call a
23736 function with too many arguments.  (Normally, extra arguments are
23737 harmlessly ignored.)
23739 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
23740 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
23742 The default is @option{-mno-rtd}.
23744 @item -malign-int
23745 @itemx -mno-align-int
23746 @opindex malign-int
23747 @opindex mno-align-int
23748 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
23749 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
23750 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
23751 Aligning variables on 32-bit boundaries produces code that runs somewhat
23752 faster on processors with 32-bit busses at the expense of more memory.
23754 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
23755 aligns structures containing the above types differently than
23756 most published application binary interface specifications for the m68k.
23758 @opindex mpcrel
23759 Use the pc-relative addressing mode of the 68000 directly, instead of
23760 using a global offset table.  At present, this option implies @option{-fpic},
23761 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
23762 not presently supported with @option{-mpcrel}, though this could be supported for
23763 68020 and higher processors.
23765 @item -mno-strict-align
23766 @itemx -mstrict-align
23767 @opindex mno-strict-align
23768 @opindex mstrict-align
23769 Do not (do) assume that unaligned memory references are handled by
23770 the system.
23772 @item -msep-data
23773 Generate code that allows the data segment to be located in a different
23774 area of memory from the text segment.  This allows for execute-in-place in
23775 an environment without virtual memory management.  This option implies
23776 @option{-fPIC}.
23778 @item -mno-sep-data
23779 Generate code that assumes that the data segment follows the text segment.
23780 This is the default.
23782 @item -mid-shared-library
23783 Generate code that supports shared libraries via the library ID method.
23784 This allows for execute-in-place and shared libraries in an environment
23785 without virtual memory management.  This option implies @option{-fPIC}.
23787 @item -mno-id-shared-library
23788 Generate code that doesn't assume ID-based shared libraries are being used.
23789 This is the default.
23791 @item -mshared-library-id=n
23792 Specifies the identification number of the ID-based shared library being
23793 compiled.  Specifying a value of 0 generates more compact code; specifying
23794 other values forces the allocation of that number to the current
23795 library, but is no more space- or time-efficient than omitting this option.
23797 @item -mxgot
23798 @itemx -mno-xgot
23799 @opindex mxgot
23800 @opindex mno-xgot
23801 When generating position-independent code for ColdFire, generate code
23802 that works if the GOT has more than 8192 entries.  This code is
23803 larger and slower than code generated without this option.  On M680x0
23804 processors, this option is not needed; @option{-fPIC} suffices.
23806 GCC normally uses a single instruction to load values from the GOT@.
23807 While this is relatively efficient, it only works if the GOT
23808 is smaller than about 64k.  Anything larger causes the linker
23809 to report an error such as:
23811 @cindex relocation truncated to fit (ColdFire)
23812 @smallexample
23813 relocation truncated to fit: R_68K_GOT16O foobar
23814 @end smallexample
23816 If this happens, you should recompile your code with @option{-mxgot}.
23817 It should then work with very large GOTs.  However, code generated with
23818 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
23819 the value of a global symbol.
23821 Note that some linkers, including newer versions of the GNU linker,
23822 can create multiple GOTs and sort GOT entries.  If you have such a linker,
23823 you should only need to use @option{-mxgot} when compiling a single
23824 object file that accesses more than 8192 GOT entries.  Very few do.
23826 These options have no effect unless GCC is generating
23827 position-independent code.
23829 @item -mlong-jump-table-offsets
23830 @opindex mlong-jump-table-offsets
23831 Use 32-bit offsets in @code{switch} tables.  The default is to use
23832 16-bit offsets.
23834 @end table
23836 @node MCore Options
23837 @subsection MCore Options
23838 @cindex MCore options
23840 These are the @samp{-m} options defined for the Motorola M*Core
23841 processors.
23843 @table @gcctabopt
23845 @item -mhardlit
23846 @itemx -mno-hardlit
23847 @opindex mhardlit
23848 @opindex mno-hardlit
23849 Inline constants into the code stream if it can be done in two
23850 instructions or less.
23852 @item -mdiv
23853 @itemx -mno-div
23854 @opindex mdiv
23855 @opindex mno-div
23856 Use the divide instruction.  (Enabled by default).
23858 @item -mrelax-immediate
23859 @itemx -mno-relax-immediate
23860 @opindex mrelax-immediate
23861 @opindex mno-relax-immediate
23862 Allow arbitrary-sized immediates in bit operations.
23864 @item -mwide-bitfields
23865 @itemx -mno-wide-bitfields
23866 @opindex mwide-bitfields
23867 @opindex mno-wide-bitfields
23868 Always treat bit-fields as @code{int}-sized.
23870 @item -m4byte-functions
23871 @itemx -mno-4byte-functions
23872 @opindex m4byte-functions
23873 @opindex mno-4byte-functions
23874 Force all functions to be aligned to a 4-byte boundary.
23876 @item -mcallgraph-data
23877 @itemx -mno-callgraph-data
23878 @opindex mcallgraph-data
23879 @opindex mno-callgraph-data
23880 Emit callgraph information.
23882 @item -mslow-bytes
23883 @itemx -mno-slow-bytes
23884 @opindex mslow-bytes
23885 @opindex mno-slow-bytes
23886 Prefer word access when reading byte quantities.
23888 @item -mlittle-endian
23889 @itemx -mbig-endian
23890 @opindex mlittle-endian
23891 @opindex mbig-endian
23892 Generate code for a little-endian target.
23894 @item -m210
23895 @itemx -m340
23896 @opindex m210
23897 @opindex m340
23898 Generate code for the 210 processor.
23900 @item -mno-lsim
23901 @opindex mno-lsim
23902 Assume that runtime support has been provided and so omit the
23903 simulator library (@file{libsim.a)} from the linker command line.
23905 @item -mstack-increment=@var{size}
23906 @opindex mstack-increment
23907 Set the maximum amount for a single stack increment operation.  Large
23908 values can increase the speed of programs that contain functions
23909 that need a large amount of stack space, but they can also trigger a
23910 segmentation fault if the stack is extended too much.  The default
23911 value is 0x1000.
23913 @end table
23915 @node MeP Options
23916 @subsection MeP Options
23917 @cindex MeP options
23919 @table @gcctabopt
23921 @item -mabsdiff
23922 @opindex mabsdiff
23923 Enables the @code{abs} instruction, which is the absolute difference
23924 between two registers.
23926 @item -mall-opts
23927 @opindex mall-opts
23928 Enables all the optional instructions---average, multiply, divide, bit
23929 operations, leading zero, absolute difference, min/max, clip, and
23930 saturation.
23933 @item -maverage
23934 @opindex maverage
23935 Enables the @code{ave} instruction, which computes the average of two
23936 registers.
23938 @item -mbased=@var{n}
23939 @opindex mbased=
23940 Variables of size @var{n} bytes or smaller are placed in the
23941 @code{.based} section by default.  Based variables use the @code{$tp}
23942 register as a base register, and there is a 128-byte limit to the
23943 @code{.based} section.
23945 @item -mbitops
23946 @opindex mbitops
23947 Enables the bit operation instructions---bit test (@code{btstm}), set
23948 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
23949 test-and-set (@code{tas}).
23951 @item -mc=@var{name}
23952 @opindex mc=
23953 Selects which section constant data is placed in.  @var{name} may
23954 be @samp{tiny}, @samp{near}, or @samp{far}.
23956 @item -mclip
23957 @opindex mclip
23958 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
23959 useful unless you also provide @option{-mminmax}.
23961 @item -mconfig=@var{name}
23962 @opindex mconfig=
23963 Selects one of the built-in core configurations.  Each MeP chip has
23964 one or more modules in it; each module has a core CPU and a variety of
23965 coprocessors, optional instructions, and peripherals.  The
23966 @code{MeP-Integrator} tool, not part of GCC, provides these
23967 configurations through this option; using this option is the same as
23968 using all the corresponding command-line options.  The default
23969 configuration is @samp{default}.
23971 @item -mcop
23972 @opindex mcop
23973 Enables the coprocessor instructions.  By default, this is a 32-bit
23974 coprocessor.  Note that the coprocessor is normally enabled via the
23975 @option{-mconfig=} option.
23977 @item -mcop32
23978 @opindex mcop32
23979 Enables the 32-bit coprocessor's instructions.
23981 @item -mcop64
23982 @opindex mcop64
23983 Enables the 64-bit coprocessor's instructions.
23985 @item -mivc2
23986 @opindex mivc2
23987 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
23989 @item -mdc
23990 @opindex mdc
23991 Causes constant variables to be placed in the @code{.near} section.
23993 @item -mdiv
23994 @opindex mdiv
23995 Enables the @code{div} and @code{divu} instructions.
23997 @item -meb
23998 @opindex meb
23999 Generate big-endian code.
24001 @item -mel
24002 @opindex mel
24003 Generate little-endian code.
24005 @item -mio-volatile
24006 @opindex mio-volatile
24007 Tells the compiler that any variable marked with the @code{io}
24008 attribute is to be considered volatile.
24010 @item -ml
24011 @opindex ml
24012 Causes variables to be assigned to the @code{.far} section by default.
24014 @item -mleadz
24015 @opindex mleadz
24016 Enables the @code{leadz} (leading zero) instruction.
24018 @item -mm
24019 @opindex mm
24020 Causes variables to be assigned to the @code{.near} section by default.
24022 @item -mminmax
24023 @opindex mminmax
24024 Enables the @code{min} and @code{max} instructions.
24026 @item -mmult
24027 @opindex mmult
24028 Enables the multiplication and multiply-accumulate instructions.
24030 @item -mno-opts
24031 @opindex mno-opts
24032 Disables all the optional instructions enabled by @option{-mall-opts}.
24034 @item -mrepeat
24035 @opindex mrepeat
24036 Enables the @code{repeat} and @code{erepeat} instructions, used for
24037 low-overhead looping.
24039 @item -ms
24040 @opindex ms
24041 Causes all variables to default to the @code{.tiny} section.  Note
24042 that there is a 65536-byte limit to this section.  Accesses to these
24043 variables use the @code{%gp} base register.
24045 @item -msatur
24046 @opindex msatur
24047 Enables the saturation instructions.  Note that the compiler does not
24048 currently generate these itself, but this option is included for
24049 compatibility with other tools, like @code{as}.
24051 @item -msdram
24052 @opindex msdram
24053 Link the SDRAM-based runtime instead of the default ROM-based runtime.
24055 @item -msim
24056 @opindex msim
24057 Link the simulator run-time libraries.
24059 @item -msimnovec
24060 @opindex msimnovec
24061 Link the simulator runtime libraries, excluding built-in support
24062 for reset and exception vectors and tables.
24064 @item -mtf
24065 @opindex mtf
24066 Causes all functions to default to the @code{.far} section.  Without
24067 this option, functions default to the @code{.near} section.
24069 @item -mtiny=@var{n}
24070 @opindex mtiny=
24071 Variables that are @var{n} bytes or smaller are allocated to the
24072 @code{.tiny} section.  These variables use the @code{$gp} base
24073 register.  The default for this option is 4, but note that there's a
24074 65536-byte limit to the @code{.tiny} section.
24076 @end table
24078 @node MicroBlaze Options
24079 @subsection MicroBlaze Options
24080 @cindex MicroBlaze Options
24082 @table @gcctabopt
24084 @item -msoft-float
24085 @opindex msoft-float
24086 Use software emulation for floating point (default).
24088 @item -mhard-float
24089 @opindex mhard-float
24090 Use hardware floating-point instructions.
24092 @item -mmemcpy
24093 @opindex mmemcpy
24094 Do not optimize block moves, use @code{memcpy}.
24096 @item -mno-clearbss
24097 @opindex mno-clearbss
24098 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
24100 @item -mcpu=@var{cpu-type}
24101 @opindex mcpu=
24102 Use features of, and schedule code for, the given CPU.
24103 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
24104 where @var{X} is a major version, @var{YY} is the minor version, and
24105 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
24106 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v6.00.a}.
24108 @item -mxl-soft-mul
24109 @opindex mxl-soft-mul
24110 Use software multiply emulation (default).
24112 @item -mxl-soft-div
24113 @opindex mxl-soft-div
24114 Use software emulation for divides (default).
24116 @item -mxl-barrel-shift
24117 @opindex mxl-barrel-shift
24118 Use the hardware barrel shifter.
24120 @item -mxl-pattern-compare
24121 @opindex mxl-pattern-compare
24122 Use pattern compare instructions.
24124 @item -msmall-divides
24125 @opindex msmall-divides
24126 Use table lookup optimization for small signed integer divisions.
24128 @item -mxl-stack-check
24129 @opindex mxl-stack-check
24130 This option is deprecated.  Use @option{-fstack-check} instead.
24132 @item -mxl-gp-opt
24133 @opindex mxl-gp-opt
24134 Use GP-relative @code{.sdata}/@code{.sbss} sections.
24136 @item -mxl-multiply-high
24137 @opindex mxl-multiply-high
24138 Use multiply high instructions for high part of 32x32 multiply.
24140 @item -mxl-float-convert
24141 @opindex mxl-float-convert
24142 Use hardware floating-point conversion instructions.
24144 @item -mxl-float-sqrt
24145 @opindex mxl-float-sqrt
24146 Use hardware floating-point square root instruction.
24148 @item -mbig-endian
24149 @opindex mbig-endian
24150 Generate code for a big-endian target.
24152 @item -mlittle-endian
24153 @opindex mlittle-endian
24154 Generate code for a little-endian target.
24156 @item -mxl-reorder
24157 @opindex mxl-reorder
24158 Use reorder instructions (swap and byte reversed load/store).
24160 @item -mxl-mode-@var{app-model}
24161 Select application model @var{app-model}.  Valid models are
24162 @table @samp
24163 @item executable
24164 normal executable (default), uses startup code @file{crt0.o}.
24166 @item -mpic-data-is-text-relative
24167 @opindex mpic-data-is-text-relative
24168 Assume that the displacement between the text and data segments is fixed
24169 at static link time.  This allows data to be referenced by offset from start of
24170 text address instead of GOT since PC-relative addressing is not supported.
24172 @item xmdstub
24173 for use with Xilinx Microprocessor Debugger (XMD) based
24174 software intrusive debug agent called xmdstub. This uses startup file
24175 @file{crt1.o} and sets the start address of the program to 0x800.
24177 @item bootstrap
24178 for applications that are loaded using a bootloader.
24179 This model uses startup file @file{crt2.o} which does not contain a processor
24180 reset vector handler. This is suitable for transferring control on a
24181 processor reset to the bootloader rather than the application.
24183 @item novectors
24184 for applications that do not require any of the
24185 MicroBlaze vectors. This option may be useful for applications running
24186 within a monitoring application. This model uses @file{crt3.o} as a startup file.
24187 @end table
24189 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
24190 @option{-mxl-mode-@var{app-model}}.
24192 @end table
24194 @node MIPS Options
24195 @subsection MIPS Options
24196 @cindex MIPS options
24198 @table @gcctabopt
24200 @item -EB
24201 @opindex EB
24202 Generate big-endian code.
24204 @item -EL
24205 @opindex EL
24206 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
24207 configurations.
24209 @item -march=@var{arch}
24210 @opindex march
24211 Generate code that runs on @var{arch}, which can be the name of a
24212 generic MIPS ISA, or the name of a particular processor.
24213 The ISA names are:
24214 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
24215 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
24216 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
24217 @samp{mips64r5} and @samp{mips64r6}.
24218 The processor names are:
24219 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
24220 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
24221 @samp{5kc}, @samp{5kf},
24222 @samp{20kc},
24223 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
24224 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
24225 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
24226 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
24227 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
24228 @samp{i6400}, @samp{i6500},
24229 @samp{interaptiv},
24230 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a}, @samp{gs464},
24231 @samp{gs464e}, @samp{gs264e},
24232 @samp{m4k},
24233 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
24234 @samp{m5100}, @samp{m5101},
24235 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
24236 @samp{orion},
24237 @samp{p5600}, @samp{p6600},
24238 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
24239 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r5900},
24240 @samp{r6000}, @samp{r8000},
24241 @samp{rm7000}, @samp{rm9000},
24242 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
24243 @samp{sb1},
24244 @samp{sr71000},
24245 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
24246 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
24247 @samp{xlr} and @samp{xlp}.
24248 The special value @samp{from-abi} selects the
24249 most compatible architecture for the selected ABI (that is,
24250 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
24252 The native Linux/GNU toolchain also supports the value @samp{native},
24253 which selects the best architecture option for the host processor.
24254 @option{-march=native} has no effect if GCC does not recognize
24255 the processor.
24257 In processor names, a final @samp{000} can be abbreviated as @samp{k}
24258 (for example, @option{-march=r2k}).  Prefixes are optional, and
24259 @samp{vr} may be written @samp{r}.
24261 Names of the form @samp{@var{n}f2_1} refer to processors with
24262 FPUs clocked at half the rate of the core, names of the form
24263 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
24264 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
24265 processors with FPUs clocked a ratio of 3:2 with respect to the core.
24266 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
24267 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
24268 accepted as synonyms for @samp{@var{n}f1_1}.
24270 GCC defines two macros based on the value of this option.  The first
24271 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
24272 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
24273 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
24274 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
24275 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
24277 Note that the @code{_MIPS_ARCH} macro uses the processor names given
24278 above.  In other words, it has the full prefix and does not
24279 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
24280 the macro names the resolved architecture (either @code{"mips1"} or
24281 @code{"mips3"}).  It names the default architecture when no
24282 @option{-march} option is given.
24284 @item -mtune=@var{arch}
24285 @opindex mtune
24286 Optimize for @var{arch}.  Among other things, this option controls
24287 the way instructions are scheduled, and the perceived cost of arithmetic
24288 operations.  The list of @var{arch} values is the same as for
24289 @option{-march}.
24291 When this option is not used, GCC optimizes for the processor
24292 specified by @option{-march}.  By using @option{-march} and
24293 @option{-mtune} together, it is possible to generate code that
24294 runs on a family of processors, but optimize the code for one
24295 particular member of that family.
24297 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
24298 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
24299 @option{-march} ones described above.
24301 @item -mips1
24302 @opindex mips1
24303 Equivalent to @option{-march=mips1}.
24305 @item -mips2
24306 @opindex mips2
24307 Equivalent to @option{-march=mips2}.
24309 @item -mips3
24310 @opindex mips3
24311 Equivalent to @option{-march=mips3}.
24313 @item -mips4
24314 @opindex mips4
24315 Equivalent to @option{-march=mips4}.
24317 @item -mips32
24318 @opindex mips32
24319 Equivalent to @option{-march=mips32}.
24321 @item -mips32r3
24322 @opindex mips32r3
24323 Equivalent to @option{-march=mips32r3}.
24325 @item -mips32r5
24326 @opindex mips32r5
24327 Equivalent to @option{-march=mips32r5}.
24329 @item -mips32r6
24330 @opindex mips32r6
24331 Equivalent to @option{-march=mips32r6}.
24333 @item -mips64
24334 @opindex mips64
24335 Equivalent to @option{-march=mips64}.
24337 @item -mips64r2
24338 @opindex mips64r2
24339 Equivalent to @option{-march=mips64r2}.
24341 @item -mips64r3
24342 @opindex mips64r3
24343 Equivalent to @option{-march=mips64r3}.
24345 @item -mips64r5
24346 @opindex mips64r5
24347 Equivalent to @option{-march=mips64r5}.
24349 @item -mips64r6
24350 @opindex mips64r6
24351 Equivalent to @option{-march=mips64r6}.
24353 @item -mips16
24354 @itemx -mno-mips16
24355 @opindex mips16
24356 @opindex mno-mips16
24357 Generate (do not generate) MIPS16 code.  If GCC is targeting a
24358 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
24360 MIPS16 code generation can also be controlled on a per-function basis
24361 by means of @code{mips16} and @code{nomips16} attributes.
24362 @xref{Function Attributes}, for more information.
24364 @item -mflip-mips16
24365 @opindex mflip-mips16
24366 Generate MIPS16 code on alternating functions.  This option is provided
24367 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
24368 not intended for ordinary use in compiling user code.
24370 @item -minterlink-compressed
24371 @itemx -mno-interlink-compressed
24372 @opindex minterlink-compressed
24373 @opindex mno-interlink-compressed
24374 Require (do not require) that code using the standard (uncompressed) MIPS ISA
24375 be link-compatible with MIPS16 and microMIPS code, and vice versa.
24377 For example, code using the standard ISA encoding cannot jump directly
24378 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
24379 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
24380 knows that the target of the jump is not compressed.
24382 @item -minterlink-mips16
24383 @itemx -mno-interlink-mips16
24384 @opindex minterlink-mips16
24385 @opindex mno-interlink-mips16
24386 Aliases of @option{-minterlink-compressed} and
24387 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
24388 and are retained for backwards compatibility.
24390 @item -mabi=32
24391 @itemx -mabi=o64
24392 @itemx -mabi=n32
24393 @itemx -mabi=64
24394 @itemx -mabi=eabi
24395 @opindex mabi=32
24396 @opindex mabi=o64
24397 @opindex mabi=n32
24398 @opindex mabi=64
24399 @opindex mabi=eabi
24400 Generate code for the given ABI@.
24402 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
24403 generates 64-bit code when you select a 64-bit architecture, but you
24404 can use @option{-mgp32} to get 32-bit code instead.
24406 For information about the O64 ABI, see
24407 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
24409 GCC supports a variant of the o32 ABI in which floating-point registers
24410 are 64 rather than 32 bits wide.  You can select this combination with
24411 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
24412 and @code{mfhc1} instructions and is therefore only supported for
24413 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
24415 The register assignments for arguments and return values remain the
24416 same, but each scalar value is passed in a single 64-bit register
24417 rather than a pair of 32-bit registers.  For example, scalar
24418 floating-point values are returned in @samp{$f0} only, not a
24419 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
24420 remains the same in that the even-numbered double-precision registers
24421 are saved.
24423 Two additional variants of the o32 ABI are supported to enable
24424 a transition from 32-bit to 64-bit registers.  These are FPXX
24425 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
24426 The FPXX extension mandates that all code must execute correctly
24427 when run using 32-bit or 64-bit registers.  The code can be interlinked
24428 with either FP32 or FP64, but not both.
24429 The FP64A extension is similar to the FP64 extension but forbids the
24430 use of odd-numbered single-precision registers.  This can be used
24431 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
24432 processors and allows both FP32 and FP64A code to interlink and
24433 run in the same process without changing FPU modes.
24435 @item -mabicalls
24436 @itemx -mno-abicalls
24437 @opindex mabicalls
24438 @opindex mno-abicalls
24439 Generate (do not generate) code that is suitable for SVR4-style
24440 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
24441 systems.
24443 @item -mshared
24444 @itemx -mno-shared
24445 Generate (do not generate) code that is fully position-independent,
24446 and that can therefore be linked into shared libraries.  This option
24447 only affects @option{-mabicalls}.
24449 All @option{-mabicalls} code has traditionally been position-independent,
24450 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
24451 as an extension, the GNU toolchain allows executables to use absolute
24452 accesses for locally-binding symbols.  It can also use shorter GP
24453 initialization sequences and generate direct calls to locally-defined
24454 functions.  This mode is selected by @option{-mno-shared}.
24456 @option{-mno-shared} depends on binutils 2.16 or higher and generates
24457 objects that can only be linked by the GNU linker.  However, the option
24458 does not affect the ABI of the final executable; it only affects the ABI
24459 of relocatable objects.  Using @option{-mno-shared} generally makes
24460 executables both smaller and quicker.
24462 @option{-mshared} is the default.
24464 @item -mplt
24465 @itemx -mno-plt
24466 @opindex mplt
24467 @opindex mno-plt
24468 Assume (do not assume) that the static and dynamic linkers
24469 support PLTs and copy relocations.  This option only affects
24470 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
24471 has no effect without @option{-msym32}.
24473 You can make @option{-mplt} the default by configuring
24474 GCC with @option{--with-mips-plt}.  The default is
24475 @option{-mno-plt} otherwise.
24477 @item -mxgot
24478 @itemx -mno-xgot
24479 @opindex mxgot
24480 @opindex mno-xgot
24481 Lift (do not lift) the usual restrictions on the size of the global
24482 offset table.
24484 GCC normally uses a single instruction to load values from the GOT@.
24485 While this is relatively efficient, it only works if the GOT
24486 is smaller than about 64k.  Anything larger causes the linker
24487 to report an error such as:
24489 @cindex relocation truncated to fit (MIPS)
24490 @smallexample
24491 relocation truncated to fit: R_MIPS_GOT16 foobar
24492 @end smallexample
24494 If this happens, you should recompile your code with @option{-mxgot}.
24495 This works with very large GOTs, although the code is also
24496 less efficient, since it takes three instructions to fetch the
24497 value of a global symbol.
24499 Note that some linkers can create multiple GOTs.  If you have such a
24500 linker, you should only need to use @option{-mxgot} when a single object
24501 file accesses more than 64k's worth of GOT entries.  Very few do.
24503 These options have no effect unless GCC is generating position
24504 independent code.
24506 @item -mgp32
24507 @opindex mgp32
24508 Assume that general-purpose registers are 32 bits wide.
24510 @item -mgp64
24511 @opindex mgp64
24512 Assume that general-purpose registers are 64 bits wide.
24514 @item -mfp32
24515 @opindex mfp32
24516 Assume that floating-point registers are 32 bits wide.
24518 @item -mfp64
24519 @opindex mfp64
24520 Assume that floating-point registers are 64 bits wide.
24522 @item -mfpxx
24523 @opindex mfpxx
24524 Do not assume the width of floating-point registers.
24526 @item -mhard-float
24527 @opindex mhard-float
24528 Use floating-point coprocessor instructions.
24530 @item -msoft-float
24531 @opindex msoft-float
24532 Do not use floating-point coprocessor instructions.  Implement
24533 floating-point calculations using library calls instead.
24535 @item -mno-float
24536 @opindex mno-float
24537 Equivalent to @option{-msoft-float}, but additionally asserts that the
24538 program being compiled does not perform any floating-point operations.
24539 This option is presently supported only by some bare-metal MIPS
24540 configurations, where it may select a special set of libraries
24541 that lack all floating-point support (including, for example, the
24542 floating-point @code{printf} formats).  
24543 If code compiled with @option{-mno-float} accidentally contains
24544 floating-point operations, it is likely to suffer a link-time
24545 or run-time failure.
24547 @item -msingle-float
24548 @opindex msingle-float
24549 Assume that the floating-point coprocessor only supports single-precision
24550 operations.
24552 @item -mdouble-float
24553 @opindex mdouble-float
24554 Assume that the floating-point coprocessor supports double-precision
24555 operations.  This is the default.
24557 @item -modd-spreg
24558 @itemx -mno-odd-spreg
24559 @opindex modd-spreg
24560 @opindex mno-odd-spreg
24561 Enable the use of odd-numbered single-precision floating-point registers
24562 for the o32 ABI.  This is the default for processors that are known to
24563 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
24564 is set by default.
24566 @item -mabs=2008
24567 @itemx -mabs=legacy
24568 @opindex mabs=2008
24569 @opindex mabs=legacy
24570 These options control the treatment of the special not-a-number (NaN)
24571 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
24572 @code{neg.@i{fmt}} machine instructions.
24574 By default or when @option{-mabs=legacy} is used the legacy
24575 treatment is selected.  In this case these instructions are considered
24576 arithmetic and avoided where correct operation is required and the
24577 input operand might be a NaN.  A longer sequence of instructions that
24578 manipulate the sign bit of floating-point datum manually is used
24579 instead unless the @option{-ffinite-math-only} option has also been
24580 specified.
24582 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
24583 this case these instructions are considered non-arithmetic and therefore
24584 operating correctly in all cases, including in particular where the
24585 input operand is a NaN.  These instructions are therefore always used
24586 for the respective operations.
24588 @item -mnan=2008
24589 @itemx -mnan=legacy
24590 @opindex mnan=2008
24591 @opindex mnan=legacy
24592 These options control the encoding of the special not-a-number (NaN)
24593 IEEE 754 floating-point data.
24595 The @option{-mnan=legacy} option selects the legacy encoding.  In this
24596 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
24597 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
24598 by the first bit of their trailing significand field being 1.
24600 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
24601 this case qNaNs are denoted by the first bit of their trailing
24602 significand field being 1, whereas sNaNs are denoted by the first bit of
24603 their trailing significand field being 0.
24605 The default is @option{-mnan=legacy} unless GCC has been configured with
24606 @option{--with-nan=2008}.
24608 @item -mllsc
24609 @itemx -mno-llsc
24610 @opindex mllsc
24611 @opindex mno-llsc
24612 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
24613 implement atomic memory built-in functions.  When neither option is
24614 specified, GCC uses the instructions if the target architecture
24615 supports them.
24617 @option{-mllsc} is useful if the runtime environment can emulate the
24618 instructions and @option{-mno-llsc} can be useful when compiling for
24619 nonstandard ISAs.  You can make either option the default by
24620 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
24621 respectively.  @option{--with-llsc} is the default for some
24622 configurations; see the installation documentation for details.
24624 @item -mdsp
24625 @itemx -mno-dsp
24626 @opindex mdsp
24627 @opindex mno-dsp
24628 Use (do not use) revision 1 of the MIPS DSP ASE@.
24629 @xref{MIPS DSP Built-in Functions}.  This option defines the
24630 preprocessor macro @code{__mips_dsp}.  It also defines
24631 @code{__mips_dsp_rev} to 1.
24633 @item -mdspr2
24634 @itemx -mno-dspr2
24635 @opindex mdspr2
24636 @opindex mno-dspr2
24637 Use (do not use) revision 2 of the MIPS DSP ASE@.
24638 @xref{MIPS DSP Built-in Functions}.  This option defines the
24639 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
24640 It also defines @code{__mips_dsp_rev} to 2.
24642 @item -msmartmips
24643 @itemx -mno-smartmips
24644 @opindex msmartmips
24645 @opindex mno-smartmips
24646 Use (do not use) the MIPS SmartMIPS ASE.
24648 @item -mpaired-single
24649 @itemx -mno-paired-single
24650 @opindex mpaired-single
24651 @opindex mno-paired-single
24652 Use (do not use) paired-single floating-point instructions.
24653 @xref{MIPS Paired-Single Support}.  This option requires
24654 hardware floating-point support to be enabled.
24656 @item -mdmx
24657 @itemx -mno-mdmx
24658 @opindex mdmx
24659 @opindex mno-mdmx
24660 Use (do not use) MIPS Digital Media Extension instructions.
24661 This option can only be used when generating 64-bit code and requires
24662 hardware floating-point support to be enabled.
24664 @item -mips3d
24665 @itemx -mno-mips3d
24666 @opindex mips3d
24667 @opindex mno-mips3d
24668 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
24669 The option @option{-mips3d} implies @option{-mpaired-single}.
24671 @item -mmicromips
24672 @itemx -mno-micromips
24673 @opindex mmicromips
24674 @opindex mno-mmicromips
24675 Generate (do not generate) microMIPS code.
24677 MicroMIPS code generation can also be controlled on a per-function basis
24678 by means of @code{micromips} and @code{nomicromips} attributes.
24679 @xref{Function Attributes}, for more information.
24681 @item -mmt
24682 @itemx -mno-mt
24683 @opindex mmt
24684 @opindex mno-mt
24685 Use (do not use) MT Multithreading instructions.
24687 @item -mmcu
24688 @itemx -mno-mcu
24689 @opindex mmcu
24690 @opindex mno-mcu
24691 Use (do not use) the MIPS MCU ASE instructions.
24693 @item -meva
24694 @itemx -mno-eva
24695 @opindex meva
24696 @opindex mno-eva
24697 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
24699 @item -mvirt
24700 @itemx -mno-virt
24701 @opindex mvirt
24702 @opindex mno-virt
24703 Use (do not use) the MIPS Virtualization (VZ) instructions.
24705 @item -mxpa
24706 @itemx -mno-xpa
24707 @opindex mxpa
24708 @opindex mno-xpa
24709 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
24711 @item -mcrc
24712 @itemx -mno-crc
24713 @opindex mcrc
24714 @opindex mno-crc
24715 Use (do not use) the MIPS Cyclic Redundancy Check (CRC) instructions.
24717 @item -mginv
24718 @itemx -mno-ginv
24719 @opindex mginv
24720 @opindex mno-ginv
24721 Use (do not use) the MIPS Global INValidate (GINV) instructions.
24723 @item -mloongson-mmi
24724 @itemx -mno-loongson-mmi
24725 @opindex mloongson-mmi
24726 @opindex mno-loongson-mmi
24727 Use (do not use) the MIPS Loongson MultiMedia extensions Instructions (MMI).
24729 @item -mloongson-ext
24730 @itemx -mno-loongson-ext
24731 @opindex mloongson-ext
24732 @opindex mno-loongson-ext
24733 Use (do not use) the MIPS Loongson EXTensions (EXT) instructions.
24735 @item -mloongson-ext2
24736 @itemx -mno-loongson-ext2
24737 @opindex mloongson-ext2
24738 @opindex mno-loongson-ext2
24739 Use (do not use) the MIPS Loongson EXTensions r2 (EXT2) instructions.
24741 @item -mlong64
24742 @opindex mlong64
24743 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
24744 an explanation of the default and the way that the pointer size is
24745 determined.
24747 @item -mlong32
24748 @opindex mlong32
24749 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
24751 The default size of @code{int}s, @code{long}s and pointers depends on
24752 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
24753 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
24754 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
24755 or the same size as integer registers, whichever is smaller.
24757 @item -msym32
24758 @itemx -mno-sym32
24759 @opindex msym32
24760 @opindex mno-sym32
24761 Assume (do not assume) that all symbols have 32-bit values, regardless
24762 of the selected ABI@.  This option is useful in combination with
24763 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
24764 to generate shorter and faster references to symbolic addresses.
24766 @item -G @var{num}
24767 @opindex G
24768 Put definitions of externally-visible data in a small data section
24769 if that data is no bigger than @var{num} bytes.  GCC can then generate
24770 more efficient accesses to the data; see @option{-mgpopt} for details.
24772 The default @option{-G} option depends on the configuration.
24774 @item -mlocal-sdata
24775 @itemx -mno-local-sdata
24776 @opindex mlocal-sdata
24777 @opindex mno-local-sdata
24778 Extend (do not extend) the @option{-G} behavior to local data too,
24779 such as to static variables in C@.  @option{-mlocal-sdata} is the
24780 default for all configurations.
24782 If the linker complains that an application is using too much small data,
24783 you might want to try rebuilding the less performance-critical parts with
24784 @option{-mno-local-sdata}.  You might also want to build large
24785 libraries with @option{-mno-local-sdata}, so that the libraries leave
24786 more room for the main program.
24788 @item -mextern-sdata
24789 @itemx -mno-extern-sdata
24790 @opindex mextern-sdata
24791 @opindex mno-extern-sdata
24792 Assume (do not assume) that externally-defined data is in
24793 a small data section if the size of that data is within the @option{-G} limit.
24794 @option{-mextern-sdata} is the default for all configurations.
24796 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
24797 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
24798 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
24799 is placed in a small data section.  If @var{Var} is defined by another
24800 module, you must either compile that module with a high-enough
24801 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
24802 definition.  If @var{Var} is common, you must link the application
24803 with a high-enough @option{-G} setting.
24805 The easiest way of satisfying these restrictions is to compile
24806 and link every module with the same @option{-G} option.  However,
24807 you may wish to build a library that supports several different
24808 small data limits.  You can do this by compiling the library with
24809 the highest supported @option{-G} setting and additionally using
24810 @option{-mno-extern-sdata} to stop the library from making assumptions
24811 about externally-defined data.
24813 @item -mgpopt
24814 @itemx -mno-gpopt
24815 @opindex mgpopt
24816 @opindex mno-gpopt
24817 Use (do not use) GP-relative accesses for symbols that are known to be
24818 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
24819 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
24820 configurations.
24822 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
24823 might not hold the value of @code{_gp}.  For example, if the code is
24824 part of a library that might be used in a boot monitor, programs that
24825 call boot monitor routines pass an unknown value in @code{$gp}.
24826 (In such situations, the boot monitor itself is usually compiled
24827 with @option{-G0}.)
24829 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
24830 @option{-mno-extern-sdata}.
24832 @item -membedded-data
24833 @itemx -mno-embedded-data
24834 @opindex membedded-data
24835 @opindex mno-embedded-data
24836 Allocate variables to the read-only data section first if possible, then
24837 next in the small data section if possible, otherwise in data.  This gives
24838 slightly slower code than the default, but reduces the amount of RAM required
24839 when executing, and thus may be preferred for some embedded systems.
24841 @item -muninit-const-in-rodata
24842 @itemx -mno-uninit-const-in-rodata
24843 @opindex muninit-const-in-rodata
24844 @opindex mno-uninit-const-in-rodata
24845 Put uninitialized @code{const} variables in the read-only data section.
24846 This option is only meaningful in conjunction with @option{-membedded-data}.
24848 @item -mcode-readable=@var{setting}
24849 @opindex mcode-readable
24850 Specify whether GCC may generate code that reads from executable sections.
24851 There are three possible settings:
24853 @table @gcctabopt
24854 @item -mcode-readable=yes
24855 Instructions may freely access executable sections.  This is the
24856 default setting.
24858 @item -mcode-readable=pcrel
24859 MIPS16 PC-relative load instructions can access executable sections,
24860 but other instructions must not do so.  This option is useful on 4KSc
24861 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
24862 It is also useful on processors that can be configured to have a dual
24863 instruction/data SRAM interface and that, like the M4K, automatically
24864 redirect PC-relative loads to the instruction RAM.
24866 @item -mcode-readable=no
24867 Instructions must not access executable sections.  This option can be
24868 useful on targets that are configured to have a dual instruction/data
24869 SRAM interface but that (unlike the M4K) do not automatically redirect
24870 PC-relative loads to the instruction RAM.
24871 @end table
24873 @item -msplit-addresses
24874 @itemx -mno-split-addresses
24875 @opindex msplit-addresses
24876 @opindex mno-split-addresses
24877 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
24878 relocation operators.  This option has been superseded by
24879 @option{-mexplicit-relocs} but is retained for backwards compatibility.
24881 @item -mexplicit-relocs
24882 @itemx -mno-explicit-relocs
24883 @opindex mexplicit-relocs
24884 @opindex mno-explicit-relocs
24885 Use (do not use) assembler relocation operators when dealing with symbolic
24886 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
24887 is to use assembler macros instead.
24889 @option{-mexplicit-relocs} is the default if GCC was configured
24890 to use an assembler that supports relocation operators.
24892 @item -mcheck-zero-division
24893 @itemx -mno-check-zero-division
24894 @opindex mcheck-zero-division
24895 @opindex mno-check-zero-division
24896 Trap (do not trap) on integer division by zero.
24898 The default is @option{-mcheck-zero-division}.
24900 @item -mdivide-traps
24901 @itemx -mdivide-breaks
24902 @opindex mdivide-traps
24903 @opindex mdivide-breaks
24904 MIPS systems check for division by zero by generating either a
24905 conditional trap or a break instruction.  Using traps results in
24906 smaller code, but is only supported on MIPS II and later.  Also, some
24907 versions of the Linux kernel have a bug that prevents trap from
24908 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
24909 allow conditional traps on architectures that support them and
24910 @option{-mdivide-breaks} to force the use of breaks.
24912 The default is usually @option{-mdivide-traps}, but this can be
24913 overridden at configure time using @option{--with-divide=breaks}.
24914 Divide-by-zero checks can be completely disabled using
24915 @option{-mno-check-zero-division}.
24917 @item -mload-store-pairs
24918 @itemx -mno-load-store-pairs
24919 @opindex mload-store-pairs
24920 @opindex mno-load-store-pairs
24921 Enable (disable) an optimization that pairs consecutive load or store
24922 instructions to enable load/store bonding.  This option is enabled by
24923 default but only takes effect when the selected architecture is known
24924 to support bonding.
24926 @item -mmemcpy
24927 @itemx -mno-memcpy
24928 @opindex mmemcpy
24929 @opindex mno-memcpy
24930 Force (do not force) the use of @code{memcpy} for non-trivial block
24931 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
24932 most constant-sized copies.
24934 @item -mlong-calls
24935 @itemx -mno-long-calls
24936 @opindex mlong-calls
24937 @opindex mno-long-calls
24938 Disable (do not disable) use of the @code{jal} instruction.  Calling
24939 functions using @code{jal} is more efficient but requires the caller
24940 and callee to be in the same 256 megabyte segment.
24942 This option has no effect on abicalls code.  The default is
24943 @option{-mno-long-calls}.
24945 @item -mmad
24946 @itemx -mno-mad
24947 @opindex mmad
24948 @opindex mno-mad
24949 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
24950 instructions, as provided by the R4650 ISA@.
24952 @item -mimadd
24953 @itemx -mno-imadd
24954 @opindex mimadd
24955 @opindex mno-imadd
24956 Enable (disable) use of the @code{madd} and @code{msub} integer
24957 instructions.  The default is @option{-mimadd} on architectures
24958 that support @code{madd} and @code{msub} except for the 74k 
24959 architecture where it was found to generate slower code.
24961 @item -mfused-madd
24962 @itemx -mno-fused-madd
24963 @opindex mfused-madd
24964 @opindex mno-fused-madd
24965 Enable (disable) use of the floating-point multiply-accumulate
24966 instructions, when they are available.  The default is
24967 @option{-mfused-madd}.
24969 On the R8000 CPU when multiply-accumulate instructions are used,
24970 the intermediate product is calculated to infinite precision
24971 and is not subject to the FCSR Flush to Zero bit.  This may be
24972 undesirable in some circumstances.  On other processors the result
24973 is numerically identical to the equivalent computation using
24974 separate multiply, add, subtract and negate instructions.
24976 @item -nocpp
24977 @opindex nocpp
24978 Tell the MIPS assembler to not run its preprocessor over user
24979 assembler files (with a @samp{.s} suffix) when assembling them.
24981 @item -mfix-24k
24982 @itemx -mno-fix-24k
24983 @opindex mfix-24k
24984 @opindex mno-fix-24k
24985 Work around the 24K E48 (lost data on stores during refill) errata.
24986 The workarounds are implemented by the assembler rather than by GCC@.
24988 @item -mfix-r4000
24989 @itemx -mno-fix-r4000
24990 @opindex mfix-r4000
24991 @opindex mno-fix-r4000
24992 Work around certain R4000 CPU errata:
24993 @itemize @minus
24994 @item
24995 A double-word or a variable shift may give an incorrect result if executed
24996 immediately after starting an integer division.
24997 @item
24998 A double-word or a variable shift may give an incorrect result if executed
24999 while an integer multiplication is in progress.
25000 @item
25001 An integer division may give an incorrect result if started in a delay slot
25002 of a taken branch or a jump.
25003 @end itemize
25005 @item -mfix-r4400
25006 @itemx -mno-fix-r4400
25007 @opindex mfix-r4400
25008 @opindex mno-fix-r4400
25009 Work around certain R4400 CPU errata:
25010 @itemize @minus
25011 @item
25012 A double-word or a variable shift may give an incorrect result if executed
25013 immediately after starting an integer division.
25014 @end itemize
25016 @item -mfix-r10000
25017 @itemx -mno-fix-r10000
25018 @opindex mfix-r10000
25019 @opindex mno-fix-r10000
25020 Work around certain R10000 errata:
25021 @itemize @minus
25022 @item
25023 @code{ll}/@code{sc} sequences may not behave atomically on revisions
25024 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
25025 @end itemize
25027 This option can only be used if the target architecture supports
25028 branch-likely instructions.  @option{-mfix-r10000} is the default when
25029 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
25030 otherwise.
25032 @item -mfix-r5900
25033 @itemx -mno-fix-r5900
25034 @opindex mfix-r5900
25035 Do not attempt to schedule the preceding instruction into the delay slot
25036 of a branch instruction placed at the end of a short loop of six
25037 instructions or fewer and always schedule a @code{nop} instruction there
25038 instead.  The short loop bug under certain conditions causes loops to
25039 execute only once or twice, due to a hardware bug in the R5900 chip.  The
25040 workaround is implemented by the assembler rather than by GCC@.
25042 @item -mfix-rm7000
25043 @itemx -mno-fix-rm7000
25044 @opindex mfix-rm7000
25045 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
25046 workarounds are implemented by the assembler rather than by GCC@.
25048 @item -mfix-vr4120
25049 @itemx -mno-fix-vr4120
25050 @opindex mfix-vr4120
25051 Work around certain VR4120 errata:
25052 @itemize @minus
25053 @item
25054 @code{dmultu} does not always produce the correct result.
25055 @item
25056 @code{div} and @code{ddiv} do not always produce the correct result if one
25057 of the operands is negative.
25058 @end itemize
25059 The workarounds for the division errata rely on special functions in
25060 @file{libgcc.a}.  At present, these functions are only provided by
25061 the @code{mips64vr*-elf} configurations.
25063 Other VR4120 errata require a NOP to be inserted between certain pairs of
25064 instructions.  These errata are handled by the assembler, not by GCC itself.
25066 @item -mfix-vr4130
25067 @opindex mfix-vr4130
25068 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
25069 workarounds are implemented by the assembler rather than by GCC,
25070 although GCC avoids using @code{mflo} and @code{mfhi} if the
25071 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
25072 instructions are available instead.
25074 @item -mfix-sb1
25075 @itemx -mno-fix-sb1
25076 @opindex mfix-sb1
25077 Work around certain SB-1 CPU core errata.
25078 (This flag currently works around the SB-1 revision 2
25079 ``F1'' and ``F2'' floating-point errata.)
25081 @item -mr10k-cache-barrier=@var{setting}
25082 @opindex mr10k-cache-barrier
25083 Specify whether GCC should insert cache barriers to avoid the
25084 side effects of speculation on R10K processors.
25086 In common with many processors, the R10K tries to predict the outcome
25087 of a conditional branch and speculatively executes instructions from
25088 the ``taken'' branch.  It later aborts these instructions if the
25089 predicted outcome is wrong.  However, on the R10K, even aborted
25090 instructions can have side effects.
25092 This problem only affects kernel stores and, depending on the system,
25093 kernel loads.  As an example, a speculatively-executed store may load
25094 the target memory into cache and mark the cache line as dirty, even if
25095 the store itself is later aborted.  If a DMA operation writes to the
25096 same area of memory before the ``dirty'' line is flushed, the cached
25097 data overwrites the DMA-ed data.  See the R10K processor manual
25098 for a full description, including other potential problems.
25100 One workaround is to insert cache barrier instructions before every memory
25101 access that might be speculatively executed and that might have side
25102 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
25103 controls GCC's implementation of this workaround.  It assumes that
25104 aborted accesses to any byte in the following regions does not have
25105 side effects:
25107 @enumerate
25108 @item
25109 the memory occupied by the current function's stack frame;
25111 @item
25112 the memory occupied by an incoming stack argument;
25114 @item
25115 the memory occupied by an object with a link-time-constant address.
25116 @end enumerate
25118 It is the kernel's responsibility to ensure that speculative
25119 accesses to these regions are indeed safe.
25121 If the input program contains a function declaration such as:
25123 @smallexample
25124 void foo (void);
25125 @end smallexample
25127 then the implementation of @code{foo} must allow @code{j foo} and
25128 @code{jal foo} to be executed speculatively.  GCC honors this
25129 restriction for functions it compiles itself.  It expects non-GCC
25130 functions (such as hand-written assembly code) to do the same.
25132 The option has three forms:
25134 @table @gcctabopt
25135 @item -mr10k-cache-barrier=load-store
25136 Insert a cache barrier before a load or store that might be
25137 speculatively executed and that might have side effects even
25138 if aborted.
25140 @item -mr10k-cache-barrier=store
25141 Insert a cache barrier before a store that might be speculatively
25142 executed and that might have side effects even if aborted.
25144 @item -mr10k-cache-barrier=none
25145 Disable the insertion of cache barriers.  This is the default setting.
25146 @end table
25148 @item -mflush-func=@var{func}
25149 @itemx -mno-flush-func
25150 @opindex mflush-func
25151 Specifies the function to call to flush the I and D caches, or to not
25152 call any such function.  If called, the function must take the same
25153 arguments as the common @code{_flush_func}, that is, the address of the
25154 memory range for which the cache is being flushed, the size of the
25155 memory range, and the number 3 (to flush both caches).  The default
25156 depends on the target GCC was configured for, but commonly is either
25157 @code{_flush_func} or @code{__cpu_flush}.
25159 @item mbranch-cost=@var{num}
25160 @opindex mbranch-cost
25161 Set the cost of branches to roughly @var{num} ``simple'' instructions.
25162 This cost is only a heuristic and is not guaranteed to produce
25163 consistent results across releases.  A zero cost redundantly selects
25164 the default, which is based on the @option{-mtune} setting.
25166 @item -mbranch-likely
25167 @itemx -mno-branch-likely
25168 @opindex mbranch-likely
25169 @opindex mno-branch-likely
25170 Enable or disable use of Branch Likely instructions, regardless of the
25171 default for the selected architecture.  By default, Branch Likely
25172 instructions may be generated if they are supported by the selected
25173 architecture.  An exception is for the MIPS32 and MIPS64 architectures
25174 and processors that implement those architectures; for those, Branch
25175 Likely instructions are not be generated by default because the MIPS32
25176 and MIPS64 architectures specifically deprecate their use.
25178 @item -mcompact-branches=never
25179 @itemx -mcompact-branches=optimal
25180 @itemx -mcompact-branches=always
25181 @opindex mcompact-branches=never
25182 @opindex mcompact-branches=optimal
25183 @opindex mcompact-branches=always
25184 These options control which form of branches will be generated.  The
25185 default is @option{-mcompact-branches=optimal}.
25187 The @option{-mcompact-branches=never} option ensures that compact branch
25188 instructions will never be generated.
25190 The @option{-mcompact-branches=always} option ensures that a compact
25191 branch instruction will be generated if available.  If a compact branch
25192 instruction is not available, a delay slot form of the branch will be
25193 used instead.
25195 This option is supported from MIPS Release 6 onwards.
25197 The @option{-mcompact-branches=optimal} option will cause a delay slot
25198 branch to be used if one is available in the current ISA and the delay
25199 slot is successfully filled.  If the delay slot is not filled, a compact
25200 branch will be chosen if one is available.
25202 @item -mfp-exceptions
25203 @itemx -mno-fp-exceptions
25204 @opindex mfp-exceptions
25205 Specifies whether FP exceptions are enabled.  This affects how
25206 FP instructions are scheduled for some processors.
25207 The default is that FP exceptions are
25208 enabled.
25210 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
25211 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
25212 FP pipe.
25214 @item -mvr4130-align
25215 @itemx -mno-vr4130-align
25216 @opindex mvr4130-align
25217 The VR4130 pipeline is two-way superscalar, but can only issue two
25218 instructions together if the first one is 8-byte aligned.  When this
25219 option is enabled, GCC aligns pairs of instructions that it
25220 thinks should execute in parallel.
25222 This option only has an effect when optimizing for the VR4130.
25223 It normally makes code faster, but at the expense of making it bigger.
25224 It is enabled by default at optimization level @option{-O3}.
25226 @item -msynci
25227 @itemx -mno-synci
25228 @opindex msynci
25229 Enable (disable) generation of @code{synci} instructions on
25230 architectures that support it.  The @code{synci} instructions (if
25231 enabled) are generated when @code{__builtin___clear_cache} is
25232 compiled.
25234 This option defaults to @option{-mno-synci}, but the default can be
25235 overridden by configuring GCC with @option{--with-synci}.
25237 When compiling code for single processor systems, it is generally safe
25238 to use @code{synci}.  However, on many multi-core (SMP) systems, it
25239 does not invalidate the instruction caches on all cores and may lead
25240 to undefined behavior.
25242 @item -mrelax-pic-calls
25243 @itemx -mno-relax-pic-calls
25244 @opindex mrelax-pic-calls
25245 Try to turn PIC calls that are normally dispatched via register
25246 @code{$25} into direct calls.  This is only possible if the linker can
25247 resolve the destination at link time and if the destination is within
25248 range for a direct call.
25250 @option{-mrelax-pic-calls} is the default if GCC was configured to use
25251 an assembler and a linker that support the @code{.reloc} assembly
25252 directive and @option{-mexplicit-relocs} is in effect.  With
25253 @option{-mno-explicit-relocs}, this optimization can be performed by the
25254 assembler and the linker alone without help from the compiler.
25256 @item -mmcount-ra-address
25257 @itemx -mno-mcount-ra-address
25258 @opindex mmcount-ra-address
25259 @opindex mno-mcount-ra-address
25260 Emit (do not emit) code that allows @code{_mcount} to modify the
25261 calling function's return address.  When enabled, this option extends
25262 the usual @code{_mcount} interface with a new @var{ra-address}
25263 parameter, which has type @code{intptr_t *} and is passed in register
25264 @code{$12}.  @code{_mcount} can then modify the return address by
25265 doing both of the following:
25266 @itemize
25267 @item
25268 Returning the new address in register @code{$31}.
25269 @item
25270 Storing the new address in @code{*@var{ra-address}},
25271 if @var{ra-address} is nonnull.
25272 @end itemize
25274 The default is @option{-mno-mcount-ra-address}.
25276 @item -mframe-header-opt
25277 @itemx -mno-frame-header-opt
25278 @opindex mframe-header-opt
25279 Enable (disable) frame header optimization in the o32 ABI.  When using the
25280 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
25281 function to write out register arguments.  When enabled, this optimization
25282 will suppress the allocation of the frame header if it can be determined that
25283 it is unused.
25285 This optimization is off by default at all optimization levels.
25287 @item -mlxc1-sxc1
25288 @itemx -mno-lxc1-sxc1
25289 @opindex mlxc1-sxc1
25290 When applicable, enable (disable) the generation of @code{lwxc1},
25291 @code{swxc1}, @code{ldxc1}, @code{sdxc1} instructions.  Enabled by default.
25293 @item -mmadd4
25294 @itemx -mno-madd4
25295 @opindex mmadd4
25296 When applicable, enable (disable) the generation of 4-operand @code{madd.s},
25297 @code{madd.d} and related instructions.  Enabled by default.
25299 @end table
25301 @node MMIX Options
25302 @subsection MMIX Options
25303 @cindex MMIX Options
25305 These options are defined for the MMIX:
25307 @table @gcctabopt
25308 @item -mlibfuncs
25309 @itemx -mno-libfuncs
25310 @opindex mlibfuncs
25311 @opindex mno-libfuncs
25312 Specify that intrinsic library functions are being compiled, passing all
25313 values in registers, no matter the size.
25315 @item -mepsilon
25316 @itemx -mno-epsilon
25317 @opindex mepsilon
25318 @opindex mno-epsilon
25319 Generate floating-point comparison instructions that compare with respect
25320 to the @code{rE} epsilon register.
25322 @item -mabi=mmixware
25323 @itemx -mabi=gnu
25324 @opindex mabi=mmixware
25325 @opindex mabi=gnu
25326 Generate code that passes function parameters and return values that (in
25327 the called function) are seen as registers @code{$0} and up, as opposed to
25328 the GNU ABI which uses global registers @code{$231} and up.
25330 @item -mzero-extend
25331 @itemx -mno-zero-extend
25332 @opindex mzero-extend
25333 @opindex mno-zero-extend
25334 When reading data from memory in sizes shorter than 64 bits, use (do not
25335 use) zero-extending load instructions by default, rather than
25336 sign-extending ones.
25338 @item -mknuthdiv
25339 @itemx -mno-knuthdiv
25340 @opindex mknuthdiv
25341 @opindex mno-knuthdiv
25342 Make the result of a division yielding a remainder have the same sign as
25343 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
25344 remainder follows the sign of the dividend.  Both methods are
25345 arithmetically valid, the latter being almost exclusively used.
25347 @item -mtoplevel-symbols
25348 @itemx -mno-toplevel-symbols
25349 @opindex mtoplevel-symbols
25350 @opindex mno-toplevel-symbols
25351 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
25352 code can be used with the @code{PREFIX} assembly directive.
25354 @item -melf
25355 @opindex melf
25356 Generate an executable in the ELF format, rather than the default
25357 @samp{mmo} format used by the @command{mmix} simulator.
25359 @item -mbranch-predict
25360 @itemx -mno-branch-predict
25361 @opindex mbranch-predict
25362 @opindex mno-branch-predict
25363 Use (do not use) the probable-branch instructions, when static branch
25364 prediction indicates a probable branch.
25366 @item -mbase-addresses
25367 @itemx -mno-base-addresses
25368 @opindex mbase-addresses
25369 @opindex mno-base-addresses
25370 Generate (do not generate) code that uses @emph{base addresses}.  Using a
25371 base address automatically generates a request (handled by the assembler
25372 and the linker) for a constant to be set up in a global register.  The
25373 register is used for one or more base address requests within the range 0
25374 to 255 from the value held in the register.  The generally leads to short
25375 and fast code, but the number of different data items that can be
25376 addressed is limited.  This means that a program that uses lots of static
25377 data may require @option{-mno-base-addresses}.
25379 @item -msingle-exit
25380 @itemx -mno-single-exit
25381 @opindex msingle-exit
25382 @opindex mno-single-exit
25383 Force (do not force) generated code to have a single exit point in each
25384 function.
25385 @end table
25387 @node MN10300 Options
25388 @subsection MN10300 Options
25389 @cindex MN10300 options
25391 These @option{-m} options are defined for Matsushita MN10300 architectures:
25393 @table @gcctabopt
25394 @item -mmult-bug
25395 @opindex mmult-bug
25396 Generate code to avoid bugs in the multiply instructions for the MN10300
25397 processors.  This is the default.
25399 @item -mno-mult-bug
25400 @opindex mno-mult-bug
25401 Do not generate code to avoid bugs in the multiply instructions for the
25402 MN10300 processors.
25404 @item -mam33
25405 @opindex mam33
25406 Generate code using features specific to the AM33 processor.
25408 @item -mno-am33
25409 @opindex mno-am33
25410 Do not generate code using features specific to the AM33 processor.  This
25411 is the default.
25413 @item -mam33-2
25414 @opindex mam33-2
25415 Generate code using features specific to the AM33/2.0 processor.
25417 @item -mam34
25418 @opindex mam34
25419 Generate code using features specific to the AM34 processor.
25421 @item -mtune=@var{cpu-type}
25422 @opindex mtune
25423 Use the timing characteristics of the indicated CPU type when
25424 scheduling instructions.  This does not change the targeted processor
25425 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
25426 @samp{am33-2} or @samp{am34}.
25428 @item -mreturn-pointer-on-d0
25429 @opindex mreturn-pointer-on-d0
25430 When generating a function that returns a pointer, return the pointer
25431 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
25432 only in @code{a0}, and attempts to call such functions without a prototype
25433 result in errors.  Note that this option is on by default; use
25434 @option{-mno-return-pointer-on-d0} to disable it.
25436 @item -mno-crt0
25437 @opindex mno-crt0
25438 Do not link in the C run-time initialization object file.
25440 @item -mrelax
25441 @opindex mrelax
25442 Indicate to the linker that it should perform a relaxation optimization pass
25443 to shorten branches, calls and absolute memory addresses.  This option only
25444 has an effect when used on the command line for the final link step.
25446 This option makes symbolic debugging impossible.
25448 @item -mliw
25449 @opindex mliw
25450 Allow the compiler to generate @emph{Long Instruction Word}
25451 instructions if the target is the @samp{AM33} or later.  This is the
25452 default.  This option defines the preprocessor macro @code{__LIW__}.
25454 @item -mno-liw
25455 @opindex mno-liw
25456 Do not allow the compiler to generate @emph{Long Instruction Word}
25457 instructions.  This option defines the preprocessor macro
25458 @code{__NO_LIW__}.
25460 @item -msetlb
25461 @opindex msetlb
25462 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
25463 instructions if the target is the @samp{AM33} or later.  This is the
25464 default.  This option defines the preprocessor macro @code{__SETLB__}.
25466 @item -mno-setlb
25467 @opindex mno-setlb
25468 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
25469 instructions.  This option defines the preprocessor macro
25470 @code{__NO_SETLB__}.
25472 @end table
25474 @node Moxie Options
25475 @subsection Moxie Options
25476 @cindex Moxie Options
25478 @table @gcctabopt
25480 @item -meb
25481 @opindex meb
25482 Generate big-endian code.  This is the default for @samp{moxie-*-*}
25483 configurations.
25485 @item -mel
25486 @opindex mel
25487 Generate little-endian code.
25489 @item -mmul.x
25490 @opindex mmul.x
25491 Generate mul.x and umul.x instructions.  This is the default for
25492 @samp{moxiebox-*-*} configurations.
25494 @item -mno-crt0
25495 @opindex mno-crt0
25496 Do not link in the C run-time initialization object file.
25498 @end table
25500 @node MSP430 Options
25501 @subsection MSP430 Options
25502 @cindex MSP430 Options
25504 These options are defined for the MSP430:
25506 @table @gcctabopt
25508 @item -masm-hex
25509 @opindex masm-hex
25510 Force assembly output to always use hex constants.  Normally such
25511 constants are signed decimals, but this option is available for
25512 testsuite and/or aesthetic purposes.
25514 @item -mmcu=
25515 @opindex mmcu=
25516 Select the MCU to target.  This is used to create a C preprocessor
25517 symbol based upon the MCU name, converted to upper case and pre- and
25518 post-fixed with @samp{__}.  This in turn is used by the
25519 @file{msp430.h} header file to select an MCU-specific supplementary
25520 header file.
25522 The option also sets the ISA to use.  If the MCU name is one that is
25523 known to only support the 430 ISA then that is selected, otherwise the
25524 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
25525 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
25526 name selects the 430X ISA.
25528 In addition an MCU-specific linker script is added to the linker
25529 command line.  The script's name is the name of the MCU with
25530 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
25531 command line defines the C preprocessor symbol @code{__XXX__} and
25532 cause the linker to search for a script called @file{xxx.ld}.
25534 The ISA and hardware multiply supported for the different MCUs is hard-coded
25535 into GCC.  However, an external @samp{devices.csv} file can be used to
25536 extend device support beyond those that have been hard-coded.
25538 GCC searches for the @samp{devices.csv} file using the following methods in the
25539 given precedence order, where the first method takes precendence over the
25540 second which takes precedence over the third.
25542 @table @asis
25543 @item Include path specified with @code{-I} and @code{-L}
25544 @samp{devices.csv} will be searched for in each of the directories specified by
25545 include paths and linker library search paths.
25546 @item Path specified by the environment variable @samp{MSP430_GCC_INCLUDE_DIR}
25547 Define the value of the global environment variable
25548 @samp{MSP430_GCC_INCLUDE_DIR}
25549 to the full path to the directory containing devices.csv, and GCC will search
25550 this directory for devices.csv.  If devices.csv is found, this directory will
25551 also be registered as an include path, and linker library path.  Header files
25552 and linker scripts in this directory can therefore be used without manually
25553 specifying @code{-I} and @code{-L} on the command line.
25554 @item The @samp{msp430-elf@{,bare@}/include/devices} directory
25555 Finally, GCC will examine @samp{msp430-elf@{,bare@}/include/devices} from the
25556 toolchain root directory.  This directory does not exist in a default
25557 installation, but if the user has created it and copied @samp{devices.csv}
25558 there, then the MCU data will be read.  As above, this directory will
25559 also be registered as an include path, and linker library path.
25561 @end table
25562 If none of the above search methods find @samp{devices.csv}, then the
25563 hard-coded MCU data is used.
25566 @item -mwarn-mcu
25567 @itemx -mno-warn-mcu
25568 @opindex mwarn-mcu
25569 @opindex mno-warn-mcu
25570 This option enables or disables warnings about conflicts between the
25571 MCU name specified by the @option{-mmcu} option and the ISA set by the
25572 @option{-mcpu} option and/or the hardware multiply support set by the
25573 @option{-mhwmult} option.  It also toggles warnings about unrecognized
25574 MCU names.  This option is on by default.
25576 @item -mcpu=
25577 @opindex mcpu=
25578 Specifies the ISA to use.  Accepted values are @samp{msp430},
25579 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
25580 @option{-mmcu=} option should be used to select the ISA.
25582 @item -msim
25583 @opindex msim
25584 Link to the simulator runtime libraries and linker script.  Overrides
25585 any scripts that would be selected by the @option{-mmcu=} option.
25587 @item -mlarge
25588 @opindex mlarge
25589 Use large-model addressing (20-bit pointers, 20-bit @code{size_t}).
25591 @item -msmall
25592 @opindex msmall
25593 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
25595 @item -mrelax
25596 @opindex mrelax
25597 This option is passed to the assembler and linker, and allows the
25598 linker to perform certain optimizations that cannot be done until
25599 the final link.
25601 @item mhwmult=
25602 @opindex mhwmult=
25603 Describes the type of hardware multiply supported by the target.
25604 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
25605 for the original 16-bit-only multiply supported by early MCUs.
25606 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
25607 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
25608 A value of @samp{auto} can also be given.  This tells GCC to deduce
25609 the hardware multiply support based upon the MCU name provided by the
25610 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
25611 the MCU name is not recognized then no hardware multiply support is
25612 assumed.  @code{auto} is the default setting.
25614 Hardware multiplies are normally performed by calling a library
25615 routine.  This saves space in the generated code.  When compiling at
25616 @option{-O3} or higher however the hardware multiplier is invoked
25617 inline.  This makes for bigger, but faster code.
25619 The hardware multiply routines disable interrupts whilst running and
25620 restore the previous interrupt state when they finish.  This makes
25621 them safe to use inside interrupt handlers as well as in normal code.
25623 @item -minrt
25624 @opindex minrt
25625 Enable the use of a minimum runtime environment - no static
25626 initializers or constructors.  This is intended for memory-constrained
25627 devices.  The compiler includes special symbols in some objects
25628 that tell the linker and runtime which code fragments are required.
25630 @item -mtiny-printf
25631 @opindex mtiny-printf
25632 Enable reduced code size @code{printf} and @code{puts} library functions.
25633 The @samp{tiny} implementations of these functions are not reentrant, so
25634 must be used with caution in multi-threaded applications.
25636 Support for streams has been removed and the string to be printed will
25637 always be sent to stdout via the @code{write} syscall.  The string is not
25638 buffered before it is sent to write.
25640 This option requires Newlib Nano IO, so GCC must be configured with
25641 @samp{--enable-newlib-nano-formatted-io}.
25643 @item -mmax-inline-shift=
25644 @opindex mmax-inline-shift=
25645 This option takes an integer between 0 and 64 inclusive, and sets
25646 the maximum number of inline shift instructions which should be emitted to
25647 perform a shift operation by a constant amount.  When this value needs to be
25648 exceeded, an mspabi helper function is used instead.  The default value is 4.
25650 This only affects cases where a shift by multiple positions cannot be
25651 completed with a single instruction (e.g. all shifts >1 on the 430 ISA).
25653 Shifts of a 32-bit value are at least twice as costly, so the value passed for
25654 this option is divided by 2 and the resulting value used instead.
25656 @item -mcode-region=
25657 @itemx -mdata-region=
25658 @opindex mcode-region
25659 @opindex mdata-region
25660 These options tell the compiler where to place functions and data that
25661 do not have one of the @code{lower}, @code{upper}, @code{either} or
25662 @code{section} attributes.  Possible values are @code{lower},
25663 @code{upper}, @code{either} or @code{any}.  The first three behave
25664 like the corresponding attribute.  The fourth possible value -
25665 @code{any} - is the default.  It leaves placement entirely up to the
25666 linker script and how it assigns the standard sections
25667 (@code{.text}, @code{.data}, etc) to the memory regions.
25669 @item -msilicon-errata=
25670 @opindex msilicon-errata
25671 This option passes on a request to assembler to enable the fixes for
25672 the named silicon errata.
25674 @item -msilicon-errata-warn=
25675 @opindex msilicon-errata-warn
25676 This option passes on a request to the assembler to enable warning
25677 messages when a silicon errata might need to be applied.
25679 @item -mwarn-devices-csv
25680 @itemx -mno-warn-devices-csv
25681 @opindex mwarn-devices-csv
25682 @opindex mno-warn-devices-csv
25683 Warn if @samp{devices.csv} is not found or there are problem parsing it
25684 (default: on).
25686 @end table
25688 @node NDS32 Options
25689 @subsection NDS32 Options
25690 @cindex NDS32 Options
25692 These options are defined for NDS32 implementations:
25694 @table @gcctabopt
25696 @item -mbig-endian
25697 @opindex mbig-endian
25698 Generate code in big-endian mode.
25700 @item -mlittle-endian
25701 @opindex mlittle-endian
25702 Generate code in little-endian mode.
25704 @item -mreduced-regs
25705 @opindex mreduced-regs
25706 Use reduced-set registers for register allocation.
25708 @item -mfull-regs
25709 @opindex mfull-regs
25710 Use full-set registers for register allocation.
25712 @item -mcmov
25713 @opindex mcmov
25714 Generate conditional move instructions.
25716 @item -mno-cmov
25717 @opindex mno-cmov
25718 Do not generate conditional move instructions.
25720 @item -mext-perf
25721 @opindex mext-perf
25722 Generate performance extension instructions.
25724 @item -mno-ext-perf
25725 @opindex mno-ext-perf
25726 Do not generate performance extension instructions.
25728 @item -mext-perf2
25729 @opindex mext-perf2
25730 Generate performance extension 2 instructions.
25732 @item -mno-ext-perf2
25733 @opindex mno-ext-perf2
25734 Do not generate performance extension 2 instructions.
25736 @item -mext-string
25737 @opindex mext-string
25738 Generate string extension instructions.
25740 @item -mno-ext-string
25741 @opindex mno-ext-string
25742 Do not generate string extension instructions.
25744 @item -mv3push
25745 @opindex mv3push
25746 Generate v3 push25/pop25 instructions.
25748 @item -mno-v3push
25749 @opindex mno-v3push
25750 Do not generate v3 push25/pop25 instructions.
25752 @item -m16-bit
25753 @opindex m16-bit
25754 Generate 16-bit instructions.
25756 @item -mno-16-bit
25757 @opindex mno-16-bit
25758 Do not generate 16-bit instructions.
25760 @item -misr-vector-size=@var{num}
25761 @opindex misr-vector-size
25762 Specify the size of each interrupt vector, which must be 4 or 16.
25764 @item -mcache-block-size=@var{num}
25765 @opindex mcache-block-size
25766 Specify the size of each cache block,
25767 which must be a power of 2 between 4 and 512.
25769 @item -march=@var{arch}
25770 @opindex march
25771 Specify the name of the target architecture.
25773 @item -mcmodel=@var{code-model}
25774 @opindex mcmodel
25775 Set the code model to one of
25776 @table @asis
25777 @item @samp{small}
25778 All the data and read-only data segments must be within 512KB addressing space.
25779 The text segment must be within 16MB addressing space.
25780 @item @samp{medium}
25781 The data segment must be within 512KB while the read-only data segment can be
25782 within 4GB addressing space.  The text segment should be still within 16MB
25783 addressing space.
25784 @item @samp{large}
25785 All the text and data segments can be within 4GB addressing space.
25786 @end table
25788 @item -mctor-dtor
25789 @opindex mctor-dtor
25790 Enable constructor/destructor feature.
25792 @item -mrelax
25793 @opindex mrelax
25794 Guide linker to relax instructions.
25796 @end table
25798 @node Nios II Options
25799 @subsection Nios II Options
25800 @cindex Nios II options
25801 @cindex Altera Nios II options
25803 These are the options defined for the Altera Nios II processor.
25805 @table @gcctabopt
25807 @item -G @var{num}
25808 @opindex G
25809 @cindex smaller data references
25810 Put global and static objects less than or equal to @var{num} bytes
25811 into the small data or BSS sections instead of the normal data or BSS
25812 sections.  The default value of @var{num} is 8.
25814 @item -mgpopt=@var{option}
25815 @itemx -mgpopt
25816 @itemx -mno-gpopt
25817 @opindex mgpopt
25818 @opindex mno-gpopt
25819 Generate (do not generate) GP-relative accesses.  The following 
25820 @var{option} names are recognized:
25822 @table @samp
25824 @item none
25825 Do not generate GP-relative accesses.
25827 @item local
25828 Generate GP-relative accesses for small data objects that are not 
25829 external, weak, or uninitialized common symbols.  
25830 Also use GP-relative addressing for objects that
25831 have been explicitly placed in a small data section via a @code{section}
25832 attribute.
25834 @item global
25835 As for @samp{local}, but also generate GP-relative accesses for
25836 small data objects that are external, weak, or common.  If you use this option,
25837 you must ensure that all parts of your program (including libraries) are
25838 compiled with the same @option{-G} setting.
25840 @item data
25841 Generate GP-relative accesses for all data objects in the program.  If you
25842 use this option, the entire data and BSS segments
25843 of your program must fit in 64K of memory and you must use an appropriate
25844 linker script to allocate them within the addressable range of the
25845 global pointer.
25847 @item all
25848 Generate GP-relative addresses for function pointers as well as data
25849 pointers.  If you use this option, the entire text, data, and BSS segments
25850 of your program must fit in 64K of memory and you must use an appropriate
25851 linker script to allocate them within the addressable range of the
25852 global pointer.
25854 @end table
25856 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
25857 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
25859 The default is @option{-mgpopt} except when @option{-fpic} or
25860 @option{-fPIC} is specified to generate position-independent code.
25861 Note that the Nios II ABI does not permit GP-relative accesses from
25862 shared libraries.
25864 You may need to specify @option{-mno-gpopt} explicitly when building
25865 programs that include large amounts of small data, including large
25866 GOT data sections.  In this case, the 16-bit offset for GP-relative
25867 addressing may not be large enough to allow access to the entire 
25868 small data section.
25870 @item -mgprel-sec=@var{regexp}
25871 @opindex mgprel-sec
25872 This option specifies additional section names that can be accessed via
25873 GP-relative addressing.  It is most useful in conjunction with 
25874 @code{section} attributes on variable declarations 
25875 (@pxref{Common Variable Attributes}) and a custom linker script.  
25876 The @var{regexp} is a POSIX Extended Regular Expression.
25878 This option does not affect the behavior of the @option{-G} option, and 
25879 the specified sections are in addition to the standard @code{.sdata}
25880 and @code{.sbss} small-data sections that are recognized by @option{-mgpopt}.
25882 @item -mr0rel-sec=@var{regexp}
25883 @opindex mr0rel-sec
25884 This option specifies names of sections that can be accessed via a 
25885 16-bit offset from @code{r0}; that is, in the low 32K or high 32K 
25886 of the 32-bit address space.  It is most useful in conjunction with 
25887 @code{section} attributes on variable declarations 
25888 (@pxref{Common Variable Attributes}) and a custom linker script.  
25889 The @var{regexp} is a POSIX Extended Regular Expression.
25891 In contrast to the use of GP-relative addressing for small data, 
25892 zero-based addressing is never generated by default and there are no 
25893 conventional section names used in standard linker scripts for sections
25894 in the low or high areas of memory.
25896 @item -mel
25897 @itemx -meb
25898 @opindex mel
25899 @opindex meb
25900 Generate little-endian (default) or big-endian (experimental) code,
25901 respectively.
25903 @item -march=@var{arch}
25904 @opindex march
25905 This specifies the name of the target Nios II architecture.  GCC uses this
25906 name to determine what kind of instructions it can emit when generating
25907 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
25909 The preprocessor macro @code{__nios2_arch__} is available to programs,
25910 with value 1 or 2, indicating the targeted ISA level.
25912 @item -mbypass-cache
25913 @itemx -mno-bypass-cache
25914 @opindex mno-bypass-cache
25915 @opindex mbypass-cache
25916 Force all load and store instructions to always bypass cache by 
25917 using I/O variants of the instructions. The default is not to
25918 bypass the cache.
25920 @item -mno-cache-volatile 
25921 @itemx -mcache-volatile       
25922 @opindex mcache-volatile 
25923 @opindex mno-cache-volatile
25924 Volatile memory access bypass the cache using the I/O variants of 
25925 the load and store instructions. The default is not to bypass the cache.
25927 @item -mno-fast-sw-div
25928 @itemx -mfast-sw-div
25929 @opindex mno-fast-sw-div
25930 @opindex mfast-sw-div
25931 Do not use table-based fast divide for small numbers. The default 
25932 is to use the fast divide at @option{-O3} and above.
25934 @item -mno-hw-mul
25935 @itemx -mhw-mul
25936 @itemx -mno-hw-mulx
25937 @itemx -mhw-mulx
25938 @itemx -mno-hw-div
25939 @itemx -mhw-div
25940 @opindex mno-hw-mul
25941 @opindex mhw-mul
25942 @opindex mno-hw-mulx
25943 @opindex mhw-mulx
25944 @opindex mno-hw-div
25945 @opindex mhw-div
25946 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
25947 instructions by the compiler. The default is to emit @code{mul}
25948 and not emit @code{div} and @code{mulx}.
25950 @item -mbmx
25951 @itemx -mno-bmx
25952 @itemx -mcdx
25953 @itemx -mno-cdx
25954 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
25955 CDX (code density) instructions.  Enabling these instructions also
25956 requires @option{-march=r2}.  Since these instructions are optional
25957 extensions to the R2 architecture, the default is not to emit them.
25959 @item -mcustom-@var{insn}=@var{N}
25960 @itemx -mno-custom-@var{insn}
25961 @opindex mcustom-@var{insn}
25962 @opindex mno-custom-@var{insn}
25963 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
25964 custom instruction with encoding @var{N} when generating code that uses 
25965 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
25966 instruction 253 for single-precision floating-point add operations instead
25967 of the default behavior of using a library call.
25969 The following values of @var{insn} are supported.  Except as otherwise
25970 noted, floating-point operations are expected to be implemented with
25971 normal IEEE 754 semantics and correspond directly to the C operators or the
25972 equivalent GCC built-in functions (@pxref{Other Builtins}).
25974 Single-precision floating point:
25975 @table @asis
25977 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
25978 Binary arithmetic operations.
25980 @item @samp{fnegs}
25981 Unary negation.
25983 @item @samp{fabss}
25984 Unary absolute value.
25986 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
25987 Comparison operations.
25989 @item @samp{fmins}, @samp{fmaxs}
25990 Floating-point minimum and maximum.  These instructions are only
25991 generated if @option{-ffinite-math-only} is specified.
25993 @item @samp{fsqrts}
25994 Unary square root operation.
25996 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
25997 Floating-point trigonometric and exponential functions.  These instructions
25998 are only generated if @option{-funsafe-math-optimizations} is also specified.
26000 @end table
26002 Double-precision floating point:
26003 @table @asis
26005 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
26006 Binary arithmetic operations.
26008 @item @samp{fnegd}
26009 Unary negation.
26011 @item @samp{fabsd}
26012 Unary absolute value.
26014 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
26015 Comparison operations.
26017 @item @samp{fmind}, @samp{fmaxd}
26018 Double-precision minimum and maximum.  These instructions are only
26019 generated if @option{-ffinite-math-only} is specified.
26021 @item @samp{fsqrtd}
26022 Unary square root operation.
26024 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
26025 Double-precision trigonometric and exponential functions.  These instructions
26026 are only generated if @option{-funsafe-math-optimizations} is also specified.
26028 @end table
26030 Conversions:
26031 @table @asis
26032 @item @samp{fextsd}
26033 Conversion from single precision to double precision.
26035 @item @samp{ftruncds}
26036 Conversion from double precision to single precision.
26038 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
26039 Conversion from floating point to signed or unsigned integer types, with
26040 truncation towards zero.
26042 @item @samp{round}
26043 Conversion from single-precision floating point to signed integer,
26044 rounding to the nearest integer and ties away from zero.
26045 This corresponds to the @code{__builtin_lroundf} function when
26046 @option{-fno-math-errno} is used.
26048 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
26049 Conversion from signed or unsigned integer types to floating-point types.
26051 @end table
26053 In addition, all of the following transfer instructions for internal
26054 registers X and Y must be provided to use any of the double-precision
26055 floating-point instructions.  Custom instructions taking two
26056 double-precision source operands expect the first operand in the
26057 64-bit register X.  The other operand (or only operand of a unary
26058 operation) is given to the custom arithmetic instruction with the
26059 least significant half in source register @var{src1} and the most
26060 significant half in @var{src2}.  A custom instruction that returns a
26061 double-precision result returns the most significant 32 bits in the
26062 destination register and the other half in 32-bit register Y.  
26063 GCC automatically generates the necessary code sequences to write
26064 register X and/or read register Y when double-precision floating-point
26065 instructions are used.
26067 @table @asis
26069 @item @samp{fwrx}
26070 Write @var{src1} into the least significant half of X and @var{src2} into
26071 the most significant half of X.
26073 @item @samp{fwry}
26074 Write @var{src1} into Y.
26076 @item @samp{frdxhi}, @samp{frdxlo}
26077 Read the most or least (respectively) significant half of X and store it in
26078 @var{dest}.
26080 @item @samp{frdy}
26081 Read the value of Y and store it into @var{dest}.
26082 @end table
26084 Note that you can gain more local control over generation of Nios II custom
26085 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
26086 and @code{target("no-custom-@var{insn}")} function attributes
26087 (@pxref{Function Attributes})
26088 or pragmas (@pxref{Function Specific Option Pragmas}).
26090 @item -mcustom-fpu-cfg=@var{name}
26091 @opindex mcustom-fpu-cfg
26093 This option enables a predefined, named set of custom instruction encodings
26094 (see @option{-mcustom-@var{insn}} above).  
26095 Currently, the following sets are defined:
26097 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
26098 @gccoptlist{-mcustom-fmuls=252 @gol
26099 -mcustom-fadds=253 @gol
26100 -mcustom-fsubs=254 @gol
26101 -fsingle-precision-constant}
26103 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
26104 @gccoptlist{-mcustom-fmuls=252 @gol
26105 -mcustom-fadds=253 @gol
26106 -mcustom-fsubs=254 @gol
26107 -mcustom-fdivs=255 @gol
26108 -fsingle-precision-constant}
26110 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
26111 @gccoptlist{-mcustom-floatus=243 @gol
26112 -mcustom-fixsi=244 @gol
26113 -mcustom-floatis=245 @gol
26114 -mcustom-fcmpgts=246 @gol
26115 -mcustom-fcmples=249 @gol
26116 -mcustom-fcmpeqs=250 @gol
26117 -mcustom-fcmpnes=251 @gol
26118 -mcustom-fmuls=252 @gol
26119 -mcustom-fadds=253 @gol
26120 -mcustom-fsubs=254 @gol
26121 -mcustom-fdivs=255 @gol
26122 -fsingle-precision-constant}
26124 Custom instruction assignments given by individual
26125 @option{-mcustom-@var{insn}=} options override those given by
26126 @option{-mcustom-fpu-cfg=}, regardless of the
26127 order of the options on the command line.
26129 Note that you can gain more local control over selection of a FPU
26130 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
26131 function attribute (@pxref{Function Attributes})
26132 or pragma (@pxref{Function Specific Option Pragmas}).
26134 @end table
26136 These additional @samp{-m} options are available for the Altera Nios II
26137 ELF (bare-metal) target:
26139 @table @gcctabopt
26141 @item -mhal
26142 @opindex mhal
26143 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
26144 startup and termination code, and is typically used in conjunction with
26145 @option{-msys-crt0=} to specify the location of the alternate startup code
26146 provided by the HAL BSP.
26148 @item -msmallc
26149 @opindex msmallc
26150 Link with a limited version of the C library, @option{-lsmallc}, rather than
26151 Newlib.
26153 @item -msys-crt0=@var{startfile}
26154 @opindex msys-crt0
26155 @var{startfile} is the file name of the startfile (crt0) to use 
26156 when linking.  This option is only useful in conjunction with @option{-mhal}.
26158 @item -msys-lib=@var{systemlib}
26159 @opindex msys-lib
26160 @var{systemlib} is the library name of the library that provides
26161 low-level system calls required by the C library,
26162 e.g.@: @code{read} and @code{write}.
26163 This option is typically used to link with a library provided by a HAL BSP.
26165 @end table
26167 @node Nvidia PTX Options
26168 @subsection Nvidia PTX Options
26169 @cindex Nvidia PTX options
26170 @cindex nvptx options
26172 These options are defined for Nvidia PTX:
26174 @table @gcctabopt
26176 @item -m64
26177 @opindex m64
26178 Ignored, but preserved for backward compatibility.  Only 64-bit ABI is
26179 supported.
26181 @item -misa=@var{ISA-string}
26182 @opindex march
26183 Generate code for given the specified PTX ISA (e.g.@: @samp{sm_35}).  ISA
26184 strings must be lower-case.  Valid ISA strings include @samp{sm_30} and
26185 @samp{sm_35}.  The default ISA is sm_35.
26187 @item -mmainkernel
26188 @opindex mmainkernel
26189 Link in code for a __main kernel.  This is for stand-alone instead of
26190 offloading execution.
26192 @item -moptimize
26193 @opindex moptimize
26194 Apply partitioned execution optimizations.  This is the default when any
26195 level of optimization is selected.
26197 @item -msoft-stack
26198 @opindex msoft-stack
26199 Generate code that does not use @code{.local} memory
26200 directly for stack storage. Instead, a per-warp stack pointer is
26201 maintained explicitly. This enables variable-length stack allocation (with
26202 variable-length arrays or @code{alloca}), and when global memory is used for
26203 underlying storage, makes it possible to access automatic variables from other
26204 threads, or with atomic instructions. This code generation variant is used
26205 for OpenMP offloading, but the option is exposed on its own for the purpose
26206 of testing the compiler; to generate code suitable for linking into programs
26207 using OpenMP offloading, use option @option{-mgomp}.
26209 @item -muniform-simt
26210 @opindex muniform-simt
26211 Switch to code generation variant that allows to execute all threads in each
26212 warp, while maintaining memory state and side effects as if only one thread
26213 in each warp was active outside of OpenMP SIMD regions.  All atomic operations
26214 and calls to runtime (malloc, free, vprintf) are conditionally executed (iff
26215 current lane index equals the master lane index), and the register being
26216 assigned is copied via a shuffle instruction from the master lane.  Outside of
26217 SIMD regions lane 0 is the master; inside, each thread sees itself as the
26218 master.  Shared memory array @code{int __nvptx_uni[]} stores all-zeros or
26219 all-ones bitmasks for each warp, indicating current mode (0 outside of SIMD
26220 regions).  Each thread can bitwise-and the bitmask at position @code{tid.y}
26221 with current lane index to compute the master lane index.
26223 @item -mgomp
26224 @opindex mgomp
26225 Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and
26226 @option{-muniform-simt} options, and selects corresponding multilib variant.
26228 @end table
26230 @node OpenRISC Options
26231 @subsection OpenRISC Options
26232 @cindex OpenRISC Options
26234 These options are defined for OpenRISC:
26236 @table @gcctabopt
26238 @item -mboard=@var{name}
26239 @opindex mboard
26240 Configure a board specific runtime.  This will be passed to the linker for
26241 newlib board library linking.  The default is @code{or1ksim}.
26243 @item -mnewlib
26244 @opindex mnewlib
26245 This option is ignored; it is for compatibility purposes only.  This used to
26246 select linker and preprocessor options for use with newlib.
26248 @item -msoft-div
26249 @itemx -mhard-div
26250 @opindex msoft-div
26251 @opindex mhard-div
26252 Select software or hardware divide (@code{l.div}, @code{l.divu}) instructions.
26253 This default is hardware divide.
26255 @item -msoft-mul
26256 @itemx -mhard-mul
26257 @opindex msoft-mul
26258 @opindex mhard-mul
26259 Select software or hardware multiply (@code{l.mul}, @code{l.muli}) instructions.
26260 This default is hardware multiply.
26262 @item -msoft-float
26263 @itemx -mhard-float
26264 @opindex msoft-float
26265 @opindex mhard-float
26266 Select software or hardware for floating point operations.
26267 The default is software.
26269 @item -mdouble-float
26270 @opindex mdouble-float
26271 When @option{-mhard-float} is selected, enables generation of double-precision
26272 floating point instructions.  By default functions from @file{libgcc} are used
26273 to perform double-precision floating point operations.
26275 @item -munordered-float
26276 @opindex munordered-float
26277 When @option{-mhard-float} is selected, enables generation of unordered
26278 floating point compare and set flag (@code{lf.sfun*}) instructions.  By default
26279 functions from @file{libgcc} are used to perform unordered floating point
26280 compare and set flag operations.
26282 @item -mcmov
26283 @opindex mcmov
26284 Enable generation of conditional move (@code{l.cmov}) instructions.  By
26285 default the equivalent will be generated using set and branch.
26287 @item -mror
26288 @opindex mror
26289 Enable generation of rotate right (@code{l.ror}) instructions.  By default
26290 functions from @file{libgcc} are used to perform rotate right operations.
26292 @item -mrori
26293 @opindex mrori
26294 Enable generation of rotate right with immediate (@code{l.rori}) instructions.
26295 By default functions from @file{libgcc} are used to perform rotate right with
26296 immediate operations.
26298 @item -msext
26299 @opindex msext
26300 Enable generation of sign extension (@code{l.ext*}) instructions.  By default
26301 memory loads are used to perform sign extension.
26303 @item -msfimm
26304 @opindex msfimm
26305 Enable generation of compare and set flag with immediate (@code{l.sf*i})
26306 instructions.  By default extra instructions will be generated to store the
26307 immediate to a register first.
26309 @item -mshftimm
26310 @opindex mshftimm
26311 Enable generation of shift with immediate (@code{l.srai}, @code{l.srli},
26312 @code{l.slli}) instructions.  By default extra instructions will be generated
26313 to store the immediate to a register first.
26316 @end table
26318 @node PDP-11 Options
26319 @subsection PDP-11 Options
26320 @cindex PDP-11 Options
26322 These options are defined for the PDP-11:
26324 @table @gcctabopt
26325 @item -mfpu
26326 @opindex mfpu
26327 Use hardware FPP floating point.  This is the default.  (FIS floating
26328 point on the PDP-11/40 is not supported.)  Implies -m45.
26330 @item -msoft-float
26331 @opindex msoft-float
26332 Do not use hardware floating point.
26334 @item -mac0
26335 @opindex mac0
26336 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
26338 @item -mno-ac0
26339 @opindex mno-ac0
26340 Return floating-point results in memory.  This is the default.
26342 @item -m40
26343 @opindex m40
26344 Generate code for a PDP-11/40.  Implies -msoft-float -mno-split.
26346 @item -m45
26347 @opindex m45
26348 Generate code for a PDP-11/45.  This is the default.
26350 @item -m10
26351 @opindex m10
26352 Generate code for a PDP-11/10.  Implies -msoft-float -mno-split.
26354 @item -mint16
26355 @itemx -mno-int32
26356 @opindex mint16
26357 @opindex mno-int32
26358 Use 16-bit @code{int}.  This is the default.
26360 @item -mint32
26361 @itemx -mno-int16
26362 @opindex mint32
26363 @opindex mno-int16
26364 Use 32-bit @code{int}.
26366 @item -msplit
26367 @opindex msplit
26368 Target has split instruction and data space.  Implies -m45.
26370 @item -munix-asm
26371 @opindex munix-asm
26372 Use Unix assembler syntax.
26374 @item -mdec-asm
26375 @opindex mdec-asm
26376 Use DEC assembler syntax.
26378 @item -mgnu-asm
26379 @opindex mgnu-asm
26380 Use GNU assembler syntax.  This is the default.
26382 @item -mlra
26383 @opindex mlra
26384 Use the new LRA register allocator.  By default, the old ``reload''
26385 allocator is used.
26386 @end table
26388 @node picoChip Options
26389 @subsection picoChip Options
26390 @cindex picoChip options
26392 These @samp{-m} options are defined for picoChip implementations:
26394 @table @gcctabopt
26396 @item -mae=@var{ae_type}
26397 @opindex mcpu
26398 Set the instruction set, register set, and instruction scheduling
26399 parameters for array element type @var{ae_type}.  Supported values
26400 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
26402 @option{-mae=ANY} selects a completely generic AE type.  Code
26403 generated with this option runs on any of the other AE types.  The
26404 code is not as efficient as it would be if compiled for a specific
26405 AE type, and some types of operation (e.g., multiplication) do not
26406 work properly on all types of AE.
26408 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
26409 for compiled code, and is the default.
26411 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
26412 option may suffer from poor performance of byte (char) manipulation,
26413 since the DSP AE does not provide hardware support for byte load/stores.
26415 @item -msymbol-as-address
26416 Enable the compiler to directly use a symbol name as an address in a
26417 load/store instruction, without first loading it into a
26418 register.  Typically, the use of this option generates larger
26419 programs, which run faster than when the option isn't used.  However, the
26420 results vary from program to program, so it is left as a user option,
26421 rather than being permanently enabled.
26423 @item -mno-inefficient-warnings
26424 Disables warnings about the generation of inefficient code.  These
26425 warnings can be generated, for example, when compiling code that
26426 performs byte-level memory operations on the MAC AE type.  The MAC AE has
26427 no hardware support for byte-level memory operations, so all byte
26428 load/stores must be synthesized from word load/store operations.  This is
26429 inefficient and a warning is generated to indicate
26430 that you should rewrite the code to avoid byte operations, or to target
26431 an AE type that has the necessary hardware support.  This option disables
26432 these warnings.
26434 @end table
26436 @node PowerPC Options
26437 @subsection PowerPC Options
26438 @cindex PowerPC options
26440 These are listed under @xref{RS/6000 and PowerPC Options}.
26442 @node PRU Options
26443 @subsection PRU Options
26444 @cindex PRU Options
26446 These command-line options are defined for PRU target:
26448 @table @gcctabopt
26449 @item -minrt
26450 @opindex minrt
26451 Link with a minimum runtime environment, with no support for static
26452 initializers and constructors.  Using this option can significantly reduce
26453 the size of the final ELF binary.  Beware that the compiler could still
26454 generate code with static initializers and constructors.  It is up to the
26455 programmer to ensure that the source program will not use those features.
26457 @item -mmcu=@var{mcu}
26458 @opindex mmcu
26459 Specify the PRU MCU variant to use.  Check Newlib for the exact list of
26460 supported MCUs.
26462 @item -mno-relax
26463 @opindex mno-relax
26464 Make GCC pass the @option{--no-relax} command-line option to the linker
26465 instead of the @option{--relax} option.
26467 @item -mloop
26468 @opindex mloop
26469 Allow (or do not allow) GCC to use the LOOP instruction.
26471 @item -mabi=@var{variant}
26472 @opindex mabi
26473 Specify the ABI variant to output code for.  @option{-mabi=ti} selects the
26474 unmodified TI ABI while @option{-mabi=gnu} selects a GNU variant that copes
26475 more naturally with certain GCC assumptions.  These are the differences:
26477 @table @samp
26478 @item Function Pointer Size
26479 TI ABI specifies that function (code) pointers are 16-bit, whereas GNU
26480 supports only 32-bit data and code pointers.
26482 @item Optional Return Value Pointer
26483 Function return values larger than 64 bits are passed by using a hidden
26484 pointer as the first argument of the function.  TI ABI, though, mandates that
26485 the pointer can be NULL in case the caller is not using the returned value.
26486 GNU always passes and expects a valid return value pointer.
26488 @end table
26490 The current @option{-mabi=ti} implementation simply raises a compile error
26491 when any of the above code constructs is detected.  As a consequence
26492 the standard C library cannot be built and it is omitted when linking with
26493 @option{-mabi=ti}.
26495 Relaxation is a GNU feature and for safety reasons is disabled when using
26496 @option{-mabi=ti}.  The TI toolchain does not emit relocations for QBBx
26497 instructions, so the GNU linker cannot adjust them when shortening adjacent
26498 LDI32 pseudo instructions.
26500 @end table
26502 @node RISC-V Options
26503 @subsection RISC-V Options
26504 @cindex RISC-V Options
26506 These command-line options are defined for RISC-V targets:
26508 @table @gcctabopt
26509 @item -mbranch-cost=@var{n}
26510 @opindex mbranch-cost
26511 Set the cost of branches to roughly @var{n} instructions.
26513 @item -mplt
26514 @itemx -mno-plt
26515 @opindex plt
26516 When generating PIC code, do or don't allow the use of PLTs. Ignored for
26517 non-PIC.  The default is @option{-mplt}.
26519 @item -mabi=@var{ABI-string}
26520 @opindex mabi
26521 Specify integer and floating-point calling convention.  @var{ABI-string}
26522 contains two parts: the size of integer types and the registers used for
26523 floating-point types.  For example @samp{-march=rv64ifd -mabi=lp64d} means that
26524 @samp{long} and pointers are 64-bit (implicitly defining @samp{int} to be
26525 32-bit), and that floating-point values up to 64 bits wide are passed in F
26526 registers.  Contrast this with @samp{-march=rv64ifd -mabi=lp64f}, which still
26527 allows the compiler to generate code that uses the F and D extensions but only
26528 allows floating-point values up to 32 bits long to be passed in registers; or
26529 @samp{-march=rv64ifd -mabi=lp64}, in which no floating-point arguments will be
26530 passed in registers.
26532 The default for this argument is system dependent, users who want a specific
26533 calling convention should specify one explicitly.  The valid calling
26534 conventions are: @samp{ilp32}, @samp{ilp32f}, @samp{ilp32d}, @samp{lp64},
26535 @samp{lp64f}, and @samp{lp64d}.  Some calling conventions are impossible to
26536 implement on some ISAs: for example, @samp{-march=rv32if -mabi=ilp32d} is
26537 invalid because the ABI requires 64-bit values be passed in F registers, but F
26538 registers are only 32 bits wide.  There is also the @samp{ilp32e} ABI that can
26539 only be used with the @samp{rv32e} architecture.  This ABI is not well
26540 specified at present, and is subject to change.
26542 @item -mfdiv
26543 @itemx -mno-fdiv
26544 @opindex mfdiv
26545 Do or don't use hardware floating-point divide and square root instructions.
26546 This requires the F or D extensions for floating-point registers.  The default
26547 is to use them if the specified architecture has these instructions.
26549 @item -mdiv
26550 @itemx -mno-div
26551 @opindex mdiv
26552 Do or don't use hardware instructions for integer division.  This requires the
26553 M extension.  The default is to use them if the specified architecture has
26554 these instructions.
26556 @item -march=@var{ISA-string}
26557 @opindex march
26558 Generate code for given RISC-V ISA (e.g.@: @samp{rv64im}).  ISA strings must be
26559 lower-case.  Examples include @samp{rv64i}, @samp{rv32g}, @samp{rv32e}, and
26560 @samp{rv32imaf}.
26562 When @option{-march=} is not specified, use the setting from @option{-mcpu}.
26564 If both @option{-march} and @option{-mcpu=} are not specified, the default for
26565 this argument is system dependent, users who want a specific architecture
26566 extensions should specify one explicitly.
26568 @item -mcpu=@var{processor-string}
26569 @opindex mcpu
26570 Use architecture of and optimize the output for the given processor, specified
26571 by particular CPU name.
26572 Permissible values for this option are: @samp{sifive-e20}, @samp{sifive-e21},
26573 @samp{sifive-e24}, @samp{sifive-e31}, @samp{sifive-e34}, @samp{sifive-e76},
26574 @samp{sifive-s21}, @samp{sifive-s51}, @samp{sifive-s54}, @samp{sifive-s76},
26575 @samp{sifive-u54}, and @samp{sifive-u74}.
26577 @item -mtune=@var{processor-string}
26578 @opindex mtune
26579 Optimize the output for the given processor, specified by microarchitecture or
26580 particular CPU name.  Permissible values for this option are: @samp{rocket},
26581 @samp{sifive-3-series}, @samp{sifive-5-series}, @samp{sifive-7-series},
26582 @samp{size}, and all valid options for @option{-mcpu=}.
26584 When @option{-mtune=} is not specified, use the setting from @option{-mcpu},
26585 the default is @samp{rocket} if both are not specified.
26587 The @samp{size} choice is not intended for use by end-users.  This is used
26588 when @option{-Os} is specified.  It overrides the instruction cost info
26589 provided by @option{-mtune=}, but does not override the pipeline info.  This
26590 helps reduce code size while still giving good performance.
26592 @item -mpreferred-stack-boundary=@var{num}
26593 @opindex mpreferred-stack-boundary
26594 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
26595 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
26596 the default is 4 (16 bytes or 128-bits).
26598 @strong{Warning:} If you use this switch, then you must build all modules with
26599 the same value, including any libraries.  This includes the system libraries
26600 and startup modules.
26602 @item -msmall-data-limit=@var{n}
26603 @opindex msmall-data-limit
26604 Put global and static data smaller than @var{n} bytes into a special section
26605 (on some targets).
26607 @item -msave-restore
26608 @itemx -mno-save-restore
26609 @opindex msave-restore
26610 Do or don't use smaller but slower prologue and epilogue code that uses
26611 library function calls.  The default is to use fast inline prologues and
26612 epilogues.
26614 @item -mshorten-memrefs
26615 @itemx -mno-shorten-memrefs
26616 @opindex mshorten-memrefs
26617 Do or do not attempt to make more use of compressed load/store instructions by
26618 replacing a load/store of 'base register + large offset' with a new load/store
26619 of 'new base + small offset'.  If the new base gets stored in a compressed
26620 register, then the new load/store can be compressed.  Currently targets 32-bit
26621 integer load/stores only.
26623 @item -mstrict-align
26624 @itemx -mno-strict-align
26625 @opindex mstrict-align
26626 Do not or do generate unaligned memory accesses.  The default is set depending
26627 on whether the processor we are optimizing for supports fast unaligned access
26628 or not.
26630 @item -mcmodel=medlow
26631 @opindex mcmodel=medlow
26632 Generate code for the medium-low code model. The program and its statically
26633 defined symbols must lie within a single 2 GiB address range and must lie
26634 between absolute addresses @minus{}2 GiB and +2 GiB. Programs can be
26635 statically or dynamically linked. This is the default code model.
26637 @item -mcmodel=medany
26638 @opindex mcmodel=medany
26639 Generate code for the medium-any code model. The program and its statically
26640 defined symbols must be within any single 2 GiB address range. Programs can be
26641 statically or dynamically linked.
26643 @item -mexplicit-relocs
26644 @itemx -mno-exlicit-relocs
26645 Use or do not use assembler relocation operators when dealing with symbolic
26646 addresses.  The alternative is to use assembler macros instead, which may
26647 limit optimization.
26649 @item -mrelax
26650 @itemx -mno-relax
26651 Take advantage of linker relaxations to reduce the number of instructions
26652 required to materialize symbol addresses. The default is to take advantage of
26653 linker relaxations.
26655 @item -memit-attribute
26656 @itemx -mno-emit-attribute
26657 Emit (do not emit) RISC-V attribute to record extra information into ELF
26658 objects.  This feature requires at least binutils 2.32.
26660 @item -malign-data=@var{type}
26661 @opindex malign-data
26662 Control how GCC aligns variables and constants of array, structure, or union
26663 types.  Supported values for @var{type} are @samp{xlen} which uses x register
26664 width as the alignment value, and @samp{natural} which uses natural alignment.
26665 @samp{xlen} is the default.
26667 @item -mstack-protector-guard=@var{guard}
26668 @itemx -mstack-protector-guard-reg=@var{reg}
26669 @itemx -mstack-protector-guard-offset=@var{offset}
26670 @opindex mstack-protector-guard
26671 @opindex mstack-protector-guard-reg
26672 @opindex mstack-protector-guard-offset
26673 Generate stack protection code using canary at @var{guard}.  Supported
26674 locations are @samp{global} for a global canary or @samp{tls} for per-thread
26675 canary in the TLS block.
26677 With the latter choice the options
26678 @option{-mstack-protector-guard-reg=@var{reg}} and
26679 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
26680 which register to use as base register for reading the canary,
26681 and from what offset from that base register. There is no default
26682 register or offset as this is entirely for use within the Linux
26683 kernel.
26684 @end table
26686 @node RL78 Options
26687 @subsection RL78 Options
26688 @cindex RL78 Options
26690 @table @gcctabopt
26692 @item -msim
26693 @opindex msim
26694 Links in additional target libraries to support operation within a
26695 simulator.
26697 @item -mmul=none
26698 @itemx -mmul=g10
26699 @itemx -mmul=g13
26700 @itemx -mmul=g14
26701 @itemx -mmul=rl78
26702 @opindex mmul
26703 Specifies the type of hardware multiplication and division support to
26704 be used.  The simplest is @code{none}, which uses software for both
26705 multiplication and division.  This is the default.  The @code{g13}
26706 value is for the hardware multiply/divide peripheral found on the
26707 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
26708 the multiplication and division instructions supported by the RL78/G14
26709 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
26710 the value @code{mg10} is an alias for @code{none}.
26712 In addition a C preprocessor macro is defined, based upon the setting
26713 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
26714 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
26716 @item -mcpu=g10
26717 @itemx -mcpu=g13
26718 @itemx -mcpu=g14
26719 @itemx -mcpu=rl78
26720 @opindex mcpu
26721 Specifies the RL78 core to target.  The default is the G14 core, also
26722 known as an S3 core or just RL78.  The G13 or S2 core does not have
26723 multiply or divide instructions, instead it uses a hardware peripheral
26724 for these operations.  The G10 or S1 core does not have register
26725 banks, so it uses a different calling convention.
26727 If this option is set it also selects the type of hardware multiply
26728 support to use, unless this is overridden by an explicit
26729 @option{-mmul=none} option on the command line.  Thus specifying
26730 @option{-mcpu=g13} enables the use of the G13 hardware multiply
26731 peripheral and specifying @option{-mcpu=g10} disables the use of
26732 hardware multiplications altogether.
26734 Note, although the RL78/G14 core is the default target, specifying
26735 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
26736 change the behavior of the toolchain since it also enables G14
26737 hardware multiply support.  If these options are not specified on the
26738 command line then software multiplication routines will be used even
26739 though the code targets the RL78 core.  This is for backwards
26740 compatibility with older toolchains which did not have hardware
26741 multiply and divide support.
26743 In addition a C preprocessor macro is defined, based upon the setting
26744 of this option.  Possible values are: @code{__RL78_G10__},
26745 @code{__RL78_G13__} or @code{__RL78_G14__}.
26747 @item -mg10
26748 @itemx -mg13
26749 @itemx -mg14
26750 @itemx -mrl78
26751 @opindex mg10
26752 @opindex mg13
26753 @opindex mg14
26754 @opindex mrl78
26755 These are aliases for the corresponding @option{-mcpu=} option.  They
26756 are provided for backwards compatibility.
26758 @item -mallregs
26759 @opindex mallregs
26760 Allow the compiler to use all of the available registers.  By default
26761 registers @code{r24..r31} are reserved for use in interrupt handlers.
26762 With this option enabled these registers can be used in ordinary
26763 functions as well.
26765 @item -m64bit-doubles
26766 @itemx -m32bit-doubles
26767 @opindex m64bit-doubles
26768 @opindex m32bit-doubles
26769 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
26770 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
26771 @option{-m32bit-doubles}.
26773 @item -msave-mduc-in-interrupts
26774 @itemx -mno-save-mduc-in-interrupts
26775 @opindex msave-mduc-in-interrupts
26776 @opindex mno-save-mduc-in-interrupts
26777 Specifies that interrupt handler functions should preserve the
26778 MDUC registers.  This is only necessary if normal code might use
26779 the MDUC registers, for example because it performs multiplication
26780 and division operations.  The default is to ignore the MDUC registers
26781 as this makes the interrupt handlers faster.  The target option -mg13
26782 needs to be passed for this to work as this feature is only available
26783 on the G13 target (S2 core).  The MDUC registers will only be saved
26784 if the interrupt handler performs a multiplication or division
26785 operation or it calls another function.
26787 @end table
26789 @node RS/6000 and PowerPC Options
26790 @subsection IBM RS/6000 and PowerPC Options
26791 @cindex RS/6000 and PowerPC Options
26792 @cindex IBM RS/6000 and PowerPC Options
26794 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
26795 @table @gcctabopt
26796 @item -mpowerpc-gpopt
26797 @itemx -mno-powerpc-gpopt
26798 @itemx -mpowerpc-gfxopt
26799 @itemx -mno-powerpc-gfxopt
26800 @need 800
26801 @itemx -mpowerpc64
26802 @itemx -mno-powerpc64
26803 @itemx -mmfcrf
26804 @itemx -mno-mfcrf
26805 @itemx -mpopcntb
26806 @itemx -mno-popcntb
26807 @itemx -mpopcntd
26808 @itemx -mno-popcntd
26809 @itemx -mfprnd
26810 @itemx -mno-fprnd
26811 @need 800
26812 @itemx -mcmpb
26813 @itemx -mno-cmpb
26814 @itemx -mhard-dfp
26815 @itemx -mno-hard-dfp
26816 @opindex mpowerpc-gpopt
26817 @opindex mno-powerpc-gpopt
26818 @opindex mpowerpc-gfxopt
26819 @opindex mno-powerpc-gfxopt
26820 @opindex mpowerpc64
26821 @opindex mno-powerpc64
26822 @opindex mmfcrf
26823 @opindex mno-mfcrf
26824 @opindex mpopcntb
26825 @opindex mno-popcntb
26826 @opindex mpopcntd
26827 @opindex mno-popcntd
26828 @opindex mfprnd
26829 @opindex mno-fprnd
26830 @opindex mcmpb
26831 @opindex mno-cmpb
26832 @opindex mhard-dfp
26833 @opindex mno-hard-dfp
26834 You use these options to specify which instructions are available on the
26835 processor you are using.  The default value of these options is
26836 determined when configuring GCC@.  Specifying the
26837 @option{-mcpu=@var{cpu_type}} overrides the specification of these
26838 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
26839 rather than the options listed above.
26841 Specifying @option{-mpowerpc-gpopt} allows
26842 GCC to use the optional PowerPC architecture instructions in the
26843 General Purpose group, including floating-point square root.  Specifying
26844 @option{-mpowerpc-gfxopt} allows GCC to
26845 use the optional PowerPC architecture instructions in the Graphics
26846 group, including floating-point select.
26848 The @option{-mmfcrf} option allows GCC to generate the move from
26849 condition register field instruction implemented on the POWER4
26850 processor and other processors that support the PowerPC V2.01
26851 architecture.
26852 The @option{-mpopcntb} option allows GCC to generate the popcount and
26853 double-precision FP reciprocal estimate instruction implemented on the
26854 POWER5 processor and other processors that support the PowerPC V2.02
26855 architecture.
26856 The @option{-mpopcntd} option allows GCC to generate the popcount
26857 instruction implemented on the POWER7 processor and other processors
26858 that support the PowerPC V2.06 architecture.
26859 The @option{-mfprnd} option allows GCC to generate the FP round to
26860 integer instructions implemented on the POWER5+ processor and other
26861 processors that support the PowerPC V2.03 architecture.
26862 The @option{-mcmpb} option allows GCC to generate the compare bytes
26863 instruction implemented on the POWER6 processor and other processors
26864 that support the PowerPC V2.05 architecture.
26865 The @option{-mhard-dfp} option allows GCC to generate the decimal
26866 floating-point instructions implemented on some POWER processors.
26868 The @option{-mpowerpc64} option allows GCC to generate the additional
26869 64-bit instructions that are found in the full PowerPC64 architecture
26870 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
26871 @option{-mno-powerpc64}.
26873 @item -mcpu=@var{cpu_type}
26874 @opindex mcpu
26875 Set architecture type, register usage, and
26876 instruction scheduling parameters for machine type @var{cpu_type}.
26877 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
26878 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
26879 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
26880 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
26881 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
26882 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
26883 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
26884 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
26885 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
26886 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
26887 @samp{power9}, @samp{future}, @samp{powerpc}, @samp{powerpc64},
26888 @samp{powerpc64le}, @samp{rs64}, and @samp{native}.
26890 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
26891 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
26892 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
26893 architecture machine types, with an appropriate, generic processor
26894 model assumed for scheduling purposes.
26896 Specifying @samp{native} as cpu type detects and selects the
26897 architecture option that corresponds to the host processor of the
26898 system performing the compilation.
26899 @option{-mcpu=native} has no effect if GCC does not recognize the
26900 processor.
26902 The other options specify a specific processor.  Code generated under
26903 those options runs best on that processor, and may not run at all on
26904 others.
26906 The @option{-mcpu} options automatically enable or disable the
26907 following options:
26909 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
26910 -mpopcntb  -mpopcntd  -mpowerpc64 @gol
26911 -mpowerpc-gpopt  -mpowerpc-gfxopt @gol
26912 -mmulhw  -mdlmzb  -mmfpgpr  -mvsx @gol
26913 -mcrypto  -mhtm  -mpower8-fusion  -mpower8-vector @gol
26914 -mquad-memory  -mquad-memory-atomic  -mfloat128 @gol
26915 -mfloat128-hardware -mprefixed -mpcrel -mmma}
26917 The particular options set for any particular CPU varies between
26918 compiler versions, depending on what setting seems to produce optimal
26919 code for that CPU; it doesn't necessarily reflect the actual hardware's
26920 capabilities.  If you wish to set an individual option to a particular
26921 value, you may specify it after the @option{-mcpu} option, like
26922 @option{-mcpu=970 -mno-altivec}.
26924 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
26925 not enabled or disabled by the @option{-mcpu} option at present because
26926 AIX does not have full support for these options.  You may still
26927 enable or disable them individually if you're sure it'll work in your
26928 environment.
26930 @item -mtune=@var{cpu_type}
26931 @opindex mtune
26932 Set the instruction scheduling parameters for machine type
26933 @var{cpu_type}, but do not set the architecture type or register usage,
26934 as @option{-mcpu=@var{cpu_type}} does.  The same
26935 values for @var{cpu_type} are used for @option{-mtune} as for
26936 @option{-mcpu}.  If both are specified, the code generated uses the
26937 architecture and registers set by @option{-mcpu}, but the
26938 scheduling parameters set by @option{-mtune}.
26940 @item -mcmodel=small
26941 @opindex mcmodel=small
26942 Generate PowerPC64 code for the small model: The TOC is limited to
26943 64k.
26945 @item -mcmodel=medium
26946 @opindex mcmodel=medium
26947 Generate PowerPC64 code for the medium model: The TOC and other static
26948 data may be up to a total of 4G in size.  This is the default for 64-bit
26949 Linux.
26951 @item -mcmodel=large
26952 @opindex mcmodel=large
26953 Generate PowerPC64 code for the large model: The TOC may be up to 4G
26954 in size.  Other data and code is only limited by the 64-bit address
26955 space.
26957 @item -maltivec
26958 @itemx -mno-altivec
26959 @opindex maltivec
26960 @opindex mno-altivec
26961 Generate code that uses (does not use) AltiVec instructions, and also
26962 enable the use of built-in functions that allow more direct access to
26963 the AltiVec instruction set.  You may also need to set
26964 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
26965 enhancements.
26967 When @option{-maltivec} is used, the element order for AltiVec intrinsics
26968 such as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
26969 match array element order corresponding to the endianness of the
26970 target.  That is, element zero identifies the leftmost element in a
26971 vector register when targeting a big-endian platform, and identifies
26972 the rightmost element in a vector register when targeting a
26973 little-endian platform.
26975 @item -mvrsave
26976 @itemx -mno-vrsave
26977 @opindex mvrsave
26978 @opindex mno-vrsave
26979 Generate VRSAVE instructions when generating AltiVec code.
26981 @item -msecure-plt
26982 @opindex msecure-plt
26983 Generate code that allows @command{ld} and @command{ld.so}
26984 to build executables and shared
26985 libraries with non-executable @code{.plt} and @code{.got} sections.
26986 This is a PowerPC
26987 32-bit SYSV ABI option.
26989 @item -mbss-plt
26990 @opindex mbss-plt
26991 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
26992 fills in, and
26993 requires @code{.plt} and @code{.got}
26994 sections that are both writable and executable.
26995 This is a PowerPC 32-bit SYSV ABI option.
26997 @item -misel
26998 @itemx -mno-isel
26999 @opindex misel
27000 @opindex mno-isel
27001 This switch enables or disables the generation of ISEL instructions.
27003 @item -mvsx
27004 @itemx -mno-vsx
27005 @opindex mvsx
27006 @opindex mno-vsx
27007 Generate code that uses (does not use) vector/scalar (VSX)
27008 instructions, and also enable the use of built-in functions that allow
27009 more direct access to the VSX instruction set.
27011 @item -mcrypto
27012 @itemx -mno-crypto
27013 @opindex mcrypto
27014 @opindex mno-crypto
27015 Enable the use (disable) of the built-in functions that allow direct
27016 access to the cryptographic instructions that were added in version
27017 2.07 of the PowerPC ISA.
27019 @item -mhtm
27020 @itemx -mno-htm
27021 @opindex mhtm
27022 @opindex mno-htm
27023 Enable (disable) the use of the built-in functions that allow direct
27024 access to the Hardware Transactional Memory (HTM) instructions that
27025 were added in version 2.07 of the PowerPC ISA.
27027 @item -mpower8-fusion
27028 @itemx -mno-power8-fusion
27029 @opindex mpower8-fusion
27030 @opindex mno-power8-fusion
27031 Generate code that keeps (does not keeps) some integer operations
27032 adjacent so that the instructions can be fused together on power8 and
27033 later processors.
27035 @item -mpower8-vector
27036 @itemx -mno-power8-vector
27037 @opindex mpower8-vector
27038 @opindex mno-power8-vector
27039 Generate code that uses (does not use) the vector and scalar
27040 instructions that were added in version 2.07 of the PowerPC ISA.  Also
27041 enable the use of built-in functions that allow more direct access to
27042 the vector instructions.
27044 @item -mquad-memory
27045 @itemx -mno-quad-memory
27046 @opindex mquad-memory
27047 @opindex mno-quad-memory
27048 Generate code that uses (does not use) the non-atomic quad word memory
27049 instructions.  The @option{-mquad-memory} option requires use of
27050 64-bit mode.
27052 @item -mquad-memory-atomic
27053 @itemx -mno-quad-memory-atomic
27054 @opindex mquad-memory-atomic
27055 @opindex mno-quad-memory-atomic
27056 Generate code that uses (does not use) the atomic quad word memory
27057 instructions.  The @option{-mquad-memory-atomic} option requires use of
27058 64-bit mode.
27060 @item -mfloat128
27061 @itemx -mno-float128
27062 @opindex mfloat128
27063 @opindex mno-float128
27064 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
27065 and use either software emulation for IEEE 128-bit floating point or
27066 hardware instructions.
27068 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7},
27069 @option{-mcpu=power8}), or @option{-mcpu=power9} must be enabled to
27070 use the IEEE 128-bit floating point support.  The IEEE 128-bit
27071 floating point support only works on PowerPC Linux systems.
27073 The default for @option{-mfloat128} is enabled on PowerPC Linux
27074 systems using the VSX instruction set, and disabled on other systems.
27076 If you use the ISA 3.0 instruction set (@option{-mpower9-vector} or
27077 @option{-mcpu=power9}) on a 64-bit system, the IEEE 128-bit floating
27078 point support will also enable the generation of ISA 3.0 IEEE 128-bit
27079 floating point instructions.  Otherwise, if you do not specify to
27080 generate ISA 3.0 instructions or you are targeting a 32-bit big endian
27081 system, IEEE 128-bit floating point will be done with software
27082 emulation.
27084 @item -mfloat128-hardware
27085 @itemx -mno-float128-hardware
27086 @opindex mfloat128-hardware
27087 @opindex mno-float128-hardware
27088 Enable/disable using ISA 3.0 hardware instructions to support the
27089 @var{__float128} data type.
27091 The default for @option{-mfloat128-hardware} is enabled on PowerPC
27092 Linux systems using the ISA 3.0 instruction set, and disabled on other
27093 systems.
27095 @item -m32
27096 @itemx -m64
27097 @opindex m32
27098 @opindex m64
27099 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
27100 targets (including GNU/Linux).  The 32-bit environment sets int, long
27101 and pointer to 32 bits and generates code that runs on any PowerPC
27102 variant.  The 64-bit environment sets int to 32 bits and long and
27103 pointer to 64 bits, and generates code for PowerPC64, as for
27104 @option{-mpowerpc64}.
27106 @item -mfull-toc
27107 @itemx -mno-fp-in-toc
27108 @itemx -mno-sum-in-toc
27109 @itemx -mminimal-toc
27110 @opindex mfull-toc
27111 @opindex mno-fp-in-toc
27112 @opindex mno-sum-in-toc
27113 @opindex mminimal-toc
27114 Modify generation of the TOC (Table Of Contents), which is created for
27115 every executable file.  The @option{-mfull-toc} option is selected by
27116 default.  In that case, GCC allocates at least one TOC entry for
27117 each unique non-automatic variable reference in your program.  GCC
27118 also places floating-point constants in the TOC@.  However, only
27119 16,384 entries are available in the TOC@.
27121 If you receive a linker error message that saying you have overflowed
27122 the available TOC space, you can reduce the amount of TOC space used
27123 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
27124 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
27125 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
27126 generate code to calculate the sum of an address and a constant at
27127 run time instead of putting that sum into the TOC@.  You may specify one
27128 or both of these options.  Each causes GCC to produce very slightly
27129 slower and larger code at the expense of conserving TOC space.
27131 If you still run out of space in the TOC even when you specify both of
27132 these options, specify @option{-mminimal-toc} instead.  This option causes
27133 GCC to make only one TOC entry for every file.  When you specify this
27134 option, GCC produces code that is slower and larger but which
27135 uses extremely little TOC space.  You may wish to use this option
27136 only on files that contain less frequently-executed code.
27138 @item -maix64
27139 @itemx -maix32
27140 @opindex maix64
27141 @opindex maix32
27142 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
27143 @code{long} type, and the infrastructure needed to support them.
27144 Specifying @option{-maix64} implies @option{-mpowerpc64},
27145 while @option{-maix32} disables the 64-bit ABI and
27146 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
27148 @item -mxl-compat
27149 @itemx -mno-xl-compat
27150 @opindex mxl-compat
27151 @opindex mno-xl-compat
27152 Produce code that conforms more closely to IBM XL compiler semantics
27153 when using AIX-compatible ABI@.  Pass floating-point arguments to
27154 prototyped functions beyond the register save area (RSA) on the stack
27155 in addition to argument FPRs.  Do not assume that most significant
27156 double in 128-bit long double value is properly rounded when comparing
27157 values and converting to double.  Use XL symbol names for long double
27158 support routines.
27160 The AIX calling convention was extended but not initially documented to
27161 handle an obscure K&R C case of calling a function that takes the
27162 address of its arguments with fewer arguments than declared.  IBM XL
27163 compilers access floating-point arguments that do not fit in the
27164 RSA from the stack when a subroutine is compiled without
27165 optimization.  Because always storing floating-point arguments on the
27166 stack is inefficient and rarely needed, this option is not enabled by
27167 default and only is necessary when calling subroutines compiled by IBM
27168 XL compilers without optimization.
27170 @item -mpe
27171 @opindex mpe
27172 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
27173 application written to use message passing with special startup code to
27174 enable the application to run.  The system must have PE installed in the
27175 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
27176 must be overridden with the @option{-specs=} option to specify the
27177 appropriate directory location.  The Parallel Environment does not
27178 support threads, so the @option{-mpe} option and the @option{-pthread}
27179 option are incompatible.
27181 @item -malign-natural
27182 @itemx -malign-power
27183 @opindex malign-natural
27184 @opindex malign-power
27185 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
27186 @option{-malign-natural} overrides the ABI-defined alignment of larger
27187 types, such as floating-point doubles, on their natural size-based boundary.
27188 The option @option{-malign-power} instructs GCC to follow the ABI-specified
27189 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
27191 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
27192 is not supported.
27194 @item -msoft-float
27195 @itemx -mhard-float
27196 @opindex msoft-float
27197 @opindex mhard-float
27198 Generate code that does not use (uses) the floating-point register set.
27199 Software floating-point emulation is provided if you use the
27200 @option{-msoft-float} option, and pass the option to GCC when linking.
27202 @item -mmultiple
27203 @itemx -mno-multiple
27204 @opindex mmultiple
27205 @opindex mno-multiple
27206 Generate code that uses (does not use) the load multiple word
27207 instructions and the store multiple word instructions.  These
27208 instructions are generated by default on POWER systems, and not
27209 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
27210 PowerPC systems, since those instructions do not work when the
27211 processor is in little-endian mode.  The exceptions are PPC740 and
27212 PPC750 which permit these instructions in little-endian mode.
27214 @item -mupdate
27215 @itemx -mno-update
27216 @opindex mupdate
27217 @opindex mno-update
27218 Generate code that uses (does not use) the load or store instructions
27219 that update the base register to the address of the calculated memory
27220 location.  These instructions are generated by default.  If you use
27221 @option{-mno-update}, there is a small window between the time that the
27222 stack pointer is updated and the address of the previous frame is
27223 stored, which means code that walks the stack frame across interrupts or
27224 signals may get corrupted data.
27226 @item -mavoid-indexed-addresses
27227 @itemx -mno-avoid-indexed-addresses
27228 @opindex mavoid-indexed-addresses
27229 @opindex mno-avoid-indexed-addresses
27230 Generate code that tries to avoid (not avoid) the use of indexed load
27231 or store instructions. These instructions can incur a performance
27232 penalty on Power6 processors in certain situations, such as when
27233 stepping through large arrays that cross a 16M boundary.  This option
27234 is enabled by default when targeting Power6 and disabled otherwise.
27236 @item -mfused-madd
27237 @itemx -mno-fused-madd
27238 @opindex mfused-madd
27239 @opindex mno-fused-madd
27240 Generate code that uses (does not use) the floating-point multiply and
27241 accumulate instructions.  These instructions are generated by default
27242 if hardware floating point is used.  The machine-dependent
27243 @option{-mfused-madd} option is now mapped to the machine-independent
27244 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
27245 mapped to @option{-ffp-contract=off}.
27247 @item -mmulhw
27248 @itemx -mno-mulhw
27249 @opindex mmulhw
27250 @opindex mno-mulhw
27251 Generate code that uses (does not use) the half-word multiply and
27252 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
27253 These instructions are generated by default when targeting those
27254 processors.
27256 @item -mdlmzb
27257 @itemx -mno-dlmzb
27258 @opindex mdlmzb
27259 @opindex mno-dlmzb
27260 Generate code that uses (does not use) the string-search @samp{dlmzb}
27261 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
27262 generated by default when targeting those processors.
27264 @item -mno-bit-align
27265 @itemx -mbit-align
27266 @opindex mno-bit-align
27267 @opindex mbit-align
27268 On System V.4 and embedded PowerPC systems do not (do) force structures
27269 and unions that contain bit-fields to be aligned to the base type of the
27270 bit-field.
27272 For example, by default a structure containing nothing but 8
27273 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
27274 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
27275 the structure is aligned to a 1-byte boundary and is 1 byte in
27276 size.
27278 @item -mno-strict-align
27279 @itemx -mstrict-align
27280 @opindex mno-strict-align
27281 @opindex mstrict-align
27282 On System V.4 and embedded PowerPC systems do not (do) assume that
27283 unaligned memory references are handled by the system.
27285 @item -mrelocatable
27286 @itemx -mno-relocatable
27287 @opindex mrelocatable
27288 @opindex mno-relocatable
27289 Generate code that allows (does not allow) a static executable to be
27290 relocated to a different address at run time.  A simple embedded
27291 PowerPC system loader should relocate the entire contents of
27292 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
27293 a table of 32-bit addresses generated by this option.  For this to
27294 work, all objects linked together must be compiled with
27295 @option{-mrelocatable} or @option{-mrelocatable-lib}.
27296 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
27298 @item -mrelocatable-lib
27299 @itemx -mno-relocatable-lib
27300 @opindex mrelocatable-lib
27301 @opindex mno-relocatable-lib
27302 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
27303 @code{.fixup} section to allow static executables to be relocated at
27304 run time, but @option{-mrelocatable-lib} does not use the smaller stack
27305 alignment of @option{-mrelocatable}.  Objects compiled with
27306 @option{-mrelocatable-lib} may be linked with objects compiled with
27307 any combination of the @option{-mrelocatable} options.
27309 @item -mno-toc
27310 @itemx -mtoc
27311 @opindex mno-toc
27312 @opindex mtoc
27313 On System V.4 and embedded PowerPC systems do not (do) assume that
27314 register 2 contains a pointer to a global area pointing to the addresses
27315 used in the program.
27317 @item -mlittle
27318 @itemx -mlittle-endian
27319 @opindex mlittle
27320 @opindex mlittle-endian
27321 On System V.4 and embedded PowerPC systems compile code for the
27322 processor in little-endian mode.  The @option{-mlittle-endian} option is
27323 the same as @option{-mlittle}.
27325 @item -mbig
27326 @itemx -mbig-endian
27327 @opindex mbig
27328 @opindex mbig-endian
27329 On System V.4 and embedded PowerPC systems compile code for the
27330 processor in big-endian mode.  The @option{-mbig-endian} option is
27331 the same as @option{-mbig}.
27333 @item -mdynamic-no-pic
27334 @opindex mdynamic-no-pic
27335 On Darwin and Mac OS X systems, compile code so that it is not
27336 relocatable, but that its external references are relocatable.  The
27337 resulting code is suitable for applications, but not shared
27338 libraries.
27340 @item -msingle-pic-base
27341 @opindex msingle-pic-base
27342 Treat the register used for PIC addressing as read-only, rather than
27343 loading it in the prologue for each function.  The runtime system is
27344 responsible for initializing this register with an appropriate value
27345 before execution begins.
27347 @item -mprioritize-restricted-insns=@var{priority}
27348 @opindex mprioritize-restricted-insns
27349 This option controls the priority that is assigned to
27350 dispatch-slot restricted instructions during the second scheduling
27351 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
27352 or @samp{2} to assign no, highest, or second-highest (respectively) 
27353 priority to dispatch-slot restricted
27354 instructions.
27356 @item -msched-costly-dep=@var{dependence_type}
27357 @opindex msched-costly-dep
27358 This option controls which dependences are considered costly
27359 by the target during instruction scheduling.  The argument
27360 @var{dependence_type} takes one of the following values:
27362 @table @asis
27363 @item @samp{no}
27364 No dependence is costly.
27366 @item @samp{all}
27367 All dependences are costly.
27369 @item @samp{true_store_to_load}
27370 A true dependence from store to load is costly.
27372 @item @samp{store_to_load}
27373 Any dependence from store to load is costly.
27375 @item @var{number}
27376 Any dependence for which the latency is greater than or equal to 
27377 @var{number} is costly.
27378 @end table
27380 @item -minsert-sched-nops=@var{scheme}
27381 @opindex minsert-sched-nops
27382 This option controls which NOP insertion scheme is used during
27383 the second scheduling pass.  The argument @var{scheme} takes one of the
27384 following values:
27386 @table @asis
27387 @item @samp{no}
27388 Don't insert NOPs.
27390 @item @samp{pad}
27391 Pad with NOPs any dispatch group that has vacant issue slots,
27392 according to the scheduler's grouping.
27394 @item @samp{regroup_exact}
27395 Insert NOPs to force costly dependent insns into
27396 separate groups.  Insert exactly as many NOPs as needed to force an insn
27397 to a new group, according to the estimated processor grouping.
27399 @item @var{number}
27400 Insert NOPs to force costly dependent insns into
27401 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
27402 @end table
27404 @item -mcall-sysv
27405 @opindex mcall-sysv
27406 On System V.4 and embedded PowerPC systems compile code using calling
27407 conventions that adhere to the March 1995 draft of the System V
27408 Application Binary Interface, PowerPC processor supplement.  This is the
27409 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
27411 @item -mcall-sysv-eabi
27412 @itemx -mcall-eabi
27413 @opindex mcall-sysv-eabi
27414 @opindex mcall-eabi
27415 Specify both @option{-mcall-sysv} and @option{-meabi} options.
27417 @item -mcall-sysv-noeabi
27418 @opindex mcall-sysv-noeabi
27419 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
27421 @item -mcall-aixdesc
27422 @opindex m
27423 On System V.4 and embedded PowerPC systems compile code for the AIX
27424 operating system.
27426 @item -mcall-linux
27427 @opindex mcall-linux
27428 On System V.4 and embedded PowerPC systems compile code for the
27429 Linux-based GNU system.
27431 @item -mcall-freebsd
27432 @opindex mcall-freebsd
27433 On System V.4 and embedded PowerPC systems compile code for the
27434 FreeBSD operating system.
27436 @item -mcall-netbsd
27437 @opindex mcall-netbsd
27438 On System V.4 and embedded PowerPC systems compile code for the
27439 NetBSD operating system.
27441 @item -mcall-openbsd
27442 @opindex mcall-netbsd
27443 On System V.4 and embedded PowerPC systems compile code for the
27444 OpenBSD operating system.
27446 @item -mtraceback=@var{traceback_type}
27447 @opindex mtraceback
27448 Select the type of traceback table. Valid values for @var{traceback_type}
27449 are @samp{full}, @samp{part}, and @samp{no}.
27451 @item -maix-struct-return
27452 @opindex maix-struct-return
27453 Return all structures in memory (as specified by the AIX ABI)@.
27455 @item -msvr4-struct-return
27456 @opindex msvr4-struct-return
27457 Return structures smaller than 8 bytes in registers (as specified by the
27458 SVR4 ABI)@.
27460 @item -mabi=@var{abi-type}
27461 @opindex mabi
27462 Extend the current ABI with a particular extension, or remove such extension.
27463 Valid values are @samp{altivec}, @samp{no-altivec},
27464 @samp{ibmlongdouble}, @samp{ieeelongdouble},
27465 @samp{elfv1}, @samp{elfv2}@.
27467 @item -mabi=ibmlongdouble
27468 @opindex mabi=ibmlongdouble
27469 Change the current ABI to use IBM extended-precision long double.
27470 This is not likely to work if your system defaults to using IEEE
27471 extended-precision long double.  If you change the long double type
27472 from IEEE extended-precision, the compiler will issue a warning unless
27473 you use the @option{-Wno-psabi} option.  Requires @option{-mlong-double-128}
27474 to be enabled.
27476 @item -mabi=ieeelongdouble
27477 @opindex mabi=ieeelongdouble
27478 Change the current ABI to use IEEE extended-precision long double.
27479 This is not likely to work if your system defaults to using IBM
27480 extended-precision long double.  If you change the long double type
27481 from IBM extended-precision, the compiler will issue a warning unless
27482 you use the @option{-Wno-psabi} option.  Requires @option{-mlong-double-128}
27483 to be enabled.
27485 @item -mabi=elfv1
27486 @opindex mabi=elfv1
27487 Change the current ABI to use the ELFv1 ABI.
27488 This is the default ABI for big-endian PowerPC 64-bit Linux.
27489 Overriding the default ABI requires special system support and is
27490 likely to fail in spectacular ways.
27492 @item -mabi=elfv2
27493 @opindex mabi=elfv2
27494 Change the current ABI to use the ELFv2 ABI.
27495 This is the default ABI for little-endian PowerPC 64-bit Linux.
27496 Overriding the default ABI requires special system support and is
27497 likely to fail in spectacular ways.
27499 @item -mgnu-attribute
27500 @itemx -mno-gnu-attribute
27501 @opindex mgnu-attribute
27502 @opindex mno-gnu-attribute
27503 Emit .gnu_attribute assembly directives to set tag/value pairs in a
27504 .gnu.attributes section that specify ABI variations in function
27505 parameters or return values.
27507 @item -mprototype
27508 @itemx -mno-prototype
27509 @opindex mprototype
27510 @opindex mno-prototype
27511 On System V.4 and embedded PowerPC systems assume that all calls to
27512 variable argument functions are properly prototyped.  Otherwise, the
27513 compiler must insert an instruction before every non-prototyped call to
27514 set or clear bit 6 of the condition code register (@code{CR}) to
27515 indicate whether floating-point values are passed in the floating-point
27516 registers in case the function takes variable arguments.  With
27517 @option{-mprototype}, only calls to prototyped variable argument functions
27518 set or clear the bit.
27520 @item -msim
27521 @opindex msim
27522 On embedded PowerPC systems, assume that the startup module is called
27523 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
27524 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
27525 configurations.
27527 @item -mmvme
27528 @opindex mmvme
27529 On embedded PowerPC systems, assume that the startup module is called
27530 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
27531 @file{libc.a}.
27533 @item -mads
27534 @opindex mads
27535 On embedded PowerPC systems, assume that the startup module is called
27536 @file{crt0.o} and the standard C libraries are @file{libads.a} and
27537 @file{libc.a}.
27539 @item -myellowknife
27540 @opindex myellowknife
27541 On embedded PowerPC systems, assume that the startup module is called
27542 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
27543 @file{libc.a}.
27545 @item -mvxworks
27546 @opindex mvxworks
27547 On System V.4 and embedded PowerPC systems, specify that you are
27548 compiling for a VxWorks system.
27550 @item -memb
27551 @opindex memb
27552 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
27553 header to indicate that @samp{eabi} extended relocations are used.
27555 @item -meabi
27556 @itemx -mno-eabi
27557 @opindex meabi
27558 @opindex mno-eabi
27559 On System V.4 and embedded PowerPC systems do (do not) adhere to the
27560 Embedded Applications Binary Interface (EABI), which is a set of
27561 modifications to the System V.4 specifications.  Selecting @option{-meabi}
27562 means that the stack is aligned to an 8-byte boundary, a function
27563 @code{__eabi} is called from @code{main} to set up the EABI
27564 environment, and the @option{-msdata} option can use both @code{r2} and
27565 @code{r13} to point to two separate small data areas.  Selecting
27566 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
27567 no EABI initialization function is called from @code{main}, and the
27568 @option{-msdata} option only uses @code{r13} to point to a single
27569 small data area.  The @option{-meabi} option is on by default if you
27570 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
27572 @item -msdata=eabi
27573 @opindex msdata=eabi
27574 On System V.4 and embedded PowerPC systems, put small initialized
27575 @code{const} global and static data in the @code{.sdata2} section, which
27576 is pointed to by register @code{r2}.  Put small initialized
27577 non-@code{const} global and static data in the @code{.sdata} section,
27578 which is pointed to by register @code{r13}.  Put small uninitialized
27579 global and static data in the @code{.sbss} section, which is adjacent to
27580 the @code{.sdata} section.  The @option{-msdata=eabi} option is
27581 incompatible with the @option{-mrelocatable} option.  The
27582 @option{-msdata=eabi} option also sets the @option{-memb} option.
27584 @item -msdata=sysv
27585 @opindex msdata=sysv
27586 On System V.4 and embedded PowerPC systems, put small global and static
27587 data in the @code{.sdata} section, which is pointed to by register
27588 @code{r13}.  Put small uninitialized global and static data in the
27589 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
27590 The @option{-msdata=sysv} option is incompatible with the
27591 @option{-mrelocatable} option.
27593 @item -msdata=default
27594 @itemx -msdata
27595 @opindex msdata=default
27596 @opindex msdata
27597 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
27598 compile code the same as @option{-msdata=eabi}, otherwise compile code the
27599 same as @option{-msdata=sysv}.
27601 @item -msdata=data
27602 @opindex msdata=data
27603 On System V.4 and embedded PowerPC systems, put small global
27604 data in the @code{.sdata} section.  Put small uninitialized global
27605 data in the @code{.sbss} section.  Do not use register @code{r13}
27606 to address small data however.  This is the default behavior unless
27607 other @option{-msdata} options are used.
27609 @item -msdata=none
27610 @itemx -mno-sdata
27611 @opindex msdata=none
27612 @opindex mno-sdata
27613 On embedded PowerPC systems, put all initialized global and static data
27614 in the @code{.data} section, and all uninitialized data in the
27615 @code{.bss} section.
27617 @item -mreadonly-in-sdata
27618 @opindex mreadonly-in-sdata
27619 @opindex mno-readonly-in-sdata
27620 Put read-only objects in the @code{.sdata} section as well.  This is the
27621 default.
27623 @item -mblock-move-inline-limit=@var{num}
27624 @opindex mblock-move-inline-limit
27625 Inline all block moves (such as calls to @code{memcpy} or structure
27626 copies) less than or equal to @var{num} bytes.  The minimum value for
27627 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
27628 targets.  The default value is target-specific.
27630 @item -mblock-compare-inline-limit=@var{num}
27631 @opindex mblock-compare-inline-limit
27632 Generate non-looping inline code for all block compares (such as calls
27633 to @code{memcmp} or structure compares) less than or equal to @var{num}
27634 bytes. If @var{num} is 0, all inline expansion (non-loop and loop) of
27635 block compare is disabled. The default value is target-specific.
27637 @item -mblock-compare-inline-loop-limit=@var{num}
27638 @opindex mblock-compare-inline-loop-limit
27639 Generate an inline expansion using loop code for all block compares that
27640 are less than or equal to @var{num} bytes, but greater than the limit
27641 for non-loop inline block compare expansion. If the block length is not
27642 constant, at most @var{num} bytes will be compared before @code{memcmp}
27643 is called to compare the remainder of the block. The default value is
27644 target-specific.
27646 @item -mstring-compare-inline-limit=@var{num}
27647 @opindex mstring-compare-inline-limit
27648 Compare at most @var{num} string bytes with inline code.
27649 If the difference or end of string is not found at the
27650 end of the inline compare a call to @code{strcmp} or @code{strncmp} will
27651 take care of the rest of the comparison. The default is 64 bytes.
27653 @item -G @var{num}
27654 @opindex G
27655 @cindex smaller data references (PowerPC)
27656 @cindex .sdata/.sdata2 references (PowerPC)
27657 On embedded PowerPC systems, put global and static items less than or
27658 equal to @var{num} bytes into the small data or BSS sections instead of
27659 the normal data or BSS section.  By default, @var{num} is 8.  The
27660 @option{-G @var{num}} switch is also passed to the linker.
27661 All modules should be compiled with the same @option{-G @var{num}} value.
27663 @item -mregnames
27664 @itemx -mno-regnames
27665 @opindex mregnames
27666 @opindex mno-regnames
27667 On System V.4 and embedded PowerPC systems do (do not) emit register
27668 names in the assembly language output using symbolic forms.
27670 @item -mlongcall
27671 @itemx -mno-longcall
27672 @opindex mlongcall
27673 @opindex mno-longcall
27674 By default assume that all calls are far away so that a longer and more
27675 expensive calling sequence is required.  This is required for calls
27676 farther than 32 megabytes (33,554,432 bytes) from the current location.
27677 A short call is generated if the compiler knows
27678 the call cannot be that far away.  This setting can be overridden by
27679 the @code{shortcall} function attribute, or by @code{#pragma
27680 longcall(0)}.
27682 Some linkers are capable of detecting out-of-range calls and generating
27683 glue code on the fly.  On these systems, long calls are unnecessary and
27684 generate slower code.  As of this writing, the AIX linker can do this,
27685 as can the GNU linker for PowerPC/64.  It is planned to add this feature
27686 to the GNU linker for 32-bit PowerPC systems as well.
27688 On PowerPC64 ELFv2 and 32-bit PowerPC systems with newer GNU linkers,
27689 GCC can generate long calls using an inline PLT call sequence (see
27690 @option{-mpltseq}).  PowerPC with @option{-mbss-plt} and PowerPC64
27691 ELFv1 (big-endian) do not support inline PLT calls.
27693 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
27694 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
27695 addresses represent the callee and the branch island.  The
27696 Darwin/PPC linker prefers the first address and generates a @code{bl
27697 callee} if the PPC @code{bl} instruction reaches the callee directly;
27698 otherwise, the linker generates @code{bl L42} to call the branch
27699 island.  The branch island is appended to the body of the
27700 calling function; it computes the full 32-bit address of the callee
27701 and jumps to it.
27703 On Mach-O (Darwin) systems, this option directs the compiler emit to
27704 the glue for every direct call, and the Darwin linker decides whether
27705 to use or discard it.
27707 In the future, GCC may ignore all longcall specifications
27708 when the linker is known to generate glue.
27710 @item -mpltseq
27711 @itemx -mno-pltseq
27712 @opindex mpltseq
27713 @opindex mno-pltseq
27714 Implement (do not implement) -fno-plt and long calls using an inline
27715 PLT call sequence that supports lazy linking and long calls to
27716 functions in dlopen'd shared libraries.  Inline PLT calls are only
27717 supported on PowerPC64 ELFv2 and 32-bit PowerPC systems with newer GNU
27718 linkers, and are enabled by default if the support is detected when
27719 configuring GCC, and, in the case of 32-bit PowerPC, if GCC is
27720 configured with @option{--enable-secureplt}.  @option{-mpltseq} code
27721 and @option{-mbss-plt} 32-bit PowerPC relocatable objects may not be
27722 linked together.
27724 @item -mtls-markers
27725 @itemx -mno-tls-markers
27726 @opindex mtls-markers
27727 @opindex mno-tls-markers
27728 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
27729 specifying the function argument.  The relocation allows the linker to
27730 reliably associate function call with argument setup instructions for
27731 TLS optimization, which in turn allows GCC to better schedule the
27732 sequence.
27734 @item -mrecip
27735 @itemx -mno-recip
27736 @opindex mrecip
27737 This option enables use of the reciprocal estimate and
27738 reciprocal square root estimate instructions with additional
27739 Newton-Raphson steps to increase precision instead of doing a divide or
27740 square root and divide for floating-point arguments.  You should use
27741 the @option{-ffast-math} option when using @option{-mrecip} (or at
27742 least @option{-funsafe-math-optimizations},
27743 @option{-ffinite-math-only}, @option{-freciprocal-math} and
27744 @option{-fno-trapping-math}).  Note that while the throughput of the
27745 sequence is generally higher than the throughput of the non-reciprocal
27746 instruction, the precision of the sequence can be decreased by up to 2
27747 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
27748 roots.
27750 @item -mrecip=@var{opt}
27751 @opindex mrecip=opt
27752 This option controls which reciprocal estimate instructions
27753 may be used.  @var{opt} is a comma-separated list of options, which may
27754 be preceded by a @code{!} to invert the option:
27756 @table @samp
27758 @item all
27759 Enable all estimate instructions.
27761 @item default 
27762 Enable the default instructions, equivalent to @option{-mrecip}.
27764 @item none 
27765 Disable all estimate instructions, equivalent to @option{-mno-recip}.
27767 @item div 
27768 Enable the reciprocal approximation instructions for both 
27769 single and double precision.
27771 @item divf 
27772 Enable the single-precision reciprocal approximation instructions.
27774 @item divd 
27775 Enable the double-precision reciprocal approximation instructions.
27777 @item rsqrt 
27778 Enable the reciprocal square root approximation instructions for both
27779 single and double precision.
27781 @item rsqrtf 
27782 Enable the single-precision reciprocal square root approximation instructions.
27784 @item rsqrtd 
27785 Enable the double-precision reciprocal square root approximation instructions.
27787 @end table
27789 So, for example, @option{-mrecip=all,!rsqrtd} enables
27790 all of the reciprocal estimate instructions, except for the
27791 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
27792 which handle the double-precision reciprocal square root calculations.
27794 @item -mrecip-precision
27795 @itemx -mno-recip-precision
27796 @opindex mrecip-precision
27797 Assume (do not assume) that the reciprocal estimate instructions
27798 provide higher-precision estimates than is mandated by the PowerPC
27799 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
27800 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
27801 The double-precision square root estimate instructions are not generated by
27802 default on low-precision machines, since they do not provide an
27803 estimate that converges after three steps.
27805 @item -mveclibabi=@var{type}
27806 @opindex mveclibabi
27807 Specifies the ABI type to use for vectorizing intrinsics using an
27808 external library.  The only type supported at present is @samp{mass},
27809 which specifies to use IBM's Mathematical Acceleration Subsystem
27810 (MASS) libraries for vectorizing intrinsics using external libraries.
27811 GCC currently emits calls to @code{acosd2}, @code{acosf4},
27812 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
27813 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
27814 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
27815 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
27816 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
27817 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
27818 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
27819 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
27820 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
27821 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
27822 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
27823 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
27824 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
27825 for power7.  Both @option{-ftree-vectorize} and
27826 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
27827 libraries must be specified at link time.
27829 @item -mfriz
27830 @itemx -mno-friz
27831 @opindex mfriz
27832 Generate (do not generate) the @code{friz} instruction when the
27833 @option{-funsafe-math-optimizations} option is used to optimize
27834 rounding of floating-point values to 64-bit integer and back to floating
27835 point.  The @code{friz} instruction does not return the same value if
27836 the floating-point number is too large to fit in an integer.
27838 @item -mpointers-to-nested-functions
27839 @itemx -mno-pointers-to-nested-functions
27840 @opindex mpointers-to-nested-functions
27841 Generate (do not generate) code to load up the static chain register
27842 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
27843 systems where a function pointer points to a 3-word descriptor giving
27844 the function address, TOC value to be loaded in register @code{r2}, and
27845 static chain value to be loaded in register @code{r11}.  The
27846 @option{-mpointers-to-nested-functions} is on by default.  You cannot
27847 call through pointers to nested functions or pointers
27848 to functions compiled in other languages that use the static chain if
27849 you use @option{-mno-pointers-to-nested-functions}.
27851 @item -msave-toc-indirect
27852 @itemx -mno-save-toc-indirect
27853 @opindex msave-toc-indirect
27854 Generate (do not generate) code to save the TOC value in the reserved
27855 stack location in the function prologue if the function calls through
27856 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
27857 saved in the prologue, it is saved just before the call through the
27858 pointer.  The @option{-mno-save-toc-indirect} option is the default.
27860 @item -mcompat-align-parm
27861 @itemx -mno-compat-align-parm
27862 @opindex mcompat-align-parm
27863 Generate (do not generate) code to pass structure parameters with a
27864 maximum alignment of 64 bits, for compatibility with older versions
27865 of GCC.
27867 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
27868 structure parameter on a 128-bit boundary when that structure contained
27869 a member requiring 128-bit alignment.  This is corrected in more
27870 recent versions of GCC.  This option may be used to generate code
27871 that is compatible with functions compiled with older versions of
27872 GCC.
27874 The @option{-mno-compat-align-parm} option is the default.
27876 @item -mstack-protector-guard=@var{guard}
27877 @itemx -mstack-protector-guard-reg=@var{reg}
27878 @itemx -mstack-protector-guard-offset=@var{offset}
27879 @itemx -mstack-protector-guard-symbol=@var{symbol}
27880 @opindex mstack-protector-guard
27881 @opindex mstack-protector-guard-reg
27882 @opindex mstack-protector-guard-offset
27883 @opindex mstack-protector-guard-symbol
27884 Generate stack protection code using canary at @var{guard}.  Supported
27885 locations are @samp{global} for global canary or @samp{tls} for per-thread
27886 canary in the TLS block (the default with GNU libc version 2.4 or later).
27888 With the latter choice the options
27889 @option{-mstack-protector-guard-reg=@var{reg}} and
27890 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
27891 which register to use as base register for reading the canary, and from what
27892 offset from that base register. The default for those is as specified in the
27893 relevant ABI.  @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
27894 the offset with a symbol reference to a canary in the TLS block.
27896 @item -mpcrel
27897 @itemx -mno-pcrel
27898 @opindex mpcrel
27899 @opindex mno-pcrel
27900 Generate (do not generate) pc-relative addressing when the option
27901 @option{-mcpu=future} is used.  The @option{-mpcrel} option requires
27902 that the medium code model (@option{-mcmodel=medium}) and prefixed
27903 addressing (@option{-mprefixed}) options are enabled.
27905 @item -mprefixed
27906 @itemx -mno-prefixed
27907 @opindex mprefixed
27908 @opindex mno-prefixed
27909 Generate (do not generate) addressing modes using prefixed load and
27910 store instructions when the option @option{-mcpu=future} is used.
27912 @item -mmma
27913 @itemx -mno-mma
27914 @opindex mmma
27915 @opindex mno-mma
27916 Generate (do not generate) the MMA instructions when the option
27917 @option{-mcpu=future} is used.
27919 @item -mblock-ops-unaligned-vsx
27920 @itemx -mno-block-ops-unaligned-vsx
27921 @opindex block-ops-unaligned-vsx
27922 @opindex no-block-ops-unaligned-vsx
27923 Generate (do not generate) unaligned vsx loads and stores for
27924 inline expansion of @code{memcpy} and @code{memmove}.
27925 @end table
27927 @node RX Options
27928 @subsection RX Options
27929 @cindex RX Options
27931 These command-line options are defined for RX targets:
27933 @table @gcctabopt
27934 @item -m64bit-doubles
27935 @itemx -m32bit-doubles
27936 @opindex m64bit-doubles
27937 @opindex m32bit-doubles
27938 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
27939 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
27940 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
27941 works on 32-bit values, which is why the default is
27942 @option{-m32bit-doubles}.
27944 @item -fpu
27945 @itemx -nofpu
27946 @opindex fpu
27947 @opindex nofpu
27948 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
27949 floating-point hardware.  The default is enabled for the RX600
27950 series and disabled for the RX200 series.
27952 Floating-point instructions are only generated for 32-bit floating-point 
27953 values, however, so the FPU hardware is not used for doubles if the
27954 @option{-m64bit-doubles} option is used.
27956 @emph{Note} If the @option{-fpu} option is enabled then
27957 @option{-funsafe-math-optimizations} is also enabled automatically.
27958 This is because the RX FPU instructions are themselves unsafe.
27960 @item -mcpu=@var{name}
27961 @opindex mcpu
27962 Selects the type of RX CPU to be targeted.  Currently three types are
27963 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
27964 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
27966 The only difference between @samp{RX600} and @samp{RX610} is that the
27967 @samp{RX610} does not support the @code{MVTIPL} instruction.
27969 The @samp{RX200} series does not have a hardware floating-point unit
27970 and so @option{-nofpu} is enabled by default when this type is
27971 selected.
27973 @item -mbig-endian-data
27974 @itemx -mlittle-endian-data
27975 @opindex mbig-endian-data
27976 @opindex mlittle-endian-data
27977 Store data (but not code) in the big-endian format.  The default is
27978 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
27979 format.
27981 @item -msmall-data-limit=@var{N}
27982 @opindex msmall-data-limit
27983 Specifies the maximum size in bytes of global and static variables
27984 which can be placed into the small data area.  Using the small data
27985 area can lead to smaller and faster code, but the size of area is
27986 limited and it is up to the programmer to ensure that the area does
27987 not overflow.  Also when the small data area is used one of the RX's
27988 registers (usually @code{r13}) is reserved for use pointing to this
27989 area, so it is no longer available for use by the compiler.  This
27990 could result in slower and/or larger code if variables are pushed onto
27991 the stack instead of being held in this register.
27993 Note, common variables (variables that have not been initialized) and
27994 constants are not placed into the small data area as they are assigned
27995 to other sections in the output executable.
27997 The default value is zero, which disables this feature.  Note, this
27998 feature is not enabled by default with higher optimization levels
27999 (@option{-O2} etc) because of the potentially detrimental effects of
28000 reserving a register.  It is up to the programmer to experiment and
28001 discover whether this feature is of benefit to their program.  See the
28002 description of the @option{-mpid} option for a description of how the
28003 actual register to hold the small data area pointer is chosen.
28005 @item -msim
28006 @itemx -mno-sim
28007 @opindex msim
28008 @opindex mno-sim
28009 Use the simulator runtime.  The default is to use the libgloss
28010 board-specific runtime.
28012 @item -mas100-syntax
28013 @itemx -mno-as100-syntax
28014 @opindex mas100-syntax
28015 @opindex mno-as100-syntax
28016 When generating assembler output use a syntax that is compatible with
28017 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
28018 assembler, but it has some restrictions so it is not generated by default.
28020 @item -mmax-constant-size=@var{N}
28021 @opindex mmax-constant-size
28022 Specifies the maximum size, in bytes, of a constant that can be used as
28023 an operand in a RX instruction.  Although the RX instruction set does
28024 allow constants of up to 4 bytes in length to be used in instructions,
28025 a longer value equates to a longer instruction.  Thus in some
28026 circumstances it can be beneficial to restrict the size of constants
28027 that are used in instructions.  Constants that are too big are instead
28028 placed into a constant pool and referenced via register indirection.
28030 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
28031 or 4 means that constants of any size are allowed.
28033 @item -mrelax
28034 @opindex mrelax
28035 Enable linker relaxation.  Linker relaxation is a process whereby the
28036 linker attempts to reduce the size of a program by finding shorter
28037 versions of various instructions.  Disabled by default.
28039 @item -mint-register=@var{N}
28040 @opindex mint-register
28041 Specify the number of registers to reserve for fast interrupt handler
28042 functions.  The value @var{N} can be between 0 and 4.  A value of 1
28043 means that register @code{r13} is reserved for the exclusive use
28044 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
28045 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
28046 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
28047 A value of 0, the default, does not reserve any registers.
28049 @item -msave-acc-in-interrupts
28050 @opindex msave-acc-in-interrupts
28051 Specifies that interrupt handler functions should preserve the
28052 accumulator register.  This is only necessary if normal code might use
28053 the accumulator register, for example because it performs 64-bit
28054 multiplications.  The default is to ignore the accumulator as this
28055 makes the interrupt handlers faster.
28057 @item -mpid
28058 @itemx -mno-pid
28059 @opindex mpid
28060 @opindex mno-pid
28061 Enables the generation of position independent data.  When enabled any
28062 access to constant data is done via an offset from a base address
28063 held in a register.  This allows the location of constant data to be
28064 determined at run time without requiring the executable to be
28065 relocated, which is a benefit to embedded applications with tight
28066 memory constraints.  Data that can be modified is not affected by this
28067 option.
28069 Note, using this feature reserves a register, usually @code{r13}, for
28070 the constant data base address.  This can result in slower and/or
28071 larger code, especially in complicated functions.
28073 The actual register chosen to hold the constant data base address
28074 depends upon whether the @option{-msmall-data-limit} and/or the
28075 @option{-mint-register} command-line options are enabled.  Starting
28076 with register @code{r13} and proceeding downwards, registers are
28077 allocated first to satisfy the requirements of @option{-mint-register},
28078 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
28079 is possible for the small data area register to be @code{r8} if both
28080 @option{-mint-register=4} and @option{-mpid} are specified on the
28081 command line.
28083 By default this feature is not enabled.  The default can be restored
28084 via the @option{-mno-pid} command-line option.
28086 @item -mno-warn-multiple-fast-interrupts
28087 @itemx -mwarn-multiple-fast-interrupts
28088 @opindex mno-warn-multiple-fast-interrupts
28089 @opindex mwarn-multiple-fast-interrupts
28090 Prevents GCC from issuing a warning message if it finds more than one
28091 fast interrupt handler when it is compiling a file.  The default is to
28092 issue a warning for each extra fast interrupt handler found, as the RX
28093 only supports one such interrupt.
28095 @item -mallow-string-insns
28096 @itemx -mno-allow-string-insns
28097 @opindex mallow-string-insns
28098 @opindex mno-allow-string-insns
28099 Enables or disables the use of the string manipulation instructions
28100 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
28101 @code{SWHILE} and also the @code{RMPA} instruction.  These
28102 instructions may prefetch data, which is not safe to do if accessing
28103 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
28104 for more information).
28106 The default is to allow these instructions, but it is not possible for
28107 GCC to reliably detect all circumstances where a string instruction
28108 might be used to access an I/O register, so their use cannot be
28109 disabled automatically.  Instead it is reliant upon the programmer to
28110 use the @option{-mno-allow-string-insns} option if their program
28111 accesses I/O space.
28113 When the instructions are enabled GCC defines the C preprocessor
28114 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
28115 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
28117 @item -mjsr
28118 @itemx -mno-jsr
28119 @opindex mjsr
28120 @opindex mno-jsr
28121 Use only (or not only) @code{JSR} instructions to access functions.
28122 This option can be used when code size exceeds the range of @code{BSR}
28123 instructions.  Note that @option{-mno-jsr} does not mean to not use
28124 @code{JSR} but instead means that any type of branch may be used.
28125 @end table
28127 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
28128 has special significance to the RX port when used with the
28129 @code{interrupt} function attribute.  This attribute indicates a
28130 function intended to process fast interrupts.  GCC ensures
28131 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
28132 and/or @code{r13} and only provided that the normal use of the
28133 corresponding registers have been restricted via the
28134 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
28135 options.
28137 @node S/390 and zSeries Options
28138 @subsection S/390 and zSeries Options
28139 @cindex S/390 and zSeries Options
28141 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
28143 @table @gcctabopt
28144 @item -mhard-float
28145 @itemx -msoft-float
28146 @opindex mhard-float
28147 @opindex msoft-float
28148 Use (do not use) the hardware floating-point instructions and registers
28149 for floating-point operations.  When @option{-msoft-float} is specified,
28150 functions in @file{libgcc.a} are used to perform floating-point
28151 operations.  When @option{-mhard-float} is specified, the compiler
28152 generates IEEE floating-point instructions.  This is the default.
28154 @item -mhard-dfp
28155 @itemx -mno-hard-dfp
28156 @opindex mhard-dfp
28157 @opindex mno-hard-dfp
28158 Use (do not use) the hardware decimal-floating-point instructions for
28159 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
28160 specified, functions in @file{libgcc.a} are used to perform
28161 decimal-floating-point operations.  When @option{-mhard-dfp} is
28162 specified, the compiler generates decimal-floating-point hardware
28163 instructions.  This is the default for @option{-march=z9-ec} or higher.
28165 @item -mlong-double-64
28166 @itemx -mlong-double-128
28167 @opindex mlong-double-64
28168 @opindex mlong-double-128
28169 These switches control the size of @code{long double} type. A size
28170 of 64 bits makes the @code{long double} type equivalent to the @code{double}
28171 type. This is the default.
28173 @item -mbackchain
28174 @itemx -mno-backchain
28175 @opindex mbackchain
28176 @opindex mno-backchain
28177 Store (do not store) the address of the caller's frame as backchain pointer
28178 into the callee's stack frame.
28179 A backchain may be needed to allow debugging using tools that do not understand
28180 DWARF call frame information.
28181 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
28182 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
28183 the backchain is placed into the topmost word of the 96/160 byte register
28184 save area.
28186 In general, code compiled with @option{-mbackchain} is call-compatible with
28187 code compiled with @option{-mno-backchain}; however, use of the backchain
28188 for debugging purposes usually requires that the whole binary is built with
28189 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
28190 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
28191 to build a linux kernel use @option{-msoft-float}.
28193 The default is to not maintain the backchain.
28195 @item -mpacked-stack
28196 @itemx -mno-packed-stack
28197 @opindex mpacked-stack
28198 @opindex mno-packed-stack
28199 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
28200 specified, the compiler uses the all fields of the 96/160 byte register save
28201 area only for their default purpose; unused fields still take up stack space.
28202 When @option{-mpacked-stack} is specified, register save slots are densely
28203 packed at the top of the register save area; unused space is reused for other
28204 purposes, allowing for more efficient use of the available stack space.
28205 However, when @option{-mbackchain} is also in effect, the topmost word of
28206 the save area is always used to store the backchain, and the return address
28207 register is always saved two words below the backchain.
28209 As long as the stack frame backchain is not used, code generated with
28210 @option{-mpacked-stack} is call-compatible with code generated with
28211 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
28212 S/390 or zSeries generated code that uses the stack frame backchain at run
28213 time, not just for debugging purposes.  Such code is not call-compatible
28214 with code compiled with @option{-mpacked-stack}.  Also, note that the
28215 combination of @option{-mbackchain},
28216 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
28217 to build a linux kernel use @option{-msoft-float}.
28219 The default is to not use the packed stack layout.
28221 @item -msmall-exec
28222 @itemx -mno-small-exec
28223 @opindex msmall-exec
28224 @opindex mno-small-exec
28225 Generate (or do not generate) code using the @code{bras} instruction
28226 to do subroutine calls.
28227 This only works reliably if the total executable size does not
28228 exceed 64k.  The default is to use the @code{basr} instruction instead,
28229 which does not have this limitation.
28231 @item -m64
28232 @itemx -m31
28233 @opindex m64
28234 @opindex m31
28235 When @option{-m31} is specified, generate code compliant to the
28236 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
28237 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
28238 particular to generate 64-bit instructions.  For the @samp{s390}
28239 targets, the default is @option{-m31}, while the @samp{s390x}
28240 targets default to @option{-m64}.
28242 @item -mzarch
28243 @itemx -mesa
28244 @opindex mzarch
28245 @opindex mesa
28246 When @option{-mzarch} is specified, generate code using the
28247 instructions available on z/Architecture.
28248 When @option{-mesa} is specified, generate code using the
28249 instructions available on ESA/390.  Note that @option{-mesa} is
28250 not possible with @option{-m64}.
28251 When generating code compliant to the GNU/Linux for S/390 ABI,
28252 the default is @option{-mesa}.  When generating code compliant
28253 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
28255 @item -mhtm
28256 @itemx -mno-htm
28257 @opindex mhtm
28258 @opindex mno-htm
28259 The @option{-mhtm} option enables a set of builtins making use of
28260 instructions available with the transactional execution facility
28261 introduced with the IBM zEnterprise EC12 machine generation
28262 @ref{S/390 System z Built-in Functions}.
28263 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
28265 @item -mvx
28266 @itemx -mno-vx
28267 @opindex mvx
28268 @opindex mno-vx
28269 When @option{-mvx} is specified, generate code using the instructions
28270 available with the vector extension facility introduced with the IBM
28271 z13 machine generation.
28272 This option changes the ABI for some vector type values with regard to
28273 alignment and calling conventions.  In case vector type values are
28274 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
28275 command will be added to mark the resulting binary with the ABI used.
28276 @option{-mvx} is enabled by default when using @option{-march=z13}.
28278 @item -mzvector
28279 @itemx -mno-zvector
28280 @opindex mzvector
28281 @opindex mno-zvector
28282 The @option{-mzvector} option enables vector language extensions and
28283 builtins using instructions available with the vector extension
28284 facility introduced with the IBM z13 machine generation.
28285 This option adds support for @samp{vector} to be used as a keyword to
28286 define vector type variables and arguments.  @samp{vector} is only
28287 available when GNU extensions are enabled.  It will not be expanded
28288 when requesting strict standard compliance e.g.@: with @option{-std=c99}.
28289 In addition to the GCC low-level builtins @option{-mzvector} enables
28290 a set of builtins added for compatibility with AltiVec-style
28291 implementations like Power and Cell.  In order to make use of these
28292 builtins the header file @file{vecintrin.h} needs to be included.
28293 @option{-mzvector} is disabled by default.
28295 @item -mmvcle
28296 @itemx -mno-mvcle
28297 @opindex mmvcle
28298 @opindex mno-mvcle
28299 Generate (or do not generate) code using the @code{mvcle} instruction
28300 to perform block moves.  When @option{-mno-mvcle} is specified,
28301 use a @code{mvc} loop instead.  This is the default unless optimizing for
28302 size.
28304 @item -mdebug
28305 @itemx -mno-debug
28306 @opindex mdebug
28307 @opindex mno-debug
28308 Print (or do not print) additional debug information when compiling.
28309 The default is to not print debug information.
28311 @item -march=@var{cpu-type}
28312 @opindex march
28313 Generate code that runs on @var{cpu-type}, which is the name of a
28314 system representing a certain processor type.  Possible values for
28315 @var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
28316 @samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
28317 @samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11},
28318 @samp{z14}/@samp{arch12}, @samp{z15}/@samp{arch13}, and @samp{native}.
28320 The default is @option{-march=z900}.
28322 Specifying @samp{native} as cpu type can be used to select the best
28323 architecture option for the host processor.
28324 @option{-march=native} has no effect if GCC does not recognize the
28325 processor.
28327 @item -mtune=@var{cpu-type}
28328 @opindex mtune
28329 Tune to @var{cpu-type} everything applicable about the generated code,
28330 except for the ABI and the set of available instructions.
28331 The list of @var{cpu-type} values is the same as for @option{-march}.
28332 The default is the value used for @option{-march}.
28334 @item -mtpf-trace
28335 @itemx -mno-tpf-trace
28336 @opindex mtpf-trace
28337 @opindex mno-tpf-trace
28338 Generate code that adds (does not add) in TPF OS specific branches to trace
28339 routines in the operating system.  This option is off by default, even
28340 when compiling for the TPF OS@.
28342 @item -mtpf-trace-skip
28343 @itemx -mno-tpf-trace-skip
28344 @opindex mtpf-trace-skip
28345 @opindex mno-tpf-trace-skip
28346 Generate code that changes (does not change) the default branch
28347 targets enabled by @option{-mtpf-trace} to point to specialized trace
28348 routines providing the ability of selectively skipping function trace
28349 entries for the TPF OS.  This option is off by default, even when
28350 compiling for the TPF OS and specifying @option{-mtpf-trace}.
28352 @item -mfused-madd
28353 @itemx -mno-fused-madd
28354 @opindex mfused-madd
28355 @opindex mno-fused-madd
28356 Generate code that uses (does not use) the floating-point multiply and
28357 accumulate instructions.  These instructions are generated by default if
28358 hardware floating point is used.
28360 @item -mwarn-framesize=@var{framesize}
28361 @opindex mwarn-framesize
28362 Emit a warning if the current function exceeds the given frame size.  Because
28363 this is a compile-time check it doesn't need to be a real problem when the program
28364 runs.  It is intended to identify functions that most probably cause
28365 a stack overflow.  It is useful to be used in an environment with limited stack
28366 size e.g.@: the linux kernel.
28368 @item -mwarn-dynamicstack
28369 @opindex mwarn-dynamicstack
28370 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
28371 arrays.  This is generally a bad idea with a limited stack size.
28373 @item -mstack-guard=@var{stack-guard}
28374 @itemx -mstack-size=@var{stack-size}
28375 @opindex mstack-guard
28376 @opindex mstack-size
28377 If these options are provided the S/390 back end emits additional instructions in
28378 the function prologue that trigger a trap if the stack size is @var{stack-guard}
28379 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
28380 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
28381 the frame size of the compiled function is chosen.
28382 These options are intended to be used to help debugging stack overflow problems.
28383 The additionally emitted code causes only little overhead and hence can also be
28384 used in production-like systems without greater performance degradation.  The given
28385 values have to be exact powers of 2 and @var{stack-size} has to be greater than
28386 @var{stack-guard} without exceeding 64k.
28387 In order to be efficient the extra code makes the assumption that the stack starts
28388 at an address aligned to the value given by @var{stack-size}.
28389 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
28391 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
28392 @opindex mhotpatch
28393 If the hotpatch option is enabled, a ``hot-patching'' function
28394 prologue is generated for all functions in the compilation unit.
28395 The funtion label is prepended with the given number of two-byte
28396 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
28397 the label, 2 * @var{post-halfwords} bytes are appended, using the
28398 largest NOP like instructions the architecture allows (maximum
28399 1000000).
28401 If both arguments are zero, hotpatching is disabled.
28403 This option can be overridden for individual functions with the
28404 @code{hotpatch} attribute.
28405 @end table
28407 @node Score Options
28408 @subsection Score Options
28409 @cindex Score Options
28411 These options are defined for Score implementations:
28413 @table @gcctabopt
28414 @item -meb
28415 @opindex meb
28416 Compile code for big-endian mode.  This is the default.
28418 @item -mel
28419 @opindex mel
28420 Compile code for little-endian mode.
28422 @item -mnhwloop
28423 @opindex mnhwloop
28424 Disable generation of @code{bcnz} instructions.
28426 @item -muls
28427 @opindex muls
28428 Enable generation of unaligned load and store instructions.
28430 @item -mmac
28431 @opindex mmac
28432 Enable the use of multiply-accumulate instructions. Disabled by default.
28434 @item -mscore5
28435 @opindex mscore5
28436 Specify the SCORE5 as the target architecture.
28438 @item -mscore5u
28439 @opindex mscore5u
28440 Specify the SCORE5U of the target architecture.
28442 @item -mscore7
28443 @opindex mscore7
28444 Specify the SCORE7 as the target architecture. This is the default.
28446 @item -mscore7d
28447 @opindex mscore7d
28448 Specify the SCORE7D as the target architecture.
28449 @end table
28451 @node SH Options
28452 @subsection SH Options
28454 These @samp{-m} options are defined for the SH implementations:
28456 @table @gcctabopt
28457 @item -m1
28458 @opindex m1
28459 Generate code for the SH1.
28461 @item -m2
28462 @opindex m2
28463 Generate code for the SH2.
28465 @item -m2e
28466 Generate code for the SH2e.
28468 @item -m2a-nofpu
28469 @opindex m2a-nofpu
28470 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
28471 that the floating-point unit is not used.
28473 @item -m2a-single-only
28474 @opindex m2a-single-only
28475 Generate code for the SH2a-FPU, in such a way that no double-precision
28476 floating-point operations are used.
28478 @item -m2a-single
28479 @opindex m2a-single
28480 Generate code for the SH2a-FPU assuming the floating-point unit is in
28481 single-precision mode by default.
28483 @item -m2a
28484 @opindex m2a
28485 Generate code for the SH2a-FPU assuming the floating-point unit is in
28486 double-precision mode by default.
28488 @item -m3
28489 @opindex m3
28490 Generate code for the SH3.
28492 @item -m3e
28493 @opindex m3e
28494 Generate code for the SH3e.
28496 @item -m4-nofpu
28497 @opindex m4-nofpu
28498 Generate code for the SH4 without a floating-point unit.
28500 @item -m4-single-only
28501 @opindex m4-single-only
28502 Generate code for the SH4 with a floating-point unit that only
28503 supports single-precision arithmetic.
28505 @item -m4-single
28506 @opindex m4-single
28507 Generate code for the SH4 assuming the floating-point unit is in
28508 single-precision mode by default.
28510 @item -m4
28511 @opindex m4
28512 Generate code for the SH4.
28514 @item -m4-100
28515 @opindex m4-100
28516 Generate code for SH4-100.
28518 @item -m4-100-nofpu
28519 @opindex m4-100-nofpu
28520 Generate code for SH4-100 in such a way that the
28521 floating-point unit is not used.
28523 @item -m4-100-single
28524 @opindex m4-100-single
28525 Generate code for SH4-100 assuming the floating-point unit is in
28526 single-precision mode by default.
28528 @item -m4-100-single-only
28529 @opindex m4-100-single-only
28530 Generate code for SH4-100 in such a way that no double-precision
28531 floating-point operations are used.
28533 @item -m4-200
28534 @opindex m4-200
28535 Generate code for SH4-200.
28537 @item -m4-200-nofpu
28538 @opindex m4-200-nofpu
28539 Generate code for SH4-200 without in such a way that the
28540 floating-point unit is not used.
28542 @item -m4-200-single
28543 @opindex m4-200-single
28544 Generate code for SH4-200 assuming the floating-point unit is in
28545 single-precision mode by default.
28547 @item -m4-200-single-only
28548 @opindex m4-200-single-only
28549 Generate code for SH4-200 in such a way that no double-precision
28550 floating-point operations are used.
28552 @item -m4-300
28553 @opindex m4-300
28554 Generate code for SH4-300.
28556 @item -m4-300-nofpu
28557 @opindex m4-300-nofpu
28558 Generate code for SH4-300 without in such a way that the
28559 floating-point unit is not used.
28561 @item -m4-300-single
28562 @opindex m4-300-single
28563 Generate code for SH4-300 in such a way that no double-precision
28564 floating-point operations are used.
28566 @item -m4-300-single-only
28567 @opindex m4-300-single-only
28568 Generate code for SH4-300 in such a way that no double-precision
28569 floating-point operations are used.
28571 @item -m4-340
28572 @opindex m4-340
28573 Generate code for SH4-340 (no MMU, no FPU).
28575 @item -m4-500
28576 @opindex m4-500
28577 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
28578 assembler.
28580 @item -m4a-nofpu
28581 @opindex m4a-nofpu
28582 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
28583 floating-point unit is not used.
28585 @item -m4a-single-only
28586 @opindex m4a-single-only
28587 Generate code for the SH4a, in such a way that no double-precision
28588 floating-point operations are used.
28590 @item -m4a-single
28591 @opindex m4a-single
28592 Generate code for the SH4a assuming the floating-point unit is in
28593 single-precision mode by default.
28595 @item -m4a
28596 @opindex m4a
28597 Generate code for the SH4a.
28599 @item -m4al
28600 @opindex m4al
28601 Same as @option{-m4a-nofpu}, except that it implicitly passes
28602 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
28603 instructions at the moment.
28605 @item -mb
28606 @opindex mb
28607 Compile code for the processor in big-endian mode.
28609 @item -ml
28610 @opindex ml
28611 Compile code for the processor in little-endian mode.
28613 @item -mdalign
28614 @opindex mdalign
28615 Align doubles at 64-bit boundaries.  Note that this changes the calling
28616 conventions, and thus some functions from the standard C library do
28617 not work unless you recompile it first with @option{-mdalign}.
28619 @item -mrelax
28620 @opindex mrelax
28621 Shorten some address references at link time, when possible; uses the
28622 linker option @option{-relax}.
28624 @item -mbigtable
28625 @opindex mbigtable
28626 Use 32-bit offsets in @code{switch} tables.  The default is to use
28627 16-bit offsets.
28629 @item -mbitops
28630 @opindex mbitops
28631 Enable the use of bit manipulation instructions on SH2A.
28633 @item -mfmovd
28634 @opindex mfmovd
28635 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
28636 alignment constraints.
28638 @item -mrenesas
28639 @opindex mrenesas
28640 Comply with the calling conventions defined by Renesas.
28642 @item -mno-renesas
28643 @opindex mno-renesas
28644 Comply with the calling conventions defined for GCC before the Renesas
28645 conventions were available.  This option is the default for all
28646 targets of the SH toolchain.
28648 @item -mnomacsave
28649 @opindex mnomacsave
28650 Mark the @code{MAC} register as call-clobbered, even if
28651 @option{-mrenesas} is given.
28653 @item -mieee
28654 @itemx -mno-ieee
28655 @opindex mieee
28656 @opindex mno-ieee
28657 Control the IEEE compliance of floating-point comparisons, which affects the
28658 handling of cases where the result of a comparison is unordered.  By default
28659 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
28660 enabled @option{-mno-ieee} is implicitly set, which results in faster
28661 floating-point greater-equal and less-equal comparisons.  The implicit settings
28662 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
28664 @item -minline-ic_invalidate
28665 @opindex minline-ic_invalidate
28666 Inline code to invalidate instruction cache entries after setting up
28667 nested function trampolines.
28668 This option has no effect if @option{-musermode} is in effect and the selected
28669 code generation option (e.g.@: @option{-m4}) does not allow the use of the @code{icbi}
28670 instruction.
28671 If the selected code generation option does not allow the use of the @code{icbi}
28672 instruction, and @option{-musermode} is not in effect, the inlined code
28673 manipulates the instruction cache address array directly with an associative
28674 write.  This not only requires privileged mode at run time, but it also
28675 fails if the cache line had been mapped via the TLB and has become unmapped.
28677 @item -misize
28678 @opindex misize
28679 Dump instruction size and location in the assembly code.
28681 @item -mpadstruct
28682 @opindex mpadstruct
28683 This option is deprecated.  It pads structures to multiple of 4 bytes,
28684 which is incompatible with the SH ABI@.
28686 @item -matomic-model=@var{model}
28687 @opindex matomic-model=@var{model}
28688 Sets the model of atomic operations and additional parameters as a comma
28689 separated list.  For details on the atomic built-in functions see
28690 @ref{__atomic Builtins}.  The following models and parameters are supported:
28692 @table @samp
28694 @item none
28695 Disable compiler generated atomic sequences and emit library calls for atomic
28696 operations.  This is the default if the target is not @code{sh*-*-linux*}.
28698 @item soft-gusa
28699 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
28700 built-in functions.  The generated atomic sequences require additional support
28701 from the interrupt/exception handling code of the system and are only suitable
28702 for SH3* and SH4* single-core systems.  This option is enabled by default when
28703 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
28704 this option also partially utilizes the hardware atomic instructions
28705 @code{movli.l} and @code{movco.l} to create more efficient code, unless
28706 @samp{strict} is specified.  
28708 @item soft-tcb
28709 Generate software atomic sequences that use a variable in the thread control
28710 block.  This is a variation of the gUSA sequences which can also be used on
28711 SH1* and SH2* targets.  The generated atomic sequences require additional
28712 support from the interrupt/exception handling code of the system and are only
28713 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
28714 parameter has to be specified as well.
28716 @item soft-imask
28717 Generate software atomic sequences that temporarily disable interrupts by
28718 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
28719 in privileged mode and is only suitable for single-core systems.  Additional
28720 support from the interrupt/exception handling code of the system is not
28721 required.  This model is enabled by default when the target is
28722 @code{sh*-*-linux*} and SH1* or SH2*.
28724 @item hard-llcs
28725 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
28726 instructions only.  This is only available on SH4A and is suitable for
28727 multi-core systems.  Since the hardware instructions support only 32 bit atomic
28728 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
28729 Code compiled with this option is also compatible with other software
28730 atomic model interrupt/exception handling systems if executed on an SH4A
28731 system.  Additional support from the interrupt/exception handling code of the
28732 system is not required for this model.
28734 @item gbr-offset=
28735 This parameter specifies the offset in bytes of the variable in the thread
28736 control block structure that should be used by the generated atomic sequences
28737 when the @samp{soft-tcb} model has been selected.  For other models this
28738 parameter is ignored.  The specified value must be an integer multiple of four
28739 and in the range 0-1020.
28741 @item strict
28742 This parameter prevents mixed usage of multiple atomic models, even if they
28743 are compatible, and makes the compiler generate atomic sequences of the
28744 specified model only.
28746 @end table
28748 @item -mtas
28749 @opindex mtas
28750 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
28751 Notice that depending on the particular hardware and software configuration
28752 this can degrade overall performance due to the operand cache line flushes
28753 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
28754 processors the @code{tas.b} instruction must be used with caution since it
28755 can result in data corruption for certain cache configurations.
28757 @item -mprefergot
28758 @opindex mprefergot
28759 When generating position-independent code, emit function calls using
28760 the Global Offset Table instead of the Procedure Linkage Table.
28762 @item -musermode
28763 @itemx -mno-usermode
28764 @opindex musermode
28765 @opindex mno-usermode
28766 Don't allow (allow) the compiler generating privileged mode code.  Specifying
28767 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
28768 inlined code would not work in user mode.  @option{-musermode} is the default
28769 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
28770 @option{-musermode} has no effect, since there is no user mode.
28772 @item -multcost=@var{number}
28773 @opindex multcost=@var{number}
28774 Set the cost to assume for a multiply insn.
28776 @item -mdiv=@var{strategy}
28777 @opindex mdiv=@var{strategy}
28778 Set the division strategy to be used for integer division operations.
28779 @var{strategy} can be one of: 
28781 @table @samp
28783 @item call-div1
28784 Calls a library function that uses the single-step division instruction
28785 @code{div1} to perform the operation.  Division by zero calculates an
28786 unspecified result and does not trap.  This is the default except for SH4,
28787 SH2A and SHcompact.
28789 @item call-fp
28790 Calls a library function that performs the operation in double precision
28791 floating point.  Division by zero causes a floating-point exception.  This is
28792 the default for SHcompact with FPU.  Specifying this for targets that do not
28793 have a double precision FPU defaults to @code{call-div1}.
28795 @item call-table
28796 Calls a library function that uses a lookup table for small divisors and
28797 the @code{div1} instruction with case distinction for larger divisors.  Division
28798 by zero calculates an unspecified result and does not trap.  This is the default
28799 for SH4.  Specifying this for targets that do not have dynamic shift
28800 instructions defaults to @code{call-div1}.
28802 @end table
28804 When a division strategy has not been specified the default strategy is
28805 selected based on the current target.  For SH2A the default strategy is to
28806 use the @code{divs} and @code{divu} instructions instead of library function
28807 calls.
28809 @item -maccumulate-outgoing-args
28810 @opindex maccumulate-outgoing-args
28811 Reserve space once for outgoing arguments in the function prologue rather
28812 than around each call.  Generally beneficial for performance and size.  Also
28813 needed for unwinding to avoid changing the stack frame around conditional code.
28815 @item -mdivsi3_libfunc=@var{name}
28816 @opindex mdivsi3_libfunc=@var{name}
28817 Set the name of the library function used for 32-bit signed division to
28818 @var{name}.
28819 This only affects the name used in the @samp{call} division strategies, and
28820 the compiler still expects the same sets of input/output/clobbered registers as
28821 if this option were not present.
28823 @item -mfixed-range=@var{register-range}
28824 @opindex mfixed-range
28825 Generate code treating the given register range as fixed registers.
28826 A fixed register is one that the register allocator cannot use.  This is
28827 useful when compiling kernel code.  A register range is specified as
28828 two registers separated by a dash.  Multiple register ranges can be
28829 specified separated by a comma.
28831 @item -mbranch-cost=@var{num}
28832 @opindex mbranch-cost=@var{num}
28833 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
28834 make the compiler try to generate more branch-free code if possible.  
28835 If not specified the value is selected depending on the processor type that
28836 is being compiled for.
28838 @item -mzdcbranch
28839 @itemx -mno-zdcbranch
28840 @opindex mzdcbranch
28841 @opindex mno-zdcbranch
28842 Assume (do not assume) that zero displacement conditional branch instructions
28843 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
28844 compiler prefers zero displacement branch code sequences.  This is
28845 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
28846 disabled by specifying @option{-mno-zdcbranch}.
28848 @item -mcbranch-force-delay-slot
28849 @opindex mcbranch-force-delay-slot
28850 Force the usage of delay slots for conditional branches, which stuffs the delay
28851 slot with a @code{nop} if a suitable instruction cannot be found.  By default
28852 this option is disabled.  It can be enabled to work around hardware bugs as
28853 found in the original SH7055.
28855 @item -mfused-madd
28856 @itemx -mno-fused-madd
28857 @opindex mfused-madd
28858 @opindex mno-fused-madd
28859 Generate code that uses (does not use) the floating-point multiply and
28860 accumulate instructions.  These instructions are generated by default
28861 if hardware floating point is used.  The machine-dependent
28862 @option{-mfused-madd} option is now mapped to the machine-independent
28863 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
28864 mapped to @option{-ffp-contract=off}.
28866 @item -mfsca
28867 @itemx -mno-fsca
28868 @opindex mfsca
28869 @opindex mno-fsca
28870 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
28871 and cosine approximations.  The option @option{-mfsca} must be used in
28872 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
28873 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
28874 approximations even if @option{-funsafe-math-optimizations} is in effect.
28876 @item -mfsrra
28877 @itemx -mno-fsrra
28878 @opindex mfsrra
28879 @opindex mno-fsrra
28880 Allow or disallow the compiler to emit the @code{fsrra} instruction for
28881 reciprocal square root approximations.  The option @option{-mfsrra} must be used
28882 in combination with @option{-funsafe-math-optimizations} and
28883 @option{-ffinite-math-only}.  It is enabled by default when generating code for
28884 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
28885 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
28886 in effect.
28888 @item -mpretend-cmove
28889 @opindex mpretend-cmove
28890 Prefer zero-displacement conditional branches for conditional move instruction
28891 patterns.  This can result in faster code on the SH4 processor.
28893 @item -mfdpic
28894 @opindex fdpic
28895 Generate code using the FDPIC ABI.
28897 @end table
28899 @node Solaris 2 Options
28900 @subsection Solaris 2 Options
28901 @cindex Solaris 2 options
28903 These @samp{-m} options are supported on Solaris 2:
28905 @table @gcctabopt
28906 @item -mclear-hwcap
28907 @opindex mclear-hwcap
28908 @option{-mclear-hwcap} tells the compiler to remove the hardware
28909 capabilities generated by the Solaris assembler.  This is only necessary
28910 when object files use ISA extensions not supported by the current
28911 machine, but check at runtime whether or not to use them.
28913 @item -mimpure-text
28914 @opindex mimpure-text
28915 @option{-mimpure-text}, used in addition to @option{-shared}, tells
28916 the compiler to not pass @option{-z text} to the linker when linking a
28917 shared object.  Using this option, you can link position-dependent
28918 code into a shared object.
28920 @option{-mimpure-text} suppresses the ``relocations remain against
28921 allocatable but non-writable sections'' linker error message.
28922 However, the necessary relocations trigger copy-on-write, and the
28923 shared object is not actually shared across processes.  Instead of
28924 using @option{-mimpure-text}, you should compile all source code with
28925 @option{-fpic} or @option{-fPIC}.
28927 @end table
28929 These switches are supported in addition to the above on Solaris 2:
28931 @table @gcctabopt
28932 @item -pthreads
28933 @opindex pthreads
28934 This is a synonym for @option{-pthread}.
28935 @end table
28937 @node SPARC Options
28938 @subsection SPARC Options
28939 @cindex SPARC options
28941 These @samp{-m} options are supported on the SPARC:
28943 @table @gcctabopt
28944 @item -mno-app-regs
28945 @itemx -mapp-regs
28946 @opindex mno-app-regs
28947 @opindex mapp-regs
28948 Specify @option{-mapp-regs} to generate output using the global registers
28949 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
28950 global register 1, each global register 2 through 4 is then treated as an
28951 allocable register that is clobbered by function calls.  This is the default.
28953 To be fully SVR4 ABI-compliant at the cost of some performance loss,
28954 specify @option{-mno-app-regs}.  You should compile libraries and system
28955 software with this option.
28957 @item -mflat
28958 @itemx -mno-flat
28959 @opindex mflat
28960 @opindex mno-flat
28961 With @option{-mflat}, the compiler does not generate save/restore instructions
28962 and uses a ``flat'' or single register window model.  This model is compatible
28963 with the regular register window model.  The local registers and the input
28964 registers (0--5) are still treated as ``call-saved'' registers and are
28965 saved on the stack as needed.
28967 With @option{-mno-flat} (the default), the compiler generates save/restore
28968 instructions (except for leaf functions).  This is the normal operating mode.
28970 @item -mfpu
28971 @itemx -mhard-float
28972 @opindex mfpu
28973 @opindex mhard-float
28974 Generate output containing floating-point instructions.  This is the
28975 default.
28977 @item -mno-fpu
28978 @itemx -msoft-float
28979 @opindex mno-fpu
28980 @opindex msoft-float
28981 Generate output containing library calls for floating point.
28982 @strong{Warning:} the requisite libraries are not available for all SPARC
28983 targets.  Normally the facilities of the machine's usual C compiler are
28984 used, but this cannot be done directly in cross-compilation.  You must make
28985 your own arrangements to provide suitable library functions for
28986 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
28987 @samp{sparclite-*-*} do provide software floating-point support.
28989 @option{-msoft-float} changes the calling convention in the output file;
28990 therefore, it is only useful if you compile @emph{all} of a program with
28991 this option.  In particular, you need to compile @file{libgcc.a}, the
28992 library that comes with GCC, with @option{-msoft-float} in order for
28993 this to work.
28995 @item -mhard-quad-float
28996 @opindex mhard-quad-float
28997 Generate output containing quad-word (long double) floating-point
28998 instructions.
29000 @item -msoft-quad-float
29001 @opindex msoft-quad-float
29002 Generate output containing library calls for quad-word (long double)
29003 floating-point instructions.  The functions called are those specified
29004 in the SPARC ABI@.  This is the default.
29006 As of this writing, there are no SPARC implementations that have hardware
29007 support for the quad-word floating-point instructions.  They all invoke
29008 a trap handler for one of these instructions, and then the trap handler
29009 emulates the effect of the instruction.  Because of the trap handler overhead,
29010 this is much slower than calling the ABI library routines.  Thus the
29011 @option{-msoft-quad-float} option is the default.
29013 @item -mno-unaligned-doubles
29014 @itemx -munaligned-doubles
29015 @opindex mno-unaligned-doubles
29016 @opindex munaligned-doubles
29017 Assume that doubles have 8-byte alignment.  This is the default.
29019 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
29020 alignment only if they are contained in another type, or if they have an
29021 absolute address.  Otherwise, it assumes they have 4-byte alignment.
29022 Specifying this option avoids some rare compatibility problems with code
29023 generated by other compilers.  It is not the default because it results
29024 in a performance loss, especially for floating-point code.
29026 @item -muser-mode
29027 @itemx -mno-user-mode
29028 @opindex muser-mode
29029 @opindex mno-user-mode
29030 Do not generate code that can only run in supervisor mode.  This is relevant
29031 only for the @code{casa} instruction emitted for the LEON3 processor.  This
29032 is the default.
29034 @item -mfaster-structs
29035 @itemx -mno-faster-structs
29036 @opindex mfaster-structs
29037 @opindex mno-faster-structs
29038 With @option{-mfaster-structs}, the compiler assumes that structures
29039 should have 8-byte alignment.  This enables the use of pairs of
29040 @code{ldd} and @code{std} instructions for copies in structure
29041 assignment, in place of twice as many @code{ld} and @code{st} pairs.
29042 However, the use of this changed alignment directly violates the SPARC
29043 ABI@.  Thus, it's intended only for use on targets where the developer
29044 acknowledges that their resulting code is not directly in line with
29045 the rules of the ABI@.
29047 @item -mstd-struct-return
29048 @itemx -mno-std-struct-return
29049 @opindex mstd-struct-return
29050 @opindex mno-std-struct-return
29051 With @option{-mstd-struct-return}, the compiler generates checking code
29052 in functions returning structures or unions to detect size mismatches
29053 between the two sides of function calls, as per the 32-bit ABI@.
29055 The default is @option{-mno-std-struct-return}.  This option has no effect
29056 in 64-bit mode.
29058 @item -mlra
29059 @itemx -mno-lra
29060 @opindex mlra
29061 @opindex mno-lra
29062 Enable Local Register Allocation.  This is the default for SPARC since GCC 7
29063 so @option{-mno-lra} needs to be passed to get old Reload.
29065 @item -mcpu=@var{cpu_type}
29066 @opindex mcpu
29067 Set the instruction set, register set, and instruction scheduling parameters
29068 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
29069 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
29070 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
29071 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
29072 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
29073 @samp{niagara3}, @samp{niagara4}, @samp{niagara7} and @samp{m8}.
29075 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
29076 which selects the best architecture option for the host processor.
29077 @option{-mcpu=native} has no effect if GCC does not recognize
29078 the processor.
29080 Default instruction scheduling parameters are used for values that select
29081 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
29082 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
29084 Here is a list of each supported architecture and their supported
29085 implementations.
29087 @table @asis
29088 @item v7
29089 cypress, leon3v7
29091 @item v8
29092 supersparc, hypersparc, leon, leon3
29094 @item sparclite
29095 f930, f934, sparclite86x
29097 @item sparclet
29098 tsc701
29100 @item v9
29101 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
29102 niagara7, m8
29103 @end table
29105 By default (unless configured otherwise), GCC generates code for the V7
29106 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
29107 additionally optimizes it for the Cypress CY7C602 chip, as used in the
29108 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
29109 SPARCStation 1, 2, IPX etc.
29111 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
29112 architecture.  The only difference from V7 code is that the compiler emits
29113 the integer multiply and integer divide instructions which exist in SPARC-V8
29114 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
29115 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
29116 2000 series.
29118 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
29119 the SPARC architecture.  This adds the integer multiply, integer divide step
29120 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
29121 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
29122 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
29123 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
29124 MB86934 chip, which is the more recent SPARClite with FPU@.
29126 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
29127 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
29128 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
29129 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
29130 optimizes it for the TEMIC SPARClet chip.
29132 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
29133 architecture.  This adds 64-bit integer and floating-point move instructions,
29134 3 additional floating-point condition code registers and conditional move
29135 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
29136 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
29137 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
29138 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
29139 @option{-mcpu=niagara}, the compiler additionally optimizes it for
29140 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
29141 additionally optimizes it for Sun UltraSPARC T2 chips. With
29142 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
29143 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
29144 additionally optimizes it for Sun UltraSPARC T4 chips.  With
29145 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
29146 Oracle SPARC M7 chips.  With @option{-mcpu=m8}, the compiler
29147 additionally optimizes it for Oracle M8 chips.
29149 @item -mtune=@var{cpu_type}
29150 @opindex mtune
29151 Set the instruction scheduling parameters for machine type
29152 @var{cpu_type}, but do not set the instruction set or register set that the
29153 option @option{-mcpu=@var{cpu_type}} does.
29155 The same values for @option{-mcpu=@var{cpu_type}} can be used for
29156 @option{-mtune=@var{cpu_type}}, but the only useful values are those
29157 that select a particular CPU implementation.  Those are
29158 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
29159 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
29160 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
29161 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
29162 @samp{niagara4}, @samp{niagara7} and @samp{m8}.  With native Solaris
29163 and GNU/Linux toolchains, @samp{native} can also be used.
29165 @item -mv8plus
29166 @itemx -mno-v8plus
29167 @opindex mv8plus
29168 @opindex mno-v8plus
29169 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
29170 difference from the V8 ABI is that the global and out registers are
29171 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
29172 mode for all SPARC-V9 processors.
29174 @item -mvis
29175 @itemx -mno-vis
29176 @opindex mvis
29177 @opindex mno-vis
29178 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
29179 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
29181 @item -mvis2
29182 @itemx -mno-vis2
29183 @opindex mvis2
29184 @opindex mno-vis2
29185 With @option{-mvis2}, GCC generates code that takes advantage of
29186 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
29187 default is @option{-mvis2} when targeting a cpu that supports such
29188 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
29189 also sets @option{-mvis}.
29191 @item -mvis3
29192 @itemx -mno-vis3
29193 @opindex mvis3
29194 @opindex mno-vis3
29195 With @option{-mvis3}, GCC generates code that takes advantage of
29196 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
29197 default is @option{-mvis3} when targeting a cpu that supports such
29198 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
29199 also sets @option{-mvis2} and @option{-mvis}.
29201 @item -mvis4
29202 @itemx -mno-vis4
29203 @opindex mvis4
29204 @opindex mno-vis4
29205 With @option{-mvis4}, GCC generates code that takes advantage of
29206 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
29207 default is @option{-mvis4} when targeting a cpu that supports such
29208 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
29209 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
29211 @item -mvis4b
29212 @itemx -mno-vis4b
29213 @opindex mvis4b
29214 @opindex mno-vis4b
29215 With @option{-mvis4b}, GCC generates code that takes advantage of
29216 version 4.0 of the UltraSPARC Visual Instruction Set extensions, plus
29217 the additional VIS instructions introduced in the Oracle SPARC
29218 Architecture 2017.  The default is @option{-mvis4b} when targeting a
29219 cpu that supports such instructions, such as m8 and later.  Setting
29220 @option{-mvis4b} also sets @option{-mvis4}, @option{-mvis3},
29221 @option{-mvis2} and @option{-mvis}.
29223 @item -mcbcond
29224 @itemx -mno-cbcond
29225 @opindex mcbcond
29226 @opindex mno-cbcond
29227 With @option{-mcbcond}, GCC generates code that takes advantage of the UltraSPARC
29228 Compare-and-Branch-on-Condition instructions.  The default is @option{-mcbcond}
29229 when targeting a CPU that supports such instructions, such as Niagara-4 and
29230 later.
29232 @item -mfmaf
29233 @itemx -mno-fmaf
29234 @opindex mfmaf
29235 @opindex mno-fmaf
29236 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
29237 Fused Multiply-Add Floating-point instructions.  The default is @option{-mfmaf}
29238 when targeting a CPU that supports such instructions, such as Niagara-3 and
29239 later.
29241 @item -mfsmuld
29242 @itemx -mno-fsmuld
29243 @opindex mfsmuld
29244 @opindex mno-fsmuld
29245 With @option{-mfsmuld}, GCC generates code that takes advantage of the
29246 Floating-point Multiply Single to Double (FsMULd) instruction.  The default is
29247 @option{-mfsmuld} when targeting a CPU supporting the architecture versions V8
29248 or V9 with FPU except @option{-mcpu=leon}.
29250 @item -mpopc
29251 @itemx -mno-popc
29252 @opindex mpopc
29253 @opindex mno-popc
29254 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
29255 Population Count instruction.  The default is @option{-mpopc}
29256 when targeting a CPU that supports such an instruction, such as Niagara-2 and
29257 later.
29259 @item -msubxc
29260 @itemx -mno-subxc
29261 @opindex msubxc
29262 @opindex mno-subxc
29263 With @option{-msubxc}, GCC generates code that takes advantage of the UltraSPARC
29264 Subtract-Extended-with-Carry instruction.  The default is @option{-msubxc}
29265 when targeting a CPU that supports such an instruction, such as Niagara-7 and
29266 later.
29268 @item -mfix-at697f
29269 @opindex mfix-at697f
29270 Enable the documented workaround for the single erratum of the Atmel AT697F
29271 processor (which corresponds to erratum #13 of the AT697E processor).
29273 @item -mfix-ut699
29274 @opindex mfix-ut699
29275 Enable the documented workarounds for the floating-point errata and the data
29276 cache nullify errata of the UT699 processor.
29278 @item -mfix-ut700
29279 @opindex mfix-ut700
29280 Enable the documented workaround for the back-to-back store errata of
29281 the UT699E/UT700 processor.
29283 @item -mfix-gr712rc
29284 @opindex mfix-gr712rc
29285 Enable the documented workaround for the back-to-back store errata of
29286 the GR712RC processor.
29287 @end table
29289 These @samp{-m} options are supported in addition to the above
29290 on SPARC-V9 processors in 64-bit environments:
29292 @table @gcctabopt
29293 @item -m32
29294 @itemx -m64
29295 @opindex m32
29296 @opindex m64
29297 Generate code for a 32-bit or 64-bit environment.
29298 The 32-bit environment sets int, long and pointer to 32 bits.
29299 The 64-bit environment sets int to 32 bits and long and pointer
29300 to 64 bits.
29302 @item -mcmodel=@var{which}
29303 @opindex mcmodel
29304 Set the code model to one of
29306 @table @samp
29307 @item medlow
29308 The Medium/Low code model: 64-bit addresses, programs
29309 must be linked in the low 32 bits of memory.  Programs can be statically
29310 or dynamically linked.
29312 @item medmid
29313 The Medium/Middle code model: 64-bit addresses, programs
29314 must be linked in the low 44 bits of memory, the text and data segments must
29315 be less than 2GB in size and the data segment must be located within 2GB of
29316 the text segment.
29318 @item medany
29319 The Medium/Anywhere code model: 64-bit addresses, programs
29320 may be linked anywhere in memory, the text and data segments must be less
29321 than 2GB in size and the data segment must be located within 2GB of the
29322 text segment.
29324 @item embmedany
29325 The Medium/Anywhere code model for embedded systems:
29326 64-bit addresses, the text and data segments must be less than 2GB in
29327 size, both starting anywhere in memory (determined at link time).  The
29328 global register %g4 points to the base of the data segment.  Programs
29329 are statically linked and PIC is not supported.
29330 @end table
29332 @item -mmemory-model=@var{mem-model}
29333 @opindex mmemory-model
29334 Set the memory model in force on the processor to one of
29336 @table @samp
29337 @item default
29338 The default memory model for the processor and operating system.
29340 @item rmo
29341 Relaxed Memory Order
29343 @item pso
29344 Partial Store Order
29346 @item tso
29347 Total Store Order
29349 @item sc
29350 Sequential Consistency
29351 @end table
29353 These memory models are formally defined in Appendix D of the SPARC-V9
29354 architecture manual, as set in the processor's @code{PSTATE.MM} field.
29356 @item -mstack-bias
29357 @itemx -mno-stack-bias
29358 @opindex mstack-bias
29359 @opindex mno-stack-bias
29360 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
29361 frame pointer if present, are offset by @minus{}2047 which must be added back
29362 when making stack frame references.  This is the default in 64-bit mode.
29363 Otherwise, assume no such offset is present.
29364 @end table
29366 @node System V Options
29367 @subsection Options for System V
29369 These additional options are available on System V Release 4 for
29370 compatibility with other compilers on those systems:
29372 @table @gcctabopt
29373 @item -G
29374 @opindex G
29375 Create a shared object.
29376 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
29378 @item -Qy
29379 @opindex Qy
29380 Identify the versions of each tool used by the compiler, in a
29381 @code{.ident} assembler directive in the output.
29383 @item -Qn
29384 @opindex Qn
29385 Refrain from adding @code{.ident} directives to the output file (this is
29386 the default).
29388 @item -YP,@var{dirs}
29389 @opindex YP
29390 Search the directories @var{dirs}, and no others, for libraries
29391 specified with @option{-l}.
29393 @item -Ym,@var{dir}
29394 @opindex Ym
29395 Look in the directory @var{dir} to find the M4 preprocessor.
29396 The assembler uses this option.
29397 @c This is supposed to go with a -Yd for predefined M4 macro files, but
29398 @c the generic assembler that comes with Solaris takes just -Ym.
29399 @end table
29401 @node TILE-Gx Options
29402 @subsection TILE-Gx Options
29403 @cindex TILE-Gx options
29405 These @samp{-m} options are supported on the TILE-Gx:
29407 @table @gcctabopt
29408 @item -mcmodel=small
29409 @opindex mcmodel=small
29410 Generate code for the small model.  The distance for direct calls is
29411 limited to 500M in either direction.  PC-relative addresses are 32
29412 bits.  Absolute addresses support the full address range.
29414 @item -mcmodel=large
29415 @opindex mcmodel=large
29416 Generate code for the large model.  There is no limitation on call
29417 distance, pc-relative addresses, or absolute addresses.
29419 @item -mcpu=@var{name}
29420 @opindex mcpu
29421 Selects the type of CPU to be targeted.  Currently the only supported
29422 type is @samp{tilegx}.
29424 @item -m32
29425 @itemx -m64
29426 @opindex m32
29427 @opindex m64
29428 Generate code for a 32-bit or 64-bit environment.  The 32-bit
29429 environment sets int, long, and pointer to 32 bits.  The 64-bit
29430 environment sets int to 32 bits and long and pointer to 64 bits.
29432 @item -mbig-endian
29433 @itemx -mlittle-endian
29434 @opindex mbig-endian
29435 @opindex mlittle-endian
29436 Generate code in big/little endian mode, respectively.
29437 @end table
29439 @node TILEPro Options
29440 @subsection TILEPro Options
29441 @cindex TILEPro options
29443 These @samp{-m} options are supported on the TILEPro:
29445 @table @gcctabopt
29446 @item -mcpu=@var{name}
29447 @opindex mcpu
29448 Selects the type of CPU to be targeted.  Currently the only supported
29449 type is @samp{tilepro}.
29451 @item -m32
29452 @opindex m32
29453 Generate code for a 32-bit environment, which sets int, long, and
29454 pointer to 32 bits.  This is the only supported behavior so the flag
29455 is essentially ignored.
29456 @end table
29458 @node V850 Options
29459 @subsection V850 Options
29460 @cindex V850 Options
29462 These @samp{-m} options are defined for V850 implementations:
29464 @table @gcctabopt
29465 @item -mlong-calls
29466 @itemx -mno-long-calls
29467 @opindex mlong-calls
29468 @opindex mno-long-calls
29469 Treat all calls as being far away (near).  If calls are assumed to be
29470 far away, the compiler always loads the function's address into a
29471 register, and calls indirect through the pointer.
29473 @item -mno-ep
29474 @itemx -mep
29475 @opindex mno-ep
29476 @opindex mep
29477 Do not optimize (do optimize) basic blocks that use the same index
29478 pointer 4 or more times to copy pointer into the @code{ep} register, and
29479 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
29480 option is on by default if you optimize.
29482 @item -mno-prolog-function
29483 @itemx -mprolog-function
29484 @opindex mno-prolog-function
29485 @opindex mprolog-function
29486 Do not use (do use) external functions to save and restore registers
29487 at the prologue and epilogue of a function.  The external functions
29488 are slower, but use less code space if more than one function saves
29489 the same number of registers.  The @option{-mprolog-function} option
29490 is on by default if you optimize.
29492 @item -mspace
29493 @opindex mspace
29494 Try to make the code as small as possible.  At present, this just turns
29495 on the @option{-mep} and @option{-mprolog-function} options.
29497 @item -mtda=@var{n}
29498 @opindex mtda
29499 Put static or global variables whose size is @var{n} bytes or less into
29500 the tiny data area that register @code{ep} points to.  The tiny data
29501 area can hold up to 256 bytes in total (128 bytes for byte references).
29503 @item -msda=@var{n}
29504 @opindex msda
29505 Put static or global variables whose size is @var{n} bytes or less into
29506 the small data area that register @code{gp} points to.  The small data
29507 area can hold up to 64 kilobytes.
29509 @item -mzda=@var{n}
29510 @opindex mzda
29511 Put static or global variables whose size is @var{n} bytes or less into
29512 the first 32 kilobytes of memory.
29514 @item -mv850
29515 @opindex mv850
29516 Specify that the target processor is the V850.
29518 @item -mv850e3v5
29519 @opindex mv850e3v5
29520 Specify that the target processor is the V850E3V5.  The preprocessor
29521 constant @code{__v850e3v5__} is defined if this option is used.
29523 @item -mv850e2v4
29524 @opindex mv850e2v4
29525 Specify that the target processor is the V850E3V5.  This is an alias for
29526 the @option{-mv850e3v5} option.
29528 @item -mv850e2v3
29529 @opindex mv850e2v3
29530 Specify that the target processor is the V850E2V3.  The preprocessor
29531 constant @code{__v850e2v3__} is defined if this option is used.
29533 @item -mv850e2
29534 @opindex mv850e2
29535 Specify that the target processor is the V850E2.  The preprocessor
29536 constant @code{__v850e2__} is defined if this option is used.
29538 @item -mv850e1
29539 @opindex mv850e1
29540 Specify that the target processor is the V850E1.  The preprocessor
29541 constants @code{__v850e1__} and @code{__v850e__} are defined if
29542 this option is used.
29544 @item -mv850es
29545 @opindex mv850es
29546 Specify that the target processor is the V850ES.  This is an alias for
29547 the @option{-mv850e1} option.
29549 @item -mv850e
29550 @opindex mv850e
29551 Specify that the target processor is the V850E@.  The preprocessor
29552 constant @code{__v850e__} is defined if this option is used.
29554 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
29555 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
29556 are defined then a default target processor is chosen and the
29557 relevant @samp{__v850*__} preprocessor constant is defined.
29559 The preprocessor constants @code{__v850} and @code{__v851__} are always
29560 defined, regardless of which processor variant is the target.
29562 @item -mdisable-callt
29563 @itemx -mno-disable-callt
29564 @opindex mdisable-callt
29565 @opindex mno-disable-callt
29566 This option suppresses generation of the @code{CALLT} instruction for the
29567 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
29568 architecture.
29570 This option is enabled by default when the RH850 ABI is
29571 in use (see @option{-mrh850-abi}), and disabled by default when the
29572 GCC ABI is in use.  If @code{CALLT} instructions are being generated
29573 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
29575 @item -mrelax
29576 @itemx -mno-relax
29577 @opindex mrelax
29578 @opindex mno-relax
29579 Pass on (or do not pass on) the @option{-mrelax} command-line option
29580 to the assembler.
29582 @item -mlong-jumps
29583 @itemx -mno-long-jumps
29584 @opindex mlong-jumps
29585 @opindex mno-long-jumps
29586 Disable (or re-enable) the generation of PC-relative jump instructions.
29588 @item -msoft-float
29589 @itemx -mhard-float
29590 @opindex msoft-float
29591 @opindex mhard-float
29592 Disable (or re-enable) the generation of hardware floating point
29593 instructions.  This option is only significant when the target
29594 architecture is @samp{V850E2V3} or higher.  If hardware floating point
29595 instructions are being generated then the C preprocessor symbol
29596 @code{__FPU_OK__} is defined, otherwise the symbol
29597 @code{__NO_FPU__} is defined.
29599 @item -mloop
29600 @opindex mloop
29601 Enables the use of the e3v5 LOOP instruction.  The use of this
29602 instruction is not enabled by default when the e3v5 architecture is
29603 selected because its use is still experimental.
29605 @item -mrh850-abi
29606 @itemx -mghs
29607 @opindex mrh850-abi
29608 @opindex mghs
29609 Enables support for the RH850 version of the V850 ABI.  This is the
29610 default.  With this version of the ABI the following rules apply:
29612 @itemize
29613 @item
29614 Integer sized structures and unions are returned via a memory pointer
29615 rather than a register.
29617 @item
29618 Large structures and unions (more than 8 bytes in size) are passed by
29619 value.
29621 @item
29622 Functions are aligned to 16-bit boundaries.
29624 @item
29625 The @option{-m8byte-align} command-line option is supported.
29627 @item
29628 The @option{-mdisable-callt} command-line option is enabled by
29629 default.  The @option{-mno-disable-callt} command-line option is not
29630 supported.
29631 @end itemize
29633 When this version of the ABI is enabled the C preprocessor symbol
29634 @code{__V850_RH850_ABI__} is defined.
29636 @item -mgcc-abi
29637 @opindex mgcc-abi
29638 Enables support for the old GCC version of the V850 ABI.  With this
29639 version of the ABI the following rules apply:
29641 @itemize
29642 @item
29643 Integer sized structures and unions are returned in register @code{r10}.
29645 @item
29646 Large structures and unions (more than 8 bytes in size) are passed by
29647 reference.
29649 @item
29650 Functions are aligned to 32-bit boundaries, unless optimizing for
29651 size.
29653 @item
29654 The @option{-m8byte-align} command-line option is not supported.
29656 @item
29657 The @option{-mdisable-callt} command-line option is supported but not
29658 enabled by default.
29659 @end itemize
29661 When this version of the ABI is enabled the C preprocessor symbol
29662 @code{__V850_GCC_ABI__} is defined.
29664 @item -m8byte-align
29665 @itemx -mno-8byte-align
29666 @opindex m8byte-align
29667 @opindex mno-8byte-align
29668 Enables support for @code{double} and @code{long long} types to be
29669 aligned on 8-byte boundaries.  The default is to restrict the
29670 alignment of all objects to at most 4-bytes.  When
29671 @option{-m8byte-align} is in effect the C preprocessor symbol
29672 @code{__V850_8BYTE_ALIGN__} is defined.
29674 @item -mbig-switch
29675 @opindex mbig-switch
29676 Generate code suitable for big switch tables.  Use this option only if
29677 the assembler/linker complain about out of range branches within a switch
29678 table.
29680 @item -mapp-regs
29681 @opindex mapp-regs
29682 This option causes r2 and r5 to be used in the code generated by
29683 the compiler.  This setting is the default.
29685 @item -mno-app-regs
29686 @opindex mno-app-regs
29687 This option causes r2 and r5 to be treated as fixed registers.
29689 @end table
29691 @node VAX Options
29692 @subsection VAX Options
29693 @cindex VAX options
29695 These @samp{-m} options are defined for the VAX:
29697 @table @gcctabopt
29698 @item -munix
29699 @opindex munix
29700 Do not output certain jump instructions (@code{aobleq} and so on)
29701 that the Unix assembler for the VAX cannot handle across long
29702 ranges.
29704 @item -mgnu
29705 @opindex mgnu
29706 Do output those jump instructions, on the assumption that the
29707 GNU assembler is being used.
29709 @item -mg
29710 @opindex mg
29711 Output code for G-format floating-point numbers instead of D-format.
29712 @end table
29714 @node Visium Options
29715 @subsection Visium Options
29716 @cindex Visium options
29718 @table @gcctabopt
29720 @item -mdebug
29721 @opindex mdebug
29722 A program which performs file I/O and is destined to run on an MCM target
29723 should be linked with this option.  It causes the libraries libc.a and
29724 libdebug.a to be linked.  The program should be run on the target under
29725 the control of the GDB remote debugging stub.
29727 @item -msim
29728 @opindex msim
29729 A program which performs file I/O and is destined to run on the simulator
29730 should be linked with option.  This causes libraries libc.a and libsim.a to
29731 be linked.
29733 @item -mfpu
29734 @itemx -mhard-float
29735 @opindex mfpu
29736 @opindex mhard-float
29737 Generate code containing floating-point instructions.  This is the
29738 default.
29740 @item -mno-fpu
29741 @itemx -msoft-float
29742 @opindex mno-fpu
29743 @opindex msoft-float
29744 Generate code containing library calls for floating-point.
29746 @option{-msoft-float} changes the calling convention in the output file;
29747 therefore, it is only useful if you compile @emph{all} of a program with
29748 this option.  In particular, you need to compile @file{libgcc.a}, the
29749 library that comes with GCC, with @option{-msoft-float} in order for
29750 this to work.
29752 @item -mcpu=@var{cpu_type}
29753 @opindex mcpu
29754 Set the instruction set, register set, and instruction scheduling parameters
29755 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
29756 @samp{mcm}, @samp{gr5} and @samp{gr6}.
29758 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
29760 By default (unless configured otherwise), GCC generates code for the GR5
29761 variant of the Visium architecture.  
29763 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
29764 architecture.  The only difference from GR5 code is that the compiler will
29765 generate block move instructions.
29767 @item -mtune=@var{cpu_type}
29768 @opindex mtune
29769 Set the instruction scheduling parameters for machine type @var{cpu_type},
29770 but do not set the instruction set or register set that the option
29771 @option{-mcpu=@var{cpu_type}} would.
29773 @item -msv-mode
29774 @opindex msv-mode
29775 Generate code for the supervisor mode, where there are no restrictions on
29776 the access to general registers.  This is the default.
29778 @item -muser-mode
29779 @opindex muser-mode
29780 Generate code for the user mode, where the access to some general registers
29781 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
29782 mode; on the GR6, only registers r29 to r31 are affected.
29783 @end table
29785 @node VMS Options
29786 @subsection VMS Options
29788 These @samp{-m} options are defined for the VMS implementations:
29790 @table @gcctabopt
29791 @item -mvms-return-codes
29792 @opindex mvms-return-codes
29793 Return VMS condition codes from @code{main}. The default is to return POSIX-style
29794 condition (e.g.@: error) codes.
29796 @item -mdebug-main=@var{prefix}
29797 @opindex mdebug-main=@var{prefix}
29798 Flag the first routine whose name starts with @var{prefix} as the main
29799 routine for the debugger.
29801 @item -mmalloc64
29802 @opindex mmalloc64
29803 Default to 64-bit memory allocation routines.
29805 @item -mpointer-size=@var{size}
29806 @opindex mpointer-size=@var{size}
29807 Set the default size of pointers. Possible options for @var{size} are
29808 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
29809 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
29810 The later option disables @code{pragma pointer_size}.
29811 @end table
29813 @node VxWorks Options
29814 @subsection VxWorks Options
29815 @cindex VxWorks Options
29817 The options in this section are defined for all VxWorks targets.
29818 Options specific to the target hardware are listed with the other
29819 options for that target.
29821 @table @gcctabopt
29822 @item -mrtp
29823 @opindex mrtp
29824 GCC can generate code for both VxWorks kernels and real time processes
29825 (RTPs).  This option switches from the former to the latter.  It also
29826 defines the preprocessor macro @code{__RTP__}.
29828 @item -non-static
29829 @opindex non-static
29830 Link an RTP executable against shared libraries rather than static
29831 libraries.  The options @option{-static} and @option{-shared} can
29832 also be used for RTPs (@pxref{Link Options}); @option{-static}
29833 is the default.
29835 @item -Bstatic
29836 @itemx -Bdynamic
29837 @opindex Bstatic
29838 @opindex Bdynamic
29839 These options are passed down to the linker.  They are defined for
29840 compatibility with Diab.
29842 @item -Xbind-lazy
29843 @opindex Xbind-lazy
29844 Enable lazy binding of function calls.  This option is equivalent to
29845 @option{-Wl,-z,now} and is defined for compatibility with Diab.
29847 @item -Xbind-now
29848 @opindex Xbind-now
29849 Disable lazy binding of function calls.  This option is the default and
29850 is defined for compatibility with Diab.
29851 @end table
29853 @node x86 Options
29854 @subsection x86 Options
29855 @cindex x86 Options
29857 These @samp{-m} options are defined for the x86 family of computers.
29859 @table @gcctabopt
29861 @item -march=@var{cpu-type}
29862 @opindex march
29863 Generate instructions for the machine type @var{cpu-type}.  In contrast to
29864 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
29865 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
29866 to generate code that may not run at all on processors other than the one
29867 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
29868 @option{-mtune=@var{cpu-type}}, except where noted otherwise.
29870 The choices for @var{cpu-type} are:
29872 @table @samp
29873 @item native
29874 This selects the CPU to generate code for at compilation time by determining
29875 the processor type of the compiling machine.  Using @option{-march=native}
29876 enables all instruction subsets supported by the local machine (hence
29877 the result might not run on different machines).  Using @option{-mtune=native}
29878 produces code optimized for the local machine under the constraints
29879 of the selected instruction set.  
29881 @item x86-64
29882 A generic CPU with 64-bit extensions.
29884 @item x86-64-v2
29885 @itemx x86-64-v3
29886 @itemx x86-64-v4
29887 These choices for @var{cpu-type} select the corresponding
29888 micro-architecture level from the x86-64 psABI.  On ABIs other than
29889 the x86-64 psABI they select the same CPU features as the x86-64 psABI
29890 documents for the particular micro-architecture level.
29892 Since these @var{cpu-type} values do not have a corresponding
29893 @option{-mtune} setting, using @option{-march} with these values enables
29894 generic tuning.  Specific tuning can be enabled using the
29895 @option{-mtune=@var{other-cpu-type}} option with an appropriate
29896 @var{other-cpu-type} value.
29898 @item i386
29899 Original Intel i386 CPU@.
29901 @item i486
29902 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
29904 @item i586
29905 @itemx pentium
29906 Intel Pentium CPU with no MMX support.
29908 @item lakemont
29909 Intel Lakemont MCU, based on Intel Pentium CPU.
29911 @item pentium-mmx
29912 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
29914 @item pentiumpro
29915 Intel Pentium Pro CPU@.
29917 @item i686
29918 When used with @option{-march}, the Pentium Pro
29919 instruction set is used, so the code runs on all i686 family chips.
29920 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
29922 @item pentium2
29923 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
29924 support.
29926 @item pentium3
29927 @itemx pentium3m
29928 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
29929 set support.
29931 @item pentium-m
29932 Intel Pentium M; low-power version of Intel Pentium III CPU
29933 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
29935 @item pentium4
29936 @itemx pentium4m
29937 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
29939 @item prescott
29940 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
29941 set support.
29943 @item nocona
29944 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
29945 SSE2 and SSE3 instruction set support.
29947 @item core2
29948 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
29949 instruction set support.
29951 @item nehalem
29952 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
29953 SSE4.1, SSE4.2 and POPCNT instruction set support.
29955 @item westmere
29956 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
29957 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
29959 @item sandybridge
29960 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
29961 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
29963 @item ivybridge
29964 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
29965 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
29966 instruction set support.
29968 @item haswell
29969 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
29970 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
29971 BMI, BMI2 and F16C instruction set support.
29973 @item broadwell
29974 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
29975 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2,
29976 F16C, RDSEED ADCX and PREFETCHW instruction set support.
29978 @item skylake
29979 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
29980 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
29981 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and XSAVES
29982 instruction set support.
29984 @item bonnell
29985 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
29986 instruction set support.
29988 @item silvermont
29989 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
29990 SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL and RDRND instruction set support.
29992 @item goldmont
29993 Intel Goldmont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
29994 SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC, XSAVES,
29995 XSAVEOPT and FSGSBASE instruction set support.
29997 @item goldmont-plus
29998 Intel Goldmont Plus CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
29999 SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC,
30000 XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX and UMIP instruction set support.
30002 @item tremont
30003 Intel Tremont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
30004 SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC, XSAVES,
30005 XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, UMIP, GFNI-SSE, CLWB, MOVDIRI,
30006 MOVDIR64B, CLDEMOTE and WAITPKG instruction set support.
30008 @item knl
30009 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
30010 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
30011 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, PREFETCHWT1, AVX512F, AVX512PF,
30012 AVX512ER and AVX512CD instruction set support.
30014 @item knm
30015 Intel Knights Mill CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
30016 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
30017 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, PREFETCHWT1, AVX512F, AVX512PF,
30018 AVX512ER, AVX512CD, AVX5124VNNIW, AVX5124FMAPS and AVX512VPOPCNTDQ instruction
30019 set support.
30021 @item skylake-avx512
30022 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
30023 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
30024 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
30025 CLWB, AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
30027 @item cannonlake
30028 Intel Cannonlake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
30029 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
30030 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
30031 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
30032 AVX512IFMA, SHA and UMIP instruction set support.
30034 @item icelake-client
30035 Intel Icelake Client CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
30036 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
30037 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
30038 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
30039 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
30040 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES instruction set support.
30042 @item icelake-server
30043 Intel Icelake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
30044 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
30045 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
30046 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
30047 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
30048 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES, PCONFIG and WBNOINVD instruction
30049 set support.
30051 @item cascadelake
30052 Intel Cascadelake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
30053 SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI,
30054 BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, CLWB,
30055 AVX512VL, AVX512BW, AVX512DQ, AVX512CD and AVX512VNNI instruction set support.
30057 @item cooperlake
30058 Intel cooperlake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
30059 SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI,
30060 BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, CLWB,
30061 AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VNNI and AVX512BF16 instruction
30062 set support.
30064 @item tigerlake
30065 Intel Tigerlake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
30066 SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI,
30067 BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
30068 AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, AVX512IFMA, SHA, CLWB, UMIP,
30069 RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ, AVX512BITALG, AVX512VNNI, VPCLMULQDQ,
30070 VAES, PCONFIG, WBNOINVD, MOVDIRI, MOVDIR64B, AVX512VP2INTERSECT and KEYLOCKER
30071 instruction set support.
30073 @item sapphirerapids
30074 Intel sapphirerapids CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
30075 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND,
30076 FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES,
30077 AVX512F, CLWB, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VNNI, AVX512BF16,
30078 MOVDIRI, MOVDIR64B, AVX512VP2INTERSECT, ENQCMD, CLDEMOTE, PTWRITE, WAITPKG,
30079 SERIALIZE, TSXLDTRK, UINTR, AMX-BF16, AMX-TILE, AMX-INT8 and AVX-VNNI
30080 instruction set support.
30082 @item alderlake
30083 Intel Alderlake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
30084 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI,
30085 BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, CLDEMOTE,
30086 PTWRITE, WAITPKG, SERIALIZE, KEYLOCKER, HRESET and AVX-VNNI instruction set
30087 support.
30089 @item k6
30090 AMD K6 CPU with MMX instruction set support.
30092 @item k6-2
30093 @itemx k6-3
30094 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
30096 @item athlon
30097 @itemx athlon-tbird
30098 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
30099 support.
30101 @item athlon-4
30102 @itemx athlon-xp
30103 @itemx athlon-mp
30104 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
30105 instruction set support.
30107 @item k8
30108 @itemx opteron
30109 @itemx athlon64
30110 @itemx athlon-fx
30111 Processors based on the AMD K8 core with x86-64 instruction set support,
30112 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
30113 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
30114 instruction set extensions.)
30116 @item k8-sse3
30117 @itemx opteron-sse3
30118 @itemx athlon64-sse3
30119 Improved versions of AMD K8 cores with SSE3 instruction set support.
30121 @item amdfam10
30122 @itemx barcelona
30123 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
30124 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
30125 instruction set extensions.)
30127 @item bdver1
30128 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
30129 supersets FMA4, AVX, XOP, LWP, AES, PCLMUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
30130 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
30132 @item bdver2
30133 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
30134 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCLMUL, CX16, MMX,
30135 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
30136 extensions.)
30138 @item bdver3
30139 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
30140 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
30141 PCLMUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and
30142 64-bit instruction set extensions.)
30144 @item bdver4
30145 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
30146 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
30147 AES, PCLMUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1,
30148 SSE4.2, ABM and 64-bit instruction set extensions.)
30150 @item znver1
30151 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
30152 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
30153 SHA, CLZERO, AES, PCLMUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
30154 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
30155 instruction set extensions.)
30157 @item znver2
30158 AMD Family 17h core based CPUs with x86-64 instruction set support. (This
30159 supersets BMI, BMI2, CLWB, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED,
30160 MWAITX, SHA, CLZERO, AES, PCLMUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A,
30161 SSSE3, SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, RDPID,
30162 WBNOINVD, and 64-bit instruction set extensions.)
30164 @item znver3
30165 AMD Family 19h core based CPUs with x86-64 instruction set support. (This
30166 supersets BMI, BMI2, CLWB, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED,
30167 MWAITX, SHA, CLZERO, AES, PCLMUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A,
30168 SSSE3, SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, RDPID,
30169 WBNOINVD, PKU, VPCLMULQDQ, VAES, and 64-bit instruction set extensions.)
30171 @item btver1
30172 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
30173 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
30174 instruction set extensions.)
30176 @item btver2
30177 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
30178 includes MOVBE, F16C, BMI, AVX, PCLMUL, AES, SSE4.2, SSE4.1, CX16, ABM,
30179 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
30181 @item winchip-c6
30182 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
30183 set support.
30185 @item winchip2
30186 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
30187 instruction set support.
30189 @item c3
30190 VIA C3 CPU with MMX and 3DNow!@: instruction set support.
30191 (No scheduling is implemented for this chip.)
30193 @item c3-2
30194 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
30195 (No scheduling is implemented for this chip.)
30197 @item c7
30198 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
30199 (No scheduling is implemented for this chip.)
30201 @item samuel-2
30202 VIA Eden Samuel 2 CPU with MMX and 3DNow!@: instruction set support.
30203 (No scheduling is implemented for this chip.)
30205 @item nehemiah
30206 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
30207 (No scheduling is implemented for this chip.)
30209 @item esther
30210 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
30211 (No scheduling is implemented for this chip.)
30213 @item eden-x2
30214 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3 instruction set support.
30215 (No scheduling is implemented for this chip.)
30217 @item eden-x4
30218 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
30219 AVX and AVX2 instruction set support.
30220 (No scheduling is implemented for this chip.)
30222 @item nano
30223 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
30224 instruction set support.
30225 (No scheduling is implemented for this chip.)
30227 @item nano-1000
30228 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
30229 instruction set support.
30230 (No scheduling is implemented for this chip.)
30232 @item nano-2000
30233 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
30234 instruction set support.
30235 (No scheduling is implemented for this chip.)
30237 @item nano-3000
30238 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
30239 instruction set support.
30240 (No scheduling is implemented for this chip.)
30242 @item nano-x2
30243 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
30244 instruction set support.
30245 (No scheduling is implemented for this chip.)
30247 @item nano-x4
30248 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
30249 instruction set support.
30250 (No scheduling is implemented for this chip.)
30252 @item geode
30253 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
30254 @end table
30256 @item -mtune=@var{cpu-type}
30257 @opindex mtune
30258 Tune to @var{cpu-type} everything applicable about the generated code, except
30259 for the ABI and the set of available instructions.  
30260 While picking a specific @var{cpu-type} schedules things appropriately
30261 for that particular chip, the compiler does not generate any code that
30262 cannot run on the default machine type unless you use a
30263 @option{-march=@var{cpu-type}} option.
30264 For example, if GCC is configured for i686-pc-linux-gnu
30265 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
30266 but still runs on i686 machines.
30268 The choices for @var{cpu-type} are the same as for @option{-march}.
30269 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
30271 @table @samp
30272 @item generic
30273 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
30274 If you know the CPU on which your code will run, then you should use
30275 the corresponding @option{-mtune} or @option{-march} option instead of
30276 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
30277 of your application will have, then you should use this option.
30279 As new processors are deployed in the marketplace, the behavior of this
30280 option will change.  Therefore, if you upgrade to a newer version of
30281 GCC, code generation controlled by this option will change to reflect
30282 the processors
30283 that are most common at the time that version of GCC is released.
30285 There is no @option{-march=generic} option because @option{-march}
30286 indicates the instruction set the compiler can use, and there is no
30287 generic instruction set applicable to all processors.  In contrast,
30288 @option{-mtune} indicates the processor (or, in this case, collection of
30289 processors) for which the code is optimized.
30291 @item intel
30292 Produce code optimized for the most current Intel processors, which are
30293 Haswell and Silvermont for this version of GCC.  If you know the CPU
30294 on which your code will run, then you should use the corresponding
30295 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
30296 But, if you want your application performs better on both Haswell and
30297 Silvermont, then you should use this option.
30299 As new Intel processors are deployed in the marketplace, the behavior of
30300 this option will change.  Therefore, if you upgrade to a newer version of
30301 GCC, code generation controlled by this option will change to reflect
30302 the most current Intel processors at the time that version of GCC is
30303 released.
30305 There is no @option{-march=intel} option because @option{-march} indicates
30306 the instruction set the compiler can use, and there is no common
30307 instruction set applicable to all processors.  In contrast,
30308 @option{-mtune} indicates the processor (or, in this case, collection of
30309 processors) for which the code is optimized.
30310 @end table
30312 @item -mcpu=@var{cpu-type}
30313 @opindex mcpu
30314 A deprecated synonym for @option{-mtune}.
30316 @item -mfpmath=@var{unit}
30317 @opindex mfpmath
30318 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
30319 for @var{unit} are:
30321 @table @samp
30322 @item 387
30323 Use the standard 387 floating-point coprocessor present on the majority of chips and
30324 emulated otherwise.  Code compiled with this option runs almost everywhere.
30325 The temporary results are computed in 80-bit precision instead of the precision
30326 specified by the type, resulting in slightly different results compared to most
30327 of other chips.  See @option{-ffloat-store} for more detailed description.
30329 This is the default choice for non-Darwin x86-32 targets.
30331 @item sse
30332 Use scalar floating-point instructions present in the SSE instruction set.
30333 This instruction set is supported by Pentium III and newer chips,
30334 and in the AMD line
30335 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
30336 instruction set supports only single-precision arithmetic, thus the double and
30337 extended-precision arithmetic are still done using 387.  A later version, present
30338 only in Pentium 4 and AMD x86-64 chips, supports double-precision
30339 arithmetic too.
30341 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
30342 or @option{-msse2} switches to enable SSE extensions and make this option
30343 effective.  For the x86-64 compiler, these extensions are enabled by default.
30345 The resulting code should be considerably faster in the majority of cases and avoid
30346 the numerical instability problems of 387 code, but may break some existing
30347 code that expects temporaries to be 80 bits.
30349 This is the default choice for the x86-64 compiler, Darwin x86-32 targets,
30350 and the default choice for x86-32 targets with the SSE2 instruction set
30351 when @option{-ffast-math} is enabled.
30353 @item sse,387
30354 @itemx sse+387
30355 @itemx both
30356 Attempt to utilize both instruction sets at once.  This effectively doubles the
30357 amount of available registers, and on chips with separate execution units for
30358 387 and SSE the execution resources too.  Use this option with care, as it is
30359 still experimental, because the GCC register allocator does not model separate
30360 functional units well, resulting in unstable performance.
30361 @end table
30363 @item -masm=@var{dialect}
30364 @opindex masm=@var{dialect}
30365 Output assembly instructions using selected @var{dialect}.  Also affects
30366 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
30367 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
30368 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
30369 not support @samp{intel}.
30371 @item -mieee-fp
30372 @itemx -mno-ieee-fp
30373 @opindex mieee-fp
30374 @opindex mno-ieee-fp
30375 Control whether or not the compiler uses IEEE floating-point
30376 comparisons.  These correctly handle the case where the result of a
30377 comparison is unordered.
30379 @item -m80387
30380 @itemx -mhard-float
30381 @opindex 80387
30382 @opindex mhard-float
30383 Generate output containing 80387 instructions for floating point.
30385 @item -mno-80387
30386 @itemx -msoft-float
30387 @opindex no-80387
30388 @opindex msoft-float
30389 Generate output containing library calls for floating point.
30391 @strong{Warning:} the requisite libraries are not part of GCC@.
30392 Normally the facilities of the machine's usual C compiler are used, but
30393 this cannot be done directly in cross-compilation.  You must make your
30394 own arrangements to provide suitable library functions for
30395 cross-compilation.
30397 On machines where a function returns floating-point results in the 80387
30398 register stack, some floating-point opcodes may be emitted even if
30399 @option{-msoft-float} is used.
30401 @item -mno-fp-ret-in-387
30402 @opindex mno-fp-ret-in-387
30403 @opindex mfp-ret-in-387
30404 Do not use the FPU registers for return values of functions.
30406 The usual calling convention has functions return values of types
30407 @code{float} and @code{double} in an FPU register, even if there
30408 is no FPU@.  The idea is that the operating system should emulate
30409 an FPU@.
30411 The option @option{-mno-fp-ret-in-387} causes such values to be returned
30412 in ordinary CPU registers instead.
30414 @item -mno-fancy-math-387
30415 @opindex mno-fancy-math-387
30416 @opindex mfancy-math-387
30417 Some 387 emulators do not support the @code{sin}, @code{cos} and
30418 @code{sqrt} instructions for the 387.  Specify this option to avoid
30419 generating those instructions.
30420 This option is overridden when @option{-march}
30421 indicates that the target CPU always has an FPU and so the
30422 instruction does not need emulation.  These
30423 instructions are not generated unless you also use the
30424 @option{-funsafe-math-optimizations} switch.
30426 @item -malign-double
30427 @itemx -mno-align-double
30428 @opindex malign-double
30429 @opindex mno-align-double
30430 Control whether GCC aligns @code{double}, @code{long double}, and
30431 @code{long long} variables on a two-word boundary or a one-word
30432 boundary.  Aligning @code{double} variables on a two-word boundary
30433 produces code that runs somewhat faster on a Pentium at the
30434 expense of more memory.
30436 On x86-64, @option{-malign-double} is enabled by default.
30438 @strong{Warning:} if you use the @option{-malign-double} switch,
30439 structures containing the above types are aligned differently than
30440 the published application binary interface specifications for the x86-32
30441 and are not binary compatible with structures in code compiled
30442 without that switch.
30444 @item -m96bit-long-double
30445 @itemx -m128bit-long-double
30446 @opindex m96bit-long-double
30447 @opindex m128bit-long-double
30448 These switches control the size of @code{long double} type.  The x86-32
30449 application binary interface specifies the size to be 96 bits,
30450 so @option{-m96bit-long-double} is the default in 32-bit mode.
30452 Modern architectures (Pentium and newer) prefer @code{long double}
30453 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
30454 conforming to the ABI, this is not possible.  So specifying
30455 @option{-m128bit-long-double} aligns @code{long double}
30456 to a 16-byte boundary by padding the @code{long double} with an additional
30457 32-bit zero.
30459 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
30460 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
30462 Notice that neither of these options enable any extra precision over the x87
30463 standard of 80 bits for a @code{long double}.
30465 @strong{Warning:} if you override the default value for your target ABI, this
30466 changes the size of 
30467 structures and arrays containing @code{long double} variables,
30468 as well as modifying the function calling convention for functions taking
30469 @code{long double}.  Hence they are not binary-compatible
30470 with code compiled without that switch.
30472 @item -mlong-double-64
30473 @itemx -mlong-double-80
30474 @itemx -mlong-double-128
30475 @opindex mlong-double-64
30476 @opindex mlong-double-80
30477 @opindex mlong-double-128
30478 These switches control the size of @code{long double} type. A size
30479 of 64 bits makes the @code{long double} type equivalent to the @code{double}
30480 type. This is the default for 32-bit Bionic C library.  A size
30481 of 128 bits makes the @code{long double} type equivalent to the
30482 @code{__float128} type. This is the default for 64-bit Bionic C library.
30484 @strong{Warning:} if you override the default value for your target ABI, this
30485 changes the size of
30486 structures and arrays containing @code{long double} variables,
30487 as well as modifying the function calling convention for functions taking
30488 @code{long double}.  Hence they are not binary-compatible
30489 with code compiled without that switch.
30491 @item -malign-data=@var{type}
30492 @opindex malign-data
30493 Control how GCC aligns variables.  Supported values for @var{type} are
30494 @samp{compat} uses increased alignment value compatible uses GCC 4.8
30495 and earlier, @samp{abi} uses alignment value as specified by the
30496 psABI, and @samp{cacheline} uses increased alignment value to match
30497 the cache line size.  @samp{compat} is the default.
30499 @item -mlarge-data-threshold=@var{threshold}
30500 @opindex mlarge-data-threshold
30501 When @option{-mcmodel=medium} is specified, data objects larger than
30502 @var{threshold} are placed in the large data section.  This value must be the
30503 same across all objects linked into the binary, and defaults to 65535.
30505 @item -mrtd
30506 @opindex mrtd
30507 Use a different function-calling convention, in which functions that
30508 take a fixed number of arguments return with the @code{ret @var{num}}
30509 instruction, which pops their arguments while returning.  This saves one
30510 instruction in the caller since there is no need to pop the arguments
30511 there.
30513 You can specify that an individual function is called with this calling
30514 sequence with the function attribute @code{stdcall}.  You can also
30515 override the @option{-mrtd} option by using the function attribute
30516 @code{cdecl}.  @xref{Function Attributes}.
30518 @strong{Warning:} this calling convention is incompatible with the one
30519 normally used on Unix, so you cannot use it if you need to call
30520 libraries compiled with the Unix compiler.
30522 Also, you must provide function prototypes for all functions that
30523 take variable numbers of arguments (including @code{printf});
30524 otherwise incorrect code is generated for calls to those
30525 functions.
30527 In addition, seriously incorrect code results if you call a
30528 function with too many arguments.  (Normally, extra arguments are
30529 harmlessly ignored.)
30531 @item -mregparm=@var{num}
30532 @opindex mregparm
30533 Control how many registers are used to pass integer arguments.  By
30534 default, no registers are used to pass arguments, and at most 3
30535 registers can be used.  You can control this behavior for a specific
30536 function by using the function attribute @code{regparm}.
30537 @xref{Function Attributes}.
30539 @strong{Warning:} if you use this switch, and
30540 @var{num} is nonzero, then you must build all modules with the same
30541 value, including any libraries.  This includes the system libraries and
30542 startup modules.
30544 @item -msseregparm
30545 @opindex msseregparm
30546 Use SSE register passing conventions for float and double arguments
30547 and return values.  You can control this behavior for a specific
30548 function by using the function attribute @code{sseregparm}.
30549 @xref{Function Attributes}.
30551 @strong{Warning:} if you use this switch then you must build all
30552 modules with the same value, including any libraries.  This includes
30553 the system libraries and startup modules.
30555 @item -mvect8-ret-in-mem
30556 @opindex mvect8-ret-in-mem
30557 Return 8-byte vectors in memory instead of MMX registers.  This is the
30558 default on VxWorks to match the ABI of the Sun Studio compilers until
30559 version 12.  @emph{Only} use this option if you need to remain
30560 compatible with existing code produced by those previous compiler
30561 versions or older versions of GCC@.
30563 @item -mpc32
30564 @itemx -mpc64
30565 @itemx -mpc80
30566 @opindex mpc32
30567 @opindex mpc64
30568 @opindex mpc80
30570 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
30571 is specified, the significands of results of floating-point operations are
30572 rounded to 24 bits (single precision); @option{-mpc64} rounds the
30573 significands of results of floating-point operations to 53 bits (double
30574 precision) and @option{-mpc80} rounds the significands of results of
30575 floating-point operations to 64 bits (extended double precision), which is
30576 the default.  When this option is used, floating-point operations in higher
30577 precisions are not available to the programmer without setting the FPU
30578 control word explicitly.
30580 Setting the rounding of floating-point operations to less than the default
30581 80 bits can speed some programs by 2% or more.  Note that some mathematical
30582 libraries assume that extended-precision (80-bit) floating-point operations
30583 are enabled by default; routines in such libraries could suffer significant
30584 loss of accuracy, typically through so-called ``catastrophic cancellation'',
30585 when this option is used to set the precision to less than extended precision.
30587 @item -mstackrealign
30588 @opindex mstackrealign
30589 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
30590 option generates an alternate prologue and epilogue that realigns the
30591 run-time stack if necessary.  This supports mixing legacy codes that keep
30592 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
30593 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
30594 applicable to individual functions.
30596 @item -mpreferred-stack-boundary=@var{num}
30597 @opindex mpreferred-stack-boundary
30598 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
30599 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
30600 the default is 4 (16 bytes or 128 bits).
30602 @strong{Warning:} When generating code for the x86-64 architecture with
30603 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
30604 used to keep the stack boundary aligned to 8 byte boundary.  Since
30605 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
30606 intended to be used in controlled environment where stack space is
30607 important limitation.  This option leads to wrong code when functions
30608 compiled with 16 byte stack alignment (such as functions from a standard
30609 library) are called with misaligned stack.  In this case, SSE
30610 instructions may lead to misaligned memory access traps.  In addition,
30611 variable arguments are handled incorrectly for 16 byte aligned
30612 objects (including x87 long double and __int128), leading to wrong
30613 results.  You must build all modules with
30614 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
30615 includes the system libraries and startup modules.
30617 @item -mincoming-stack-boundary=@var{num}
30618 @opindex mincoming-stack-boundary
30619 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
30620 boundary.  If @option{-mincoming-stack-boundary} is not specified,
30621 the one specified by @option{-mpreferred-stack-boundary} is used.
30623 On Pentium and Pentium Pro, @code{double} and @code{long double} values
30624 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
30625 suffer significant run time performance penalties.  On Pentium III, the
30626 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
30627 properly if it is not 16-byte aligned.
30629 To ensure proper alignment of this values on the stack, the stack boundary
30630 must be as aligned as that required by any value stored on the stack.
30631 Further, every function must be generated such that it keeps the stack
30632 aligned.  Thus calling a function compiled with a higher preferred
30633 stack boundary from a function compiled with a lower preferred stack
30634 boundary most likely misaligns the stack.  It is recommended that
30635 libraries that use callbacks always use the default setting.
30637 This extra alignment does consume extra stack space, and generally
30638 increases code size.  Code that is sensitive to stack space usage, such
30639 as embedded systems and operating system kernels, may want to reduce the
30640 preferred alignment to @option{-mpreferred-stack-boundary=2}.
30642 @need 200
30643 @item -mmmx
30644 @opindex mmmx
30645 @need 200
30646 @itemx -msse
30647 @opindex msse
30648 @need 200
30649 @itemx -msse2
30650 @opindex msse2
30651 @need 200
30652 @itemx -msse3
30653 @opindex msse3
30654 @need 200
30655 @itemx -mssse3
30656 @opindex mssse3
30657 @need 200
30658 @itemx -msse4
30659 @opindex msse4
30660 @need 200
30661 @itemx -msse4a
30662 @opindex msse4a
30663 @need 200
30664 @itemx -msse4.1
30665 @opindex msse4.1
30666 @need 200
30667 @itemx -msse4.2
30668 @opindex msse4.2
30669 @need 200
30670 @itemx -mavx
30671 @opindex mavx
30672 @need 200
30673 @itemx -mavx2
30674 @opindex mavx2
30675 @need 200
30676 @itemx -mavx512f
30677 @opindex mavx512f
30678 @need 200
30679 @itemx -mavx512pf
30680 @opindex mavx512pf
30681 @need 200
30682 @itemx -mavx512er
30683 @opindex mavx512er
30684 @need 200
30685 @itemx -mavx512cd
30686 @opindex mavx512cd
30687 @need 200
30688 @itemx -mavx512vl
30689 @opindex mavx512vl
30690 @need 200
30691 @itemx -mavx512bw
30692 @opindex mavx512bw
30693 @need 200
30694 @itemx -mavx512dq
30695 @opindex mavx512dq
30696 @need 200
30697 @itemx -mavx512ifma
30698 @opindex mavx512ifma
30699 @need 200
30700 @itemx -mavx512vbmi
30701 @opindex mavx512vbmi
30702 @need 200
30703 @itemx -msha
30704 @opindex msha
30705 @need 200
30706 @itemx -maes
30707 @opindex maes
30708 @need 200
30709 @itemx -mpclmul
30710 @opindex mpclmul
30711 @need 200
30712 @itemx -mclflushopt
30713 @opindex mclflushopt
30714 @need 200
30715 @itemx -mclwb
30716 @opindex mclwb
30717 @need 200
30718 @itemx -mfsgsbase
30719 @opindex mfsgsbase
30720 @need 200
30721 @itemx -mptwrite
30722 @opindex mptwrite
30723 @need 200
30724 @itemx -mrdrnd
30725 @opindex mrdrnd
30726 @need 200
30727 @itemx -mf16c
30728 @opindex mf16c
30729 @need 200
30730 @itemx -mfma
30731 @opindex mfma
30732 @need 200
30733 @itemx -mpconfig
30734 @opindex mpconfig
30735 @need 200
30736 @itemx -mwbnoinvd
30737 @opindex mwbnoinvd
30738 @need 200
30739 @itemx -mfma4
30740 @opindex mfma4
30741 @need 200
30742 @itemx -mprfchw
30743 @opindex mprfchw
30744 @need 200
30745 @itemx -mrdpid
30746 @opindex mrdpid
30747 @need 200
30748 @itemx -mprefetchwt1
30749 @opindex mprefetchwt1
30750 @need 200
30751 @itemx -mrdseed
30752 @opindex mrdseed
30753 @need 200
30754 @itemx -msgx
30755 @opindex msgx
30756 @need 200
30757 @itemx -mxop
30758 @opindex mxop
30759 @need 200
30760 @itemx -mlwp
30761 @opindex mlwp
30762 @need 200
30763 @itemx -m3dnow
30764 @opindex m3dnow
30765 @need 200
30766 @itemx -m3dnowa
30767 @opindex m3dnowa
30768 @need 200
30769 @itemx -mpopcnt
30770 @opindex mpopcnt
30771 @need 200
30772 @itemx -mabm
30773 @opindex mabm
30774 @need 200
30775 @itemx -madx
30776 @opindex madx
30777 @need 200
30778 @itemx -mbmi
30779 @opindex mbmi
30780 @need 200
30781 @itemx -mbmi2
30782 @opindex mbmi2
30783 @need 200
30784 @itemx -mlzcnt
30785 @opindex mlzcnt
30786 @need 200
30787 @itemx -mfxsr
30788 @opindex mfxsr
30789 @need 200
30790 @itemx -mxsave
30791 @opindex mxsave
30792 @need 200
30793 @itemx -mxsaveopt
30794 @opindex mxsaveopt
30795 @need 200
30796 @itemx -mxsavec
30797 @opindex mxsavec
30798 @need 200
30799 @itemx -mxsaves
30800 @opindex mxsaves
30801 @need 200
30802 @itemx -mrtm
30803 @opindex mrtm
30804 @need 200
30805 @itemx -mhle
30806 @opindex mhle
30807 @need 200
30808 @itemx -mtbm
30809 @opindex mtbm
30810 @need 200
30811 @itemx -mmwaitx
30812 @opindex mmwaitx
30813 @need 200
30814 @itemx -mclzero
30815 @opindex mclzero
30816 @need 200
30817 @itemx -mpku
30818 @opindex mpku
30819 @need 200
30820 @itemx -mavx512vbmi2
30821 @opindex mavx512vbmi2
30822 @need 200
30823 @itemx -mavx512bf16
30824 @opindex mavx512bf16
30825 @need 200
30826 @itemx -mgfni
30827 @opindex mgfni
30828 @need 200
30829 @itemx -mvaes
30830 @opindex mvaes
30831 @need 200
30832 @itemx -mwaitpkg
30833 @opindex mwaitpkg
30834 @need 200
30835 @itemx -mvpclmulqdq
30836 @opindex mvpclmulqdq
30837 @need 200
30838 @itemx -mavx512bitalg
30839 @opindex mavx512bitalg
30840 @need 200
30841 @itemx -mmovdiri
30842 @opindex mmovdiri
30843 @need 200
30844 @itemx -mmovdir64b
30845 @opindex mmovdir64b
30846 @need 200
30847 @itemx -menqcmd
30848 @opindex menqcmd
30849 @itemx -muintr
30850 @opindex muintr
30851 @need 200
30852 @itemx -mtsxldtrk
30853 @opindex mtsxldtrk
30854 @need 200
30855 @itemx -mavx512vpopcntdq
30856 @opindex mavx512vpopcntdq
30857 @need 200
30858 @itemx -mavx512vp2intersect
30859 @opindex mavx512vp2intersect
30860 @need 200
30861 @itemx -mavx5124fmaps
30862 @opindex mavx5124fmaps
30863 @need 200
30864 @itemx -mavx512vnni
30865 @opindex mavx512vnni
30866 @need 200
30867 @itemx -mavxvnni
30868 @opindex mavxvnni
30869 @need 200
30870 @itemx -mavx5124vnniw
30871 @opindex mavx5124vnniw
30872 @need 200
30873 @itemx -mcldemote
30874 @opindex mcldemote
30875 @need 200
30876 @itemx -mserialize
30877 @opindex mserialize
30878 @need 200
30879 @itemx -mamx-tile
30880 @opindex mamx-tile
30881 @need 200
30882 @itemx -mamx-int8
30883 @opindex mamx-int8
30884 @need 200
30885 @itemx -mamx-bf16
30886 @opindex mamx-bf16
30887 @need 200
30888 @itemx -mhreset
30889 @opindex mhreset
30890 @itemx -mkl
30891 @opindex mkl
30892 @need 200
30893 @itemx -mwidekl
30894 @opindex mwidekl
30895 These switches enable the use of instructions in the MMX, SSE,
30896 SSE2, SSE3, SSSE3, SSE4, SSE4A, SSE4.1, SSE4.2, AVX, AVX2, AVX512F, AVX512PF,
30897 AVX512ER, AVX512CD, AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA, AVX512VBMI, SHA,
30898 AES, PCLMUL, CLFLUSHOPT, CLWB, FSGSBASE, PTWRITE, RDRND, F16C, FMA, PCONFIG,
30899 WBNOINVD, FMA4, PREFETCHW, RDPID, PREFETCHWT1, RDSEED, SGX, XOP, LWP,
30900 3DNow!@:, enhanced 3DNow!@:, POPCNT, ABM, ADX, BMI, BMI2, LZCNT, FXSR, XSAVE,
30901 XSAVEOPT, XSAVEC, XSAVES, RTM, HLE, TBM, MWAITX, CLZERO, PKU, AVX512VBMI2,
30902 GFNI, VAES, WAITPKG, VPCLMULQDQ, AVX512BITALG, MOVDIRI, MOVDIR64B, AVX512BF16,
30903 ENQCMD, AVX512VPOPCNTDQ, AVX5124FMAPS, AVX512VNNI, AVX5124VNNIW, SERIALIZE,
30904 UINTR, HRESET, AMXTILE, AMXINT8, AMXBF16, KL, WIDEKL, AVXVNNI or CLDEMOTE
30905 extended instruction sets. Each has a corresponding @option{-mno-} option to
30906 disable use of these instructions.
30908 These extensions are also available as built-in functions: see
30909 @ref{x86 Built-in Functions}, for details of the functions enabled and
30910 disabled by these switches.
30912 To generate SSE/SSE2 instructions automatically from floating-point
30913 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
30915 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
30916 generates new AVX instructions or AVX equivalence for all SSEx instructions
30917 when needed.
30919 These options enable GCC to use these extended instructions in
30920 generated code, even without @option{-mfpmath=sse}.  Applications that
30921 perform run-time CPU detection must compile separate files for each
30922 supported architecture, using the appropriate flags.  In particular,
30923 the file containing the CPU detection code should be compiled without
30924 these options.
30926 @item -mdump-tune-features
30927 @opindex mdump-tune-features
30928 This option instructs GCC to dump the names of the x86 performance 
30929 tuning features and default settings. The names can be used in 
30930 @option{-mtune-ctrl=@var{feature-list}}.
30932 @item -mtune-ctrl=@var{feature-list}
30933 @opindex mtune-ctrl=@var{feature-list}
30934 This option is used to do fine grain control of x86 code generation features.
30935 @var{feature-list} is a comma separated list of @var{feature} names. See also
30936 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
30937 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
30938 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
30939 developers. Using it may lead to code paths not covered by testing and can
30940 potentially result in compiler ICEs or runtime errors.
30942 @item -mno-default
30943 @opindex mno-default
30944 This option instructs GCC to turn off all tunable features. See also 
30945 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
30947 @item -mcld
30948 @opindex mcld
30949 This option instructs GCC to emit a @code{cld} instruction in the prologue
30950 of functions that use string instructions.  String instructions depend on
30951 the DF flag to select between autoincrement or autodecrement mode.  While the
30952 ABI specifies the DF flag to be cleared on function entry, some operating
30953 systems violate this specification by not clearing the DF flag in their
30954 exception dispatchers.  The exception handler can be invoked with the DF flag
30955 set, which leads to wrong direction mode when string instructions are used.
30956 This option can be enabled by default on 32-bit x86 targets by configuring
30957 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
30958 instructions can be suppressed with the @option{-mno-cld} compiler option
30959 in this case.
30961 @item -mvzeroupper
30962 @opindex mvzeroupper
30963 This option instructs GCC to emit a @code{vzeroupper} instruction
30964 before a transfer of control flow out of the function to minimize
30965 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
30966 intrinsics.
30968 @item -mprefer-avx128
30969 @opindex mprefer-avx128
30970 This option instructs GCC to use 128-bit AVX instructions instead of
30971 256-bit AVX instructions in the auto-vectorizer.
30973 @item -mprefer-vector-width=@var{opt}
30974 @opindex mprefer-vector-width
30975 This option instructs GCC to use @var{opt}-bit vector width in instructions
30976 instead of default on the selected platform.
30978 @table @samp
30979 @item none
30980 No extra limitations applied to GCC other than defined by the selected platform.
30982 @item 128
30983 Prefer 128-bit vector width for instructions.
30985 @item 256
30986 Prefer 256-bit vector width for instructions.
30988 @item 512
30989 Prefer 512-bit vector width for instructions.
30990 @end table
30992 @item -mcx16
30993 @opindex mcx16
30994 This option enables GCC to generate @code{CMPXCHG16B} instructions in 64-bit
30995 code to implement compare-and-exchange operations on 16-byte aligned 128-bit
30996 objects.  This is useful for atomic updates of data structures exceeding one
30997 machine word in size.  The compiler uses this instruction to implement
30998 @ref{__sync Builtins}.  However, for @ref{__atomic Builtins} operating on
30999 128-bit integers, a library call is always used.
31001 @item -msahf
31002 @opindex msahf
31003 This option enables generation of @code{SAHF} instructions in 64-bit code.
31004 Early Intel Pentium 4 CPUs with Intel 64 support,
31005 prior to the introduction of Pentium 4 G1 step in December 2005,
31006 lacked the @code{LAHF} and @code{SAHF} instructions
31007 which are supported by AMD64.
31008 These are load and store instructions, respectively, for certain status flags.
31009 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
31010 @code{drem}, and @code{remainder} built-in functions;
31011 see @ref{Other Builtins} for details.
31013 @item -mmovbe
31014 @opindex mmovbe
31015 This option enables use of the @code{movbe} instruction to implement
31016 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
31018 @item -mshstk
31019 @opindex mshstk
31020 The @option{-mshstk} option enables shadow stack built-in functions
31021 from x86 Control-flow Enforcement Technology (CET).
31023 @item -mcrc32
31024 @opindex mcrc32
31025 This option enables built-in functions @code{__builtin_ia32_crc32qi},
31026 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
31027 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
31029 @item -mrecip
31030 @opindex mrecip
31031 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
31032 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
31033 with an additional Newton-Raphson step
31034 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
31035 (and their vectorized
31036 variants) for single-precision floating-point arguments.  These instructions
31037 are generated only when @option{-funsafe-math-optimizations} is enabled
31038 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
31039 Note that while the throughput of the sequence is higher than the throughput
31040 of the non-reciprocal instruction, the precision of the sequence can be
31041 decreased by up to 2 ulp (i.e.@: the inverse of 1.0 equals 0.99999994).
31043 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
31044 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
31045 combination), and doesn't need @option{-mrecip}.
31047 Also note that GCC emits the above sequence with additional Newton-Raphson step
31048 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
31049 already with @option{-ffast-math} (or the above option combination), and
31050 doesn't need @option{-mrecip}.
31052 @item -mrecip=@var{opt}
31053 @opindex mrecip=opt
31054 This option controls which reciprocal estimate instructions
31055 may be used.  @var{opt} is a comma-separated list of options, which may
31056 be preceded by a @samp{!} to invert the option:
31058 @table @samp
31059 @item all
31060 Enable all estimate instructions.
31062 @item default
31063 Enable the default instructions, equivalent to @option{-mrecip}.
31065 @item none
31066 Disable all estimate instructions, equivalent to @option{-mno-recip}.
31068 @item div
31069 Enable the approximation for scalar division.
31071 @item vec-div
31072 Enable the approximation for vectorized division.
31074 @item sqrt
31075 Enable the approximation for scalar square root.
31077 @item vec-sqrt
31078 Enable the approximation for vectorized square root.
31079 @end table
31081 So, for example, @option{-mrecip=all,!sqrt} enables
31082 all of the reciprocal approximations, except for square root.
31084 @item -mveclibabi=@var{type}
31085 @opindex mveclibabi
31086 Specifies the ABI type to use for vectorizing intrinsics using an
31087 external library.  Supported values for @var{type} are @samp{svml} 
31088 for the Intel short
31089 vector math library and @samp{acml} for the AMD math core library.
31090 To use this option, both @option{-ftree-vectorize} and
31091 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
31092 ABI-compatible library must be specified at link time.
31094 GCC currently emits calls to @code{vmldExp2},
31095 @code{vmldLn2}, @code{vmldLog102}, @code{vmldPow2},
31096 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
31097 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
31098 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
31099 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4},
31100 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
31101 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
31102 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
31103 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
31104 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
31105 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
31106 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
31107 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
31108 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
31109 when @option{-mveclibabi=acml} is used.  
31111 @item -mabi=@var{name}
31112 @opindex mabi
31113 Generate code for the specified calling convention.  Permissible values
31114 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
31115 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
31116 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
31117 You can control this behavior for specific functions by
31118 using the function attributes @code{ms_abi} and @code{sysv_abi}.
31119 @xref{Function Attributes}.
31121 @item -mforce-indirect-call
31122 @opindex mforce-indirect-call
31123 Force all calls to functions to be indirect. This is useful
31124 when using Intel Processor Trace where it generates more precise timing
31125 information for function calls.
31127 @item -mmanual-endbr
31128 @opindex mmanual-endbr
31129 Insert ENDBR instruction at function entry only via the @code{cf_check}
31130 function attribute. This is useful when used with the option
31131 @option{-fcf-protection=branch} to control ENDBR insertion at the
31132 function entry.
31134 @item -mcall-ms2sysv-xlogues
31135 @opindex mcall-ms2sysv-xlogues
31136 @opindex mno-call-ms2sysv-xlogues
31137 Due to differences in 64-bit ABIs, any Microsoft ABI function that calls a
31138 System V ABI function must consider RSI, RDI and XMM6-15 as clobbered.  By
31139 default, the code for saving and restoring these registers is emitted inline,
31140 resulting in fairly lengthy prologues and epilogues.  Using
31141 @option{-mcall-ms2sysv-xlogues} emits prologues and epilogues that
31142 use stubs in the static portion of libgcc to perform these saves and restores,
31143 thus reducing function size at the cost of a few extra instructions.
31145 @item -mtls-dialect=@var{type}
31146 @opindex mtls-dialect
31147 Generate code to access thread-local storage using the @samp{gnu} or
31148 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
31149 @samp{gnu2} is more efficient, but it may add compile- and run-time
31150 requirements that cannot be satisfied on all systems.
31152 @item -mpush-args
31153 @itemx -mno-push-args
31154 @opindex mpush-args
31155 @opindex mno-push-args
31156 Use PUSH operations to store outgoing parameters.  This method is shorter
31157 and usually equally fast as method using SUB/MOV operations and is enabled
31158 by default.  In some cases disabling it may improve performance because of
31159 improved scheduling and reduced dependencies.
31161 @item -maccumulate-outgoing-args
31162 @opindex maccumulate-outgoing-args
31163 If enabled, the maximum amount of space required for outgoing arguments is
31164 computed in the function prologue.  This is faster on most modern CPUs
31165 because of reduced dependencies, improved scheduling and reduced stack usage
31166 when the preferred stack boundary is not equal to 2.  The drawback is a notable
31167 increase in code size.  This switch implies @option{-mno-push-args}.
31169 @item -mthreads
31170 @opindex mthreads
31171 Support thread-safe exception handling on MinGW.  Programs that rely
31172 on thread-safe exception handling must compile and link all code with the
31173 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
31174 @option{-D_MT}; when linking, it links in a special thread helper library
31175 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
31177 @item -mms-bitfields
31178 @itemx -mno-ms-bitfields
31179 @opindex mms-bitfields
31180 @opindex mno-ms-bitfields
31182 Enable/disable bit-field layout compatible with the native Microsoft
31183 Windows compiler.  
31185 If @code{packed} is used on a structure, or if bit-fields are used,
31186 it may be that the Microsoft ABI lays out the structure differently
31187 than the way GCC normally does.  Particularly when moving packed
31188 data between functions compiled with GCC and the native Microsoft compiler
31189 (either via function call or as data in a file), it may be necessary to access
31190 either format.
31192 This option is enabled by default for Microsoft Windows
31193 targets.  This behavior can also be controlled locally by use of variable
31194 or type attributes.  For more information, see @ref{x86 Variable Attributes}
31195 and @ref{x86 Type Attributes}.
31197 The Microsoft structure layout algorithm is fairly simple with the exception
31198 of the bit-field packing.  
31199 The padding and alignment of members of structures and whether a bit-field 
31200 can straddle a storage-unit boundary are determine by these rules:
31202 @enumerate
31203 @item Structure members are stored sequentially in the order in which they are
31204 declared: the first member has the lowest memory address and the last member
31205 the highest.
31207 @item Every data object has an alignment requirement.  The alignment requirement
31208 for all data except structures, unions, and arrays is either the size of the
31209 object or the current packing size (specified with either the
31210 @code{aligned} attribute or the @code{pack} pragma),
31211 whichever is less.  For structures, unions, and arrays,
31212 the alignment requirement is the largest alignment requirement of its members.
31213 Every object is allocated an offset so that:
31215 @smallexample
31216 offset % alignment_requirement == 0
31217 @end smallexample
31219 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
31220 unit if the integral types are the same size and if the next bit-field fits
31221 into the current allocation unit without crossing the boundary imposed by the
31222 common alignment requirements of the bit-fields.
31223 @end enumerate
31225 MSVC interprets zero-length bit-fields in the following ways:
31227 @enumerate
31228 @item If a zero-length bit-field is inserted between two bit-fields that
31229 are normally coalesced, the bit-fields are not coalesced.
31231 For example:
31233 @smallexample
31234 struct
31235  @{
31236    unsigned long bf_1 : 12;
31237    unsigned long : 0;
31238    unsigned long bf_2 : 12;
31239  @} t1;
31240 @end smallexample
31242 @noindent
31243 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
31244 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
31246 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
31247 alignment of the zero-length bit-field is greater than the member that follows it,
31248 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
31250 For example:
31252 @smallexample
31253 struct
31254  @{
31255    char foo : 4;
31256    short : 0;
31257    char bar;
31258  @} t2;
31260 struct
31261  @{
31262    char foo : 4;
31263    short : 0;
31264    double bar;
31265  @} t3;
31266 @end smallexample
31268 @noindent
31269 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
31270 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
31271 bit-field does not affect the alignment of @code{bar} or, as a result, the size
31272 of the structure.
31274 Taking this into account, it is important to note the following:
31276 @enumerate
31277 @item If a zero-length bit-field follows a normal bit-field, the type of the
31278 zero-length bit-field may affect the alignment of the structure as whole. For
31279 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
31280 normal bit-field, and is of type short.
31282 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
31283 still affect the alignment of the structure:
31285 @smallexample
31286 struct
31287  @{
31288    char foo : 6;
31289    long : 0;
31290  @} t4;
31291 @end smallexample
31293 @noindent
31294 Here, @code{t4} takes up 4 bytes.
31295 @end enumerate
31297 @item Zero-length bit-fields following non-bit-field members are ignored:
31299 @smallexample
31300 struct
31301  @{
31302    char foo;
31303    long : 0;
31304    char bar;
31305  @} t5;
31306 @end smallexample
31308 @noindent
31309 Here, @code{t5} takes up 2 bytes.
31310 @end enumerate
31313 @item -mno-align-stringops
31314 @opindex mno-align-stringops
31315 @opindex malign-stringops
31316 Do not align the destination of inlined string operations.  This switch reduces
31317 code size and improves performance in case the destination is already aligned,
31318 but GCC doesn't know about it.
31320 @item -minline-all-stringops
31321 @opindex minline-all-stringops
31322 By default GCC inlines string operations only when the destination is 
31323 known to be aligned to least a 4-byte boundary.  
31324 This enables more inlining and increases code
31325 size, but may improve performance of code that depends on fast
31326 @code{memcpy} and @code{memset} for short lengths.
31327 The option enables inline expansion of @code{strlen} for all
31328 pointer alignments.
31330 @item -minline-stringops-dynamically
31331 @opindex minline-stringops-dynamically
31332 For string operations of unknown size, use run-time checks with
31333 inline code for small blocks and a library call for large blocks.
31335 @item -mstringop-strategy=@var{alg}
31336 @opindex mstringop-strategy=@var{alg}
31337 Override the internal decision heuristic for the particular algorithm to use
31338 for inlining string operations.  The allowed values for @var{alg} are:
31340 @table @samp
31341 @item rep_byte
31342 @itemx rep_4byte
31343 @itemx rep_8byte
31344 Expand using i386 @code{rep} prefix of the specified size.
31346 @item byte_loop
31347 @itemx loop
31348 @itemx unrolled_loop
31349 Expand into an inline loop.
31351 @item libcall
31352 Always use a library call.
31353 @end table
31355 @item -mmemcpy-strategy=@var{strategy}
31356 @opindex mmemcpy-strategy=@var{strategy}
31357 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
31358 should be inlined and what inline algorithm to use when the expected size
31359 of the copy operation is known. @var{strategy} 
31360 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
31361 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
31362 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
31363 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
31364 in the list must be specified in increasing order.  The minimal byte size for 
31365 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
31366 preceding range.
31368 @item -mmemset-strategy=@var{strategy}
31369 @opindex mmemset-strategy=@var{strategy}
31370 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
31371 @code{__builtin_memset} expansion.
31373 @item -momit-leaf-frame-pointer
31374 @opindex momit-leaf-frame-pointer
31375 Don't keep the frame pointer in a register for leaf functions.  This
31376 avoids the instructions to save, set up, and restore frame pointers and
31377 makes an extra register available in leaf functions.  The option
31378 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
31379 which might make debugging harder.
31381 @item -mtls-direct-seg-refs
31382 @itemx -mno-tls-direct-seg-refs
31383 @opindex mtls-direct-seg-refs
31384 Controls whether TLS variables may be accessed with offsets from the
31385 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
31386 or whether the thread base pointer must be added.  Whether or not this
31387 is valid depends on the operating system, and whether it maps the
31388 segment to cover the entire TLS area.
31390 For systems that use the GNU C Library, the default is on.
31392 @item -msse2avx
31393 @itemx -mno-sse2avx
31394 @opindex msse2avx
31395 Specify that the assembler should encode SSE instructions with VEX
31396 prefix.  The option @option{-mavx} turns this on by default.
31398 @item -mfentry
31399 @itemx -mno-fentry
31400 @opindex mfentry
31401 If profiling is active (@option{-pg}), put the profiling
31402 counter call before the prologue.
31403 Note: On x86 architectures the attribute @code{ms_hook_prologue}
31404 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
31406 @item -mrecord-mcount
31407 @itemx -mno-record-mcount
31408 @opindex mrecord-mcount
31409 If profiling is active (@option{-pg}), generate a __mcount_loc section
31410 that contains pointers to each profiling call. This is useful for
31411 automatically patching and out calls.
31413 @item -mnop-mcount
31414 @itemx -mno-nop-mcount
31415 @opindex mnop-mcount
31416 If profiling is active (@option{-pg}), generate the calls to
31417 the profiling functions as NOPs. This is useful when they
31418 should be patched in later dynamically. This is likely only
31419 useful together with @option{-mrecord-mcount}.
31421 @item -minstrument-return=@var{type}
31422 @opindex minstrument-return
31423 Instrument function exit in -pg -mfentry instrumented functions with
31424 call to specified function. This only instruments true returns ending
31425 with ret, but not sibling calls ending with jump. Valid types
31426 are @var{none} to not instrument, @var{call} to generate a call to __return__,
31427 or @var{nop5} to generate a 5 byte nop.
31429 @item -mrecord-return
31430 @itemx -mno-record-return
31431 @opindex mrecord-return
31432 Generate a __return_loc section pointing to all return instrumentation code.
31434 @item -mfentry-name=@var{name}
31435 @opindex mfentry-name
31436 Set name of __fentry__ symbol called at function entry for -pg -mfentry functions.
31438 @item -mfentry-section=@var{name}
31439 @opindex mfentry-section
31440 Set name of section to record -mrecord-mcount calls (default __mcount_loc).
31442 @item -mskip-rax-setup
31443 @itemx -mno-skip-rax-setup
31444 @opindex mskip-rax-setup
31445 When generating code for the x86-64 architecture with SSE extensions
31446 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
31447 register when there are no variable arguments passed in vector registers.
31449 @strong{Warning:} Since RAX register is used to avoid unnecessarily
31450 saving vector registers on stack when passing variable arguments, the
31451 impacts of this option are callees may waste some stack space,
31452 misbehave or jump to a random location.  GCC 4.4 or newer don't have
31453 those issues, regardless the RAX register value.
31455 @item -m8bit-idiv
31456 @itemx -mno-8bit-idiv
31457 @opindex m8bit-idiv
31458 On some processors, like Intel Atom, 8-bit unsigned integer divide is
31459 much faster than 32-bit/64-bit integer divide.  This option generates a
31460 run-time check.  If both dividend and divisor are within range of 0
31461 to 255, 8-bit unsigned integer divide is used instead of
31462 32-bit/64-bit integer divide.
31464 @item -mavx256-split-unaligned-load
31465 @itemx -mavx256-split-unaligned-store
31466 @opindex mavx256-split-unaligned-load
31467 @opindex mavx256-split-unaligned-store
31468 Split 32-byte AVX unaligned load and store.
31470 @item -mstack-protector-guard=@var{guard}
31471 @itemx -mstack-protector-guard-reg=@var{reg}
31472 @itemx -mstack-protector-guard-offset=@var{offset}
31473 @opindex mstack-protector-guard
31474 @opindex mstack-protector-guard-reg
31475 @opindex mstack-protector-guard-offset
31476 Generate stack protection code using canary at @var{guard}.  Supported
31477 locations are @samp{global} for global canary or @samp{tls} for per-thread
31478 canary in the TLS block (the default).  This option has effect only when
31479 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
31481 With the latter choice the options
31482 @option{-mstack-protector-guard-reg=@var{reg}} and
31483 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
31484 which segment register (@code{%fs} or @code{%gs}) to use as base register
31485 for reading the canary, and from what offset from that base register.
31486 The default for those is as specified in the relevant ABI.
31488 @item -mgeneral-regs-only
31489 @opindex mgeneral-regs-only
31490 Generate code that uses only the general-purpose registers.  This
31491 prevents the compiler from using floating-point, vector, mask and bound
31492 registers.
31494 @item -mindirect-branch=@var{choice}
31495 @opindex mindirect-branch
31496 Convert indirect call and jump with @var{choice}.  The default is
31497 @samp{keep}, which keeps indirect call and jump unmodified.
31498 @samp{thunk} converts indirect call and jump to call and return thunk.
31499 @samp{thunk-inline} converts indirect call and jump to inlined call
31500 and return thunk.  @samp{thunk-extern} converts indirect call and jump
31501 to external call and return thunk provided in a separate object file.
31502 You can control this behavior for a specific function by using the
31503 function attribute @code{indirect_branch}.  @xref{Function Attributes}.
31505 Note that @option{-mcmodel=large} is incompatible with
31506 @option{-mindirect-branch=thunk} and
31507 @option{-mindirect-branch=thunk-extern} since the thunk function may
31508 not be reachable in the large code model.
31510 Note that @option{-mindirect-branch=thunk-extern} is compatible with
31511 @option{-fcf-protection=branch} since the external thunk can be made
31512 to enable control-flow check.
31514 @item -mfunction-return=@var{choice}
31515 @opindex mfunction-return
31516 Convert function return with @var{choice}.  The default is @samp{keep},
31517 which keeps function return unmodified.  @samp{thunk} converts function
31518 return to call and return thunk.  @samp{thunk-inline} converts function
31519 return to inlined call and return thunk.  @samp{thunk-extern} converts
31520 function return to external call and return thunk provided in a separate
31521 object file.  You can control this behavior for a specific function by
31522 using the function attribute @code{function_return}.
31523 @xref{Function Attributes}.
31525 Note that @option{-mindirect-return=thunk-extern} is compatible with
31526 @option{-fcf-protection=branch} since the external thunk can be made
31527 to enable control-flow check.
31529 Note that @option{-mcmodel=large} is incompatible with
31530 @option{-mfunction-return=thunk} and
31531 @option{-mfunction-return=thunk-extern} since the thunk function may
31532 not be reachable in the large code model.
31535 @item -mindirect-branch-register
31536 @opindex mindirect-branch-register
31537 Force indirect call and jump via register.
31539 @end table
31541 These @samp{-m} switches are supported in addition to the above
31542 on x86-64 processors in 64-bit environments.
31544 @table @gcctabopt
31545 @item -m32
31546 @itemx -m64
31547 @itemx -mx32
31548 @itemx -m16
31549 @itemx -miamcu
31550 @opindex m32
31551 @opindex m64
31552 @opindex mx32
31553 @opindex m16
31554 @opindex miamcu
31555 Generate code for a 16-bit, 32-bit or 64-bit environment.
31556 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
31557 to 32 bits, and
31558 generates code that runs on any i386 system.
31560 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
31561 types to 64 bits, and generates code for the x86-64 architecture.
31562 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
31563 and @option{-mdynamic-no-pic} options.
31565 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
31566 to 32 bits, and
31567 generates code for the x86-64 architecture.
31569 The @option{-m16} option is the same as @option{-m32}, except for that
31570 it outputs the @code{.code16gcc} assembly directive at the beginning of
31571 the assembly output so that the binary can run in 16-bit mode.
31573 The @option{-miamcu} option generates code which conforms to Intel MCU
31574 psABI.  It requires the @option{-m32} option to be turned on.
31576 @item -mno-red-zone
31577 @opindex mno-red-zone
31578 @opindex mred-zone
31579 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
31580 by the x86-64 ABI; it is a 128-byte area beyond the location of the
31581 stack pointer that is not modified by signal or interrupt handlers
31582 and therefore can be used for temporary data without adjusting the stack
31583 pointer.  The flag @option{-mno-red-zone} disables this red zone.
31585 @item -mcmodel=small
31586 @opindex mcmodel=small
31587 Generate code for the small code model: the program and its symbols must
31588 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
31589 Programs can be statically or dynamically linked.  This is the default
31590 code model.
31592 @item -mcmodel=kernel
31593 @opindex mcmodel=kernel
31594 Generate code for the kernel code model.  The kernel runs in the
31595 negative 2 GB of the address space.
31596 This model has to be used for Linux kernel code.
31598 @item -mcmodel=medium
31599 @opindex mcmodel=medium
31600 Generate code for the medium model: the program is linked in the lower 2
31601 GB of the address space.  Small symbols are also placed there.  Symbols
31602 with sizes larger than @option{-mlarge-data-threshold} are put into
31603 large data or BSS sections and can be located above 2GB.  Programs can
31604 be statically or dynamically linked.
31606 @item -mcmodel=large
31607 @opindex mcmodel=large
31608 Generate code for the large model.  This model makes no assumptions
31609 about addresses and sizes of sections.
31611 @item -maddress-mode=long
31612 @opindex maddress-mode=long
31613 Generate code for long address mode.  This is only supported for 64-bit
31614 and x32 environments.  It is the default address mode for 64-bit
31615 environments.
31617 @item -maddress-mode=short
31618 @opindex maddress-mode=short
31619 Generate code for short address mode.  This is only supported for 32-bit
31620 and x32 environments.  It is the default address mode for 32-bit and
31621 x32 environments.
31623 @item -mneeded
31624 @itemx -mno-needed
31625 @opindex mneeded
31626 Emit GNU_PROPERTY_X86_ISA_1_NEEDED GNU property for Linux target to
31627 indicate the micro-architecture ISA level required to execute the binary.
31628 @end table
31630 @node x86 Windows Options
31631 @subsection x86 Windows Options
31632 @cindex x86 Windows Options
31633 @cindex Windows Options for x86
31635 These additional options are available for Microsoft Windows targets:
31637 @table @gcctabopt
31638 @item -mconsole
31639 @opindex mconsole
31640 This option
31641 specifies that a console application is to be generated, by
31642 instructing the linker to set the PE header subsystem type
31643 required for console applications.
31644 This option is available for Cygwin and MinGW targets and is
31645 enabled by default on those targets.
31647 @item -mdll
31648 @opindex mdll
31649 This option is available for Cygwin and MinGW targets.  It
31650 specifies that a DLL---a dynamic link library---is to be
31651 generated, enabling the selection of the required runtime
31652 startup object and entry point.
31654 @item -mnop-fun-dllimport
31655 @opindex mnop-fun-dllimport
31656 This option is available for Cygwin and MinGW targets.  It
31657 specifies that the @code{dllimport} attribute should be ignored.
31659 @item -mthread
31660 @opindex mthread
31661 This option is available for MinGW targets. It specifies
31662 that MinGW-specific thread support is to be used.
31664 @item -municode
31665 @opindex municode
31666 This option is available for MinGW-w64 targets.  It causes
31667 the @code{UNICODE} preprocessor macro to be predefined, and
31668 chooses Unicode-capable runtime startup code.
31670 @item -mwin32
31671 @opindex mwin32
31672 This option is available for Cygwin and MinGW targets.  It
31673 specifies that the typical Microsoft Windows predefined macros are to
31674 be set in the pre-processor, but does not influence the choice
31675 of runtime library/startup code.
31677 @item -mwindows
31678 @opindex mwindows
31679 This option is available for Cygwin and MinGW targets.  It
31680 specifies that a GUI application is to be generated by
31681 instructing the linker to set the PE header subsystem type
31682 appropriately.
31684 @item -fno-set-stack-executable
31685 @opindex fno-set-stack-executable
31686 @opindex fset-stack-executable
31687 This option is available for MinGW targets. It specifies that
31688 the executable flag for the stack used by nested functions isn't
31689 set. This is necessary for binaries running in kernel mode of
31690 Microsoft Windows, as there the User32 API, which is used to set executable
31691 privileges, isn't available.
31693 @item -fwritable-relocated-rdata
31694 @opindex fno-writable-relocated-rdata
31695 @opindex fwritable-relocated-rdata
31696 This option is available for MinGW and Cygwin targets.  It specifies
31697 that relocated-data in read-only section is put into the @code{.data}
31698 section.  This is a necessary for older runtimes not supporting
31699 modification of @code{.rdata} sections for pseudo-relocation.
31701 @item -mpe-aligned-commons
31702 @opindex mpe-aligned-commons
31703 This option is available for Cygwin and MinGW targets.  It
31704 specifies that the GNU extension to the PE file format that
31705 permits the correct alignment of COMMON variables should be
31706 used when generating code.  It is enabled by default if
31707 GCC detects that the target assembler found during configuration
31708 supports the feature.
31709 @end table
31711 See also under @ref{x86 Options} for standard options.
31713 @node Xstormy16 Options
31714 @subsection Xstormy16 Options
31715 @cindex Xstormy16 Options
31717 These options are defined for Xstormy16:
31719 @table @gcctabopt
31720 @item -msim
31721 @opindex msim
31722 Choose startup files and linker script suitable for the simulator.
31723 @end table
31725 @node Xtensa Options
31726 @subsection Xtensa Options
31727 @cindex Xtensa Options
31729 These options are supported for Xtensa targets:
31731 @table @gcctabopt
31732 @item -mconst16
31733 @itemx -mno-const16
31734 @opindex mconst16
31735 @opindex mno-const16
31736 Enable or disable use of @code{CONST16} instructions for loading
31737 constant values.  The @code{CONST16} instruction is currently not a
31738 standard option from Tensilica.  When enabled, @code{CONST16}
31739 instructions are always used in place of the standard @code{L32R}
31740 instructions.  The use of @code{CONST16} is enabled by default only if
31741 the @code{L32R} instruction is not available.
31743 @item -mfused-madd
31744 @itemx -mno-fused-madd
31745 @opindex mfused-madd
31746 @opindex mno-fused-madd
31747 Enable or disable use of fused multiply/add and multiply/subtract
31748 instructions in the floating-point option.  This has no effect if the
31749 floating-point option is not also enabled.  Disabling fused multiply/add
31750 and multiply/subtract instructions forces the compiler to use separate
31751 instructions for the multiply and add/subtract operations.  This may be
31752 desirable in some cases where strict IEEE 754-compliant results are
31753 required: the fused multiply add/subtract instructions do not round the
31754 intermediate result, thereby producing results with @emph{more} bits of
31755 precision than specified by the IEEE standard.  Disabling fused multiply
31756 add/subtract instructions also ensures that the program output is not
31757 sensitive to the compiler's ability to combine multiply and add/subtract
31758 operations.
31760 @item -mserialize-volatile
31761 @itemx -mno-serialize-volatile
31762 @opindex mserialize-volatile
31763 @opindex mno-serialize-volatile
31764 When this option is enabled, GCC inserts @code{MEMW} instructions before
31765 @code{volatile} memory references to guarantee sequential consistency.
31766 The default is @option{-mserialize-volatile}.  Use
31767 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
31769 @item -mforce-no-pic
31770 @opindex mforce-no-pic
31771 For targets, like GNU/Linux, where all user-mode Xtensa code must be
31772 position-independent code (PIC), this option disables PIC for compiling
31773 kernel code.
31775 @item -mtext-section-literals
31776 @itemx -mno-text-section-literals
31777 @opindex mtext-section-literals
31778 @opindex mno-text-section-literals
31779 These options control the treatment of literal pools.  The default is
31780 @option{-mno-text-section-literals}, which places literals in a separate
31781 section in the output file.  This allows the literal pool to be placed
31782 in a data RAM/ROM, and it also allows the linker to combine literal
31783 pools from separate object files to remove redundant literals and
31784 improve code size.  With @option{-mtext-section-literals}, the literals
31785 are interspersed in the text section in order to keep them as close as
31786 possible to their references.  This may be necessary for large assembly
31787 files.  Literals for each function are placed right before that function.
31789 @item -mauto-litpools
31790 @itemx -mno-auto-litpools
31791 @opindex mauto-litpools
31792 @opindex mno-auto-litpools
31793 These options control the treatment of literal pools.  The default is
31794 @option{-mno-auto-litpools}, which places literals in a separate
31795 section in the output file unless @option{-mtext-section-literals} is
31796 used.  With @option{-mauto-litpools} the literals are interspersed in
31797 the text section by the assembler.  Compiler does not produce explicit
31798 @code{.literal} directives and loads literals into registers with
31799 @code{MOVI} instructions instead of @code{L32R} to let the assembler
31800 do relaxation and place literals as necessary.  This option allows
31801 assembler to create several literal pools per function and assemble
31802 very big functions, which may not be possible with
31803 @option{-mtext-section-literals}.
31805 @item -mtarget-align
31806 @itemx -mno-target-align
31807 @opindex mtarget-align
31808 @opindex mno-target-align
31809 When this option is enabled, GCC instructs the assembler to
31810 automatically align instructions to reduce branch penalties at the
31811 expense of some code density.  The assembler attempts to widen density
31812 instructions to align branch targets and the instructions following call
31813 instructions.  If there are not enough preceding safe density
31814 instructions to align a target, no widening is performed.  The
31815 default is @option{-mtarget-align}.  These options do not affect the
31816 treatment of auto-aligned instructions like @code{LOOP}, which the
31817 assembler always aligns, either by widening density instructions or
31818 by inserting NOP instructions.
31820 @item -mlongcalls
31821 @itemx -mno-longcalls
31822 @opindex mlongcalls
31823 @opindex mno-longcalls
31824 When this option is enabled, GCC instructs the assembler to translate
31825 direct calls to indirect calls unless it can determine that the target
31826 of a direct call is in the range allowed by the call instruction.  This
31827 translation typically occurs for calls to functions in other source
31828 files.  Specifically, the assembler translates a direct @code{CALL}
31829 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
31830 The default is @option{-mno-longcalls}.  This option should be used in
31831 programs where the call target can potentially be out of range.  This
31832 option is implemented in the assembler, not the compiler, so the
31833 assembly code generated by GCC still shows direct call
31834 instructions---look at the disassembled object code to see the actual
31835 instructions.  Note that the assembler uses an indirect call for
31836 every cross-file call, not just those that really are out of range.
31838 @item -mabi=@var{name}
31839 @opindex mabi
31840 Generate code for the specified ABI@.  Permissible values are: @samp{call0},
31841 @samp{windowed}.  Default ABI is chosen by the Xtensa core configuration.
31843 @item -mabi=call0
31844 @opindex mabi=call0
31845 When this option is enabled function parameters are passed in registers
31846 @code{a2} through @code{a7}, registers @code{a12} through @code{a15} are
31847 caller-saved, and register @code{a15} may be used as a frame pointer.
31848 When this version of the ABI is enabled the C preprocessor symbol
31849 @code{__XTENSA_CALL0_ABI__} is defined.
31851 @item -mabi=windowed
31852 @opindex mabi=windowed
31853 When this option is enabled function parameters are passed in registers
31854 @code{a10} through @code{a15}, and called function rotates register window
31855 by 8 registers on entry so that its arguments are found in registers
31856 @code{a2} through @code{a7}.  Register @code{a7} may be used as a frame
31857 pointer.  Register window is rotated 8 registers back upon return.
31858 When this version of the ABI is enabled the C preprocessor symbol
31859 @code{__XTENSA_WINDOWED_ABI__} is defined.
31860 @end table
31862 @node zSeries Options
31863 @subsection zSeries Options
31864 @cindex zSeries options
31866 These are listed under @xref{S/390 and zSeries Options}.
31869 @c man end
31871 @node Spec Files
31872 @section Specifying Subprocesses and the Switches to Pass to Them
31873 @cindex Spec Files
31875 @command{gcc} is a driver program.  It performs its job by invoking a
31876 sequence of other programs to do the work of compiling, assembling and
31877 linking.  GCC interprets its command-line parameters and uses these to
31878 deduce which programs it should invoke, and which command-line options
31879 it ought to place on their command lines.  This behavior is controlled
31880 by @dfn{spec strings}.  In most cases there is one spec string for each
31881 program that GCC can invoke, but a few programs have multiple spec
31882 strings to control their behavior.  The spec strings built into GCC can
31883 be overridden by using the @option{-specs=} command-line switch to specify
31884 a spec file.
31886 @dfn{Spec files} are plain-text files that are used to construct spec
31887 strings.  They consist of a sequence of directives separated by blank
31888 lines.  The type of directive is determined by the first non-whitespace
31889 character on the line, which can be one of the following:
31891 @table @code
31892 @item %@var{command}
31893 Issues a @var{command} to the spec file processor.  The commands that can
31894 appear here are:
31896 @table @code
31897 @item %include <@var{file}>
31898 @cindex @code{%include}
31899 Search for @var{file} and insert its text at the current point in the
31900 specs file.
31902 @item %include_noerr <@var{file}>
31903 @cindex @code{%include_noerr}
31904 Just like @samp{%include}, but do not generate an error message if the include
31905 file cannot be found.
31907 @item %rename @var{old_name} @var{new_name}
31908 @cindex @code{%rename}
31909 Rename the spec string @var{old_name} to @var{new_name}.
31911 @end table
31913 @item *[@var{spec_name}]:
31914 This tells the compiler to create, override or delete the named spec
31915 string.  All lines after this directive up to the next directive or
31916 blank line are considered to be the text for the spec string.  If this
31917 results in an empty string then the spec is deleted.  (Or, if the
31918 spec did not exist, then nothing happens.)  Otherwise, if the spec
31919 does not currently exist a new spec is created.  If the spec does
31920 exist then its contents are overridden by the text of this
31921 directive, unless the first character of that text is the @samp{+}
31922 character, in which case the text is appended to the spec.
31924 @item [@var{suffix}]:
31925 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
31926 and up to the next directive or blank line are considered to make up the
31927 spec string for the indicated suffix.  When the compiler encounters an
31928 input file with the named suffix, it processes the spec string in
31929 order to work out how to compile that file.  For example:
31931 @smallexample
31932 .ZZ:
31933 z-compile -input %i
31934 @end smallexample
31936 This says that any input file whose name ends in @samp{.ZZ} should be
31937 passed to the program @samp{z-compile}, which should be invoked with the
31938 command-line switch @option{-input} and with the result of performing the
31939 @samp{%i} substitution.  (See below.)
31941 As an alternative to providing a spec string, the text following a
31942 suffix directive can be one of the following:
31944 @table @code
31945 @item @@@var{language}
31946 This says that the suffix is an alias for a known @var{language}.  This is
31947 similar to using the @option{-x} command-line switch to GCC to specify a
31948 language explicitly.  For example:
31950 @smallexample
31951 .ZZ:
31952 @@c++
31953 @end smallexample
31955 Says that .ZZ files are, in fact, C++ source files.
31957 @item #@var{name}
31958 This causes an error messages saying:
31960 @smallexample
31961 @var{name} compiler not installed on this system.
31962 @end smallexample
31963 @end table
31965 GCC already has an extensive list of suffixes built into it.
31966 This directive adds an entry to the end of the list of suffixes, but
31967 since the list is searched from the end backwards, it is effectively
31968 possible to override earlier entries using this technique.
31970 @end table
31972 GCC has the following spec strings built into it.  Spec files can
31973 override these strings or create their own.  Note that individual
31974 targets can also add their own spec strings to this list.
31976 @smallexample
31977 asm          Options to pass to the assembler
31978 asm_final    Options to pass to the assembler post-processor
31979 cpp          Options to pass to the C preprocessor
31980 cc1          Options to pass to the C compiler
31981 cc1plus      Options to pass to the C++ compiler
31982 endfile      Object files to include at the end of the link
31983 link         Options to pass to the linker
31984 lib          Libraries to include on the command line to the linker
31985 libgcc       Decides which GCC support library to pass to the linker
31986 linker       Sets the name of the linker
31987 predefines   Defines to be passed to the C preprocessor
31988 signed_char  Defines to pass to CPP to say whether @code{char} is signed
31989              by default
31990 startfile    Object files to include at the start of the link
31991 @end smallexample
31993 Here is a small example of a spec file:
31995 @smallexample
31996 %rename lib                 old_lib
31998 *lib:
31999 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
32000 @end smallexample
32002 This example renames the spec called @samp{lib} to @samp{old_lib} and
32003 then overrides the previous definition of @samp{lib} with a new one.
32004 The new definition adds in some extra command-line options before
32005 including the text of the old definition.
32007 @dfn{Spec strings} are a list of command-line options to be passed to their
32008 corresponding program.  In addition, the spec strings can contain
32009 @samp{%}-prefixed sequences to substitute variable text or to
32010 conditionally insert text into the command line.  Using these constructs
32011 it is possible to generate quite complex command lines.
32013 Here is a table of all defined @samp{%}-sequences for spec
32014 strings.  Note that spaces are not generated automatically around the
32015 results of expanding these sequences.  Therefore you can concatenate them
32016 together or combine them with constant text in a single argument.
32018 @table @code
32019 @item %%
32020 Substitute one @samp{%} into the program name or argument.
32022 @item %"
32023 Substitute an empty argument.
32025 @item %i
32026 Substitute the name of the input file being processed.
32028 @item %b
32029 Substitute the basename for outputs related with the input file being
32030 processed.  This is often the substring up to (and not including) the
32031 last period and not including the directory but, unless %w is active, it
32032 expands to the basename for auxiliary outputs, which may be influenced
32033 by an explicit output name, and by various other options that control
32034 how auxiliary outputs are named.
32036 @item %B
32037 This is the same as @samp{%b}, but include the file suffix (text after
32038 the last period).  Without %w, it expands to the basename for dump
32039 outputs.
32041 @item %d
32042 Marks the argument containing or following the @samp{%d} as a
32043 temporary file name, so that that file is deleted if GCC exits
32044 successfully.  Unlike @samp{%g}, this contributes no text to the
32045 argument.
32047 @item %g@var{suffix}
32048 Substitute a file name that has suffix @var{suffix} and is chosen
32049 once per compilation, and mark the argument in the same way as
32050 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
32051 name is now chosen in a way that is hard to predict even when previously
32052 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
32053 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
32054 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
32055 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
32056 was simply substituted with a file name chosen once per compilation,
32057 without regard to any appended suffix (which was therefore treated
32058 just like ordinary text), making such attacks more likely to succeed.
32060 @item %u@var{suffix}
32061 Like @samp{%g}, but generates a new temporary file name
32062 each time it appears instead of once per compilation.
32064 @item %U@var{suffix}
32065 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
32066 new one if there is no such last file name.  In the absence of any
32067 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
32068 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
32069 involves the generation of two distinct file names, one
32070 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
32071 simply substituted with a file name chosen for the previous @samp{%u},
32072 without regard to any appended suffix.
32074 @item %j@var{suffix}
32075 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
32076 writable, and if @option{-save-temps} is not used; 
32077 otherwise, substitute the name
32078 of a temporary file, just like @samp{%u}.  This temporary file is not
32079 meant for communication between processes, but rather as a junk
32080 disposal mechanism.
32082 @item %|@var{suffix}
32083 @itemx %m@var{suffix}
32084 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
32085 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
32086 all.  These are the two most common ways to instruct a program that it
32087 should read from standard input or write to standard output.  If you
32088 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
32089 construct: see for example @file{gcc/fortran/lang-specs.h}.
32091 @item %.@var{SUFFIX}
32092 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
32093 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
32094 terminated by the next space or %.
32096 @item %w
32097 Marks the argument containing or following the @samp{%w} as the
32098 designated output file of this compilation.  This puts the argument
32099 into the sequence of arguments that @samp{%o} substitutes.
32101 @item %V
32102 Indicates that this compilation produces no output file.
32104 @item %o
32105 Substitutes the names of all the output files, with spaces
32106 automatically placed around them.  You should write spaces
32107 around the @samp{%o} as well or the results are undefined.
32108 @samp{%o} is for use in the specs for running the linker.
32109 Input files whose names have no recognized suffix are not compiled
32110 at all, but they are included among the output files, so they are
32111 linked.
32113 @item %O
32114 Substitutes the suffix for object files.  Note that this is
32115 handled specially when it immediately follows @samp{%g, %u, or %U},
32116 because of the need for those to form complete file names.  The
32117 handling is such that @samp{%O} is treated exactly as if it had already
32118 been substituted, except that @samp{%g, %u, and %U} do not currently
32119 support additional @var{suffix} characters following @samp{%O} as they do
32120 following, for example, @samp{.o}.
32122 @item %I
32123 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
32124 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
32125 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
32126 and @option{-imultilib} as necessary.
32128 @item %s
32129 Current argument is the name of a library or startup file of some sort.
32130 Search for that file in a standard list of directories and substitute
32131 the full name found.  The current working directory is included in the
32132 list of directories scanned.
32134 @item %T
32135 Current argument is the name of a linker script.  Search for that file
32136 in the current list of directories to scan for libraries. If the file
32137 is located insert a @option{--script} option into the command line
32138 followed by the full path name found.  If the file is not found then
32139 generate an error message.  Note: the current working directory is not
32140 searched.
32142 @item %e@var{str}
32143 Print @var{str} as an error message.  @var{str} is terminated by a newline.
32144 Use this when inconsistent options are detected.
32146 @item %n@var{str}
32147 Print @var{str} as a notice.  @var{str} is terminated by a newline.
32149 @item %(@var{name})
32150 Substitute the contents of spec string @var{name} at this point.
32152 @item %x@{@var{option}@}
32153 Accumulate an option for @samp{%X}.
32155 @item %X
32156 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
32157 spec string.
32159 @item %Y
32160 Output the accumulated assembler options specified by @option{-Wa}.
32162 @item %Z
32163 Output the accumulated preprocessor options specified by @option{-Wp}.
32165 @item %M
32166 Output @code{multilib_os_dir}.
32168 @item %R
32169 Output the concatenation of @code{target_system_root} and @code{target_sysroot_suffix}.
32171 @item %a
32172 Process the @code{asm} spec.  This is used to compute the
32173 switches to be passed to the assembler.
32175 @item %A
32176 Process the @code{asm_final} spec.  This is a spec string for
32177 passing switches to an assembler post-processor, if such a program is
32178 needed.
32180 @item %l
32181 Process the @code{link} spec.  This is the spec for computing the
32182 command line passed to the linker.  Typically it makes use of the
32183 @samp{%L %G %S %D and %E} sequences.
32185 @item %D
32186 Dump out a @option{-L} option for each directory that GCC believes might
32187 contain startup files.  If the target supports multilibs then the
32188 current multilib directory is prepended to each of these paths.
32190 @item %L
32191 Process the @code{lib} spec.  This is a spec string for deciding which
32192 libraries are included on the command line to the linker.
32194 @item %G
32195 Process the @code{libgcc} spec.  This is a spec string for deciding
32196 which GCC support library is included on the command line to the linker.
32198 @item %S
32199 Process the @code{startfile} spec.  This is a spec for deciding which
32200 object files are the first ones passed to the linker.  Typically
32201 this might be a file named @file{crt0.o}.
32203 @item %E
32204 Process the @code{endfile} spec.  This is a spec string that specifies
32205 the last object files that are passed to the linker.
32207 @item %C
32208 Process the @code{cpp} spec.  This is used to construct the arguments
32209 to be passed to the C preprocessor.
32211 @item %1
32212 Process the @code{cc1} spec.  This is used to construct the options to be
32213 passed to the actual C compiler (@command{cc1}).
32215 @item %2
32216 Process the @code{cc1plus} spec.  This is used to construct the options to be
32217 passed to the actual C++ compiler (@command{cc1plus}).
32219 @item %*
32220 Substitute the variable part of a matched option.  See below.
32221 Note that each comma in the substituted string is replaced by
32222 a single space.
32224 @item %<S
32225 Remove all occurrences of @code{-S} from the command line.  Note---this
32226 command is position dependent.  @samp{%} commands in the spec string
32227 before this one see @code{-S}, @samp{%} commands in the spec string
32228 after this one do not.
32230 @item %<S*
32231 Similar to @samp{%<S}, but match all switches beginning with @code{-S}.
32233 @item %>S
32234 Similar to @samp{%<S}, but keep @code{-S} in the GCC command line.
32236 @item %:@var{function}(@var{args})
32237 Call the named function @var{function}, passing it @var{args}.
32238 @var{args} is first processed as a nested spec string, then split
32239 into an argument vector in the usual fashion.  The function returns
32240 a string which is processed as if it had appeared literally as part
32241 of the current spec.
32243 The following built-in spec functions are provided:
32245 @table @code
32246 @item @code{getenv}
32247 The @code{getenv} spec function takes two arguments: an environment
32248 variable name and a string.  If the environment variable is not
32249 defined, a fatal error is issued.  Otherwise, the return value is the
32250 value of the environment variable concatenated with the string.  For
32251 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
32253 @smallexample
32254 %:getenv(TOPDIR /include)
32255 @end smallexample
32257 expands to @file{/path/to/top/include}.
32259 @item @code{if-exists}
32260 The @code{if-exists} spec function takes one argument, an absolute
32261 pathname to a file.  If the file exists, @code{if-exists} returns the
32262 pathname.  Here is a small example of its usage:
32264 @smallexample
32265 *startfile:
32266 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
32267 @end smallexample
32269 @item @code{if-exists-else}
32270 The @code{if-exists-else} spec function is similar to the @code{if-exists}
32271 spec function, except that it takes two arguments.  The first argument is
32272 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
32273 returns the pathname.  If it does not exist, it returns the second argument.
32274 This way, @code{if-exists-else} can be used to select one file or another,
32275 based on the existence of the first.  Here is a small example of its usage:
32277 @smallexample
32278 *startfile:
32279 crt0%O%s %:if-exists(crti%O%s) \
32280 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
32281 @end smallexample
32283 @item @code{if-exists-then-else}
32284 The @code{if-exists-then-else} spec function takes at least two arguments
32285 and an optional third one. The first argument is an absolute pathname to a
32286 file.  If the file exists, the function returns the second argument.
32287 If the file does not exist, the function returns the third argument if there
32288 is one, or NULL otherwise. This can be used to expand one text, or optionally
32289 another, based on the existence of a file.  Here is a small example of its
32290 usage:
32292 @smallexample
32293 -l%:if-exists-then-else(%:getenv(VSB_DIR rtnet.h) rtnet net)
32294 @end smallexample
32296 @item @code{sanitize}
32297 The @code{sanitize} spec function takes no arguments.  It returns non-NULL if
32298 any address, thread or undefined behavior sanitizers are active.
32300 @smallexample
32301 %@{%:sanitize(address):-funwind-tables@}
32302 @end smallexample
32304 @item @code{replace-outfile}
32305 The @code{replace-outfile} spec function takes two arguments.  It looks for the
32306 first argument in the outfiles array and replaces it with the second argument.  Here
32307 is a small example of its usage:
32309 @smallexample
32310 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
32311 @end smallexample
32313 @item @code{remove-outfile}
32314 The @code{remove-outfile} spec function takes one argument.  It looks for the
32315 first argument in the outfiles array and removes it.  Here is a small example
32316 its usage:
32318 @smallexample
32319 %:remove-outfile(-lm)
32320 @end smallexample
32322 @item @code{version-compare}
32323 The @code{version-compare} spec function takes four or five arguments of the following
32324 form:
32326 @smallexample
32327 <comparison-op> <arg1> [<arg2>] <switch> <result>
32328 @end smallexample
32330 It returns @code{result} if the comparison evaluates to true, and NULL if it doesn't.
32331 The supported @code{comparison-op} values are:
32333 @table @code
32334 @item >=
32335 True if @code{switch} is a later (or same) version than @code{arg1}
32337 @item !>
32338 Opposite of @code{>=}
32340 @item <
32341 True if @code{switch} is an earlier version than @code{arg1}
32343 @item !<
32344 Opposite of @code{<}
32346 @item ><
32347 True if @code{switch} is @code{arg1} or later, and earlier than @code{arg2}
32349 @item <>
32350 True if @code{switch} is earlier than @code{arg1}, or is @code{arg2} or later
32351 @end table
32353 If the @code{switch} is not present at all, the condition is false unless the first character
32354 of the @code{comparison-op} is @code{!}.
32356 @smallexample
32357 %:version-compare(>= 10.3 mmacosx-version-min= -lmx)
32358 @end smallexample
32360 The above example would add @option{-lmx} if @option{-mmacosx-version-min=10.3.9} was
32361 passed.
32363 @item @code{include}
32364 The @code{include} spec function behaves much like @code{%include}, with the advantage
32365 that it can be nested inside a spec and thus be conditionalized.  It takes one argument,
32366 the filename, and looks for it in the startfile path.  It always returns NULL.
32368 @smallexample
32369 %@{static-libasan|static:%:include(libsanitizer.spec)%(link_libasan)@}
32370 @end smallexample
32372 @item @code{pass-through-libs}
32373 The @code{pass-through-libs} spec function takes any number of arguments.  It
32374 finds any @option{-l} options and any non-options ending in @file{.a} (which it
32375 assumes are the names of linker input library archive files) and returns a
32376 result containing all the found arguments each prepended by
32377 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
32378 intended to be passed to the LTO linker plugin.
32380 @smallexample
32381 %:pass-through-libs(%G %L %G)
32382 @end smallexample
32384 @item @code{print-asm-header}
32385 The @code{print-asm-header} function takes no arguments and simply
32386 prints a banner like:
32388 @smallexample
32389 Assembler options
32390 =================
32392 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
32393 @end smallexample
32395 It is used to separate compiler options from assembler options
32396 in the @option{--target-help} output.
32398 @item @code{gt}
32399 The @code{gt} spec function takes two or more arguments.  It returns @code{""} (the
32400 empty string) if the second-to-last argument is greater than the last argument, and NULL
32401 otherwise.  The following example inserts the @code{link_gomp} spec if the last
32402 @option{-ftree-parallelize-loops=} option given on the command line is greater than 1:
32404 @smallexample
32405 %@{%:gt(%@{ftree-parallelize-loops=*:%*@} 1):%:include(libgomp.spec)%(link_gomp)@}
32406 @end smallexample
32408 @item @code{debug-level-gt}
32409 The @code{debug-level-gt} spec function takes one argument and returns @code{""} (the
32410 empty string) if @code{debug_info_level} is greater than the specified number, and NULL
32411 otherwise.
32413 @smallexample
32414 %@{%:debug-level-gt(0):%@{gdwarf*:--gdwarf2@}@}
32415 @end smallexample
32416 @end table
32418 @item %@{S@}
32419 Substitutes the @code{-S} switch, if that switch is given to GCC@.
32420 If that switch is not specified, this substitutes nothing.  Note that
32421 the leading dash is omitted when specifying this option, and it is
32422 automatically inserted if the substitution is performed.  Thus the spec
32423 string @samp{%@{foo@}} matches the command-line option @option{-foo}
32424 and outputs the command-line option @option{-foo}.
32426 @item %W@{S@}
32427 Like %@{@code{S}@} but mark last argument supplied within as a file to be
32428 deleted on failure.
32430 @item %@@@{S@}
32431 Like %@{@code{S}@} but puts the result into a @code{FILE} and substitutes
32432 @code{@@FILE} if an @code{@@file} argument has been supplied.
32434 @item %@{S*@}
32435 Substitutes all the switches specified to GCC whose names start
32436 with @code{-S}, but which also take an argument.  This is used for
32437 switches like @option{-o}, @option{-D}, @option{-I}, etc.
32438 GCC considers @option{-o foo} as being
32439 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
32440 text, including the space.  Thus two arguments are generated.
32442 @item %@{S*&T*@}
32443 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
32444 (the order of @code{S} and @code{T} in the spec is not significant).
32445 There can be any number of ampersand-separated variables; for each the
32446 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
32448 @item %@{S:X@}
32449 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
32451 @item %@{!S:X@}
32452 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
32454 @item %@{S*:X@}
32455 Substitutes @code{X} if one or more switches whose names start with
32456 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
32457 once, no matter how many such switches appeared.  However, if @code{%*}
32458 appears somewhere in @code{X}, then @code{X} is substituted once
32459 for each matching switch, with the @code{%*} replaced by the part of
32460 that switch matching the @code{*}.
32462 If @code{%*} appears as the last part of a spec sequence then a space
32463 is added after the end of the last substitution.  If there is more
32464 text in the sequence, however, then a space is not generated.  This
32465 allows the @code{%*} substitution to be used as part of a larger
32466 string.  For example, a spec string like this:
32468 @smallexample
32469 %@{mcu=*:--script=%*/memory.ld@}
32470 @end smallexample
32472 @noindent
32473 when matching an option like @option{-mcu=newchip} produces:
32475 @smallexample
32476 --script=newchip/memory.ld
32477 @end smallexample
32479 @item %@{.S:X@}
32480 Substitutes @code{X}, if processing a file with suffix @code{S}.
32482 @item %@{!.S:X@}
32483 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
32485 @item %@{,S:X@}
32486 Substitutes @code{X}, if processing a file for language @code{S}.
32488 @item %@{!,S:X@}
32489 Substitutes @code{X}, if not processing a file for language @code{S}.
32491 @item %@{S|P:X@}
32492 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
32493 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
32494 @code{*} sequences as well, although they have a stronger binding than
32495 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
32496 alternatives must be starred, and only the first matching alternative
32497 is substituted.
32499 For example, a spec string like this:
32501 @smallexample
32502 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
32503 @end smallexample
32505 @noindent
32506 outputs the following command-line options from the following input
32507 command-line options:
32509 @smallexample
32510 fred.c        -foo -baz
32511 jim.d         -bar -boggle
32512 -d fred.c     -foo -baz -boggle
32513 -d jim.d      -bar -baz -boggle
32514 @end smallexample
32516 @item %@{%:@var{function}(@var{args}):X@}
32518 Call function named @var{function} with args @var{args}.  If the
32519 function returns non-NULL, then @code{X} is substituted, if it returns
32520 NULL, it isn't substituted.
32522 @item %@{S:X; T:Y; :D@}
32524 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
32525 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
32526 be as many clauses as you need.  This may be combined with @code{.},
32527 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
32530 @end table
32532 The switch matching text @code{S} in a @samp{%@{S@}}, @samp{%@{S:X@}}
32533 or similar construct can use a backslash to ignore the special meaning
32534 of the character following it, thus allowing literal matching of a
32535 character that is otherwise specially treated.  For example,
32536 @samp{%@{std=iso9899\:1999:X@}} substitutes @code{X} if the
32537 @option{-std=iso9899:1999} option is given.
32539 The conditional text @code{X} in a @samp{%@{S:X@}} or similar
32540 construct may contain other nested @samp{%} constructs or spaces, or
32541 even newlines.  They are processed as usual, as described above.
32542 Trailing white space in @code{X} is ignored.  White space may also
32543 appear anywhere on the left side of the colon in these constructs,
32544 except between @code{.} or @code{*} and the corresponding word.
32546 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
32547 handled specifically in these constructs.  If another value of
32548 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
32549 @option{-W} switch is found later in the command line, the earlier
32550 switch value is ignored, except with @{@code{S}*@} where @code{S} is
32551 just one letter, which passes all matching options.
32553 The character @samp{|} at the beginning of the predicate text is used to
32554 indicate that a command should be piped to the following command, but
32555 only if @option{-pipe} is specified.
32557 It is built into GCC which switches take arguments and which do not.
32558 (You might think it would be useful to generalize this to allow each
32559 compiler's spec to say which switches take arguments.  But this cannot
32560 be done in a consistent fashion.  GCC cannot even decide which input
32561 files have been specified without knowing which switches take arguments,
32562 and it must know which input files to compile in order to tell which
32563 compilers to run).
32565 GCC also knows implicitly that arguments starting in @option{-l} are to be
32566 treated as compiler output files, and passed to the linker in their
32567 proper position among the other output files.
32569 @node Environment Variables
32570 @section Environment Variables Affecting GCC
32571 @cindex environment variables
32573 @c man begin ENVIRONMENT
32574 This section describes several environment variables that affect how GCC
32575 operates.  Some of them work by specifying directories or prefixes to use
32576 when searching for various kinds of files.  Some are used to specify other
32577 aspects of the compilation environment.
32579 Note that you can also specify places to search using options such as
32580 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
32581 take precedence over places specified using environment variables, which
32582 in turn take precedence over those specified by the configuration of GCC@.
32583 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
32584 GNU Compiler Collection (GCC) Internals}.
32586 @table @env
32587 @item LANG
32588 @itemx LC_CTYPE
32589 @c @itemx LC_COLLATE
32590 @itemx LC_MESSAGES
32591 @c @itemx LC_MONETARY
32592 @c @itemx LC_NUMERIC
32593 @c @itemx LC_TIME
32594 @itemx LC_ALL
32595 @findex LANG
32596 @findex LC_CTYPE
32597 @c @findex LC_COLLATE
32598 @findex LC_MESSAGES
32599 @c @findex LC_MONETARY
32600 @c @findex LC_NUMERIC
32601 @c @findex LC_TIME
32602 @findex LC_ALL
32603 @cindex locale
32604 These environment variables control the way that GCC uses
32605 localization information which allows GCC to work with different
32606 national conventions.  GCC inspects the locale categories
32607 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
32608 so.  These locale categories can be set to any value supported by your
32609 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
32610 Kingdom encoded in UTF-8.
32612 The @env{LC_CTYPE} environment variable specifies character
32613 classification.  GCC uses it to determine the character boundaries in
32614 a string; this is needed for some multibyte encodings that contain quote
32615 and escape characters that are otherwise interpreted as a string
32616 end or escape.
32618 The @env{LC_MESSAGES} environment variable specifies the language to
32619 use in diagnostic messages.
32621 If the @env{LC_ALL} environment variable is set, it overrides the value
32622 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
32623 and @env{LC_MESSAGES} default to the value of the @env{LANG}
32624 environment variable.  If none of these variables are set, GCC
32625 defaults to traditional C English behavior.
32627 @item TMPDIR
32628 @findex TMPDIR
32629 If @env{TMPDIR} is set, it specifies the directory to use for temporary
32630 files.  GCC uses temporary files to hold the output of one stage of
32631 compilation which is to be used as input to the next stage: for example,
32632 the output of the preprocessor, which is the input to the compiler
32633 proper.
32635 @item GCC_COMPARE_DEBUG
32636 @findex GCC_COMPARE_DEBUG
32637 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
32638 @option{-fcompare-debug} to the compiler driver.  See the documentation
32639 of this option for more details.
32641 @item GCC_EXEC_PREFIX
32642 @findex GCC_EXEC_PREFIX
32643 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
32644 names of the subprograms executed by the compiler.  No slash is added
32645 when this prefix is combined with the name of a subprogram, but you can
32646 specify a prefix that ends with a slash if you wish.
32648 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
32649 an appropriate prefix to use based on the pathname it is invoked with.
32651 If GCC cannot find the subprogram using the specified prefix, it
32652 tries looking in the usual places for the subprogram.
32654 The default value of @env{GCC_EXEC_PREFIX} is
32655 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
32656 the installed compiler. In many cases @var{prefix} is the value
32657 of @code{prefix} when you ran the @file{configure} script.
32659 Other prefixes specified with @option{-B} take precedence over this prefix.
32661 This prefix is also used for finding files such as @file{crt0.o} that are
32662 used for linking.
32664 In addition, the prefix is used in an unusual way in finding the
32665 directories to search for header files.  For each of the standard
32666 directories whose name normally begins with @samp{/usr/local/lib/gcc}
32667 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
32668 replacing that beginning with the specified prefix to produce an
32669 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
32670 @file{foo/bar} just before it searches the standard directory 
32671 @file{/usr/local/lib/bar}.
32672 If a standard directory begins with the configured
32673 @var{prefix} then the value of @var{prefix} is replaced by
32674 @env{GCC_EXEC_PREFIX} when looking for header files.
32676 @item COMPILER_PATH
32677 @findex COMPILER_PATH
32678 The value of @env{COMPILER_PATH} is a colon-separated list of
32679 directories, much like @env{PATH}.  GCC tries the directories thus
32680 specified when searching for subprograms, if it cannot find the
32681 subprograms using @env{GCC_EXEC_PREFIX}.
32683 @item LIBRARY_PATH
32684 @findex LIBRARY_PATH
32685 The value of @env{LIBRARY_PATH} is a colon-separated list of
32686 directories, much like @env{PATH}.  When configured as a native compiler,
32687 GCC tries the directories thus specified when searching for special
32688 linker files, if it cannot find them using @env{GCC_EXEC_PREFIX}.  Linking
32689 using GCC also uses these directories when searching for ordinary
32690 libraries for the @option{-l} option (but directories specified with
32691 @option{-L} come first).
32693 @item LANG
32694 @findex LANG
32695 @cindex locale definition
32696 This variable is used to pass locale information to the compiler.  One way in
32697 which this information is used is to determine the character set to be used
32698 when character literals, string literals and comments are parsed in C and C++.
32699 When the compiler is configured to allow multibyte characters,
32700 the following values for @env{LANG} are recognized:
32702 @table @samp
32703 @item C-JIS
32704 Recognize JIS characters.
32705 @item C-SJIS
32706 Recognize SJIS characters.
32707 @item C-EUCJP
32708 Recognize EUCJP characters.
32709 @end table
32711 If @env{LANG} is not defined, or if it has some other value, then the
32712 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
32713 recognize and translate multibyte characters.
32715 @item GCC_EXTRA_DIAGNOSTIC_OUTPUT
32716 If @env{GCC_EXTRA_DIAGNOSTIC_OUTPUT} is set to one of the following values,
32717 then additional text will be emitted to stderr when fix-it hints are
32718 emitted.  @option{-fdiagnostics-parseable-fixits} and
32719 @option{-fno-diagnostics-parseable-fixits} take precedence over this
32720 environment variable.
32722 @table @samp
32723 @item fixits-v1
32724 Emit parseable fix-it hints, equivalent to
32725 @option{-fdiagnostics-parseable-fixits}.  In particular, columns are
32726 expressed as a count of bytes, starting at byte 1 for the initial column.
32728 @item fixits-v2
32729 As @code{fixits-v1}, but columns are expressed as display columns,
32730 as per @option{-fdiagnostics-column-unit=display}.
32731 @end table
32733 @end table
32735 @noindent
32736 Some additional environment variables affect the behavior of the
32737 preprocessor.
32739 @include cppenv.texi
32741 @c man end
32743 @node Precompiled Headers
32744 @section Using Precompiled Headers
32745 @cindex precompiled headers
32746 @cindex speed of compilation
32748 Often large projects have many header files that are included in every
32749 source file.  The time the compiler takes to process these header files
32750 over and over again can account for nearly all of the time required to
32751 build the project.  To make builds faster, GCC allows you to
32752 @dfn{precompile} a header file.
32754 To create a precompiled header file, simply compile it as you would any
32755 other file, if necessary using the @option{-x} option to make the driver
32756 treat it as a C or C++ header file.  You may want to use a
32757 tool like @command{make} to keep the precompiled header up-to-date when
32758 the headers it contains change.
32760 A precompiled header file is searched for when @code{#include} is
32761 seen in the compilation.  As it searches for the included file
32762 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
32763 compiler looks for a precompiled header in each directory just before it
32764 looks for the include file in that directory.  The name searched for is
32765 the name specified in the @code{#include} with @samp{.gch} appended.  If
32766 the precompiled header file cannot be used, it is ignored.
32768 For instance, if you have @code{#include "all.h"}, and you have
32769 @file{all.h.gch} in the same directory as @file{all.h}, then the
32770 precompiled header file is used if possible, and the original
32771 header is used otherwise.
32773 Alternatively, you might decide to put the precompiled header file in a
32774 directory and use @option{-I} to ensure that directory is searched
32775 before (or instead of) the directory containing the original header.
32776 Then, if you want to check that the precompiled header file is always
32777 used, you can put a file of the same name as the original header in this
32778 directory containing an @code{#error} command.
32780 This also works with @option{-include}.  So yet another way to use
32781 precompiled headers, good for projects not designed with precompiled
32782 header files in mind, is to simply take most of the header files used by
32783 a project, include them from another header file, precompile that header
32784 file, and @option{-include} the precompiled header.  If the header files
32785 have guards against multiple inclusion, they are skipped because
32786 they've already been included (in the precompiled header).
32788 If you need to precompile the same header file for different
32789 languages, targets, or compiler options, you can instead make a
32790 @emph{directory} named like @file{all.h.gch}, and put each precompiled
32791 header in the directory, perhaps using @option{-o}.  It doesn't matter
32792 what you call the files in the directory; every precompiled header in
32793 the directory is considered.  The first precompiled header
32794 encountered in the directory that is valid for this compilation is
32795 used; they're searched in no particular order.
32797 There are many other possibilities, limited only by your imagination,
32798 good sense, and the constraints of your build system.
32800 A precompiled header file can be used only when these conditions apply:
32802 @itemize
32803 @item
32804 Only one precompiled header can be used in a particular compilation.
32806 @item
32807 A precompiled header cannot be used once the first C token is seen.  You
32808 can have preprocessor directives before a precompiled header; you cannot
32809 include a precompiled header from inside another header.
32811 @item
32812 The precompiled header file must be produced for the same language as
32813 the current compilation.  You cannot use a C precompiled header for a C++
32814 compilation.
32816 @item
32817 The precompiled header file must have been produced by the same compiler
32818 binary as the current compilation is using.
32820 @item
32821 Any macros defined before the precompiled header is included must
32822 either be defined in the same way as when the precompiled header was
32823 generated, or must not affect the precompiled header, which usually
32824 means that they don't appear in the precompiled header at all.
32826 The @option{-D} option is one way to define a macro before a
32827 precompiled header is included; using a @code{#define} can also do it.
32828 There are also some options that define macros implicitly, like
32829 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
32830 defined this way.
32832 @item If debugging information is output when using the precompiled
32833 header, using @option{-g} or similar, the same kind of debugging information
32834 must have been output when building the precompiled header.  However,
32835 a precompiled header built using @option{-g} can be used in a compilation
32836 when no debugging information is being output.
32838 @item The same @option{-m} options must generally be used when building
32839 and using the precompiled header.  @xref{Submodel Options},
32840 for any cases where this rule is relaxed.
32842 @item Each of the following options must be the same when building and using
32843 the precompiled header:
32845 @gccoptlist{-fexceptions}
32847 @item
32848 Some other command-line options starting with @option{-f},
32849 @option{-p}, or @option{-O} must be defined in the same way as when
32850 the precompiled header was generated.  At present, it's not clear
32851 which options are safe to change and which are not; the safest choice
32852 is to use exactly the same options when generating and using the
32853 precompiled header.  The following are known to be safe:
32855 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
32856 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
32857 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
32858 -pedantic-errors}
32860 @item Address space layout randomization (ASLR) can lead to not binary identical
32861 PCH files.  If you rely on stable PCH file contents disable ASLR when generating
32862 PCH files.
32864 @end itemize
32866 For all of these except the last, the compiler automatically
32867 ignores the precompiled header if the conditions aren't met.  If you
32868 find an option combination that doesn't work and doesn't cause the
32869 precompiled header to be ignored, please consider filing a bug report,
32870 see @ref{Bugs}.
32872 If you do use differing options when generating and using the
32873 precompiled header, the actual behavior is a mixture of the
32874 behavior for the options.  For instance, if you use @option{-g} to
32875 generate the precompiled header but not when using it, you may or may
32876 not get debugging information for routines in the precompiled header.
32878 @node C++ Modules
32879 @section C++ Modules
32880 @cindex speed of compilation
32882 Modules are a C++20 language feature.  As the name suggests, they
32883 provides a modular compilation system, intending to provide both
32884 faster builds and better library isolation.  The ``Merging Modules''
32885 paper @uref{https://wg21.link/p1103}, provides the easiest to read set
32886 of changes to the standard, although it does not capture later
32887 changes.  That specification is now part of C++20,
32888 @uref{git@@github.com:cplusplus/draft.git}, it is considered complete
32889 (there may be defect reports to come).
32891 @emph{G++'s modules support is not complete.}  Other than bugs, the
32892 known missing pieces are:
32894 @table @emph
32896 @item Private Module Fragment
32897 The Private Module Fragment is recognized, but an error is emitted.
32899 @item Partition definition visibility rules
32900 Entities may be defined in implementation partitions, and those
32901 definitions are not available outside of the module.  This is not
32902 implemented, and the definitions are available to extra-module use.
32904 @item Textual merging of reachable GM entities
32905 Entities may be multiply defined across different header-units.
32906 These must be de-duplicated, and this is implemented across imports,
32907 or when an import redefines a textually-defined entity.  However the
32908 reverse is not implemented---textually redefining an entity that has
32909 been defined in an imported header-unit.  A redefinition error is
32910 emitted.
32912 @item Translation-Unit local referencing rules
32913 Papers p1815 (@uref{https://wg21.link/p1815}) and p2003
32914 (@uref{https://wg21.link/p2003}) add limitations on which entities an
32915 exported region may reference (for instance, the entities an exported
32916 template definition may reference).  These are not fully implemented.
32918 @item Language-linkage module attachment
32919 Declarations with explicit language linkage (@code{extern "C"} or
32920 @code{extern "C++"}) are attached to the global module, even when in
32921 the purview of a named module.  This is not implemented.  Such
32922 declarations will be attached to the module, if any, in which they are
32923 declared.
32925 @item Standard Library Header Units
32926 The Standard Library is not provided as importable header units.  If
32927 you want to import such units, you must explicitly build them first.
32928 If you do not do this with care, you may have multiple declarations,
32929 which the module machinery must merge---compiler resource usage can be
32930 affected by how you partition header files into header units.
32932 @end table
32934 Modular compilation is @emph{not} enabled with just the
32935 @option{-std=c++20} option.  You must explicitly enable it with the
32936 @option{-fmodules-ts} option.  It is independent of the language
32937 version selected, although in pre-C++20 versions, it is of course an
32938 extension.
32940 No new source file suffixes are required or supported.  If you wish to
32941 use a non-standard suffix (@xref{Overall Options}), you also need
32942 to provide a @option{-x c++} option too.@footnote{Some users like to
32943 distinguish module interface files with a new suffix, such as naming
32944 the source @code{module.cppm}, which involves
32945 teaching all tools about the new suffix.  A different scheme, such as
32946 naming @code{module-m.cpp} would be less invasive.}
32948 Compiling a module interface unit produces an additional output (to
32949 the assembly or object file), called a Compiled Module Interface
32950 (CMI).  This encodes the exported declarations of the module.
32951 Importing a module reads in the CMI.  The import graph is a Directed
32952 Acyclic Graph (DAG).  You must build imports before the importer.
32954 Header files may themselves be compiled to header units, which are a
32955 transitional ability aiming at faster compilation.  The
32956 @option{-fmodule-header} option is used to enable this, and implies
32957 the @option{-fmodules-ts} option.  These CMIs are named by the fully
32958 resolved underlying header file, and thus may be a complete pathname
32959 containing subdirectories.  If the header file is found at an absolute
32960 pathname, the CMI location is still relative to a CMI root directory.
32962 As header files often have no suffix, you commonly have to specify a
32963 @option{-x} option to tell the compiler the source is a header file.
32964 You may use @option{-x c++-header}, @option{-x c++-user-header} or
32965 @option{-x c++-system-header}.  When used in conjunction with
32966 @option{-fmodules-ts}, these all imply an appropriate
32967 @option{-fmodule-header} option.  The latter two variants use the
32968 user or system include path to search for the file specified.  This
32969 allows you to, for instance, compile standard library header files as
32970 header units, without needing to know exactly where they are
32971 installed.  Specifying the language as one of these variants also
32972 inhibits output of the object file, as header files have no associated
32973 object file.
32975 The @option{-fmodule-only} option disables generation of the
32976 associated object file for compiling a module interface.  Only the CMI
32977 is generated.  This option is implied when using the
32978 @option{-fmodule-header} option.
32980 The @option{-flang-info-include-translate} and
32981 @option{-flang-info-include-translate-not} options notes whether
32982 include translation occurs or not.  With no argument, the first will
32983 note all include translation.  The second will note all
32984 non-translations of include files not known to intentionally be
32985 textual.  With an argument, queries about include translation of a
32986 header files with that particular trailing pathname are noted.  You
32987 may repeat this form to cover several different header files.  This
32988 option may be helpful in determining whether include translation is
32989 happening---if it is working correctly, it'll behave as if it wasn't
32990 there at all.
32992 The @option{-Winvalid-imported-macros} option causes all imported macros
32993 to be resolved at the end of compilation.  Without this, imported
32994 macros are only resolved when expanded or (re)defined.  This option
32995 detects conflicting import definitions for all macros.
32997 @xref{C++ Module Mapper} for details of the @option{-fmodule-mapper}
32998 family of options.
33000 @menu
33001 * C++ Module Mapper::       Module Mapper
33002 * C++ Module Preprocessing::  Module Preprocessing
33003 * C++ Compiled Module Interface:: Compiled Module Interface
33004 @end menu
33006 @node C++ Module Mapper
33007 @subsection Module Mapper
33008 @cindex C++ Module Mapper
33010 A module mapper provides a server or file that the compiler queries to
33011 determine the mapping between module names and CMI files.  It is also
33012 used to build CMIs on demand.  @emph{Mapper functionality is in its
33013 infancy and is intended for experimentation with build system
33014 interactions.}
33016 You can specify a mapper with the @option{-fmodule-mapper=@var{val}}
33017 option or @env{CXX_MODULE_MAPPER} environment variable.  The value may
33018 have one of the following forms:
33020 @table @gcctabopt
33022 @item @r{[}@var{hostname}@r{]}:@var{port}@r{[}?@var{ident}@r{]}
33023 An optional hostname and a numeric port number to connect to.  If the
33024 hostname is omitted, the loopback address is used.  If the hostname
33025 corresponds to multiple IPV6 addresses, these are tried in turn, until
33026 one is successful.  If your host lacks IPv6, this form is
33027 non-functional.  If you must use IPv4 use
33028 @option{-fmodule-mapper='|ncat @var{ipv4host} @var{port}'}.
33030 @item =@var{socket}@r{[}?@var{ident}@r{]}
33031 A local domain socket.  If your host lacks local domain sockets, this
33032 form is non-functional.
33034 @item |@var{program}@r{[}?@var{ident}@r{]} @r{[}@var{args...}@r{]}
33035 A program to spawn, and communicate with on its stdin/stdout streams.
33036 Your @var{PATH} environment variable is searched for the program.
33037 Arguments are separated by space characters, (it is not possible for
33038 one of the arguments delivered to the program to contain a space).  An
33039 exception is if @var{program} begins with @@.  In that case
33040 @var{program} (sans @@) is looked for in the compiler's internal
33041 binary directory.  Thus the sample mapper-server can be specified
33042 with @code{@@g++-mapper-server}.
33044 @item <>@r{[}?@var{ident}@r{]}
33045 @item <>@var{inout}@r{[}?@var{ident}@r{]}
33046 @item <@var{in}>@var{out}@r{[}?@var{ident}@r{]}
33047 Named pipes or file descriptors to communicate over.  The first form,
33048 @option{<>}, communicates over stdin and stdout.  The other forms
33049 allow you to specify a file descriptor or name a pipe.  A numeric value
33050 is interpreted as a file descriptor, otherwise named pipe is opened.
33051 The second form specifies a bidirectional pipe and the last form
33052 allows specifying two independent pipes.  Using file descriptors
33053 directly in this manner is fragile in general, as it can require the
33054 cooperation of intermediate processes.  In particular using stdin &
33055 stdout is fraught with danger as other compiler options might also
33056 cause the compiler to read stdin or write stdout, and it can have
33057 unfortunate interactions with signal delivery from the terminal.
33059 @item @var{file}@r{[}?@var{ident}@r{]}
33060 A mapping file consisting of space-separated module-name, filename
33061 pairs, one per line.  Only the mappings for the direct imports and any
33062 module export name need be provided.  If other mappings are provided,
33063 they override those stored in any imported CMI files.  A repository
33064 root may be specified in the mapping file by using @samp{$root} as the
33065 module name in the first active line.
33067 @end table
33069 As shown, an optional @var{ident} may suffix the first word of the
33070 option, indicated by a @samp{?} prefix.  The value is used in the
33071 initial handshake with the module server, or to specify a prefix on
33072 mapping file lines.  In the server case, the main source file name is
33073 used if no @var{ident} is specified.  In the file case, all non-blank
33074 lines are significant, unless a value is specified, in which case only
33075 lines beginning with @var{ident} are significant.  The @var{ident}
33076 must be separated by whitespace from the module name.  Be aware that
33077 @samp{<}, @samp{>}, @samp{?}, and @samp{|} characters are often
33078 significant to the shell, and therefore may need quoting.
33080 The mapper is connected to or loaded lazily, when the first module
33081 mapping is required.  The networking protocols are only supported on
33082 hosts that provide networking.  If no mapper is specified a default is
33083 provided.
33085 A project-specific mapper is expected to be provided by the build
33086 system that invokes the compiler.  It is not expected that a
33087 general-purpose server is provided for all compilations.  As such, the
33088 server will know the build configuration, the compiler it invoked, and
33089 the environment (such as working directory) in which that is
33090 operating.  As it may parallelize builds, several compilations may
33091 connect to the same socket.
33093 The default mapper generates CMI files in a @samp{gcm.cache}
33094 directory.  CMI files have a @samp{.gcm} suffix.  The module unit name
33095 is used directly to provide the basename.  Header units construct a
33096 relative path using the underlying header file name.  If the path is
33097 already relative, a @samp{,} directory is prepended.  Internal
33098 @samp{..} components are translated to @samp{,,}.  No attempt is made
33099 to canonicalize these filenames beyond that done by the preprocessor's
33100 include search algorithm, as in general it is ambiguous when symbolic
33101 links are present.
33103 The mapper protocol was published as ``A Module Mapper''
33104 @uref{https://wg21.link/p1184}.  The implementation is provided by
33105 @command{libcody}, @uref{https://github.com/urnathan/libcody},
33106 which specifies the canonical protocol definition.  A proof of concept
33107 server implementation embedded in @command{make} was described in
33108 ''Make Me A Module'', @uref{https://wg21.link/p1602}.
33110 @node C++ Module Preprocessing
33111 @subsection Module Preprocessing
33112 @cindex C++ Module Preprocessing
33114 Modules affect preprocessing because of header units and include
33115 translation.  Some uses of the preprocessor as a separate step either
33116 do not produce a correct output, or require CMIs to be available.
33118 Header units import macros.  These macros can affect later conditional
33119 inclusion, which therefore can cascade to differing import sets.  When
33120 preprocessing, it is necessary to load the CMI.  If a header unit is
33121 unavailable, the preprocessor issues a warning and continue (when
33122 not just preprocessing, an error is emitted).  Detecting such imports
33123 requires preprocessor tokenization of the input stream to phase 4
33124 (macro expansion).
33126 Include translation converts @code{#include}, @code{#include_next} and
33127 @code{#import} directives to internal @code{import} declarations.
33128 Whether a particular directive is translated is controlled by the
33129 module mapper.  Header unit names are canonicalized during
33130 preprocessing.
33132 Dependency information can be emitted for macro import, extending the
33133 functionality of @option{-MD} and @option{-MMD} options.  Detection of
33134 import declarations also requires phase 4 preprocessing, and thus
33135 requires full preprocessing (or compilation).
33137 The @option{-M}, @option{-MM} and @option{-E -fdirectives-only} options halt
33138 preprocessing before phase 4.
33140 The @option{-save-temps} option uses @option{-fdirectives-only} for
33141 preprocessing, and preserve the macro definitions in the preprocessed
33142 output.  Usually you also want to use this option when explicitly
33143 preprocessing a header-unit, or consuming such preprocessed output:
33145 @smallexample
33146 g++ -fmodules-ts -E -fdirectives-only my-header.hh -o my-header.ii
33147 g++ -x c++-header -fmodules-ts -fpreprocessed -fdirectives-only my-header.ii
33148 @end smallexample
33150 @node C++ Compiled Module Interface
33151 @subsection Compiled Module Interface
33152 @cindex C++ Compiled Module Interface
33154 CMIs are an additional artifact when compiling named module
33155 interfaces, partitions or header units.  These are read when
33156 importing.  CMI contents are implementation-specific, and in GCC's
33157 case tied to the compiler version.  Consider them a rebuildable cache
33158 artifact, not a distributable object.
33160 When creating an output CMI, any missing directory components are
33161 created in a manner that is safe for concurrent builds creating
33162 multiple, different, CMIs within a common subdirectory tree.
33164 CMI contents are written to a temporary file, which is then atomically
33165 renamed.  Observers either see old contents (if there is an
33166 existing file), or complete new contents.  They do not observe the
33167 CMI during its creation.  This is unlike object file writing, which
33168 may be observed by an external process.
33170 CMIs are read in lazily, if the host OS provides @code{mmap}
33171 functionality.  Generally blocks are read when name lookup or template
33172 instantiation occurs.  To inhibit this, the @option{-fno-module-lazy}
33173 option may be used.
33175 The @option{--param lazy-modules=@var{n}} parameter controls the limit
33176 on the number of concurrently open module files during lazy loading.
33177 Should more modules be imported, an LRU algorithm is used to determine
33178 which files to close---until that file is needed again.  This limit
33179 may be exceeded with deep module dependency hierarchies.  With large
33180 code bases there may be more imports than the process limit of file
33181 descriptors.  By default, the limit is a few less than the per-process
33182 file descriptor hard limit, if that is determinable.@footnote{Where
33183 applicable the soft limit is incremented as needed towards the hard limit.}
33185 GCC CMIs use ELF32 as an architecture-neutral encapsulation mechanism.
33186 You may use @command{readelf} to inspect them, although section
33187 contents are largely undecipherable.  There is a section named
33188 @code{.gnu.c++.README}, which contains human-readable text.  Other
33189 than the first line, each line consists of @code{@var{tag}: @code{value}}
33190 tuples.
33192 @smallexample
33193 > @command{readelf -p.gnu.c++.README gcm.cache/foo.gcm}
33195 String dump of section '.gnu.c++.README':
33196   [     0]  GNU C++ primary module interface
33197   [    21]  compiler: 11.0.0 20201116 (experimental) [c++-modules revision 20201116-0454]
33198   [    6f]  version: 2020/11/16-04:54
33199   [    89]  module: foo
33200   [    95]  source: c_b.ii
33201   [    a4]  dialect: C++20/coroutines
33202   [    be]  cwd: /data/users/nathans/modules/obj/x86_64/gcc
33203   [    ee]  repository: gcm.cache
33204   [   104]  buildtime: 2020/11/16 15:03:21 UTC
33205   [   127]  localtime: 2020/11/16 07:03:21 PST
33206   [   14a]  export: foo:part1 foo-part1.gcm
33207 @end smallexample
33209 Amongst other things, this lists the source that was built, C++
33210 dialect used and imports of the module.@footnote{The precise contents
33211 of this output may change.} The timestamp is the same value as that
33212 provided by the @code{__DATE__} & @code{__TIME__} macros, and may be
33213 explicitly specified with the environment variable
33214 @code{SOURCE_DATE_EPOCH}.  @xref{Environment Variables} for further
33215 details.
33217 A set of related CMIs may be copied, provided the relative pathnames
33218 are preserved.
33220 The @code{.gnu.c++.README} contents do not affect CMI integrity, and
33221 it may be removed or altered.  The section numbering of the sections
33222 whose names do not begin with @code{.gnu.c++.}, or are not the string
33223 section is significant and must not be altered.