bd9ecebf1030190bf0e9a14862e3d5fad9c544e3
[platform/upstream/gcc.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988-2020 Free Software Foundation, Inc.
2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file gcc.texi.
4
5 @ignore
6 @c man begin INCLUDE
7 @include gcc-vers.texi
8 @c man end
9
10 @c man begin COPYRIGHT
11 Copyright @copyright{} 1988-2020 Free Software Foundation, Inc.
12
13 Permission is granted to copy, distribute and/or modify this document
14 under the terms of the GNU Free Documentation License, Version 1.3 or
15 any later version published by the Free Software Foundation; with the
16 Invariant Sections being ``GNU General Public License'' and ``Funding
17 Free Software'', the Front-Cover texts being (a) (see below), and with
18 the Back-Cover Texts being (b) (see below).  A copy of the license is
19 included in the gfdl(7) man page.
20
21 (a) The FSF's Front-Cover Text is:
22
23      A GNU Manual
24
25 (b) The FSF's Back-Cover Text is:
26
27      You have freedom to copy and modify this GNU Manual, like GNU
28      software.  Copies published by the Free Software Foundation raise
29      funds for GNU development.
30 @c man end
31 @c Set file name and title for the man page.
32 @setfilename gcc
33 @settitle GNU project C and C++ compiler
34 @c man begin SYNOPSIS
35 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
36     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
37     [@option{-W}@var{warn}@dots{}] [@option{-Wpedantic}]
38     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
39     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
40     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
41     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
42
43 Only the most useful options are listed here; see below for the
44 remainder.  @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
62
63 @node Invoking GCC
64 @chapter GCC Command Options
65 @cindex GCC command options
66 @cindex command options
67 @cindex options, GCC command
68
69 @c man begin DESCRIPTION
70 When you invoke GCC, it normally does preprocessing, compilation,
71 assembly and linking.  The ``overall options'' allow you to stop this
72 process at an intermediate stage.  For example, the @option{-c} option
73 says not to run the linker.  Then the output consists of object files
74 output by the assembler.
75 @xref{Overall Options,,Options Controlling the Kind of Output}.
76
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.
81
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.
88
89 @cindex cross compiling
90 @cindex specifying machine version
91 @cindex specifying compiler version and target machine
92 @cindex compiler version, specifying
93 @cindex target machine, specifying
94 The usual way to run GCC is to run the executable called @command{gcc}, or
95 @command{@var{machine}-gcc} when cross-compiling, or
96 @command{@var{machine}-gcc-@var{version}} to run a specific version of GCC.
97 When you compile C++ programs, you should invoke GCC as @command{g++} 
98 instead.  @xref{Invoking G++,,Compiling C++ Programs}, 
99 for information about the differences in behavior between @command{gcc} 
100 and @code{g++} when compiling C++ programs.
101
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}}.
108
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.
116
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.
123
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.
138
139 @c man end
140
141 @xref{Option Index}, for an index to GCC's options.
142
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 @end menu
176
177 @c man begin OPTIONS
178
179 @node Option Summary
180 @section Option Summary
181
182 Here is a summary of all the options, grouped by type.  Explanations are
183 in the following sections.
184
185 @table @emph
186 @item Overall Options
187 @xref{Overall Options,,Options Controlling the Kind of Output}.
188 @gccoptlist{-c  -S  -E  -o @var{file}  -x @var{language}  @gol
189 -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  --version @gol
190 -pass-exit-codes  -pipe  -specs=@var{file}  -wrapper  @gol
191 @@@var{file}  -ffile-prefix-map=@var{old}=@var{new}  @gol
192 -fplugin=@var{file}  -fplugin-arg-@var{name}=@var{arg}  @gol
193 -fdump-ada-spec@r{[}-slim@r{]}  -fada-spec-parent=@var{unit}  -fdump-go-spec=@var{file}}
194
195 @item C Language Options
196 @xref{C Dialect Options,,Options Controlling C Dialect}.
197 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
198 -fpermitted-flt-eval-methods=@var{standard} @gol
199 -aux-info @var{filename}  -fallow-parameterless-variadic-functions @gol
200 -fno-asm  -fno-builtin  -fno-builtin-@var{function}  -fgimple@gol
201 -fhosted  -ffreestanding @gol
202 -fopenacc  -fopenacc-dim=@var{geom} @gol
203 -fopenmp  -fopenmp-simd @gol
204 -fms-extensions  -fplan9-extensions  -fsso-struct=@var{endianness} @gol
205 -fallow-single-precision  -fcond-mismatch  -flax-vector-conversions @gol
206 -fsigned-bitfields  -fsigned-char @gol
207 -funsigned-bitfields  -funsigned-char}
208
209 @item C++ Language Options
210 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
211 @gccoptlist{-fabi-version=@var{n}  -fno-access-control @gol
212 -faligned-new=@var{n}  -fargs-in-order=@var{n}  -fchar8_t  -fcheck-new @gol
213 -fconstexpr-depth=@var{n}  -fconstexpr-cache-depth=@var{n} @gol
214 -fconstexpr-loop-limit=@var{n}  -fconstexpr-ops-limit=@var{n} @gol
215 -fno-elide-constructors @gol
216 -fno-enforce-eh-specs @gol
217 -fno-gnu-keywords @gol
218 -fno-implicit-templates @gol
219 -fno-implicit-inline-templates @gol
220 -fno-implement-inlines  -fms-extensions @gol
221 -fnew-inheriting-ctors @gol
222 -fnew-ttp-matching @gol
223 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
224 -fno-optional-diags  -fpermissive @gol
225 -fno-pretty-templates @gol
226 -fno-rtti  -fsized-deallocation @gol
227 -ftemplate-backtrace-limit=@var{n} @gol
228 -ftemplate-depth=@var{n} @gol
229 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
230 -fno-weak  -nostdinc++ @gol
231 -fvisibility-inlines-hidden @gol
232 -fvisibility-ms-compat @gol
233 -fext-numeric-literals @gol
234 -Wabi=@var{n}  -Wabi-tag  -Wcomma-subscript  -Wconversion-null @gol
235 -Wctor-dtor-privacy @gol
236 -Wdelete-non-virtual-dtor  -Wdeprecated-copy  -Wdeprecated-copy-dtor @gol
237 -Wliteral-suffix -Wmismatched-tags @gol
238 -Wmultiple-inheritance  -Wno-init-list-lifetime @gol
239 -Wnamespaces  -Wnarrowing @gol
240 -Wpessimizing-move  -Wredundant-move -Wredundant-tags @gol
241 -Wnoexcept  -Wnoexcept-type  -Wclass-memaccess @gol
242 -Wnon-virtual-dtor  -Wreorder  -Wregister @gol
243 -Weffc++  -Wstrict-null-sentinel  -Wtemplates @gol
244 -Wno-non-template-friend  -Wold-style-cast @gol
245 -Woverloaded-virtual  -Wno-pmf-conversions @gol
246 -Wno-class-conversion  -Wno-terminate @gol
247 -Wsign-promo  -Wvirtual-inheritance  -Wvolatile}
248
249 @item Objective-C and Objective-C++ Language Options
250 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
251 Objective-C and Objective-C++ Dialects}.
252 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
253 -fgnu-runtime  -fnext-runtime @gol
254 -fno-nil-receivers @gol
255 -fobjc-abi-version=@var{n} @gol
256 -fobjc-call-cxx-cdtors @gol
257 -fobjc-direct-dispatch @gol
258 -fobjc-exceptions @gol
259 -fobjc-gc @gol
260 -fobjc-nilcheck @gol
261 -fobjc-std=objc1 @gol
262 -fno-local-ivars @gol
263 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
264 -freplace-objc-classes @gol
265 -fzero-link @gol
266 -gen-decls @gol
267 -Wassign-intercept @gol
268 -Wno-protocol  -Wselector @gol
269 -Wstrict-selector-match @gol
270 -Wundeclared-selector}
271
272 @item Diagnostic Message Formatting Options
273 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
274 @gccoptlist{-fmessage-length=@var{n}  @gol
275 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
276 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
277 -fdiagnostics-urls=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
278 -fdiagnostics-format=@r{[}text@r{|}json@r{]}  @gol
279 -fno-diagnostics-show-option  -fno-diagnostics-show-caret @gol
280 -fno-diagnostics-show-labels  -fno-diagnostics-show-line-numbers @gol
281 -fno-diagnostics-show-cwe  @gol
282 -fdiagnostics-minimum-margin-width=@var{width} @gol
283 -fdiagnostics-parseable-fixits  -fdiagnostics-generate-patch @gol
284 -fdiagnostics-show-template-tree  -fno-elide-type @gol
285 -fdiagnostics-path-format=@r{[}none@r{|}separate-events@r{|}inline-events@r{]} @gol
286 -fdiagnostics-show-path-depths @gol
287 -fno-show-column}
288
289 @item Warning Options
290 @xref{Warning Options,,Options to Request or Suppress Warnings}.
291 @gccoptlist{-fanalyzer -fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
292 -pedantic-errors @gol
293 -w  -Wextra  -Wall  -Waddress  -Waddress-of-packed-member @gol
294 -Waggregate-return  -Waligned-new @gol
295 -Walloc-zero  -Walloc-size-larger-than=@var{byte-size} @gol
296 -Walloca  -Walloca-larger-than=@var{byte-size} @gol
297 -Wno-aggressive-loop-optimizations @gol
298 -Wno-analyzer-double-fclose @gol
299 -Wno-analyzer-double-free @gol
300 -Wno-analyzer-exposure-through-output-file @gol
301 -Wno-analyzer-file-leak @gol
302 -Wno-analyzer-free-of-non-heap @gol
303 -Wno-analyzer-malloc-leak @gol
304 -Wno-analyzer-possible-null-argument @gol
305 -Wno-analyzer-possible-null-dereference @gol
306 -Wno-analyzer-null-argument @gol
307 -Wno-analyzer-null-dereference @gol
308 -Wno-analyzer-stale-setjmp-buffer @gol
309 -Wno-analyzer-tainted-array-index @gol
310 -Wno-analyzer-unsafe-call-within-signal-handler @gol
311 -Wno-analyzer-use-after-free @gol
312 -Wno-analyzer-use-of-pointer-in-stale-stack-frame @gol
313 -Wno-analyzer-use-of-uninitialized-value @gol
314 -Wanalyzer-too-complex @gol
315 -Warith-conversion @gol
316 -Warray-bounds  -Warray-bounds=@var{n} @gol
317 -Wno-attributes  -Wattribute-alias=@var{n}  @gol
318 -Wbool-compare  -Wbool-operation @gol
319 -Wno-builtin-declaration-mismatch @gol
320 -Wno-builtin-macro-redefined  -Wc90-c99-compat  -Wc99-c11-compat @gol
321 -Wc11-c2x-compat @gol
322 -Wc++-compat  -Wc++11-compat  -Wc++14-compat  -Wc++17-compat  @gol
323 -Wc++20-compat  @gol
324 -Wcast-align  -Wcast-align=strict  -Wcast-function-type  -Wcast-qual  @gol
325 -Wchar-subscripts  -Wcatch-value  -Wcatch-value=@var{n} @gol
326 -Wclobbered  -Wcomment  -Wconditionally-supported @gol
327 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wdangling-else  -Wdate-time @gol
328 -Wdelete-incomplete @gol
329 -Wno-attribute-warning @gol
330 -Wno-deprecated  -Wno-deprecated-declarations  -Wno-designated-init @gol
331 -Wdisabled-optimization @gol
332 -Wno-discarded-qualifiers  -Wno-discarded-array-qualifiers @gol
333 -Wno-div-by-zero  -Wdouble-promotion @gol
334 -Wduplicated-branches  -Wduplicated-cond @gol
335 -Wempty-body  -Wenum-compare  -Wenum-conversion @gol
336 -Wno-endif-labels  -Wexpansion-to-defined @gol
337 -Werror  -Werror=*  -Wextra-semi  -Wfatal-errors @gol
338 -Wfloat-equal  -Wformat  -Wformat=2 @gol
339 -Wno-format-contains-nul  -Wno-format-extra-args  @gol
340 -Wformat-nonliteral  -Wformat-overflow=@var{n} @gol
341 -Wformat-security  -Wformat-signedness  -Wformat-truncation=@var{n} @gol
342 -Wformat-y2k  -Wframe-address @gol
343 -Wframe-larger-than=@var{byte-size}  -Wno-free-nonheap-object @gol
344 -Wjump-misses-init @gol
345 -Whsa  -Wif-not-aligned @gol
346 -Wignored-qualifiers  -Wignored-attributes  -Wincompatible-pointer-types @gol
347 -Wimplicit  -Wimplicit-fallthrough  -Wimplicit-fallthrough=@var{n} @gol
348 -Wimplicit-function-declaration  -Wimplicit-int @gol
349 -Winaccessible-base @gol
350 -Winit-self  -Winline  -Wno-int-conversion  -Wint-in-bool-context @gol
351 -Wno-int-to-pointer-cast  -Winvalid-memory-model  -Wno-invalid-offsetof @gol
352 -Wzero-length-bounds @gol
353 -Winvalid-pch  -Wlarger-than=@var{byte-size} @gol
354 -Wlogical-op  -Wlogical-not-parentheses  -Wlong-long @gol
355 -Wmain  -Wmaybe-uninitialized  -Wmemset-elt-size  -Wmemset-transposed-args @gol
356 -Wmisleading-indentation  -Wmissing-attributes  -Wmissing-braces @gol
357 -Wmissing-field-initializers  -Wmissing-format-attribute @gol
358 -Wmissing-include-dirs  -Wmissing-noreturn  -Wmissing-profile @gol
359 -Wno-multichar  -Wmultistatement-macros  -Wnonnull  -Wnonnull-compare @gol
360 -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
361 -Wnull-dereference  -Wodr  -Wno-overflow  -Wopenmp-simd  @gol
362 -Woverride-init-side-effects  -Woverlength-strings @gol
363 -Wpacked  -Wpacked-bitfield-compat -Wpacked-not-aligned  -Wpadded @gol
364 -Wparentheses  -Wno-pedantic-ms-format @gol
365 -Wplacement-new  -Wplacement-new=@var{n} @gol
366 -Wpointer-arith  -Wpointer-compare  -Wno-pointer-to-int-cast @gol
367 -Wno-pragmas  -Wno-prio-ctor-dtor  -Wredundant-decls @gol
368 -Wrestrict  -Wno-return-local-addr @gol
369 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
370 -Wshadow=global  -Wshadow=local  -Wshadow=compatible-local @gol
371 -Wshift-overflow  -Wshift-overflow=@var{n} @gol
372 -Wshift-count-negative  -Wshift-count-overflow  -Wshift-negative-value @gol
373 -Wsign-compare  -Wsign-conversion  -Wfloat-conversion @gol
374 -Wno-scalar-storage-order  -Wsizeof-pointer-div @gol
375 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
376 -Wstack-protector  -Wstack-usage=@var{byte-size}  -Wstrict-aliasing @gol
377 -Wstrict-aliasing=n  -Wstrict-overflow  -Wstrict-overflow=@var{n} @gol
378 -Wstring-compare @gol
379 -Wstringop-overflow=@var{n}  -Wstringop-truncation  -Wsubobject-linkage @gol
380 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}malloc@r{]} @gol
381 -Wsuggest-final-types @gol  -Wsuggest-final-methods  -Wsuggest-override @gol
382 -Wswitch  -Wswitch-bool  -Wswitch-default  -Wswitch-enum @gol
383 -Wswitch-unreachable  -Wsync-nand @gol
384 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
385 -Wtype-limits  -Wundef @gol
386 -Wuninitialized  -Wunknown-pragmas @gol
387 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
388 -Wunused-label  -Wunused-local-typedefs  -Wunused-macros @gol
389 -Wunused-parameter  -Wno-unused-result @gol
390 -Wunused-value  -Wunused-variable @gol
391 -Wunused-const-variable  -Wunused-const-variable=@var{n} @gol
392 -Wunused-but-set-parameter  -Wunused-but-set-variable @gol
393 -Wuseless-cast  -Wvariadic-macros  -Wvector-operation-performance @gol
394 -Wvla  -Wvla-larger-than=@var{byte-size}  -Wvolatile-register-var @gol
395 -Wwrite-strings @gol
396 -Wzero-as-null-pointer-constant}
397
398 @item Static Analyzer Options
399 @gccoptlist{-Wanalyzer-double-fclose @gol
400 -Wanalyzer-double-free @gol
401 -Wanalyzer-exposure-through-output-file @gol
402 -Wanalyzer-file-leak @gol
403 -Wanalyzer-free-of-non-heap @gol
404 -Wanalyzer-malloc-leak @gol
405 -Wanalyzer-null-argument @gol
406 -Wanalyzer-null-dereference @gol
407 -Wanalyzer-possible-null-argument @gol
408 -Wanalyzer-possible-null-dereference @gol
409 -Wanalyzer-stale-setjmp-buffer @gol
410 -Wanalyzer-tainted-array-index @gol
411 -Wanalyzer-unsafe-call-within-signal-handler @gol
412 -Wanalyzer-use-after-free @gol
413 -Wanalyzer-use-of-pointer-in-stale-stack-frame @gol
414 -Wanalyzer-use-of-uninitialized-value @gol
415 -Wanalyzer-too-complex  @gol
416 -fanalyzer-call-summaries @gol
417 -fanalyzer-checker=@var{name} @gol
418 -fanalyzer-fine-grained @gol
419 -fanalyzer-state-merge @gol
420 -fanalyzer-state-purge @gol
421 -fanalyzer-transitivity @gol
422 -fanalyzer-verbose-edges @gol
423 -fanalyzer-verbose-state-changes @gol
424 -fanalyzer-verbosity=@var{level} @gol
425 -fdump-analyzer @gol
426 -fdump-analyzer-stderr @gol
427 -fdump-analyzer-callgraph @gol
428 -fdump-analyzer-exploded-graph @gol
429 -fdump-analyzer-exploded-nodes @gol
430 -fdump-analyzer-exploded-nodes-2 @gol
431 -fdump-analyzer-exploded-nodes-3 @gol
432 -fdump-analyzer-state-purge @gol
433 -fdump-analyzer-supergraph @gol
434 }
435
436 @item C and Objective-C-only Warning Options
437 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
438 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
439 -Wold-style-declaration  -Wold-style-definition @gol
440 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
441 -Wdeclaration-after-statement  -Wpointer-sign}
442
443 @item Debugging Options
444 @xref{Debugging Options,,Options for Debugging Your Program}.
445 @gccoptlist{-g  -g@var{level}  -gdwarf  -gdwarf-@var{version} @gol
446 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
447 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
448 -gas-loc-support  -gno-as-loc-support @gol
449 -gas-locview-support  -gno-as-locview-support @gol
450 -gcolumn-info  -gno-column-info @gol
451 -gstatement-frontiers  -gno-statement-frontiers @gol
452 -gvariable-location-views  -gno-variable-location-views @gol
453 -ginternal-reset-location-views  -gno-internal-reset-location-views @gol
454 -ginline-points  -gno-inline-points @gol
455 -gvms  -gxcoff  -gxcoff+  -gz@r{[}=@var{type}@r{]} @gol
456 -gsplit-dwarf  -gdescribe-dies  -gno-describe-dies @gol
457 -fdebug-prefix-map=@var{old}=@var{new}  -fdebug-types-section @gol
458 -fno-eliminate-unused-debug-types @gol
459 -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
460 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
461 -fno-eliminate-unused-debug-symbols  -femit-class-debug-always @gol
462 -fno-merge-debug-strings  -fno-dwarf2-cfi-asm @gol
463 -fvar-tracking  -fvar-tracking-assignments}
464
465 @item Optimization Options
466 @xref{Optimize Options,,Options that Control Optimization}.
467 @gccoptlist{-faggressive-loop-optimizations @gol
468 -falign-functions[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
469 -falign-jumps[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
470 -falign-labels[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
471 -falign-loops[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
472 -fno-allocation-dce -fallow-store-data-races @gol
473 -fassociative-math  -fauto-profile  -fauto-profile[=@var{path}] @gol
474 -fauto-inc-dec  -fbranch-probabilities @gol
475 -fcaller-saves @gol
476 -fcombine-stack-adjustments  -fconserve-stack @gol
477 -fcompare-elim  -fcprop-registers  -fcrossjumping @gol
478 -fcse-follow-jumps  -fcse-skip-blocks  -fcx-fortran-rules @gol
479 -fcx-limited-range @gol
480 -fdata-sections  -fdce  -fdelayed-branch @gol
481 -fdelete-null-pointer-checks  -fdevirtualize  -fdevirtualize-speculatively @gol
482 -fdevirtualize-at-ltrans  -fdse @gol
483 -fearly-inlining  -fipa-sra  -fexpensive-optimizations  -ffat-lto-objects @gol
484 -ffast-math  -ffinite-math-only  -ffloat-store  -fexcess-precision=@var{style} @gol
485 -ffinite-loops @gol
486 -fforward-propagate  -ffp-contract=@var{style}  -ffunction-sections @gol
487 -fgcse  -fgcse-after-reload  -fgcse-las  -fgcse-lm  -fgraphite-identity @gol
488 -fgcse-sm  -fhoist-adjacent-loads  -fif-conversion @gol
489 -fif-conversion2  -findirect-inlining @gol
490 -finline-functions  -finline-functions-called-once  -finline-limit=@var{n} @gol
491 -finline-small-functions  -fipa-cp  -fipa-cp-clone @gol
492 -fipa-bit-cp  -fipa-vrp  -fipa-pta  -fipa-profile  -fipa-pure-const @gol
493 -fipa-reference  -fipa-reference-addressable @gol
494 -fipa-stack-alignment  -fipa-icf  -fira-algorithm=@var{algorithm} @gol
495 -flive-patching=@var{level} @gol
496 -fira-region=@var{region}  -fira-hoist-pressure @gol
497 -fira-loop-pressure  -fno-ira-share-save-slots @gol
498 -fno-ira-share-spill-slots @gol
499 -fisolate-erroneous-paths-dereference  -fisolate-erroneous-paths-attribute @gol
500 -fivopts  -fkeep-inline-functions  -fkeep-static-functions @gol
501 -fkeep-static-consts  -flimit-function-alignment  -flive-range-shrinkage @gol
502 -floop-block  -floop-interchange  -floop-strip-mine @gol
503 -floop-unroll-and-jam  -floop-nest-optimize @gol
504 -floop-parallelize-all  -flra-remat  -flto  -flto-compression-level @gol
505 -flto-partition=@var{alg}  -fmerge-all-constants @gol
506 -fmerge-constants  -fmodulo-sched  -fmodulo-sched-allow-regmoves @gol
507 -fmove-loop-invariants  -fno-branch-count-reg @gol
508 -fno-defer-pop  -fno-fp-int-builtin-inexact  -fno-function-cse @gol
509 -fno-guess-branch-probability  -fno-inline  -fno-math-errno  -fno-peephole @gol
510 -fno-peephole2  -fno-printf-return-value  -fno-sched-interblock @gol
511 -fno-sched-spec  -fno-signed-zeros @gol
512 -fno-toplevel-reorder  -fno-trapping-math  -fno-zero-initialized-in-bss @gol
513 -fomit-frame-pointer  -foptimize-sibling-calls @gol
514 -fpartial-inlining  -fpeel-loops  -fpredictive-commoning @gol
515 -fprefetch-loop-arrays @gol
516 -fprofile-correction @gol
517 -fprofile-use  -fprofile-use=@var{path} -fprofile-partial-training @gol
518 -fprofile-values -fprofile-reorder-functions @gol
519 -freciprocal-math  -free  -frename-registers  -freorder-blocks @gol
520 -freorder-blocks-algorithm=@var{algorithm} @gol
521 -freorder-blocks-and-partition  -freorder-functions @gol
522 -frerun-cse-after-loop  -freschedule-modulo-scheduled-loops @gol
523 -frounding-math  -fsave-optimization-record @gol
524 -fsched2-use-superblocks  -fsched-pressure @gol
525 -fsched-spec-load  -fsched-spec-load-dangerous @gol
526 -fsched-stalled-insns-dep[=@var{n}]  -fsched-stalled-insns[=@var{n}] @gol
527 -fsched-group-heuristic  -fsched-critical-path-heuristic @gol
528 -fsched-spec-insn-heuristic  -fsched-rank-heuristic @gol
529 -fsched-last-insn-heuristic  -fsched-dep-count-heuristic @gol
530 -fschedule-fusion @gol
531 -fschedule-insns  -fschedule-insns2  -fsection-anchors @gol
532 -fselective-scheduling  -fselective-scheduling2 @gol
533 -fsel-sched-pipelining  -fsel-sched-pipelining-outer-loops @gol
534 -fsemantic-interposition  -fshrink-wrap  -fshrink-wrap-separate @gol
535 -fsignaling-nans @gol
536 -fsingle-precision-constant  -fsplit-ivs-in-unroller  -fsplit-loops@gol
537 -fsplit-paths @gol
538 -fsplit-wide-types  -fsplit-wide-types-early  -fssa-backprop  -fssa-phiopt @gol
539 -fstdarg-opt  -fstore-merging  -fstrict-aliasing @gol
540 -fthread-jumps  -ftracer  -ftree-bit-ccp @gol
541 -ftree-builtin-call-dce  -ftree-ccp  -ftree-ch @gol
542 -ftree-coalesce-vars  -ftree-copy-prop  -ftree-dce  -ftree-dominator-opts @gol
543 -ftree-dse  -ftree-forwprop  -ftree-fre  -fcode-hoisting @gol
544 -ftree-loop-if-convert  -ftree-loop-im @gol
545 -ftree-phiprop  -ftree-loop-distribution  -ftree-loop-distribute-patterns @gol
546 -ftree-loop-ivcanon  -ftree-loop-linear  -ftree-loop-optimize @gol
547 -ftree-loop-vectorize @gol
548 -ftree-parallelize-loops=@var{n}  -ftree-pre  -ftree-partial-pre  -ftree-pta @gol
549 -ftree-reassoc  -ftree-scev-cprop  -ftree-sink  -ftree-slsr  -ftree-sra @gol
550 -ftree-switch-conversion  -ftree-tail-merge @gol
551 -ftree-ter  -ftree-vectorize  -ftree-vrp  -funconstrained-commons @gol
552 -funit-at-a-time  -funroll-all-loops  -funroll-loops @gol
553 -funsafe-math-optimizations  -funswitch-loops @gol
554 -fipa-ra  -fvariable-expansion-in-unroller  -fvect-cost-model  -fvpt @gol
555 -fweb  -fwhole-program  -fwpa  -fuse-linker-plugin @gol
556 --param @var{name}=@var{value}
557 -O  -O0  -O1  -O2  -O3  -Os  -Ofast  -Og}
558
559 @item Program Instrumentation Options
560 @xref{Instrumentation Options,,Program Instrumentation Options}.
561 @gccoptlist{-p  -pg  -fprofile-arcs  --coverage  -ftest-coverage @gol
562 -fprofile-abs-path @gol
563 -fprofile-dir=@var{path}  -fprofile-generate  -fprofile-generate=@var{path} @gol
564 -fprofile-note=@var{path}  -fprofile-update=@var{method} @gol
565 -fprofile-filter-files=@var{regex}  -fprofile-exclude-files=@var{regex} @gol
566 -fsanitize=@var{style}  -fsanitize-recover  -fsanitize-recover=@var{style} @gol
567 -fasan-shadow-offset=@var{number}  -fsanitize-sections=@var{s1},@var{s2},... @gol
568 -fsanitize-undefined-trap-on-error  -fbounds-check @gol
569 -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]} @gol
570 -fstack-protector  -fstack-protector-all  -fstack-protector-strong @gol
571 -fstack-protector-explicit  -fstack-check @gol
572 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
573 -fno-stack-limit  -fsplit-stack @gol
574 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
575 -fvtv-counts  -fvtv-debug @gol
576 -finstrument-functions @gol
577 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
578 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}}
579
580 @item Preprocessor Options
581 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
582 @gccoptlist{-A@var{question}=@var{answer} @gol
583 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
584 -C  -CC  -D@var{macro}@r{[}=@var{defn}@r{]} @gol
585 -dD  -dI  -dM  -dN  -dU @gol
586 -fdebug-cpp  -fdirectives-only  -fdollars-in-identifiers  @gol
587 -fexec-charset=@var{charset}  -fextended-identifiers  @gol
588 -finput-charset=@var{charset}  -fmacro-prefix-map=@var{old}=@var{new}  @gol
589 -fmax-include-depth=@var{depth} @gol
590 -fno-canonical-system-headers  -fpch-deps  -fpch-preprocess  @gol
591 -fpreprocessed  -ftabstop=@var{width}  -ftrack-macro-expansion  @gol
592 -fwide-exec-charset=@var{charset}  -fworking-directory @gol
593 -H  -imacros @var{file}  -include @var{file} @gol
594 -M  -MD  -MF  -MG  -MM  -MMD  -MP  -MQ  -MT @gol
595 -no-integrated-cpp  -P  -pthread  -remap @gol
596 -traditional  -traditional-cpp  -trigraphs @gol
597 -U@var{macro}  -undef  @gol
598 -Wp,@var{option}  -Xpreprocessor @var{option}}
599
600 @item Assembler Options
601 @xref{Assembler Options,,Passing Options to the Assembler}.
602 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
603
604 @item Linker Options
605 @xref{Link Options,,Options for Linking}.
606 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker}  -l@var{library} @gol
607 -nostartfiles  -nodefaultlibs  -nolibc  -nostdlib @gol
608 -e @var{entry}  --entry=@var{entry} @gol
609 -pie  -pthread  -r  -rdynamic @gol
610 -s  -static  -static-pie  -static-libgcc  -static-libstdc++ @gol
611 -static-libasan  -static-libtsan  -static-liblsan  -static-libubsan @gol
612 -shared  -shared-libgcc  -symbolic @gol
613 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
614 -u @var{symbol}  -z @var{keyword}}
615
616 @item Directory Options
617 @xref{Directory Options,,Options for Directory Search}.
618 @gccoptlist{-B@var{prefix}  -I@var{dir}  -I- @gol
619 -idirafter @var{dir} @gol
620 -imacros @var{file}  -imultilib @var{dir} @gol
621 -iplugindir=@var{dir}  -iprefix @var{file} @gol
622 -iquote @var{dir}  -isysroot @var{dir}  -isystem @var{dir} @gol
623 -iwithprefix @var{dir}  -iwithprefixbefore @var{dir}  @gol
624 -L@var{dir}  -no-canonical-prefixes  --no-sysroot-suffix @gol
625 -nostdinc  -nostdinc++  --sysroot=@var{dir}}
626
627 @item Code Generation Options
628 @xref{Code Gen Options,,Options for Code Generation Conventions}.
629 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
630 -ffixed-@var{reg}  -fexceptions @gol
631 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
632 -fasynchronous-unwind-tables @gol
633 -fno-gnu-unique @gol
634 -finhibit-size-directive  -fcommon  -fno-ident @gol
635 -fpcc-struct-return  -fpic  -fPIC  -fpie  -fPIE  -fno-plt @gol
636 -fno-jump-tables @gol
637 -frecord-gcc-switches @gol
638 -freg-struct-return  -fshort-enums  -fshort-wchar @gol
639 -fverbose-asm  -fpack-struct[=@var{n}]  @gol
640 -fleading-underscore  -ftls-model=@var{model} @gol
641 -fstack-reuse=@var{reuse_level} @gol
642 -ftrampolines  -ftrapv  -fwrapv @gol
643 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
644 -fstrict-volatile-bitfields  -fsync-libcalls}
645
646 @item Developer Options
647 @xref{Developer Options,,GCC Developer Options}.
648 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
649 -dumpfullversion  -fcallgraph-info@r{[}=su,da@r{]}
650 -fchecking  -fchecking=@var{n}
651 -fdbg-cnt-list @gol  -fdbg-cnt=@var{counter-value-list} @gol
652 -fdisable-ipa-@var{pass_name} @gol
653 -fdisable-rtl-@var{pass_name} @gol
654 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
655 -fdisable-tree-@var{pass_name} @gol
656 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
657 -fdump-debug  -fdump-earlydebug @gol
658 -fdump-noaddr  -fdump-unnumbered  -fdump-unnumbered-links @gol
659 -fdump-final-insns@r{[}=@var{file}@r{]} @gol
660 -fdump-ipa-all  -fdump-ipa-cgraph  -fdump-ipa-inline @gol
661 -fdump-lang-all @gol
662 -fdump-lang-@var{switch} @gol
663 -fdump-lang-@var{switch}-@var{options} @gol
664 -fdump-lang-@var{switch}-@var{options}=@var{filename} @gol
665 -fdump-passes @gol
666 -fdump-rtl-@var{pass}  -fdump-rtl-@var{pass}=@var{filename} @gol
667 -fdump-statistics @gol
668 -fdump-tree-all @gol
669 -fdump-tree-@var{switch} @gol
670 -fdump-tree-@var{switch}-@var{options} @gol
671 -fdump-tree-@var{switch}-@var{options}=@var{filename} @gol
672 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
673 -fenable-@var{kind}-@var{pass} @gol
674 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
675 -fira-verbose=@var{n} @gol
676 -flto-report  -flto-report-wpa  -fmem-report-wpa @gol
677 -fmem-report  -fpre-ipa-mem-report  -fpost-ipa-mem-report @gol
678 -fopt-info  -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
679 -fprofile-report @gol
680 -frandom-seed=@var{string}  -fsched-verbose=@var{n} @gol
681 -fsel-sched-verbose  -fsel-sched-dump-cfg  -fsel-sched-pipelining-verbose @gol
682 -fstats  -fstack-usage  -ftime-report  -ftime-report-details @gol
683 -fvar-tracking-assignments-toggle  -gtoggle @gol
684 -print-file-name=@var{library}  -print-libgcc-file-name @gol
685 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
686 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
687 -print-sysroot  -print-sysroot-headers-suffix @gol
688 -save-temps  -save-temps=cwd  -save-temps=obj  -time@r{[}=@var{file}@r{]}}
689
690 @item Machine-Dependent Options
691 @xref{Submodel Options,,Machine-Dependent Options}.
692 @c This list is ordered alphanumerically by subsection name.
693 @c Try and put the significant identifier (CPU or system) first,
694 @c so users have a clue at guessing where the ones they want will be.
695
696 @emph{AArch64 Options}
697 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
698 -mgeneral-regs-only @gol
699 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
700 -mstrict-align  -mno-strict-align @gol
701 -momit-leaf-frame-pointer @gol
702 -mtls-dialect=desc  -mtls-dialect=traditional @gol
703 -mtls-size=@var{size} @gol
704 -mfix-cortex-a53-835769  -mfix-cortex-a53-843419 @gol
705 -mlow-precision-recip-sqrt  -mlow-precision-sqrt  -mlow-precision-div @gol
706 -mpc-relative-literal-loads @gol
707 -msign-return-address=@var{scope} @gol
708 -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}
709 +@var{b-key}]|@var{bti} @gol
710 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}  @gol
711 -moverride=@var{string}  -mverbose-cost-dump @gol
712 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{sysreg} @gol
713 -mstack-protector-guard-offset=@var{offset} -mtrack-speculation @gol
714 -moutline-atomics }
715
716 @emph{Adapteva Epiphany Options}
717 @gccoptlist{-mhalf-reg-file  -mprefer-short-insn-regs @gol
718 -mbranch-cost=@var{num}  -mcmove  -mnops=@var{num}  -msoft-cmpsf @gol
719 -msplit-lohi  -mpost-inc  -mpost-modify  -mstack-offset=@var{num} @gol
720 -mround-nearest  -mlong-calls  -mshort-calls  -msmall16 @gol
721 -mfp-mode=@var{mode}  -mvect-double  -max-vect-align=@var{num} @gol
722 -msplit-vecmove-early  -m1reg-@var{reg}}
723
724 @emph{AMD GCN Options}
725 @gccoptlist{-march=@var{gpu} -mtune=@var{gpu} -mstack-size=@var{bytes}}
726
727 @emph{ARC Options}
728 @gccoptlist{-mbarrel-shifter  -mjli-always @gol
729 -mcpu=@var{cpu}  -mA6  -mARC600  -mA7  -mARC700 @gol
730 -mdpfp  -mdpfp-compact  -mdpfp-fast  -mno-dpfp-lrsr @gol
731 -mea  -mno-mpy  -mmul32x16  -mmul64  -matomic @gol
732 -mnorm  -mspfp  -mspfp-compact  -mspfp-fast  -msimd  -msoft-float  -mswap @gol
733 -mcrc  -mdsp-packa  -mdvbf  -mlock  -mmac-d16  -mmac-24  -mrtsc  -mswape @gol
734 -mtelephony  -mxy  -misize  -mannotate-align  -marclinux  -marclinux_prof @gol
735 -mlong-calls  -mmedium-calls  -msdata  -mirq-ctrl-saved @gol
736 -mrgf-banked-regs  -mlpc-width=@var{width}  -G @var{num} @gol
737 -mvolatile-cache  -mtp-regno=@var{regno} @gol
738 -malign-call  -mauto-modify-reg  -mbbit-peephole  -mno-brcc @gol
739 -mcase-vector-pcrel  -mcompact-casesi  -mno-cond-exec  -mearly-cbranchsi @gol
740 -mexpand-adddi  -mindexed-loads  -mlra  -mlra-priority-none @gol
741 -mlra-priority-compact mlra-priority-noncompact  -mmillicode @gol
742 -mmixed-code  -mq-class  -mRcq  -mRcw  -msize-level=@var{level} @gol
743 -mtune=@var{cpu}  -mmultcost=@var{num}  -mcode-density-frame @gol
744 -munalign-prob-threshold=@var{probability}  -mmpy-option=@var{multo} @gol
745 -mdiv-rem  -mcode-density  -mll64  -mfpu=@var{fpu}  -mrf16  -mbranch-index}
746
747 @emph{ARM Options}
748 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
749 -mabi=@var{name} @gol
750 -mapcs-stack-check  -mno-apcs-stack-check @gol
751 -mapcs-reentrant  -mno-apcs-reentrant @gol
752 -mgeneral-regs-only @gol
753 -msched-prolog  -mno-sched-prolog @gol
754 -mlittle-endian  -mbig-endian @gol
755 -mbe8  -mbe32 @gol
756 -mfloat-abi=@var{name} @gol
757 -mfp16-format=@var{name}
758 -mthumb-interwork  -mno-thumb-interwork @gol
759 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
760 -mtune=@var{name}  -mprint-tune-info @gol
761 -mstructure-size-boundary=@var{n} @gol
762 -mabort-on-noreturn @gol
763 -mlong-calls  -mno-long-calls @gol
764 -msingle-pic-base  -mno-single-pic-base @gol
765 -mpic-register=@var{reg} @gol
766 -mnop-fun-dllimport @gol
767 -mpoke-function-name @gol
768 -mthumb  -marm  -mflip-thumb @gol
769 -mtpcs-frame  -mtpcs-leaf-frame @gol
770 -mcaller-super-interworking  -mcallee-super-interworking @gol
771 -mtp=@var{name}  -mtls-dialect=@var{dialect} @gol
772 -mword-relocations @gol
773 -mfix-cortex-m3-ldrd @gol
774 -munaligned-access @gol
775 -mneon-for-64bits @gol
776 -mslow-flash-data @gol
777 -masm-syntax-unified @gol
778 -mrestrict-it @gol
779 -mverbose-cost-dump @gol
780 -mpure-code @gol
781 -mcmse @gol
782 -mfdpic}
783
784 @emph{AVR Options}
785 @gccoptlist{-mmcu=@var{mcu}  -mabsdata  -maccumulate-args @gol
786 -mbranch-cost=@var{cost} @gol
787 -mcall-prologues  -mgas-isr-prologues  -mint8 @gol
788 -mdouble=@var{bits} -mlong-double=@var{bits} @gol
789 -mn_flash=@var{size}  -mno-interrupts @gol
790 -mmain-is-OS_task  -mrelax  -mrmw  -mstrict-X  -mtiny-stack @gol
791 -mfract-convert-truncate @gol
792 -mshort-calls  -nodevicelib  -nodevicespecs @gol
793 -Waddr-space-convert  -Wmisspelled-isr}
794
795 @emph{Blackfin Options}
796 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
797 -msim  -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
798 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
799 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
800 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
801 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
802 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
803 -mfast-fp  -minline-plt  -mmulticore  -mcorea  -mcoreb  -msdram @gol
804 -micplb}
805
806 @emph{C6X Options}
807 @gccoptlist{-mbig-endian  -mlittle-endian  -march=@var{cpu} @gol
808 -msim  -msdata=@var{sdata-type}}
809
810 @emph{CRIS Options}
811 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
812 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
813 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
814 -mstack-align  -mdata-align  -mconst-align @gol
815 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
816 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
817 -mmul-bug-workaround  -mno-mul-bug-workaround}
818
819 @emph{CR16 Options}
820 @gccoptlist{-mmac @gol
821 -mcr16cplus  -mcr16c @gol
822 -msim  -mint32  -mbit-ops
823 -mdata-model=@var{model}}
824
825 @emph{C-SKY Options}
826 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu} @gol
827 -mbig-endian  -EB  -mlittle-endian  -EL @gol
828 -mhard-float  -msoft-float  -mfpu=@var{fpu}  -mdouble-float  -mfdivdu @gol
829 -melrw  -mistack  -mmp  -mcp  -mcache  -msecurity  -mtrust @gol
830 -mdsp  -medsp  -mvdsp @gol
831 -mdiv  -msmart  -mhigh-registers  -manchor @gol
832 -mpushpop  -mmultiple-stld  -mconstpool  -mstack-size  -mccrt @gol
833 -mbranch-cost=@var{n}  -mcse-cc  -msched-prolog}
834
835 @emph{Darwin Options}
836 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
837 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
838 -client_name  -compatibility_version  -current_version @gol
839 -dead_strip @gol
840 -dependency-file  -dylib_file  -dylinker_install_name @gol
841 -dynamic  -dynamiclib  -exported_symbols_list @gol
842 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
843 -force_flat_namespace  -headerpad_max_install_names @gol
844 -iframework @gol
845 -image_base  -init  -install_name  -keep_private_externs @gol
846 -multi_module  -multiply_defined  -multiply_defined_unused @gol
847 -noall_load   -no_dead_strip_inits_and_terms @gol
848 -nofixprebinding  -nomultidefs  -noprebind  -noseglinkedit @gol
849 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
850 -private_bundle  -read_only_relocs  -sectalign @gol
851 -sectobjectsymbols  -whyload  -seg1addr @gol
852 -sectcreate  -sectobjectsymbols  -sectorder @gol
853 -segaddr  -segs_read_only_addr  -segs_read_write_addr @gol
854 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
855 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
856 -single_module  -static  -sub_library  -sub_umbrella @gol
857 -twolevel_namespace  -umbrella  -undefined @gol
858 -unexported_symbols_list  -weak_reference_mismatches @gol
859 -whatsloaded  -F  -gused  -gfull  -mmacosx-version-min=@var{version} @gol
860 -mkernel  -mone-byte-bool}
861
862 @emph{DEC Alpha Options}
863 @gccoptlist{-mno-fp-regs  -msoft-float @gol
864 -mieee  -mieee-with-inexact  -mieee-conformant @gol
865 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
866 -mtrap-precision=@var{mode}  -mbuild-constants @gol
867 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
868 -mbwx  -mmax  -mfix  -mcix @gol
869 -mfloat-vax  -mfloat-ieee @gol
870 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
871 -msmall-text  -mlarge-text @gol
872 -mmemory-latency=@var{time}}
873
874 @emph{eBPF Options}
875 @gccoptlist{-mbig-endian -mlittle-endian -mkernel=@var{version}
876 -mframe-limit=@var{bytes}}
877
878 @emph{FR30 Options}
879 @gccoptlist{-msmall-model  -mno-lsim}
880
881 @emph{FT32 Options}
882 @gccoptlist{-msim  -mlra  -mnodiv  -mft32b  -mcompress  -mnopm}
883
884 @emph{FRV Options}
885 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
886 -mhard-float  -msoft-float @gol
887 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
888 -mdouble  -mno-double @gol
889 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
890 -mfdpic  -minline-plt  -mgprel-ro  -multilib-library-pic @gol
891 -mlinked-fp  -mlong-calls  -malign-labels @gol
892 -mlibrary-pic  -macc-4  -macc-8 @gol
893 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
894 -moptimize-membar  -mno-optimize-membar @gol
895 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
896 -mvliw-branch  -mno-vliw-branch @gol
897 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
898 -mno-nested-cond-exec  -mtomcat-stats @gol
899 -mTLS  -mtls @gol
900 -mcpu=@var{cpu}}
901
902 @emph{GNU/Linux Options}
903 @gccoptlist{-mglibc  -muclibc  -mmusl  -mbionic  -mandroid @gol
904 -tno-android-cc  -tno-android-ld}
905
906 @emph{H8/300 Options}
907 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr  -mno-exr  -mint32  -malign-300}
908
909 @emph{HPPA Options}
910 @gccoptlist{-march=@var{architecture-type} @gol
911 -mcaller-copies  -mdisable-fpregs  -mdisable-indexing @gol
912 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
913 -mfixed-range=@var{register-range} @gol
914 -mjump-in-delay  -mlinker-opt  -mlong-calls @gol
915 -mlong-load-store  -mno-disable-fpregs @gol
916 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
917 -mno-jump-in-delay  -mno-long-load-store @gol
918 -mno-portable-runtime  -mno-soft-float @gol
919 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
920 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
921 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
922 -munix=@var{unix-std}  -nolibdld  -static  -threads}
923
924 @emph{IA-64 Options}
925 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
926 -mvolatile-asm-stop  -mregister-names  -msdata  -mno-sdata @gol
927 -mconstant-gp  -mauto-pic  -mfused-madd @gol
928 -minline-float-divide-min-latency @gol
929 -minline-float-divide-max-throughput @gol
930 -mno-inline-float-divide @gol
931 -minline-int-divide-min-latency @gol
932 -minline-int-divide-max-throughput  @gol
933 -mno-inline-int-divide @gol
934 -minline-sqrt-min-latency  -minline-sqrt-max-throughput @gol
935 -mno-inline-sqrt @gol
936 -mdwarf2-asm  -mearly-stop-bits @gol
937 -mfixed-range=@var{register-range}  -mtls-size=@var{tls-size} @gol
938 -mtune=@var{cpu-type}  -milp32  -mlp64 @gol
939 -msched-br-data-spec  -msched-ar-data-spec  -msched-control-spec @gol
940 -msched-br-in-data-spec  -msched-ar-in-data-spec  -msched-in-control-spec @gol
941 -msched-spec-ldc  -msched-spec-control-ldc @gol
942 -msched-prefer-non-data-spec-insns  -msched-prefer-non-control-spec-insns @gol
943 -msched-stop-bits-after-every-cycle  -msched-count-spec-in-critical-path @gol
944 -msel-sched-dont-check-control-spec  -msched-fp-mem-deps-zero-cost @gol
945 -msched-max-memory-insns-hard-limit  -msched-max-memory-insns=@var{max-insns}}
946
947 @emph{LM32 Options}
948 @gccoptlist{-mbarrel-shift-enabled  -mdivide-enabled  -mmultiply-enabled @gol
949 -msign-extend-enabled  -muser-enabled}
950
951 @emph{M32R/D Options}
952 @gccoptlist{-m32r2  -m32rx  -m32r @gol
953 -mdebug @gol
954 -malign-loops  -mno-align-loops @gol
955 -missue-rate=@var{number} @gol
956 -mbranch-cost=@var{number} @gol
957 -mmodel=@var{code-size-model-type} @gol
958 -msdata=@var{sdata-type} @gol
959 -mno-flush-func  -mflush-func=@var{name} @gol
960 -mno-flush-trap  -mflush-trap=@var{number} @gol
961 -G @var{num}}
962
963 @emph{M32C Options}
964 @gccoptlist{-mcpu=@var{cpu}  -msim  -memregs=@var{number}}
965
966 @emph{M680x0 Options}
967 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
968 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
969 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
970 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
971 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
972 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
973 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
974 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
975 -mxgot  -mno-xgot  -mlong-jump-table-offsets}
976
977 @emph{MCore Options}
978 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
979 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
980 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
981 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
982 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
983
984 @emph{MeP Options}
985 @gccoptlist{-mabsdiff  -mall-opts  -maverage  -mbased=@var{n}  -mbitops @gol
986 -mc=@var{n}  -mclip  -mconfig=@var{name}  -mcop  -mcop32  -mcop64  -mivc2 @gol
987 -mdc  -mdiv  -meb  -mel  -mio-volatile  -ml  -mleadz  -mm  -mminmax @gol
988 -mmult  -mno-opts  -mrepeat  -ms  -msatur  -msdram  -msim  -msimnovec  -mtf @gol
989 -mtiny=@var{n}}
990
991 @emph{MicroBlaze Options}
992 @gccoptlist{-msoft-float  -mhard-float  -msmall-divides  -mcpu=@var{cpu} @gol
993 -mmemcpy  -mxl-soft-mul  -mxl-soft-div  -mxl-barrel-shift @gol
994 -mxl-pattern-compare  -mxl-stack-check  -mxl-gp-opt  -mno-clearbss @gol
995 -mxl-multiply-high  -mxl-float-convert  -mxl-float-sqrt @gol
996 -mbig-endian  -mlittle-endian  -mxl-reorder  -mxl-mode-@var{app-model} @gol
997 -mpic-data-is-text-relative}
998
999 @emph{MIPS Options}
1000 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
1001 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
1002 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
1003 -mips16  -mno-mips16  -mflip-mips16 @gol
1004 -minterlink-compressed  -mno-interlink-compressed @gol
1005 -minterlink-mips16  -mno-interlink-mips16 @gol
1006 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
1007 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
1008 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
1009 -mno-float  -msingle-float  -mdouble-float @gol
1010 -modd-spreg  -mno-odd-spreg @gol
1011 -mabs=@var{mode}  -mnan=@var{encoding} @gol
1012 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
1013 -mmcu  -mmno-mcu @gol
1014 -meva  -mno-eva @gol
1015 -mvirt  -mno-virt @gol
1016 -mxpa  -mno-xpa @gol
1017 -mcrc  -mno-crc @gol
1018 -mginv  -mno-ginv @gol
1019 -mmicromips  -mno-micromips @gol
1020 -mmsa  -mno-msa @gol
1021 -mloongson-mmi  -mno-loongson-mmi @gol
1022 -mloongson-ext  -mno-loongson-ext @gol
1023 -mloongson-ext2  -mno-loongson-ext2 @gol
1024 -mfpu=@var{fpu-type} @gol
1025 -msmartmips  -mno-smartmips @gol
1026 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
1027 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
1028 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
1029 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
1030 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
1031 -membedded-data  -mno-embedded-data @gol
1032 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
1033 -mcode-readable=@var{setting} @gol
1034 -msplit-addresses  -mno-split-addresses @gol
1035 -mexplicit-relocs  -mno-explicit-relocs @gol
1036 -mcheck-zero-division  -mno-check-zero-division @gol
1037 -mdivide-traps  -mdivide-breaks @gol
1038 -mload-store-pairs  -mno-load-store-pairs @gol
1039 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
1040 -mmad  -mno-mad  -mimadd  -mno-imadd  -mfused-madd  -mno-fused-madd  -nocpp @gol
1041 -mfix-24k  -mno-fix-24k @gol
1042 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
1043 -mfix-r5900  -mno-fix-r5900 @gol
1044 -mfix-r10000  -mno-fix-r10000  -mfix-rm7000  -mno-fix-rm7000 @gol
1045 -mfix-vr4120  -mno-fix-vr4120 @gol
1046 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
1047 -mflush-func=@var{func}  -mno-flush-func @gol
1048 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
1049 -mcompact-branches=@var{policy} @gol
1050 -mfp-exceptions  -mno-fp-exceptions @gol
1051 -mvr4130-align  -mno-vr4130-align  -msynci  -mno-synci @gol
1052 -mlxc1-sxc1  -mno-lxc1-sxc1  -mmadd4  -mno-madd4 @gol
1053 -mrelax-pic-calls  -mno-relax-pic-calls  -mmcount-ra-address @gol
1054 -mframe-header-opt  -mno-frame-header-opt}
1055
1056 @emph{MMIX Options}
1057 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
1058 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
1059 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
1060 -mno-base-addresses  -msingle-exit  -mno-single-exit}
1061
1062 @emph{MN10300 Options}
1063 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
1064 -mno-am33  -mam33  -mam33-2  -mam34 @gol
1065 -mtune=@var{cpu-type} @gol
1066 -mreturn-pointer-on-d0 @gol
1067 -mno-crt0  -mrelax  -mliw  -msetlb}
1068
1069 @emph{Moxie Options}
1070 @gccoptlist{-meb  -mel  -mmul.x  -mno-crt0}
1071
1072 @emph{MSP430 Options}
1073 @gccoptlist{-msim  -masm-hex  -mmcu=  -mcpu=  -mlarge  -msmall  -mrelax @gol
1074 -mwarn-mcu @gol
1075 -mcode-region=  -mdata-region= @gol
1076 -msilicon-errata=  -msilicon-errata-warn= @gol
1077 -mhwmult=  -minrt  -mtiny-printf}
1078
1079 @emph{NDS32 Options}
1080 @gccoptlist{-mbig-endian  -mlittle-endian @gol
1081 -mreduced-regs  -mfull-regs @gol
1082 -mcmov  -mno-cmov @gol
1083 -mext-perf  -mno-ext-perf @gol
1084 -mext-perf2  -mno-ext-perf2 @gol
1085 -mext-string  -mno-ext-string @gol
1086 -mv3push  -mno-v3push @gol
1087 -m16bit  -mno-16bit @gol
1088 -misr-vector-size=@var{num} @gol
1089 -mcache-block-size=@var{num} @gol
1090 -march=@var{arch} @gol
1091 -mcmodel=@var{code-model} @gol
1092 -mctor-dtor  -mrelax}
1093
1094 @emph{Nios II Options}
1095 @gccoptlist{-G @var{num}  -mgpopt=@var{option}  -mgpopt  -mno-gpopt @gol
1096 -mgprel-sec=@var{regexp}  -mr0rel-sec=@var{regexp} @gol
1097 -mel  -meb @gol
1098 -mno-bypass-cache  -mbypass-cache @gol
1099 -mno-cache-volatile  -mcache-volatile @gol
1100 -mno-fast-sw-div  -mfast-sw-div @gol
1101 -mhw-mul  -mno-hw-mul  -mhw-mulx  -mno-hw-mulx  -mno-hw-div  -mhw-div @gol
1102 -mcustom-@var{insn}=@var{N}  -mno-custom-@var{insn} @gol
1103 -mcustom-fpu-cfg=@var{name} @gol
1104 -mhal  -msmallc  -msys-crt0=@var{name}  -msys-lib=@var{name} @gol
1105 -march=@var{arch}  -mbmx  -mno-bmx  -mcdx  -mno-cdx}
1106
1107 @emph{Nvidia PTX Options}
1108 @gccoptlist{-m32  -m64  -mmainkernel  -moptimize}
1109
1110 @emph{OpenRISC Options}
1111 @gccoptlist{-mboard=@var{name}  -mnewlib  -mhard-mul  -mhard-div @gol
1112 -msoft-mul  -msoft-div @gol
1113 -msoft-float  -mhard-float  -mdouble-float -munordered-float @gol
1114 -mcmov  -mror  -mrori  -msext  -msfimm  -mshftimm}
1115
1116 @emph{PDP-11 Options}
1117 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
1118 -mint32  -mno-int16  -mint16  -mno-int32 @gol
1119 -msplit  -munix-asm  -mdec-asm  -mgnu-asm  -mlra}
1120
1121 @emph{picoChip Options}
1122 @gccoptlist{-mae=@var{ae_type}  -mvliw-lookahead=@var{N} @gol
1123 -msymbol-as-address  -mno-inefficient-warnings}
1124
1125 @emph{PowerPC Options}
1126 See RS/6000 and PowerPC Options.
1127
1128 @emph{PRU Options}
1129 @gccoptlist{-mmcu=@var{mcu}  -minrt  -mno-relax  -mloop @gol
1130 -mabi=@var{variant} @gol}
1131
1132 @emph{RISC-V Options}
1133 @gccoptlist{-mbranch-cost=@var{N-instruction} @gol
1134 -mplt  -mno-plt @gol
1135 -mabi=@var{ABI-string} @gol
1136 -mfdiv  -mno-fdiv @gol
1137 -mdiv  -mno-div @gol
1138 -march=@var{ISA-string} @gol
1139 -mtune=@var{processor-string} @gol
1140 -mpreferred-stack-boundary=@var{num} @gol
1141 -msmall-data-limit=@var{N-bytes} @gol
1142 -msave-restore  -mno-save-restore @gol
1143 -mstrict-align  -mno-strict-align @gol
1144 -mcmodel=medlow  -mcmodel=medany @gol
1145 -mexplicit-relocs  -mno-explicit-relocs @gol
1146 -mrelax  -mno-relax @gol
1147 -mriscv-attribute  -mmo-riscv-attribute @gol
1148 -malign-data=@var{type}}
1149
1150 @emph{RL78 Options}
1151 @gccoptlist{-msim  -mmul=none  -mmul=g13  -mmul=g14  -mallregs @gol
1152 -mcpu=g10  -mcpu=g13  -mcpu=g14  -mg10  -mg13  -mg14 @gol
1153 -m64bit-doubles  -m32bit-doubles  -msave-mduc-in-interrupts}
1154
1155 @emph{RS/6000 and PowerPC Options}
1156 @gccoptlist{-mcpu=@var{cpu-type} @gol
1157 -mtune=@var{cpu-type} @gol
1158 -mcmodel=@var{code-model} @gol
1159 -mpowerpc64 @gol
1160 -maltivec  -mno-altivec @gol
1161 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
1162 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
1163 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mpopcntd  -mno-popcntd @gol
1164 -mfprnd  -mno-fprnd @gol
1165 -mcmpb  -mno-cmpb  -mhard-dfp  -mno-hard-dfp @gol
1166 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
1167 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
1168 -malign-power  -malign-natural @gol
1169 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
1170 -mupdate  -mno-update @gol
1171 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
1172 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
1173 -mstrict-align  -mno-strict-align  -mrelocatable @gol
1174 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
1175 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
1176 -mdynamic-no-pic  -mswdiv  -msingle-pic-base @gol
1177 -mprioritize-restricted-insns=@var{priority} @gol
1178 -msched-costly-dep=@var{dependence_type} @gol
1179 -minsert-sched-nops=@var{scheme} @gol
1180 -mcall-aixdesc  -mcall-eabi  -mcall-freebsd  @gol
1181 -mcall-linux  -mcall-netbsd  -mcall-openbsd  @gol
1182 -mcall-sysv  -mcall-sysv-eabi  -mcall-sysv-noeabi @gol
1183 -mtraceback=@var{traceback_type} @gol
1184 -maix-struct-return  -msvr4-struct-return @gol
1185 -mabi=@var{abi-type}  -msecure-plt  -mbss-plt @gol
1186 -mlongcall  -mno-longcall  -mpltseq  -mno-pltseq  @gol
1187 -mblock-move-inline-limit=@var{num} @gol
1188 -mblock-compare-inline-limit=@var{num} @gol
1189 -mblock-compare-inline-loop-limit=@var{num} @gol
1190 -mstring-compare-inline-limit=@var{num} @gol
1191 -misel  -mno-isel @gol
1192 -mvrsave  -mno-vrsave @gol
1193 -mmulhw  -mno-mulhw @gol
1194 -mdlmzb  -mno-dlmzb @gol
1195 -mprototype  -mno-prototype @gol
1196 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
1197 -msdata=@var{opt}  -mreadonly-in-sdata  -mvxworks  -G @var{num} @gol
1198 -mrecip  -mrecip=@var{opt}  -mno-recip  -mrecip-precision @gol
1199 -mno-recip-precision @gol
1200 -mveclibabi=@var{type}  -mfriz  -mno-friz @gol
1201 -mpointers-to-nested-functions  -mno-pointers-to-nested-functions @gol
1202 -msave-toc-indirect  -mno-save-toc-indirect @gol
1203 -mpower8-fusion  -mno-mpower8-fusion  -mpower8-vector  -mno-power8-vector @gol
1204 -mcrypto  -mno-crypto  -mhtm  -mno-htm @gol
1205 -mquad-memory  -mno-quad-memory @gol
1206 -mquad-memory-atomic  -mno-quad-memory-atomic @gol
1207 -mcompat-align-parm  -mno-compat-align-parm @gol
1208 -mfloat128  -mno-float128  -mfloat128-hardware  -mno-float128-hardware @gol
1209 -mgnu-attribute  -mno-gnu-attribute @gol
1210 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
1211 -mstack-protector-guard-offset=@var{offset} -mprefixed -mno-prefixed @gol
1212 -mpcrel -mno-pcrel}
1213
1214 @emph{RX Options}
1215 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
1216 -mcpu=@gol
1217 -mbig-endian-data  -mlittle-endian-data @gol
1218 -msmall-data @gol
1219 -msim  -mno-sim@gol
1220 -mas100-syntax  -mno-as100-syntax@gol
1221 -mrelax@gol
1222 -mmax-constant-size=@gol
1223 -mint-register=@gol
1224 -mpid@gol
1225 -mallow-string-insns  -mno-allow-string-insns@gol
1226 -mjsr@gol
1227 -mno-warn-multiple-fast-interrupts@gol
1228 -msave-acc-in-interrupts}
1229
1230 @emph{S/390 and zSeries Options}
1231 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1232 -mhard-float  -msoft-float  -mhard-dfp  -mno-hard-dfp @gol
1233 -mlong-double-64  -mlong-double-128 @gol
1234 -mbackchain  -mno-backchain  -mpacked-stack  -mno-packed-stack @gol
1235 -msmall-exec  -mno-small-exec  -mmvcle  -mno-mvcle @gol
1236 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
1237 -mhtm  -mvx  -mzvector @gol
1238 -mtpf-trace  -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
1239 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size  -mstack-guard @gol
1240 -mhotpatch=@var{halfwords},@var{halfwords}}
1241
1242 @emph{Score Options}
1243 @gccoptlist{-meb  -mel @gol
1244 -mnhwloop @gol
1245 -muls @gol
1246 -mmac @gol
1247 -mscore5  -mscore5u  -mscore7  -mscore7d}
1248
1249 @emph{SH Options}
1250 @gccoptlist{-m1  -m2  -m2e @gol
1251 -m2a-nofpu  -m2a-single-only  -m2a-single  -m2a @gol
1252 -m3  -m3e @gol
1253 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
1254 -m4a-nofpu  -m4a-single-only  -m4a-single  -m4a  -m4al @gol
1255 -mb  -ml  -mdalign  -mrelax @gol
1256 -mbigtable  -mfmovd  -mrenesas  -mno-renesas  -mnomacsave @gol
1257 -mieee  -mno-ieee  -mbitops  -misize  -minline-ic_invalidate  -mpadstruct @gol
1258 -mprefergot  -musermode  -multcost=@var{number}  -mdiv=@var{strategy} @gol
1259 -mdivsi3_libfunc=@var{name}  -mfixed-range=@var{register-range} @gol
1260 -maccumulate-outgoing-args @gol
1261 -matomic-model=@var{atomic-model} @gol
1262 -mbranch-cost=@var{num}  -mzdcbranch  -mno-zdcbranch @gol
1263 -mcbranch-force-delay-slot @gol
1264 -mfused-madd  -mno-fused-madd  -mfsca  -mno-fsca  -mfsrra  -mno-fsrra @gol
1265 -mpretend-cmove  -mtas}
1266
1267 @emph{Solaris 2 Options}
1268 @gccoptlist{-mclear-hwcap  -mno-clear-hwcap  -mimpure-text  -mno-impure-text @gol
1269 -pthreads}
1270
1271 @emph{SPARC Options}
1272 @gccoptlist{-mcpu=@var{cpu-type} @gol
1273 -mtune=@var{cpu-type} @gol
1274 -mcmodel=@var{code-model} @gol
1275 -mmemory-model=@var{mem-model} @gol
1276 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1277 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1278 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1279 -mhard-quad-float  -msoft-quad-float @gol
1280 -mstack-bias  -mno-stack-bias @gol
1281 -mstd-struct-return  -mno-std-struct-return @gol
1282 -munaligned-doubles  -mno-unaligned-doubles @gol
1283 -muser-mode  -mno-user-mode @gol
1284 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1285 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1286 -mvis4  -mno-vis4  -mvis4b  -mno-vis4b @gol
1287 -mcbcond  -mno-cbcond  -mfmaf  -mno-fmaf  -mfsmuld  -mno-fsmuld  @gol
1288 -mpopc  -mno-popc  -msubxc  -mno-subxc @gol
1289 -mfix-at697f  -mfix-ut699  -mfix-ut700  -mfix-gr712rc @gol
1290 -mlra  -mno-lra}
1291
1292 @emph{System V Options}
1293 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1294
1295 @emph{TILE-Gx Options}
1296 @gccoptlist{-mcpu=CPU  -m32  -m64  -mbig-endian  -mlittle-endian @gol
1297 -mcmodel=@var{code-model}}
1298
1299 @emph{TILEPro Options}
1300 @gccoptlist{-mcpu=@var{cpu}  -m32}
1301
1302 @emph{V850 Options}
1303 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1304 -mprolog-function  -mno-prolog-function  -mspace @gol
1305 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1306 -mapp-regs  -mno-app-regs @gol
1307 -mdisable-callt  -mno-disable-callt @gol
1308 -mv850e2v3  -mv850e2  -mv850e1  -mv850es @gol
1309 -mv850e  -mv850  -mv850e3v5 @gol
1310 -mloop @gol
1311 -mrelax @gol
1312 -mlong-jumps @gol
1313 -msoft-float @gol
1314 -mhard-float @gol
1315 -mgcc-abi @gol
1316 -mrh850-abi @gol
1317 -mbig-switch}
1318
1319 @emph{VAX Options}
1320 @gccoptlist{-mg  -mgnu  -munix}
1321
1322 @emph{Visium Options}
1323 @gccoptlist{-mdebug  -msim  -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1324 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type}  -msv-mode  -muser-mode}
1325
1326 @emph{VMS Options}
1327 @gccoptlist{-mvms-return-codes  -mdebug-main=@var{prefix}  -mmalloc64 @gol
1328 -mpointer-size=@var{size}}
1329
1330 @emph{VxWorks Options}
1331 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1332 -Xbind-lazy  -Xbind-now}
1333
1334 @emph{x86 Options}
1335 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1336 -mtune-ctrl=@var{feature-list}  -mdump-tune-features  -mno-default @gol
1337 -mfpmath=@var{unit} @gol
1338 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1339 -mno-fp-ret-in-387  -m80387  -mhard-float  -msoft-float @gol
1340 -mno-wide-multiply  -mrtd  -malign-double @gol
1341 -mpreferred-stack-boundary=@var{num} @gol
1342 -mincoming-stack-boundary=@var{num} @gol
1343 -mcld  -mcx16  -msahf  -mmovbe  -mcrc32 @gol
1344 -mrecip  -mrecip=@var{opt} @gol
1345 -mvzeroupper  -mprefer-avx128  -mprefer-vector-width=@var{opt} @gol
1346 -mmmx  -msse  -msse2  -msse3  -mssse3  -msse4.1  -msse4.2  -msse4  -mavx @gol
1347 -mavx2  -mavx512f  -mavx512pf  -mavx512er  -mavx512cd  -mavx512vl @gol
1348 -mavx512bw  -mavx512dq  -mavx512ifma  -mavx512vbmi  -msha  -maes @gol
1349 -mpclmul  -mfsgsbase  -mrdrnd  -mf16c  -mfma  -mpconfig  -mwbnoinvd  @gol
1350 -mptwrite  -mprefetchwt1  -mclflushopt  -mclwb  -mxsavec  -mxsaves @gol
1351 -msse4a  -m3dnow  -m3dnowa  -mpopcnt  -mabm  -mbmi  -mtbm  -mfma4  -mxop @gol
1352 -madx  -mlzcnt  -mbmi2  -mfxsr  -mxsave  -mxsaveopt  -mrtm  -mhle  -mlwp @gol
1353 -mmwaitx  -mclzero  -mpku  -mthreads  -mgfni  -mvaes  -mwaitpkg @gol
1354 -mshstk -mmanual-endbr -mforce-indirect-call  -mavx512vbmi2 -mavx512bf16 -menqcmd @gol
1355 -mvpclmulqdq  -mavx512bitalg  -mmovdiri  -mmovdir64b  -mavx512vpopcntdq @gol
1356 -mavx5124fmaps  -mavx512vnni  -mavx5124vnniw  -mprfchw  -mrdpid @gol
1357 -mrdseed  -msgx -mavx512vp2intersect@gol
1358 -mcldemote  -mms-bitfields  -mno-align-stringops  -minline-all-stringops @gol
1359 -minline-stringops-dynamically  -mstringop-strategy=@var{alg} @gol
1360 -mmemcpy-strategy=@var{strategy}  -mmemset-strategy=@var{strategy} @gol
1361 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1362 -m96bit-long-double  -mlong-double-64  -mlong-double-80  -mlong-double-128 @gol
1363 -mregparm=@var{num}  -msseregparm @gol
1364 -mveclibabi=@var{type}  -mvect8-ret-in-mem @gol
1365 -mpc32  -mpc64  -mpc80  -mstackrealign @gol
1366 -momit-leaf-frame-pointer  -mno-red-zone  -mno-tls-direct-seg-refs @gol
1367 -mcmodel=@var{code-model}  -mabi=@var{name}  -maddress-mode=@var{mode} @gol
1368 -m32  -m64  -mx32  -m16  -miamcu  -mlarge-data-threshold=@var{num} @gol
1369 -msse2avx  -mfentry  -mrecord-mcount  -mnop-mcount  -m8bit-idiv @gol
1370 -minstrument-return=@var{type} -mfentry-name=@var{name} -mfentry-section=@var{name} @gol
1371 -mavx256-split-unaligned-load  -mavx256-split-unaligned-store @gol
1372 -malign-data=@var{type}  -mstack-protector-guard=@var{guard} @gol
1373 -mstack-protector-guard-reg=@var{reg} @gol
1374 -mstack-protector-guard-offset=@var{offset} @gol
1375 -mstack-protector-guard-symbol=@var{symbol} @gol
1376 -mgeneral-regs-only  -mcall-ms2sysv-xlogues @gol
1377 -mindirect-branch=@var{choice}  -mfunction-return=@var{choice} @gol
1378 -mindirect-branch-register}
1379
1380 @emph{x86 Windows Options}
1381 @gccoptlist{-mconsole  -mcygwin  -mno-cygwin  -mdll @gol
1382 -mnop-fun-dllimport  -mthread @gol
1383 -municode  -mwin32  -mwindows  -fno-set-stack-executable}
1384
1385 @emph{Xstormy16 Options}
1386 @gccoptlist{-msim}
1387
1388 @emph{Xtensa Options}
1389 @gccoptlist{-mconst16  -mno-const16 @gol
1390 -mfused-madd  -mno-fused-madd @gol
1391 -mforce-no-pic @gol
1392 -mserialize-volatile  -mno-serialize-volatile @gol
1393 -mtext-section-literals  -mno-text-section-literals @gol
1394 -mauto-litpools  -mno-auto-litpools @gol
1395 -mtarget-align  -mno-target-align @gol
1396 -mlongcalls  -mno-longcalls}
1397
1398 @emph{zSeries Options}
1399 See S/390 and zSeries Options.
1400 @end table
1401
1402
1403 @node Overall Options
1404 @section Options Controlling the Kind of Output
1405
1406 Compilation can involve up to four stages: preprocessing, compilation
1407 proper, assembly and linking, always in that order.  GCC is capable of
1408 preprocessing and compiling several files either into several
1409 assembler input files, or into one assembler input file; then each
1410 assembler input file produces an object file, and linking combines all
1411 the object files (those newly compiled, and those specified as input)
1412 into an executable file.
1413
1414 @cindex file name suffix
1415 For any given input file, the file name suffix determines what kind of
1416 compilation is done:
1417
1418 @table @gcctabopt
1419 @item @var{file}.c
1420 C source code that must be preprocessed.
1421
1422 @item @var{file}.i
1423 C source code that should not be preprocessed.
1424
1425 @item @var{file}.ii
1426 C++ source code that should not be preprocessed.
1427
1428 @item @var{file}.m
1429 Objective-C source code.  Note that you must link with the @file{libobjc}
1430 library to make an Objective-C program work.
1431
1432 @item @var{file}.mi
1433 Objective-C source code that should not be preprocessed.
1434
1435 @item @var{file}.mm
1436 @itemx @var{file}.M
1437 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1438 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1439 to a literal capital M@.
1440
1441 @item @var{file}.mii
1442 Objective-C++ source code that should not be preprocessed.
1443
1444 @item @var{file}.h
1445 C, C++, Objective-C or Objective-C++ header file to be turned into a
1446 precompiled header (default), or C, C++ header file to be turned into an
1447 Ada spec (via the @option{-fdump-ada-spec} switch).
1448
1449 @item @var{file}.cc
1450 @itemx @var{file}.cp
1451 @itemx @var{file}.cxx
1452 @itemx @var{file}.cpp
1453 @itemx @var{file}.CPP
1454 @itemx @var{file}.c++
1455 @itemx @var{file}.C
1456 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1457 the last two letters must both be literally @samp{x}.  Likewise,
1458 @samp{.C} refers to a literal capital C@.
1459
1460 @item @var{file}.mm
1461 @itemx @var{file}.M
1462 Objective-C++ source code that must be preprocessed.
1463
1464 @item @var{file}.mii
1465 Objective-C++ source code that should not be preprocessed.
1466
1467 @item @var{file}.hh
1468 @itemx @var{file}.H
1469 @itemx @var{file}.hp
1470 @itemx @var{file}.hxx
1471 @itemx @var{file}.hpp
1472 @itemx @var{file}.HPP
1473 @itemx @var{file}.h++
1474 @itemx @var{file}.tcc
1475 C++ header file to be turned into a precompiled header or Ada spec.
1476
1477 @item @var{file}.f
1478 @itemx @var{file}.for
1479 @itemx @var{file}.ftn
1480 Fixed form Fortran source code that should not be preprocessed.
1481
1482 @item @var{file}.F
1483 @itemx @var{file}.FOR
1484 @itemx @var{file}.fpp
1485 @itemx @var{file}.FPP
1486 @itemx @var{file}.FTN
1487 Fixed form Fortran source code that must be preprocessed (with the traditional
1488 preprocessor).
1489
1490 @item @var{file}.f90
1491 @itemx @var{file}.f95
1492 @itemx @var{file}.f03
1493 @itemx @var{file}.f08
1494 Free form Fortran source code that should not be preprocessed.
1495
1496 @item @var{file}.F90
1497 @itemx @var{file}.F95
1498 @itemx @var{file}.F03
1499 @itemx @var{file}.F08
1500 Free form Fortran source code that must be preprocessed (with the
1501 traditional preprocessor).
1502
1503 @item @var{file}.go
1504 Go source code.
1505
1506 @item @var{file}.brig
1507 BRIG files (binary representation of HSAIL).
1508
1509 @item @var{file}.d
1510 D source code.
1511
1512 @item @var{file}.di
1513 D interface file.
1514
1515 @item @var{file}.dd
1516 D documentation code (Ddoc).
1517
1518 @item @var{file}.ads
1519 Ada source code file that contains a library unit declaration (a
1520 declaration of a package, subprogram, or generic, or a generic
1521 instantiation), or a library unit renaming declaration (a package,
1522 generic, or subprogram renaming declaration).  Such files are also
1523 called @dfn{specs}.
1524
1525 @item @var{file}.adb
1526 Ada source code file containing a library unit body (a subprogram or
1527 package body).  Such files are also called @dfn{bodies}.
1528
1529 @c GCC also knows about some suffixes for languages not yet included:
1530 @c Ratfor:
1531 @c @var{file}.r
1532
1533 @item @var{file}.s
1534 Assembler code.
1535
1536 @item @var{file}.S
1537 @itemx @var{file}.sx
1538 Assembler code that must be preprocessed.
1539
1540 @item @var{other}
1541 An object file to be fed straight into linking.
1542 Any file name with no recognized suffix is treated this way.
1543 @end table
1544
1545 @opindex x
1546 You can specify the input language explicitly with the @option{-x} option:
1547
1548 @table @gcctabopt
1549 @item -x @var{language}
1550 Specify explicitly the @var{language} for the following input files
1551 (rather than letting the compiler choose a default based on the file
1552 name suffix).  This option applies to all following input files until
1553 the next @option{-x} option.  Possible values for @var{language} are:
1554 @smallexample
1555 c  c-header  cpp-output
1556 c++  c++-header  c++-cpp-output
1557 objective-c  objective-c-header  objective-c-cpp-output
1558 objective-c++ objective-c++-header objective-c++-cpp-output
1559 assembler  assembler-with-cpp
1560 ada
1561 d
1562 f77  f77-cpp-input f95  f95-cpp-input
1563 go
1564 brig
1565 @end smallexample
1566
1567 @item -x none
1568 Turn off any specification of a language, so that subsequent files are
1569 handled according to their file name suffixes (as they are if @option{-x}
1570 has not been used at all).
1571 @end table
1572
1573 If you only want some of the stages of compilation, you can use
1574 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1575 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1576 @command{gcc} is to stop.  Note that some combinations (for example,
1577 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1578
1579 @table @gcctabopt
1580 @item -c
1581 @opindex c
1582 Compile or assemble the source files, but do not link.  The linking
1583 stage simply is not done.  The ultimate output is in the form of an
1584 object file for each source file.
1585
1586 By default, the object file name for a source file is made by replacing
1587 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1588
1589 Unrecognized input files, not requiring compilation or assembly, are
1590 ignored.
1591
1592 @item -S
1593 @opindex S
1594 Stop after the stage of compilation proper; do not assemble.  The output
1595 is in the form of an assembler code file for each non-assembler input
1596 file specified.
1597
1598 By default, the assembler file name for a source file is made by
1599 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1600
1601 Input files that don't require compilation are ignored.
1602
1603 @item -E
1604 @opindex E
1605 Stop after the preprocessing stage; do not run the compiler proper.  The
1606 output is in the form of preprocessed source code, which is sent to the
1607 standard output.
1608
1609 Input files that don't require preprocessing are ignored.
1610
1611 @cindex output file option
1612 @item -o @var{file}
1613 @opindex o
1614 Place output in file @var{file}.  This applies to whatever
1615 sort of output is being produced, whether it be an executable file,
1616 an object file, an assembler file or preprocessed C code.
1617
1618 If @option{-o} is not specified, the default is to put an executable
1619 file in @file{a.out}, the object file for
1620 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1621 assembler file in @file{@var{source}.s}, a precompiled header file in
1622 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1623 standard output.
1624
1625 @item -v
1626 @opindex v
1627 Print (on standard error output) the commands executed to run the stages
1628 of compilation.  Also print the version number of the compiler driver
1629 program and of the preprocessor and the compiler proper.
1630
1631 @item -###
1632 @opindex ###
1633 Like @option{-v} except the commands are not executed and arguments
1634 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1635 This is useful for shell scripts to capture the driver-generated command lines.
1636
1637 @item --help
1638 @opindex help
1639 Print (on the standard output) a description of the command-line options
1640 understood by @command{gcc}.  If the @option{-v} option is also specified
1641 then @option{--help} is also passed on to the various processes
1642 invoked by @command{gcc}, so that they can display the command-line options
1643 they accept.  If the @option{-Wextra} option has also been specified
1644 (prior to the @option{--help} option), then command-line options that
1645 have no documentation associated with them are also displayed.
1646
1647 @item --target-help
1648 @opindex target-help
1649 Print (on the standard output) a description of target-specific command-line
1650 options for each tool.  For some targets extra target-specific
1651 information may also be printed.
1652
1653 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1654 Print (on the standard output) a description of the command-line
1655 options understood by the compiler that fit into all specified classes
1656 and qualifiers.  These are the supported classes:
1657
1658 @table @asis
1659 @item @samp{optimizers}
1660 Display all of the optimization options supported by the
1661 compiler.
1662
1663 @item @samp{warnings}
1664 Display all of the options controlling warning messages
1665 produced by the compiler.
1666
1667 @item @samp{target}
1668 Display target-specific options.  Unlike the
1669 @option{--target-help} option however, target-specific options of the
1670 linker and assembler are not displayed.  This is because those
1671 tools do not currently support the extended @option{--help=} syntax.
1672
1673 @item @samp{params}
1674 Display the values recognized by the @option{--param}
1675 option.
1676
1677 @item @var{language}
1678 Display the options supported for @var{language}, where
1679 @var{language} is the name of one of the languages supported in this
1680 version of GCC@.
1681
1682 @item @samp{common}
1683 Display the options that are common to all languages.
1684 @end table
1685
1686 These are the supported qualifiers:
1687
1688 @table @asis
1689 @item @samp{undocumented}
1690 Display only those options that are undocumented.
1691
1692 @item @samp{joined}
1693 Display options taking an argument that appears after an equal
1694 sign in the same continuous piece of text, such as:
1695 @samp{--help=target}.
1696
1697 @item @samp{separate}
1698 Display options taking an argument that appears as a separate word
1699 following the original option, such as: @samp{-o output-file}.
1700 @end table
1701
1702 Thus for example to display all the undocumented target-specific
1703 switches supported by the compiler, use:
1704
1705 @smallexample
1706 --help=target,undocumented
1707 @end smallexample
1708
1709 The sense of a qualifier can be inverted by prefixing it with the
1710 @samp{^} character, so for example to display all binary warning
1711 options (i.e., ones that are either on or off and that do not take an
1712 argument) that have a description, use:
1713
1714 @smallexample
1715 --help=warnings,^joined,^undocumented
1716 @end smallexample
1717
1718 The argument to @option{--help=} should not consist solely of inverted
1719 qualifiers.
1720
1721 Combining several classes is possible, although this usually
1722 restricts the output so much that there is nothing to display.  One
1723 case where it does work, however, is when one of the classes is
1724 @var{target}.  For example, to display all the target-specific
1725 optimization options, use:
1726
1727 @smallexample
1728 --help=target,optimizers
1729 @end smallexample
1730
1731 The @option{--help=} option can be repeated on the command line.  Each
1732 successive use displays its requested class of options, skipping
1733 those that have already been displayed.  If @option{--help} is also
1734 specified anywhere on the command line then this takes precedence
1735 over any @option{--help=} option.
1736
1737 If the @option{-Q} option appears on the command line before the
1738 @option{--help=} option, then the descriptive text displayed by
1739 @option{--help=} is changed.  Instead of describing the displayed
1740 options, an indication is given as to whether the option is enabled,
1741 disabled or set to a specific value (assuming that the compiler
1742 knows this at the point where the @option{--help=} option is used).
1743
1744 Here is a truncated example from the ARM port of @command{gcc}:
1745
1746 @smallexample
1747   % gcc -Q -mabi=2 --help=target -c
1748   The following options are target specific:
1749   -mabi=                                2
1750   -mabort-on-noreturn                   [disabled]
1751   -mapcs                                [disabled]
1752 @end smallexample
1753
1754 The output is sensitive to the effects of previous command-line
1755 options, so for example it is possible to find out which optimizations
1756 are enabled at @option{-O2} by using:
1757
1758 @smallexample
1759 -Q -O2 --help=optimizers
1760 @end smallexample
1761
1762 Alternatively you can discover which binary optimizations are enabled
1763 by @option{-O3} by using:
1764
1765 @smallexample
1766 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1767 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1768 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1769 @end smallexample
1770
1771 @item --version
1772 @opindex version
1773 Display the version number and copyrights of the invoked GCC@.
1774
1775 @item -pass-exit-codes
1776 @opindex pass-exit-codes
1777 Normally the @command{gcc} program exits with the code of 1 if any
1778 phase of the compiler returns a non-success return code.  If you specify
1779 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1780 the numerically highest error produced by any phase returning an error
1781 indication.  The C, C++, and Fortran front ends return 4 if an internal
1782 compiler error is encountered.
1783
1784 @item -pipe
1785 @opindex pipe
1786 Use pipes rather than temporary files for communication between the
1787 various stages of compilation.  This fails to work on some systems where
1788 the assembler is unable to read from a pipe; but the GNU assembler has
1789 no trouble.
1790
1791 @item -specs=@var{file}
1792 @opindex specs
1793 Process @var{file} after the compiler reads in the standard @file{specs}
1794 file, in order to override the defaults which the @command{gcc} driver
1795 program uses when determining what switches to pass to @command{cc1},
1796 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
1797 @option{-specs=@var{file}} can be specified on the command line, and they
1798 are processed in order, from left to right.  @xref{Spec Files}, for
1799 information about the format of the @var{file}.
1800
1801 @item -wrapper
1802 @opindex wrapper
1803 Invoke all subcommands under a wrapper program.  The name of the
1804 wrapper program and its parameters are passed as a comma separated
1805 list.
1806
1807 @smallexample
1808 gcc -c t.c -wrapper gdb,--args
1809 @end smallexample
1810
1811 @noindent
1812 This invokes all subprograms of @command{gcc} under
1813 @samp{gdb --args}, thus the invocation of @command{cc1} is
1814 @samp{gdb --args cc1 @dots{}}.
1815
1816 @item -ffile-prefix-map=@var{old}=@var{new}
1817 @opindex ffile-prefix-map
1818 When compiling files residing in directory @file{@var{old}}, record
1819 any references to them in the result of the compilation as if the
1820 files resided in directory @file{@var{new}} instead.  Specifying this
1821 option is equivalent to specifying all the individual
1822 @option{-f*-prefix-map} options.  This can be used to make reproducible
1823 builds that are location independent.  See also
1824 @option{-fmacro-prefix-map} and @option{-fdebug-prefix-map}.
1825
1826 @item -fplugin=@var{name}.so
1827 @opindex fplugin
1828 Load the plugin code in file @var{name}.so, assumed to be a
1829 shared object to be dlopen'd by the compiler.  The base name of
1830 the shared object file is used to identify the plugin for the
1831 purposes of argument parsing (See
1832 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1833 Each plugin should define the callback functions specified in the
1834 Plugins API.
1835
1836 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1837 @opindex fplugin-arg
1838 Define an argument called @var{key} with a value of @var{value}
1839 for the plugin called @var{name}.
1840
1841 @item -fdump-ada-spec@r{[}-slim@r{]}
1842 @opindex fdump-ada-spec
1843 For C and C++ source and include files, generate corresponding Ada specs.
1844 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1845 GNAT User's Guide}, which provides detailed documentation on this feature.
1846
1847 @item -fada-spec-parent=@var{unit}
1848 @opindex fada-spec-parent
1849 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1850 Ada specs as child units of parent @var{unit}.
1851
1852 @item -fdump-go-spec=@var{file}
1853 @opindex fdump-go-spec
1854 For input files in any language, generate corresponding Go
1855 declarations in @var{file}.  This generates Go @code{const},
1856 @code{type}, @code{var}, and @code{func} declarations which may be a
1857 useful way to start writing a Go interface to code written in some
1858 other language.
1859
1860 @include @value{srcdir}/../libiberty/at-file.texi
1861 @end table
1862
1863 @node Invoking G++
1864 @section Compiling C++ Programs
1865
1866 @cindex suffixes for C++ source
1867 @cindex C++ source file suffixes
1868 C++ source files conventionally use one of the suffixes @samp{.C},
1869 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1870 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1871 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1872 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1873 files with these names and compiles them as C++ programs even if you
1874 call the compiler the same way as for compiling C programs (usually
1875 with the name @command{gcc}).
1876
1877 @findex g++
1878 @findex c++
1879 However, the use of @command{gcc} does not add the C++ library.
1880 @command{g++} is a program that calls GCC and automatically specifies linking
1881 against the C++ library.  It treats @samp{.c},
1882 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1883 files unless @option{-x} is used.  This program is also useful when
1884 precompiling a C header file with a @samp{.h} extension for use in C++
1885 compilations.  On many systems, @command{g++} is also installed with
1886 the name @command{c++}.
1887
1888 @cindex invoking @command{g++}
1889 When you compile C++ programs, you may specify many of the same
1890 command-line options that you use for compiling programs in any
1891 language; or command-line options meaningful for C and related
1892 languages; or options that are meaningful only for C++ programs.
1893 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1894 explanations of options for languages related to C@.
1895 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1896 explanations of options that are meaningful only for C++ programs.
1897
1898 @node C Dialect Options
1899 @section Options Controlling C Dialect
1900 @cindex dialect options
1901 @cindex language dialect options
1902 @cindex options, dialect
1903
1904 The following options control the dialect of C (or languages derived
1905 from C, such as C++, Objective-C and Objective-C++) that the compiler
1906 accepts:
1907
1908 @table @gcctabopt
1909 @cindex ANSI support
1910 @cindex ISO support
1911 @item -ansi
1912 @opindex ansi
1913 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1914 equivalent to @option{-std=c++98}.
1915
1916 This turns off certain features of GCC that are incompatible with ISO
1917 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1918 such as the @code{asm} and @code{typeof} keywords, and
1919 predefined macros such as @code{unix} and @code{vax} that identify the
1920 type of system you are using.  It also enables the undesirable and
1921 rarely used ISO trigraph feature.  For the C compiler,
1922 it disables recognition of C++ style @samp{//} comments as well as
1923 the @code{inline} keyword.
1924
1925 The alternate keywords @code{__asm__}, @code{__extension__},
1926 @code{__inline__} and @code{__typeof__} continue to work despite
1927 @option{-ansi}.  You would not want to use them in an ISO C program, of
1928 course, but it is useful to put them in header files that might be included
1929 in compilations done with @option{-ansi}.  Alternate predefined macros
1930 such as @code{__unix__} and @code{__vax__} are also available, with or
1931 without @option{-ansi}.
1932
1933 The @option{-ansi} option does not cause non-ISO programs to be
1934 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1935 addition to @option{-ansi}.  @xref{Warning Options}.
1936
1937 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1938 option is used.  Some header files may notice this macro and refrain
1939 from declaring certain functions or defining certain macros that the
1940 ISO standard doesn't call for; this is to avoid interfering with any
1941 programs that might use these names for other things.
1942
1943 Functions that are normally built in but do not have semantics
1944 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1945 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1946 built-in functions provided by GCC}, for details of the functions
1947 affected.
1948
1949 @item -std=
1950 @opindex std
1951 Determine the language standard. @xref{Standards,,Language Standards
1952 Supported by GCC}, for details of these standard versions.  This option
1953 is currently only supported when compiling C or C++.
1954
1955 The compiler can accept several base standards, such as @samp{c90} or
1956 @samp{c++98}, and GNU dialects of those standards, such as
1957 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1958 compiler accepts all programs following that standard plus those
1959 using GNU extensions that do not contradict it.  For example,
1960 @option{-std=c90} turns off certain features of GCC that are
1961 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1962 keywords, but not other GNU extensions that do not have a meaning in
1963 ISO C90, such as omitting the middle term of a @code{?:}
1964 expression. On the other hand, when a GNU dialect of a standard is
1965 specified, all features supported by the compiler are enabled, even when
1966 those features change the meaning of the base standard.  As a result, some
1967 strict-conforming programs may be rejected.  The particular standard
1968 is used by @option{-Wpedantic} to identify which features are GNU
1969 extensions given that version of the standard. For example
1970 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1971 comments, while @option{-std=gnu99 -Wpedantic} does not.
1972
1973 A value for this option must be provided; possible values are
1974
1975 @table @samp
1976 @item c90
1977 @itemx c89
1978 @itemx iso9899:1990
1979 Support all ISO C90 programs (certain GNU extensions that conflict
1980 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1981
1982 @item iso9899:199409
1983 ISO C90 as modified in amendment 1.
1984
1985 @item c99
1986 @itemx c9x
1987 @itemx iso9899:1999
1988 @itemx iso9899:199x
1989 ISO C99.  This standard is substantially completely supported, modulo
1990 bugs and floating-point issues
1991 (mainly but not entirely relating to optional C99 features from
1992 Annexes F and G).  See
1993 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1994 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1995
1996 @item c11
1997 @itemx c1x
1998 @itemx iso9899:2011
1999 ISO C11, the 2011 revision of the ISO C standard.  This standard is
2000 substantially completely supported, modulo bugs, floating-point issues
2001 (mainly but not entirely relating to optional C11 features from
2002 Annexes F and G) and the optional Annexes K (Bounds-checking
2003 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
2004
2005 @item c17
2006 @itemx c18
2007 @itemx iso9899:2017
2008 @itemx iso9899:2018
2009 ISO C17, the 2017 revision of the ISO C standard
2010 (published in 2018).  This standard is
2011 same as C11 except for corrections of defects (all of which are also
2012 applied with @option{-std=c11}) and a new value of
2013 @code{__STDC_VERSION__}, and so is supported to the same extent as C11.
2014
2015 @item c2x
2016 The next version of the ISO C standard, still under development.  The
2017 support for this version is experimental and incomplete.
2018
2019 @item gnu90
2020 @itemx gnu89
2021 GNU dialect of ISO C90 (including some C99 features).
2022
2023 @item gnu99
2024 @itemx gnu9x
2025 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
2026
2027 @item gnu11
2028 @itemx gnu1x
2029 GNU dialect of ISO C11.
2030 The name @samp{gnu1x} is deprecated.
2031
2032 @item gnu17
2033 @itemx gnu18
2034 GNU dialect of ISO C17.  This is the default for C code.
2035
2036 @item gnu2x
2037 The next version of the ISO C standard, still under development, plus
2038 GNU extensions.  The support for this version is experimental and
2039 incomplete.
2040
2041 @item c++98
2042 @itemx c++03
2043 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
2044 additional defect reports. Same as @option{-ansi} for C++ code.
2045
2046 @item gnu++98
2047 @itemx gnu++03
2048 GNU dialect of @option{-std=c++98}.
2049
2050 @item c++11
2051 @itemx c++0x
2052 The 2011 ISO C++ standard plus amendments.
2053 The name @samp{c++0x} is deprecated.
2054
2055 @item gnu++11
2056 @itemx gnu++0x
2057 GNU dialect of @option{-std=c++11}.
2058 The name @samp{gnu++0x} is deprecated.
2059
2060 @item c++14
2061 @itemx c++1y
2062 The 2014 ISO C++ standard plus amendments.
2063 The name @samp{c++1y} is deprecated.
2064
2065 @item gnu++14
2066 @itemx gnu++1y
2067 GNU dialect of @option{-std=c++14}.
2068 This is the default for C++ code.
2069 The name @samp{gnu++1y} is deprecated.
2070
2071 @item c++17
2072 @itemx c++1z
2073 The 2017 ISO C++ standard plus amendments.
2074 The name @samp{c++1z} is deprecated.
2075
2076 @item gnu++17
2077 @itemx gnu++1z
2078 GNU dialect of @option{-std=c++17}.
2079 The name @samp{gnu++1z} is deprecated.
2080
2081 @item c++2a
2082 The next revision of the ISO C++ standard, tentatively planned for
2083 2020.  Support is highly experimental, and will almost certainly
2084 change in incompatible ways in future releases.
2085
2086 @item gnu++2a
2087 GNU dialect of @option{-std=c++2a}.  Support is highly experimental,
2088 and will almost certainly change in incompatible ways in future
2089 releases.
2090 @end table
2091
2092 @item -fgnu89-inline
2093 @opindex fgnu89-inline
2094 The option @option{-fgnu89-inline} tells GCC to use the traditional
2095 GNU semantics for @code{inline} functions when in C99 mode.
2096 @xref{Inline,,An Inline Function is As Fast As a Macro}.
2097 Using this option is roughly equivalent to adding the
2098 @code{gnu_inline} function attribute to all inline functions
2099 (@pxref{Function Attributes}).
2100
2101 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
2102 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
2103 specifies the default behavior).
2104 This option is not supported in @option{-std=c90} or
2105 @option{-std=gnu90} mode.
2106
2107 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
2108 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
2109 in effect for @code{inline} functions.  @xref{Common Predefined
2110 Macros,,,cpp,The C Preprocessor}.
2111
2112 @item -fpermitted-flt-eval-methods=@var{style}
2113 @opindex fpermitted-flt-eval-methods
2114 @opindex fpermitted-flt-eval-methods=c11
2115 @opindex fpermitted-flt-eval-methods=ts-18661-3
2116 ISO/IEC TS 18661-3 defines new permissible values for
2117 @code{FLT_EVAL_METHOD} that indicate that operations and constants with
2118 a semantic type that is an interchange or extended format should be
2119 evaluated to the precision and range of that type.  These new values are
2120 a superset of those permitted under C99/C11, which does not specify the
2121 meaning of other positive values of @code{FLT_EVAL_METHOD}.  As such, code
2122 conforming to C11 may not have been written expecting the possibility of
2123 the new values.
2124
2125 @option{-fpermitted-flt-eval-methods} specifies whether the compiler
2126 should allow only the values of @code{FLT_EVAL_METHOD} specified in C99/C11,
2127 or the extended set of values specified in ISO/IEC TS 18661-3.
2128
2129 @var{style} is either @code{c11} or @code{ts-18661-3} as appropriate.
2130
2131 The default when in a standards compliant mode (@option{-std=c11} or similar)
2132 is @option{-fpermitted-flt-eval-methods=c11}.  The default when in a GNU
2133 dialect (@option{-std=gnu11} or similar) is
2134 @option{-fpermitted-flt-eval-methods=ts-18661-3}.
2135
2136 @item -aux-info @var{filename}
2137 @opindex aux-info
2138 Output to the given filename prototyped declarations for all functions
2139 declared and/or defined in a translation unit, including those in header
2140 files.  This option is silently ignored in any language other than C@.
2141
2142 Besides declarations, the file indicates, in comments, the origin of
2143 each declaration (source file and line), whether the declaration was
2144 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
2145 @samp{O} for old, respectively, in the first character after the line
2146 number and the colon), and whether it came from a declaration or a
2147 definition (@samp{C} or @samp{F}, respectively, in the following
2148 character).  In the case of function definitions, a K&R-style list of
2149 arguments followed by their declarations is also provided, inside
2150 comments, after the declaration.
2151
2152 @item -fallow-parameterless-variadic-functions
2153 @opindex fallow-parameterless-variadic-functions
2154 Accept variadic functions without named parameters.
2155
2156 Although it is possible to define such a function, this is not very
2157 useful as it is not possible to read the arguments.  This is only
2158 supported for C as this construct is allowed by C++.
2159
2160 @item -fno-asm
2161 @opindex fno-asm
2162 @opindex fasm
2163 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
2164 keyword, so that code can use these words as identifiers.  You can use
2165 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
2166 instead.  @option{-ansi} implies @option{-fno-asm}.
2167
2168 In C++, this switch only affects the @code{typeof} keyword, since
2169 @code{asm} and @code{inline} are standard keywords.  You may want to
2170 use the @option{-fno-gnu-keywords} flag instead, which has the same
2171 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
2172 switch only affects the @code{asm} and @code{typeof} keywords, since
2173 @code{inline} is a standard keyword in ISO C99.
2174
2175 @item -fno-builtin
2176 @itemx -fno-builtin-@var{function}
2177 @opindex fno-builtin
2178 @opindex fbuiltin
2179 @cindex built-in functions
2180 Don't recognize built-in functions that do not begin with
2181 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
2182 functions provided by GCC}, for details of the functions affected,
2183 including those which are not built-in functions when @option{-ansi} or
2184 @option{-std} options for strict ISO C conformance are used because they
2185 do not have an ISO standard meaning.
2186
2187 GCC normally generates special code to handle certain built-in functions
2188 more efficiently; for instance, calls to @code{alloca} may become single
2189 instructions which adjust the stack directly, and calls to @code{memcpy}
2190 may become inline copy loops.  The resulting code is often both smaller
2191 and faster, but since the function calls no longer appear as such, you
2192 cannot set a breakpoint on those calls, nor can you change the behavior
2193 of the functions by linking with a different library.  In addition,
2194 when a function is recognized as a built-in function, GCC may use
2195 information about that function to warn about problems with calls to
2196 that function, or to generate more efficient code, even if the
2197 resulting code still contains calls to that function.  For example,
2198 warnings are given with @option{-Wformat} for bad calls to
2199 @code{printf} when @code{printf} is built in and @code{strlen} is
2200 known not to modify global memory.
2201
2202 With the @option{-fno-builtin-@var{function}} option
2203 only the built-in function @var{function} is
2204 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
2205 function is named that is not built-in in this version of GCC, this
2206 option is ignored.  There is no corresponding
2207 @option{-fbuiltin-@var{function}} option; if you wish to enable
2208 built-in functions selectively when using @option{-fno-builtin} or
2209 @option{-ffreestanding}, you may define macros such as:
2210
2211 @smallexample
2212 #define abs(n)          __builtin_abs ((n))
2213 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
2214 @end smallexample
2215
2216 @item -fgimple
2217 @opindex fgimple
2218
2219 Enable parsing of function definitions marked with @code{__GIMPLE}.
2220 This is an experimental feature that allows unit testing of GIMPLE
2221 passes.
2222
2223 @item -fhosted
2224 @opindex fhosted
2225 @cindex hosted environment
2226
2227 Assert that compilation targets a hosted environment.  This implies
2228 @option{-fbuiltin}.  A hosted environment is one in which the
2229 entire standard library is available, and in which @code{main} has a return
2230 type of @code{int}.  Examples are nearly everything except a kernel.
2231 This is equivalent to @option{-fno-freestanding}.
2232
2233 @item -ffreestanding
2234 @opindex ffreestanding
2235 @cindex hosted environment
2236
2237 Assert that compilation targets a freestanding environment.  This
2238 implies @option{-fno-builtin}.  A freestanding environment
2239 is one in which the standard library may not exist, and program startup may
2240 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
2241 This is equivalent to @option{-fno-hosted}.
2242
2243 @xref{Standards,,Language Standards Supported by GCC}, for details of
2244 freestanding and hosted environments.
2245
2246 @item -fopenacc
2247 @opindex fopenacc
2248 @cindex OpenACC accelerator programming
2249 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
2250 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
2251 compiler generates accelerated code according to the OpenACC Application
2252 Programming Interface v2.6 @w{@uref{https://www.openacc.org}}.  This option
2253 implies @option{-pthread}, and thus is only supported on targets that
2254 have support for @option{-pthread}.
2255
2256 @item -fopenacc-dim=@var{geom}
2257 @opindex fopenacc-dim
2258 @cindex OpenACC accelerator programming
2259 Specify default compute dimensions for parallel offload regions that do
2260 not explicitly specify.  The @var{geom} value is a triple of
2261 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'.  A size
2262 can be omitted, to use a target-specific default value.
2263
2264 @item -fopenmp
2265 @opindex fopenmp
2266 @cindex OpenMP parallel
2267 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
2268 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
2269 compiler generates parallel code according to the OpenMP Application
2270 Program Interface v4.5 @w{@uref{https://www.openmp.org}}.  This option
2271 implies @option{-pthread}, and thus is only supported on targets that
2272 have support for @option{-pthread}. @option{-fopenmp} implies
2273 @option{-fopenmp-simd}.
2274
2275 @item -fopenmp-simd
2276 @opindex fopenmp-simd
2277 @cindex OpenMP SIMD
2278 @cindex SIMD
2279 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
2280 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
2281 are ignored.
2282
2283 @item -fgnu-tm
2284 @opindex fgnu-tm
2285 When the option @option{-fgnu-tm} is specified, the compiler
2286 generates code for the Linux variant of Intel's current Transactional
2287 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
2288 an experimental feature whose interface may change in future versions
2289 of GCC, as the official specification changes.  Please note that not
2290 all architectures are supported for this feature.
2291
2292 For more information on GCC's support for transactional memory,
2293 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
2294 Transactional Memory Library}.
2295
2296 Note that the transactional memory feature is not supported with
2297 non-call exceptions (@option{-fnon-call-exceptions}).
2298
2299 @item -fms-extensions
2300 @opindex fms-extensions
2301 Accept some non-standard constructs used in Microsoft header files.
2302
2303 In C++ code, this allows member names in structures to be similar
2304 to previous types declarations.
2305
2306 @smallexample
2307 typedef int UOW;
2308 struct ABC @{
2309   UOW UOW;
2310 @};
2311 @end smallexample
2312
2313 Some cases of unnamed fields in structures and unions are only
2314 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
2315 fields within structs/unions}, for details.
2316
2317 Note that this option is off for all targets except for x86
2318 targets using ms-abi.
2319
2320 @item -fplan9-extensions
2321 @opindex fplan9-extensions
2322 Accept some non-standard constructs used in Plan 9 code.
2323
2324 This enables @option{-fms-extensions}, permits passing pointers to
2325 structures with anonymous fields to functions that expect pointers to
2326 elements of the type of the field, and permits referring to anonymous
2327 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2328 struct/union fields within structs/unions}, for details.  This is only
2329 supported for C, not C++.
2330
2331 @item -fcond-mismatch
2332 @opindex fcond-mismatch
2333 Allow conditional expressions with mismatched types in the second and
2334 third arguments.  The value of such an expression is void.  This option
2335 is not supported for C++.
2336
2337 @item -flax-vector-conversions
2338 @opindex flax-vector-conversions
2339 Allow implicit conversions between vectors with differing numbers of
2340 elements and/or incompatible element types.  This option should not be
2341 used for new code.
2342
2343 @item -funsigned-char
2344 @opindex funsigned-char
2345 Let the type @code{char} be unsigned, like @code{unsigned char}.
2346
2347 Each kind of machine has a default for what @code{char} should
2348 be.  It is either like @code{unsigned char} by default or like
2349 @code{signed char} by default.
2350
2351 Ideally, a portable program should always use @code{signed char} or
2352 @code{unsigned char} when it depends on the signedness of an object.
2353 But many programs have been written to use plain @code{char} and
2354 expect it to be signed, or expect it to be unsigned, depending on the
2355 machines they were written for.  This option, and its inverse, let you
2356 make such a program work with the opposite default.
2357
2358 The type @code{char} is always a distinct type from each of
2359 @code{signed char} or @code{unsigned char}, even though its behavior
2360 is always just like one of those two.
2361
2362 @item -fsigned-char
2363 @opindex fsigned-char
2364 Let the type @code{char} be signed, like @code{signed char}.
2365
2366 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2367 the negative form of @option{-funsigned-char}.  Likewise, the option
2368 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2369
2370 @item -fsigned-bitfields
2371 @itemx -funsigned-bitfields
2372 @itemx -fno-signed-bitfields
2373 @itemx -fno-unsigned-bitfields
2374 @opindex fsigned-bitfields
2375 @opindex funsigned-bitfields
2376 @opindex fno-signed-bitfields
2377 @opindex fno-unsigned-bitfields
2378 These options control whether a bit-field is signed or unsigned, when the
2379 declaration does not use either @code{signed} or @code{unsigned}.  By
2380 default, such a bit-field is signed, because this is consistent: the
2381 basic integer types such as @code{int} are signed types.
2382
2383 @item -fsso-struct=@var{endianness}
2384 @opindex fsso-struct
2385 Set the default scalar storage order of structures and unions to the
2386 specified endianness.  The accepted values are @samp{big-endian},
2387 @samp{little-endian} and @samp{native} for the native endianness of
2388 the target (the default).  This option is not supported for C++.
2389
2390 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2391 code that is not binary compatible with code generated without it if the
2392 specified endianness is not the native endianness of the target.
2393 @end table
2394
2395 @node C++ Dialect Options
2396 @section Options Controlling C++ Dialect
2397
2398 @cindex compiler options, C++
2399 @cindex C++ options, command-line
2400 @cindex options, C++
2401 This section describes the command-line options that are only meaningful
2402 for C++ programs.  You can also use most of the GNU compiler options
2403 regardless of what language your program is in.  For example, you
2404 might compile a file @file{firstClass.C} like this:
2405
2406 @smallexample
2407 g++ -g -fstrict-enums -O -c firstClass.C
2408 @end smallexample
2409
2410 @noindent
2411 In this example, only @option{-fstrict-enums} is an option meant
2412 only for C++ programs; you can use the other options with any
2413 language supported by GCC@.
2414
2415 Some options for compiling C programs, such as @option{-std}, are also
2416 relevant for C++ programs.
2417 @xref{C Dialect Options,,Options Controlling C Dialect}.
2418
2419 Here is a list of options that are @emph{only} for compiling C++ programs:
2420
2421 @table @gcctabopt
2422
2423 @item -fabi-version=@var{n}
2424 @opindex fabi-version
2425 Use version @var{n} of the C++ ABI@.  The default is version 0.
2426
2427 Version 0 refers to the version conforming most closely to
2428 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2429 will change in different versions of G++ as ABI bugs are fixed.
2430
2431 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2432
2433 Version 2 is the version of the C++ ABI that first appeared in G++
2434 3.4, and was the default through G++ 4.9.
2435
2436 Version 3 corrects an error in mangling a constant address as a
2437 template argument.
2438
2439 Version 4, which first appeared in G++ 4.5, implements a standard
2440 mangling for vector types.
2441
2442 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2443 attribute const/volatile on function pointer types, decltype of a
2444 plain decl, and use of a function parameter in the declaration of
2445 another parameter.
2446
2447 Version 6, which first appeared in G++ 4.7, corrects the promotion
2448 behavior of C++11 scoped enums and the mangling of template argument
2449 packs, const/static_cast, prefix ++ and --, and a class scope function
2450 used as a template argument.
2451
2452 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2453 builtin type and corrects the mangling of lambdas in default argument
2454 scope.
2455
2456 Version 8, which first appeared in G++ 4.9, corrects the substitution
2457 behavior of function types with function-cv-qualifiers.
2458
2459 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2460 @code{nullptr_t}.
2461
2462 Version 10, which first appeared in G++ 6.1, adds mangling of
2463 attributes that affect type identity, such as ia32 calling convention
2464 attributes (e.g.@: @samp{stdcall}).
2465
2466 Version 11, which first appeared in G++ 7, corrects the mangling of
2467 sizeof... expressions and operator names.  For multiple entities with
2468 the same name within a function, that are declared in different scopes,
2469 the mangling now changes starting with the twelfth occurrence.  It also
2470 implies @option{-fnew-inheriting-ctors}.
2471
2472 Version 12, which first appeared in G++ 8, corrects the calling
2473 conventions for empty classes on the x86_64 target and for classes
2474 with only deleted copy/move constructors.  It accidentally changes the
2475 calling convention for classes with a deleted copy constructor and a
2476 trivial move constructor.
2477
2478 Version 13, which first appeared in G++ 8.2, fixes the accidental
2479 change in version 12.
2480
2481 Version 14, which first appeared in G++ 10, corrects the mangling of
2482 the nullptr expression.
2483
2484 See also @option{-Wabi}.
2485
2486 @item -fabi-compat-version=@var{n}
2487 @opindex fabi-compat-version
2488 On targets that support strong aliases, G++
2489 works around mangling changes by creating an alias with the correct
2490 mangled name when defining a symbol with an incorrect mangled name.
2491 This switch specifies which ABI version to use for the alias.
2492
2493 With @option{-fabi-version=0} (the default), this defaults to 11 (GCC 7
2494 compatibility).  If another ABI version is explicitly selected, this
2495 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2496 use @option{-fabi-compat-version=2}.
2497
2498 If this option is not provided but @option{-Wabi=@var{n}} is, that
2499 version is used for compatibility aliases.  If this option is provided
2500 along with @option{-Wabi} (without the version), the version from this
2501 option is used for the warning.
2502
2503 @item -fno-access-control
2504 @opindex fno-access-control
2505 @opindex faccess-control
2506 Turn off all access checking.  This switch is mainly useful for working
2507 around bugs in the access control code.
2508
2509 @item -faligned-new
2510 @opindex faligned-new
2511 Enable support for C++17 @code{new} of types that require more
2512 alignment than @code{void* ::operator new(std::size_t)} provides.  A
2513 numeric argument such as @code{-faligned-new=32} can be used to
2514 specify how much alignment (in bytes) is provided by that function,
2515 but few users will need to override the default of
2516 @code{alignof(std::max_align_t)}.
2517
2518 This flag is enabled by default for @option{-std=c++17}.
2519
2520 @item -fchar8_t
2521 @itemx -fno-char8_t
2522 @opindex fchar8_t
2523 @opindex fno-char8_t
2524 Enable support for @code{char8_t} as adopted for C++2a.  This includes
2525 the addition of a new @code{char8_t} fundamental type, changes to the
2526 types of UTF-8 string and character literals, new signatures for
2527 user-defined literals, associated standard library updates, and new
2528 @code{__cpp_char8_t} and @code{__cpp_lib_char8_t} feature test macros.
2529
2530 This option enables functions to be overloaded for ordinary and UTF-8
2531 strings:
2532
2533 @smallexample
2534 int f(const char *);    // #1
2535 int f(const char8_t *); // #2
2536 int v1 = f("text");     // Calls #1
2537 int v2 = f(u8"text");   // Calls #2
2538 @end smallexample
2539
2540 @noindent
2541 and introduces new signatures for user-defined literals:
2542
2543 @smallexample
2544 int operator""_udl1(char8_t);
2545 int v3 = u8'x'_udl1;
2546 int operator""_udl2(const char8_t*, std::size_t);
2547 int v4 = u8"text"_udl2;
2548 template<typename T, T...> int operator""_udl3();
2549 int v5 = u8"text"_udl3;
2550 @end smallexample
2551
2552 @noindent
2553 The change to the types of UTF-8 string and character literals introduces
2554 incompatibilities with ISO C++11 and later standards.  For example, the
2555 following code is well-formed under ISO C++11, but is ill-formed when
2556 @option{-fchar8_t} is specified.
2557
2558 @smallexample
2559 char ca[] = u8"xx";     // error: char-array initialized from wide
2560                         //        string
2561 const char *cp = u8"xx";// error: invalid conversion from
2562                         //        `const char8_t*' to `const char*'
2563 int f(const char*);
2564 auto v = f(u8"xx");     // error: invalid conversion from
2565                         //        `const char8_t*' to `const char*'
2566 std::string s@{u8"xx"@};  // error: no matching function for call to
2567                         //        `std::basic_string<char>::basic_string()'
2568 using namespace std::literals;
2569 s = u8"xx"s;            // error: conversion from
2570                         //        `basic_string<char8_t>' to non-scalar
2571                         //        type `basic_string<char>' requested
2572 @end smallexample
2573
2574 @item -fcheck-new
2575 @opindex fcheck-new
2576 Check that the pointer returned by @code{operator new} is non-null
2577 before attempting to modify the storage allocated.  This check is
2578 normally unnecessary because the C++ standard specifies that
2579 @code{operator new} only returns @code{0} if it is declared
2580 @code{throw()}, in which case the compiler always checks the
2581 return value even without this option.  In all other cases, when
2582 @code{operator new} has a non-empty exception specification, memory
2583 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2584 @samp{new (nothrow)}.
2585
2586 @item -fconcepts
2587 @itemx -fconcepts-ts
2588 @opindex fconcepts
2589 @opindex fconcepts-ts
2590 Below @option{-std=c++2a}, @option{-fconcepts} enables support for the
2591 C++ Extensions for Concepts Technical Specification, ISO 19217 (2015).
2592
2593 With @option{-std=c++2a} and above, Concepts are part of the language
2594 standard, so @option{-fconcepts} defaults to on.  But the standard
2595 specification of Concepts differs significantly from the TS, so some
2596 constructs that were allowed in the TS but didn't make it into the
2597 standard can still be enabled by @option{-fconcepts-ts}.
2598
2599 @item -fconstexpr-depth=@var{n}
2600 @opindex fconstexpr-depth
2601 Set the maximum nested evaluation depth for C++11 constexpr functions
2602 to @var{n}.  A limit is needed to detect endless recursion during
2603 constant expression evaluation.  The minimum specified by the standard
2604 is 512.
2605
2606 @item -fconstexpr-cache-depth=@var{n}
2607 @opindex fconstexpr-cache-depth
2608 Set the maximum level of nested evaluation depth for C++11 constexpr
2609 functions that will be cached to @var{n}.  This is a heuristic that
2610 trades off compilation speed (when the cache avoids repeated
2611 calculations) against memory consumption (when the cache grows very
2612 large from highly recursive evaluations).  The default is 8.  Very few
2613 users are likely to want to adjust it, but if your code does heavy
2614 constexpr calculations you might want to experiment to find which
2615 value works best for you.
2616
2617 @item -fconstexpr-loop-limit=@var{n}
2618 @opindex fconstexpr-loop-limit
2619 Set the maximum number of iterations for a loop in C++14 constexpr functions
2620 to @var{n}.  A limit is needed to detect infinite loops during
2621 constant expression evaluation.  The default is 262144 (1<<18).
2622
2623 @item -fconstexpr-ops-limit=@var{n}
2624 @opindex fconstexpr-ops-limit
2625 Set the maximum number of operations during a single constexpr evaluation.
2626 Even when number of iterations of a single loop is limited with the above limit,
2627 if there are several nested loops and each of them has many iterations but still
2628 smaller than the above limit, or if in a body of some loop or even outside
2629 of a loop too many expressions need to be evaluated, the resulting constexpr
2630 evaluation might take too long.
2631 The default is 33554432 (1<<25).
2632
2633 @item -fcoroutines
2634 @opindex fcoroutines
2635 Enable support for the C++ coroutines extension (experimental).
2636
2637 @item -fno-elide-constructors
2638 @opindex fno-elide-constructors
2639 @opindex felide-constructors
2640 The C++ standard allows an implementation to omit creating a temporary
2641 that is only used to initialize another object of the same type.
2642 Specifying this option disables that optimization, and forces G++ to
2643 call the copy constructor in all cases.  This option also causes G++
2644 to call trivial member functions which otherwise would be expanded inline.
2645
2646 In C++17, the compiler is required to omit these temporaries, but this
2647 option still affects trivial member functions.
2648
2649 @item -fno-enforce-eh-specs
2650 @opindex fno-enforce-eh-specs
2651 @opindex fenforce-eh-specs
2652 Don't generate code to check for violation of exception specifications
2653 at run time.  This option violates the C++ standard, but may be useful
2654 for reducing code size in production builds, much like defining
2655 @code{NDEBUG}.  This does not give user code permission to throw
2656 exceptions in violation of the exception specifications; the compiler
2657 still optimizes based on the specifications, so throwing an
2658 unexpected exception results in undefined behavior at run time.
2659
2660 @item -fextern-tls-init
2661 @itemx -fno-extern-tls-init
2662 @opindex fextern-tls-init
2663 @opindex fno-extern-tls-init
2664 The C++11 and OpenMP standards allow @code{thread_local} and
2665 @code{threadprivate} variables to have dynamic (runtime)
2666 initialization.  To support this, any use of such a variable goes
2667 through a wrapper function that performs any necessary initialization.
2668 When the use and definition of the variable are in the same
2669 translation unit, this overhead can be optimized away, but when the
2670 use is in a different translation unit there is significant overhead
2671 even if the variable doesn't actually need dynamic initialization.  If
2672 the programmer can be sure that no use of the variable in a
2673 non-defining TU needs to trigger dynamic initialization (either
2674 because the variable is statically initialized, or a use of the
2675 variable in the defining TU will be executed before any uses in
2676 another TU), they can avoid this overhead with the
2677 @option{-fno-extern-tls-init} option.
2678
2679 On targets that support symbol aliases, the default is
2680 @option{-fextern-tls-init}.  On targets that do not support symbol
2681 aliases, the default is @option{-fno-extern-tls-init}.
2682
2683 @item -fno-gnu-keywords
2684 @opindex fno-gnu-keywords
2685 @opindex fgnu-keywords
2686 Do not recognize @code{typeof} as a keyword, so that code can use this
2687 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2688 This option is implied by the strict ISO C++ dialects: @option{-ansi},
2689 @option{-std=c++98}, @option{-std=c++11}, etc.
2690
2691 @item -fno-implicit-templates
2692 @opindex fno-implicit-templates
2693 @opindex fimplicit-templates
2694 Never emit code for non-inline templates that are instantiated
2695 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2696 If you use this option, you must take care to structure your code to
2697 include all the necessary explicit instantiations to avoid getting
2698 undefined symbols at link time.
2699 @xref{Template Instantiation}, for more information.
2700
2701 @item -fno-implicit-inline-templates
2702 @opindex fno-implicit-inline-templates
2703 @opindex fimplicit-inline-templates
2704 Don't emit code for implicit instantiations of inline templates, either.
2705 The default is to handle inlines differently so that compiles with and
2706 without optimization need the same set of explicit instantiations.
2707
2708 @item -fno-implement-inlines
2709 @opindex fno-implement-inlines
2710 @opindex fimplement-inlines
2711 To save space, do not emit out-of-line copies of inline functions
2712 controlled by @code{#pragma implementation}.  This causes linker
2713 errors if these functions are not inlined everywhere they are called.
2714
2715 @item -fms-extensions
2716 @opindex fms-extensions
2717 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2718 int and getting a pointer to member function via non-standard syntax.
2719
2720 @item -fnew-inheriting-ctors
2721 @opindex fnew-inheriting-ctors
2722 Enable the P0136 adjustment to the semantics of C++11 constructor
2723 inheritance.  This is part of C++17 but also considered to be a Defect
2724 Report against C++11 and C++14.  This flag is enabled by default
2725 unless @option{-fabi-version=10} or lower is specified.
2726
2727 @item -fnew-ttp-matching
2728 @opindex fnew-ttp-matching
2729 Enable the P0522 resolution to Core issue 150, template template
2730 parameters and default arguments: this allows a template with default
2731 template arguments as an argument for a template template parameter
2732 with fewer template parameters.  This flag is enabled by default for
2733 @option{-std=c++17}.
2734
2735 @item -fno-nonansi-builtins
2736 @opindex fno-nonansi-builtins
2737 @opindex fnonansi-builtins
2738 Disable built-in declarations of functions that are not mandated by
2739 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2740 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2741
2742 @item -fnothrow-opt
2743 @opindex fnothrow-opt
2744 Treat a @code{throw()} exception specification as if it were a
2745 @code{noexcept} specification to reduce or eliminate the text size
2746 overhead relative to a function with no exception specification.  If
2747 the function has local variables of types with non-trivial
2748 destructors, the exception specification actually makes the
2749 function smaller because the EH cleanups for those variables can be
2750 optimized away.  The semantic effect is that an exception thrown out of
2751 a function with such an exception specification results in a call
2752 to @code{terminate} rather than @code{unexpected}.
2753
2754 @item -fno-operator-names
2755 @opindex fno-operator-names
2756 @opindex foperator-names
2757 Do not treat the operator name keywords @code{and}, @code{bitand},
2758 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2759 synonyms as keywords.
2760
2761 @item -fno-optional-diags
2762 @opindex fno-optional-diags
2763 @opindex foptional-diags
2764 Disable diagnostics that the standard says a compiler does not need to
2765 issue.  Currently, the only such diagnostic issued by G++ is the one for
2766 a name having multiple meanings within a class.
2767
2768 @item -fpermissive
2769 @opindex fpermissive
2770 Downgrade some diagnostics about nonconformant code from errors to
2771 warnings.  Thus, using @option{-fpermissive} allows some
2772 nonconforming code to compile.
2773
2774 @item -fno-pretty-templates
2775 @opindex fno-pretty-templates
2776 @opindex fpretty-templates
2777 When an error message refers to a specialization of a function
2778 template, the compiler normally prints the signature of the
2779 template followed by the template arguments and any typedefs or
2780 typenames in the signature (e.g.@: @code{void f(T) [with T = int]}
2781 rather than @code{void f(int)}) so that it's clear which template is
2782 involved.  When an error message refers to a specialization of a class
2783 template, the compiler omits any template arguments that match
2784 the default template arguments for that template.  If either of these
2785 behaviors make it harder to understand the error message rather than
2786 easier, you can use @option{-fno-pretty-templates} to disable them.
2787
2788 @item -fno-rtti
2789 @opindex fno-rtti
2790 @opindex frtti
2791 Disable generation of information about every class with virtual
2792 functions for use by the C++ run-time type identification features
2793 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2794 of the language, you can save some space by using this flag.  Note that
2795 exception handling uses the same information, but G++ generates it as
2796 needed. The @code{dynamic_cast} operator can still be used for casts that
2797 do not require run-time type information, i.e.@: casts to @code{void *} or to
2798 unambiguous base classes.
2799
2800 Mixing code compiled with @option{-frtti} with that compiled with
2801 @option{-fno-rtti} may not work.  For example, programs may
2802 fail to link if a class compiled with @option{-fno-rtti} is used as a base 
2803 for a class compiled with @option{-frtti}.  
2804
2805 @item -fsized-deallocation
2806 @opindex fsized-deallocation
2807 Enable the built-in global declarations
2808 @smallexample
2809 void operator delete (void *, std::size_t) noexcept;
2810 void operator delete[] (void *, std::size_t) noexcept;
2811 @end smallexample
2812 as introduced in C++14.  This is useful for user-defined replacement
2813 deallocation functions that, for example, use the size of the object
2814 to make deallocation faster.  Enabled by default under
2815 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2816 warns about places that might want to add a definition.
2817
2818 @item -fstrict-enums
2819 @opindex fstrict-enums
2820 Allow the compiler to optimize using the assumption that a value of
2821 enumerated type can only be one of the values of the enumeration (as
2822 defined in the C++ standard; basically, a value that can be
2823 represented in the minimum number of bits needed to represent all the
2824 enumerators).  This assumption may not be valid if the program uses a
2825 cast to convert an arbitrary integer value to the enumerated type.
2826
2827 @item -fstrong-eval-order
2828 @opindex fstrong-eval-order
2829 Evaluate member access, array subscripting, and shift expressions in
2830 left-to-right order, and evaluate assignment in right-to-left order,
2831 as adopted for C++17.  Enabled by default with @option{-std=c++17}.
2832 @option{-fstrong-eval-order=some} enables just the ordering of member
2833 access and shift expressions, and is the default without
2834 @option{-std=c++17}.
2835
2836 @item -ftemplate-backtrace-limit=@var{n}
2837 @opindex ftemplate-backtrace-limit
2838 Set the maximum number of template instantiation notes for a single
2839 warning or error to @var{n}.  The default value is 10.
2840
2841 @item -ftemplate-depth=@var{n}
2842 @opindex ftemplate-depth
2843 Set the maximum instantiation depth for template classes to @var{n}.
2844 A limit on the template instantiation depth is needed to detect
2845 endless recursions during template class instantiation.  ANSI/ISO C++
2846 conforming programs must not rely on a maximum depth greater than 17
2847 (changed to 1024 in C++11).  The default value is 900, as the compiler
2848 can run out of stack space before hitting 1024 in some situations.
2849
2850 @item -fno-threadsafe-statics
2851 @opindex fno-threadsafe-statics
2852 @opindex fthreadsafe-statics
2853 Do not emit the extra code to use the routines specified in the C++
2854 ABI for thread-safe initialization of local statics.  You can use this
2855 option to reduce code size slightly in code that doesn't need to be
2856 thread-safe.
2857
2858 @item -fuse-cxa-atexit
2859 @opindex fuse-cxa-atexit
2860 Register destructors for objects with static storage duration with the
2861 @code{__cxa_atexit} function rather than the @code{atexit} function.
2862 This option is required for fully standards-compliant handling of static
2863 destructors, but only works if your C library supports
2864 @code{__cxa_atexit}.
2865
2866 @item -fno-use-cxa-get-exception-ptr
2867 @opindex fno-use-cxa-get-exception-ptr
2868 @opindex fuse-cxa-get-exception-ptr
2869 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2870 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2871 if the runtime routine is not available.
2872
2873 @item -fvisibility-inlines-hidden
2874 @opindex fvisibility-inlines-hidden
2875 This switch declares that the user does not attempt to compare
2876 pointers to inline functions or methods where the addresses of the two functions
2877 are taken in different shared objects.
2878
2879 The effect of this is that GCC may, effectively, mark inline methods with
2880 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2881 appear in the export table of a DSO and do not require a PLT indirection
2882 when used within the DSO@.  Enabling this option can have a dramatic effect
2883 on load and link times of a DSO as it massively reduces the size of the
2884 dynamic export table when the library makes heavy use of templates.
2885
2886 The behavior of this switch is not quite the same as marking the
2887 methods as hidden directly, because it does not affect static variables
2888 local to the function or cause the compiler to deduce that
2889 the function is defined in only one shared object.
2890
2891 You may mark a method as having a visibility explicitly to negate the
2892 effect of the switch for that method.  For example, if you do want to
2893 compare pointers to a particular inline method, you might mark it as
2894 having default visibility.  Marking the enclosing class with explicit
2895 visibility has no effect.
2896
2897 Explicitly instantiated inline methods are unaffected by this option
2898 as their linkage might otherwise cross a shared library boundary.
2899 @xref{Template Instantiation}.
2900
2901 @item -fvisibility-ms-compat
2902 @opindex fvisibility-ms-compat
2903 This flag attempts to use visibility settings to make GCC's C++
2904 linkage model compatible with that of Microsoft Visual Studio.
2905
2906 The flag makes these changes to GCC's linkage model:
2907
2908 @enumerate
2909 @item
2910 It sets the default visibility to @code{hidden}, like
2911 @option{-fvisibility=hidden}.
2912
2913 @item
2914 Types, but not their members, are not hidden by default.
2915
2916 @item
2917 The One Definition Rule is relaxed for types without explicit
2918 visibility specifications that are defined in more than one
2919 shared object: those declarations are permitted if they are
2920 permitted when this option is not used.
2921 @end enumerate
2922
2923 In new code it is better to use @option{-fvisibility=hidden} and
2924 export those classes that are intended to be externally visible.
2925 Unfortunately it is possible for code to rely, perhaps accidentally,
2926 on the Visual Studio behavior.
2927
2928 Among the consequences of these changes are that static data members
2929 of the same type with the same name but defined in different shared
2930 objects are different, so changing one does not change the other;
2931 and that pointers to function members defined in different shared
2932 objects may not compare equal.  When this flag is given, it is a
2933 violation of the ODR to define types with the same name differently.
2934
2935 @item -fno-weak
2936 @opindex fno-weak
2937 @opindex fweak
2938 Do not use weak symbol support, even if it is provided by the linker.
2939 By default, G++ uses weak symbols if they are available.  This
2940 option exists only for testing, and should not be used by end-users;
2941 it results in inferior code and has no benefits.  This option may
2942 be removed in a future release of G++.
2943
2944 @item -nostdinc++
2945 @opindex nostdinc++
2946 Do not search for header files in the standard directories specific to
2947 C++, but do still search the other standard directories.  (This option
2948 is used when building the C++ library.)
2949 @end table
2950
2951 In addition, these optimization, warning, and code generation options
2952 have meanings only for C++ programs:
2953
2954 @table @gcctabopt
2955 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2956 @opindex Wabi
2957 @opindex Wno-abi
2958 Warn when G++ it generates code that is probably not compatible with
2959 the vendor-neutral C++ ABI@.  Since G++ now defaults to updating the
2960 ABI with each major release, normally @option{-Wabi} will warn only if
2961 there is a check added later in a release series for an ABI issue
2962 discovered since the initial release.  @option{-Wabi} will warn about
2963 more things if an older ABI version is selected (with
2964 @option{-fabi-version=@var{n}}).
2965
2966 @option{-Wabi} can also be used with an explicit version number to
2967 warn about compatibility with a particular @option{-fabi-version}
2968 level, e.g.@: @option{-Wabi=2} to warn about changes relative to
2969 @option{-fabi-version=2}.
2970
2971 If an explicit version number is provided and
2972 @option{-fabi-compat-version} is not specified, the version number
2973 from this option is used for compatibility aliases.  If no explicit
2974 version number is provided with this option, but
2975 @option{-fabi-compat-version} is specified, that version number is
2976 used for ABI warnings.
2977
2978 Although an effort has been made to warn about
2979 all such cases, there are probably some cases that are not warned about,
2980 even though G++ is generating incompatible code.  There may also be
2981 cases where warnings are emitted even though the code that is generated
2982 is compatible.
2983
2984 You should rewrite your code to avoid these warnings if you are
2985 concerned about the fact that code generated by G++ may not be binary
2986 compatible with code generated by other compilers.
2987
2988 Known incompatibilities in @option{-fabi-version=2} (which was the
2989 default from GCC 3.4 to 4.9) include:
2990
2991 @itemize @bullet
2992
2993 @item
2994 A template with a non-type template parameter of reference type was
2995 mangled incorrectly:
2996 @smallexample
2997 extern int N;
2998 template <int &> struct S @{@};
2999 void n (S<N>) @{2@}
3000 @end smallexample
3001
3002 This was fixed in @option{-fabi-version=3}.
3003
3004 @item
3005 SIMD vector types declared using @code{__attribute ((vector_size))} were
3006 mangled in a non-standard way that does not allow for overloading of
3007 functions taking vectors of different sizes.
3008
3009 The mangling was changed in @option{-fabi-version=4}.
3010
3011 @item
3012 @code{__attribute ((const))} and @code{noreturn} were mangled as type
3013 qualifiers, and @code{decltype} of a plain declaration was folded away.
3014
3015 These mangling issues were fixed in @option{-fabi-version=5}.
3016
3017 @item
3018 Scoped enumerators passed as arguments to a variadic function are
3019 promoted like unscoped enumerators, causing @code{va_arg} to complain.
3020 On most targets this does not actually affect the parameter passing
3021 ABI, as there is no way to pass an argument smaller than @code{int}.
3022
3023 Also, the ABI changed the mangling of template argument packs,
3024 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
3025 a class scope function used as a template argument.
3026
3027 These issues were corrected in @option{-fabi-version=6}.
3028
3029 @item
3030 Lambdas in default argument scope were mangled incorrectly, and the
3031 ABI changed the mangling of @code{nullptr_t}.
3032
3033 These issues were corrected in @option{-fabi-version=7}.
3034
3035 @item
3036 When mangling a function type with function-cv-qualifiers, the
3037 un-qualified function type was incorrectly treated as a substitution
3038 candidate.
3039
3040 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
3041
3042 @item
3043 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
3044 unaligned accesses.  Note that this did not affect the ABI of a
3045 function with a @code{nullptr_t} parameter, as parameters have a
3046 minimum alignment.
3047
3048 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
3049
3050 @item
3051 Target-specific attributes that affect the identity of a type, such as
3052 ia32 calling conventions on a function type (stdcall, regparm, etc.),
3053 did not affect the mangled name, leading to name collisions when
3054 function pointers were used as template arguments.
3055
3056 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
3057
3058 @end itemize
3059
3060 It also warns about psABI-related changes.  The known psABI changes at this
3061 point include:
3062
3063 @itemize @bullet
3064
3065 @item
3066 For SysV/x86-64, unions with @code{long double} members are 
3067 passed in memory as specified in psABI.  For example:
3068
3069 @smallexample
3070 union U @{
3071   long double ld;
3072   int i;
3073 @};
3074 @end smallexample
3075
3076 @noindent
3077 @code{union U} is always passed in memory.
3078
3079 @end itemize
3080
3081 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
3082 @opindex Wabi-tag
3083 @opindex Wabi-tag
3084 Warn when a type with an ABI tag is used in a context that does not
3085 have that ABI tag.  See @ref{C++ Attributes} for more information
3086 about ABI tags.
3087
3088 @item -Wcomma-subscript @r{(C++ and Objective-C++ only)}
3089 @opindex Wcomma-subscript
3090 @opindex Wno-comma-subscript
3091 Warn about uses of a comma expression within a subscripting expression.
3092 This usage was deprecated in C++2a.  However, a comma expression wrapped
3093 in @code{( )} is not deprecated.  Example:
3094
3095 @smallexample
3096 @group
3097 void f(int *a, int b, int c) @{
3098     a[b,c];     // deprecated
3099     a[(b,c)];   // OK
3100 @}
3101 @end group
3102 @end smallexample
3103
3104 Enabled by default with @option{-std=c++2a}.
3105
3106 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
3107 @opindex Wctor-dtor-privacy
3108 @opindex Wno-ctor-dtor-privacy
3109 Warn when a class seems unusable because all the constructors or
3110 destructors in that class are private, and it has neither friends nor
3111 public static member functions.  Also warn if there are no non-private
3112 methods, and there's at least one private member function that isn't
3113 a constructor or destructor.
3114
3115 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
3116 @opindex Wdelete-non-virtual-dtor
3117 @opindex Wno-delete-non-virtual-dtor
3118 Warn when @code{delete} is used to destroy an instance of a class that
3119 has virtual functions and non-virtual destructor. It is unsafe to delete
3120 an instance of a derived class through a pointer to a base class if the
3121 base class does not have a virtual destructor.  This warning is enabled
3122 by @option{-Wall}.
3123
3124 @item -Wdeprecated-copy @r{(C++ and Objective-C++ only)}
3125 @opindex Wdeprecated-copy
3126 @opindex Wno-deprecated-copy
3127 Warn that the implicit declaration of a copy constructor or copy
3128 assignment operator is deprecated if the class has a user-provided
3129 copy constructor or copy assignment operator, in C++11 and up.  This
3130 warning is enabled by @option{-Wextra}.  With
3131 @option{-Wdeprecated-copy-dtor}, also deprecate if the class has a
3132 user-provided destructor.
3133
3134 @item -Wno-init-list-lifetime @r{(C++ and Objective-C++ only)}
3135 @opindex Winit-list-lifetime
3136 @opindex Wno-init-list-lifetime
3137 Do not warn about uses of @code{std::initializer_list} that are likely
3138 to result in dangling pointers.  Since the underlying array for an
3139 @code{initializer_list} is handled like a normal C++ temporary object,
3140 it is easy to inadvertently keep a pointer to the array past the end
3141 of the array's lifetime.  For example:
3142
3143 @itemize @bullet
3144 @item
3145 If a function returns a temporary @code{initializer_list}, or a local
3146 @code{initializer_list} variable, the array's lifetime ends at the end
3147 of the return statement, so the value returned has a dangling pointer.
3148
3149 @item
3150 If a new-expression creates an @code{initializer_list}, the array only
3151 lives until the end of the enclosing full-expression, so the
3152 @code{initializer_list} in the heap has a dangling pointer.
3153
3154 @item
3155 When an @code{initializer_list} variable is assigned from a
3156 brace-enclosed initializer list, the temporary array created for the
3157 right side of the assignment only lives until the end of the
3158 full-expression, so at the next statement the @code{initializer_list}
3159 variable has a dangling pointer.
3160
3161 @smallexample
3162 // li's initial underlying array lives as long as li
3163 std::initializer_list<int> li = @{ 1,2,3 @};
3164 // assignment changes li to point to a temporary array
3165 li = @{ 4, 5 @};
3166 // now the temporary is gone and li has a dangling pointer
3167 int i = li.begin()[0] // undefined behavior
3168 @end smallexample
3169
3170 @item
3171 When a list constructor stores the @code{begin} pointer from the
3172 @code{initializer_list} argument, this doesn't extend the lifetime of
3173 the array, so if a class variable is constructed from a temporary
3174 @code{initializer_list}, the pointer is left dangling by the end of
3175 the variable declaration statement.
3176
3177 @end itemize
3178
3179 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
3180 @opindex Wliteral-suffix
3181 @opindex Wno-literal-suffix
3182 Warn when a string or character literal is followed by a ud-suffix which does
3183 not begin with an underscore.  As a conforming extension, GCC treats such
3184 suffixes as separate preprocessing tokens in order to maintain backwards
3185 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
3186 For example:
3187
3188 @smallexample
3189 #define __STDC_FORMAT_MACROS
3190 #include <inttypes.h>
3191 #include <stdio.h>
3192
3193 int main() @{
3194   int64_t i64 = 123;
3195   printf("My int64: %" PRId64"\n", i64);
3196 @}
3197 @end smallexample
3198
3199 In this case, @code{PRId64} is treated as a separate preprocessing token.
3200
3201 Additionally, warn when a user-defined literal operator is declared with
3202 a literal suffix identifier that doesn't begin with an underscore. Literal
3203 suffix identifiers that don't begin with an underscore are reserved for
3204 future standardization.
3205
3206 This warning is enabled by default.
3207
3208 @item -Wlto-type-mismatch
3209 @opindex Wlto-type-mismatch
3210 @opindex Wno-lto-type-mismatch
3211
3212 During the link-time optimization warn about type mismatches in
3213 global declarations from different compilation units.
3214 Requires @option{-flto} to be enabled.  Enabled by default.
3215
3216 @item -Wno-narrowing @r{(C++ and Objective-C++ only)}
3217 @opindex Wnarrowing
3218 @opindex Wno-narrowing
3219 For C++11 and later standards, narrowing conversions are diagnosed by default,
3220 as required by the standard.  A narrowing conversion from a constant produces
3221 an error, and a narrowing conversion from a non-constant produces a warning,
3222 but @option{-Wno-narrowing} suppresses the diagnostic.
3223 Note that this does not affect the meaning of well-formed code;
3224 narrowing conversions are still considered ill-formed in SFINAE contexts.
3225
3226 With @option{-Wnarrowing} in C++98, warn when a narrowing
3227 conversion prohibited by C++11 occurs within
3228 @samp{@{ @}}, e.g.
3229
3230 @smallexample
3231 int i = @{ 2.2 @}; // error: narrowing from double to int
3232 @end smallexample
3233
3234 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
3235
3236 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
3237 @opindex Wnoexcept
3238 @opindex Wno-noexcept
3239 Warn when a noexcept-expression evaluates to false because of a call
3240 to a function that does not have a non-throwing exception
3241 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
3242 the compiler to never throw an exception.
3243
3244 @item -Wnoexcept-type @r{(C++ and Objective-C++ only)}
3245 @opindex Wnoexcept-type
3246 @opindex Wno-noexcept-type
3247 Warn if the C++17 feature making @code{noexcept} part of a function
3248 type changes the mangled name of a symbol relative to C++14.  Enabled
3249 by @option{-Wabi} and @option{-Wc++17-compat}.
3250
3251 As an example:
3252
3253 @smallexample
3254 template <class T> void f(T t) @{ t(); @};
3255 void g() noexcept;
3256 void h() @{ f(g); @} 
3257 @end smallexample
3258
3259 @noindent
3260 In C++14, @code{f} calls @code{f<void(*)()>}, but in
3261 C++17 it calls @code{f<void(*)()noexcept>}.
3262
3263 @item -Wclass-memaccess @r{(C++ and Objective-C++ only)}
3264 @opindex Wclass-memaccess
3265 @opindex Wno-class-memaccess
3266 Warn when the destination of a call to a raw memory function such as
3267 @code{memset} or @code{memcpy} is an object of class type, and when writing
3268 into such an object might bypass the class non-trivial or deleted constructor
3269 or copy assignment, violate const-correctness or encapsulation, or corrupt
3270 virtual table pointers.  Modifying the representation of such objects may
3271 violate invariants maintained by member functions of the class.  For example,
3272 the call to @code{memset} below is undefined because it modifies a non-trivial
3273 class object and is, therefore, diagnosed.  The safe way to either initialize
3274 or clear the storage of objects of such types is by using the appropriate
3275 constructor or assignment operator, if one is available.
3276 @smallexample
3277 std::string str = "abc";
3278 memset (&str, 0, sizeof str);
3279 @end smallexample
3280 The @option{-Wclass-memaccess} option is enabled by @option{-Wall}.
3281 Explicitly casting the pointer to the class object to @code{void *} or
3282 to a type that can be safely accessed by the raw memory function suppresses
3283 the warning.
3284
3285 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
3286 @opindex Wnon-virtual-dtor
3287 @opindex Wno-non-virtual-dtor
3288 Warn when a class has virtual functions and an accessible non-virtual
3289 destructor itself or in an accessible polymorphic base class, in which
3290 case it is possible but unsafe to delete an instance of a derived
3291 class through a pointer to the class itself or base class.  This
3292 warning is automatically enabled if @option{-Weffc++} is specified.
3293
3294 @item -Wregister @r{(C++ and Objective-C++ only)}
3295 @opindex Wregister
3296 @opindex Wno-register
3297 Warn on uses of the @code{register} storage class specifier, except
3298 when it is part of the GNU @ref{Explicit Register Variables} extension.
3299 The use of the @code{register} keyword as storage class specifier has
3300 been deprecated in C++11 and removed in C++17.
3301 Enabled by default with @option{-std=c++17}.
3302
3303 @item -Wreorder @r{(C++ and Objective-C++ only)}
3304 @opindex Wreorder
3305 @opindex Wno-reorder
3306 @cindex reordering, warning
3307 @cindex warning for reordering of member initializers
3308 Warn when the order of member initializers given in the code does not
3309 match the order in which they must be executed.  For instance:
3310
3311 @smallexample
3312 struct A @{
3313   int i;
3314   int j;
3315   A(): j (0), i (1) @{ @}
3316 @};
3317 @end smallexample
3318
3319 @noindent
3320 The compiler rearranges the member initializers for @code{i}
3321 and @code{j} to match the declaration order of the members, emitting
3322 a warning to that effect.  This warning is enabled by @option{-Wall}.
3323
3324 @item -Wno-pessimizing-move @r{(C++ and Objective-C++ only)}
3325 @opindex Wpessimizing-move
3326 @opindex Wno-pessimizing-move
3327 This warning warns when a call to @code{std::move} prevents copy
3328 elision.  A typical scenario when copy elision can occur is when returning in
3329 a function with a class return type, when the expression being returned is the
3330 name of a non-volatile automatic object, and is not a function parameter, and
3331 has the same type as the function return type.
3332
3333 @smallexample
3334 struct T @{
3335 @dots{}
3336 @};
3337 T fn()
3338 @{
3339   T t;
3340   @dots{}
3341   return std::move (t);
3342 @}
3343 @end smallexample
3344
3345 But in this example, the @code{std::move} call prevents copy elision.
3346
3347 This warning is enabled by @option{-Wall}.
3348
3349 @item -Wno-redundant-move @r{(C++ and Objective-C++ only)}
3350 @opindex Wredundant-move
3351 @opindex Wno-redundant-move
3352 This warning warns about redundant calls to @code{std::move}; that is, when
3353 a move operation would have been performed even without the @code{std::move}
3354 call.  This happens because the compiler is forced to treat the object as if
3355 it were an rvalue in certain situations such as returning a local variable,
3356 where copy elision isn't applicable.  Consider:
3357
3358 @smallexample
3359 struct T @{
3360 @dots{}
3361 @};
3362 T fn(T t)
3363 @{
3364   @dots{}
3365   return std::move (t);
3366 @}
3367 @end smallexample
3368
3369 Here, the @code{std::move} call is redundant.  Because G++ implements Core
3370 Issue 1579, another example is:
3371
3372 @smallexample
3373 struct T @{ // convertible to U
3374 @dots{}
3375 @};
3376 struct U @{
3377 @dots{}
3378 @};
3379 U fn()
3380 @{
3381   T t;
3382   @dots{}
3383   return std::move (t);
3384 @}
3385 @end smallexample
3386 In this example, copy elision isn't applicable because the type of the
3387 expression being returned and the function return type differ, yet G++
3388 treats the return value as if it were designated by an rvalue.
3389
3390 This warning is enabled by @option{-Wextra}.
3391
3392 @item -Wredundant-tags @r{(C++ and Objective-C++ only)}
3393 @opindex Wredundant-tags
3394 @opindex Wno-redundant-tags
3395 Warn about redundant class-key and enum-key in references to class types
3396 and enumerated types in contexts where the key can be eliminated without
3397 causing an ambiguity.  For example
3398
3399 @smallexample
3400 struct foo;
3401 struct foo *p;   // -Wredundant-tags, keyword struct can be eliminated
3402
3403 void foo ();   // "hides" struct foo
3404 void bar (struct foo&);   // no warning, keyword struct cannot be eliminated
3405 @end smallexample
3406
3407 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
3408 @opindex fext-numeric-literals
3409 @opindex fno-ext-numeric-literals
3410 Accept imaginary, fixed-point, or machine-defined
3411 literal number suffixes as GNU extensions.
3412 When this option is turned off these suffixes are treated
3413 as C++11 user-defined literal numeric suffixes.
3414 This is on by default for all pre-C++11 dialects and all GNU dialects:
3415 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
3416 @option{-std=gnu++14}.
3417 This option is off by default
3418 for ISO C++11 onwards (@option{-std=c++11}, ...).
3419 @end table
3420
3421 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
3422
3423 @table @gcctabopt
3424 @item -Weffc++ @r{(C++ and Objective-C++ only)}
3425 @opindex Weffc++
3426 @opindex Wno-effc++
3427 Warn about violations of the following style guidelines from Scott Meyers'
3428 @cite{Effective C++} series of books:
3429
3430 @itemize @bullet
3431 @item
3432 Define a copy constructor and an assignment operator for classes
3433 with dynamically-allocated memory.
3434
3435 @item
3436 Prefer initialization to assignment in constructors.
3437
3438 @item
3439 Have @code{operator=} return a reference to @code{*this}.
3440
3441 @item
3442 Don't try to return a reference when you must return an object.
3443
3444 @item
3445 Distinguish between prefix and postfix forms of increment and
3446 decrement operators.
3447
3448 @item
3449 Never overload @code{&&}, @code{||}, or @code{,}.
3450
3451 @end itemize
3452
3453 This option also enables @option{-Wnon-virtual-dtor}, which is also
3454 one of the effective C++ recommendations.  However, the check is
3455 extended to warn about the lack of virtual destructor in accessible
3456 non-polymorphic bases classes too.
3457
3458 When selecting this option, be aware that the standard library
3459 headers do not obey all of these guidelines; use @samp{grep -v}
3460 to filter out those warnings.
3461
3462 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
3463 @opindex Wstrict-null-sentinel
3464 @opindex Wno-strict-null-sentinel
3465 Warn about the use of an uncasted @code{NULL} as sentinel.  When
3466 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
3467 to @code{__null}.  Although it is a null pointer constant rather than a
3468 null pointer, it is guaranteed to be of the same size as a pointer.
3469 But this use is not portable across different compilers.
3470
3471 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
3472 @opindex Wno-non-template-friend
3473 @opindex Wnon-template-friend
3474 Disable warnings when non-template friend functions are declared
3475 within a template.  In very old versions of GCC that predate implementation
3476 of the ISO standard, declarations such as 
3477 @samp{friend int foo(int)}, where the name of the friend is an unqualified-id,
3478 could be interpreted as a particular specialization of a template
3479 function; the warning exists to diagnose compatibility problems, 
3480 and is enabled by default.
3481
3482 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
3483 @opindex Wold-style-cast
3484 @opindex Wno-old-style-cast
3485 Warn if an old-style (C-style) cast to a non-void type is used within
3486 a C++ program.  The new-style casts (@code{dynamic_cast},
3487 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
3488 less vulnerable to unintended effects and much easier to search for.
3489
3490 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
3491 @opindex Woverloaded-virtual
3492 @opindex Wno-overloaded-virtual
3493 @cindex overloaded virtual function, warning
3494 @cindex warning for overloaded virtual function
3495 Warn when a function declaration hides virtual functions from a
3496 base class.  For example, in:
3497
3498 @smallexample
3499 struct A @{
3500   virtual void f();
3501 @};
3502
3503 struct B: public A @{
3504   void f(int);
3505 @};
3506 @end smallexample
3507
3508 the @code{A} class version of @code{f} is hidden in @code{B}, and code
3509 like:
3510
3511 @smallexample
3512 B* b;
3513 b->f();
3514 @end smallexample
3515
3516 @noindent
3517 fails to compile.
3518
3519 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
3520 @opindex Wno-pmf-conversions
3521 @opindex Wpmf-conversions
3522 Disable the diagnostic for converting a bound pointer to member function
3523 to a plain pointer.
3524
3525 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
3526 @opindex Wsign-promo
3527 @opindex Wno-sign-promo
3528 Warn when overload resolution chooses a promotion from unsigned or
3529 enumerated type to a signed type, over a conversion to an unsigned type of
3530 the same size.  Previous versions of G++ tried to preserve
3531 unsignedness, but the standard mandates the current behavior.
3532
3533 @item -Wtemplates @r{(C++ and Objective-C++ only)}
3534 @opindex Wtemplates
3535 @opindex Wno-templates
3536 Warn when a primary template declaration is encountered.  Some coding
3537 rules disallow templates, and this may be used to enforce that rule.
3538 The warning is inactive inside a system header file, such as the STL, so
3539 one can still use the STL.  One may also instantiate or specialize
3540 templates.
3541
3542 @item -Wmismatched-tags @r{(C++ and Objective-C++ only)}
3543 @opindex Wmismatched-tags
3544 @opindex Wno-mismatched-tags
3545 Warn for declarations of structs, classes, and class templates and their
3546 specializations with a class-key that does not match either the definition
3547 or the first declaration if no definition is provided.
3548
3549 For example, the declaration of @code{struct Object} in the argument list
3550 of @code{draw} triggers the warning.  To avoid it, either remove the redundant
3551 class-key @code{struct} or replace it with @code{class} to match its definition.
3552 @smallexample
3553 class Object @{
3554 public:
3555   virtual ~Object () = 0;
3556 @};
3557 void draw (struct Object*);
3558 @end smallexample
3559
3560 It is not wrong to declare a class with the class-key @code{struct} as
3561 the example above shows.  The @option{-Wmismatched-tags} option is intended
3562 to help achieve a consistent style of class declarations.  In code that is
3563 intended to be portable to Windows-based compilers the warning helps prevent
3564 unresolved references due to the difference in the mangling of symbols
3565 declared with different class-keys.  The option can be used either on its
3566 own or in conjunction with @option{-Wredundant-tags}.
3567
3568 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
3569 @opindex Wmultiple-inheritance
3570 @opindex Wno-multiple-inheritance
3571 Warn when a class is defined with multiple direct base classes.  Some
3572 coding rules disallow multiple inheritance, and this may be used to
3573 enforce that rule.  The warning is inactive inside a system header file,
3574 such as the STL, so one can still use the STL.  One may also define
3575 classes that indirectly use multiple inheritance.
3576
3577 @item -Wvirtual-inheritance
3578 @opindex Wvirtual-inheritance
3579 @opindex Wno-virtual-inheritance
3580 Warn when a class is defined with a virtual direct base class.  Some
3581 coding rules disallow multiple inheritance, and this may be used to
3582 enforce that rule.  The warning is inactive inside a system header file,
3583 such as the STL, so one can still use the STL.  One may also define
3584 classes that indirectly use virtual inheritance.
3585
3586 @item -Wnamespaces
3587 @opindex Wnamespaces
3588 @opindex Wno-namespaces
3589 Warn when a namespace definition is opened.  Some coding rules disallow
3590 namespaces, and this may be used to enforce that rule.  The warning is
3591 inactive inside a system header file, such as the STL, so one can still
3592 use the STL.  One may also use using directives and qualified names.
3593
3594 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
3595 @opindex Wterminate
3596 @opindex Wno-terminate
3597 Disable the warning about a throw-expression that will immediately
3598 result in a call to @code{terminate}.
3599
3600 @item -Wno-class-conversion @r{(C++ and Objective-C++ only)}
3601 @opindex Wno-class-conversion
3602 @opindex Wclass-conversion
3603 Disable the warning about the case when a conversion function converts an
3604 object to the same type, to a base class of that type, or to void; such
3605 a conversion function will never be called.
3606
3607 @item -Wvolatile @r{(C++ and Objective-C++ only)}
3608 @opindex Wvolatile
3609 @opindex Wno-volatile
3610 Warn about deprecated uses of the @code{volatile} qualifier.  This includes
3611 postfix and prefix @code{++} and @code{--} expressions of
3612 @code{volatile}-qualified types, using simple assignments where the left
3613 operand is a @code{volatile}-qualified non-class type for their value,
3614 compound assignments where the left operand is a @code{volatile}-qualified
3615 non-class type, @code{volatile}-qualified function return type,
3616 @code{volatile}-qualified parameter type, and structured bindings of a
3617 @code{volatile}-qualified type.  This usage was deprecated in C++20.
3618
3619 Enabled by default with @option{-std=c++2a}.
3620 @end table
3621
3622 @node Objective-C and Objective-C++ Dialect Options
3623 @section Options Controlling Objective-C and Objective-C++ Dialects
3624
3625 @cindex compiler options, Objective-C and Objective-C++
3626 @cindex Objective-C and Objective-C++ options, command-line
3627 @cindex options, Objective-C and Objective-C++
3628 (NOTE: This manual does not describe the Objective-C and Objective-C++
3629 languages themselves.  @xref{Standards,,Language Standards
3630 Supported by GCC}, for references.)
3631
3632 This section describes the command-line options that are only meaningful
3633 for Objective-C and Objective-C++ programs.  You can also use most of
3634 the language-independent GNU compiler options.
3635 For example, you might compile a file @file{some_class.m} like this:
3636
3637 @smallexample
3638 gcc -g -fgnu-runtime -O -c some_class.m
3639 @end smallexample
3640
3641 @noindent
3642 In this example, @option{-fgnu-runtime} is an option meant only for
3643 Objective-C and Objective-C++ programs; you can use the other options with
3644 any language supported by GCC@.
3645
3646 Note that since Objective-C is an extension of the C language, Objective-C
3647 compilations may also use options specific to the C front-end (e.g.,
3648 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
3649 C++-specific options (e.g., @option{-Wabi}).
3650
3651 Here is a list of options that are @emph{only} for compiling Objective-C
3652 and Objective-C++ programs:
3653
3654 @table @gcctabopt
3655 @item -fconstant-string-class=@var{class-name}
3656 @opindex fconstant-string-class
3657 Use @var{class-name} as the name of the class to instantiate for each
3658 literal string specified with the syntax @code{@@"@dots{}"}.  The default
3659 class name is @code{NXConstantString} if the GNU runtime is being used, and
3660 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
3661 @option{-fconstant-cfstrings} option, if also present, overrides the
3662 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
3663 to be laid out as constant CoreFoundation strings.
3664
3665 @item -fgnu-runtime
3666 @opindex fgnu-runtime
3667 Generate object code compatible with the standard GNU Objective-C
3668 runtime.  This is the default for most types of systems.
3669
3670 @item -fnext-runtime
3671 @opindex fnext-runtime
3672 Generate output compatible with the NeXT runtime.  This is the default
3673 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
3674 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
3675 used.
3676
3677 @item -fno-nil-receivers
3678 @opindex fno-nil-receivers
3679 @opindex fnil-receivers
3680 Assume that all Objective-C message dispatches (@code{[receiver
3681 message:arg]}) in this translation unit ensure that the receiver is
3682 not @code{nil}.  This allows for more efficient entry points in the
3683 runtime to be used.  This option is only available in conjunction with
3684 the NeXT runtime and ABI version 0 or 1.
3685
3686 @item -fobjc-abi-version=@var{n}
3687 @opindex fobjc-abi-version
3688 Use version @var{n} of the Objective-C ABI for the selected runtime.
3689 This option is currently supported only for the NeXT runtime.  In that
3690 case, Version 0 is the traditional (32-bit) ABI without support for
3691 properties and other Objective-C 2.0 additions.  Version 1 is the
3692 traditional (32-bit) ABI with support for properties and other
3693 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
3694 nothing is specified, the default is Version 0 on 32-bit target
3695 machines, and Version 2 on 64-bit target machines.
3696
3697 @item -fobjc-call-cxx-cdtors
3698 @opindex fobjc-call-cxx-cdtors
3699 For each Objective-C class, check if any of its instance variables is a
3700 C++ object with a non-trivial default constructor.  If so, synthesize a
3701 special @code{- (id) .cxx_construct} instance method which runs
3702 non-trivial default constructors on any such instance variables, in order,
3703 and then return @code{self}.  Similarly, check if any instance variable
3704 is a C++ object with a non-trivial destructor, and if so, synthesize a
3705 special @code{- (void) .cxx_destruct} method which runs
3706 all such default destructors, in reverse order.
3707
3708 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
3709 methods thusly generated only operate on instance variables
3710 declared in the current Objective-C class, and not those inherited
3711 from superclasses.  It is the responsibility of the Objective-C
3712 runtime to invoke all such methods in an object's inheritance
3713 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
3714 by the runtime immediately after a new object instance is allocated;
3715 the @code{- (void) .cxx_destruct} methods are invoked immediately
3716 before the runtime deallocates an object instance.
3717
3718 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3719 support for invoking the @code{- (id) .cxx_construct} and
3720 @code{- (void) .cxx_destruct} methods.
3721
3722 @item -fobjc-direct-dispatch
3723 @opindex fobjc-direct-dispatch
3724 Allow fast jumps to the message dispatcher.  On Darwin this is
3725 accomplished via the comm page.
3726
3727 @item -fobjc-exceptions
3728 @opindex fobjc-exceptions
3729 Enable syntactic support for structured exception handling in
3730 Objective-C, similar to what is offered by C++.  This option
3731 is required to use the Objective-C keywords @code{@@try},
3732 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3733 @code{@@synchronized}.  This option is available with both the GNU
3734 runtime and the NeXT runtime (but not available in conjunction with
3735 the NeXT runtime on Mac OS X 10.2 and earlier).
3736
3737 @item -fobjc-gc
3738 @opindex fobjc-gc
3739 Enable garbage collection (GC) in Objective-C and Objective-C++
3740 programs.  This option is only available with the NeXT runtime; the
3741 GNU runtime has a different garbage collection implementation that
3742 does not require special compiler flags.
3743
3744 @item -fobjc-nilcheck
3745 @opindex fobjc-nilcheck
3746 For the NeXT runtime with version 2 of the ABI, check for a nil
3747 receiver in method invocations before doing the actual method call.
3748 This is the default and can be disabled using
3749 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3750 checked for nil in this way no matter what this flag is set to.
3751 Currently this flag does nothing when the GNU runtime, or an older
3752 version of the NeXT runtime ABI, is used.
3753
3754 @item -fobjc-std=objc1
3755 @opindex fobjc-std
3756 Conform to the language syntax of Objective-C 1.0, the language
3757 recognized by GCC 4.0.  This only affects the Objective-C additions to
3758 the C/C++ language; it does not affect conformance to C/C++ standards,
3759 which is controlled by the separate C/C++ dialect option flags.  When
3760 this option is used with the Objective-C or Objective-C++ compiler,
3761 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3762 This is useful if you need to make sure that your Objective-C code can
3763 be compiled with older versions of GCC@.
3764
3765 @item -freplace-objc-classes
3766 @opindex freplace-objc-classes
3767 Emit a special marker instructing @command{ld(1)} not to statically link in
3768 the resulting object file, and allow @command{dyld(1)} to load it in at
3769 run time instead.  This is used in conjunction with the Fix-and-Continue
3770 debugging mode, where the object file in question may be recompiled and
3771 dynamically reloaded in the course of program execution, without the need
3772 to restart the program itself.  Currently, Fix-and-Continue functionality
3773 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3774 and later.
3775
3776 @item -fzero-link
3777 @opindex fzero-link
3778 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3779 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3780 compile time) with static class references that get initialized at load time,
3781 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3782 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3783 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3784 for individual class implementations to be modified during program execution.
3785 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3786 regardless of command-line options.
3787
3788 @item -fno-local-ivars
3789 @opindex fno-local-ivars
3790 @opindex flocal-ivars
3791 By default instance variables in Objective-C can be accessed as if
3792 they were local variables from within the methods of the class they're
3793 declared in.  This can lead to shadowing between instance variables
3794 and other variables declared either locally inside a class method or
3795 globally with the same name.  Specifying the @option{-fno-local-ivars}
3796 flag disables this behavior thus avoiding variable shadowing issues.
3797
3798 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3799 @opindex fivar-visibility
3800 Set the default instance variable visibility to the specified option
3801 so that instance variables declared outside the scope of any access
3802 modifier directives default to the specified visibility.
3803
3804 @item -gen-decls
3805 @opindex gen-decls
3806 Dump interface declarations for all classes seen in the source file to a
3807 file named @file{@var{sourcename}.decl}.
3808
3809 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3810 @opindex Wassign-intercept
3811 @opindex Wno-assign-intercept
3812 Warn whenever an Objective-C assignment is being intercepted by the
3813 garbage collector.
3814
3815 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3816 @opindex Wno-protocol
3817 @opindex Wprotocol
3818 If a class is declared to implement a protocol, a warning is issued for
3819 every method in the protocol that is not implemented by the class.  The
3820 default behavior is to issue a warning for every method not explicitly
3821 implemented in the class, even if a method implementation is inherited
3822 from the superclass.  If you use the @option{-Wno-protocol} option, then
3823 methods inherited from the superclass are considered to be implemented,
3824 and no warning is issued for them.
3825
3826 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3827 @opindex Wselector
3828 @opindex Wno-selector
3829 Warn if multiple methods of different types for the same selector are
3830 found during compilation.  The check is performed on the list of methods
3831 in the final stage of compilation.  Additionally, a check is performed
3832 for each selector appearing in a @code{@@selector(@dots{})}
3833 expression, and a corresponding method for that selector has been found
3834 during compilation.  Because these checks scan the method table only at
3835 the end of compilation, these warnings are not produced if the final
3836 stage of compilation is not reached, for example because an error is
3837 found during compilation, or because the @option{-fsyntax-only} option is
3838 being used.
3839
3840 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3841 @opindex Wstrict-selector-match
3842 @opindex Wno-strict-selector-match
3843 Warn if multiple methods with differing argument and/or return types are
3844 found for a given selector when attempting to send a message using this
3845 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3846 is off (which is the default behavior), the compiler omits such warnings
3847 if any differences found are confined to types that share the same size
3848 and alignment.
3849
3850 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3851 @opindex Wundeclared-selector
3852 @opindex Wno-undeclared-selector
3853 Warn if a @code{@@selector(@dots{})} expression referring to an
3854 undeclared selector is found.  A selector is considered undeclared if no
3855 method with that name has been declared before the
3856 @code{@@selector(@dots{})} expression, either explicitly in an
3857 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3858 an @code{@@implementation} section.  This option always performs its
3859 checks as soon as a @code{@@selector(@dots{})} expression is found,
3860 while @option{-Wselector} only performs its checks in the final stage of
3861 compilation.  This also enforces the coding style convention
3862 that methods and selectors must be declared before being used.
3863
3864 @item -print-objc-runtime-info
3865 @opindex print-objc-runtime-info
3866 Generate C header describing the largest structure that is passed by
3867 value, if any.
3868
3869 @end table
3870
3871 @node Diagnostic Message Formatting Options
3872 @section Options to Control Diagnostic Messages Formatting
3873 @cindex options to control diagnostics formatting
3874 @cindex diagnostic messages
3875 @cindex message formatting
3876
3877 Traditionally, diagnostic messages have been formatted irrespective of
3878 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3879 options described below
3880 to control the formatting algorithm for diagnostic messages, 
3881 e.g.@: how many characters per line, how often source location
3882 information should be reported.  Note that some language front ends may not
3883 honor these options.
3884
3885 @table @gcctabopt
3886 @item -fmessage-length=@var{n}
3887 @opindex fmessage-length
3888 Try to format error messages so that they fit on lines of about
3889 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3890 done; each error message appears on a single line.  This is the
3891 default for all front ends.
3892
3893 Note - this option also affects the display of the @samp{#error} and
3894 @samp{#warning} pre-processor directives, and the @samp{deprecated}
3895 function/type/variable attribute.  It does not however affect the
3896 @samp{pragma GCC warning} and @samp{pragma GCC error} pragmas.
3897
3898 @item -fdiagnostics-show-location=once
3899 @opindex fdiagnostics-show-location
3900 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3901 reporter to emit source location information @emph{once}; that is, in
3902 case the message is too long to fit on a single physical line and has to
3903 be wrapped, the source location won't be emitted (as prefix) again,
3904 over and over, in subsequent continuation lines.  This is the default
3905 behavior.
3906
3907 @item -fdiagnostics-show-location=every-line
3908 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3909 messages reporter to emit the same source location information (as
3910 prefix) for physical lines that result from the process of breaking
3911 a message which is too long to fit on a single line.
3912
3913 @item -fdiagnostics-color[=@var{WHEN}]
3914 @itemx -fno-diagnostics-color
3915 @opindex fdiagnostics-color
3916 @cindex highlight, color
3917 @vindex GCC_COLORS @r{environment variable}
3918 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3919 or @samp{auto}.  The default depends on how the compiler has been configured,
3920 it can be any of the above @var{WHEN} options or also @samp{never}
3921 if @env{GCC_COLORS} environment variable isn't present in the environment,
3922 and @samp{auto} otherwise.
3923 @samp{auto} means to use color only when the standard error is a terminal.
3924 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3925 aliases for @option{-fdiagnostics-color=always} and
3926 @option{-fdiagnostics-color=never}, respectively.
3927
3928 The colors are defined by the environment variable @env{GCC_COLORS}.
3929 Its value is a colon-separated list of capabilities and Select Graphic
3930 Rendition (SGR) substrings. SGR commands are interpreted by the
3931 terminal or terminal emulator.  (See the section in the documentation
3932 of your text terminal for permitted values and their meanings as
3933 character attributes.)  These substring values are integers in decimal
3934 representation and can be concatenated with semicolons.
3935 Common values to concatenate include
3936 @samp{1} for bold,
3937 @samp{4} for underline,
3938 @samp{5} for blink,
3939 @samp{7} for inverse,
3940 @samp{39} for default foreground color,
3941 @samp{30} to @samp{37} for foreground colors,
3942 @samp{90} to @samp{97} for 16-color mode foreground colors,
3943 @samp{38;5;0} to @samp{38;5;255}
3944 for 88-color and 256-color modes foreground colors,
3945 @samp{49} for default background color,
3946 @samp{40} to @samp{47} for background colors,
3947 @samp{100} to @samp{107} for 16-color mode background colors,
3948 and @samp{48;5;0} to @samp{48;5;255}
3949 for 88-color and 256-color modes background colors.
3950
3951 The default @env{GCC_COLORS} is
3952 @smallexample
3953 error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\
3954 quote=01:path=01;36:fixit-insert=32:fixit-delete=31:\
3955 diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32:\
3956 type-diff=01;32
3957 @end smallexample
3958 @noindent
3959 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3960 @samp{01;36} is bold cyan, @samp{32} is green, @samp{34} is blue,
3961 @samp{01} is bold, and @samp{31} is red.
3962 Setting @env{GCC_COLORS} to the empty string disables colors.
3963 Supported capabilities are as follows.
3964
3965 @table @code
3966 @item error=
3967 @vindex error GCC_COLORS @r{capability}
3968 SGR substring for error: markers.
3969
3970 @item warning=
3971 @vindex warning GCC_COLORS @r{capability}
3972 SGR substring for warning: markers.
3973
3974 @item note=
3975 @vindex note GCC_COLORS @r{capability}
3976 SGR substring for note: markers.
3977
3978 @item path=
3979 @vindex path GCC_COLORS @r{capability}
3980 SGR substring for colorizing paths of control-flow events as printed
3981 via @option{-fdiagnostics-path-format=}, such as the identifiers of
3982 individual events and lines indicating interprocedural calls and returns.
3983
3984 @item range1=
3985 @vindex range1 GCC_COLORS @r{capability}
3986 SGR substring for first additional range.
3987
3988 @item range2=
3989 @vindex range2 GCC_COLORS @r{capability}
3990 SGR substring for second additional range.
3991
3992 @item locus=
3993 @vindex locus GCC_COLORS @r{capability}
3994 SGR substring for location information, @samp{file:line} or
3995 @samp{file:line:column} etc.
3996
3997 @item quote=
3998 @vindex quote GCC_COLORS @r{capability}
3999 SGR substring for information printed within quotes.
4000
4001 @item fixit-insert=
4002 @vindex fixit-insert GCC_COLORS @r{capability}
4003 SGR substring for fix-it hints suggesting text to
4004 be inserted or replaced.
4005
4006 @item fixit-delete=
4007 @vindex fixit-delete GCC_COLORS @r{capability}
4008 SGR substring for fix-it hints suggesting text to
4009 be deleted.
4010
4011 @item diff-filename=
4012 @vindex diff-filename GCC_COLORS @r{capability}
4013 SGR substring for filename headers within generated patches.
4014
4015 @item diff-hunk=
4016 @vindex diff-hunk GCC_COLORS @r{capability}
4017 SGR substring for the starts of hunks within generated patches.
4018
4019 @item diff-delete=
4020 @vindex diff-delete GCC_COLORS @r{capability}
4021 SGR substring for deleted lines within generated patches.
4022
4023 @item diff-insert=
4024 @vindex diff-insert GCC_COLORS @r{capability}
4025 SGR substring for inserted lines within generated patches.
4026
4027 @item type-diff=
4028 @vindex type-diff GCC_COLORS @r{capability}
4029 SGR substring for highlighting mismatching types within template
4030 arguments in the C++ frontend.
4031 @end table
4032
4033 @item -fdiagnostics-urls[=@var{WHEN}]
4034 @opindex fdiagnostics-urls
4035 @cindex urls
4036 Use escape sequences to embed URLs in diagnostics.  For example, when
4037 @option{-fdiagnostics-show-option} emits text showing the command-line
4038 option controlling a diagnostic, embed a URL for documentation of that
4039 option.
4040
4041 @var{WHEN} is @samp{never}, @samp{always}, or @samp{auto}.
4042 The default is @samp{auto}, which means to use URL escape sequences only
4043 when the standard error is a terminal.
4044
4045 @item -fno-diagnostics-show-option
4046 @opindex fno-diagnostics-show-option
4047 @opindex fdiagnostics-show-option
4048 By default, each diagnostic emitted includes text indicating the
4049 command-line option that directly controls the diagnostic (if such an
4050 option is known to the diagnostic machinery).  Specifying the
4051 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
4052
4053 @item -fno-diagnostics-show-caret
4054 @opindex fno-diagnostics-show-caret
4055 @opindex fdiagnostics-show-caret
4056 By default, each diagnostic emitted includes the original source line
4057 and a caret @samp{^} indicating the column.  This option suppresses this
4058 information.  The source line is truncated to @var{n} characters, if
4059 the @option{-fmessage-length=n} option is given.  When the output is done
4060 to the terminal, the width is limited to the width given by the
4061 @env{COLUMNS} environment variable or, if not set, to the terminal width.
4062
4063 @item -fno-diagnostics-show-labels
4064 @opindex fno-diagnostics-show-labels
4065 @opindex fdiagnostics-show-labels
4066 By default, when printing source code (via @option{-fdiagnostics-show-caret}),
4067 diagnostics can label ranges of source code with pertinent information, such
4068 as the types of expressions:
4069
4070 @smallexample
4071     printf ("foo %s bar", long_i + long_j);
4072                  ~^       ~~~~~~~~~~~~~~~
4073                   |              |
4074                   char *         long int
4075 @end smallexample
4076
4077 This option suppresses the printing of these labels (in the example above,
4078 the vertical bars and the ``char *'' and ``long int'' text).
4079
4080 @item -fno-diagnostics-show-cwe
4081 @opindex fno-diagnostics-show-cwe
4082 @opindex fdiagnostics-show-cwe
4083 Diagnostic messages can optionally have an associated
4084 @url{https://cwe.mitre.org/index.html, CWE} identifier.
4085 GCC itself only provides such metadata for some of the @option{-fanalyzer}
4086 diagnostics.  GCC plugins may also provide diagnostics with such metadata.
4087 By default, if this information is present, it will be printed with
4088 the diagnostic.  This option suppresses the printing of this metadata.
4089
4090 @item -fno-diagnostics-show-line-numbers
4091 @opindex fno-diagnostics-show-line-numbers
4092 @opindex fdiagnostics-show-line-numbers
4093 By default, when printing source code (via @option{-fdiagnostics-show-caret}),
4094 a left margin is printed, showing line numbers.  This option suppresses this
4095 left margin.
4096
4097 @item -fdiagnostics-minimum-margin-width=@var{width}
4098 @opindex fdiagnostics-minimum-margin-width
4099 This option controls the minimum width of the left margin printed by
4100 @option{-fdiagnostics-show-line-numbers}.  It defaults to 6.
4101
4102 @item -fdiagnostics-parseable-fixits
4103 @opindex fdiagnostics-parseable-fixits
4104 Emit fix-it hints in a machine-parseable format, suitable for consumption
4105 by IDEs.  For each fix-it, a line will be printed after the relevant
4106 diagnostic, starting with the string ``fix-it:''.  For example:
4107
4108 @smallexample
4109 fix-it:"test.c":@{45:3-45:21@}:"gtk_widget_show_all"
4110 @end smallexample
4111
4112 The location is expressed as a half-open range, expressed as a count of
4113 bytes, starting at byte 1 for the initial column.  In the above example,
4114 bytes 3 through 20 of line 45 of ``test.c'' are to be replaced with the
4115 given string:
4116
4117 @smallexample
4118 00000000011111111112222222222
4119 12345678901234567890123456789
4120   gtk_widget_showall (dlg);
4121   ^^^^^^^^^^^^^^^^^^
4122   gtk_widget_show_all
4123 @end smallexample
4124
4125 The filename and replacement string escape backslash as ``\\", tab as ``\t'',
4126 newline as ``\n'', double quotes as ``\"'', non-printable characters as octal
4127 (e.g. vertical tab as ``\013'').
4128
4129 An empty replacement string indicates that the given range is to be removed.
4130 An empty range (e.g. ``45:3-45:3'') indicates that the string is to
4131 be inserted at the given position.
4132
4133 @item -fdiagnostics-generate-patch
4134 @opindex fdiagnostics-generate-patch
4135 Print fix-it hints to stderr in unified diff format, after any diagnostics
4136 are printed.  For example:
4137
4138 @smallexample
4139 --- test.c
4140 +++ test.c
4141 @@ -42,5 +42,5 @@
4142
4143  void show_cb(GtkDialog *dlg)
4144  @{
4145 -  gtk_widget_showall(dlg);
4146 +  gtk_widget_show_all(dlg);
4147  @}
4148
4149 @end smallexample
4150
4151 The diff may or may not be colorized, following the same rules
4152 as for diagnostics (see @option{-fdiagnostics-color}).
4153
4154 @item -fdiagnostics-show-template-tree
4155 @opindex fdiagnostics-show-template-tree
4156
4157 In the C++ frontend, when printing diagnostics showing mismatching
4158 template types, such as:
4159
4160 @smallexample
4161   could not convert 'std::map<int, std::vector<double> >()'
4162     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
4163 @end smallexample
4164
4165 the @option{-fdiagnostics-show-template-tree} flag enables printing a
4166 tree-like structure showing the common and differing parts of the types,
4167 such as:
4168
4169 @smallexample
4170   map<
4171     [...],
4172     vector<
4173       [double != float]>>
4174 @end smallexample
4175
4176 The parts that differ are highlighted with color (``double'' and
4177 ``float'' in this case).
4178
4179 @item -fno-elide-type
4180 @opindex fno-elide-type
4181 @opindex felide-type
4182 By default when the C++ frontend prints diagnostics showing mismatching
4183 template types, common parts of the types are printed as ``[...]'' to
4184 simplify the error message.  For example:
4185
4186 @smallexample
4187   could not convert 'std::map<int, std::vector<double> >()'
4188     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
4189 @end smallexample
4190
4191 Specifying the @option{-fno-elide-type} flag suppresses that behavior.
4192 This flag also affects the output of the
4193 @option{-fdiagnostics-show-template-tree} flag.
4194
4195 @item -fdiagnostics-path-format=@var{KIND}
4196 @opindex fdiagnostics-path-format
4197 Specify how to print paths of control-flow events for diagnostics that
4198 have such a path associated with them.
4199
4200 @var{KIND} is @samp{none}, @samp{separate-events}, or @samp{inline-events},
4201 the default.
4202
4203 @samp{none} means to not print diagnostic paths.
4204
4205 @samp{separate-events} means to print a separate ``note'' diagnostic for
4206 each event within the diagnostic.  For example:
4207
4208 @smallexample
4209 test.c:29:5: error: passing NULL as argument 1 to 'PyList_Append' which requires a non-NULL parameter
4210 test.c:25:10: note: (1) when 'PyList_New' fails, returning NULL
4211 test.c:27:3: note: (2) when 'i < count'
4212 test.c:29:5: note: (3) when calling 'PyList_Append', passing NULL from (1) as argument 1
4213 @end smallexample
4214
4215 @samp{inline-events} means to print the events ``inline'' within the source
4216 code.  This view attempts to consolidate the events into runs of
4217 sufficiently-close events, printing them as labelled ranges within the source.
4218
4219 For example, the same events as above might be printed as:
4220
4221 @smallexample
4222   'test': events 1-3
4223     |
4224     |   25 |   list = PyList_New(0);
4225     |      |          ^~~~~~~~~~~~~
4226     |      |          |
4227     |      |          (1) when 'PyList_New' fails, returning NULL
4228     |   26 |
4229     |   27 |   for (i = 0; i < count; i++) @{
4230     |      |   ~~~
4231     |      |   |
4232     |      |   (2) when 'i < count'
4233     |   28 |     item = PyLong_FromLong(random());
4234     |   29 |     PyList_Append(list, item);
4235     |      |     ~~~~~~~~~~~~~~~~~~~~~~~~~
4236     |      |     |
4237     |      |     (3) when calling 'PyList_Append', passing NULL from (1) as argument 1
4238     |
4239 @end smallexample
4240
4241 Interprocedural control flow is shown by grouping the events by stack frame,
4242 and using indentation to show how stack frames are nested, pushed, and popped.
4243
4244 For example:
4245
4246 @smallexample
4247   'test': events 1-2
4248     |
4249     |  133 | @{
4250     |      | ^
4251     |      | |
4252     |      | (1) entering 'test'
4253     |  134 |   boxed_int *obj = make_boxed_int (i);
4254     |      |                    ~~~~~~~~~~~~~~~~~~
4255     |      |                    |
4256     |      |                    (2) calling 'make_boxed_int'
4257     |
4258     +--> 'make_boxed_int': events 3-4
4259            |
4260            |  120 | @{
4261            |      | ^
4262            |      | |
4263            |      | (3) entering 'make_boxed_int'
4264            |  121 |   boxed_int *result = (boxed_int *)wrapped_malloc (sizeof (boxed_int));
4265            |      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4266            |      |                                    |
4267            |      |                                    (4) calling 'wrapped_malloc'
4268            |
4269            +--> 'wrapped_malloc': events 5-6
4270                   |
4271                   |    7 | @{
4272                   |      | ^
4273                   |      | |
4274                   |      | (5) entering 'wrapped_malloc'
4275                   |    8 |   return malloc (size);
4276                   |      |          ~~~~~~~~~~~~~
4277                   |      |          |
4278                   |      |          (6) calling 'malloc'
4279                   |
4280     <-------------+
4281     |
4282  'test': event 7
4283     |
4284     |  138 |   free_boxed_int (obj);
4285     |      |   ^~~~~~~~~~~~~~~~~~~~
4286     |      |   |
4287     |      |   (7) calling 'free_boxed_int'
4288     |
4289 (etc)
4290 @end smallexample
4291
4292 @item -fdiagnostics-show-path-depths
4293 @opindex fdiagnostics-show-path-depths
4294 This option provides additional information when printing control-flow paths
4295 associated with a diagnostic.
4296
4297 If this is option is provided then the stack depth will be printed for
4298 each run of events within @option{-fdiagnostics-path-format=separate-events}.
4299
4300 This is intended for use by GCC developers and plugin developers when
4301 debugging diagnostics that report interprocedural control flow.
4302
4303 @item -fno-show-column
4304 @opindex fno-show-column
4305 @opindex fshow-column
4306 Do not print column numbers in diagnostics.  This may be necessary if
4307 diagnostics are being scanned by a program that does not understand the
4308 column numbers, such as @command{dejagnu}.
4309
4310 @item -fdiagnostics-format=@var{FORMAT}
4311 @opindex fdiagnostics-format
4312 Select a different format for printing diagnostics.
4313 @var{FORMAT} is @samp{text} or @samp{json}.
4314 The default is @samp{text}.
4315
4316 The @samp{json} format consists of a top-level JSON array containing JSON
4317 objects representing the diagnostics.
4318
4319 The JSON is emitted as one line, without formatting; the examples below
4320 have been formatted for clarity.
4321
4322 Diagnostics can have child diagnostics.  For example, this error and note:
4323
4324 @smallexample
4325 misleading-indentation.c:15:3: warning: this 'if' clause does not
4326   guard... [-Wmisleading-indentation]
4327    15 |   if (flag)
4328       |   ^~
4329 misleading-indentation.c:17:5: note: ...this statement, but the latter
4330   is misleadingly indented as if it were guarded by the 'if'
4331    17 |     y = 2;
4332       |     ^
4333 @end smallexample
4334
4335 @noindent
4336 might be printed in JSON form (after formatting) like this:
4337
4338 @smallexample
4339 [
4340     @{
4341         "kind": "warning",
4342         "locations": [
4343             @{
4344                 "caret": @{
4345                     "column": 3,
4346                     "file": "misleading-indentation.c",
4347                     "line": 15
4348                 @},
4349                 "finish": @{
4350                     "column": 4,
4351                     "file": "misleading-indentation.c",
4352                     "line": 15
4353                 @}
4354             @}
4355         ],
4356         "message": "this \u2018if\u2019 clause does not guard...",
4357         "option": "-Wmisleading-indentation",
4358         "option_url": "https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wmisleading-indentation",
4359         "children": [
4360             @{
4361                 "kind": "note",
4362                 "locations": [
4363                     @{
4364                         "caret": @{
4365                             "column": 5,
4366                             "file": "misleading-indentation.c",
4367                             "line": 17
4368                         @}
4369                     @}
4370                 ],
4371                 "message": "...this statement, but the latter is @dots{}"
4372             @}
4373         ]
4374     @},
4375     @dots{}
4376 ]
4377 @end smallexample
4378
4379 @noindent
4380 where the @code{note} is a child of the @code{warning}.
4381
4382 A diagnostic has a @code{kind}.  If this is @code{warning}, then there is
4383 an @code{option} key describing the command-line option controlling the
4384 warning.
4385
4386 A diagnostic can contain zero or more locations.  Each location has up
4387 to three positions within it: a @code{caret} position and optional
4388 @code{start} and @code{finish} positions.  A location can also have
4389 an optional @code{label} string.  For example, this error:
4390
4391 @smallexample
4392 bad-binary-ops.c:64:23: error: invalid operands to binary + (have 'S' @{aka
4393    'struct s'@} and 'T' @{aka 'struct t'@})
4394    64 |   return callee_4a () + callee_4b ();
4395       |          ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
4396       |          |              |
4397       |          |              T @{aka struct t@}
4398       |          S @{aka struct s@}
4399 @end smallexample
4400
4401 @noindent
4402 has three locations.  Its primary location is at the ``+'' token at column
4403 23.  It has two secondary locations, describing the left and right-hand sides
4404 of the expression, which have labels.  It might be printed in JSON form as:
4405
4406 @smallexample
4407     @{
4408         "children": [],
4409         "kind": "error",
4410         "locations": [
4411             @{
4412                 "caret": @{
4413                     "column": 23, "file": "bad-binary-ops.c", "line": 64
4414                 @}
4415             @},
4416             @{
4417                 "caret": @{
4418                     "column": 10, "file": "bad-binary-ops.c", "line": 64
4419                 @},
4420                 "finish": @{
4421                     "column": 21, "file": "bad-binary-ops.c", "line": 64
4422                 @},
4423                 "label": "S @{aka struct s@}"
4424             @},
4425             @{
4426                 "caret": @{
4427                     "column": 25, "file": "bad-binary-ops.c", "line": 64
4428                 @},
4429                 "finish": @{
4430                     "column": 36, "file": "bad-binary-ops.c", "line": 64
4431                 @},
4432                 "label": "T @{aka struct t@}"
4433             @}
4434         ],
4435         "message": "invalid operands to binary + @dots{}"
4436     @}
4437 @end smallexample
4438
4439 If a diagnostic contains fix-it hints, it has a @code{fixits} array,
4440 consisting of half-open intervals, similar to the output of
4441 @option{-fdiagnostics-parseable-fixits}.  For example, this diagnostic
4442 with a replacement fix-it hint:
4443
4444 @smallexample
4445 demo.c:8:15: error: 'struct s' has no member named 'colour'; did you
4446   mean 'color'?
4447     8 |   return ptr->colour;
4448       |               ^~~~~~
4449       |               color
4450 @end smallexample
4451
4452 @noindent
4453 might be printed in JSON form as:
4454
4455 @smallexample
4456     @{
4457         "children": [],
4458         "fixits": [
4459             @{
4460                 "next": @{
4461                     "column": 21,
4462                     "file": "demo.c",
4463                     "line": 8
4464                 @},
4465                 "start": @{
4466                     "column": 15,
4467                     "file": "demo.c",
4468                     "line": 8
4469                 @},
4470                 "string": "color"
4471             @}
4472         ],
4473         "kind": "error",
4474         "locations": [
4475             @{
4476                 "caret": @{
4477                     "column": 15,
4478                     "file": "demo.c",
4479                     "line": 8
4480                 @},
4481                 "finish": @{
4482                     "column": 20,
4483                     "file": "demo.c",
4484                     "line": 8
4485                 @}
4486             @}
4487         ],
4488         "message": "\u2018struct s\u2019 has no member named @dots{}"
4489     @}
4490 @end smallexample
4491
4492 @noindent
4493 where the fix-it hint suggests replacing the text from @code{start} up
4494 to but not including @code{next} with @code{string}'s value.  Deletions
4495 are expressed via an empty value for @code{string}, insertions by
4496 having @code{start} equal @code{next}.
4497
4498 If the diagnostic has a path of control-flow events associated with it,
4499 it has a @code{path} array of objects representing the events.  Each
4500 event object has a @code{description} string, a @code{location} object,
4501 along with a @code{function} string and a @code{depth} number for
4502 representing interprocedural paths.  The @code{function} represents the
4503 current function at that event, and the @code{depth} represents the
4504 stack depth relative to some baseline: the higher, the more frames are
4505 within the stack.
4506
4507 For example, the intraprocedural example shown for
4508 @option{-fdiagnostics-path-format=} might have this JSON for its path:
4509
4510 @smallexample
4511     "path": [
4512         @{
4513             "depth": 0,
4514             "description": "when 'PyList_New' fails, returning NULL",
4515             "function": "test",
4516             "location": @{
4517                 "column": 10,
4518                 "file": "test.c",
4519                 "line": 25
4520             @}
4521         @},
4522         @{
4523             "depth": 0,
4524             "description": "when 'i < count'",
4525             "function": "test",
4526             "location": @{
4527                 "column": 3,
4528                 "file": "test.c",
4529                 "line": 27
4530             @}
4531         @},
4532         @{
4533             "depth": 0,
4534             "description": "when calling 'PyList_Append', passing NULL from (1) as argument 1",
4535             "function": "test",
4536             "location": @{
4537                 "column": 5,
4538                 "file": "test.c",
4539                 "line": 29
4540             @}
4541         @}
4542     ]
4543 @end smallexample
4544
4545 @end table
4546
4547 @node Warning Options
4548 @section Options to Request or Suppress Warnings
4549 @cindex options to control warnings
4550 @cindex warning messages
4551 @cindex messages, warning
4552 @cindex suppressing warnings
4553
4554 Warnings are diagnostic messages that report constructions that
4555 are not inherently erroneous but that are risky or suggest there
4556 may have been an error.
4557
4558 The following language-independent options do not enable specific
4559 warnings but control the kinds of diagnostics produced by GCC@.
4560
4561 @table @gcctabopt
4562 @cindex syntax checking
4563 @item -fsyntax-only
4564 @opindex fsyntax-only
4565 Check the code for syntax errors, but don't do anything beyond that.
4566
4567 @item -fmax-errors=@var{n}
4568 @opindex fmax-errors
4569 Limits the maximum number of error messages to @var{n}, at which point
4570 GCC bails out rather than attempting to continue processing the source
4571 code.  If @var{n} is 0 (the default), there is no limit on the number
4572 of error messages produced.  If @option{-Wfatal-errors} is also
4573 specified, then @option{-Wfatal-errors} takes precedence over this
4574 option.
4575
4576 @item -w
4577 @opindex w
4578 Inhibit all warning messages.
4579
4580 @item -Werror
4581 @opindex Werror
4582 @opindex Wno-error
4583 Make all warnings into errors.
4584
4585 @item -Werror=
4586 @opindex Werror=
4587 @opindex Wno-error=
4588 Make the specified warning into an error.  The specifier for a warning
4589 is appended; for example @option{-Werror=switch} turns the warnings
4590 controlled by @option{-Wswitch} into errors.  This switch takes a
4591 negative form, to be used to negate @option{-Werror} for specific
4592 warnings; for example @option{-Wno-error=switch} makes
4593 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
4594 is in effect.
4595
4596 The warning message for each controllable warning includes the
4597 option that controls the warning.  That option can then be used with
4598 @option{-Werror=} and @option{-Wno-error=} as described above.
4599 (Printing of the option in the warning message can be disabled using the
4600 @option{-fno-diagnostics-show-option} flag.)
4601
4602 Note that specifying @option{-Werror=}@var{foo} automatically implies
4603 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
4604 imply anything.
4605
4606 @item -Wfatal-errors
4607 @opindex Wfatal-errors
4608 @opindex Wno-fatal-errors
4609 This option causes the compiler to abort compilation on the first error
4610 occurred rather than trying to keep going and printing further error
4611 messages.
4612
4613 @end table
4614
4615 You can request many specific warnings with options beginning with
4616 @samp{-W}, for example @option{-Wimplicit} to request warnings on
4617 implicit declarations.  Each of these specific warning options also
4618 has a negative form beginning @samp{-Wno-} to turn off warnings; for
4619 example, @option{-Wno-implicit}.  This manual lists only one of the
4620 two forms, whichever is not the default.  For further
4621 language-specific options also refer to @ref{C++ Dialect Options} and
4622 @ref{Objective-C and Objective-C++ Dialect Options}.
4623
4624 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
4625 options, such as @option{-Wunused}, which may turn on further options,
4626 such as @option{-Wunused-value}. The combined effect of positive and
4627 negative forms is that more specific options have priority over less
4628 specific ones, independently of their position in the command-line. For
4629 options of the same specificity, the last one takes effect. Options
4630 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
4631 as if they appeared at the end of the command-line.
4632
4633 When an unrecognized warning option is requested (e.g.,
4634 @option{-Wunknown-warning}), GCC emits a diagnostic stating
4635 that the option is not recognized.  However, if the @option{-Wno-} form
4636 is used, the behavior is slightly different: no diagnostic is
4637 produced for @option{-Wno-unknown-warning} unless other diagnostics
4638 are being produced.  This allows the use of new @option{-Wno-} options
4639 with old compilers, but if something goes wrong, the compiler
4640 warns that an unrecognized option is present.
4641
4642 The effectiveness of some warnings depends on optimizations also being
4643 enabled. For example @option{-Wsuggest-final-types} is more effective
4644 with link-time optimization and @option{-Wmaybe-uninitialized} will not
4645 warn at all unless optimization is enabled.
4646
4647 @table @gcctabopt
4648 @item -Wpedantic
4649 @itemx -pedantic
4650 @opindex pedantic
4651 @opindex Wpedantic
4652 @opindex Wno-pedantic
4653 Issue all the warnings demanded by strict ISO C and ISO C++;
4654 reject all programs that use forbidden extensions, and some other
4655 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
4656 version of the ISO C standard specified by any @option{-std} option used.
4657
4658 Valid ISO C and ISO C++ programs should compile properly with or without
4659 this option (though a rare few require @option{-ansi} or a
4660 @option{-std} option specifying the required version of ISO C)@.  However,
4661 without this option, certain GNU extensions and traditional C and C++
4662 features are supported as well.  With this option, they are rejected.
4663
4664 @option{-Wpedantic} does not cause warning messages for use of the
4665 alternate keywords whose names begin and end with @samp{__}.  This alternate
4666 format can also be used to disable warnings for non-ISO @samp{__intN} types,
4667 i.e. @samp{__intN__}.
4668 Pedantic warnings are also disabled in the expression that follows
4669 @code{__extension__}.  However, only system header files should use
4670 these escape routes; application programs should avoid them.
4671 @xref{Alternate Keywords}.
4672
4673 Some users try to use @option{-Wpedantic} to check programs for strict ISO
4674 C conformance.  They soon find that it does not do quite what they want:
4675 it finds some non-ISO practices, but not all---only those for which
4676 ISO C @emph{requires} a diagnostic, and some others for which
4677 diagnostics have been added.
4678
4679 A feature to report any failure to conform to ISO C might be useful in
4680 some instances, but would require considerable additional work and would
4681 be quite different from @option{-Wpedantic}.  We don't have plans to
4682 support such a feature in the near future.
4683
4684 Where the standard specified with @option{-std} represents a GNU
4685 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
4686 corresponding @dfn{base standard}, the version of ISO C on which the GNU
4687 extended dialect is based.  Warnings from @option{-Wpedantic} are given
4688 where they are required by the base standard.  (It does not make sense
4689 for such warnings to be given only for features not in the specified GNU
4690 C dialect, since by definition the GNU dialects of C include all
4691 features the compiler supports with the given option, and there would be
4692 nothing to warn about.)
4693
4694 @item -pedantic-errors
4695 @opindex pedantic-errors
4696 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
4697 requires a diagnostic, in some cases where there is undefined behavior
4698 at compile-time and in some other cases that do not prevent compilation
4699 of programs that are valid according to the standard. This is not
4700 equivalent to @option{-Werror=pedantic}, since there are errors enabled
4701 by this option and not enabled by the latter and vice versa.
4702
4703 @item -Wall
4704 @opindex Wall
4705 @opindex Wno-all
4706 This enables all the warnings about constructions that some users
4707 consider questionable, and that are easy to avoid (or modify to
4708 prevent the warning), even in conjunction with macros.  This also
4709 enables some language-specific warnings described in @ref{C++ Dialect
4710 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
4711
4712 @option{-Wall} turns on the following warning flags:
4713
4714 @gccoptlist{-Waddress   @gol
4715 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
4716 -Wbool-compare  @gol
4717 -Wbool-operation  @gol
4718 -Wc++11-compat  -Wc++14-compat  @gol
4719 -Wcatch-value @r{(C++ and Objective-C++ only)}  @gol
4720 -Wchar-subscripts  @gol
4721 -Wcomment  @gol
4722 -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
4723 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
4724 -Wenum-conversion @r{in C/ObjC;} @gol
4725 -Wformat   @gol
4726 -Wint-in-bool-context  @gol
4727 -Wimplicit @r{(C and Objective-C only)} @gol
4728 -Wimplicit-int @r{(C and Objective-C only)} @gol
4729 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
4730 -Winit-self @r{(only for C++)} @gol
4731 -Wzero-length-bounds @gol
4732 -Wlogical-not-parentheses @gol
4733 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
4734 -Wmaybe-uninitialized @gol
4735 -Wmemset-elt-size @gol
4736 -Wmemset-transposed-args @gol
4737 -Wmisleading-indentation @r{(only for C/C++)} @gol
4738 -Wmissing-attributes @gol
4739 -Wmissing-braces @r{(only for C/ObjC)} @gol
4740 -Wmultistatement-macros  @gol
4741 -Wnarrowing @r{(only for C++)}  @gol
4742 -Wnonnull  @gol
4743 -Wnonnull-compare  @gol
4744 -Wopenmp-simd @gol
4745 -Wparentheses  @gol
4746 -Wpessimizing-move @r{(only for C++)}  @gol
4747 -Wpointer-sign  @gol
4748 -Wreorder   @gol
4749 -Wrestrict   @gol
4750 -Wreturn-type  @gol
4751 -Wsequence-point  @gol
4752 -Wsign-compare @r{(only in C++)}  @gol
4753 -Wsizeof-pointer-div @gol
4754 -Wsizeof-pointer-memaccess @gol
4755 -Wstrict-aliasing  @gol
4756 -Wstrict-overflow=1  @gol
4757 -Wswitch  @gol
4758 -Wtautological-compare  @gol
4759 -Wtrigraphs  @gol
4760 -Wuninitialized  @gol
4761 -Wunknown-pragmas  @gol
4762 -Wunused-function  @gol
4763 -Wunused-label     @gol
4764 -Wunused-value     @gol
4765 -Wunused-variable  @gol
4766 -Wvolatile-register-var}
4767
4768 Note that some warning flags are not implied by @option{-Wall}.  Some of
4769 them warn about constructions that users generally do not consider
4770 questionable, but which occasionally you might wish to check for;
4771 others warn about constructions that are necessary or hard to avoid in
4772 some cases, and there is no simple way to modify the code to suppress
4773 the warning. Some of them are enabled by @option{-Wextra} but many of
4774 them must be enabled individually.
4775
4776 @item -Wextra
4777 @opindex W
4778 @opindex Wextra
4779 @opindex Wno-extra
4780 This enables some extra warning flags that are not enabled by
4781 @option{-Wall}. (This option used to be called @option{-W}.  The older
4782 name is still supported, but the newer name is more descriptive.)
4783
4784 @gccoptlist{-Wclobbered  @gol
4785 -Wcast-function-type  @gol
4786 -Wdeprecated-copy @r{(C++ only)} @gol
4787 -Wempty-body  @gol
4788 -Wignored-qualifiers @gol
4789 -Wimplicit-fallthrough=3 @gol
4790 -Wmissing-field-initializers  @gol
4791 -Wmissing-parameter-type @r{(C only)}  @gol
4792 -Wold-style-declaration @r{(C only)}  @gol
4793 -Woverride-init  @gol
4794 -Wsign-compare @r{(C only)} @gol
4795 -Wstring-compare @gol
4796 -Wredundant-move @r{(only for C++)}  @gol
4797 -Wtype-limits  @gol
4798 -Wuninitialized  @gol
4799 -Wshift-negative-value @r{(in C++03 and in C99 and newer)}  @gol
4800 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
4801 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}}
4802
4803
4804 The option @option{-Wextra} also prints warning messages for the
4805 following cases:
4806
4807 @itemize @bullet
4808
4809 @item
4810 A pointer is compared against integer zero with @code{<}, @code{<=},
4811 @code{>}, or @code{>=}.
4812
4813 @item
4814 (C++ only) An enumerator and a non-enumerator both appear in a
4815 conditional expression.
4816
4817 @item
4818 (C++ only) Ambiguous virtual bases.
4819
4820 @item
4821 (C++ only) Subscripting an array that has been declared @code{register}.
4822
4823 @item
4824 (C++ only) Taking the address of a variable that has been declared
4825 @code{register}.
4826
4827 @item
4828 (C++ only) A base class is not initialized in the copy constructor
4829 of a derived class.
4830
4831 @end itemize
4832
4833 @item -Wchar-subscripts
4834 @opindex Wchar-subscripts
4835 @opindex Wno-char-subscripts
4836 Warn if an array subscript has type @code{char}.  This is a common cause
4837 of error, as programmers often forget that this type is signed on some
4838 machines.
4839 This warning is enabled by @option{-Wall}.
4840
4841 @item -Wno-coverage-mismatch
4842 @opindex Wno-coverage-mismatch
4843 @opindex Wcoverage-mismatch
4844 Warn if feedback profiles do not match when using the
4845 @option{-fprofile-use} option.
4846 If a source file is changed between compiling with @option{-fprofile-generate}
4847 and with @option{-fprofile-use}, the files with the profile feedback can fail
4848 to match the source file and GCC cannot use the profile feedback
4849 information.  By default, this warning is enabled and is treated as an
4850 error.  @option{-Wno-coverage-mismatch} can be used to disable the
4851 warning or @option{-Wno-error=coverage-mismatch} can be used to
4852 disable the error.  Disabling the error for this warning can result in
4853 poorly optimized code and is useful only in the
4854 case of very minor changes such as bug fixes to an existing code-base.
4855 Completely disabling the warning is not recommended.
4856
4857 @item -Wno-cpp
4858 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
4859
4860 Suppress warning messages emitted by @code{#warning} directives.
4861
4862 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
4863 @opindex Wdouble-promotion
4864 @opindex Wno-double-promotion
4865 Give a warning when a value of type @code{float} is implicitly
4866 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
4867 floating-point unit implement @code{float} in hardware, but emulate
4868 @code{double} in software.  On such a machine, doing computations
4869 using @code{double} values is much more expensive because of the
4870 overhead required for software emulation.
4871
4872 It is easy to accidentally do computations with @code{double} because
4873 floating-point literals are implicitly of type @code{double}.  For
4874 example, in:
4875 @smallexample
4876 @group
4877 float area(float radius)
4878 @{
4879    return 3.14159 * radius * radius;
4880 @}
4881 @end group
4882 @end smallexample
4883 the compiler performs the entire computation with @code{double}
4884 because the floating-point literal is a @code{double}.
4885
4886 @item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
4887 @opindex Wduplicate-decl-specifier
4888 @opindex Wno-duplicate-decl-specifier
4889 Warn if a declaration has duplicate @code{const}, @code{volatile},
4890 @code{restrict} or @code{_Atomic} specifier.  This warning is enabled by
4891 @option{-Wall}.
4892
4893 @item -Wformat
4894 @itemx -Wformat=@var{n}
4895 @opindex Wformat
4896 @opindex Wno-format
4897 @opindex ffreestanding
4898 @opindex fno-builtin
4899 @opindex Wformat=
4900 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
4901 the arguments supplied have types appropriate to the format string
4902 specified, and that the conversions specified in the format string make
4903 sense.  This includes standard functions, and others specified by format
4904 attributes (@pxref{Function Attributes}), in the @code{printf},
4905 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
4906 not in the C standard) families (or other target-specific families).
4907 Which functions are checked without format attributes having been
4908 specified depends on the standard version selected, and such checks of
4909 functions without the attribute specified are disabled by
4910 @option{-ffreestanding} or @option{-fno-builtin}.
4911
4912 The formats are checked against the format features supported by GNU
4913 libc version 2.2.  These include all ISO C90 and C99 features, as well
4914 as features from the Single Unix Specification and some BSD and GNU
4915 extensions.  Other library implementations may not support all these
4916 features; GCC does not support warning about features that go beyond a
4917 particular library's limitations.  However, if @option{-Wpedantic} is used
4918 with @option{-Wformat}, warnings are given about format features not
4919 in the selected standard version (but not for @code{strfmon} formats,
4920 since those are not in any version of the C standard).  @xref{C Dialect
4921 Options,,Options Controlling C Dialect}.
4922
4923 @table @gcctabopt
4924 @item -Wformat=1
4925 @itemx -Wformat
4926 @opindex Wformat
4927 @opindex Wformat=1
4928 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
4929 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
4930 @option{-Wformat} also checks for null format arguments for several
4931 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
4932 aspects of this level of format checking can be disabled by the
4933 options: @option{-Wno-format-contains-nul},
4934 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
4935 @option{-Wformat} is enabled by @option{-Wall}.
4936
4937 @item -Wno-format-contains-nul
4938 @opindex Wno-format-contains-nul
4939 @opindex Wformat-contains-nul
4940 If @option{-Wformat} is specified, do not warn about format strings that
4941 contain NUL bytes.
4942
4943 @item -Wno-format-extra-args
4944 @opindex Wno-format-extra-args
4945 @opindex Wformat-extra-args
4946 If @option{-Wformat} is specified, do not warn about excess arguments to a
4947 @code{printf} or @code{scanf} format function.  The C standard specifies
4948 that such arguments are ignored.
4949
4950 Where the unused arguments lie between used arguments that are
4951 specified with @samp{$} operand number specifications, normally
4952 warnings are still given, since the implementation could not know what
4953 type to pass to @code{va_arg} to skip the unused arguments.  However,
4954 in the case of @code{scanf} formats, this option suppresses the
4955 warning if the unused arguments are all pointers, since the Single
4956 Unix Specification says that such unused arguments are allowed.
4957
4958 @item -Wformat-overflow
4959 @itemx -Wformat-overflow=@var{level}
4960 @opindex Wformat-overflow
4961 @opindex Wno-format-overflow
4962 Warn about calls to formatted input/output functions such as @code{sprintf}
4963 and @code{vsprintf} that might overflow the destination buffer.  When the
4964 exact number of bytes written by a format directive cannot be determined
4965 at compile-time it is estimated based on heuristics that depend on the
4966 @var{level} argument and on optimization.  While enabling optimization
4967 will in most cases improve the accuracy of the warning, it may also
4968 result in false positives.
4969
4970 @table @gcctabopt
4971 @item -Wformat-overflow
4972 @itemx -Wformat-overflow=1
4973 @opindex Wformat-overflow
4974 @opindex Wno-format-overflow
4975 Level @var{1} of @option{-Wformat-overflow} enabled by @option{-Wformat}
4976 employs a conservative approach that warns only about calls that most
4977 likely overflow the buffer.  At this level, numeric arguments to format
4978 directives with unknown values are assumed to have the value of one, and
4979 strings of unknown length to be empty.  Numeric arguments that are known
4980 to be bounded to a subrange of their type, or string arguments whose output
4981 is bounded either by their directive's precision or by a finite set of
4982 string literals, are assumed to take on the value within the range that
4983 results in the most bytes on output.  For example, the call to @code{sprintf}
4984 below is diagnosed because even with both @var{a} and @var{b} equal to zero,
4985 the terminating NUL character (@code{'\0'}) appended by the function
4986 to the destination buffer will be written past its end.  Increasing
4987 the size of the buffer by a single byte is sufficient to avoid the
4988 warning, though it may not be sufficient to avoid the overflow.
4989
4990 @smallexample
4991 void f (int a, int b)
4992 @{
4993   char buf [13];
4994   sprintf (buf, "a = %i, b = %i\n", a, b);
4995 @}
4996 @end smallexample
4997
4998 @item -Wformat-overflow=2
4999 Level @var{2} warns also about calls that might overflow the destination
5000 buffer given an argument of sufficient length or magnitude.  At level
5001 @var{2}, unknown numeric arguments are assumed to have the minimum
5002 representable value for signed types with a precision greater than 1, and
5003 the maximum representable value otherwise.  Unknown string arguments whose
5004 length cannot be assumed to be bounded either by the directive's precision,
5005 or by a finite set of string literals they may evaluate to, or the character
5006 array they may point to, are assumed to be 1 character long.
5007
5008 At level @var{2}, the call in the example above is again diagnosed, but
5009 this time because with @var{a} equal to a 32-bit @code{INT_MIN} the first
5010 @code{%i} directive will write some of its digits beyond the end of
5011 the destination buffer.  To make the call safe regardless of the values
5012 of the two variables, the size of the destination buffer must be increased
5013 to at least 34 bytes.  GCC includes the minimum size of the buffer in
5014 an informational note following the warning.
5015
5016 An alternative to increasing the size of the destination buffer is to
5017 constrain the range of formatted values.  The maximum length of string
5018 arguments can be bounded by specifying the precision in the format
5019 directive.  When numeric arguments of format directives can be assumed
5020 to be bounded by less than the precision of their type, choosing
5021 an appropriate length modifier to the format specifier will reduce
5022 the required buffer size.  For example, if @var{a} and @var{b} in the
5023 example above can be assumed to be within the precision of
5024 the @code{short int} type then using either the @code{%hi} format
5025 directive or casting the argument to @code{short} reduces the maximum
5026 required size of the buffer to 24 bytes.
5027
5028 @smallexample
5029 void f (int a, int b)
5030 @{
5031   char buf [23];
5032   sprintf (buf, "a = %hi, b = %i\n", a, (short)b);
5033 @}
5034 @end smallexample
5035 @end table
5036
5037 @item -Wno-format-zero-length
5038 @opindex Wno-format-zero-length
5039 @opindex Wformat-zero-length
5040 If @option{-Wformat} is specified, do not warn about zero-length formats.
5041 The C standard specifies that zero-length formats are allowed.
5042
5043
5044 @item -Wformat=2
5045 @opindex Wformat=2
5046 Enable @option{-Wformat} plus additional format checks.  Currently
5047 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
5048 -Wformat-y2k}.
5049
5050 @item -Wformat-nonliteral
5051 @opindex Wformat-nonliteral
5052 @opindex Wno-format-nonliteral
5053 If @option{-Wformat} is specified, also warn if the format string is not a
5054 string literal and so cannot be checked, unless the format function
5055 takes its format arguments as a @code{va_list}.
5056
5057 @item -Wformat-security
5058 @opindex Wformat-security
5059 @opindex Wno-format-security
5060 If @option{-Wformat} is specified, also warn about uses of format
5061 functions that represent possible security problems.  At present, this
5062 warns about calls to @code{printf} and @code{scanf} functions where the
5063 format string is not a string literal and there are no format arguments,
5064 as in @code{printf (foo);}.  This may be a security hole if the format
5065 string came from untrusted input and contains @samp{%n}.  (This is
5066 currently a subset of what @option{-Wformat-nonliteral} warns about, but
5067 in future warnings may be added to @option{-Wformat-security} that are not
5068 included in @option{-Wformat-nonliteral}.)
5069
5070 @item -Wformat-signedness
5071 @opindex Wformat-signedness
5072 @opindex Wno-format-signedness
5073 If @option{-Wformat} is specified, also warn if the format string
5074 requires an unsigned argument and the argument is signed and vice versa.
5075
5076 @item -Wformat-truncation
5077 @itemx -Wformat-truncation=@var{level}
5078 @opindex Wformat-truncation
5079 @opindex Wno-format-truncation
5080 Warn about calls to formatted input/output functions such as @code{snprintf}
5081 and @code{vsnprintf} that might result in output truncation.  When the exact
5082 number of bytes written by a format directive cannot be determined at
5083 compile-time it is estimated based on heuristics that depend on
5084 the @var{level} argument and on optimization.  While enabling optimization
5085 will in most cases improve the accuracy of the warning, it may also result
5086 in false positives.  Except as noted otherwise, the option uses the same
5087 logic @option{-Wformat-overflow}.
5088
5089 @table @gcctabopt
5090 @item -Wformat-truncation
5091 @itemx -Wformat-truncation=1
5092 @opindex Wformat-truncation
5093 @opindex Wno-format-truncation
5094 Level @var{1} of @option{-Wformat-truncation} enabled by @option{-Wformat}
5095 employs a conservative approach that warns only about calls to bounded
5096 functions whose return value is unused and that will most likely result
5097 in output truncation.
5098
5099 @item -Wformat-truncation=2
5100 Level @var{2} warns also about calls to bounded functions whose return
5101 value is used and that might result in truncation given an argument of
5102 sufficient length or magnitude.
5103 @end table
5104
5105 @item -Wformat-y2k
5106 @opindex Wformat-y2k
5107 @opindex Wno-format-y2k
5108 If @option{-Wformat} is specified, also warn about @code{strftime}
5109 formats that may yield only a two-digit year.
5110 @end table
5111
5112 @item -Wnonnull
5113 @opindex Wnonnull
5114 @opindex Wno-nonnull
5115 Warn about passing a null pointer for arguments marked as
5116 requiring a non-null value by the @code{nonnull} function attribute.
5117
5118 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
5119 can be disabled with the @option{-Wno-nonnull} option.
5120
5121 @item -Wnonnull-compare
5122 @opindex Wnonnull-compare
5123 @opindex Wno-nonnull-compare
5124 Warn when comparing an argument marked with the @code{nonnull}
5125 function attribute against null inside the function.
5126
5127 @option{-Wnonnull-compare} is included in @option{-Wall}.  It
5128 can be disabled with the @option{-Wno-nonnull-compare} option.
5129
5130 @item -Wnull-dereference
5131 @opindex Wnull-dereference
5132 @opindex Wno-null-dereference
5133 Warn if the compiler detects paths that trigger erroneous or
5134 undefined behavior due to dereferencing a null pointer.  This option
5135 is only active when @option{-fdelete-null-pointer-checks} is active,
5136 which is enabled by optimizations in most targets.  The precision of
5137 the warnings depends on the optimization options used.
5138
5139 @item -Winaccessible-base @r{(C++, Objective-C++ only)}
5140 @opindex Winaccessible-base
5141 @opindex Wno-inaccessible-base
5142 Warn when a base class is inaccessible in a class derived from it due to
5143 ambiguity.  The warning is enabled by default.  Note the warning for virtual
5144 bases is enabled by the @option{-Wextra} option.
5145 @smallexample
5146 @group
5147 struct A @{ int a; @};
5148
5149 struct B : A @{ @};
5150
5151 struct C : B, A @{ @};
5152 @end group
5153 @end smallexample
5154
5155 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
5156 @opindex Winit-self
5157 @opindex Wno-init-self
5158 Warn about uninitialized variables that are initialized with themselves.
5159 Note this option can only be used with the @option{-Wuninitialized} option.
5160
5161 For example, GCC warns about @code{i} being uninitialized in the
5162 following snippet only when @option{-Winit-self} has been specified:
5163 @smallexample
5164 @group
5165 int f()
5166 @{
5167   int i = i;
5168   return i;
5169 @}
5170 @end group
5171 @end smallexample
5172
5173 This warning is enabled by @option{-Wall} in C++.
5174
5175 @item -Wimplicit-int @r{(C and Objective-C only)}
5176 @opindex Wimplicit-int
5177 @opindex Wno-implicit-int
5178 Warn when a declaration does not specify a type.
5179 This warning is enabled by @option{-Wall}.
5180
5181 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
5182 @opindex Wimplicit-function-declaration
5183 @opindex Wno-implicit-function-declaration
5184 Give a warning whenever a function is used before being declared. In
5185 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
5186 enabled by default and it is made into an error by
5187 @option{-pedantic-errors}. This warning is also enabled by
5188 @option{-Wall}.
5189
5190 @item -Wimplicit @r{(C and Objective-C only)}
5191 @opindex Wimplicit
5192 @opindex Wno-implicit
5193 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
5194 This warning is enabled by @option{-Wall}.
5195
5196 @item -Wimplicit-fallthrough
5197 @opindex Wimplicit-fallthrough
5198 @opindex Wno-implicit-fallthrough
5199 @option{-Wimplicit-fallthrough} is the same as @option{-Wimplicit-fallthrough=3}
5200 and @option{-Wno-implicit-fallthrough} is the same as
5201 @option{-Wimplicit-fallthrough=0}.
5202
5203 @item -Wimplicit-fallthrough=@var{n}
5204 @opindex Wimplicit-fallthrough=
5205 Warn when a switch case falls through.  For example:
5206
5207 @smallexample
5208 @group
5209 switch (cond)
5210   @{
5211   case 1:
5212     a = 1;
5213     break;
5214   case 2:
5215     a = 2;
5216   case 3:
5217     a = 3;
5218     break;
5219   @}
5220 @end group
5221 @end smallexample
5222
5223 This warning does not warn when the last statement of a case cannot
5224 fall through, e.g. when there is a return statement or a call to function
5225 declared with the noreturn attribute.  @option{-Wimplicit-fallthrough=}
5226 also takes into account control flow statements, such as ifs, and only
5227 warns when appropriate.  E.g.@:
5228
5229 @smallexample
5230 @group
5231 switch (cond)
5232   @{
5233   case 1:
5234     if (i > 3) @{
5235       bar (5);
5236       break;
5237     @} else if (i < 1) @{
5238       bar (0);
5239     @} else
5240       return;
5241   default:
5242     @dots{}
5243   @}
5244 @end group
5245 @end smallexample
5246
5247 Since there are occasions where a switch case fall through is desirable,
5248 GCC provides an attribute, @code{__attribute__ ((fallthrough))}, that is
5249 to be used along with a null statement to suppress this warning that
5250 would normally occur:
5251
5252 @smallexample
5253 @group
5254 switch (cond)
5255   @{
5256   case 1:
5257     bar (0);
5258     __attribute__ ((fallthrough));
5259   default:
5260     @dots{}
5261   @}
5262 @end group
5263 @end smallexample
5264
5265 C++17 provides a standard way to suppress the @option{-Wimplicit-fallthrough}
5266 warning using @code{[[fallthrough]];} instead of the GNU attribute.  In C++11
5267 or C++14 users can use @code{[[gnu::fallthrough]];}, which is a GNU extension.
5268 Instead of these attributes, it is also possible to add a fallthrough comment
5269 to silence the warning.  The whole body of the C or C++ style comment should
5270 match the given regular expressions listed below.  The option argument @var{n}
5271 specifies what kind of comments are accepted:
5272
5273 @itemize @bullet
5274
5275 @item @option{-Wimplicit-fallthrough=0} disables the warning altogether.
5276
5277 @item @option{-Wimplicit-fallthrough=1} matches @code{.*} regular
5278 expression, any comment is used as fallthrough comment.
5279
5280 @item @option{-Wimplicit-fallthrough=2} case insensitively matches
5281 @code{.*falls?[ \t-]*thr(ough|u).*} regular expression.
5282
5283 @item @option{-Wimplicit-fallthrough=3} case sensitively matches one of the
5284 following regular expressions:
5285
5286 @itemize @bullet
5287
5288 @item @code{-fallthrough}
5289
5290 @item @code{@@fallthrough@@}
5291
5292 @item @code{lint -fallthrough[ \t]*}
5293
5294 @item @code{[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?@*FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?}
5295
5296 @item @code{[ \t.!]*(Else,? |Intentional(ly)? )?@*Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?}
5297
5298 @item @code{[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?@*fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?}
5299
5300 @end itemize
5301
5302 @item @option{-Wimplicit-fallthrough=4} case sensitively matches one of the
5303 following regular expressions:
5304
5305 @itemize @bullet
5306
5307 @item @code{-fallthrough}
5308
5309 @item @code{@@fallthrough@@}
5310
5311 @item @code{lint -fallthrough[ \t]*}
5312
5313 @item @code{[ \t]*FALLTHR(OUGH|U)[ \t]*}
5314
5315 @end itemize
5316
5317 @item @option{-Wimplicit-fallthrough=5} doesn't recognize any comments as
5318 fallthrough comments, only attributes disable the warning.
5319
5320 @end itemize
5321
5322 The comment needs to be followed after optional whitespace and other comments
5323 by @code{case} or @code{default} keywords or by a user label that precedes some
5324 @code{case} or @code{default} label.
5325
5326 @smallexample
5327 @group
5328 switch (cond)
5329   @{
5330   case 1:
5331     bar (0);
5332     /* FALLTHRU */
5333   default:
5334     @dots{}
5335   @}
5336 @end group
5337 @end smallexample
5338
5339 The @option{-Wimplicit-fallthrough=3} warning is enabled by @option{-Wextra}.
5340
5341 @item -Wif-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
5342 @opindex Wif-not-aligned
5343 @opindex Wno-if-not-aligned
5344 Control if warning triggered by the @code{warn_if_not_aligned} attribute
5345 should be issued.  This is enabled by default.
5346 Use @option{-Wno-if-not-aligned} to disable it.
5347
5348 @item -Wignored-qualifiers @r{(C and C++ only)}
5349 @opindex Wignored-qualifiers
5350 @opindex Wno-ignored-qualifiers
5351 Warn if the return type of a function has a type qualifier
5352 such as @code{const}.  For ISO C such a type qualifier has no effect,
5353 since the value returned by a function is not an lvalue.
5354 For C++, the warning is only emitted for scalar types or @code{void}.
5355 ISO C prohibits qualified @code{void} return types on function
5356 definitions, so such return types always receive a warning
5357 even without this option.
5358
5359 This warning is also enabled by @option{-Wextra}.
5360
5361 @item -Wignored-attributes @r{(C and C++ only)}
5362 @opindex Wignored-attributes
5363 @opindex Wno-ignored-attributes
5364 Warn when an attribute is ignored.  This is different from the
5365 @option{-Wattributes} option in that it warns whenever the compiler decides
5366 to drop an attribute, not that the attribute is either unknown, used in a
5367 wrong place, etc.  This warning is enabled by default.
5368
5369 @item -Wmain
5370 @opindex Wmain
5371 @opindex Wno-main
5372 Warn if the type of @code{main} is suspicious.  @code{main} should be
5373 a function with external linkage, returning int, taking either zero
5374 arguments, two, or three arguments of appropriate types.  This warning
5375 is enabled by default in C++ and is enabled by either @option{-Wall}
5376 or @option{-Wpedantic}.
5377
5378 @item -Wmisleading-indentation @r{(C and C++ only)}
5379 @opindex Wmisleading-indentation
5380 @opindex Wno-misleading-indentation
5381 Warn when the indentation of the code does not reflect the block structure.
5382 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
5383 @code{for} clauses with a guarded statement that does not use braces,
5384 followed by an unguarded statement with the same indentation.
5385
5386 In the following example, the call to ``bar'' is misleadingly indented as
5387 if it were guarded by the ``if'' conditional.
5388
5389 @smallexample
5390   if (some_condition ())
5391     foo ();
5392     bar ();  /* Gotcha: this is not guarded by the "if".  */
5393 @end smallexample
5394
5395 In the case of mixed tabs and spaces, the warning uses the
5396 @option{-ftabstop=} option to determine if the statements line up
5397 (defaulting to 8).
5398
5399 The warning is not issued for code involving multiline preprocessor logic
5400 such as the following example.
5401
5402 @smallexample
5403   if (flagA)
5404     foo (0);
5405 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
5406   if (flagB)
5407 #endif
5408     foo (1);
5409 @end smallexample
5410
5411 The warning is not issued after a @code{#line} directive, since this
5412 typically indicates autogenerated code, and no assumptions can be made
5413 about the layout of the file that the directive references.
5414
5415 This warning is enabled by @option{-Wall} in C and C++.
5416
5417 @item -Wmissing-attributes
5418 @opindex Wmissing-attributes
5419 @opindex Wno-missing-attributes
5420 Warn when a declaration of a function is missing one or more attributes
5421 that a related function is declared with and whose absence may adversely
5422 affect the correctness or efficiency of generated code.  For example,
5423 the warning is issued for declarations of aliases that use attributes
5424 to specify less restrictive requirements than those of their targets.
5425 This typically represents a potential optimization opportunity.
5426 By contrast, the @option{-Wattribute-alias=2} option controls warnings
5427 issued when the alias is more restrictive than the target, which could
5428 lead to incorrect code generation.
5429 Attributes considered include @code{alloc_align}, @code{alloc_size},
5430 @code{cold}, @code{const}, @code{hot}, @code{leaf}, @code{malloc},
5431 @code{nonnull}, @code{noreturn}, @code{nothrow}, @code{pure},
5432 @code{returns_nonnull}, and @code{returns_twice}.
5433
5434 In C++, the warning is issued when an explicit specialization of a primary
5435 template declared with attribute @code{alloc_align}, @code{alloc_size},
5436 @code{assume_aligned}, @code{format}, @code{format_arg}, @code{malloc},
5437 or @code{nonnull} is declared without it.  Attributes @code{deprecated},
5438 @code{error}, and @code{warning} suppress the warning.
5439 (@pxref{Function Attributes}).
5440
5441 You can use the @code{copy} attribute to apply the same
5442 set of attributes to a declaration as that on another declaration without
5443 explicitly enumerating the attributes. This attribute can be applied
5444 to declarations of functions (@pxref{Common Function Attributes}),
5445 variables (@pxref{Common Variable Attributes}), or types
5446 (@pxref{Common Type Attributes}).
5447
5448 @option{-Wmissing-attributes} is enabled by @option{-Wall}.
5449
5450 For example, since the declaration of the primary function template
5451 below makes use of both attribute @code{malloc} and @code{alloc_size}
5452 the declaration of the explicit specialization of the template is
5453 diagnosed because it is missing one of the attributes.
5454
5455 @smallexample
5456 template <class T>
5457 T* __attribute__ ((malloc, alloc_size (1)))
5458 allocate (size_t);
5459
5460 template <>
5461 void* __attribute__ ((malloc))   // missing alloc_size
5462 allocate<void> (size_t);
5463 @end smallexample
5464
5465 @item -Wmissing-braces
5466 @opindex Wmissing-braces
5467 @opindex Wno-missing-braces
5468 Warn if an aggregate or union initializer is not fully bracketed.  In
5469 the following example, the initializer for @code{a} is not fully
5470 bracketed, but that for @code{b} is fully bracketed.  This warning is
5471 enabled by @option{-Wall} in C.
5472
5473 @smallexample
5474 int a[2][2] = @{ 0, 1, 2, 3 @};
5475 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
5476 @end smallexample
5477
5478 This warning is enabled by @option{-Wall}.
5479
5480 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
5481 @opindex Wmissing-include-dirs
5482 @opindex Wno-missing-include-dirs
5483 Warn if a user-supplied include directory does not exist.
5484
5485 @item -Wmissing-profile
5486 @opindex Wmissing-profile
5487 @opindex Wno-missing-profile
5488 Warn if feedback profiles are missing when using the
5489 @option{-fprofile-use} option.
5490 This option diagnoses those cases where a new function or a new file is added
5491 to the user code between compiling with @option{-fprofile-generate} and with
5492 @option{-fprofile-use}, without regenerating the profiles.  In these cases, the
5493 profile feedback data files do not contain any profile feedback information for
5494 the newly added function or file respectively.  Also, in the case when profile
5495 count data (.gcda) files are removed, GCC cannot use any profile feedback
5496 information.  In all these cases, warnings are issued to inform the user that a
5497 profile generation step is due.  @option{-Wno-missing-profile} can be used to
5498 disable the warning.  Ignoring the warning can result in poorly optimized code.
5499 Completely disabling the warning is not recommended and should be done only
5500 when non-existent profile data is justified.
5501
5502 @item -Wmultistatement-macros
5503 @opindex Wmultistatement-macros
5504 @opindex Wno-multistatement-macros
5505 Warn about unsafe multiple statement macros that appear to be guarded
5506 by a clause such as @code{if}, @code{else}, @code{for}, @code{switch}, or
5507 @code{while}, in which only the first statement is actually guarded after
5508 the macro is expanded.
5509
5510 For example:
5511
5512 @smallexample
5513 #define DOIT x++; y++
5514 if (c)
5515   DOIT;
5516 @end smallexample
5517
5518 will increment @code{y} unconditionally, not just when @code{c} holds.
5519 The can usually be fixed by wrapping the macro in a do-while loop:
5520 @smallexample
5521 #define DOIT do @{ x++; y++; @} while (0)
5522 if (c)
5523   DOIT;
5524 @end smallexample
5525
5526 This warning is enabled by @option{-Wall} in C and C++.
5527
5528 @item -Wparentheses
5529 @opindex Wparentheses
5530 @opindex Wno-parentheses
5531 Warn if parentheses are omitted in certain contexts, such
5532 as when there is an assignment in a context where a truth value
5533 is expected, or when operators are nested whose precedence people
5534 often get confused about.
5535
5536 Also warn if a comparison like @code{x<=y<=z} appears; this is
5537 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
5538 interpretation from that of ordinary mathematical notation.
5539
5540 Also warn for dangerous uses of the GNU extension to
5541 @code{?:} with omitted middle operand. When the condition
5542 in the @code{?}: operator is a boolean expression, the omitted value is
5543 always 1.  Often programmers expect it to be a value computed
5544 inside the conditional expression instead.
5545
5546 For C++ this also warns for some cases of unnecessary parentheses in
5547 declarations, which can indicate an attempt at a function call instead
5548 of a declaration:
5549 @smallexample
5550 @{
5551   // Declares a local variable called mymutex.
5552   std::unique_lock<std::mutex> (mymutex);
5553   // User meant std::unique_lock<std::mutex> lock (mymutex);
5554 @}
5555 @end smallexample
5556
5557 This warning is enabled by @option{-Wall}.
5558
5559 @item -Wsequence-point
5560 @opindex Wsequence-point
5561 @opindex Wno-sequence-point
5562 Warn about code that may have undefined semantics because of violations
5563 of sequence point rules in the C and C++ standards.
5564
5565 The C and C++ standards define the order in which expressions in a C/C++
5566 program are evaluated in terms of @dfn{sequence points}, which represent
5567 a partial ordering between the execution of parts of the program: those
5568 executed before the sequence point, and those executed after it.  These
5569 occur after the evaluation of a full expression (one which is not part
5570 of a larger expression), after the evaluation of the first operand of a
5571 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
5572 function is called (but after the evaluation of its arguments and the
5573 expression denoting the called function), and in certain other places.
5574 Other than as expressed by the sequence point rules, the order of
5575 evaluation of subexpressions of an expression is not specified.  All
5576 these rules describe only a partial order rather than a total order,
5577 since, for example, if two functions are called within one expression
5578 with no sequence point between them, the order in which the functions
5579 are called is not specified.  However, the standards committee have
5580 ruled that function calls do not overlap.
5581
5582 It is not specified when between sequence points modifications to the
5583 values of objects take effect.  Programs whose behavior depends on this
5584 have undefined behavior; the C and C++ standards specify that ``Between
5585 the previous and next sequence point an object shall have its stored
5586 value modified at most once by the evaluation of an expression.
5587 Furthermore, the prior value shall be read only to determine the value
5588 to be stored.''.  If a program breaks these rules, the results on any
5589 particular implementation are entirely unpredictable.
5590
5591 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
5592 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
5593 diagnosed by this option, and it may give an occasional false positive
5594 result, but in general it has been found fairly effective at detecting
5595 this sort of problem in programs.
5596
5597 The C++17 standard will define the order of evaluation of operands in
5598 more cases: in particular it requires that the right-hand side of an
5599 assignment be evaluated before the left-hand side, so the above
5600 examples are no longer undefined.  But this warning will still warn
5601 about them, to help people avoid writing code that is undefined in C
5602 and earlier revisions of C++.
5603
5604 The standard is worded confusingly, therefore there is some debate
5605 over the precise meaning of the sequence point rules in subtle cases.
5606 Links to discussions of the problem, including proposed formal
5607 definitions, may be found on the GCC readings page, at
5608 @uref{http://gcc.gnu.org/@/readings.html}.
5609
5610 This warning is enabled by @option{-Wall} for C and C++.
5611
5612 @item -Wno-return-local-addr
5613 @opindex Wno-return-local-addr
5614 @opindex Wreturn-local-addr
5615 Do not warn about returning a pointer (or in C++, a reference) to a
5616 variable that goes out of scope after the function returns.
5617
5618 @item -Wreturn-type
5619 @opindex Wreturn-type
5620 @opindex Wno-return-type
5621 Warn whenever a function is defined with a return type that defaults
5622 to @code{int}.  Also warn about any @code{return} statement with no
5623 return value in a function whose return type is not @code{void}
5624 (falling off the end of the function body is considered returning
5625 without a value).
5626
5627 For C only, warn about a @code{return} statement with an expression in a
5628 function whose return type is @code{void}, unless the expression type is
5629 also @code{void}.  As a GNU extension, the latter case is accepted
5630 without a warning unless @option{-Wpedantic} is used.  Attempting
5631 to use the return value of a non-@code{void} function other than @code{main}
5632 that flows off the end by reaching the closing curly brace that terminates
5633 the function is undefined.
5634
5635 Unlike in C, in C++, flowing off the end of a non-@code{void} function other
5636 than @code{main} results in undefined behavior even when the value of
5637 the function is not used.
5638
5639 This warning is enabled by default in C++ and by @option{-Wall} otherwise.
5640
5641 @item -Wshift-count-negative
5642 @opindex Wshift-count-negative
5643 @opindex Wno-shift-count-negative
5644 Warn if shift count is negative. This warning is enabled by default.
5645
5646 @item -Wshift-count-overflow
5647 @opindex Wshift-count-overflow
5648 @opindex Wno-shift-count-overflow
5649 Warn if shift count >= width of type. This warning is enabled by default.
5650
5651 @item -Wshift-negative-value
5652 @opindex Wshift-negative-value
5653 @opindex Wno-shift-negative-value
5654 Warn if left shifting a negative value.  This warning is enabled by
5655 @option{-Wextra} in C99 and C++11 modes (and newer).
5656
5657 @item -Wshift-overflow
5658 @itemx -Wshift-overflow=@var{n}
5659 @opindex Wshift-overflow
5660 @opindex Wno-shift-overflow
5661 Warn about left shift overflows.  This warning is enabled by
5662 default in C99 and C++11 modes (and newer).
5663
5664 @table @gcctabopt
5665 @item -Wshift-overflow=1
5666 This is the warning level of @option{-Wshift-overflow} and is enabled
5667 by default in C99 and C++11 modes (and newer).  This warning level does
5668 not warn about left-shifting 1 into the sign bit.  (However, in C, such
5669 an overflow is still rejected in contexts where an integer constant expression
5670 is required.)  No warning is emitted in C++2A mode (and newer), as signed left
5671 shifts always wrap.
5672
5673 @item -Wshift-overflow=2
5674 This warning level also warns about left-shifting 1 into the sign bit,
5675 unless C++14 mode (or newer) is active.
5676 @end table
5677
5678 @item -Wswitch
5679 @opindex Wswitch
5680 @opindex Wno-switch
5681 Warn whenever a @code{switch} statement has an index of enumerated type
5682 and lacks a @code{case} for one or more of the named codes of that
5683 enumeration.  (The presence of a @code{default} label prevents this
5684 warning.)  @code{case} labels outside the enumeration range also
5685 provoke warnings when this option is used (even if there is a
5686 @code{default} label).
5687 This warning is enabled by @option{-Wall}.
5688
5689 @item -Wswitch-default
5690 @opindex Wswitch-default
5691 @opindex Wno-switch-default
5692 Warn whenever a @code{switch} statement does not have a @code{default}
5693 case.
5694
5695 @item -Wswitch-enum
5696 @opindex Wswitch-enum
5697 @opindex Wno-switch-enum
5698 Warn whenever a @code{switch} statement has an index of enumerated type
5699 and lacks a @code{case} for one or more of the named codes of that
5700 enumeration.  @code{case} labels outside the enumeration range also
5701 provoke warnings when this option is used.  The only difference
5702 between @option{-Wswitch} and this option is that this option gives a
5703 warning about an omitted enumeration code even if there is a
5704 @code{default} label.
5705
5706 @item -Wswitch-bool
5707 @opindex Wswitch-bool
5708 @opindex Wno-switch-bool
5709 Warn whenever a @code{switch} statement has an index of boolean type
5710 and the case values are outside the range of a boolean type.
5711 It is possible to suppress this warning by casting the controlling
5712 expression to a type other than @code{bool}.  For example:
5713 @smallexample
5714 @group
5715 switch ((int) (a == 4))
5716   @{
5717   @dots{}
5718   @}
5719 @end group
5720 @end smallexample
5721 This warning is enabled by default for C and C++ programs.
5722
5723 @item -Wswitch-outside-range
5724 @opindex Wswitch-outside-range
5725 @opindex Wno-switch-outside-range
5726 Warn whenever a @code{switch} case has a value that is outside of its
5727 respective type range.  This warning is enabled by default for
5728 C and C++ programs.
5729
5730 @item -Wswitch-unreachable
5731 @opindex Wswitch-unreachable
5732 @opindex Wno-switch-unreachable
5733 Warn whenever a @code{switch} statement contains statements between the
5734 controlling expression and the first case label, which will never be
5735 executed.  For example:
5736 @smallexample
5737 @group
5738 switch (cond)
5739   @{
5740    i = 15;
5741   @dots{}
5742    case 5:
5743   @dots{}
5744   @}
5745 @end group
5746 @end smallexample
5747 @option{-Wswitch-unreachable} does not warn if the statement between the
5748 controlling expression and the first case label is just a declaration:
5749 @smallexample
5750 @group
5751 switch (cond)
5752   @{
5753    int i;
5754   @dots{}
5755    case 5:
5756    i = 5;
5757   @dots{}
5758   @}
5759 @end group
5760 @end smallexample
5761 This warning is enabled by default for C and C++ programs.
5762
5763 @item -Wsync-nand @r{(C and C++ only)}
5764 @opindex Wsync-nand
5765 @opindex Wno-sync-nand
5766 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
5767 built-in functions are used.  These functions changed semantics in GCC 4.4.
5768
5769 @item -Wunused-but-set-parameter
5770 @opindex Wunused-but-set-parameter
5771 @opindex Wno-unused-but-set-parameter
5772 Warn whenever a function parameter is assigned to, but otherwise unused
5773 (aside from its declaration).
5774
5775 To suppress this warning use the @code{unused} attribute
5776 (@pxref{Variable Attributes}).
5777
5778 This warning is also enabled by @option{-Wunused} together with
5779 @option{-Wextra}.
5780
5781 @item -Wunused-but-set-variable
5782 @opindex Wunused-but-set-variable
5783 @opindex Wno-unused-but-set-variable
5784 Warn whenever a local variable is assigned to, but otherwise unused
5785 (aside from its declaration).
5786 This warning is enabled by @option{-Wall}.
5787
5788 To suppress this warning use the @code{unused} attribute
5789 (@pxref{Variable Attributes}).
5790
5791 This warning is also enabled by @option{-Wunused}, which is enabled
5792 by @option{-Wall}.
5793
5794 @item -Wunused-function
5795 @opindex Wunused-function
5796 @opindex Wno-unused-function
5797 Warn whenever a static function is declared but not defined or a
5798 non-inline static function is unused.
5799 This warning is enabled by @option{-Wall}.
5800
5801 @item -Wunused-label
5802 @opindex Wunused-label
5803 @opindex Wno-unused-label
5804 Warn whenever a label is declared but not used.
5805 This warning is enabled by @option{-Wall}.
5806
5807 To suppress this warning use the @code{unused} attribute
5808 (@pxref{Variable Attributes}).
5809
5810 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
5811 @opindex Wunused-local-typedefs
5812 @opindex Wno-unused-local-typedefs
5813 Warn when a typedef locally defined in a function is not used.
5814 This warning is enabled by @option{-Wall}.
5815
5816 @item -Wunused-parameter
5817 @opindex Wunused-parameter
5818 @opindex Wno-unused-parameter
5819 Warn whenever a function parameter is unused aside from its declaration.
5820
5821 To suppress this warning use the @code{unused} attribute
5822 (@pxref{Variable Attributes}).
5823
5824 @item -Wno-unused-result
5825 @opindex Wunused-result
5826 @opindex Wno-unused-result
5827 Do not warn if a caller of a function marked with attribute
5828 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
5829 its return value. The default is @option{-Wunused-result}.
5830
5831 @item -Wunused-variable
5832 @opindex Wunused-variable
5833 @opindex Wno-unused-variable
5834 Warn whenever a local or static variable is unused aside from its
5835 declaration. This option implies @option{-Wunused-const-variable=1} for C,
5836 but not for C++. This warning is enabled by @option{-Wall}.
5837
5838 To suppress this warning use the @code{unused} attribute
5839 (@pxref{Variable Attributes}).
5840
5841 @item -Wunused-const-variable
5842 @itemx -Wunused-const-variable=@var{n}
5843 @opindex Wunused-const-variable
5844 @opindex Wno-unused-const-variable
5845 Warn whenever a constant static variable is unused aside from its declaration.
5846 @option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
5847 for C, but not for C++. In C this declares variable storage, but in C++ this
5848 is not an error since const variables take the place of @code{#define}s.
5849
5850 To suppress this warning use the @code{unused} attribute
5851 (@pxref{Variable Attributes}).
5852
5853 @table @gcctabopt
5854 @item -Wunused-const-variable=1
5855 This is the warning level that is enabled by @option{-Wunused-variable} for
5856 C.  It warns only about unused static const variables defined in the main
5857 compilation unit, but not about static const variables declared in any
5858 header included.
5859
5860 @item -Wunused-const-variable=2
5861 This warning level also warns for unused constant static variables in
5862 headers (excluding system headers).  This is the warning level of
5863 @option{-Wunused-const-variable} and must be explicitly requested since
5864 in C++ this isn't an error and in C it might be harder to clean up all
5865 headers included.
5866 @end table
5867
5868 @item -Wunused-value
5869 @opindex Wunused-value
5870 @opindex Wno-unused-value
5871 Warn whenever a statement computes a result that is explicitly not
5872 used. To suppress this warning cast the unused expression to
5873 @code{void}. This includes an expression-statement or the left-hand
5874 side of a comma expression that contains no side effects. For example,
5875 an expression such as @code{x[i,j]} causes a warning, while
5876 @code{x[(void)i,j]} does not.
5877
5878 This warning is enabled by @option{-Wall}.
5879
5880 @item -Wunused
5881 @opindex Wunused
5882 @opindex Wno-unused
5883 All the above @option{-Wunused} options combined.
5884
5885 In order to get a warning about an unused function parameter, you must
5886 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
5887 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
5888
5889 @item -Wuninitialized
5890 @opindex Wuninitialized
5891 @opindex Wno-uninitialized
5892 Warn if an automatic variable is used without first being initialized.
5893 In C++, warn if a non-static reference or non-static @code{const}
5894 member appears in a class without constructors.
5895
5896 If you want to warn about code that uses the uninitialized value of the
5897 variable in its own initializer, use the @option{-Winit-self} option.
5898
5899 These warnings occur for individual uninitialized elements of
5900 structure, union or array variables as well as for variables that are
5901 uninitialized as a whole.  They do not occur for variables or elements
5902 declared @code{volatile}.  Because these warnings depend on
5903 optimization, the exact variables or elements for which there are
5904 warnings depend on the precise optimization options and version of GCC
5905 used.
5906
5907 Note that there may be no warning about a variable that is used only
5908 to compute a value that itself is never used, because such
5909 computations may be deleted by data flow analysis before the warnings
5910 are printed.
5911
5912 @item -Winvalid-memory-model
5913 @opindex Winvalid-memory-model
5914 @opindex Wno-invalid-memory-model
5915 Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
5916 and the C11 atomic generic functions with a memory consistency argument
5917 that is either invalid for the operation or outside the range of values
5918 of the @code{memory_order} enumeration.  For example, since the
5919 @code{__atomic_store} and @code{__atomic_store_n} built-ins are only
5920 defined for the relaxed, release, and sequentially consistent memory
5921 orders the following code is diagnosed:
5922
5923 @smallexample
5924 void store (int *i)
5925 @{
5926   __atomic_store_n (i, 0, memory_order_consume);
5927 @}
5928 @end smallexample
5929
5930 @option{-Winvalid-memory-model} is enabled by default.
5931
5932 @item -Wmaybe-uninitialized
5933 @opindex Wmaybe-uninitialized
5934 @opindex Wno-maybe-uninitialized
5935 For an automatic (i.e.@: local) variable, if there exists a path from the
5936 function entry to a use of the variable that is initialized, but there exist
5937 some other paths for which the variable is not initialized, the compiler
5938 emits a warning if it cannot prove the uninitialized paths are not
5939 executed at run time.
5940
5941 These warnings are only possible in optimizing compilation, because otherwise
5942 GCC does not keep track of the state of variables.
5943
5944 These warnings are made optional because GCC may not be able to determine when
5945 the code is correct in spite of appearing to have an error.  Here is one
5946 example of how this can happen:
5947
5948 @smallexample
5949 @group
5950 @{
5951   int x;
5952   switch (y)
5953     @{
5954     case 1: x = 1;
5955       break;
5956     case 2: x = 4;
5957       break;
5958     case 3: x = 5;
5959     @}
5960   foo (x);
5961 @}
5962 @end group
5963 @end smallexample
5964
5965 @noindent
5966 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
5967 always initialized, but GCC doesn't know this. To suppress the
5968 warning, you need to provide a default case with assert(0) or
5969 similar code.
5970
5971 @cindex @code{longjmp} warnings
5972 This option also warns when a non-volatile automatic variable might be
5973 changed by a call to @code{longjmp}.
5974 The compiler sees only the calls to @code{setjmp}.  It cannot know
5975 where @code{longjmp} will be called; in fact, a signal handler could
5976 call it at any point in the code.  As a result, you may get a warning
5977 even when there is in fact no problem because @code{longjmp} cannot
5978 in fact be called at the place that would cause a problem.
5979
5980 Some spurious warnings can be avoided if you declare all the functions
5981 you use that never return as @code{noreturn}.  @xref{Function
5982 Attributes}.
5983
5984 This warning is enabled by @option{-Wall} or @option{-Wextra}.
5985
5986 @item -Wunknown-pragmas
5987 @opindex Wunknown-pragmas
5988 @opindex Wno-unknown-pragmas
5989 @cindex warning for unknown pragmas
5990 @cindex unknown pragmas, warning
5991 @cindex pragmas, warning of unknown
5992 Warn when a @code{#pragma} directive is encountered that is not understood by 
5993 GCC@.  If this command-line option is used, warnings are even issued
5994 for unknown pragmas in system header files.  This is not the case if
5995 the warnings are only enabled by the @option{-Wall} command-line option.
5996
5997 @item -Wno-pragmas
5998 @opindex Wno-pragmas
5999 @opindex Wpragmas
6000 Do not warn about misuses of pragmas, such as incorrect parameters,
6001 invalid syntax, or conflicts between pragmas.  See also
6002 @option{-Wunknown-pragmas}.
6003
6004 @item -Wno-prio-ctor-dtor
6005 @opindex Wno-prio-ctor-dtor
6006 @opindex Wprio-ctor-dtor
6007 Do not warn if a priority from 0 to 100 is used for constructor or destructor.
6008 The use of constructor and destructor attributes allow you to assign a
6009 priority to the constructor/destructor to control its order of execution
6010 before @code{main} is called or after it returns.  The priority values must be
6011 greater than 100 as the compiler reserves priority values between 0--100 for
6012 the implementation.
6013
6014 @item -Wstrict-aliasing
6015 @opindex Wstrict-aliasing
6016 @opindex Wno-strict-aliasing
6017 This option is only active when @option{-fstrict-aliasing} is active.
6018 It warns about code that might break the strict aliasing rules that the
6019 compiler is using for optimization.  The warning does not catch all
6020 cases, but does attempt to catch the more common pitfalls.  It is
6021 included in @option{-Wall}.
6022 It is equivalent to @option{-Wstrict-aliasing=3}
6023
6024 @item -Wstrict-aliasing=n
6025 @opindex Wstrict-aliasing=n
6026 This option is only active when @option{-fstrict-aliasing} is active.
6027 It warns about code that might break the strict aliasing rules that the
6028 compiler is using for optimization.
6029 Higher levels correspond to higher accuracy (fewer false positives).
6030 Higher levels also correspond to more effort, similar to the way @option{-O} 
6031 works.
6032 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
6033
6034 Level 1: Most aggressive, quick, least accurate.
6035 Possibly useful when higher levels
6036 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
6037 false negatives.  However, it has many false positives.
6038 Warns for all pointer conversions between possibly incompatible types,
6039 even if never dereferenced.  Runs in the front end only.
6040
6041 Level 2: Aggressive, quick, not too precise.
6042 May still have many false positives (not as many as level 1 though),
6043 and few false negatives (but possibly more than level 1).
6044 Unlike level 1, it only warns when an address is taken.  Warns about
6045 incomplete types.  Runs in the front end only.
6046
6047 Level 3 (default for @option{-Wstrict-aliasing}):
6048 Should have very few false positives and few false
6049 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
6050 Takes care of the common pun+dereference pattern in the front end:
6051 @code{*(int*)&some_float}.
6052 If optimization is enabled, it also runs in the back end, where it deals
6053 with multiple statement cases using flow-sensitive points-to information.
6054 Only warns when the converted pointer is dereferenced.
6055 Does not warn about incomplete types.
6056
6057 @item -Wstrict-overflow
6058 @itemx -Wstrict-overflow=@var{n}
6059 @opindex Wstrict-overflow
6060 @opindex Wno-strict-overflow
6061 This option is only active when signed overflow is undefined.
6062 It warns about cases where the compiler optimizes based on the
6063 assumption that signed overflow does not occur.  Note that it does not
6064 warn about all cases where the code might overflow: it only warns
6065 about cases where the compiler implements some optimization.  Thus
6066 this warning depends on the optimization level.
6067
6068 An optimization that assumes that signed overflow does not occur is
6069 perfectly safe if the values of the variables involved are such that
6070 overflow never does, in fact, occur.  Therefore this warning can
6071 easily give a false positive: a warning about code that is not
6072 actually a problem.  To help focus on important issues, several
6073 warning levels are defined.  No warnings are issued for the use of
6074 undefined signed overflow when estimating how many iterations a loop
6075 requires, in particular when determining whether a loop will be
6076 executed at all.
6077
6078 @table @gcctabopt
6079 @item -Wstrict-overflow=1
6080 Warn about cases that are both questionable and easy to avoid.  For
6081 example the compiler simplifies
6082 @code{x + 1 > x} to @code{1}.  This level of
6083 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
6084 are not, and must be explicitly requested.
6085
6086 @item -Wstrict-overflow=2
6087 Also warn about other cases where a comparison is simplified to a
6088 constant.  For example: @code{abs (x) >= 0}.  This can only be
6089 simplified when signed integer overflow is undefined, because
6090 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
6091 zero.  @option{-Wstrict-overflow} (with no level) is the same as
6092 @option{-Wstrict-overflow=2}.
6093
6094 @item -Wstrict-overflow=3
6095 Also warn about other cases where a comparison is simplified.  For
6096 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
6097
6098 @item -Wstrict-overflow=4
6099 Also warn about other simplifications not covered by the above cases.
6100 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
6101
6102 @item -Wstrict-overflow=5
6103 Also warn about cases where the compiler reduces the magnitude of a
6104 constant involved in a comparison.  For example: @code{x + 2 > y} is
6105 simplified to @code{x + 1 >= y}.  This is reported only at the
6106 highest warning level because this simplification applies to many
6107 comparisons, so this warning level gives a very large number of
6108 false positives.
6109 @end table
6110
6111 @item -Wstring-compare
6112 @opindex Wstring-compare
6113 @opindex Wno-string-compare
6114 Warn for calls to @code{strcmp} and @code{strncmp} whose result is
6115 determined to be either zero or non-zero in tests for such equality
6116 owing to the length of one argument being greater than the size of
6117 the array the other argument is stored in (or the bound in the case
6118 of @code{strncmp}).  Such calls could be mistakes.  For example,
6119 the call to @code{strcmp} below is diagnosed because its result is
6120 necessarily non-zero irrespective of the contents of the array @code{a}.
6121
6122 @smallexample
6123 extern char a[4];
6124 void f (char *d)
6125 @{
6126   strcpy (d, "string");
6127   @dots{}
6128   if (0 == strcmp (a, d))   // cannot be true
6129     puts ("a and d are the same");
6130 @}
6131 @end smallexample
6132
6133 @option{-Wstring-compare} is enabled by @option{-Wextra}.
6134
6135 @item -Wstringop-overflow
6136 @itemx -Wstringop-overflow=@var{type}
6137 @opindex Wstringop-overflow
6138 @opindex Wno-stringop-overflow
6139 Warn for calls to string manipulation functions such as @code{memcpy} and
6140 @code{strcpy} that are determined to overflow the destination buffer.  The
6141 optional argument is one greater than the type of Object Size Checking to
6142 perform to determine the size of the destination.  @xref{Object Size Checking}.
6143 The argument is meaningful only for functions that operate on character arrays
6144 but not for raw memory functions like @code{memcpy} which always make use
6145 of Object Size type-0.  The option also warns for calls that specify a size
6146 in excess of the largest possible object or at most @code{SIZE_MAX / 2} bytes.
6147 The option produces the best results with optimization enabled but can detect
6148 a small subset of simple buffer overflows even without optimization in
6149 calls to the GCC built-in functions like @code{__builtin_memcpy} that
6150 correspond to the standard functions.  In any case, the option warns about
6151 just a subset of buffer overflows detected by the corresponding overflow
6152 checking built-ins.  For example, the option will issue a warning for
6153 the @code{strcpy} call below because it copies at least 5 characters
6154 (the string @code{"blue"} including the terminating NUL) into the buffer
6155 of size 4.
6156
6157 @smallexample
6158 enum Color @{ blue, purple, yellow @};
6159 const char* f (enum Color clr)
6160 @{
6161   static char buf [4];
6162   const char *str;
6163   switch (clr)
6164     @{
6165       case blue: str = "blue"; break;
6166       case purple: str = "purple"; break;
6167       case yellow: str = "yellow"; break;
6168     @}
6169
6170   return strcpy (buf, str);   // warning here
6171 @}
6172 @end smallexample
6173
6174 Option @option{-Wstringop-overflow=2} is enabled by default.
6175
6176 @table @gcctabopt
6177 @item -Wstringop-overflow
6178 @itemx -Wstringop-overflow=1
6179 @opindex Wstringop-overflow
6180 @opindex Wno-stringop-overflow
6181 The @option{-Wstringop-overflow=1} option uses type-zero Object Size Checking
6182 to determine the sizes of destination objects.  This is the default setting
6183 of the option.  At this setting the option will not warn for writes past
6184 the end of subobjects of larger objects accessed by pointers unless the
6185 size of the largest surrounding object is known.  When the destination may
6186 be one of several objects it is assumed to be the largest one of them.  On
6187 Linux systems, when optimization is enabled at this setting the option warns
6188 for the same code as when the @code{_FORTIFY_SOURCE} macro is defined to
6189 a non-zero value.
6190
6191 @item -Wstringop-overflow=2
6192 The @option{-Wstringop-overflow=2} option uses type-one Object Size Checking
6193 to determine the sizes of destination objects.  At this setting the option
6194 will warn about overflows when writing to members of the largest complete
6195 objects whose exact size is known.  It will, however, not warn for excessive
6196 writes to the same members of unknown objects referenced by pointers since
6197 they may point to arrays containing unknown numbers of elements.
6198
6199 @item -Wstringop-overflow=3
6200 The @option{-Wstringop-overflow=3} option uses type-two Object Size Checking
6201 to determine the sizes of destination objects.  At this setting the option
6202 warns about overflowing the smallest object or data member.  This is the
6203 most restrictive setting of the option that may result in warnings for safe
6204 code.
6205
6206 @item -Wstringop-overflow=4
6207 The @option{-Wstringop-overflow=4} option uses type-three Object Size Checking
6208 to determine the sizes of destination objects.  At this setting the option
6209 will warn about overflowing any data members, and when the destination is
6210 one of several objects it uses the size of the largest of them to decide
6211 whether to issue a warning.  Similarly to @option{-Wstringop-overflow=3} this
6212 setting of the option may result in warnings for benign code.
6213 @end table
6214
6215 @item -Wstringop-truncation
6216 @opindex Wstringop-truncation
6217 @opindex Wno-stringop-truncation
6218 Warn for calls to bounded string manipulation functions such as @code{strncat},
6219 @code{strncpy}, and @code{stpncpy} that may either truncate the copied string
6220 or leave the destination unchanged.
6221
6222 In the following example, the call to @code{strncat} specifies a bound that
6223 is less than the length of the source string.  As a result, the copy of
6224 the source will be truncated and so the call is diagnosed.  To avoid the
6225 warning use @code{bufsize - strlen (buf) - 1)} as the bound.
6226
6227 @smallexample
6228 void append (char *buf, size_t bufsize)
6229 @{
6230   strncat (buf, ".txt", 3);
6231 @}
6232 @end smallexample
6233
6234 As another example, the following call to @code{strncpy} results in copying
6235 to @code{d} just the characters preceding the terminating NUL, without
6236 appending the NUL to the end.  Assuming the result of @code{strncpy} is
6237 necessarily a NUL-terminated string is a common mistake, and so the call
6238 is diagnosed.  To avoid the warning when the result is not expected to be
6239 NUL-terminated, call @code{memcpy} instead.
6240
6241 @smallexample
6242 void copy (char *d, const char *s)
6243 @{
6244   strncpy (d, s, strlen (s));
6245 @}
6246 @end smallexample
6247
6248 In the following example, the call to @code{strncpy} specifies the size
6249 of the destination buffer as the bound.  If the length of the source
6250 string is equal to or greater than this size the result of the copy will
6251 not be NUL-terminated.  Therefore, the call is also diagnosed.  To avoid
6252 the warning, specify @code{sizeof buf - 1} as the bound and set the last
6253 element of the buffer to @code{NUL}.
6254
6255 @smallexample
6256 void copy (const char *s)
6257 @{
6258   char buf[80];
6259   strncpy (buf, s, sizeof buf);
6260   @dots{}
6261 @}
6262 @end smallexample
6263
6264 In situations where a character array is intended to store a sequence
6265 of bytes with no terminating @code{NUL} such an array may be annotated
6266 with attribute @code{nonstring} to avoid this warning.  Such arrays,
6267 however, are not suitable arguments to functions that expect
6268 @code{NUL}-terminated strings.  To help detect accidental misuses of
6269 such arrays GCC issues warnings unless it can prove that the use is
6270 safe.  @xref{Common Variable Attributes}.
6271
6272 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}cold@r{|}malloc@r{]}
6273 @opindex Wsuggest-attribute=
6274 @opindex Wno-suggest-attribute=
6275 Warn for cases where adding an attribute may be beneficial. The
6276 attributes currently supported are listed below.
6277
6278 @table @gcctabopt
6279 @item -Wsuggest-attribute=pure
6280 @itemx -Wsuggest-attribute=const
6281 @itemx -Wsuggest-attribute=noreturn
6282 @itemx -Wmissing-noreturn
6283 @itemx -Wsuggest-attribute=malloc
6284 @opindex Wsuggest-attribute=pure
6285 @opindex Wno-suggest-attribute=pure
6286 @opindex Wsuggest-attribute=const
6287 @opindex Wno-suggest-attribute=const
6288 @opindex Wsuggest-attribute=noreturn
6289 @opindex Wno-suggest-attribute=noreturn
6290 @opindex Wmissing-noreturn
6291 @opindex Wno-missing-noreturn
6292 @opindex Wsuggest-attribute=malloc
6293 @opindex Wno-suggest-attribute=malloc
6294
6295 Warn about functions that might be candidates for attributes
6296 @code{pure}, @code{const} or @code{noreturn} or @code{malloc}. The compiler
6297 only warns for functions visible in other compilation units or (in the case of
6298 @code{pure} and @code{const}) if it cannot prove that the function returns
6299 normally. A function returns normally if it doesn't contain an infinite loop or
6300 return abnormally by throwing, calling @code{abort} or trapping.  This analysis
6301 requires option @option{-fipa-pure-const}, which is enabled by default at
6302 @option{-O} and higher.  Higher optimization levels improve the accuracy
6303 of the analysis.
6304
6305 @item -Wsuggest-attribute=format
6306 @itemx -Wmissing-format-attribute
6307 @opindex Wsuggest-attribute=format
6308 @opindex Wmissing-format-attribute
6309 @opindex Wno-suggest-attribute=format
6310 @opindex Wno-missing-format-attribute
6311 @opindex Wformat
6312 @opindex Wno-format
6313
6314 Warn about function pointers that might be candidates for @code{format}
6315 attributes.  Note these are only possible candidates, not absolute ones.
6316 GCC guesses that function pointers with @code{format} attributes that
6317 are used in assignment, initialization, parameter passing or return
6318 statements should have a corresponding @code{format} attribute in the
6319 resulting type.  I.e.@: the left-hand side of the assignment or
6320 initialization, the type of the parameter variable, or the return type
6321 of the containing function respectively should also have a @code{format}
6322 attribute to avoid the warning.
6323
6324 GCC also warns about function definitions that might be
6325 candidates for @code{format} attributes.  Again, these are only
6326 possible candidates.  GCC guesses that @code{format} attributes
6327 might be appropriate for any function that calls a function like
6328 @code{vprintf} or @code{vscanf}, but this might not always be the
6329 case, and some functions for which @code{format} attributes are
6330 appropriate may not be detected.
6331
6332 @item -Wsuggest-attribute=cold
6333 @opindex Wsuggest-attribute=cold
6334 @opindex Wno-suggest-attribute=cold
6335
6336 Warn about functions that might be candidates for @code{cold} attribute.  This
6337 is based on static detection and generally will only warn about functions which
6338 always leads to a call to another @code{cold} function such as wrappers of
6339 C++ @code{throw} or fatal error reporting functions leading to @code{abort}.
6340 @end table
6341
6342 @item -Wsuggest-final-types
6343 @opindex Wno-suggest-final-types
6344 @opindex Wsuggest-final-types
6345 Warn about types with virtual methods where code quality would be improved
6346 if the type were declared with the C++11 @code{final} specifier, 
6347 or, if possible,
6348 declared in an anonymous namespace. This allows GCC to more aggressively
6349 devirtualize the polymorphic calls. This warning is more effective with 
6350 link-time optimization, 
6351 where the information about the class hierarchy graph is
6352 more complete.
6353
6354 @item -Wsuggest-final-methods
6355 @opindex Wno-suggest-final-methods
6356 @opindex Wsuggest-final-methods
6357 Warn about virtual methods where code quality would be improved if the method
6358 were declared with the C++11 @code{final} specifier, 
6359 or, if possible, its type were
6360 declared in an anonymous namespace or with the @code{final} specifier.
6361 This warning is
6362 more effective with link-time optimization, where the information about the
6363 class hierarchy graph is more complete. It is recommended to first consider
6364 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
6365 annotations.
6366
6367 @item -Wsuggest-override
6368 Warn about overriding virtual functions that are not marked with the override
6369 keyword.
6370
6371 @item -Walloc-zero
6372 @opindex Wno-alloc-zero
6373 @opindex Walloc-zero
6374 Warn about calls to allocation functions decorated with attribute
6375 @code{alloc_size} that specify zero bytes, including those to the built-in
6376 forms of the functions @code{aligned_alloc}, @code{alloca}, @code{calloc},
6377 @code{malloc}, and @code{realloc}.  Because the behavior of these functions
6378 when called with a zero size differs among implementations (and in the case
6379 of @code{realloc} has been deprecated) relying on it may result in subtle
6380 portability bugs and should be avoided.
6381
6382 @item -Walloc-size-larger-than=@var{byte-size}
6383 @opindex Walloc-size-larger-than=
6384 @opindex Wno-alloc-size-larger-than
6385 Warn about calls to functions decorated with attribute @code{alloc_size}
6386 that attempt to allocate objects larger than the specified number of bytes,
6387 or where the result of the size computation in an integer type with infinite
6388 precision would exceed the value of @samp{PTRDIFF_MAX} on the target.
6389 @option{-Walloc-size-larger-than=}@samp{PTRDIFF_MAX} is enabled by default.
6390 Warnings controlled by the option can be disabled either by specifying
6391 @var{byte-size} of @samp{SIZE_MAX} or more or by
6392 @option{-Wno-alloc-size-larger-than}.
6393 @xref{Function Attributes}.
6394
6395 @item -Wno-alloc-size-larger-than
6396 @opindex Wno-alloc-size-larger-than
6397 Disable @option{-Walloc-size-larger-than=} warnings.  The option is
6398 equivalent to @option{-Walloc-size-larger-than=}@samp{SIZE_MAX} or
6399 larger.
6400
6401 @item -Walloca
6402 @opindex Wno-alloca
6403 @opindex Walloca
6404 This option warns on all uses of @code{alloca} in the source.
6405
6406 @item -Walloca-larger-than=@var{byte-size}
6407 @opindex Walloca-larger-than=
6408 @opindex Wno-alloca-larger-than
6409 This option warns on calls to @code{alloca} with an integer argument whose
6410 value is either zero, or that is not bounded by a controlling predicate
6411 that limits its value to at most @var{byte-size}.  It also warns for calls
6412 to @code{alloca} where the bound value is unknown.  Arguments of non-integer
6413 types are considered unbounded even if they appear to be constrained to
6414 the expected range.
6415
6416 For example, a bounded case of @code{alloca} could be:
6417
6418 @smallexample
6419 void func (size_t n)
6420 @{
6421   void *p;
6422   if (n <= 1000)
6423     p = alloca (n);
6424   else
6425     p = malloc (n);
6426   f (p);
6427 @}
6428 @end smallexample
6429
6430 In the above example, passing @code{-Walloca-larger-than=1000} would not
6431 issue a warning because the call to @code{alloca} is known to be at most
6432 1000 bytes.  However, if @code{-Walloca-larger-than=500} were passed,
6433 the compiler would emit a warning.
6434
6435 Unbounded uses, on the other hand, are uses of @code{alloca} with no
6436 controlling predicate constraining its integer argument.  For example:
6437
6438 @smallexample
6439 void func ()
6440 @{
6441   void *p = alloca (n);
6442   f (p);
6443 @}
6444 @end smallexample
6445
6446 If @code{-Walloca-larger-than=500} were passed, the above would trigger
6447 a warning, but this time because of the lack of bounds checking.
6448
6449 Note, that even seemingly correct code involving signed integers could
6450 cause a warning:
6451
6452 @smallexample
6453 void func (signed int n)
6454 @{
6455   if (n < 500)
6456     @{
6457       p = alloca (n);
6458       f (p);
6459     @}
6460 @}
6461 @end smallexample
6462
6463 In the above example, @var{n} could be negative, causing a larger than
6464 expected argument to be implicitly cast into the @code{alloca} call.
6465
6466 This option also warns when @code{alloca} is used in a loop.
6467
6468 @option{-Walloca-larger-than=}@samp{PTRDIFF_MAX} is enabled by default
6469 but is usually only effective  when @option{-ftree-vrp} is active (default
6470 for @option{-O2} and above).
6471
6472 See also @option{-Wvla-larger-than=}@samp{byte-size}.
6473
6474 @item -Wno-alloca-larger-than
6475 @opindex Wno-alloca-larger-than
6476 Disable @option{-Walloca-larger-than=} warnings.  The option is
6477 equivalent to @option{-Walloca-larger-than=}@samp{SIZE_MAX} or larger.
6478
6479 @item -Wno-analyzer-double-fclose
6480 @opindex Wanalyzer-double-fclose
6481 @opindex Wno-analyzer-double-fclose
6482 This warning requires @option{-fanalyzer}, which enables it; use
6483 @option{-Wno-analyzer-double-fclose} to disable it.
6484
6485 This diagnostic warns for paths through the code in which a @code{FILE *}
6486 can have @code{fclose} called on it more than once.
6487
6488 @item -Wno-analyzer-double-free
6489 @opindex Wanalyzer-double-free
6490 @opindex Wno-analyzer-double-free
6491 This warning requires @option{-fanalyzer}, which enables it; use
6492 @option{-Wno-analyzer-double-free} to disable it.
6493
6494 This diagnostic warns for paths through the code in which a pointer
6495 can have @code{free} called on it more than once.
6496
6497 @item -Wno-analyzer-exposure-through-output-file
6498 @opindex Wanalyzer-exposure-through-output-file
6499 @opindex Wno-analyzer-exposure-through-output-file
6500 This warning requires @option{-fanalyzer}, which enables it; use
6501 @option{-Wno-analyzer-exposure-through-output-file}
6502 to disable it.
6503
6504 This diagnostic warns for paths through the code in which a
6505 security-sensitive value is written to an output file
6506 (such as writing a password to a log file).
6507
6508 @item -Wno-analyzer-file-leak
6509 @opindex Wanalyzer-file-leak
6510 @opindex Wno-analyzer-file-leak
6511 This warning requires @option{-fanalyzer}, which enables it; use
6512 @option{-Wno-analyzer-file-leak}
6513 to disable it.
6514
6515 This diagnostic warns for paths through the code in which a
6516 @code{<stdio.h>} @code{FILE *} stream object is leaked.
6517
6518 @item -Wno-analyzer-free-of-non-heap
6519 @opindex Wanalyzer-free-of-non-heap
6520 @opindex Wno-analyzer-free-of-non-heap
6521 This warning requires @option{-fanalyzer}, which enables it; use
6522 @option{-Wno-analyzer-free-of-non-heap}
6523 to disable it.
6524
6525 This diagnostic warns for paths through the code in which @code{free}
6526 is called on a non-heap pointer (e.g. an on-stack buffer, or a global).
6527
6528 @item -Wno-analyzer-malloc-leak
6529 @opindex Wanalyzer-malloc-leak
6530 @opindex Wno-analyzer-malloc-leak
6531 This warning requires @option{-fanalyzer}, which enables it; use
6532 @option{-Wno-analyzer-malloc-leak}
6533 to disable it.
6534
6535 This diagnostic warns for paths through the code in which a
6536 pointer allocated via @code{malloc} is leaked.
6537
6538 @item -Wno-analyzer-possible-null-argument
6539 @opindex Wanalyzer-possible-null-argument
6540 @opindex Wno-analyzer-possible-null-argument
6541 This warning requires @option{-fanalyzer}, which enables it; use
6542 @option{-Wno-analyzer-possible-null-argument} to disable it.
6543
6544 This diagnostic warns for paths through the code in which a
6545 possibly-NULL value is passed to a function argument marked
6546 with @code{__attribute__((nonnull))} as requiring a non-NULL
6547 value.
6548
6549 @item -Wno-analyzer-possible-null-dereference
6550 @opindex Wanalyzer-possible-null-dereference
6551 @opindex Wno-analyzer-possible-null-dereference
6552 This warning requires @option{-fanalyzer}, which enables it; use
6553 @option{-Wno-analyzer-possible-null-dereference} to disable it.
6554
6555 This diagnostic warns for paths through the code in which a
6556 possibly-NULL value is dereferenced.
6557
6558 @item -Wno-analyzer-null-argument
6559 @opindex Wanalyzer-null-argument
6560 @opindex Wno-analyzer-null-argument
6561 This warning requires @option{-fanalyzer}, which enables it; use
6562 @option{-Wno-analyzer-null-argument} to disable it.
6563
6564 This diagnostic warns for paths through the code in which a
6565 value known to be NULL is passed to a function argument marked
6566 with @code{__attribute__((nonnull))} as requiring a non-NULL
6567 value.
6568
6569 @item -Wno-analyzer-null-dereference
6570 @opindex Wanalyzer-null-dereference
6571 @opindex Wno-analyzer-null-dereference
6572 This warning requires @option{-fanalyzer}, which enables it; use
6573 @option{-Wno-analyzer-null-dereference} to disable it.
6574
6575 This diagnostic warns for paths through the code in which a
6576 value known to be NULL is dereferenced.
6577
6578 @item -Wno-analyzer-stale-setjmp-buffer
6579 @opindex Wanalyzer-stale-setjmp-buffer
6580 @opindex Wno-analyzer-stale-setjmp-buffer
6581 This warning requires @option{-fanalyzer}, which enables it; use
6582 @option{-Wno-analyzer-stale-setjmp-buffer} to disable it.
6583
6584 This diagnostic warns for paths through the code in which
6585 @code{longjmp} is called to rewind to a @code{jmp_buf} relating
6586 to a @code{setjmp} call in a function that has returned.
6587
6588 When @code{setjmp} is called on a @code{jmp_buf} to record a rewind
6589 location, it records the stack frame.  The stack frame becomes invalid
6590 when the function containing the @code{setjmp} call returns.  Attempting
6591 to rewind to it via @code{longjmp} would reference a stack frame that
6592 no longer exists, and likely lead to a crash (or worse).
6593
6594 @item -Wno-analyzer-tainted-array-index
6595 @opindex Wanalyzer-tainted-array-index
6596 @opindex Wno-analyzer-tainted-array-index
6597 This warning requires @option{-fanalyzer}, which enables it; use
6598 @option{-Wno-analyzer-tainted-array-index} to disable it.
6599
6600 This diagnostic warns for paths through the code in which a value
6601 that could be under an attacker's control is used as the index
6602 of an array access without being sanitized.
6603
6604 @item -Wno-analyzer-unsafe-call-within-signal-handler
6605 @opindex Wanalyzer-unsafe-call-within-signal-handler
6606 @opindex Wno-analyzer-unsafe-call-within-signal-handler
6607 This warning requires @option{-fanalyzer}, which enables it; use
6608 @option{-Wno-analyzer-unsafe-call-within-signal-handler} to disable it.
6609
6610 This diagnostic warns for paths through the code in which a
6611 function known to be async-signal-unsafe (such as @code{fprintf}) is
6612 called from a signal handler.
6613
6614 @item -Wno-analyzer-use-after-free
6615 @opindex Wanalyzer-use-after-free
6616 @opindex Wno-analyzer-use-after-free
6617 This warning requires @option{-fanalyzer}, which enables it; use
6618 @option{-Wno-analyzer-use-after-free} to disable it.
6619
6620 This diagnostic warns for paths through the code in which a
6621 pointer is used after @code{free} is called on it.
6622
6623 @item -Wno-analyzer-use-of-pointer-in-stale-stack-frame
6624 @opindex Wanalyzer-use-of-pointer-in-stale-stack-frame
6625 @opindex Wno-analyzer-use-of-pointer-in-stale-stack-frame
6626 This warning requires @option{-fanalyzer}, which enables it; use
6627 @option{-Wno-analyzer-use-of-pointer-in-stale-stack-frame}
6628 to disable it.
6629
6630 This diagnostic warns for paths through the code in which a pointer
6631 is dereferenced that points to a variable in a stale stack frame.
6632
6633 @item -Wno-analyzer-use-of-uninitialized-value
6634 @opindex Wanalyzer-use-of-uninitialized-value
6635 @opindex Wno-analyzer-use-of-uninitialized-value
6636 This warning requires @option{-fanalyzer}, which enables it; use
6637 @option{-Wno-analyzer-use-of-uninitialized-value} to disable it.
6638
6639 This diagnostic warns for paths through the code in which an uninitialized
6640 value is used.
6641
6642 @item -Warith-conversion
6643 @opindex Warith-conversion
6644 @opindex Wno-arith-conversion
6645 Do warn about implicit conversions from arithmetic operations even
6646 when conversion of the operands to the same type cannot change their
6647 values.  This affects warnings from @option{-Wconversion},
6648 @option{-Wfloat-conversion}, and @option{-Wsign-conversion}.
6649
6650 @smallexample
6651 @group
6652 void f (char c, int i)
6653 @{
6654   c = c + i; // warns with @option{-Wconversion}
6655   c = c + 1; // only warns with @option{-Warith-conversion}
6656 @}
6657 @end group
6658 @end smallexample
6659
6660 @item -Warray-bounds
6661 @itemx -Warray-bounds=@var{n}
6662 @opindex Wno-array-bounds
6663 @opindex Warray-bounds
6664 This option is only active when @option{-ftree-vrp} is active
6665 (default for @option{-O2} and above). It warns about subscripts to arrays
6666 that are always out of bounds. This warning is enabled by @option{-Wall}.
6667
6668 @table @gcctabopt
6669 @item -Warray-bounds=1
6670 This is the warning level of @option{-Warray-bounds} and is enabled
6671 by @option{-Wall}; higher levels are not, and must be explicitly requested.
6672
6673 @item -Warray-bounds=2
6674 This warning level also warns about out of bounds access for
6675 arrays at the end of a struct and for arrays accessed through
6676 pointers. This warning level may give a larger number of
6677 false positives and is deactivated by default.
6678 @end table
6679
6680 @item -Wattribute-alias=@var{n}
6681 @itemx -Wno-attribute-alias
6682 @opindex Wattribute-alias
6683 @opindex Wno-attribute-alias
6684 Warn about declarations using the @code{alias} and similar attributes whose
6685 target is incompatible with the type of the alias.
6686 @xref{Function Attributes,,Declaring Attributes of Functions}.
6687
6688 @table @gcctabopt
6689 @item -Wattribute-alias=1
6690 The default warning level of the @option{-Wattribute-alias} option diagnoses
6691 incompatibilities between the type of the alias declaration and that of its
6692 target.  Such incompatibilities are typically indicative of bugs.
6693
6694 @item -Wattribute-alias=2
6695
6696 At this level @option{-Wattribute-alias} also diagnoses cases where
6697 the attributes of the alias declaration are more restrictive than the
6698 attributes applied to its target.  These mismatches can potentially
6699 result in incorrect code generation.  In other cases they may be
6700 benign and could be resolved simply by adding the missing attribute to
6701 the target.  For comparison, see the @option{-Wmissing-attributes}
6702 option, which controls diagnostics when the alias declaration is less
6703 restrictive than the target, rather than more restrictive.
6704
6705 Attributes considered include @code{alloc_align}, @code{alloc_size},
6706 @code{cold}, @code{const}, @code{hot}, @code{leaf}, @code{malloc},
6707 @code{nonnull}, @code{noreturn}, @code{nothrow}, @code{pure},
6708 @code{returns_nonnull}, and @code{returns_twice}.
6709 @end table
6710
6711 @option{-Wattribute-alias} is equivalent to @option{-Wattribute-alias=1}.
6712 This is the default.  You can disable these warnings with either
6713 @option{-Wno-attribute-alias} or @option{-Wattribute-alias=0}.
6714
6715 @item -Wbool-compare
6716 @opindex Wno-bool-compare
6717 @opindex Wbool-compare
6718 Warn about boolean expression compared with an integer value different from
6719 @code{true}/@code{false}.  For instance, the following comparison is
6720 always false:
6721 @smallexample
6722 int n = 5;
6723 @dots{}
6724 if ((n > 1) == 2) @{ @dots{} @}
6725 @end smallexample
6726 This warning is enabled by @option{-Wall}.
6727
6728 @item -Wbool-operation
6729 @opindex Wno-bool-operation
6730 @opindex Wbool-operation
6731 Warn about suspicious operations on expressions of a boolean type.  For
6732 instance, bitwise negation of a boolean is very likely a bug in the program.
6733 For C, this warning also warns about incrementing or decrementing a boolean,
6734 which rarely makes sense.  (In C++, decrementing a boolean is always invalid.
6735 Incrementing a boolean is invalid in C++17, and deprecated otherwise.)
6736
6737 This warning is enabled by @option{-Wall}.
6738
6739 @item -Wduplicated-branches
6740 @opindex Wno-duplicated-branches
6741 @opindex Wduplicated-branches
6742 Warn when an if-else has identical branches.  This warning detects cases like
6743 @smallexample
6744 if (p != NULL)
6745   return 0;
6746 else
6747   return 0;
6748 @end smallexample
6749 It doesn't warn when both branches contain just a null statement.  This warning
6750 also warn for conditional operators:
6751 @smallexample
6752   int i = x ? *p : *p;
6753 @end smallexample
6754
6755 @item -Wduplicated-cond
6756 @opindex Wno-duplicated-cond
6757 @opindex Wduplicated-cond
6758 Warn about duplicated conditions in an if-else-if chain.  For instance,
6759 warn for the following code:
6760 @smallexample
6761 if (p->q != NULL) @{ @dots{} @}
6762 else if (p->q != NULL) @{ @dots{} @}
6763 @end smallexample
6764
6765 @item -Wframe-address
6766 @opindex Wno-frame-address
6767 @opindex Wframe-address
6768 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
6769 is called with an argument greater than 0.  Such calls may return indeterminate
6770 values or crash the program.  The warning is included in @option{-Wall}.
6771
6772 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
6773 @opindex Wno-discarded-qualifiers
6774 @opindex Wdiscarded-qualifiers
6775 Do not warn if type qualifiers on pointers are being discarded.
6776 Typically, the compiler warns if a @code{const char *} variable is
6777 passed to a function that takes a @code{char *} parameter.  This option
6778 can be used to suppress such a warning.
6779
6780 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
6781 @opindex Wno-discarded-array-qualifiers
6782 @opindex Wdiscarded-array-qualifiers
6783 Do not warn if type qualifiers on arrays which are pointer targets
6784 are being discarded.  Typically, the compiler warns if a
6785 @code{const int (*)[]} variable is passed to a function that
6786 takes a @code{int (*)[]} parameter.  This option can be used to
6787 suppress such a warning.
6788
6789 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
6790 @opindex Wno-incompatible-pointer-types
6791 @opindex Wincompatible-pointer-types
6792 Do not warn when there is a conversion between pointers that have incompatible
6793 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
6794 which warns for pointer argument passing or assignment with different
6795 signedness.
6796
6797 @item -Wno-int-conversion @r{(C and Objective-C only)}
6798 @opindex Wno-int-conversion
6799 @opindex Wint-conversion
6800 Do not warn about incompatible integer to pointer and pointer to integer
6801 conversions.  This warning is about implicit conversions; for explicit
6802 conversions the warnings @option{-Wno-int-to-pointer-cast} and
6803 @option{-Wno-pointer-to-int-cast} may be used.
6804
6805 @item -Wzero-length-bounds
6806 @opindex Wzero-length-bounds
6807 @opindex Wzero-length-bounds
6808 Warn about accesses to elements of zero-length array members that might
6809 overlap other members of the same object.  Declaring interior zero-length
6810 arrays is discouraged because accesses to them are undefined.  See
6811 @xref{Zero Length}.
6812
6813 For example, the first two stores in function @code{bad} are diagnosed
6814 because the array elements overlap the subsequent members @code{b} and
6815 @code{c}.  The third store is diagnosed by @option{-Warray-bounds}
6816 because it is beyond the bounds of the enclosing object.
6817
6818 @smallexample
6819 struct X @{ int a[0]; int b, c; @};
6820 struct X x;
6821
6822 void bad (void)
6823 @{
6824   x.a[0] = 0;   // -Wzero-length-bounds
6825   x.a[1] = 1;   // -Wzero-length-bounds
6826   x.a[2] = 2;   // -Warray-bounds
6827 @}
6828 @end smallexample
6829
6830 Option @option{-Wzero-length-bounds} is enabled by @option{-Warray-bounds}.
6831
6832 @item -Wno-div-by-zero
6833 @opindex Wno-div-by-zero
6834 @opindex Wdiv-by-zero
6835 Do not warn about compile-time integer division by zero.  Floating-point
6836 division by zero is not warned about, as it can be a legitimate way of
6837 obtaining infinities and NaNs.
6838
6839 @item -Wsystem-headers
6840 @opindex Wsystem-headers
6841 @opindex Wno-system-headers
6842 @cindex warnings from system headers
6843 @cindex system headers, warnings from
6844 Print warning messages for constructs found in system header files.
6845 Warnings from system headers are normally suppressed, on the assumption
6846 that they usually do not indicate real problems and would only make the
6847 compiler output harder to read.  Using this command-line option tells
6848 GCC to emit warnings from system headers as if they occurred in user
6849 code.  However, note that using @option{-Wall} in conjunction with this
6850 option does @emph{not} warn about unknown pragmas in system
6851 headers---for that, @option{-Wunknown-pragmas} must also be used.
6852
6853 @item -Wtautological-compare
6854 @opindex Wtautological-compare
6855 @opindex Wno-tautological-compare
6856 Warn if a self-comparison always evaluates to true or false.  This
6857 warning detects various mistakes such as:
6858 @smallexample
6859 int i = 1;
6860 @dots{}
6861 if (i > i) @{ @dots{} @}
6862 @end smallexample
6863
6864 This warning also warns about bitwise comparisons that always evaluate
6865 to true or false, for instance:
6866 @smallexample
6867 if ((a & 16) == 10) @{ @dots{} @}
6868 @end smallexample
6869 will always be false.
6870
6871 This warning is enabled by @option{-Wall}.
6872
6873 @item -Wtrampolines
6874 @opindex Wtrampolines
6875 @opindex Wno-trampolines
6876 Warn about trampolines generated for pointers to nested functions.
6877 A trampoline is a small piece of data or code that is created at run
6878 time on the stack when the address of a nested function is taken, and is
6879 used to call the nested function indirectly.  For some targets, it is
6880 made up of data only and thus requires no special treatment.  But, for
6881 most targets, it is made up of code and thus requires the stack to be
6882 made executable in order for the program to work properly.
6883
6884 @item -Wfloat-equal
6885 @opindex Wfloat-equal
6886 @opindex Wno-float-equal
6887 Warn if floating-point values are used in equality comparisons.
6888
6889 The idea behind this is that sometimes it is convenient (for the
6890 programmer) to consider floating-point values as approximations to
6891 infinitely precise real numbers.  If you are doing this, then you need
6892 to compute (by analyzing the code, or in some other way) the maximum or
6893 likely maximum error that the computation introduces, and allow for it
6894 when performing comparisons (and when producing output, but that's a
6895 different problem).  In particular, instead of testing for equality, you
6896 should check to see whether the two values have ranges that overlap; and
6897 this is done with the relational operators, so equality comparisons are
6898 probably mistaken.
6899
6900 @item -Wtraditional @r{(C and Objective-C only)}
6901 @opindex Wtraditional
6902 @opindex Wno-traditional
6903 Warn about certain constructs that behave differently in traditional and
6904 ISO C@.  Also warn about ISO C constructs that have no traditional C
6905 equivalent, and/or problematic constructs that should be avoided.
6906
6907 @itemize @bullet
6908 @item
6909 Macro parameters that appear within string literals in the macro body.
6910 In traditional C macro replacement takes place within string literals,
6911 but in ISO C it does not.
6912
6913 @item
6914 In traditional C, some preprocessor directives did not exist.
6915 Traditional preprocessors only considered a line to be a directive
6916 if the @samp{#} appeared in column 1 on the line.  Therefore
6917 @option{-Wtraditional} warns about directives that traditional C
6918 understands but ignores because the @samp{#} does not appear as the
6919 first character on the line.  It also suggests you hide directives like
6920 @code{#pragma} not understood by traditional C by indenting them.  Some
6921 traditional implementations do not recognize @code{#elif}, so this option
6922 suggests avoiding it altogether.
6923
6924 @item
6925 A function-like macro that appears without arguments.
6926
6927 @item
6928 The unary plus operator.
6929
6930 @item
6931 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
6932 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
6933 constants.)  Note, these suffixes appear in macros defined in the system
6934 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
6935 Use of these macros in user code might normally lead to spurious
6936 warnings, however GCC's integrated preprocessor has enough context to
6937 avoid warning in these cases.
6938
6939 @item
6940 A function declared external in one block and then used after the end of
6941 the block.
6942
6943 @item
6944 A @code{switch} statement has an operand of type @code{long}.
6945
6946 @item
6947 A non-@code{static} function declaration follows a @code{static} one.
6948 This construct is not accepted by some traditional C compilers.
6949
6950 @item
6951 The ISO type of an integer constant has a different width or
6952 signedness from its traditional type.  This warning is only issued if
6953 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
6954 typically represent bit patterns, are not warned about.
6955
6956 @item
6957 Usage of ISO string concatenation is detected.
6958
6959 @item
6960 Initialization of automatic aggregates.
6961
6962 @item
6963 Identifier conflicts with labels.  Traditional C lacks a separate
6964 namespace for labels.
6965
6966 @item
6967 Initialization of unions.  If the initializer is zero, the warning is
6968 omitted.  This is done under the assumption that the zero initializer in
6969 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
6970 initializer warnings and relies on default initialization to zero in the
6971 traditional C case.
6972
6973 @item
6974 Conversions by prototypes between fixed/floating-point values and vice
6975 versa.  The absence of these prototypes when compiling with traditional
6976 C causes serious problems.  This is a subset of the possible
6977 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
6978
6979 @item
6980 Use of ISO C style function definitions.  This warning intentionally is
6981 @emph{not} issued for prototype declarations or variadic functions
6982 because these ISO C features appear in your code when using
6983 libiberty's traditional C compatibility macros, @code{PARAMS} and
6984 @code{VPARAMS}.  This warning is also bypassed for nested functions
6985 because that feature is already a GCC extension and thus not relevant to
6986 traditional C compatibility.
6987 @end itemize
6988
6989 @item -Wtraditional-conversion @r{(C and Objective-C only)}
6990 @opindex Wtraditional-conversion
6991 @opindex Wno-traditional-conversion
6992 Warn if a prototype causes a type conversion that is different from what
6993 would happen to the same argument in the absence of a prototype.  This
6994 includes conversions of fixed point to floating and vice versa, and
6995 conversions changing the width or signedness of a fixed-point argument
6996 except when the same as the default promotion.
6997
6998 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
6999 @opindex Wdeclaration-after-statement
7000 @opindex Wno-declaration-after-statement
7001 Warn when a declaration is found after a statement in a block.  This
7002 construct, known from C++, was introduced with ISO C99 and is by default
7003 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
7004
7005 @item -Wshadow
7006 @opindex Wshadow
7007 @opindex Wno-shadow
7008 Warn whenever a local variable or type declaration shadows another
7009 variable, parameter, type, class member (in C++), or instance variable
7010 (in Objective-C) or whenever a built-in function is shadowed.  Note
7011 that in C++, the compiler warns if a local variable shadows an
7012 explicit typedef, but not if it shadows a struct/class/enum.
7013 If this warning is enabled, it includes also all instances of
7014 local shadowing.  This means that @option{-Wno-shadow=local}
7015 and @option{-Wno-shadow=compatible-local} are ignored when
7016 @option{-Wshadow} is used.
7017 Same as @option{-Wshadow=global}.
7018
7019 @item -Wno-shadow-ivar @r{(Objective-C only)}
7020 @opindex Wno-shadow-ivar
7021 @opindex Wshadow-ivar
7022 Do not warn whenever a local variable shadows an instance variable in an
7023 Objective-C method.
7024
7025 @item -Wshadow=global
7026 @opindex Wshadow=global
7027 Warn for any shadowing.
7028 Same as @option{-Wshadow}.
7029
7030 @item -Wshadow=local
7031 @opindex Wshadow=local
7032 Warn when a local variable shadows another local variable or parameter.
7033
7034 @item -Wshadow=compatible-local
7035 @opindex Wshadow=compatible-local
7036 Warn when a local variable shadows another local variable or parameter
7037 whose type is compatible with that of the shadowing variable.  In C++,
7038 type compatibility here means the type of the shadowing variable can be
7039 converted to that of the shadowed variable.  The creation of this flag
7040 (in addition to @option{-Wshadow=local}) is based on the idea that when
7041 a local variable shadows another one of incompatible type, it is most
7042 likely intentional, not a bug or typo, as shown in the following example:
7043
7044 @smallexample
7045 @group
7046 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
7047 @{
7048   for (int i = 0; i < N; ++i)
7049   @{
7050     ...
7051   @}
7052   ...
7053 @}
7054 @end group
7055 @end smallexample
7056
7057 Since the two variable @code{i} in the example above have incompatible types,
7058 enabling only @option{-Wshadow=compatible-local} does not emit a warning.
7059 Because their types are incompatible, if a programmer accidentally uses one
7060 in place of the other, type checking is expected to catch that and emit an
7061 error or warning.  Use of this flag instead of @option{-Wshadow=local} can
7062 possibly reduce the number of warnings triggered by intentional shadowing.
7063 Note that this also means that shadowing @code{const char *i} by
7064 @code{char *i} does not emit a warning.
7065
7066 This warning is also enabled by @option{-Wshadow=local}.
7067
7068 @item -Wlarger-than=@var{byte-size}
7069 @opindex Wlarger-than=
7070 @opindex Wlarger-than-@var{byte-size}
7071 Warn whenever an object is defined whose size exceeds @var{byte-size}.
7072 @option{-Wlarger-than=}@samp{PTRDIFF_MAX} is enabled by default.
7073 Warnings controlled by the option can be disabled either by specifying
7074 @var{byte-size} of @samp{SIZE_MAX} or more or by
7075 @option{-Wno-larger-than}.
7076
7077 @item -Wno-larger-than
7078 @opindex Wno-larger-than
7079 Disable @option{-Wlarger-than=} warnings.  The option is equivalent
7080 to @option{-Wlarger-than=}@samp{SIZE_MAX} or larger.
7081
7082 @item -Wframe-larger-than=@var{byte-size}
7083 @opindex Wframe-larger-than=
7084 @opindex Wno-frame-larger-than
7085 Warn if the size of a function frame exceeds @var{byte-size}.
7086 The computation done to determine the stack frame size is approximate
7087 and not conservative.
7088 The actual requirements may be somewhat greater than @var{byte-size}
7089 even if you do not get a warning.  In addition, any space allocated
7090 via @code{alloca}, variable-length arrays, or related constructs
7091 is not included by the compiler when determining
7092 whether or not to issue a warning.
7093 @option{-Wframe-larger-than=}@samp{PTRDIFF_MAX} is enabled by default.
7094 Warnings controlled by the option can be disabled either by specifying
7095 @var{byte-size} of @samp{SIZE_MAX} or more or by
7096 @option{-Wno-frame-larger-than}.
7097
7098 @item -Wno-frame-larger-than
7099 @opindex Wno-frame-larger-than
7100 Disable @option{-Wframe-larger-than=} warnings.  The option is equivalent
7101 to @option{-Wframe-larger-than=}@samp{SIZE_MAX} or larger.
7102
7103 @item -Wno-free-nonheap-object
7104 @opindex Wno-free-nonheap-object
7105 @opindex Wfree-nonheap-object
7106 Do not warn when attempting to free an object that was not allocated
7107 on the heap.
7108
7109 @item -Wstack-usage=@var{byte-size}
7110 @opindex Wstack-usage
7111 @opindex Wno-stack-usage
7112 Warn if the stack usage of a function might exceed @var{byte-size}.
7113 The computation done to determine the stack usage is conservative.
7114 Any space allocated via @code{alloca}, variable-length arrays, or related
7115 constructs is included by the compiler when determining whether or not to
7116 issue a warning.
7117
7118 The message is in keeping with the output of @option{-fstack-usage}.
7119
7120 @itemize
7121 @item
7122 If the stack usage is fully static but exceeds the specified amount, it's:
7123
7124 @smallexample
7125   warning: stack usage is 1120 bytes
7126 @end smallexample
7127 @item
7128 If the stack usage is (partly) dynamic but bounded, it's:
7129
7130 @smallexample
7131   warning: stack usage might be 1648 bytes
7132 @end smallexample
7133 @item
7134 If the stack usage is (partly) dynamic and not bounded, it's:
7135
7136 @smallexample
7137   warning: stack usage might be unbounded
7138 @end smallexample
7139 @end itemize
7140
7141 @option{-Wstack-usage=}@samp{PTRDIFF_MAX} is enabled by default.
7142 Warnings controlled by the option can be disabled either by specifying
7143 @var{byte-size} of @samp{SIZE_MAX} or more or by
7144 @option{-Wno-stack-usage}.
7145
7146 @item -Wno-stack-usage
7147 @opindex Wno-stack-usage
7148 Disable @option{-Wstack-usage=} warnings.  The option is equivalent
7149 to @option{-Wstack-usage=}@samp{SIZE_MAX} or larger.
7150
7151 @item -Wunsafe-loop-optimizations
7152 @opindex Wunsafe-loop-optimizations
7153 @opindex Wno-unsafe-loop-optimizations
7154 Warn if the loop cannot be optimized because the compiler cannot
7155 assume anything on the bounds of the loop indices.  With
7156 @option{-funsafe-loop-optimizations} warn if the compiler makes
7157 such assumptions.
7158
7159 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
7160 @opindex Wno-pedantic-ms-format
7161 @opindex Wpedantic-ms-format
7162 When used in combination with @option{-Wformat}
7163 and @option{-pedantic} without GNU extensions, this option
7164 disables the warnings about non-ISO @code{printf} / @code{scanf} format
7165 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
7166 which depend on the MS runtime.
7167
7168 @item -Waligned-new
7169 @opindex Waligned-new
7170 @opindex Wno-aligned-new
7171 Warn about a new-expression of a type that requires greater alignment
7172 than the @code{alignof(std::max_align_t)} but uses an allocation
7173 function without an explicit alignment parameter. This option is
7174 enabled by @option{-Wall}.
7175
7176 Normally this only warns about global allocation functions, but
7177 @option{-Waligned-new=all} also warns about class member allocation
7178 functions.
7179
7180 @item -Wplacement-new
7181 @itemx -Wplacement-new=@var{n}
7182 @opindex Wplacement-new
7183 @opindex Wno-placement-new
7184 Warn about placement new expressions with undefined behavior, such as
7185 constructing an object in a buffer that is smaller than the type of
7186 the object.  For example, the placement new expression below is diagnosed
7187 because it attempts to construct an array of 64 integers in a buffer only
7188 64 bytes large.
7189 @smallexample
7190 char buf [64];
7191 new (buf) int[64];
7192 @end smallexample
7193 This warning is enabled by default.
7194
7195 @table @gcctabopt
7196 @item -Wplacement-new=1
7197 This is the default warning level of @option{-Wplacement-new}.  At this
7198 level the warning is not issued for some strictly undefined constructs that
7199 GCC allows as extensions for compatibility with legacy code.  For example,
7200 the following @code{new} expression is not diagnosed at this level even
7201 though it has undefined behavior according to the C++ standard because
7202 it writes past the end of the one-element array.
7203 @smallexample
7204 struct S @{ int n, a[1]; @};
7205 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
7206 new (s->a)int [32]();
7207 @end smallexample
7208
7209 @item -Wplacement-new=2
7210 At this level, in addition to diagnosing all the same constructs as at level
7211 1, a diagnostic is also issued for placement new expressions that construct
7212 an object in the last member of structure whose type is an array of a single
7213 element and whose size is less than the size of the object being constructed.
7214 While the previous example would be diagnosed, the following construct makes
7215 use of the flexible member array extension to avoid the warning at level 2.
7216 @smallexample
7217 struct S @{ int n, a[]; @};
7218 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
7219 new (s->a)int [32]();
7220 @end smallexample
7221
7222 @end table
7223
7224 @item -Wpointer-arith
7225 @opindex Wpointer-arith
7226 @opindex Wno-pointer-arith
7227 Warn about anything that depends on the ``size of'' a function type or
7228 of @code{void}.  GNU C assigns these types a size of 1, for
7229 convenience in calculations with @code{void *} pointers and pointers
7230 to functions.  In C++, warn also when an arithmetic operation involves
7231 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
7232
7233 @item -Wpointer-compare
7234 @opindex Wpointer-compare
7235 @opindex Wno-pointer-compare
7236 Warn if a pointer is compared with a zero character constant.  This usually
7237 means that the pointer was meant to be dereferenced.  For example:
7238
7239 @smallexample
7240 const char *p = foo ();
7241 if (p == '\0')
7242   return 42;
7243 @end smallexample
7244
7245 Note that the code above is invalid in C++11.
7246
7247 This warning is enabled by default.
7248
7249 @item -Wtype-limits
7250 @opindex Wtype-limits
7251 @opindex Wno-type-limits
7252 Warn if a comparison is always true or always false due to the limited
7253 range of the data type, but do not warn for constant expressions.  For
7254 example, warn if an unsigned variable is compared against zero with
7255 @code{<} or @code{>=}.  This warning is also enabled by
7256 @option{-Wextra}.
7257
7258 @item -Wabsolute-value @r{(C and Objective-C only)}
7259 @opindex Wabsolute-value
7260 @opindex Wno-absolute-value
7261 Warn for calls to standard functions that compute the absolute value
7262 of an argument when a more appropriate standard function is available.
7263 For example, calling @code{abs(3.14)} triggers the warning because the
7264 appropriate function to call to compute the absolute value of a double
7265 argument is @code{fabs}.  The option also triggers warnings when the
7266 argument in a call to such a function has an unsigned type.  This
7267 warning can be suppressed with an explicit type cast and it is also
7268 enabled by @option{-Wextra}.
7269
7270 @include cppwarnopts.texi
7271
7272 @item -Wbad-function-cast @r{(C and Objective-C only)}
7273 @opindex Wbad-function-cast
7274 @opindex Wno-bad-function-cast
7275 Warn when a function call is cast to a non-matching type.
7276 For example, warn if a call to a function returning an integer type 
7277 is cast to a pointer type.
7278
7279 @item -Wc90-c99-compat @r{(C and Objective-C only)}
7280 @opindex Wc90-c99-compat
7281 @opindex Wno-c90-c99-compat
7282 Warn about features not present in ISO C90, but present in ISO C99.
7283 For instance, warn about use of variable length arrays, @code{long long}
7284 type, @code{bool} type, compound literals, designated initializers, and so
7285 on.  This option is independent of the standards mode.  Warnings are disabled
7286 in the expression that follows @code{__extension__}.
7287
7288 @item -Wc99-c11-compat @r{(C and Objective-C only)}
7289 @opindex Wc99-c11-compat
7290 @opindex Wno-c99-c11-compat
7291 Warn about features not present in ISO C99, but present in ISO C11.
7292 For instance, warn about use of anonymous structures and unions,
7293 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
7294 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
7295 and so on.  This option is independent of the standards mode.  Warnings are
7296 disabled in the expression that follows @code{__extension__}.
7297
7298 @item -Wc11-c2x-compat @r{(C and Objective-C only)}
7299 @opindex Wc11-c2x-compat
7300 @opindex Wno-c11-c2x-compat
7301 Warn about features not present in ISO C11, but present in ISO C2X.
7302 For instance, warn about omitting the string in @code{_Static_assert},
7303 use of @samp{[[]]} syntax for attributes, use of decimal
7304 floating-point types, and so on.  This option is independent of the
7305 standards mode.  Warnings are disabled in the expression that follows
7306 @code{__extension__}.
7307
7308 @item -Wc++-compat @r{(C and Objective-C only)}
7309 @opindex Wc++-compat
7310 @opindex Wno-c++-compat
7311 Warn about ISO C constructs that are outside of the common subset of
7312 ISO C and ISO C++, e.g.@: request for implicit conversion from
7313 @code{void *} to a pointer to non-@code{void} type.
7314
7315 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
7316 @opindex Wc++11-compat
7317 @opindex Wno-c++11-compat
7318 Warn about C++ constructs whose meaning differs between ISO C++ 1998
7319 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
7320 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
7321 enabled by @option{-Wall}.
7322
7323 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
7324 @opindex Wc++14-compat
7325 @opindex Wno-c++14-compat
7326 Warn about C++ constructs whose meaning differs between ISO C++ 2011
7327 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
7328
7329 @item -Wc++17-compat @r{(C++ and Objective-C++ only)}
7330 @opindex Wc++17-compat
7331 @opindex Wno-c++17-compat
7332 Warn about C++ constructs whose meaning differs between ISO C++ 2014
7333 and ISO C++ 2017.  This warning is enabled by @option{-Wall}.
7334
7335 @item -Wc++20-compat @r{(C++ and Objective-C++ only)}
7336 @opindex Wc++20-compat
7337 @opindex Wno-c++20-compat
7338 Warn about C++ constructs whose meaning differs between ISO C++ 2017
7339 and ISO C++ 2020.  This warning is enabled by @option{-Wall}.
7340
7341 @item -Wcast-qual
7342 @opindex Wcast-qual
7343 @opindex Wno-cast-qual
7344 Warn whenever a pointer is cast so as to remove a type qualifier from
7345 the target type.  For example, warn if a @code{const char *} is cast
7346 to an ordinary @code{char *}.
7347
7348 Also warn when making a cast that introduces a type qualifier in an
7349 unsafe way.  For example, casting @code{char **} to @code{const char **}
7350 is unsafe, as in this example:
7351
7352 @smallexample
7353   /* p is char ** value.  */
7354   const char **q = (const char **) p;
7355   /* Assignment of readonly string to const char * is OK.  */
7356   *q = "string";
7357   /* Now char** pointer points to read-only memory.  */
7358   **p = 'b';
7359 @end smallexample
7360
7361 @item -Wcast-align
7362 @opindex Wcast-align
7363 @opindex Wno-cast-align
7364 Warn whenever a pointer is cast such that the required alignment of the
7365 target is increased.  For example, warn if a @code{char *} is cast to
7366 an @code{int *} on machines where integers can only be accessed at
7367 two- or four-byte boundaries.
7368
7369 @item -Wcast-align=strict
7370 @opindex Wcast-align=strict
7371 Warn whenever a pointer is cast such that the required alignment of the
7372 target is increased.  For example, warn if a @code{char *} is cast to
7373 an @code{int *} regardless of the target machine.
7374
7375 @item -Wcast-function-type
7376 @opindex Wcast-function-type
7377 @opindex Wno-cast-function-type
7378 Warn when a function pointer is cast to an incompatible function pointer.
7379 In a cast involving function types with a variable argument list only
7380 the types of initial arguments that are provided are considered.
7381 Any parameter of pointer-type matches any other pointer-type.  Any benign
7382 differences in integral types are ignored, like @code{int} vs.@: @code{long}
7383 on ILP32 targets.  Likewise type qualifiers are ignored.  The function
7384 type @code{void (*) (void)} is special and matches everything, which can
7385 be used to suppress this warning.
7386 In a cast involving pointer to member types this warning warns whenever
7387 the type cast is changing the pointer to member type.
7388 This warning is enabled by @option{-Wextra}.
7389
7390 @item -Wwrite-strings
7391 @opindex Wwrite-strings
7392 @opindex Wno-write-strings
7393 When compiling C, give string constants the type @code{const
7394 char[@var{length}]} so that copying the address of one into a
7395 non-@code{const} @code{char *} pointer produces a warning.  These
7396 warnings help you find at compile time code that can try to write
7397 into a string constant, but only if you have been very careful about
7398 using @code{const} in declarations and prototypes.  Otherwise, it is
7399 just a nuisance. This is why we did not make @option{-Wall} request
7400 these warnings.
7401
7402 When compiling C++, warn about the deprecated conversion from string
7403 literals to @code{char *}.  This warning is enabled by default for C++
7404 programs.
7405
7406 @item -Wcatch-value
7407 @itemx -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)}
7408 @opindex Wcatch-value
7409 @opindex Wno-catch-value
7410 Warn about catch handlers that do not catch via reference.
7411 With @option{-Wcatch-value=1} (or @option{-Wcatch-value} for short)
7412 warn about polymorphic class types that are caught by value.
7413 With @option{-Wcatch-value=2} warn about all class types that are caught
7414 by value. With @option{-Wcatch-value=3} warn about all types that are
7415 not caught by reference. @option{-Wcatch-value} is enabled by @option{-Wall}.
7416
7417 @item -Wclobbered
7418 @opindex Wclobbered
7419 @opindex Wno-clobbered
7420 Warn for variables that might be changed by @code{longjmp} or
7421 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
7422
7423 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
7424 @opindex Wconditionally-supported
7425 @opindex Wno-conditionally-supported
7426 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
7427
7428 @item -Wconversion
7429 @opindex Wconversion
7430 @opindex Wno-conversion
7431 Warn for implicit conversions that may alter a value. This includes
7432 conversions between real and integer, like @code{abs (x)} when
7433 @code{x} is @code{double}; conversions between signed and unsigned,
7434 like @code{unsigned ui = -1}; and conversions to smaller types, like
7435 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
7436 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
7437 changed by the conversion like in @code{abs (2.0)}.  Warnings about
7438 conversions between signed and unsigned integers can be disabled by
7439 using @option{-Wno-sign-conversion}.
7440
7441 For C++, also warn for confusing overload resolution for user-defined
7442 conversions; and conversions that never use a type conversion
7443 operator: conversions to @code{void}, the same type, a base class or a
7444 reference to them. Warnings about conversions between signed and
7445 unsigned integers are disabled by default in C++ unless
7446 @option{-Wsign-conversion} is explicitly enabled.
7447
7448 Warnings about conversion from arithmetic on a small type back to that
7449 type are only given with @option{-Warith-conversion}.
7450
7451 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
7452 @opindex Wconversion-null
7453 @opindex Wno-conversion-null
7454 Do not warn for conversions between @code{NULL} and non-pointer
7455 types. @option{-Wconversion-null} is enabled by default.
7456
7457 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
7458 @opindex Wzero-as-null-pointer-constant
7459 @opindex Wno-zero-as-null-pointer-constant
7460 Warn when a literal @samp{0} is used as null pointer constant.  This can
7461 be useful to facilitate the conversion to @code{nullptr} in C++11.
7462
7463 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
7464 @opindex Wsubobject-linkage
7465 @opindex Wno-subobject-linkage
7466 Warn if a class type has a base or a field whose type uses the anonymous
7467 namespace or depends on a type with no linkage.  If a type A depends on
7468 a type B with no or internal linkage, defining it in multiple
7469 translation units would be an ODR violation because the meaning of B
7470 is different in each translation unit.  If A only appears in a single
7471 translation unit, the best way to silence the warning is to give it
7472 internal linkage by putting it in an anonymous namespace as well.  The
7473 compiler doesn't give this warning for types defined in the main .C
7474 file, as those are unlikely to have multiple definitions.
7475 @option{-Wsubobject-linkage} is enabled by default.
7476
7477 @item -Wdangling-else
7478 @opindex Wdangling-else
7479 @opindex Wno-dangling-else
7480 Warn about constructions where there may be confusion to which
7481 @code{if} statement an @code{else} branch belongs.  Here is an example of
7482 such a case:
7483
7484 @smallexample
7485 @group
7486 @{
7487   if (a)
7488     if (b)
7489       foo ();
7490   else
7491     bar ();
7492 @}
7493 @end group
7494 @end smallexample
7495
7496 In C/C++, every @code{else} branch belongs to the innermost possible
7497 @code{if} statement, which in this example is @code{if (b)}.  This is
7498 often not what the programmer expected, as illustrated in the above
7499 example by indentation the programmer chose.  When there is the
7500 potential for this confusion, GCC issues a warning when this flag
7501 is specified.  To eliminate the warning, add explicit braces around
7502 the innermost @code{if} statement so there is no way the @code{else}
7503 can belong to the enclosing @code{if}.  The resulting code
7504 looks like this:
7505
7506 @smallexample
7507 @group
7508 @{
7509   if (a)
7510     @{
7511       if (b)
7512         foo ();
7513       else
7514         bar ();
7515     @}
7516 @}
7517 @end group
7518 @end smallexample
7519
7520 This warning is enabled by @option{-Wparentheses}.
7521
7522 @item -Wdate-time
7523 @opindex Wdate-time
7524 @opindex Wno-date-time
7525 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
7526 are encountered as they might prevent bit-wise-identical reproducible
7527 compilations.
7528
7529 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
7530 @opindex Wdelete-incomplete
7531 @opindex Wno-delete-incomplete
7532 Warn when deleting a pointer to incomplete type, which may cause
7533 undefined behavior at runtime.  This warning is enabled by default.
7534
7535 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
7536 @opindex Wuseless-cast
7537 @opindex Wno-useless-cast
7538 Warn when an expression is casted to its own type.
7539
7540 @item -Wempty-body
7541 @opindex Wempty-body
7542 @opindex Wno-empty-body
7543 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
7544 while} statement.  This warning is also enabled by @option{-Wextra}.
7545
7546 @item -Wenum-compare
7547 @opindex Wenum-compare
7548 @opindex Wno-enum-compare
7549 Warn about a comparison between values of different enumerated types.
7550 In C++ enumerated type mismatches in conditional expressions are also
7551 diagnosed and the warning is enabled by default.  In C this warning is 
7552 enabled by @option{-Wall}.
7553
7554 @item -Wenum-conversion @r{(C, Objective-C only)}
7555 @opindex Wenum-conversion
7556 @opindex Wno-enum-conversion
7557 Warn when a value of enumerated type is implicitly converted to a 
7558 different enumerated type.  This warning is enabled by @option{-Wextra}.
7559
7560 @item -Wextra-semi @r{(C++, Objective-C++ only)}
7561 @opindex Wextra-semi
7562 @opindex Wno-extra-semi
7563 Warn about redundant semicolon after in-class function definition.
7564
7565 @item -Wjump-misses-init @r{(C, Objective-C only)}
7566 @opindex Wjump-misses-init
7567 @opindex Wno-jump-misses-init
7568 Warn if a @code{goto} statement or a @code{switch} statement jumps
7569 forward across the initialization of a variable, or jumps backward to a
7570 label after the variable has been initialized.  This only warns about
7571 variables that are initialized when they are declared.  This warning is
7572 only supported for C and Objective-C; in C++ this sort of branch is an
7573 error in any case.
7574
7575 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
7576 can be disabled with the @option{-Wno-jump-misses-init} option.
7577
7578 @item -Wsign-compare
7579 @opindex Wsign-compare
7580 @opindex Wno-sign-compare
7581 @cindex warning for comparison of signed and unsigned values
7582 @cindex comparison of signed and unsigned values, warning
7583 @cindex signed and unsigned values, comparison warning
7584 Warn when a comparison between signed and unsigned values could produce
7585 an incorrect result when the signed value is converted to unsigned.
7586 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
7587 also enabled by @option{-Wextra}.
7588
7589 @item -Wsign-conversion
7590 @opindex Wsign-conversion
7591 @opindex Wno-sign-conversion
7592 Warn for implicit conversions that may change the sign of an integer
7593 value, like assigning a signed integer expression to an unsigned
7594 integer variable. An explicit cast silences the warning. In C, this
7595 option is enabled also by @option{-Wconversion}.
7596
7597 @item -Wfloat-conversion
7598 @opindex Wfloat-conversion
7599 @opindex Wno-float-conversion
7600 Warn for implicit conversions that reduce the precision of a real value.
7601 This includes conversions from real to integer, and from higher precision
7602 real to lower precision real values.  This option is also enabled by
7603 @option{-Wconversion}.
7604
7605 @item -Wno-scalar-storage-order
7606 @opindex Wno-scalar-storage-order
7607 @opindex Wscalar-storage-order
7608 Do not warn on suspicious constructs involving reverse scalar storage order.
7609
7610 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
7611 @opindex Wsized-deallocation
7612 @opindex Wno-sized-deallocation
7613 Warn about a definition of an unsized deallocation function
7614 @smallexample
7615 void operator delete (void *) noexcept;
7616 void operator delete[] (void *) noexcept;
7617 @end smallexample
7618 without a definition of the corresponding sized deallocation function
7619 @smallexample
7620 void operator delete (void *, std::size_t) noexcept;
7621 void operator delete[] (void *, std::size_t) noexcept;
7622 @end smallexample
7623 or vice versa.  Enabled by @option{-Wextra} along with
7624 @option{-fsized-deallocation}.
7625
7626 @item -Wsizeof-pointer-div
7627 @opindex Wsizeof-pointer-div
7628 @opindex Wno-sizeof-pointer-div
7629 Warn for suspicious divisions of two sizeof expressions that divide
7630 the pointer size by the element size, which is the usual way to compute
7631 the array size but won't work out correctly with pointers.  This warning
7632 warns e.g.@: about @code{sizeof (ptr) / sizeof (ptr[0])} if @code{ptr} is
7633 not an array, but a pointer.  This warning is enabled by @option{-Wall}.
7634
7635 @item -Wsizeof-pointer-memaccess
7636 @opindex Wsizeof-pointer-memaccess
7637 @opindex Wno-sizeof-pointer-memaccess
7638 Warn for suspicious length parameters to certain string and memory built-in
7639 functions if the argument uses @code{sizeof}.  This warning triggers for
7640 example for @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not
7641 an array, but a pointer, and suggests a possible fix, or about
7642 @code{memcpy (&foo, ptr, sizeof (&foo));}.  @option{-Wsizeof-pointer-memaccess}
7643 also warns about calls to bounded string copy functions like @code{strncat}
7644 or @code{strncpy} that specify as the bound a @code{sizeof} expression of
7645 the source array.  For example, in the following function the call to
7646 @code{strncat} specifies the size of the source string as the bound.  That
7647 is almost certainly a mistake and so the call is diagnosed.
7648 @smallexample
7649 void make_file (const char *name)
7650 @{
7651   char path[PATH_MAX];
7652   strncpy (path, name, sizeof path - 1);
7653   strncat (path, ".text", sizeof ".text");
7654   @dots{}
7655 @}
7656 @end smallexample
7657
7658 The @option{-Wsizeof-pointer-memaccess} option is enabled by @option{-Wall}.
7659
7660 @item -Wsizeof-array-argument
7661 @opindex Wsizeof-array-argument
7662 @opindex Wno-sizeof-array-argument
7663 Warn when the @code{sizeof} operator is applied to a parameter that is
7664 declared as an array in a function definition.  This warning is enabled by
7665 default for C and C++ programs.
7666
7667 @item -Wmemset-elt-size
7668 @opindex Wmemset-elt-size
7669 @opindex Wno-memset-elt-size
7670 Warn for suspicious calls to the @code{memset} built-in function, if the
7671 first argument references an array, and the third argument is a number
7672 equal to the number of elements, but not equal to the size of the array
7673 in memory.  This indicates that the user has omitted a multiplication by
7674 the element size.  This warning is enabled by @option{-Wall}.
7675
7676 @item -Wmemset-transposed-args
7677 @opindex Wmemset-transposed-args
7678 @opindex Wno-memset-transposed-args
7679 Warn for suspicious calls to the @code{memset} built-in function where
7680 the second argument is not zero and the third argument is zero.  For
7681 example, the call @code{memset (buf, sizeof buf, 0)} is diagnosed because
7682 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostic
7683 is only emitted if the third argument is a literal zero.  Otherwise, if
7684 it is an expression that is folded to zero, or a cast of zero to some
7685 type, it is far less likely that the arguments have been mistakenly
7686 transposed and no warning is emitted.  This warning is enabled
7687 by @option{-Wall}.
7688
7689 @item -Waddress
7690 @opindex Waddress
7691 @opindex Wno-address
7692 Warn about suspicious uses of memory addresses. These include using
7693 the address of a function in a conditional expression, such as
7694 @code{void func(void); if (func)}, and comparisons against the memory
7695 address of a string literal, such as @code{if (x == "abc")}.  Such
7696 uses typically indicate a programmer error: the address of a function
7697 always evaluates to true, so their use in a conditional usually
7698 indicate that the programmer forgot the parentheses in a function
7699 call; and comparisons against string literals result in unspecified
7700 behavior and are not portable in C, so they usually indicate that the
7701 programmer intended to use @code{strcmp}.  This warning is enabled by
7702 @option{-Wall}.
7703
7704 @item -Waddress-of-packed-member
7705 @opindex Waddress-of-packed-member
7706 @opindex Wno-address-of-packed-member
7707 Warn when the address of packed member of struct or union is taken,
7708 which usually results in an unaligned pointer value.  This is
7709 enabled by default.
7710
7711 @item -Wlogical-op
7712 @opindex Wlogical-op
7713 @opindex Wno-logical-op
7714 Warn about suspicious uses of logical operators in expressions.
7715 This includes using logical operators in contexts where a
7716 bit-wise operator is likely to be expected.  Also warns when
7717 the operands of a logical operator are the same:
7718 @smallexample
7719 extern int a;
7720 if (a < 0 && a < 0) @{ @dots{} @}
7721 @end smallexample
7722
7723 @item -Wlogical-not-parentheses
7724 @opindex Wlogical-not-parentheses
7725 @opindex Wno-logical-not-parentheses
7726 Warn about logical not used on the left hand side operand of a comparison.
7727 This option does not warn if the right operand is considered to be a boolean
7728 expression.  Its purpose is to detect suspicious code like the following:
7729 @smallexample
7730 int a;
7731 @dots{}
7732 if (!a > 1) @{ @dots{} @}
7733 @end smallexample
7734
7735 It is possible to suppress the warning by wrapping the LHS into
7736 parentheses:
7737 @smallexample
7738 if ((!a) > 1) @{ @dots{} @}
7739 @end smallexample
7740
7741 This warning is enabled by @option{-Wall}.
7742
7743 @item -Waggregate-return
7744 @opindex Waggregate-return
7745 @opindex Wno-aggregate-return
7746 Warn if any functions that return structures or unions are defined or
7747 called.  (In languages where you can return an array, this also elicits
7748 a warning.)
7749
7750 @item -Wno-aggressive-loop-optimizations
7751 @opindex Wno-aggressive-loop-optimizations
7752 @opindex Waggressive-loop-optimizations
7753 Warn if in a loop with constant number of iterations the compiler detects
7754 undefined behavior in some statement during one or more of the iterations.
7755
7756 @item -Wno-attributes
7757 @opindex Wno-attributes
7758 @opindex Wattributes
7759 Do not warn if an unexpected @code{__attribute__} is used, such as
7760 unrecognized attributes, function attributes applied to variables,
7761 etc.  This does not stop errors for incorrect use of supported
7762 attributes.
7763
7764 @item -Wno-builtin-declaration-mismatch
7765 @opindex Wno-builtin-declaration-mismatch
7766 @opindex Wbuiltin-declaration-mismatch
7767 Warn if a built-in function is declared with an incompatible signature
7768 or as a non-function, or when a built-in function declared with a type
7769 that does not include a prototype is called with arguments whose promoted
7770 types do not match those expected by the function.  When @option{-Wextra}
7771 is specified, also warn when a built-in function that takes arguments is
7772 declared without a prototype.  The @option{-Wno-builtin-declaration-mismatch}
7773 warning is enabled by default.  To avoid the warning include the appropriate
7774 header to bring the prototypes of built-in functions into scope.
7775
7776 For example, the call to @code{memset} below is diagnosed by the warning
7777 because the function expects a value of type @code{size_t} as its argument
7778 but the type of @code{32} is @code{int}.  With @option{-Wextra},
7779 the declaration of the function is diagnosed as well.
7780 @smallexample
7781 extern void* memset ();
7782 void f (void *d)
7783 @{
7784   memset (d, '\0', 32);
7785 @}
7786 @end smallexample
7787
7788 @item -Wno-builtin-macro-redefined
7789 @opindex Wno-builtin-macro-redefined
7790 @opindex Wbuiltin-macro-redefined
7791 Do not warn if certain built-in macros are redefined.  This suppresses
7792 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
7793 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
7794
7795 @item -Wstrict-prototypes @r{(C and Objective-C only)}
7796 @opindex Wstrict-prototypes
7797 @opindex Wno-strict-prototypes
7798 Warn if a function is declared or defined without specifying the
7799 argument types.  (An old-style function definition is permitted without
7800 a warning if preceded by a declaration that specifies the argument
7801 types.)
7802
7803 @item -Wold-style-declaration @r{(C and Objective-C only)}
7804 @opindex Wold-style-declaration
7805 @opindex Wno-old-style-declaration
7806 Warn for obsolescent usages, according to the C Standard, in a
7807 declaration. For example, warn if storage-class specifiers like
7808 @code{static} are not the first things in a declaration.  This warning
7809 is also enabled by @option{-Wextra}.
7810
7811 @item -Wold-style-definition @r{(C and Objective-C only)}
7812 @opindex Wold-style-definition
7813 @opindex Wno-old-style-definition
7814 Warn if an old-style function definition is used.  A warning is given
7815 even if there is a previous prototype.  A definition using @samp{()}
7816 is not considered an old-style definition in C2X mode, because it is
7817 equivalent to @samp{(void)} in that case, but is considered an
7818 old-style definition for older standards.
7819
7820 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
7821 @opindex Wmissing-parameter-type
7822 @opindex Wno-missing-parameter-type
7823 A function parameter is declared without a type specifier in K&R-style
7824 functions:
7825
7826 @smallexample
7827 void foo(bar) @{ @}
7828 @end smallexample
7829
7830 This warning is also enabled by @option{-Wextra}.
7831
7832 @item -Wmissing-prototypes @r{(C and Objective-C only)}
7833 @opindex Wmissing-prototypes
7834 @opindex Wno-missing-prototypes
7835 Warn if a global function is defined without a previous prototype
7836 declaration.  This warning is issued even if the definition itself
7837 provides a prototype.  Use this option to detect global functions
7838 that do not have a matching prototype declaration in a header file.
7839 This option is not valid for C++ because all function declarations
7840 provide prototypes and a non-matching declaration declares an
7841 overload rather than conflict with an earlier declaration.
7842 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
7843
7844 @item -Wmissing-declarations
7845 @opindex Wmissing-declarations
7846 @opindex Wno-missing-declarations
7847 Warn if a global function is defined without a previous declaration.
7848 Do so even if the definition itself provides a prototype.
7849 Use this option to detect global functions that are not declared in
7850 header files.  In C, no warnings are issued for functions with previous
7851 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
7852 missing prototypes.  In C++, no warnings are issued for function templates,
7853 or for inline functions, or for functions in anonymous namespaces.
7854
7855 @item -Wmissing-field-initializers
7856 @opindex Wmissing-field-initializers
7857 @opindex Wno-missing-field-initializers
7858 @opindex W
7859 @opindex Wextra
7860 @opindex Wno-extra
7861 Warn if a structure's initializer has some fields missing.  For
7862 example, the following code causes such a warning, because
7863 @code{x.h} is implicitly zero:
7864
7865 @smallexample
7866 struct s @{ int f, g, h; @};
7867 struct s x = @{ 3, 4 @};
7868 @end smallexample
7869
7870 This option does not warn about designated initializers, so the following
7871 modification does not trigger a warning:
7872
7873 @smallexample
7874 struct s @{ int f, g, h; @};
7875 struct s x = @{ .f = 3, .g = 4 @};
7876 @end smallexample
7877
7878 In C this option does not warn about the universal zero initializer
7879 @samp{@{ 0 @}}:
7880
7881 @smallexample
7882 struct s @{ int f, g, h; @};
7883 struct s x = @{ 0 @};
7884 @end smallexample
7885
7886 Likewise, in C++ this option does not warn about the empty @{ @}
7887 initializer, for example:
7888
7889 @smallexample
7890 struct s @{ int f, g, h; @};
7891 s x = @{ @};
7892 @end smallexample
7893
7894 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
7895 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
7896
7897 @item -Wno-multichar
7898 @opindex Wno-multichar
7899 @opindex Wmultichar
7900 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
7901 Usually they indicate a typo in the user's code, as they have
7902 implementation-defined values, and should not be used in portable code.
7903
7904 @item -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]}
7905 @opindex Wnormalized=
7906 @opindex Wnormalized
7907 @opindex Wno-normalized
7908 @cindex NFC
7909 @cindex NFKC
7910 @cindex character set, input normalization
7911 In ISO C and ISO C++, two identifiers are different if they are
7912 different sequences of characters.  However, sometimes when characters
7913 outside the basic ASCII character set are used, you can have two
7914 different character sequences that look the same.  To avoid confusion,
7915 the ISO 10646 standard sets out some @dfn{normalization rules} which
7916 when applied ensure that two sequences that look the same are turned into
7917 the same sequence.  GCC can warn you if you are using identifiers that
7918 have not been normalized; this option controls that warning.
7919
7920 There are four levels of warning supported by GCC@.  The default is
7921 @option{-Wnormalized=nfc}, which warns about any identifier that is
7922 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
7923 recommended form for most uses.  It is equivalent to
7924 @option{-Wnormalized}.
7925
7926 Unfortunately, there are some characters allowed in identifiers by
7927 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
7928 identifiers.  That is, there's no way to use these symbols in portable
7929 ISO C or C++ and have all your identifiers in NFC@.
7930 @option{-Wnormalized=id} suppresses the warning for these characters.
7931 It is hoped that future versions of the standards involved will correct
7932 this, which is why this option is not the default.
7933
7934 You can switch the warning off for all characters by writing
7935 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
7936 only do this if you are using some other normalization scheme (like
7937 ``D''), because otherwise you can easily create bugs that are
7938 literally impossible to see.
7939
7940 Some characters in ISO 10646 have distinct meanings but look identical
7941 in some fonts or display methodologies, especially once formatting has
7942 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
7943 LETTER N'', displays just like a regular @code{n} that has been
7944 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
7945 normalization scheme to convert all these into a standard form as
7946 well, and GCC warns if your code is not in NFKC if you use
7947 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
7948 about every identifier that contains the letter O because it might be
7949 confused with the digit 0, and so is not the default, but may be
7950 useful as a local coding convention if the programming environment 
7951 cannot be fixed to display these characters distinctly.
7952
7953 @item -Wno-attribute-warning
7954 @opindex Wno-attribute-warning
7955 @opindex Wattribute-warning
7956 Do not warn about usage of functions (@pxref{Function Attributes})
7957 declared with @code{warning} attribute.  By default, this warning is
7958 enabled.  @option{-Wno-attribute-warning} can be used to disable the
7959 warning or @option{-Wno-error=attribute-warning} can be used to
7960 disable the error when compiled with @option{-Werror} flag.
7961
7962 @item -Wno-deprecated
7963 @opindex Wno-deprecated
7964 @opindex Wdeprecated
7965 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
7966
7967 @item -Wno-deprecated-declarations
7968 @opindex Wno-deprecated-declarations
7969 @opindex Wdeprecated-declarations
7970 Do not warn about uses of functions (@pxref{Function Attributes}),
7971 variables (@pxref{Variable Attributes}), and types (@pxref{Type
7972 Attributes}) marked as deprecated by using the @code{deprecated}
7973 attribute.
7974
7975 @item -Wno-overflow
7976 @opindex Wno-overflow
7977 @opindex Woverflow
7978 Do not warn about compile-time overflow in constant expressions.
7979
7980 @item -Wno-odr
7981 @opindex Wno-odr
7982 @opindex Wodr
7983 Warn about One Definition Rule violations during link-time optimization.
7984 Enabled by default.
7985
7986 @item -Wopenmp-simd
7987 @opindex Wopenmp-simd
7988 @opindex Wno-openmp-simd
7989 Warn if the vectorizer cost model overrides the OpenMP
7990 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
7991 option can be used to relax the cost model.
7992
7993 @item -Woverride-init @r{(C and Objective-C only)}
7994 @opindex Woverride-init
7995 @opindex Wno-override-init
7996 @opindex W
7997 @opindex Wextra
7998 @opindex Wno-extra
7999 Warn if an initialized field without side effects is overridden when
8000 using designated initializers (@pxref{Designated Inits, , Designated
8001 Initializers}).
8002
8003 This warning is included in @option{-Wextra}.  To get other
8004 @option{-Wextra} warnings without this one, use @option{-Wextra
8005 -Wno-override-init}.
8006
8007 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
8008 @opindex Woverride-init-side-effects
8009 @opindex Wno-override-init-side-effects
8010 Warn if an initialized field with side effects is overridden when
8011 using designated initializers (@pxref{Designated Inits, , Designated
8012 Initializers}).  This warning is enabled by default.
8013
8014 @item -Wpacked
8015 @opindex Wpacked
8016 @opindex Wno-packed
8017 Warn if a structure is given the packed attribute, but the packed
8018 attribute has no effect on the layout or size of the structure.
8019 Such structures may be mis-aligned for little benefit.  For
8020 instance, in this code, the variable @code{f.x} in @code{struct bar}
8021 is misaligned even though @code{struct bar} does not itself
8022 have the packed attribute:
8023
8024 @smallexample
8025 @group
8026 struct foo @{
8027   int x;
8028   char a, b, c, d;
8029 @} __attribute__((packed));
8030 struct bar @{
8031   char z;
8032   struct foo f;
8033 @};
8034 @end group
8035 @end smallexample
8036
8037 @item -Wpacked-bitfield-compat
8038 @opindex Wpacked-bitfield-compat
8039 @opindex Wno-packed-bitfield-compat
8040 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
8041 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
8042 the change can lead to differences in the structure layout.  GCC
8043 informs you when the offset of such a field has changed in GCC 4.4.
8044 For example there is no longer a 4-bit padding between field @code{a}
8045 and @code{b} in this structure:
8046
8047 @smallexample
8048 struct foo
8049 @{
8050   char a:4;
8051   char b:8;
8052 @} __attribute__ ((packed));
8053 @end smallexample
8054
8055 This warning is enabled by default.  Use
8056 @option{-Wno-packed-bitfield-compat} to disable this warning.
8057
8058 @item -Wpacked-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
8059 @opindex Wpacked-not-aligned
8060 @opindex Wno-packed-not-aligned
8061 Warn if a structure field with explicitly specified alignment in a
8062 packed struct or union is misaligned.  For example, a warning will
8063 be issued on @code{struct S}, like, @code{warning: alignment 1 of
8064 'struct S' is less than 8}, in this code:
8065
8066 @smallexample
8067 @group
8068 struct __attribute__ ((aligned (8))) S8 @{ char a[8]; @};
8069 struct __attribute__ ((packed)) S @{
8070   struct S8 s8;
8071 @};
8072 @end group
8073 @end smallexample
8074
8075 This warning is enabled by @option{-Wall}.
8076
8077 @item -Wpadded
8078 @opindex Wpadded
8079 @opindex Wno-padded
8080 Warn if padding is included in a structure, either to align an element
8081 of the structure or to align the whole structure.  Sometimes when this
8082 happens it is possible to rearrange the fields of the structure to
8083 reduce the padding and so make the structure smaller.
8084
8085 @item -Wredundant-decls
8086 @opindex Wredundant-decls
8087 @opindex Wno-redundant-decls
8088 Warn if anything is declared more than once in the same scope, even in
8089 cases where multiple declaration is valid and changes nothing.
8090
8091 @item -Wno-restrict
8092 @opindex Wrestrict
8093 @opindex Wno-restrict
8094 Warn when an object referenced by a @code{restrict}-qualified parameter
8095 (or, in C++, a @code{__restrict}-qualified parameter) is aliased by another
8096 argument, or when copies between such objects overlap.  For example,
8097 the call to the @code{strcpy} function below attempts to truncate the string
8098 by replacing its initial characters with the last four.  However, because
8099 the call writes the terminating NUL into @code{a[4]}, the copies overlap and
8100 the call is diagnosed.
8101
8102 @smallexample
8103 void foo (void)
8104 @{
8105   char a[] = "abcd1234";
8106   strcpy (a, a + 4);
8107   @dots{}
8108 @}
8109 @end smallexample
8110 The @option{-Wrestrict} option detects some instances of simple overlap
8111 even without optimization but works best at @option{-O2} and above.  It
8112 is included in @option{-Wall}.
8113
8114 @item -Wnested-externs @r{(C and Objective-C only)}
8115 @opindex Wnested-externs
8116 @opindex Wno-nested-externs
8117 Warn if an @code{extern} declaration is encountered within a function.
8118
8119 @item -Wno-inherited-variadic-ctor
8120 @opindex Winherited-variadic-ctor
8121 @opindex Wno-inherited-variadic-ctor
8122 Suppress warnings about use of C++11 inheriting constructors when the
8123 base class inherited from has a C variadic constructor; the warning is
8124 on by default because the ellipsis is not inherited.
8125
8126 @item -Winline
8127 @opindex Winline
8128 @opindex Wno-inline
8129 Warn if a function that is declared as inline cannot be inlined.
8130 Even with this option, the compiler does not warn about failures to
8131 inline functions declared in system headers.
8132
8133 The compiler uses a variety of heuristics to determine whether or not
8134 to inline a function.  For example, the compiler takes into account
8135 the size of the function being inlined and the amount of inlining
8136 that has already been done in the current function.  Therefore,
8137 seemingly insignificant changes in the source program can cause the
8138 warnings produced by @option{-Winline} to appear or disappear.
8139
8140 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
8141 @opindex Wno-invalid-offsetof
8142 @opindex Winvalid-offsetof
8143 Suppress warnings from applying the @code{offsetof} macro to a non-POD
8144 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
8145 to a non-standard-layout type is undefined.  In existing C++ implementations,
8146 however, @code{offsetof} typically gives meaningful results.
8147 This flag is for users who are aware that they are
8148 writing nonportable code and who have deliberately chosen to ignore the
8149 warning about it.
8150
8151 The restrictions on @code{offsetof} may be relaxed in a future version
8152 of the C++ standard.
8153
8154 @item -Wint-in-bool-context
8155 @opindex Wint-in-bool-context
8156 @opindex Wno-int-in-bool-context
8157 Warn for suspicious use of integer values where boolean values are expected,
8158 such as conditional expressions (?:) using non-boolean integer constants in
8159 boolean context, like @code{if (a <= b ? 2 : 3)}.  Or left shifting of signed
8160 integers in boolean context, like @code{for (a = 0; 1 << a; a++);}.  Likewise
8161 for all kinds of multiplications regardless of the data type.
8162 This warning is enabled by @option{-Wall}.
8163
8164 @item -Wno-int-to-pointer-cast
8165 @opindex Wno-int-to-pointer-cast
8166 @opindex Wint-to-pointer-cast
8167 Suppress warnings from casts to pointer type of an integer of a
8168 different size. In C++, casting to a pointer type of smaller size is
8169 an error. @option{Wint-to-pointer-cast} is enabled by default.
8170
8171
8172 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
8173 @opindex Wno-pointer-to-int-cast
8174 @opindex Wpointer-to-int-cast
8175 Suppress warnings from casts from a pointer to an integer type of a
8176 different size.
8177
8178 @item -Winvalid-pch
8179 @opindex Winvalid-pch
8180 @opindex Wno-invalid-pch
8181 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
8182 the search path but cannot be used.
8183
8184 @item -Wlong-long
8185 @opindex Wlong-long
8186 @opindex Wno-long-long
8187 Warn if @code{long long} type is used.  This is enabled by either
8188 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
8189 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
8190
8191 @item -Wvariadic-macros
8192 @opindex Wvariadic-macros
8193 @opindex Wno-variadic-macros
8194 Warn if variadic macros are used in ISO C90 mode, or if the GNU
8195 alternate syntax is used in ISO C99 mode.  This is enabled by either
8196 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
8197 messages, use @option{-Wno-variadic-macros}.
8198
8199 @item -Wvarargs
8200 @opindex Wvarargs
8201 @opindex Wno-varargs
8202 Warn upon questionable usage of the macros used to handle variable
8203 arguments like @code{va_start}.  This is default.  To inhibit the
8204 warning messages, use @option{-Wno-varargs}.
8205
8206 @item -Wvector-operation-performance
8207 @opindex Wvector-operation-performance
8208 @opindex Wno-vector-operation-performance
8209 Warn if vector operation is not implemented via SIMD capabilities of the
8210 architecture.  Mainly useful for the performance tuning.
8211 Vector operation can be implemented @code{piecewise}, which means that the
8212 scalar operation is performed on every vector element; 
8213 @code{in parallel}, which means that the vector operation is implemented
8214 using scalars of wider type, which normally is more performance efficient;
8215 and @code{as a single scalar}, which means that vector fits into a
8216 scalar type.
8217
8218 @item -Wno-virtual-move-assign
8219 @opindex Wvirtual-move-assign
8220 @opindex Wno-virtual-move-assign
8221 Suppress warnings about inheriting from a virtual base with a
8222 non-trivial C++11 move assignment operator.  This is dangerous because
8223 if the virtual base is reachable along more than one path, it is
8224 moved multiple times, which can mean both objects end up in the
8225 moved-from state.  If the move assignment operator is written to avoid
8226 moving from a moved-from object, this warning can be disabled.
8227
8228 @item -Wvla
8229 @opindex Wvla
8230 @opindex Wno-vla
8231 Warn if a variable-length array is used in the code.
8232 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
8233 the variable-length array.
8234
8235 @item -Wvla-larger-than=@var{byte-size}
8236 @opindex Wvla-larger-than=
8237 @opindex Wno-vla-larger-than
8238 If this option is used, the compiler will warn for declarations of
8239 variable-length arrays whose size is either unbounded, or bounded
8240 by an argument that allows the array size to exceed @var{byte-size}
8241 bytes.  This is similar to how @option{-Walloca-larger-than=}@var{byte-size}
8242 works, but with variable-length arrays.
8243
8244 Note that GCC may optimize small variable-length arrays of a known
8245 value into plain arrays, so this warning may not get triggered for
8246 such arrays.
8247
8248 @option{-Wvla-larger-than=}@samp{PTRDIFF_MAX} is enabled by default but
8249 is typically only effective when @option{-ftree-vrp} is active (default
8250 for @option{-O2} and above).
8251
8252 See also @option{-Walloca-larger-than=@var{byte-size}}.
8253
8254 @item -Wno-vla-larger-than
8255 @opindex Wno-vla-larger-than
8256 Disable @option{-Wvla-larger-than=} warnings.  The option is equivalent
8257 to @option{-Wvla-larger-than=}@samp{SIZE_MAX} or larger.
8258
8259 @item -Wvolatile-register-var
8260 @opindex Wvolatile-register-var
8261 @opindex Wno-volatile-register-var
8262 Warn if a register variable is declared volatile.  The volatile
8263 modifier does not inhibit all optimizations that may eliminate reads
8264 and/or writes to register variables.  This warning is enabled by
8265 @option{-Wall}.
8266
8267 @item -Wdisabled-optimization
8268 @opindex Wdisabled-optimization
8269 @opindex Wno-disabled-optimization
8270 Warn if a requested optimization pass is disabled.  This warning does
8271 not generally indicate that there is anything wrong with your code; it
8272 merely indicates that GCC's optimizers are unable to handle the code
8273 effectively.  Often, the problem is that your code is too big or too
8274 complex; GCC refuses to optimize programs when the optimization
8275 itself is likely to take inordinate amounts of time.
8276
8277 @item -Wpointer-sign @r{(C and Objective-C only)}
8278 @opindex Wpointer-sign
8279 @opindex Wno-pointer-sign
8280 Warn for pointer argument passing or assignment with different signedness.
8281 This option is only supported for C and Objective-C@.  It is implied by
8282 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
8283 @option{-Wno-pointer-sign}.
8284
8285 @item -Wstack-protector
8286 @opindex Wstack-protector
8287 @opindex Wno-stack-protector
8288 This option is only active when @option{-fstack-protector} is active.  It
8289 warns about functions that are not protected against stack smashing.
8290
8291 @item -Woverlength-strings
8292 @opindex Woverlength-strings
8293 @opindex Wno-overlength-strings
8294 Warn about string constants that are longer than the ``minimum
8295 maximum'' length specified in the C standard.  Modern compilers
8296 generally allow string constants that are much longer than the
8297 standard's minimum limit, but very portable programs should avoid
8298 using longer strings.
8299
8300 The limit applies @emph{after} string constant concatenation, and does
8301 not count the trailing NUL@.  In C90, the limit was 509 characters; in
8302 C99, it was raised to 4095.  C++98 does not specify a normative
8303 minimum maximum, so we do not diagnose overlength strings in C++@.
8304
8305 This option is implied by @option{-Wpedantic}, and can be disabled with
8306 @option{-Wno-overlength-strings}.
8307
8308 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
8309 @opindex Wunsuffixed-float-constants
8310 @opindex Wno-unsuffixed-float-constants
8311
8312 Issue a warning for any floating constant that does not have
8313 a suffix.  When used together with @option{-Wsystem-headers} it
8314 warns about such constants in system header files.  This can be useful
8315 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
8316 from the decimal floating-point extension to C99.
8317
8318 @item -Wno-designated-init @r{(C and Objective-C only)}
8319 Suppress warnings when a positional initializer is used to initialize
8320 a structure that has been marked with the @code{designated_init}
8321 attribute.
8322
8323 @item -Whsa
8324 Issue a warning when HSAIL cannot be emitted for the compiled function or
8325 OpenMP construct.
8326
8327 @end table
8328
8329 @node Static Analyzer Options
8330 @section Options That Control Static Analysis
8331
8332 @table @gcctabopt
8333 @item -fanalyzer
8334 @opindex analyzer
8335 @opindex fanalyzer
8336 @opindex fno-analyzer
8337 This option enables an static analysis of program flow which looks
8338 for ``interesting'' interprocedural paths through the
8339 code, and issues warnings for problems found on them.
8340
8341 This analysis is much more expensive than other GCC warnings.
8342
8343 Enabling this option effectively enables the following warnings:
8344
8345 @gccoptlist{ @gol
8346 -Wanalyzer-double-fclose @gol
8347 -Wanalyzer-double-free @gol
8348 -Wanalyzer-exposure-through-output-file @gol
8349 -Wanalyzer-file-leak @gol
8350 -Wanalyzer-free-of-non-heap @gol
8351 -Wanalyzer-malloc-leak @gol
8352 -Wanalyzer-possible-null-argument @gol
8353 -Wanalyzer-possible-null-dereference @gol
8354 -Wanalyzer-null-argument @gol
8355 -Wanalyzer-null-dereference @gol
8356 -Wanalyzer-tainted-array-index @gol
8357 -Wanalyzer-unsafe-call-within-signal-handler @gol
8358 -Wanalyzer-use-after-free @gol
8359 -Wanalyzer-use-of-uninitialized-value @gol
8360 -Wanalyzer-use-of-pointer-in-stale-stack-frame @gol
8361 }
8362
8363 This option is only available if GCC was configured with analyzer
8364 support enabled.
8365
8366 @item -Wanalyzer-too-complex
8367 @opindex Wanalyzer-too-complex
8368 @opindex Wno-analyzer-too-complex
8369 If @option{-fanalyzer} is enabled, the analyzer uses various heuristics
8370 to attempt to explore the control flow and data flow in the program,
8371 but these can be defeated by sufficiently complicated code.
8372
8373 By default, the analysis will silently stop if the code is too
8374 complicated for the analyzer to fully explore and it reaches an internal
8375 limit.
8376
8377 The @option{-Wanalyzer-too-complex} option will warn if this occurs.
8378
8379 @end table
8380
8381 Pertinent parameters for controlling the exploration are:
8382 @option{--param analyzer-bb-explosion-factor=@var{value}},
8383 @option{--param analyzer-max-enodes-per-program-point=@var{value}},
8384 @option{--param analyzer-max-recursion-depth=@var{value}}, and
8385 @option{--param analyzer-min-snodes-for-call-summary=@var{value}}.
8386
8387 The following options control the analyzer.
8388
8389 @table @gcctabopt
8390
8391 @item -fanalyzer-call-summaries
8392 @opindex fanalyzer-call-summaries
8393 @opindex fno-analyzer-call-summaries
8394 Simplify interprocedural analysis by computing the effect of certain calls,
8395 rather than exploring all paths through the function from callsite to each
8396 possible return.
8397
8398 If enabled, call summaries are only used for functions with more than one
8399 call site, and that are sufficiently complicated (as per
8400 @option{--param analyzer-min-snodes-for-call-summary=@var{value}}).
8401
8402 @item -fanalyzer-checker=@var{name}
8403 @opindex fanalyzer-checker
8404 Restrict the analyzer to run just the named checker.
8405
8406 @item -fanalyzer-fine-grained
8407 @opindex fanalyzer-fine-grained
8408 @opindex fno-analyzer-fine-grained
8409 This option is intended for analyzer developers.
8410
8411 Internally the analyzer builds an ``exploded graph'' that combines
8412 control flow graphs with data flow information.
8413
8414 By default, an edge in this graph can contain the effects of a run
8415 of multiple statements within a basic block.  With
8416 @option{-fanalyzer-fine-grained}, each statement gets its own edge.
8417
8418 @item -fno-analyzer-state-merge
8419 @opindex fanalyzer-state-merge
8420 @opindex fno-analyzer-state-merge
8421 This option is intended for analyzer developers.
8422
8423 By default the analyzer will attempt to simplify analysis by merging
8424 sufficiently similar states at each program point as it builds its
8425 ``exploded graph''.  With @option{-fno-analyzer-state-merge} this
8426 merging can be suppressed, for debugging state-handling issues.
8427
8428 @item -fno-analyzer-state-purge
8429 @opindex fanalyzer-state-purge
8430 @opindex fno-analyzer-state-purge
8431 This option is intended for analyzer developers.
8432
8433 By default the analyzer will attempt to simplify analysis by purging
8434 aspects of state at a program point that appear to no longer be relevant
8435 e.g. the values of locals that aren't accessed later in the function
8436 and which aren't relevant to leak analysis.
8437
8438 With @option{-fno-analyzer-state-purge} this purging of state can
8439 be suppressed, for debugging state-handling issues.
8440
8441 @item -fanalyzer-transitivity
8442 @opindex fanalyzer-transitivity
8443 @opindex fno-analyzer-transitivity
8444 This option enables transitivity of constraints within the analyzer.
8445
8446 @item -fanalyzer-verbose-edges
8447 This option is intended for analyzer developers.  It enables more
8448 verbose, lower-level detail in the descriptions of control flow
8449 within diagnostic paths.
8450
8451 @item -fanalyzer-verbose-state-changes
8452 This option is intended for analyzer developers.  It enables more
8453 verbose, lower-level detail in the descriptions of events relating
8454 to state machines within diagnostic paths.
8455
8456 @item -fanalyzer-verbosity=@var{level}
8457 This option controls the complexity of the control flow paths that are
8458 emitted for analyzer diagnostics.
8459
8460 The @var{level} can be one of:
8461
8462 @table @samp
8463 @item 0
8464 At this level, interprocedural call and return events are displayed,
8465 along with the most pertinent state-change events relating to
8466 a diagnostic.  For example, for a double-@code{free} diagnostic,
8467 both calls to @code{free} will be shown.
8468
8469 @item 1
8470 As per the previous level, but also show events for the entry
8471 to each function.
8472
8473 @item 2
8474 As per the previous level, but also show  events relating to
8475 control flow (e.g. ``true path taken'' at a conditional).
8476
8477 This level is the default.
8478
8479 @item 3
8480 This level is intended for analyzer developers; it adds various
8481 other events intended for debugging the analyzer.
8482
8483 @end table
8484
8485 @item -fdump-analyzer
8486 @opindex fdump-analyzer
8487 Dump internal details about what the analyzer is doing to
8488 @file{@var{file}.analyzer.txt}.
8489 This option is overridden by @option{-fdump-analyzer-stderr}.
8490
8491 @item -fdump-analyzer-stderr
8492 @opindex fdump-analyzer-stderr
8493 Dump internal details about what the analyzer is doing to stderr.
8494 This option overrides @option{-fdump-analyzer}.
8495
8496 @item -fdump-analyzer-callgraph
8497 @opindex fdump-analyzer-callgraph
8498 Dump a representation of the call graph suitable for viewing with
8499 GraphViz to @file{@var{file}.callgraph.dot}.
8500
8501 @item -fdump-analyzer-exploded-graph
8502 @opindex fdump-analyzer-exploded-graph
8503 Dump a representation of the ``exploded graph'' suitable for viewing with
8504 GraphViz to @file{@var{file}.eg.dot}.
8505 Nodes are color-coded based on state-machine states to emphasize
8506 state changes.
8507
8508 @item -fdump-analyzer-exploded-nodes
8509 @opindex dump-analyzer-exploded-nodes
8510 Emit diagnostics showing where nodes in the ``exploded graph'' are
8511 in relation to the program source.
8512
8513 @item -fdump-analyzer-exploded-nodes-2
8514 @opindex dump-analyzer-exploded-nodes-2
8515 Dump a textual representation of the ``exploded graph'' to
8516 @file{@var{file}.eg.txt}.
8517
8518 @item -fdump-analyzer-exploded-nodes-3
8519 @opindex dump-analyzer-exploded-nodes-3
8520 Dump a textual representation of the ``exploded graph'' to
8521 one dump file per node, to @file{@var{file}.eg-@var{id}.txt}.
8522 This is typically a large number of dump files.
8523
8524 @item -fdump-analyzer-state-purge
8525 @opindex fdump-analyzer-state-purge
8526 As per @option{-fdump-analyzer-supergraph}, dump a representation of the
8527 ``supergraph'' suitable for viewing with GraphViz, but annotate the
8528 graph with information on what state will be purged at each node.
8529 The graph is written to @file{@var{file}.state-purge.dot}.
8530
8531 @item -fdump-analyzer-supergraph
8532 @opindex fdump-analyzer-supergraph
8533 Dump a representation of the ``supergraph'' suitable for viewing with
8534 GraphViz to @file{@var{file}.supergraph.dot}.  This shows all of the
8535 control flow graphs in the program, with interprocedural edges for
8536 calls and returns.
8537
8538 @end table
8539
8540 @node Debugging Options
8541 @section Options for Debugging Your Program
8542 @cindex options, debugging
8543 @cindex debugging information options
8544
8545 To tell GCC to emit extra information for use by a debugger, in almost 
8546 all cases you need only to add @option{-g} to your other options.
8547
8548 GCC allows you to use @option{-g} with
8549 @option{-O}.  The shortcuts taken by optimized code may occasionally
8550 be surprising: some variables you declared may not exist
8551 at all; flow of control may briefly move where you did not expect it;
8552 some statements may not be executed because they compute constant
8553 results or their values are already at hand; some statements may
8554 execute in different places because they have been moved out of loops.
8555 Nevertheless it is possible to debug optimized output.  This makes
8556 it reasonable to use the optimizer for programs that might have bugs.
8557
8558 If you are not using some other optimization option, consider
8559 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
8560 With no @option{-O} option at all, some compiler passes that collect
8561 information useful for debugging do not run at all, so that
8562 @option{-Og} may result in a better debugging experience.
8563
8564 @table @gcctabopt
8565 @item -g
8566 @opindex g
8567 Produce debugging information in the operating system's native format
8568 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
8569 information.
8570
8571 On most systems that use stabs format, @option{-g} enables use of extra
8572 debugging information that only GDB can use; this extra information
8573 makes debugging work better in GDB but probably makes other debuggers
8574 crash or
8575 refuse to read the program.  If you want to control for certain whether
8576 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
8577 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
8578
8579 @item -ggdb
8580 @opindex ggdb
8581 Produce debugging information for use by GDB@.  This means to use the
8582 most expressive format available (DWARF, stabs, or the native format
8583 if neither of those are supported), including GDB extensions if at all
8584 possible.
8585
8586 @item -gdwarf
8587 @itemx -gdwarf-@var{version}
8588 @opindex gdwarf
8589 Produce debugging information in DWARF format (if that is supported).
8590 The value of @var{version} may be either 2, 3, 4 or 5; the default version
8591 for most targets is 4.  DWARF Version 5 is only experimental.
8592
8593 Note that with DWARF Version 2, some ports require and always
8594 use some non-conflicting DWARF 3 extensions in the unwind tables.
8595
8596 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
8597 for maximum benefit.
8598
8599 GCC no longer supports DWARF Version 1, which is substantially
8600 different than Version 2 and later.  For historical reasons, some
8601 other DWARF-related options such as
8602 @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
8603 in their names, but apply to all currently-supported versions of DWARF.
8604
8605 @item -gstabs
8606 @opindex gstabs
8607 Produce debugging information in stabs format (if that is supported),
8608 without GDB extensions.  This is the format used by DBX on most BSD
8609 systems.  On MIPS, Alpha and System V Release 4 systems this option
8610 produces stabs debugging output that is not understood by DBX@.
8611 On System V Release 4 systems this option requires the GNU assembler.
8612
8613 @item -gstabs+
8614 @opindex gstabs+
8615 Produce debugging information in stabs format (if that is supported),
8616 using GNU extensions understood only by the GNU debugger (GDB)@.  The
8617 use of these extensions is likely to make other debuggers crash or
8618 refuse to read the program.
8619
8620 @item -gxcoff
8621 @opindex gxcoff
8622 Produce debugging information in XCOFF format (if that is supported).
8623 This is the format used by the DBX debugger on IBM RS/6000 systems.
8624
8625 @item -gxcoff+
8626 @opindex gxcoff+
8627 Produce debugging information in XCOFF format (if that is supported),
8628 using GNU extensions understood only by the GNU debugger (GDB)@.  The
8629 use of these extensions is likely to make other debuggers crash or
8630 refuse to read the program, and may cause assemblers other than the GNU
8631 assembler (GAS) to fail with an error.
8632
8633 @item -gvms
8634 @opindex gvms
8635 Produce debugging information in Alpha/VMS debug format (if that is
8636 supported).  This is the format used by DEBUG on Alpha/VMS systems.
8637
8638 @item -g@var{level}
8639 @itemx -ggdb@var{level}
8640 @itemx -gstabs@var{level}
8641 @itemx -gxcoff@var{level}
8642 @itemx -gvms@var{level}
8643 Request debugging information and also use @var{level} to specify how
8644 much information.  The default level is 2.
8645
8646 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
8647 @option{-g}.
8648
8649 Level 1 produces minimal information, enough for making backtraces in
8650 parts of the program that you don't plan to debug.  This includes
8651 descriptions of functions and external variables, and line number
8652 tables, but no information about local variables.
8653
8654 Level 3 includes extra information, such as all the macro definitions
8655 present in the program.  Some debuggers support macro expansion when
8656 you use @option{-g3}.
8657
8658 If you use multiple @option{-g} options, with or without level numbers,
8659 the last such option is the one that is effective.
8660
8661 @option{-gdwarf} does not accept a concatenated debug level, to avoid
8662 confusion with @option{-gdwarf-@var{level}}.
8663 Instead use an additional @option{-g@var{level}} option to change the
8664 debug level for DWARF.
8665
8666 @item -fno-eliminate-unused-debug-symbols
8667 @opindex feliminate-unused-debug-symbols
8668 @opindex fno-eliminate-unused-debug-symbols
8669 By default, no debug information is produced for symbols that are not actually
8670 used. Use this option if you want debug information for all symbols.
8671
8672 @item -femit-class-debug-always
8673 @opindex femit-class-debug-always
8674 Instead of emitting debugging information for a C++ class in only one
8675 object file, emit it in all object files using the class.  This option
8676 should be used only with debuggers that are unable to handle the way GCC
8677 normally emits debugging information for classes because using this
8678 option increases the size of debugging information by as much as a
8679 factor of two.
8680
8681 @item -fno-merge-debug-strings
8682 @opindex fmerge-debug-strings
8683 @opindex fno-merge-debug-strings
8684 Direct the linker to not merge together strings in the debugging
8685 information that are identical in different object files.  Merging is
8686 not supported by all assemblers or linkers.  Merging decreases the size
8687 of the debug information in the output file at the cost of increasing
8688 link processing time.  Merging is enabled by default.
8689
8690 @item -fdebug-prefix-map=@var{old}=@var{new}
8691 @opindex fdebug-prefix-map
8692 When compiling files residing in directory @file{@var{old}}, record
8693 debugging information describing them as if the files resided in
8694 directory @file{@var{new}} instead.  This can be used to replace a
8695 build-time path with an install-time path in the debug info.  It can
8696 also be used to change an absolute path to a relative path by using
8697 @file{.} for @var{new}.  This can give more reproducible builds, which
8698 are location independent, but may require an extra command to tell GDB
8699 where to find the source files. See also @option{-ffile-prefix-map}.
8700
8701 @item -fvar-tracking
8702 @opindex fvar-tracking
8703 Run variable tracking pass.  It computes where variables are stored at each
8704 position in code.  Better debugging information is then generated
8705 (if the debugging information format supports this information).
8706
8707 It is enabled by default when compiling with optimization (@option{-Os},
8708 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
8709 the debug info format supports it.
8710
8711 @item -fvar-tracking-assignments
8712 @opindex fvar-tracking-assignments
8713 @opindex fno-var-tracking-assignments
8714 Annotate assignments to user variables early in the compilation and
8715 attempt to carry the annotations over throughout the compilation all the
8716 way to the end, in an attempt to improve debug information while
8717 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
8718
8719 It can be enabled even if var-tracking is disabled, in which case
8720 annotations are created and maintained, but discarded at the end.
8721 By default, this flag is enabled together with @option{-fvar-tracking},
8722 except when selective scheduling is enabled.
8723
8724 @item -gsplit-dwarf
8725 @opindex gsplit-dwarf
8726 Separate as much DWARF debugging information as possible into a
8727 separate output file with the extension @file{.dwo}.  This option allows
8728 the build system to avoid linking files with debug information.  To
8729 be useful, this option requires a debugger capable of reading @file{.dwo}
8730 files.
8731
8732 @item -gdescribe-dies
8733 @opindex gdescribe-dies
8734 Add description attributes to some DWARF DIEs that have no name attribute,
8735 such as artificial variables, external references and call site
8736 parameter DIEs.
8737
8738 @item -gpubnames
8739 @opindex gpubnames
8740 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
8741
8742 @item -ggnu-pubnames
8743 @opindex ggnu-pubnames
8744 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
8745 suitable for conversion into a GDB@ index.  This option is only useful
8746 with a linker that can produce GDB@ index version 7.
8747
8748 @item -fdebug-types-section
8749 @opindex fdebug-types-section
8750 @opindex fno-debug-types-section
8751 When using DWARF Version 4 or higher, type DIEs can be put into
8752 their own @code{.debug_types} section instead of making them part of the
8753 @code{.debug_info} section.  It is more efficient to put them in a separate
8754 comdat section since the linker can then remove duplicates.
8755 But not all DWARF consumers support @code{.debug_types} sections yet
8756 and on some objects @code{.debug_types} produces larger instead of smaller
8757 debugging information.
8758
8759 @item -grecord-gcc-switches
8760 @itemx -gno-record-gcc-switches
8761 @opindex grecord-gcc-switches
8762 @opindex gno-record-gcc-switches
8763 This switch causes the command-line options used to invoke the
8764 compiler that may affect code generation to be appended to the
8765 DW_AT_producer attribute in DWARF debugging information.  The options
8766 are concatenated with spaces separating them from each other and from
8767 the compiler version.  
8768 It is enabled by default.
8769 See also @option{-frecord-gcc-switches} for another
8770 way of storing compiler options into the object file.  
8771
8772 @item -gstrict-dwarf
8773 @opindex gstrict-dwarf
8774 Disallow using extensions of later DWARF standard version than selected
8775 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
8776 DWARF extensions from later standard versions is allowed.
8777
8778 @item -gno-strict-dwarf
8779 @opindex gno-strict-dwarf
8780 Allow using extensions of later DWARF standard version than selected with
8781 @option{-gdwarf-@var{version}}.
8782
8783 @item -gas-loc-support
8784 @opindex gas-loc-support
8785 Inform the compiler that the assembler supports @code{.loc} directives.
8786 It may then use them for the assembler to generate DWARF2+ line number
8787 tables.
8788
8789 This is generally desirable, because assembler-generated line-number
8790 tables are a lot more compact than those the compiler can generate
8791 itself.
8792
8793 This option will be enabled by default if, at GCC configure time, the
8794 assembler was found to support such directives.
8795
8796 @item -gno-as-loc-support
8797 @opindex gno-as-loc-support
8798 Force GCC to generate DWARF2+ line number tables internally, if DWARF2+
8799 line number tables are to be generated.
8800
8801 @item -gas-locview-support
8802 @opindex gas-locview-support
8803 Inform the compiler that the assembler supports @code{view} assignment
8804 and reset assertion checking in @code{.loc} directives.
8805
8806 This option will be enabled by default if, at GCC configure time, the
8807 assembler was found to support them.
8808
8809 @item -gno-as-locview-support
8810 Force GCC to assign view numbers internally, if
8811 @option{-gvariable-location-views} are explicitly requested.
8812
8813 @item -gcolumn-info
8814 @itemx -gno-column-info
8815 @opindex gcolumn-info
8816 @opindex gno-column-info
8817 Emit location column information into DWARF debugging information, rather
8818 than just file and line.
8819 This option is enabled by default.
8820
8821 @item -gstatement-frontiers
8822 @itemx -gno-statement-frontiers
8823 @opindex gstatement-frontiers
8824 @opindex gno-statement-frontiers
8825 This option causes GCC to create markers in the internal representation
8826 at the beginning of statements, and to keep them roughly in place
8827 throughout compilation, using them to guide the output of @code{is_stmt}
8828 markers in the line number table.  This is enabled by default when
8829 compiling with optimization (@option{-Os}, @option{-O}, @option{-O2},
8830 @dots{}), and outputting DWARF 2 debug information at the normal level.
8831
8832 @item -gvariable-location-views
8833 @itemx -gvariable-location-views=incompat5
8834 @itemx -gno-variable-location-views
8835 @opindex gvariable-location-views
8836 @opindex gvariable-location-views=incompat5
8837 @opindex gno-variable-location-views
8838 Augment variable location lists with progressive view numbers implied
8839 from the line number table.  This enables debug information consumers to
8840 inspect state at certain points of the program, even if no instructions
8841 associated with the corresponding source locations are present at that
8842 point.  If the assembler lacks support for view numbers in line number
8843 tables, this will cause the compiler to emit the line number table,
8844 which generally makes them somewhat less compact.  The augmented line
8845 number tables and location lists are fully backward-compatible, so they
8846 can be consumed by debug information consumers that are not aware of
8847 these augmentations, but they won't derive any benefit from them either.
8848
8849 This is enabled by default when outputting DWARF 2 debug information at
8850 the normal level, as long as there is assembler support,
8851 @option{-fvar-tracking-assignments} is enabled and
8852 @option{-gstrict-dwarf} is not.  When assembler support is not
8853 available, this may still be enabled, but it will force GCC to output
8854 internal line number tables, and if
8855 @option{-ginternal-reset-location-views} is not enabled, that will most
8856 certainly lead to silently mismatching location views.
8857
8858 There is a proposed representation for view numbers that is not backward
8859 compatible with the location list format introduced in DWARF 5, that can
8860 be enabled with @option{-gvariable-location-views=incompat5}.  This
8861 option may be removed in the future, is only provided as a reference
8862 implementation of the proposed representation.  Debug information
8863 consumers are not expected to support this extended format, and they
8864 would be rendered unable to decode location lists using it.
8865
8866 @item -ginternal-reset-location-views
8867 @itemx -gno-internal-reset-location-views
8868 @opindex ginternal-reset-location-views
8869 @opindex gno-internal-reset-location-views
8870 Attempt to determine location views that can be omitted from location
8871 view lists.  This requires the compiler to have very accurate insn
8872 length estimates, which isn't always the case, and it may cause
8873 incorrect view lists to be generated silently when using an assembler
8874 that does not support location view lists.  The GNU assembler will flag
8875 any such error as a @code{view number mismatch}.  This is only enabled
8876 on ports that define a reliable estimation function.
8877
8878 @item -ginline-points
8879 @itemx -gno-inline-points
8880 @opindex ginline-points
8881 @opindex gno-inline-points
8882 Generate extended debug information for inlined functions.  Location
8883 view tracking markers are inserted at inlined entry points, so that
8884 address and view numbers can be computed and output in debug
8885 information.  This can be enabled independently of location views, in
8886 which case the view numbers won't be output, but it can only be enabled
8887 along with statement frontiers, and it is only enabled by default if
8888 location views are enabled.
8889
8890 @item -gz@r{[}=@var{type}@r{]}
8891 @opindex gz
8892 Produce compressed debug sections in DWARF format, if that is supported.
8893 If @var{type} is not given, the default type depends on the capabilities
8894 of the assembler and linker used.  @var{type} may be one of
8895 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
8896 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
8897 compression in traditional GNU format).  If the linker doesn't support
8898 writing compressed debug sections, the option is rejected.  Otherwise,
8899 if the assembler does not support them, @option{-gz} is silently ignored
8900 when producing object files.
8901
8902 @item -femit-struct-debug-baseonly
8903 @opindex femit-struct-debug-baseonly
8904 Emit debug information for struct-like types
8905 only when the base name of the compilation source file
8906 matches the base name of file in which the struct is defined.
8907
8908 This option substantially reduces the size of debugging information,
8909 but at significant potential loss in type information to the debugger.
8910 See @option{-femit-struct-debug-reduced} for a less aggressive option.
8911 See @option{-femit-struct-debug-detailed} for more detailed control.
8912
8913 This option works only with DWARF debug output.
8914
8915 @item -femit-struct-debug-reduced
8916 @opindex femit-struct-debug-reduced
8917 Emit debug information for struct-like types
8918 only when the base name of the compilation source file
8919 matches the base name of file in which the type is defined,
8920 unless the struct is a template or defined in a system header.
8921
8922 This option significantly reduces the size of debugging information,
8923 with some potential loss in type information to the debugger.
8924 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
8925 See @option{-femit-struct-debug-detailed} for more detailed control.
8926
8927 This option works only with DWARF debug output.
8928
8929 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
8930 @opindex femit-struct-debug-detailed
8931 Specify the struct-like types
8932 for which the compiler generates debug information.
8933 The intent is to reduce duplicate struct debug information
8934 between different object files within the same program.
8935
8936 This option is a detailed version of
8937 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
8938 which serves for most needs.
8939
8940 A specification has the syntax@*
8941 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
8942
8943 The optional first word limits the specification to
8944 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
8945 A struct type is used directly when it is the type of a variable, member.
8946 Indirect uses arise through pointers to structs.
8947 That is, when use of an incomplete struct is valid, the use is indirect.
8948 An example is
8949 @samp{struct one direct; struct two * indirect;}.
8950
8951 The optional second word limits the specification to
8952 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
8953 Generic structs are a bit complicated to explain.
8954 For C++, these are non-explicit specializations of template classes,
8955 or non-template classes within the above.
8956 Other programming languages have generics,
8957 but @option{-femit-struct-debug-detailed} does not yet implement them.
8958
8959 The third word specifies the source files for those
8960 structs for which the compiler should emit debug information.
8961 The values @samp{none} and @samp{any} have the normal meaning.
8962 The value @samp{base} means that
8963 the base of name of the file in which the type declaration appears
8964 must match the base of the name of the main compilation file.
8965 In practice, this means that when compiling @file{foo.c}, debug information
8966 is generated for types declared in that file and @file{foo.h},
8967 but not other header files.
8968 The value @samp{sys} means those types satisfying @samp{base}
8969 or declared in system or compiler headers.
8970
8971 You may need to experiment to determine the best settings for your application.
8972
8973 The default is @option{-femit-struct-debug-detailed=all}.
8974
8975 This option works only with DWARF debug output.
8976
8977 @item -fno-dwarf2-cfi-asm
8978 @opindex fdwarf2-cfi-asm
8979 @opindex fno-dwarf2-cfi-asm
8980 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
8981 instead of using GAS @code{.cfi_*} directives.
8982
8983 @item -fno-eliminate-unused-debug-types
8984 @opindex feliminate-unused-debug-types
8985 @opindex fno-eliminate-unused-debug-types
8986 Normally, when producing DWARF output, GCC avoids producing debug symbol 
8987 output for types that are nowhere used in the source file being compiled.
8988 Sometimes it is useful to have GCC emit debugging
8989 information for all types declared in a compilation
8990 unit, regardless of whether or not they are actually used
8991 in that compilation unit, for example 
8992 if, in the debugger, you want to cast a value to a type that is
8993 not actually used in your program (but is declared).  More often,
8994 however, this results in a significant amount of wasted space.
8995 @end table
8996
8997 @node Optimize Options
8998 @section Options That Control Optimization
8999 @cindex optimize options
9000 @cindex options, optimization
9001
9002 These options control various sorts of optimizations.
9003
9004 Without any optimization option, the compiler's goal is to reduce the
9005 cost of compilation and to make debugging produce the expected
9006 results.  Statements are independent: if you stop the program with a
9007 breakpoint between statements, you can then assign a new value to any
9008 variable or change the program counter to any other statement in the
9009 function and get exactly the results you expect from the source
9010 code.
9011
9012 Turning on optimization flags makes the compiler attempt to improve
9013 the performance and/or code size at the expense of compilation time
9014 and possibly the ability to debug the program.
9015
9016 The compiler performs optimization based on the knowledge it has of the
9017 program.  Compiling multiple files at once to a single output file mode allows
9018 the compiler to use information gained from all of the files when compiling
9019 each of them.
9020
9021 Not all optimizations are controlled directly by a flag.  Only
9022 optimizations that have a flag are listed in this section.
9023
9024 Most optimizations are completely disabled at @option{-O0} or if an
9025 @option{-O} level is not set on the command line, even if individual
9026 optimization flags are specified.  Similarly, @option{-Og} suppresses
9027 many optimization passes.
9028
9029 Depending on the target and how GCC was configured, a slightly different
9030 set of optimizations may be enabled at each @option{-O} level than
9031 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
9032 to find out the exact set of optimizations that are enabled at each level.
9033 @xref{Overall Options}, for examples.
9034
9035 @table @gcctabopt
9036 @item -O
9037 @itemx -O1
9038 @opindex O
9039 @opindex O1
9040 Optimize.  Optimizing compilation takes somewhat more time, and a lot
9041 more memory for a large function.
9042
9043 With @option{-O}, the compiler tries to reduce code size and execution
9044 time, without performing any optimizations that take a great deal of
9045 compilation time.
9046
9047 @c Note that in addition to the default_options_table list in opts.c,
9048 @c several optimization flags default to true but control optimization
9049 @c passes that are explicitly disabled at -O0.
9050
9051 @option{-O} turns on the following optimization flags:
9052
9053 @c Please keep the following list alphabetized.
9054 @gccoptlist{-fauto-inc-dec @gol
9055 -fbranch-count-reg @gol
9056 -fcombine-stack-adjustments @gol
9057 -fcompare-elim @gol
9058 -fcprop-registers @gol
9059 -fdce @gol
9060 -fdefer-pop @gol
9061 -fdelayed-branch @gol
9062 -fdse @gol
9063 -fforward-propagate @gol
9064 -fguess-branch-probability @gol
9065 -fif-conversion @gol
9066 -fif-conversion2 @gol
9067 -finline-functions-called-once @gol
9068 -fipa-profile @gol
9069 -fipa-pure-const @gol
9070 -fipa-reference @gol
9071 -fipa-reference-addressable @gol
9072 -fmerge-constants @gol
9073 -fmove-loop-invariants @gol
9074 -fomit-frame-pointer @gol
9075 -freorder-blocks @gol
9076 -fshrink-wrap @gol
9077 -fshrink-wrap-separate @gol
9078 -fsplit-wide-types @gol
9079 -fssa-backprop @gol
9080 -fssa-phiopt @gol
9081 -ftree-bit-ccp @gol
9082 -ftree-ccp @gol
9083 -ftree-ch @gol
9084 -ftree-coalesce-vars @gol
9085 -ftree-copy-prop @gol
9086 -ftree-dce @gol
9087 -ftree-dominator-opts @gol
9088 -ftree-dse @gol
9089 -ftree-forwprop @gol
9090 -ftree-fre @gol
9091 -ftree-phiprop @gol
9092 -ftree-pta @gol
9093 -ftree-scev-cprop @gol
9094 -ftree-sink @gol
9095 -ftree-slsr @gol
9096 -ftree-sra @gol
9097 -ftree-ter @gol
9098 -funit-at-a-time}
9099
9100 @item -O2
9101 @opindex O2
9102 Optimize even more.  GCC performs nearly all supported optimizations
9103 that do not involve a space-speed tradeoff.
9104 As compared to @option{-O}, this option increases both compilation time
9105 and the performance of the generated code.
9106
9107 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
9108 also turns on the following optimization flags:
9109
9110 @c Please keep the following list alphabetized!
9111 @gccoptlist{-falign-functions  -falign-jumps @gol
9112 -falign-labels  -falign-loops @gol
9113 -fcaller-saves @gol
9114 -fcode-hoisting @gol
9115 -fcrossjumping @gol
9116 -fcse-follow-jumps  -fcse-skip-blocks @gol
9117 -fdelete-null-pointer-checks @gol
9118 -fdevirtualize  -fdevirtualize-speculatively @gol
9119 -fexpensive-optimizations @gol
9120 -ffinite-loops @gol
9121 -fgcse  -fgcse-lm  @gol
9122 -fhoist-adjacent-loads @gol
9123 -finline-functions @gol
9124 -finline-small-functions @gol
9125 -findirect-inlining @gol
9126 -fipa-bit-cp  -fipa-cp  -fipa-icf @gol
9127 -fipa-ra  -fipa-sra  -fipa-vrp @gol
9128 -fisolate-erroneous-paths-dereference @gol
9129 -flra-remat @gol
9130 -foptimize-sibling-calls @gol
9131 -foptimize-strlen @gol
9132 -fpartial-inlining @gol
9133 -fpeephole2 @gol
9134 -freorder-blocks-algorithm=stc @gol
9135 -freorder-blocks-and-partition  -freorder-functions @gol
9136 -frerun-cse-after-loop  @gol
9137 -fschedule-insns  -fschedule-insns2 @gol
9138 -fsched-interblock  -fsched-spec @gol
9139 -fstore-merging @gol
9140 -fstrict-aliasing @gol
9141 -fthread-jumps @gol
9142 -ftree-builtin-call-dce @gol
9143 -ftree-pre @gol
9144 -ftree-switch-conversion  -ftree-tail-merge @gol
9145 -ftree-vrp}
9146
9147 Please note the warning under @option{-fgcse} about
9148 invoking @option{-O2} on programs that use computed gotos.
9149
9150 @item -O3
9151 @opindex O3
9152 Optimize yet more.  @option{-O3} turns on all optimizations specified
9153 by @option{-O2} and also turns on the following optimization flags:
9154
9155 @c Please keep the following list alphabetized!
9156 @gccoptlist{-fgcse-after-reload @gol
9157 -fipa-cp-clone
9158 -floop-interchange @gol
9159 -floop-unroll-and-jam @gol
9160 -fpeel-loops @gol
9161 -fpredictive-commoning @gol
9162 -fsplit-paths @gol
9163 -ftree-loop-distribute-patterns @gol
9164 -ftree-loop-distribution @gol
9165 -ftree-loop-vectorize @gol
9166 -ftree-partial-pre @gol
9167 -ftree-slp-vectorize @gol
9168 -funswitch-loops @gol
9169 -fvect-cost-model @gol
9170 -fversion-loops-for-strides}
9171
9172 @item -O0
9173 @opindex O0
9174 Reduce compilation time and make debugging produce the expected
9175 results.  This is the default.
9176
9177 @item -Os
9178 @opindex Os
9179 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations 
9180 except those that often increase code size:
9181
9182 @gccoptlist{-falign-functions  -falign-jumps @gol
9183 -falign-labels  -falign-loops @gol
9184 -fprefetch-loop-arrays  -freorder-blocks-algorithm=stc}
9185
9186 It also enables @option{-finline-functions}, causes the compiler to tune for
9187 code size rather than execution speed, and performs further optimizations
9188 designed to reduce code size.
9189
9190 @item -Ofast
9191 @opindex Ofast
9192 Disregard strict standards compliance.  @option{-Ofast} enables all
9193 @option{-O3} optimizations.  It also enables optimizations that are not
9194 valid for all standard-compliant programs.
9195 It turns on @option{-ffast-math}, @option{-fallow-store-data-races}
9196 and the Fortran-specific @option{-fstack-arrays}, unless
9197 @option{-fmax-stack-var-size} is specified, and @option{-fno-protect-parens}.
9198
9199 @item -Og
9200 @opindex Og
9201 Optimize debugging experience.  @option{-Og} should be the optimization
9202 level of choice for the standard edit-compile-debug cycle, offering
9203 a reasonable level of optimization while maintaining fast compilation
9204 and a good debugging experience.  It is a better choice than @option{-O0}
9205 for producing debuggable code because some compiler passes
9206 that collect debug information are disabled at @option{-O0}.
9207
9208 Like @option{-O0}, @option{-Og} completely disables a number of 
9209 optimization passes so that individual options controlling them have
9210 no effect.  Otherwise @option{-Og} enables all @option{-O1} 
9211 optimization flags except for those that may interfere with debugging:
9212
9213 @gccoptlist{-fbranch-count-reg  -fdelayed-branch @gol
9214 -fdse  -fif-conversion  -fif-conversion2  @gol
9215 -finline-functions-called-once @gol
9216 -fmove-loop-invariants  -fssa-phiopt @gol
9217 -ftree-bit-ccp  -ftree-dse  -ftree-pta  -ftree-sra}
9218
9219 @end table
9220
9221 If you use multiple @option{-O} options, with or without level numbers,
9222 the last such option is the one that is effective.
9223
9224 Options of the form @option{-f@var{flag}} specify machine-independent
9225 flags.  Most flags have both positive and negative forms; the negative
9226 form of @option{-ffoo} is @option{-fno-foo}.  In the table
9227 below, only one of the forms is listed---the one you typically 
9228 use.  You can figure out the other form by either removing @samp{no-}
9229 or adding it.
9230
9231 The following options control specific optimizations.  They are either
9232 activated by @option{-O} options or are related to ones that are.  You
9233 can use the following flags in the rare cases when ``fine-tuning'' of
9234 optimizations to be performed is desired.
9235
9236 @table @gcctabopt
9237 @item -fno-defer-pop
9238 @opindex fno-defer-pop
9239 @opindex fdefer-pop
9240 For machines that must pop arguments after a function call, always pop 
9241 the arguments as soon as each function returns.  
9242 At levels @option{-O1} and higher, @option{-fdefer-pop} is the default;
9243 this allows the compiler to let arguments accumulate on the stack for several
9244 function calls and pop them all at once.
9245
9246 @item -fforward-propagate
9247 @opindex fforward-propagate
9248 Perform a forward propagation pass on RTL@.  The pass tries to combine two
9249 instructions and checks if the result can be simplified.  If loop unrolling
9250 is active, two passes are performed and the second is scheduled after
9251 loop unrolling.
9252
9253 This option is enabled by default at optimization levels @option{-O},
9254 @option{-O2}, @option{-O3}, @option{-Os}.
9255
9256 @item -ffp-contract=@var{style}
9257 @opindex ffp-contract
9258 @option{-ffp-contract=off} disables floating-point expression contraction.
9259 @option{-ffp-contract=fast} enables floating-point expression contraction
9260 such as forming of fused multiply-add operations if the target has
9261 native support for them.
9262 @option{-ffp-contract=on} enables floating-point expression contraction
9263 if allowed by the language standard.  This is currently not implemented
9264 and treated equal to @option{-ffp-contract=off}.
9265
9266 The default is @option{-ffp-contract=fast}.
9267
9268 @item -fomit-frame-pointer
9269 @opindex fomit-frame-pointer
9270 Omit the frame pointer in functions that don't need one.  This avoids the
9271 instructions to save, set up and restore the frame pointer; on many targets
9272 it also makes an extra register available.
9273
9274 On some targets this flag has no effect because the standard calling sequence
9275 always uses a frame pointer, so it cannot be omitted.
9276
9277 Note that @option{-fno-omit-frame-pointer} doesn't guarantee the frame pointer
9278 is used in all functions.  Several targets always omit the frame pointer in
9279 leaf functions.
9280
9281 Enabled by default at @option{-O} and higher.
9282
9283 @item -foptimize-sibling-calls
9284 @opindex foptimize-sibling-calls
9285 Optimize sibling and tail recursive calls.
9286
9287 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9288
9289 @item -foptimize-strlen
9290 @opindex foptimize-strlen
9291 Optimize various standard C string functions (e.g.@: @code{strlen},
9292 @code{strchr} or @code{strcpy}) and
9293 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
9294
9295 Enabled at levels @option{-O2}, @option{-O3}.
9296
9297 @item -fno-inline
9298 @opindex fno-inline
9299 @opindex finline
9300 Do not expand any functions inline apart from those marked with
9301 the @code{always_inline} attribute.  This is the default when not
9302 optimizing.
9303
9304 Single functions can be exempted from inlining by marking them
9305 with the @code{noinline} attribute.
9306
9307 @item -finline-small-functions
9308 @opindex finline-small-functions
9309 Integrate functions into their callers when their body is smaller than expected
9310 function call code (so overall size of program gets smaller).  The compiler
9311 heuristically decides which functions are simple enough to be worth integrating
9312 in this way.  This inlining applies to all functions, even those not declared
9313 inline.
9314
9315 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9316
9317 @item -findirect-inlining
9318 @opindex findirect-inlining
9319 Inline also indirect calls that are discovered to be known at compile
9320 time thanks to previous inlining.  This option has any effect only
9321 when inlining itself is turned on by the @option{-finline-functions}
9322 or @option{-finline-small-functions} options.
9323
9324 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9325
9326 @item -finline-functions
9327 @opindex finline-functions
9328 Consider all functions for inlining, even if they are not declared inline.
9329 The compiler heuristically decides which functions are worth integrating
9330 in this way.
9331
9332 If all calls to a given function are integrated, and the function is
9333 declared @code{static}, then the function is normally not output as
9334 assembler code in its own right.
9335
9336 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.  Also enabled
9337 by @option{-fprofile-use} and @option{-fauto-profile}.
9338
9339 @item -finline-functions-called-once
9340 @opindex finline-functions-called-once
9341 Consider all @code{static} functions called once for inlining into their
9342 caller even if they are not marked @code{inline}.  If a call to a given
9343 function is integrated, then the function is not output as assembler code
9344 in its own right.
9345
9346 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os},
9347 but not @option{-Og}.
9348
9349 @item -fearly-inlining
9350 @opindex fearly-inlining
9351 Inline functions marked by @code{always_inline} and functions whose body seems
9352 smaller than the function call overhead early before doing
9353 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
9354 makes profiling significantly cheaper and usually inlining faster on programs
9355 having large chains of nested wrapper functions.
9356
9357 Enabled by default.
9358
9359 @item -fipa-sra
9360 @opindex fipa-sra
9361 Perform interprocedural scalar replacement of aggregates, removal of
9362 unused parameters and replacement of parameters passed by reference
9363 by parameters passed by value.
9364
9365 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
9366
9367 @item -finline-limit=@var{n}
9368 @opindex finline-limit
9369 By default, GCC limits the size of functions that can be inlined.  This flag
9370 allows coarse control of this limit.  @var{n} is the size of functions that
9371 can be inlined in number of pseudo instructions.
9372
9373 Inlining is actually controlled by a number of parameters, which may be
9374 specified individually by using @option{--param @var{name}=@var{value}}.
9375 The @option{-finline-limit=@var{n}} option sets some of these parameters
9376 as follows:
9377
9378 @table @gcctabopt
9379 @item max-inline-insns-single
9380 is set to @var{n}/2.
9381 @item max-inline-insns-auto
9382 is set to @var{n}/2.
9383 @end table
9384
9385 See below for a documentation of the individual
9386 parameters controlling inlining and for the defaults of these parameters.
9387
9388 @emph{Note:} there may be no value to @option{-finline-limit} that results
9389 in default behavior.
9390
9391 @emph{Note:} pseudo instruction represents, in this particular context, an
9392 abstract measurement of function's size.  In no way does it represent a count
9393 of assembly instructions and as such its exact meaning might change from one
9394 release to an another.
9395
9396 @item -fno-keep-inline-dllexport
9397 @opindex fno-keep-inline-dllexport
9398 @opindex fkeep-inline-dllexport
9399 This is a more fine-grained version of @option{-fkeep-inline-functions},
9400 which applies only to functions that are declared using the @code{dllexport}
9401 attribute or declspec.  @xref{Function Attributes,,Declaring Attributes of
9402 Functions}.
9403
9404 @item -fkeep-inline-functions
9405 @opindex fkeep-inline-functions
9406 In C, emit @code{static} functions that are declared @code{inline}
9407 into the object file, even if the function has been inlined into all
9408 of its callers.  This switch does not affect functions using the
9409 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
9410 inline functions into the object file.
9411
9412 @item -fkeep-static-functions
9413 @opindex fkeep-static-functions
9414 Emit @code{static} functions into the object file, even if the function
9415 is never used.
9416
9417 @item -fkeep-static-consts
9418 @opindex fkeep-static-consts
9419 Emit variables declared @code{static const} when optimization isn't turned
9420 on, even if the variables aren't referenced.
9421
9422 GCC enables this option by default.  If you want to force the compiler to
9423 check if a variable is referenced, regardless of whether or not
9424 optimization is turned on, use the @option{-fno-keep-static-consts} option.
9425
9426 @item -fmerge-constants
9427 @opindex fmerge-constants
9428 Attempt to merge identical constants (string constants and floating-point
9429 constants) across compilation units.
9430
9431 This option is the default for optimized compilation if the assembler and
9432 linker support it.  Use @option{-fno-merge-constants} to inhibit this
9433 behavior.
9434
9435 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9436
9437 @item -fmerge-all-constants
9438 @opindex fmerge-all-constants
9439 Attempt to merge identical constants and identical variables.
9440
9441 This option implies @option{-fmerge-constants}.  In addition to
9442 @option{-fmerge-constants} this considers e.g.@: even constant initialized
9443 arrays or initialized constant variables with integral or floating-point
9444 types.  Languages like C or C++ require each variable, including multiple
9445 instances of the same variable in recursive calls, to have distinct locations,
9446 so using this option results in non-conforming
9447 behavior.
9448
9449 @item -fmodulo-sched
9450 @opindex fmodulo-sched
9451 Perform swing modulo scheduling immediately before the first scheduling
9452 pass.  This pass looks at innermost loops and reorders their
9453 instructions by overlapping different iterations.
9454
9455 @item -fmodulo-sched-allow-regmoves
9456 @opindex fmodulo-sched-allow-regmoves
9457 Perform more aggressive SMS-based modulo scheduling with register moves
9458 allowed.  By setting this flag certain anti-dependences edges are
9459 deleted, which triggers the generation of reg-moves based on the
9460 life-range analysis.  This option is effective only with
9461 @option{-fmodulo-sched} enabled.
9462
9463 @item -fno-branch-count-reg
9464 @opindex fno-branch-count-reg
9465 @opindex fbranch-count-reg
9466 Disable the optimization pass that scans for opportunities to use 
9467 ``decrement and branch'' instructions on a count register instead of
9468 instruction sequences that decrement a register, compare it against zero, and
9469 then branch based upon the result.  This option is only meaningful on
9470 architectures that support such instructions, which include x86, PowerPC,
9471 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
9472 doesn't remove the decrement and branch instructions from the generated
9473 instruction stream introduced by other optimization passes.
9474
9475 The default is @option{-fbranch-count-reg} at @option{-O1} and higher,
9476 except for @option{-Og}.
9477
9478 @item -fno-function-cse
9479 @opindex fno-function-cse
9480 @opindex ffunction-cse
9481 Do not put function addresses in registers; make each instruction that
9482 calls a constant function contain the function's address explicitly.
9483
9484 This option results in less efficient code, but some strange hacks
9485 that alter the assembler output may be confused by the optimizations
9486 performed when this option is not used.
9487
9488 The default is @option{-ffunction-cse}
9489
9490 @item -fno-zero-initialized-in-bss
9491 @opindex fno-zero-initialized-in-bss
9492 @opindex fzero-initialized-in-bss
9493 If the target supports a BSS section, GCC by default puts variables that
9494 are initialized to zero into BSS@.  This can save space in the resulting
9495 code.
9496
9497 This option turns off this behavior because some programs explicitly
9498 rely on variables going to the data section---e.g., so that the
9499 resulting executable can find the beginning of that section and/or make
9500 assumptions based on that.
9501
9502 The default is @option{-fzero-initialized-in-bss}.
9503
9504 @item -fthread-jumps
9505 @opindex fthread-jumps
9506 Perform optimizations that check to see if a jump branches to a
9507 location where another comparison subsumed by the first is found.  If
9508 so, the first branch is redirected to either the destination of the
9509 second branch or a point immediately following it, depending on whether
9510 the condition is known to be true or false.
9511
9512 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9513
9514 @item -fsplit-wide-types
9515 @opindex fsplit-wide-types
9516 When using a type that occupies multiple registers, such as @code{long
9517 long} on a 32-bit system, split the registers apart and allocate them
9518 independently.  This normally generates better code for those types,
9519 but may make debugging more difficult.
9520
9521 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
9522 @option{-Os}.
9523
9524 @item -fsplit-wide-types-early
9525 @opindex fsplit-wide-types-early
9526 Fully split wide types early, instead of very late.
9527 This option has no effect unless @option{-fsplit-wide-types} is turned on.
9528
9529 This is the default on some targets.
9530
9531 @item -fcse-follow-jumps
9532 @opindex fcse-follow-jumps
9533 In common subexpression elimination (CSE), scan through jump instructions
9534 when the target of the jump is not reached by any other path.  For
9535 example, when CSE encounters an @code{if} statement with an
9536 @code{else} clause, CSE follows the jump when the condition
9537 tested is false.
9538
9539 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9540
9541 @item -fcse-skip-blocks
9542 @opindex fcse-skip-blocks
9543 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
9544 follow jumps that conditionally skip over blocks.  When CSE
9545 encounters a simple @code{if} statement with no else clause,
9546 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
9547 body of the @code{if}.
9548
9549 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9550
9551 @item -frerun-cse-after-loop
9552 @opindex frerun-cse-after-loop
9553 Re-run common subexpression elimination after loop optimizations are
9554 performed.
9555
9556 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9557
9558 @item -fgcse
9559 @opindex fgcse
9560 Perform a global common subexpression elimination pass.
9561 This pass also performs global constant and copy propagation.
9562
9563 @emph{Note:} When compiling a program using computed gotos, a GCC
9564 extension, you may get better run-time performance if you disable
9565 the global common subexpression elimination pass by adding
9566 @option{-fno-gcse} to the command line.
9567
9568 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9569
9570 @item -fgcse-lm
9571 @opindex fgcse-lm
9572 When @option{-fgcse-lm} is enabled, global common subexpression elimination
9573 attempts to move loads that are only killed by stores into themselves.  This
9574 allows a loop containing a load/store sequence to be changed to a load outside
9575 the loop, and a copy/store within the loop.
9576
9577 Enabled by default when @option{-fgcse} is enabled.
9578
9579 @item -fgcse-sm
9580 @opindex fgcse-sm
9581 When @option{-fgcse-sm} is enabled, a store motion pass is run after
9582 global common subexpression elimination.  This pass attempts to move
9583 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
9584 loops containing a load/store sequence can be changed to a load before
9585 the loop and a store after the loop.
9586
9587 Not enabled at any optimization level.
9588
9589 @item -fgcse-las
9590 @opindex fgcse-las
9591 When @option{-fgcse-las} is enabled, the global common subexpression
9592 elimination pass eliminates redundant loads that come after stores to the
9593 same memory location (both partial and full redundancies).
9594
9595 Not enabled at any optimization level.
9596
9597 @item -fgcse-after-reload
9598 @opindex fgcse-after-reload
9599 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
9600 pass is performed after reload.  The purpose of this pass is to clean up
9601 redundant spilling.
9602
9603 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
9604
9605 @item -faggressive-loop-optimizations
9606 @opindex faggressive-loop-optimizations
9607 This option tells the loop optimizer to use language constraints to
9608 derive bounds for the number of iterations of a loop.  This assumes that
9609 loop code does not invoke undefined behavior by for example causing signed
9610 integer overflows or out-of-bound array accesses.  The bounds for the
9611 number of iterations of a loop are used to guide loop unrolling and peeling
9612 and loop exit test optimizations.
9613 This option is enabled by default.
9614
9615 @item -funconstrained-commons
9616 @opindex funconstrained-commons
9617 This option tells the compiler that variables declared in common blocks
9618 (e.g.@: Fortran) may later be overridden with longer trailing arrays. This
9619 prevents certain optimizations that depend on knowing the array bounds.
9620
9621 @item -fcrossjumping
9622 @opindex fcrossjumping
9623 Perform cross-jumping transformation.
9624 This transformation unifies equivalent code and saves code size.  The
9625 resulting code may or may not perform better than without cross-jumping.
9626
9627 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9628
9629 @item -fauto-inc-dec
9630 @opindex fauto-inc-dec
9631 Combine increments or decrements of addresses with memory accesses.
9632 This pass is always skipped on architectures that do not have
9633 instructions to support this.  Enabled by default at @option{-O} and
9634 higher on architectures that support this.
9635
9636 @item -fdce
9637 @opindex fdce
9638 Perform dead code elimination (DCE) on RTL@.
9639 Enabled by default at @option{-O} and higher.
9640
9641 @item -fdse
9642 @opindex fdse
9643 Perform dead store elimination (DSE) on RTL@.
9644 Enabled by default at @option{-O} and higher.
9645
9646 @item -fif-conversion
9647 @opindex fif-conversion
9648 Attempt to transform conditional jumps into branch-less equivalents.  This
9649 includes use of conditional moves, min, max, set flags and abs instructions, and
9650 some tricks doable by standard arithmetics.  The use of conditional execution
9651 on chips where it is available is controlled by @option{-fif-conversion2}.
9652
9653 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}, but
9654 not with @option{-Og}.
9655
9656 @item -fif-conversion2
9657 @opindex fif-conversion2
9658 Use conditional execution (where available) to transform conditional jumps into
9659 branch-less equivalents.
9660
9661 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}, but
9662 not with @option{-Og}.
9663
9664 @item -fdeclone-ctor-dtor
9665 @opindex fdeclone-ctor-dtor
9666 The C++ ABI requires multiple entry points for constructors and
9667 destructors: one for a base subobject, one for a complete object, and
9668 one for a virtual destructor that calls operator delete afterwards.
9669 For a hierarchy with virtual bases, the base and complete variants are
9670 clones, which means two copies of the function.  With this option, the
9671 base and complete variants are changed to be thunks that call a common
9672 implementation.
9673
9674 Enabled by @option{-Os}.
9675
9676 @item -fdelete-null-pointer-checks
9677 @opindex fdelete-null-pointer-checks
9678 Assume that programs cannot safely dereference null pointers, and that
9679 no code or data element resides at address zero.
9680 This option enables simple constant
9681 folding optimizations at all optimization levels.  In addition, other
9682 optimization passes in GCC use this flag to control global dataflow
9683 analyses that eliminate useless checks for null pointers; these assume
9684 that a memory access to address zero always results in a trap, so
9685 that if a pointer is checked after it has already been dereferenced,
9686 it cannot be null.
9687
9688 Note however that in some environments this assumption is not true.
9689 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
9690 for programs that depend on that behavior.
9691
9692 This option is enabled by default on most targets.  On Nios II ELF, it
9693 defaults to off.  On AVR, CR16, and MSP430, this option is completely disabled.
9694
9695 Passes that use the dataflow information
9696 are enabled independently at different optimization levels.
9697
9698 @item -fdevirtualize
9699 @opindex fdevirtualize
9700 Attempt to convert calls to virtual functions to direct calls.  This
9701 is done both within a procedure and interprocedurally as part of
9702 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
9703 propagation (@option{-fipa-cp}).
9704 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9705
9706 @item -fdevirtualize-speculatively
9707 @opindex fdevirtualize-speculatively
9708 Attempt to convert calls to virtual functions to speculative direct calls.
9709 Based on the analysis of the type inheritance graph, determine for a given call
9710 the set of likely targets. If the set is small, preferably of size 1, change
9711 the call into a conditional deciding between direct and indirect calls.  The
9712 speculative calls enable more optimizations, such as inlining.  When they seem
9713 useless after further optimization, they are converted back into original form.
9714
9715 @item -fdevirtualize-at-ltrans
9716 @opindex fdevirtualize-at-ltrans
9717 Stream extra information needed for aggressive devirtualization when running
9718 the link-time optimizer in local transformation mode.  
9719 This option enables more devirtualization but
9720 significantly increases the size of streamed data. For this reason it is
9721 disabled by default.
9722
9723 @item -fexpensive-optimizations
9724 @opindex fexpensive-optimizations
9725 Perform a number of minor optimizations that are relatively expensive.
9726
9727 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9728
9729 @item -free
9730 @opindex free
9731 Attempt to remove redundant extension instructions.  This is especially
9732 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
9733 registers after writing to their lower 32-bit half.
9734
9735 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
9736 @option{-O3}, @option{-Os}.
9737
9738 @item -fno-lifetime-dse
9739 @opindex fno-lifetime-dse
9740 @opindex flifetime-dse
9741 In C++ the value of an object is only affected by changes within its
9742 lifetime: when the constructor begins, the object has an indeterminate
9743 value, and any changes during the lifetime of the object are dead when
9744 the object is destroyed.  Normally dead store elimination will take
9745 advantage of this; if your code relies on the value of the object
9746 storage persisting beyond the lifetime of the object, you can use this
9747 flag to disable this optimization.  To preserve stores before the
9748 constructor starts (e.g.@: because your operator new clears the object
9749 storage) but still treat the object as dead after the destructor, you
9750 can use @option{-flifetime-dse=1}.  The default behavior can be
9751 explicitly selected with @option{-flifetime-dse=2}.
9752 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
9753
9754 @item -flive-range-shrinkage
9755 @opindex flive-range-shrinkage
9756 Attempt to decrease register pressure through register live range
9757 shrinkage.  This is helpful for fast processors with small or moderate
9758 size register sets.
9759
9760 @item -fira-algorithm=@var{algorithm}
9761 @opindex fira-algorithm
9762 Use the specified coloring algorithm for the integrated register
9763 allocator.  The @var{algorithm} argument can be @samp{priority}, which
9764 specifies Chow's priority coloring, or @samp{CB}, which specifies
9765 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
9766 for all architectures, but for those targets that do support it, it is
9767 the default because it generates better code.
9768
9769 @item -fira-region=@var{region}
9770 @opindex fira-region
9771 Use specified regions for the integrated register allocator.  The
9772 @var{region} argument should be one of the following:
9773
9774 @table @samp
9775
9776 @item all
9777 Use all loops as register allocation regions.
9778 This can give the best results for machines with a small and/or
9779 irregular register set.
9780
9781 @item mixed
9782 Use all loops except for loops with small register pressure 
9783 as the regions.  This value usually gives
9784 the best results in most cases and for most architectures,
9785 and is enabled by default when compiling with optimization for speed
9786 (@option{-O}, @option{-O2}, @dots{}).
9787
9788 @item one
9789 Use all functions as a single region.  
9790 This typically results in the smallest code size, and is enabled by default for
9791 @option{-Os} or @option{-O0}.
9792
9793 @end table
9794
9795 @item -fira-hoist-pressure
9796 @opindex fira-hoist-pressure
9797 Use IRA to evaluate register pressure in the code hoisting pass for
9798 decisions to hoist expressions.  This option usually results in smaller
9799 code, but it can slow the compiler down.
9800
9801 This option is enabled at level @option{-Os} for all targets.
9802
9803 @item -fira-loop-pressure
9804 @opindex fira-loop-pressure
9805 Use IRA to evaluate register pressure in loops for decisions to move
9806 loop invariants.  This option usually results in generation
9807 of faster and smaller code on machines with large register files (>= 32
9808 registers), but it can slow the compiler down.
9809
9810 This option is enabled at level @option{-O3} for some targets.
9811
9812 @item -fno-ira-share-save-slots
9813 @opindex fno-ira-share-save-slots
9814 @opindex fira-share-save-slots
9815 Disable sharing of stack slots used for saving call-used hard
9816 registers living through a call.  Each hard register gets a
9817 separate stack slot, and as a result function stack frames are
9818 larger.
9819
9820 @item -fno-ira-share-spill-slots
9821 @opindex fno-ira-share-spill-slots
9822 @opindex fira-share-spill-slots
9823 Disable sharing of stack slots allocated for pseudo-registers.  Each
9824 pseudo-register that does not get a hard register gets a separate
9825 stack slot, and as a result function stack frames are larger.
9826
9827 @item -flra-remat
9828 @opindex flra-remat
9829 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
9830 values of spilled pseudos, LRA tries to rematerialize (recalculate)
9831 values if it is profitable.
9832
9833 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9834
9835 @item -fdelayed-branch
9836 @opindex fdelayed-branch
9837 If supported for the target machine, attempt to reorder instructions
9838 to exploit instruction slots available after delayed branch
9839 instructions.
9840
9841 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os},
9842 but not at @option{-Og}.
9843
9844 @item -fschedule-insns
9845 @opindex fschedule-insns
9846 If supported for the target machine, attempt to reorder instructions to
9847 eliminate execution stalls due to required data being unavailable.  This
9848 helps machines that have slow floating point or memory load instructions
9849 by allowing other instructions to be issued until the result of the load
9850 or floating-point instruction is required.
9851
9852 Enabled at levels @option{-O2}, @option{-O3}.
9853
9854 @item -fschedule-insns2
9855 @opindex fschedule-insns2
9856 Similar to @option{-fschedule-insns}, but requests an additional pass of
9857 instruction scheduling after register allocation has been done.  This is
9858 especially useful on machines with a relatively small number of
9859 registers and where memory load instructions take more than one cycle.
9860
9861 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9862
9863 @item -fno-sched-interblock
9864 @opindex fno-sched-interblock
9865 @opindex fsched-interblock
9866 Disable instruction scheduling across basic blocks, which
9867 is normally enabled when scheduling before register allocation, i.e.@:
9868 with @option{-fschedule-insns} or at @option{-O2} or higher.
9869
9870 @item -fno-sched-spec
9871 @opindex fno-sched-spec
9872 @opindex fsched-spec
9873 Disable speculative motion of non-load instructions, which
9874 is normally enabled when scheduling before register allocation, i.e.@:
9875 with @option{-fschedule-insns} or at @option{-O2} or higher.
9876
9877 @item -fsched-pressure
9878 @opindex fsched-pressure
9879 Enable register pressure sensitive insn scheduling before register
9880 allocation.  This only makes sense when scheduling before register
9881 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
9882 @option{-O2} or higher.  Usage of this option can improve the
9883 generated code and decrease its size by preventing register pressure
9884 increase above the number of available hard registers and subsequent
9885 spills in register allocation.
9886
9887 @item -fsched-spec-load
9888 @opindex fsched-spec-load
9889 Allow speculative motion of some load instructions.  This only makes
9890 sense when scheduling before register allocation, i.e.@: with
9891 @option{-fschedule-insns} or at @option{-O2} or higher.
9892
9893 @item -fsched-spec-load-dangerous
9894 @opindex fsched-spec-load-dangerous
9895 Allow speculative motion of more load instructions.  This only makes
9896 sense when scheduling before register allocation, i.e.@: with
9897 @option{-fschedule-insns} or at @option{-O2} or higher.
9898
9899 @item -fsched-stalled-insns
9900 @itemx -fsched-stalled-insns=@var{n}
9901 @opindex fsched-stalled-insns
9902 Define how many insns (if any) can be moved prematurely from the queue
9903 of stalled insns into the ready list during the second scheduling pass.
9904 @option{-fno-sched-stalled-insns} means that no insns are moved
9905 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
9906 on how many queued insns can be moved prematurely.
9907 @option{-fsched-stalled-insns} without a value is equivalent to
9908 @option{-fsched-stalled-insns=1}.
9909
9910 @item -fsched-stalled-insns-dep
9911 @itemx -fsched-stalled-insns-dep=@var{n}
9912 @opindex fsched-stalled-insns-dep
9913 Define how many insn groups (cycles) are examined for a dependency
9914 on a stalled insn that is a candidate for premature removal from the queue
9915 of stalled insns.  This has an effect only during the second scheduling pass,
9916 and only if @option{-fsched-stalled-insns} is used.
9917 @option{-fno-sched-stalled-insns-dep} is equivalent to
9918 @option{-fsched-stalled-insns-dep=0}.
9919 @option{-fsched-stalled-insns-dep} without a value is equivalent to
9920 @option{-fsched-stalled-insns-dep=1}.
9921
9922 @item -fsched2-use-superblocks
9923 @opindex fsched2-use-superblocks
9924 When scheduling after register allocation, use superblock scheduling.
9925 This allows motion across basic block boundaries,
9926 resulting in faster schedules.  This option is experimental, as not all machine
9927 descriptions used by GCC model the CPU closely enough to avoid unreliable
9928 results from the algorithm.
9929
9930 This only makes sense when scheduling after register allocation, i.e.@: with
9931 @option{-fschedule-insns2} or at @option{-O2} or higher.
9932
9933 @item -fsched-group-heuristic
9934 @opindex fsched-group-heuristic
9935 Enable the group heuristic in the scheduler.  This heuristic favors
9936 the instruction that belongs to a schedule group.  This is enabled
9937 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
9938 or @option{-fschedule-insns2} or at @option{-O2} or higher.
9939
9940 @item -fsched-critical-path-heuristic
9941 @opindex fsched-critical-path-heuristic
9942 Enable the critical-path heuristic in the scheduler.  This heuristic favors
9943 instructions on the critical path.  This is enabled by default when
9944 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
9945 or @option{-fschedule-insns2} or at @option{-O2} or higher.
9946
9947 @item -fsched-spec-insn-heuristic
9948 @opindex fsched-spec-insn-heuristic
9949 Enable the speculative instruction heuristic in the scheduler.  This
9950 heuristic favors speculative instructions with greater dependency weakness.
9951 This is enabled by default when scheduling is enabled, i.e.@:
9952 with @option{-fschedule-insns} or @option{-fschedule-insns2}
9953 or at @option{-O2} or higher.
9954
9955 @item -fsched-rank-heuristic
9956 @opindex fsched-rank-heuristic
9957 Enable the rank heuristic in the scheduler.  This heuristic favors
9958 the instruction belonging to a basic block with greater size or frequency.
9959 This is enabled by default when scheduling is enabled, i.e.@:
9960 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
9961 at @option{-O2} or higher.
9962
9963 @item -fsched-last-insn-heuristic
9964 @opindex fsched-last-insn-heuristic
9965 Enable the last-instruction heuristic in the scheduler.  This heuristic
9966 favors the instruction that is less dependent on the last instruction
9967 scheduled.  This is enabled by default when scheduling is enabled,
9968 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
9969 at @option{-O2} or higher.
9970
9971 @item -fsched-dep-count-heuristic
9972 @opindex fsched-dep-count-heuristic
9973 Enable the dependent-count heuristic in the scheduler.  This heuristic
9974 favors the instruction that has more instructions depending on it.
9975 This is enabled by default when scheduling is enabled, i.e.@:
9976 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
9977 at @option{-O2} or higher.
9978
9979 @item -freschedule-modulo-scheduled-loops
9980 @opindex freschedule-modulo-scheduled-loops
9981 Modulo scheduling is performed before traditional scheduling.  If a loop
9982 is modulo scheduled, later scheduling passes may change its schedule.  
9983 Use this option to control that behavior.
9984
9985 @item -fselective-scheduling
9986 @opindex fselective-scheduling
9987 Schedule instructions using selective scheduling algorithm.  Selective
9988 scheduling runs instead of the first scheduler pass.
9989
9990 @item -fselective-scheduling2
9991 @opindex fselective-scheduling2
9992 Schedule instructions using selective scheduling algorithm.  Selective
9993 scheduling runs instead of the second scheduler pass.
9994
9995 @item -fsel-sched-pipelining
9996 @opindex fsel-sched-pipelining
9997 Enable software pipelining of innermost loops during selective scheduling.
9998 This option has no effect unless one of @option{-fselective-scheduling} or
9999 @option{-fselective-scheduling2} is turned on.
10000
10001 @item -fsel-sched-pipelining-outer-loops
10002 @opindex fsel-sched-pipelining-outer-loops
10003 When pipelining loops during selective scheduling, also pipeline outer loops.
10004 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
10005
10006 @item -fsemantic-interposition
10007 @opindex fsemantic-interposition
10008 Some object formats, like ELF, allow interposing of symbols by the 
10009 dynamic linker.
10010 This means that for symbols exported from the DSO, the compiler cannot perform
10011 interprocedural propagation, inlining and other optimizations in anticipation
10012 that the function or variable in question may change. While this feature is
10013 useful, for example, to rewrite memory allocation functions by a debugging
10014 implementation, it is expensive in the terms of code quality.
10015 With @option{-fno-semantic-interposition} the compiler assumes that 
10016 if interposition happens for functions the overwriting function will have 
10017 precisely the same semantics (and side effects). 
10018 Similarly if interposition happens
10019 for variables, the constructor of the variable will be the same. The flag
10020 has no effect for functions explicitly declared inline 
10021 (where it is never allowed for interposition to change semantics) 
10022 and for symbols explicitly declared weak.
10023
10024 @item -fshrink-wrap
10025 @opindex fshrink-wrap
10026 Emit function prologues only before parts of the function that need it,
10027 rather than at the top of the function.  This flag is enabled by default at
10028 @option{-O} and higher.
10029
10030 @item -fshrink-wrap-separate
10031 @opindex fshrink-wrap-separate
10032 Shrink-wrap separate parts of the prologue and epilogue separately, so that
10033 those parts are only executed when needed.
10034 This option is on by default, but has no effect unless @option{-fshrink-wrap}
10035 is also turned on and the target supports this.
10036
10037 @item -fcaller-saves
10038 @opindex fcaller-saves
10039 Enable allocation of values to registers that are clobbered by
10040 function calls, by emitting extra instructions to save and restore the
10041 registers around such calls.  Such allocation is done only when it
10042 seems to result in better code.
10043
10044 This option is always enabled by default on certain machines, usually
10045 those which have no call-preserved registers to use instead.
10046
10047 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10048
10049 @item -fcombine-stack-adjustments
10050 @opindex fcombine-stack-adjustments
10051 Tracks stack adjustments (pushes and pops) and stack memory references
10052 and then tries to find ways to combine them.
10053
10054 Enabled by default at @option{-O1} and higher.
10055
10056 @item -fipa-ra
10057 @opindex fipa-ra
10058 Use caller save registers for allocation if those registers are not used by
10059 any called function.  In that case it is not necessary to save and restore
10060 them around calls.  This is only possible if called functions are part of
10061 same compilation unit as current function and they are compiled before it.
10062
10063 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}, however the option
10064 is disabled if generated code will be instrumented for profiling
10065 (@option{-p}, or @option{-pg}) or if callee's register usage cannot be known
10066 exactly (this happens on targets that do not expose prologues
10067 and epilogues in RTL).
10068
10069 @item -fconserve-stack
10070 @opindex fconserve-stack
10071 Attempt to minimize stack usage.  The compiler attempts to use less
10072 stack space, even if that makes the program slower.  This option
10073 implies setting the @option{large-stack-frame} parameter to 100
10074 and the @option{large-stack-frame-growth} parameter to 400.
10075
10076 @item -ftree-reassoc
10077 @opindex ftree-reassoc
10078 Perform reassociation on trees.  This flag is enabled by default
10079 at @option{-O} and higher.
10080
10081 @item -fcode-hoisting
10082 @opindex fcode-hoisting
10083 Perform code hoisting.  Code hoisting tries to move the
10084 evaluation of expressions executed on all paths to the function exit
10085 as early as possible.  This is especially useful as a code size
10086 optimization, but it often helps for code speed as well.
10087 This flag is enabled by default at @option{-O2} and higher.
10088
10089 @item -ftree-pre
10090 @opindex ftree-pre
10091 Perform partial redundancy elimination (PRE) on trees.  This flag is
10092 enabled by default at @option{-O2} and @option{-O3}.
10093
10094 @item -ftree-partial-pre
10095 @opindex ftree-partial-pre
10096 Make partial redundancy elimination (PRE) more aggressive.  This flag is
10097 enabled by default at @option{-O3}.
10098
10099 @item -ftree-forwprop
10100 @opindex ftree-forwprop
10101 Perform forward propagation on trees.  This flag is enabled by default
10102 at @option{-O} and higher.
10103
10104 @item -ftree-fre
10105 @opindex ftree-fre
10106 Perform full redundancy elimination (FRE) on trees.  The difference
10107 between FRE and PRE is that FRE only considers expressions
10108 that are computed on all paths leading to the redundant computation.
10109 This analysis is faster than PRE, though it exposes fewer redundancies.
10110 This flag is enabled by default at @option{-O} and higher.
10111
10112 @item -ftree-phiprop
10113 @opindex ftree-phiprop
10114 Perform hoisting of loads from conditional pointers on trees.  This
10115 pass is enabled by default at @option{-O} and higher.
10116
10117 @item -fhoist-adjacent-loads
10118 @opindex fhoist-adjacent-loads
10119 Speculatively hoist loads from both branches of an if-then-else if the
10120 loads are from adjacent locations in the same structure and the target
10121 architecture has a conditional move instruction.  This flag is enabled
10122 by default at @option{-O2} and higher.
10123
10124 @item -ftree-copy-prop
10125 @opindex ftree-copy-prop
10126 Perform copy propagation on trees.  This pass eliminates unnecessary
10127 copy operations.  This flag is enabled by default at @option{-O} and
10128 higher.
10129
10130 @item -fipa-pure-const
10131 @opindex fipa-pure-const
10132 Discover which functions are pure or constant.
10133 Enabled by default at @option{-O} and higher.
10134
10135 @item -fipa-reference
10136 @opindex fipa-reference
10137 Discover which static variables do not escape the
10138 compilation unit.
10139 Enabled by default at @option{-O} and higher.
10140
10141 @item -fipa-reference-addressable
10142 @opindex fipa-reference-addressable
10143 Discover read-only, write-only and non-addressable static variables.
10144 Enabled by default at @option{-O} and higher.
10145
10146 @item -fipa-stack-alignment
10147 @opindex fipa-stack-alignment
10148 Reduce stack alignment on call sites if possible.
10149 Enabled by default.
10150
10151 @item -fipa-pta
10152 @opindex fipa-pta
10153 Perform interprocedural pointer analysis and interprocedural modification
10154 and reference analysis.  This option can cause excessive memory and
10155 compile-time usage on large compilation units.  It is not enabled by
10156 default at any optimization level.
10157
10158 @item -fipa-profile
10159 @opindex fipa-profile
10160 Perform interprocedural profile propagation.  The functions called only from
10161 cold functions are marked as cold. Also functions executed once (such as
10162 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
10163 functions and loop less parts of functions executed once are then optimized for
10164 size.
10165 Enabled by default at @option{-O} and higher.
10166
10167 @item -fipa-cp
10168 @opindex fipa-cp
10169 Perform interprocedural constant propagation.
10170 This optimization analyzes the program to determine when values passed
10171 to functions are constants and then optimizes accordingly.
10172 This optimization can substantially increase performance
10173 if the application has constants passed to functions.
10174 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
10175 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10176
10177 @item -fipa-cp-clone
10178 @opindex fipa-cp-clone
10179 Perform function cloning to make interprocedural constant propagation stronger.
10180 When enabled, interprocedural constant propagation performs function cloning
10181 when externally visible function can be called with constant arguments.
10182 Because this optimization can create multiple copies of functions,
10183 it may significantly increase code size
10184 (see @option{--param ipcp-unit-growth=@var{value}}).
10185 This flag is enabled by default at @option{-O3}.
10186 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10187
10188 @item -fipa-bit-cp
10189 @opindex fipa-bit-cp
10190 When enabled, perform interprocedural bitwise constant
10191 propagation. This flag is enabled by default at @option{-O2} and
10192 by @option{-fprofile-use} and @option{-fauto-profile}.
10193 It requires that @option{-fipa-cp} is enabled.  
10194
10195 @item -fipa-vrp
10196 @opindex fipa-vrp
10197 When enabled, perform interprocedural propagation of value
10198 ranges. This flag is enabled by default at @option{-O2}. It requires
10199 that @option{-fipa-cp} is enabled.
10200
10201 @item -fipa-icf
10202 @opindex fipa-icf
10203 Perform Identical Code Folding for functions and read-only variables.
10204 The optimization reduces code size and may disturb unwind stacks by replacing
10205 a function by equivalent one with a different name. The optimization works
10206 more effectively with link-time optimization enabled.
10207
10208 Although the behavior is similar to the Gold Linker's ICF optimization, GCC ICF
10209 works on different levels and thus the optimizations are not same - there are
10210 equivalences that are found only by GCC and equivalences found only by Gold.
10211
10212 This flag is enabled by default at @option{-O2} and @option{-Os}.
10213
10214 @item -flive-patching=@var{level}
10215 @opindex flive-patching
10216 Control GCC's optimizations to produce output suitable for live-patching.
10217
10218 If the compiler's optimization uses a function's body or information extracted
10219 from its body to optimize/change another function, the latter is called an
10220 impacted function of the former.  If a function is patched, its impacted
10221 functions should be patched too.
10222
10223 The impacted functions are determined by the compiler's interprocedural
10224 optimizations.  For example, a caller is impacted when inlining a function
10225 into its caller,
10226 cloning a function and changing its caller to call this new clone,
10227 or extracting a function's pureness/constness information to optimize
10228 its direct or indirect callers, etc.
10229
10230 Usually, the more IPA optimizations enabled, the larger the number of
10231 impacted functions for each function.  In order to control the number of
10232 impacted functions and more easily compute the list of impacted function,
10233 IPA optimizations can be partially enabled at two different levels.
10234
10235 The @var{level} argument should be one of the following:
10236
10237 @table @samp
10238
10239 @item inline-clone
10240
10241 Only enable inlining and cloning optimizations, which includes inlining,
10242 cloning, interprocedural scalar replacement of aggregates and partial inlining.
10243 As a result, when patching a function, all its callers and its clones'
10244 callers are impacted, therefore need to be patched as well.
10245
10246 @option{-flive-patching=inline-clone} disables the following optimization flags:
10247 @gccoptlist{-fwhole-program  -fipa-pta  -fipa-reference  -fipa-ra @gol
10248 -fipa-icf  -fipa-icf-functions  -fipa-icf-variables @gol
10249 -fipa-bit-cp  -fipa-vrp  -fipa-pure-const  -fipa-reference-addressable @gol
10250 -fipa-stack-alignment}
10251
10252 @item inline-only-static
10253
10254 Only enable inlining of static functions.
10255 As a result, when patching a static function, all its callers are impacted
10256 and so need to be patched as well.
10257
10258 In addition to all the flags that @option{-flive-patching=inline-clone}
10259 disables,
10260 @option{-flive-patching=inline-only-static} disables the following additional
10261 optimization flags:
10262 @gccoptlist{-fipa-cp-clone  -fipa-sra  -fpartial-inlining  -fipa-cp}
10263
10264 @end table
10265
10266 When @option{-flive-patching} is specified without any value, the default value
10267 is @var{inline-clone}.
10268
10269 This flag is disabled by default.
10270
10271 Note that @option{-flive-patching} is not supported with link-time optimization
10272 (@option{-flto}).
10273
10274 @item -fisolate-erroneous-paths-dereference
10275 @opindex fisolate-erroneous-paths-dereference
10276 Detect paths that trigger erroneous or undefined behavior due to
10277 dereferencing a null pointer.  Isolate those paths from the main control
10278 flow and turn the statement with erroneous or undefined behavior into a trap.
10279 This flag is enabled by default at @option{-O2} and higher and depends on
10280 @option{-fdelete-null-pointer-checks} also being enabled.
10281
10282 @item -fisolate-erroneous-paths-attribute
10283 @opindex fisolate-erroneous-paths-attribute
10284 Detect paths that trigger erroneous or undefined behavior due to a null value
10285 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
10286 attribute.  Isolate those paths from the main control flow and turn the
10287 statement with erroneous or undefined behavior into a trap.  This is not
10288 currently enabled, but may be enabled by @option{-O2} in the future.
10289
10290 @item -ftree-sink
10291 @opindex ftree-sink
10292 Perform forward store motion on trees.  This flag is
10293 enabled by default at @option{-O} and higher.
10294
10295 @item -ftree-bit-ccp
10296 @opindex ftree-bit-ccp
10297 Perform sparse conditional bit constant propagation on trees and propagate
10298 pointer alignment information.
10299 This pass only operates on local scalar variables and is enabled by default
10300 at @option{-O1} and higher, except for @option{-Og}.
10301 It requires that @option{-ftree-ccp} is enabled.
10302
10303 @item -ftree-ccp
10304 @opindex ftree-ccp
10305 Perform sparse conditional constant propagation (CCP) on trees.  This
10306 pass only operates on local scalar variables and is enabled by default
10307 at @option{-O} and higher.
10308
10309 @item -fssa-backprop
10310 @opindex fssa-backprop
10311 Propagate information about uses of a value up the definition chain
10312 in order to simplify the definitions.  For example, this pass strips
10313 sign operations if the sign of a value never matters.  The flag is
10314 enabled by default at @option{-O} and higher.
10315
10316 @item -fssa-phiopt
10317 @opindex fssa-phiopt
10318 Perform pattern matching on SSA PHI nodes to optimize conditional
10319 code.  This pass is enabled by default at @option{-O1} and higher,
10320 except for @option{-Og}.
10321
10322 @item -ftree-switch-conversion
10323 @opindex ftree-switch-conversion
10324 Perform conversion of simple initializations in a switch to
10325 initializations from a scalar array.  This flag is enabled by default
10326 at @option{-O2} and higher.
10327
10328 @item -ftree-tail-merge
10329 @opindex ftree-tail-merge
10330 Look for identical code sequences.  When found, replace one with a jump to the
10331 other.  This optimization is known as tail merging or cross jumping.  This flag
10332 is enabled by default at @option{-O2} and higher.  The compilation time
10333 in this pass can
10334 be limited using @option{max-tail-merge-comparisons} parameter and
10335 @option{max-tail-merge-iterations} parameter.
10336
10337 @item -ftree-dce
10338 @opindex ftree-dce
10339 Perform dead code elimination (DCE) on trees.  This flag is enabled by
10340 default at @option{-O} and higher.
10341
10342 @item -ftree-builtin-call-dce
10343 @opindex ftree-builtin-call-dce
10344 Perform conditional dead code elimination (DCE) for calls to built-in functions
10345 that may set @code{errno} but are otherwise free of side effects.  This flag is
10346 enabled by default at @option{-O2} and higher if @option{-Os} is not also
10347 specified.
10348
10349 @item -ffinite-loops
10350 @opindex ffinite-loops
10351 @opindex fno-finite-loops
10352 Assume that a loop with an exit will eventually take the exit and not loop
10353 indefinitely.  This allows the compiler to remove loops that otherwise have
10354 no side-effects, not considering eventual endless looping as such.
10355
10356 This option is enabled by default at @option{-O2}.
10357
10358 @item -ftree-dominator-opts
10359 @opindex ftree-dominator-opts
10360 Perform a variety of simple scalar cleanups (constant/copy
10361 propagation, redundancy elimination, range propagation and expression
10362 simplification) based on a dominator tree traversal.  This also
10363 performs jump threading (to reduce jumps to jumps). This flag is
10364 enabled by default at @option{-O} and higher.
10365
10366 @item -ftree-dse
10367 @opindex ftree-dse
10368 Perform dead store elimination (DSE) on trees.  A dead store is a store into
10369 a memory location that is later overwritten by another store without
10370 any intervening loads.  In this case the earlier store can be deleted.  This
10371 flag is enabled by default at @option{-O} and higher.
10372
10373 @item -ftree-ch
10374 @opindex ftree-ch
10375 Perform loop header copying on trees.  This is beneficial since it increases
10376 effectiveness of code motion optimizations.  It also saves one jump.  This flag
10377 is enabled by default at @option{-O} and higher.  It is not enabled
10378 for @option{-Os}, since it usually increases code size.
10379
10380 @item -ftree-loop-optimize
10381 @opindex ftree-loop-optimize
10382 Perform loop optimizations on trees.  This flag is enabled by default
10383 at @option{-O} and higher.
10384
10385 @item -ftree-loop-linear
10386 @itemx -floop-strip-mine
10387 @itemx -floop-block
10388 @opindex ftree-loop-linear
10389 @opindex floop-strip-mine
10390 @opindex floop-block
10391 Perform loop nest optimizations.  Same as
10392 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
10393 to be configured with @option{--with-isl} to enable the Graphite loop
10394 transformation infrastructure.
10395
10396 @item -fgraphite-identity
10397 @opindex fgraphite-identity
10398 Enable the identity transformation for graphite.  For every SCoP we generate
10399 the polyhedral representation and transform it back to gimple.  Using
10400 @option{-fgraphite-identity} we can check the costs or benefits of the
10401 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
10402 are also performed by the code generator isl, like index splitting and
10403 dead code elimination in loops.
10404
10405 @item -floop-nest-optimize
10406 @opindex floop-nest-optimize
10407 Enable the isl based loop nest optimizer.  This is a generic loop nest
10408 optimizer based on the Pluto optimization algorithms.  It calculates a loop
10409 structure optimized for data-locality and parallelism.  This option
10410 is experimental.
10411
10412 @item -floop-parallelize-all
10413 @opindex floop-parallelize-all
10414 Use the Graphite data dependence analysis to identify loops that can
10415 be parallelized.  Parallelize all the loops that can be analyzed to
10416 not contain loop carried dependences without checking that it is
10417 profitable to parallelize the loops.
10418
10419 @item -ftree-coalesce-vars
10420 @opindex ftree-coalesce-vars
10421 While transforming the program out of the SSA representation, attempt to
10422 reduce copying by coalescing versions of different user-defined
10423 variables, instead of just compiler temporaries.  This may severely
10424 limit the ability to debug an optimized program compiled with
10425 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
10426 prevents SSA coalescing of user variables.  This option is enabled by
10427 default if optimization is enabled, and it does very little otherwise.
10428
10429 @item -ftree-loop-if-convert
10430 @opindex ftree-loop-if-convert
10431 Attempt to transform conditional jumps in the innermost loops to
10432 branch-less equivalents.  The intent is to remove control-flow from
10433 the innermost loops in order to improve the ability of the
10434 vectorization pass to handle these loops.  This is enabled by default
10435 if vectorization is enabled.
10436
10437 @item -ftree-loop-distribution
10438 @opindex ftree-loop-distribution
10439 Perform loop distribution.  This flag can improve cache performance on
10440 big loop bodies and allow further loop optimizations, like
10441 parallelization or vectorization, to take place.  For example, the loop
10442 @smallexample
10443 DO I = 1, N
10444   A(I) = B(I) + C
10445   D(I) = E(I) * F
10446 ENDDO
10447 @end smallexample
10448 is transformed to
10449 @smallexample
10450 DO I = 1, N
10451    A(I) = B(I) + C
10452 ENDDO
10453 DO I = 1, N
10454    D(I) = E(I) * F
10455 ENDDO
10456 @end smallexample
10457 This flag is enabled by default at @option{-O3}.
10458 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10459
10460 @item -ftree-loop-distribute-patterns
10461 @opindex ftree-loop-distribute-patterns
10462 Perform loop distribution of patterns that can be code generated with
10463 calls to a library.  This flag is enabled by default at @option{-O2} and
10464 higher, and by @option{-fprofile-use} and @option{-fauto-profile}.
10465
10466 This pass distributes the initialization loops and generates a call to
10467 memset zero.  For example, the loop
10468 @smallexample
10469 DO I = 1, N
10470   A(I) = 0
10471   B(I) = A(I) + I
10472 ENDDO
10473 @end smallexample
10474 is transformed to
10475 @smallexample
10476 DO I = 1, N
10477    A(I) = 0
10478 ENDDO
10479 DO I = 1, N
10480    B(I) = A(I) + I
10481 ENDDO
10482 @end smallexample
10483 and the initialization loop is transformed into a call to memset zero.
10484 This flag is enabled by default at @option{-O3}.
10485 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10486
10487 @item -floop-interchange
10488 @opindex floop-interchange
10489 Perform loop interchange outside of graphite.  This flag can improve cache
10490 performance on loop nest and allow further loop optimizations, like
10491 vectorization, to take place.  For example, the loop
10492 @smallexample
10493 for (int i = 0; i < N; i++)
10494   for (int j = 0; j < N; j++)
10495     for (int k = 0; k < N; k++)
10496       c[i][j] = c[i][j] + a[i][k]*b[k][j];
10497 @end smallexample
10498 is transformed to
10499 @smallexample
10500 for (int i = 0; i < N; i++)
10501   for (int k = 0; k < N; k++)
10502     for (int j = 0; j < N; j++)
10503       c[i][j] = c[i][j] + a[i][k]*b[k][j];
10504 @end smallexample
10505 This flag is enabled by default at @option{-O3}.
10506 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10507
10508 @item -floop-unroll-and-jam
10509 @opindex floop-unroll-and-jam
10510 Apply unroll and jam transformations on feasible loops.  In a loop
10511 nest this unrolls the outer loop by some factor and fuses the resulting
10512 multiple inner loops.  This flag is enabled by default at @option{-O3}.
10513 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10514
10515 @item -ftree-loop-im
10516 @opindex ftree-loop-im
10517 Perform loop invariant motion on trees.  This pass moves only invariants that
10518 are hard to handle at RTL level (function calls, operations that expand to
10519 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
10520 operands of conditions that are invariant out of the loop, so that we can use
10521 just trivial invariantness analysis in loop unswitching.  The pass also includes
10522 store motion.
10523
10524 @item -ftree-loop-ivcanon
10525 @opindex ftree-loop-ivcanon
10526 Create a canonical counter for number of iterations in loops for which
10527 determining number of iterations requires complicated analysis.  Later
10528 optimizations then may determine the number easily.  Useful especially
10529 in connection with unrolling.
10530
10531 @item -ftree-scev-cprop
10532 @opindex ftree-scev-cprop
10533 Perform final value replacement.  If a variable is modified in a loop
10534 in such a way that its value when exiting the loop can be determined using
10535 only its initial value and the number of loop iterations, replace uses of
10536 the final value by such a computation, provided it is sufficiently cheap.
10537 This reduces data dependencies and may allow further simplifications.
10538 Enabled by default at @option{-O} and higher.
10539
10540 @item -fivopts
10541 @opindex fivopts
10542 Perform induction variable optimizations (strength reduction, induction
10543 variable merging and induction variable elimination) on trees.
10544
10545 @item -ftree-parallelize-loops=n
10546 @opindex ftree-parallelize-loops
10547 Parallelize loops, i.e., split their iteration space to run in n threads.
10548 This is only possible for loops whose iterations are independent
10549 and can be arbitrarily reordered.  The optimization is only
10550 profitable on multiprocessor machines, for loops that are CPU-intensive,
10551 rather than constrained e.g.@: by memory bandwidth.  This option
10552 implies @option{-pthread}, and thus is only supported on targets
10553 that have support for @option{-pthread}.
10554
10555 @item -ftree-pta
10556 @opindex ftree-pta
10557 Perform function-local points-to analysis on trees.  This flag is
10558 enabled by default at @option{-O1} and higher, except for @option{-Og}.
10559
10560 @item -ftree-sra
10561 @opindex ftree-sra
10562 Perform scalar replacement of aggregates.  This pass replaces structure
10563 references with scalars to prevent committing structures to memory too
10564 early.  This flag is enabled by default at @option{-O1} and higher,
10565 except for @option{-Og}.
10566
10567 @item -fstore-merging
10568 @opindex fstore-merging
10569 Perform merging of narrow stores to consecutive memory addresses.  This pass
10570 merges contiguous stores of immediate values narrower than a word into fewer
10571 wider stores to reduce the number of instructions.  This is enabled by default
10572 at @option{-O2} and higher as well as @option{-Os}.
10573
10574 @item -ftree-ter
10575 @opindex ftree-ter
10576 Perform temporary expression replacement during the SSA->normal phase.  Single
10577 use/single def temporaries are replaced at their use location with their
10578 defining expression.  This results in non-GIMPLE code, but gives the expanders
10579 much more complex trees to work on resulting in better RTL generation.  This is
10580 enabled by default at @option{-O} and higher.
10581
10582 @item -ftree-slsr
10583 @opindex ftree-slsr
10584 Perform straight-line strength reduction on trees.  This recognizes related
10585 expressions involving multiplications and replaces them by less expensive
10586 calculations when possible.  This is enabled by default at @option{-O} and
10587 higher.
10588
10589 @item -ftree-vectorize
10590 @opindex ftree-vectorize
10591 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
10592 and @option{-ftree-slp-vectorize} if not explicitly specified.
10593
10594 @item -ftree-loop-vectorize
10595 @opindex ftree-loop-vectorize
10596 Perform loop vectorization on trees. This flag is enabled by default at
10597 @option{-O3} and by @option{-ftree-vectorize}, @option{-fprofile-use},
10598 and @option{-fauto-profile}.
10599
10600 @item -ftree-slp-vectorize
10601 @opindex ftree-slp-vectorize
10602 Perform basic block vectorization on trees. This flag is enabled by default at
10603 @option{-O3} and by @option{-ftree-vectorize}, @option{-fprofile-use},
10604 and @option{-fauto-profile}.
10605
10606 @item -fvect-cost-model=@var{model}
10607 @opindex fvect-cost-model
10608 Alter the cost model used for vectorization.  The @var{model} argument
10609 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
10610 With the @samp{unlimited} model the vectorized code-path is assumed
10611 to be profitable while with the @samp{dynamic} model a runtime check
10612 guards the vectorized code-path to enable it only for iteration
10613 counts that will likely execute faster than when executing the original
10614 scalar loop.  The @samp{cheap} model disables vectorization of
10615 loops where doing so would be cost prohibitive for example due to
10616 required runtime checks for data dependence or alignment but otherwise
10617 is equal to the @samp{dynamic} model.
10618 The default cost model depends on other optimization flags and is
10619 either @samp{dynamic} or @samp{cheap}.
10620
10621 @item -fsimd-cost-model=@var{model}
10622 @opindex fsimd-cost-model
10623 Alter the cost model used for vectorization of loops marked with the OpenMP
10624 simd directive.  The @var{model} argument should be one of
10625 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
10626 have the same meaning as described in @option{-fvect-cost-model} and by
10627 default a cost model defined with @option{-fvect-cost-model} is used.
10628
10629 @item -ftree-vrp
10630 @opindex ftree-vrp
10631 Perform Value Range Propagation on trees.  This is similar to the
10632 constant propagation pass, but instead of values, ranges of values are
10633 propagated.  This allows the optimizers to remove unnecessary range
10634 checks like array bound checks and null pointer checks.  This is
10635 enabled by default at @option{-O2} and higher.  Null pointer check
10636 elimination is only done if @option{-fdelete-null-pointer-checks} is
10637 enabled.
10638
10639 @item -fsplit-paths
10640 @opindex fsplit-paths
10641 Split paths leading to loop backedges.  This can improve dead code
10642 elimination and common subexpression elimination.  This is enabled by
10643 default at @option{-O3} and above.
10644
10645 @item -fsplit-ivs-in-unroller
10646 @opindex fsplit-ivs-in-unroller
10647 Enables expression of values of induction variables in later iterations
10648 of the unrolled loop using the value in the first iteration.  This breaks
10649 long dependency chains, thus improving efficiency of the scheduling passes.
10650
10651 A combination of @option{-fweb} and CSE is often sufficient to obtain the
10652 same effect.  However, that is not reliable in cases where the loop body
10653 is more complicated than a single basic block.  It also does not work at all
10654 on some architectures due to restrictions in the CSE pass.
10655
10656 This optimization is enabled by default.
10657
10658 @item -fvariable-expansion-in-unroller
10659 @opindex fvariable-expansion-in-unroller
10660 With this option, the compiler creates multiple copies of some
10661 local variables when unrolling a loop, which can result in superior code.
10662
10663 This optimization is enabled by default for PowerPC targets, but disabled
10664 by default otherwise.
10665
10666 @item -fpartial-inlining
10667 @opindex fpartial-inlining
10668 Inline parts of functions.  This option has any effect only
10669 when inlining itself is turned on by the @option{-finline-functions}
10670 or @option{-finline-small-functions} options.
10671
10672 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10673
10674 @item -fpredictive-commoning
10675 @opindex fpredictive-commoning
10676 Perform predictive commoning optimization, i.e., reusing computations
10677 (especially memory loads and stores) performed in previous
10678 iterations of loops.
10679
10680 This option is enabled at level @option{-O3}.
10681 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
10682
10683 @item -fprefetch-loop-arrays
10684 @opindex fprefetch-loop-arrays
10685 If supported by the target machine, generate instructions to prefetch
10686 memory to improve the performance of loops that access large arrays.
10687
10688 This option may generate better or worse code; results are highly
10689 dependent on the structure of loops within the source code.
10690
10691 Disabled at level @option{-Os}.
10692
10693 @item -fno-printf-return-value
10694 @opindex fno-printf-return-value
10695 @opindex fprintf-return-value
10696 Do not substitute constants for known return value of formatted output
10697 functions such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and
10698 @code{vsnprintf} (but not @code{printf} of @code{fprintf}).  This
10699 transformation allows GCC to optimize or even eliminate branches based
10700 on the known return value of these functions called with arguments that
10701 are either constant, or whose values are known to be in a range that
10702 makes determining the exact return value possible.  For example, when
10703 @option{-fprintf-return-value} is in effect, both the branch and the
10704 body of the @code{if} statement (but not the call to @code{snprint})
10705 can be optimized away when @code{i} is a 32-bit or smaller integer
10706 because the return value is guaranteed to be at most 8.
10707
10708 @smallexample
10709 char buf[9];
10710 if (snprintf (buf, "%08x", i) >= sizeof buf)
10711   @dots{}
10712 @end smallexample
10713
10714 The @option{-fprintf-return-value} option relies on other optimizations
10715 and yields best results with @option{-O2} and above.  It works in tandem
10716 with the @option{-Wformat-overflow} and @option{-Wformat-truncation}
10717 options.  The @option{-fprintf-return-value} option is enabled by default.
10718
10719 @item -fno-peephole
10720 @itemx -fno-peephole2
10721 @opindex fno-peephole
10722 @opindex fpeephole
10723 @opindex fno-peephole2
10724 @opindex fpeephole2
10725 Disable any machine-specific peephole optimizations.  The difference
10726 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
10727 are implemented in the compiler; some targets use one, some use the
10728 other, a few use both.
10729
10730 @option{-fpeephole} is enabled by default.
10731 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10732
10733 @item -fno-guess-branch-probability
10734 @opindex fno-guess-branch-probability
10735 @opindex fguess-branch-probability
10736 Do not guess branch probabilities using heuristics.
10737
10738 GCC uses heuristics to guess branch probabilities if they are
10739 not provided by profiling feedback (@option{-fprofile-arcs}).  These
10740 heuristics are based on the control flow graph.  If some branch probabilities
10741 are specified by @code{__builtin_expect}, then the heuristics are
10742 used to guess branch probabilities for the rest of the control flow graph,
10743 taking the @code{__builtin_expect} info into account.  The interactions
10744 between the heuristics and @code{__builtin_expect} can be complex, and in
10745 some cases, it may be useful to disable the heuristics so that the effects
10746 of @code{__builtin_expect} are easier to understand.
10747
10748 It is also possible to specify expected probability of the expression
10749 with @code{__builtin_expect_with_probability} built-in function.
10750
10751 The default is @option{-fguess-branch-probability} at levels
10752 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
10753
10754 @item -freorder-blocks
10755 @opindex freorder-blocks
10756 Reorder basic blocks in the compiled function in order to reduce number of
10757 taken branches and improve code locality.
10758
10759 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
10760
10761 @item -freorder-blocks-algorithm=@var{algorithm}
10762 @opindex freorder-blocks-algorithm
10763 Use the specified algorithm for basic block reordering.  The
10764 @var{algorithm} argument can be @samp{simple}, which does not increase
10765 code size (except sometimes due to secondary effects like alignment),
10766 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
10767 put all often executed code together, minimizing the number of branches
10768 executed by making extra copies of code.
10769
10770 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
10771 @samp{stc} at levels @option{-O2}, @option{-O3}.
10772
10773 @item -freorder-blocks-and-partition
10774 @opindex freorder-blocks-and-partition
10775 In addition to reordering basic blocks in the compiled function, in order
10776 to reduce number of taken branches, partitions hot and cold basic blocks
10777 into separate sections of the assembly and @file{.o} files, to improve
10778 paging and cache locality performance.
10779
10780 This optimization is automatically turned off in the presence of
10781 exception handling or unwind tables (on targets using setjump/longjump or target specific scheme), for linkonce sections, for functions with a user-defined
10782 section attribute and on any architecture that does not support named
10783 sections.  When @option{-fsplit-stack} is used this option is not
10784 enabled by default (to avoid linker errors), but may be enabled
10785 explicitly (if using a working linker).
10786
10787 Enabled for x86 at levels @option{-O2}, @option{-O3}, @option{-Os}.
10788
10789 @item -freorder-functions
10790 @opindex freorder-functions
10791 Reorder functions in the object file in order to
10792 improve code locality.  This is implemented by using special
10793 subsections @code{.text.hot} for most frequently executed functions and
10794 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
10795 the linker so object file format must support named sections and linker must
10796 place them in a reasonable way.
10797
10798 This option isn't effective unless you either provide profile feedback
10799 (see @option{-fprofile-arcs} for details) or manually annotate functions with 
10800 @code{hot} or @code{cold} attributes (@pxref{Common Function Attributes}).
10801
10802 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10803
10804 @item -fstrict-aliasing
10805 @opindex fstrict-aliasing
10806 Allow the compiler to assume the strictest aliasing rules applicable to
10807 the language being compiled.  For C (and C++), this activates
10808 optimizations based on the type of expressions.  In particular, an
10809 object of one type is assumed never to reside at the same address as an
10810 object of a different type, unless the types are almost the same.  For
10811 example, an @code{unsigned int} can alias an @code{int}, but not a
10812 @code{void*} or a @code{double}.  A character type may alias any other
10813 type.
10814
10815 @anchor{Type-punning}Pay special attention to code like this:
10816 @smallexample
10817 union a_union @{
10818   int i;
10819   double d;
10820 @};
10821
10822 int f() @{
10823   union a_union t;
10824   t.d = 3.0;
10825   return t.i;
10826 @}
10827 @end smallexample
10828 The practice of reading from a different union member than the one most
10829 recently written to (called ``type-punning'') is common.  Even with
10830 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
10831 is accessed through the union type.  So, the code above works as
10832 expected.  @xref{Structures unions enumerations and bit-fields
10833 implementation}.  However, this code might not:
10834 @smallexample
10835 int f() @{
10836   union a_union t;
10837   int* ip;
10838   t.d = 3.0;
10839   ip = &t.i;
10840   return *ip;
10841 @}
10842 @end smallexample
10843
10844 Similarly, access by taking the address, casting the resulting pointer
10845 and dereferencing the result has undefined behavior, even if the cast
10846 uses a union type, e.g.:
10847 @smallexample
10848 int f() @{
10849   double d = 3.0;
10850   return ((union a_union *) &d)->i;
10851 @}
10852 @end smallexample
10853
10854 The @option{-fstrict-aliasing} option is enabled at levels
10855 @option{-O2}, @option{-O3}, @option{-Os}.
10856
10857 @item -falign-functions
10858 @itemx -falign-functions=@var{n}
10859 @itemx -falign-functions=@var{n}:@var{m}
10860 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}
10861 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}:@var{m2}
10862 @opindex falign-functions
10863 Align the start of functions to the next power-of-two greater than
10864 @var{n}, skipping up to @var{m}-1 bytes.  This ensures that at least
10865 the first @var{m} bytes of the function can be fetched by the CPU
10866 without crossing an @var{n}-byte alignment boundary.
10867
10868 If @var{m} is not specified, it defaults to @var{n}.
10869
10870 Examples: @option{-falign-functions=32} aligns functions to the next
10871 32-byte boundary, @option{-falign-functions=24} aligns to the next
10872 32-byte boundary only if this can be done by skipping 23 bytes or less,
10873 @option{-falign-functions=32:7} aligns to the next
10874 32-byte boundary only if this can be done by skipping 6 bytes or less.
10875
10876 The second pair of @var{n2}:@var{m2} values allows you to specify
10877 a secondary alignment: @option{-falign-functions=64:7:32:3} aligns to
10878 the next 64-byte boundary if this can be done by skipping 6 bytes or less,
10879 otherwise aligns to the next 32-byte boundary if this can be done
10880 by skipping 2 bytes or less.
10881 If @var{m2} is not specified, it defaults to @var{n2}.
10882
10883 Some assemblers only support this flag when @var{n} is a power of two;
10884 in that case, it is rounded up.
10885
10886 @option{-fno-align-functions} and @option{-falign-functions=1} are
10887 equivalent and mean that functions are not aligned.
10888
10889 If @var{n} is not specified or is zero, use a machine-dependent default.
10890 The maximum allowed @var{n} option value is 65536.
10891
10892 Enabled at levels @option{-O2}, @option{-O3}.
10893
10894 @item -flimit-function-alignment
10895 If this option is enabled, the compiler tries to avoid unnecessarily
10896 overaligning functions. It attempts to instruct the assembler to align
10897 by the amount specified by @option{-falign-functions}, but not to
10898 skip more bytes than the size of the function.
10899
10900 @item -falign-labels
10901 @itemx -falign-labels=@var{n}
10902 @itemx -falign-labels=@var{n}:@var{m}
10903 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}
10904 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}:@var{m2}
10905 @opindex falign-labels
10906 Align all branch targets to a power-of-two boundary.
10907
10908 Parameters of this option are analogous to the @option{-falign-functions} option.
10909 @option{-fno-align-labels} and @option{-falign-labels=1} are
10910 equivalent and mean that labels are not aligned.
10911
10912 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
10913 are greater than this value, then their values are used instead.
10914
10915 If @var{n} is not specified or is zero, use a machine-dependent default
10916 which is very likely to be @samp{1}, meaning no alignment.
10917 The maximum allowed @var{n} option value is 65536.
10918
10919 Enabled at levels @option{-O2}, @option{-O3}.
10920
10921 @item -falign-loops
10922 @itemx -falign-loops=@var{n}
10923 @itemx -falign-loops=@var{n}:@var{m}
10924 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}
10925 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}:@var{m2}
10926 @opindex falign-loops
10927 Align loops to a power-of-two boundary.  If the loops are executed
10928 many times, this makes up for any execution of the dummy padding
10929 instructions.
10930
10931 Parameters of this option are analogous to the @option{-falign-functions} option.
10932 @option{-fno-align-loops} and @option{-falign-loops=1} are
10933 equivalent and mean that loops are not aligned.
10934 The maximum allowed @var{n} option value is 65536.
10935
10936 If @var{n} is not specified or is zero, use a machine-dependent default.
10937
10938 Enabled at levels @option{-O2}, @option{-O3}.
10939
10940 @item -falign-jumps
10941 @itemx -falign-jumps=@var{n}
10942 @itemx -falign-jumps=@var{n}:@var{m}
10943 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}
10944 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}:@var{m2}
10945 @opindex falign-jumps
10946 Align branch targets to a power-of-two boundary, for branch targets
10947 where the targets can only be reached by jumping.  In this case,
10948 no dummy operations need be executed.
10949
10950 Parameters of this option are analogous to the @option{-falign-functions} option.
10951 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
10952 equivalent and mean that loops are not aligned.
10953
10954 If @var{n} is not specified or is zero, use a machine-dependent default.
10955 The maximum allowed @var{n} option value is 65536.
10956
10957 Enabled at levels @option{-O2}, @option{-O3}.
10958
10959 @item -fno-allocation-dce
10960 @opindex fno-allocation-dce
10961 Do not remove unused C++ allocations in dead code elimination.
10962
10963 @item -fallow-store-data-races
10964 @opindex fallow-store-data-races
10965 Allow the compiler to introduce new data races on stores.
10966
10967 Enabled at level @option{-Ofast}.
10968
10969 @item -funit-at-a-time
10970 @opindex funit-at-a-time
10971 This option is left for compatibility reasons. @option{-funit-at-a-time}
10972 has no effect, while @option{-fno-unit-at-a-time} implies
10973 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
10974
10975 Enabled by default.
10976
10977 @item -fno-toplevel-reorder
10978 @opindex fno-toplevel-reorder
10979 @opindex ftoplevel-reorder
10980 Do not reorder top-level functions, variables, and @code{asm}
10981 statements.  Output them in the same order that they appear in the
10982 input file.  When this option is used, unreferenced static variables
10983 are not removed.  This option is intended to support existing code
10984 that relies on a particular ordering.  For new code, it is better to
10985 use attributes when possible.
10986
10987 @option{-ftoplevel-reorder} is the default at @option{-O1} and higher, and
10988 also at @option{-O0} if @option{-fsection-anchors} is explicitly requested.
10989 Additionally @option{-fno-toplevel-reorder} implies
10990 @option{-fno-section-anchors}.
10991
10992 @item -fweb
10993 @opindex fweb
10994 Constructs webs as commonly used for register allocation purposes and assign
10995 each web individual pseudo register.  This allows the register allocation pass
10996 to operate on pseudos directly, but also strengthens several other optimization
10997 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
10998 however, make debugging impossible, since variables no longer stay in a
10999 ``home register''.
11000
11001 Enabled by default with @option{-funroll-loops}.
11002
11003 @item -fwhole-program
11004 @opindex fwhole-program
11005 Assume that the current compilation unit represents the whole program being
11006 compiled.  All public functions and variables with the exception of @code{main}
11007 and those merged by attribute @code{externally_visible} become static functions
11008 and in effect are optimized more aggressively by interprocedural optimizers.
11009
11010 This option should not be used in combination with @option{-flto}.
11011 Instead relying on a linker plugin should provide safer and more precise
11012 information.
11013
11014 @item -flto[=@var{n}]
11015 @opindex flto
11016 This option runs the standard link-time optimizer.  When invoked
11017 with source code, it generates GIMPLE (one of GCC's internal
11018 representations) and writes it to special ELF sections in the object
11019 file.  When the object files are linked together, all the function
11020 bodies are read from these ELF sections and instantiated as if they
11021 had been part of the same translation unit.
11022
11023 To use the link-time optimizer, @option{-flto} and optimization
11024 options should be specified at compile time and during the final link.
11025 It is recommended that you compile all the files participating in the
11026 same link with the same options and also specify those options at
11027 link time.  
11028 For example:
11029
11030 @smallexample
11031 gcc -c -O2 -flto foo.c
11032 gcc -c -O2 -flto bar.c
11033 gcc -o myprog -flto -O2 foo.o bar.o
11034 @end smallexample
11035
11036 The first two invocations to GCC save a bytecode representation
11037 of GIMPLE into special ELF sections inside @file{foo.o} and
11038 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
11039 @file{foo.o} and @file{bar.o}, merges the two files into a single
11040 internal image, and compiles the result as usual.  Since both
11041 @file{foo.o} and @file{bar.o} are merged into a single image, this
11042 causes all the interprocedural analyses and optimizations in GCC to
11043 work across the two files as if they were a single one.  This means,
11044 for example, that the inliner is able to inline functions in
11045 @file{bar.o} into functions in @file{foo.o} and vice-versa.
11046
11047 Another (simpler) way to enable link-time optimization is:
11048
11049 @smallexample
11050 gcc -o myprog -flto -O2 foo.c bar.c
11051 @end smallexample
11052
11053 The above generates bytecode for @file{foo.c} and @file{bar.c},
11054 merges them together into a single GIMPLE representation and optimizes
11055 them as usual to produce @file{myprog}.
11056
11057 The important thing to keep in mind is that to enable link-time
11058 optimizations you need to use the GCC driver to perform the link step.
11059 GCC automatically performs link-time optimization if any of the
11060 objects involved were compiled with the @option{-flto} command-line option.  
11061 You can always override
11062 the automatic decision to do link-time optimization
11063 by passing @option{-fno-lto} to the link command.
11064
11065 To make whole program optimization effective, it is necessary to make
11066 certain whole program assumptions.  The compiler needs to know
11067 what functions and variables can be accessed by libraries and runtime
11068 outside of the link-time optimized unit.  When supported by the linker,
11069 the linker plugin (see @option{-fuse-linker-plugin}) passes information
11070 to the compiler about used and externally visible symbols.  When
11071 the linker plugin is not available, @option{-fwhole-program} should be
11072 used to allow the compiler to make these assumptions, which leads
11073 to more aggressive optimization decisions.
11074
11075 When a file is compiled with @option{-flto} without
11076 @option{-fuse-linker-plugin}, the generated object file is larger than
11077 a regular object file because it contains GIMPLE bytecodes and the usual
11078 final code (see @option{-ffat-lto-objects}.  This means that
11079 object files with LTO information can be linked as normal object
11080 files; if @option{-fno-lto} is passed to the linker, no
11081 interprocedural optimizations are applied.  Note that when
11082 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
11083 but you cannot perform a regular, non-LTO link on them.
11084
11085 When producing the final binary, GCC only
11086 applies link-time optimizations to those files that contain bytecode.
11087 Therefore, you can mix and match object files and libraries with
11088 GIMPLE bytecodes and final object code.  GCC automatically selects
11089 which files to optimize in LTO mode and which files to link without
11090 further processing.
11091
11092 Generally, options specified at link time override those
11093 specified at compile time, although in some cases GCC attempts to infer
11094 link-time options from the settings used to compile the input files.
11095
11096 If you do not specify an optimization level option @option{-O} at
11097 link time, then GCC uses the highest optimization level 
11098 used when compiling the object files.  Note that it is generally 
11099 ineffective to specify an optimization level option only at link time and 
11100 not at compile time, for two reasons.  First, compiling without 
11101 optimization suppresses compiler passes that gather information 
11102 needed for effective optimization at link time.  Second, some early
11103 optimization passes can be performed only at compile time and 
11104 not at link time.
11105
11106 There are some code generation flags preserved by GCC when
11107 generating bytecodes, as they need to be used during the final link.
11108 Currently, the following options and their settings are taken from
11109 the first object file that explicitly specifies them: 
11110 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
11111 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
11112 and all the @option{-m} target flags.
11113
11114 Certain ABI-changing flags are required to match in all compilation units,
11115 and trying to override this at link time with a conflicting value
11116 is ignored.  This includes options such as @option{-freg-struct-return}
11117 and @option{-fpcc-struct-return}. 
11118
11119 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
11120 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
11121 are passed through to the link stage and merged conservatively for
11122 conflicting translation units.  Specifically
11123 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
11124 precedence; and for example @option{-ffp-contract=off} takes precedence
11125 over @option{-ffp-contract=fast}.  You can override them at link time.
11126
11127 To enable debug info generation you need to supply @option{-g} at
11128 compile time.  If any of the input files at link time were built
11129 with debug info generation enabled the link will enable debug info
11130 generation as well.  Any elaborate debug info settings
11131 like the dwarf level @option{-gdwarf-5} need to be explicitly repeated
11132 at the linker command line and mixing different settings in different
11133 translation units is discouraged.
11134
11135 If LTO encounters objects with C linkage declared with incompatible
11136 types in separate translation units to be linked together (undefined
11137 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
11138 issued.  The behavior is still undefined at run time.  Similar
11139 diagnostics may be raised for other languages.
11140
11141 Another feature of LTO is that it is possible to apply interprocedural
11142 optimizations on files written in different languages:
11143
11144 @smallexample
11145 gcc -c -flto foo.c
11146 g++ -c -flto bar.cc
11147 gfortran -c -flto baz.f90
11148 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
11149 @end smallexample
11150
11151 Notice that the final link is done with @command{g++} to get the C++
11152 runtime libraries and @option{-lgfortran} is added to get the Fortran
11153 runtime libraries.  In general, when mixing languages in LTO mode, you
11154 should use the same link command options as when mixing languages in a
11155 regular (non-LTO) compilation.
11156
11157 If object files containing GIMPLE bytecode are stored in a library archive, say
11158 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
11159 are using a linker with plugin support.  To create static libraries suitable
11160 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
11161 and @command{ranlib}; 
11162 to show the symbols of object files with GIMPLE bytecode, use
11163 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
11164 and @command{nm} have been compiled with plugin support.  At link time, use the
11165 flag @option{-fuse-linker-plugin} to ensure that the library participates in
11166 the LTO optimization process:
11167
11168 @smallexample
11169 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
11170 @end smallexample
11171
11172 With the linker plugin enabled, the linker extracts the needed
11173 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
11174 to make them part of the aggregated GIMPLE image to be optimized.
11175
11176 If you are not using a linker with plugin support and/or do not
11177 enable the linker plugin, then the objects inside @file{libfoo.a}
11178 are extracted and linked as usual, but they do not participate
11179 in the LTO optimization process.  In order to make a static library suitable
11180 for both LTO optimization and usual linkage, compile its object files with
11181 @option{-flto} @option{-ffat-lto-objects}.
11182
11183 Link-time optimizations do not require the presence of the whole program to
11184 operate.  If the program does not require any symbols to be exported, it is
11185 possible to combine @option{-flto} and @option{-fwhole-program} to allow
11186 the interprocedural optimizers to use more aggressive assumptions which may
11187 lead to improved optimization opportunities.
11188 Use of @option{-fwhole-program} is not needed when linker plugin is
11189 active (see @option{-fuse-linker-plugin}).
11190
11191 The current implementation of LTO makes no
11192 attempt to generate bytecode that is portable between different
11193 types of hosts.  The bytecode files are versioned and there is a
11194 strict version check, so bytecode files generated in one version of
11195 GCC do not work with an older or newer version of GCC.
11196
11197 Link-time optimization does not work well with generation of debugging
11198 information on systems other than those using a combination of ELF and
11199 DWARF.
11200
11201 If you specify the optional @var{n}, the optimization and code
11202 generation done at link time is executed in parallel using @var{n}
11203 parallel jobs by utilizing an installed @command{make} program.  The
11204 environment variable @env{MAKE} may be used to override the program
11205 used.
11206
11207 You can also specify @option{-flto=jobserver} to use GNU make's
11208 job server mode to determine the number of parallel jobs. This
11209 is useful when the Makefile calling GCC is already executing in parallel.
11210 You must prepend a @samp{+} to the command recipe in the parent Makefile
11211 for this to work.  This option likely only works if @env{MAKE} is
11212 GNU make.  Even without the option value, GCC tries to automatically
11213 detect a running GNU make's job server.
11214
11215 Use @option{-flto=auto} to use GNU make's job server, if available,
11216 or otherwise fall back to autodetection of the number of CPU threads
11217 present in your system.
11218
11219 @item -flto-partition=@var{alg}
11220 @opindex flto-partition
11221 Specify the partitioning algorithm used by the link-time optimizer.
11222 The value is either @samp{1to1} to specify a partitioning mirroring
11223 the original source files or @samp{balanced} to specify partitioning
11224 into equally sized chunks (whenever possible) or @samp{max} to create
11225 new partition for every symbol where possible.  Specifying @samp{none}
11226 as an algorithm disables partitioning and streaming completely. 
11227 The default value is @samp{balanced}. While @samp{1to1} can be used
11228 as an workaround for various code ordering issues, the @samp{max}
11229 partitioning is intended for internal testing only.
11230 The value @samp{one} specifies that exactly one partition should be
11231 used while the value @samp{none} bypasses partitioning and executes
11232 the link-time optimization step directly from the WPA phase.
11233
11234 @item -flto-compression-level=@var{n}
11235 @opindex flto-compression-level
11236 This option specifies the level of compression used for intermediate
11237 language written to LTO object files, and is only meaningful in
11238 conjunction with LTO mode (@option{-flto}).  Valid
11239 values are 0 (no compression) to 9 (maximum compression).  Values
11240 outside this range are clamped to either 0 or 9.  If the option is not
11241 given, a default balanced compression setting is used.
11242
11243 @item -fuse-linker-plugin
11244 @opindex fuse-linker-plugin
11245 Enables the use of a linker plugin during link-time optimization.  This
11246 option relies on plugin support in the linker, which is available in gold
11247 or in GNU ld 2.21 or newer.
11248
11249 This option enables the extraction of object files with GIMPLE bytecode out
11250 of library archives. This improves the quality of optimization by exposing
11251 more code to the link-time optimizer.  This information specifies what
11252 symbols can be accessed externally (by non-LTO object or during dynamic
11253 linking).  Resulting code quality improvements on binaries (and shared
11254 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
11255 See @option{-flto} for a description of the effect of this flag and how to
11256 use it.
11257
11258 This option is enabled by default when LTO support in GCC is enabled
11259 and GCC was configured for use with
11260 a linker supporting plugins (GNU ld 2.21 or newer or gold).
11261
11262 @item -ffat-lto-objects
11263 @opindex ffat-lto-objects
11264 Fat LTO objects are object files that contain both the intermediate language
11265 and the object code. This makes them usable for both LTO linking and normal
11266 linking. This option is effective only when compiling with @option{-flto}
11267 and is ignored at link time.
11268
11269 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
11270 requires the complete toolchain to be aware of LTO. It requires a linker with
11271 linker plugin support for basic functionality.  Additionally,
11272 @command{nm}, @command{ar} and @command{ranlib}
11273 need to support linker plugins to allow a full-featured build environment
11274 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
11275 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
11276 to these tools. With non fat LTO makefiles need to be modified to use them.
11277
11278 Note that modern binutils provide plugin auto-load mechanism.
11279 Installing the linker plugin into @file{$libdir/bfd-plugins} has the same
11280 effect as usage of the command wrappers (@command{gcc-ar}, @command{gcc-nm} and
11281 @command{gcc-ranlib}).
11282
11283 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
11284 support.
11285
11286 @item -fcompare-elim
11287 @opindex fcompare-elim
11288 After register allocation and post-register allocation instruction splitting,
11289 identify arithmetic instructions that compute processor flags similar to a
11290 comparison operation based on that arithmetic.  If possible, eliminate the
11291 explicit comparison operation.
11292
11293 This pass only applies to certain targets that cannot explicitly represent
11294 the comparison operation before register allocation is complete.
11295
11296 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
11297
11298 @item -fcprop-registers
11299 @opindex fcprop-registers
11300 After register allocation and post-register allocation instruction splitting,
11301 perform a copy-propagation pass to try to reduce scheduling dependencies
11302 and occasionally eliminate the copy.
11303
11304 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
11305
11306 @item -fprofile-correction
11307 @opindex fprofile-correction
11308 Profiles collected using an instrumented binary for multi-threaded programs may
11309 be inconsistent due to missed counter updates. When this option is specified,
11310 GCC uses heuristics to correct or smooth out such inconsistencies. By
11311 default, GCC emits an error message when an inconsistent profile is detected.
11312
11313 This option is enabled by @option{-fauto-profile}.
11314
11315 @item -fprofile-partial-training
11316 @opindex fprofile-use
11317 With @code{-fprofile-use} all portions of programs not executed during train
11318 run are optimized agressively for size rather than speed.  In some cases it is
11319 not practical to train all possible hot paths in the program. (For
11320 example, program may contain functions specific for a given hardware and
11321 trianing may not cover all hardware configurations program is run on.)  With
11322 @code{-fprofile-partial-training} profile feedback will be ignored for all
11323 functions not executed during the train run leading them to be optimized as if
11324 they were compiled without profile feedback. This leads to better performance
11325 when train run is not representative but also leads to significantly bigger
11326 code.
11327
11328 @item -fprofile-use
11329 @itemx -fprofile-use=@var{path}
11330 @opindex fprofile-use
11331 Enable profile feedback-directed optimizations, 
11332 and the following optimizations, many of which
11333 are generally profitable only with profile feedback available:
11334
11335 @gccoptlist{-fbranch-probabilities  -fprofile-values @gol
11336 -funroll-loops  -fpeel-loops  -ftracer  -fvpt @gol
11337 -finline-functions  -fipa-cp  -fipa-cp-clone  -fipa-bit-cp @gol
11338 -fpredictive-commoning  -fsplit-loops  -funswitch-loops @gol
11339 -fgcse-after-reload  -ftree-loop-vectorize  -ftree-slp-vectorize @gol
11340 -fvect-cost-model=dynamic  -ftree-loop-distribute-patterns @gol
11341 -fprofile-reorder-functions}
11342
11343 Before you can use this option, you must first generate profiling information.
11344 @xref{Instrumentation Options}, for information about the
11345 @option{-fprofile-generate} option.
11346
11347 By default, GCC emits an error message if the feedback profiles do not
11348 match the source code.  This error can be turned into a warning by using
11349 @option{-Wno-error=coverage-mismatch}.  Note this may result in poorly
11350 optimized code.  Additionally, by default, GCC also emits a warning message if
11351 the feedback profiles do not exist (see @option{-Wmissing-profile}).
11352
11353 If @var{path} is specified, GCC looks at the @var{path} to find
11354 the profile feedback data files. See @option{-fprofile-dir}.
11355
11356 @item -fauto-profile
11357 @itemx -fauto-profile=@var{path}
11358 @opindex fauto-profile
11359 Enable sampling-based feedback-directed optimizations, 
11360 and the following optimizations,
11361 many of which are generally profitable only with profile feedback available:
11362
11363 @gccoptlist{-fbranch-probabilities  -fprofile-values @gol
11364 -funroll-loops  -fpeel-loops  -ftracer  -fvpt @gol
11365 -finline-functions  -fipa-cp  -fipa-cp-clone  -fipa-bit-cp @gol
11366 -fpredictive-commoning  -fsplit-loops  -funswitch-loops @gol
11367 -fgcse-after-reload  -ftree-loop-vectorize  -ftree-slp-vectorize @gol
11368 -fvect-cost-model=dynamic  -ftree-loop-distribute-patterns @gol
11369 -fprofile-correction}
11370
11371 @var{path} is the name of a file containing AutoFDO profile information.
11372 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
11373
11374 Producing an AutoFDO profile data file requires running your program
11375 with the @command{perf} utility on a supported GNU/Linux target system.
11376 For more information, see @uref{https://perf.wiki.kernel.org/}.
11377
11378 E.g.
11379 @smallexample
11380 perf record -e br_inst_retired:near_taken -b -o perf.data \
11381     -- your_program
11382 @end smallexample
11383
11384 Then use the @command{create_gcov} tool to convert the raw profile data
11385 to a format that can be used by GCC.@  You must also supply the 
11386 unstripped binary for your program to this tool.  
11387 See @uref{https://github.com/google/autofdo}.
11388
11389 E.g.
11390 @smallexample
11391 create_gcov --binary=your_program.unstripped --profile=perf.data \
11392     --gcov=profile.afdo
11393 @end smallexample
11394 @end table
11395
11396 The following options control compiler behavior regarding floating-point 
11397 arithmetic.  These options trade off between speed and
11398 correctness.  All must be specifically enabled.
11399
11400 @table @gcctabopt
11401 @item -ffloat-store
11402 @opindex ffloat-store
11403 Do not store floating-point variables in registers, and inhibit other
11404 options that might change whether a floating-point value is taken from a
11405 register or memory.
11406
11407 @cindex floating-point precision
11408 This option prevents undesirable excess precision on machines such as
11409 the 68000 where the floating registers (of the 68881) keep more
11410 precision than a @code{double} is supposed to have.  Similarly for the
11411 x86 architecture.  For most programs, the excess precision does only
11412 good, but a few programs rely on the precise definition of IEEE floating
11413 point.  Use @option{-ffloat-store} for such programs, after modifying
11414 them to store all pertinent intermediate computations into variables.
11415
11416 @item -fexcess-precision=@var{style}
11417 @opindex fexcess-precision
11418 This option allows further control over excess precision on machines
11419 where floating-point operations occur in a format with more precision or
11420 range than the IEEE standard and interchange floating-point types.  By
11421 default, @option{-fexcess-precision=fast} is in effect; this means that
11422 operations may be carried out in a wider precision than the types specified
11423 in the source if that would result in faster code, and it is unpredictable
11424 when rounding to the types specified in the source code takes place.
11425 When compiling C, if @option{-fexcess-precision=standard} is specified then
11426 excess precision follows the rules specified in ISO C99; in particular,
11427 both casts and assignments cause values to be rounded to their
11428 semantic types (whereas @option{-ffloat-store} only affects
11429 assignments).  This option is enabled by default for C if a strict
11430 conformance option such as @option{-std=c99} is used.
11431 @option{-ffast-math} enables @option{-fexcess-precision=fast} by default
11432 regardless of whether a strict conformance option is used.
11433
11434 @opindex mfpmath
11435 @option{-fexcess-precision=standard} is not implemented for languages
11436 other than C.  On the x86, it has no effect if @option{-mfpmath=sse}
11437 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
11438 semantics apply without excess precision, and in the latter, rounding
11439 is unpredictable.
11440
11441 @item -ffast-math
11442 @opindex ffast-math
11443 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
11444 @option{-ffinite-math-only}, @option{-fno-rounding-math},
11445 @option{-fno-signaling-nans}, @option{-fcx-limited-range} and
11446 @option{-fexcess-precision=fast}.
11447
11448 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
11449
11450 This option is not turned on by any @option{-O} option besides
11451 @option{-Ofast} since it can result in incorrect output for programs
11452 that depend on an exact implementation of IEEE or ISO rules/specifications
11453 for math functions. It may, however, yield faster code for programs
11454 that do not require the guarantees of these specifications.
11455
11456 @item -fno-math-errno
11457 @opindex fno-math-errno
11458 @opindex fmath-errno
11459 Do not set @code{errno} after calling math functions that are executed
11460 with a single instruction, e.g., @code{sqrt}.  A program that relies on
11461 IEEE exceptions for math error handling may want to use this flag
11462 for speed while maintaining IEEE arithmetic compatibility.
11463
11464 This option is not turned on by any @option{-O} option since
11465 it can result in incorrect output for programs that depend on
11466 an exact implementation of IEEE or ISO rules/specifications for
11467 math functions. It may, however, yield faster code for programs
11468 that do not require the guarantees of these specifications.
11469
11470 The default is @option{-fmath-errno}.
11471
11472 On Darwin systems, the math library never sets @code{errno}.  There is
11473 therefore no reason for the compiler to consider the possibility that
11474 it might, and @option{-fno-math-errno} is the default.
11475
11476 @item -funsafe-math-optimizations
11477 @opindex funsafe-math-optimizations
11478
11479 Allow optimizations for floating-point arithmetic that (a) assume
11480 that arguments and results are valid and (b) may violate IEEE or
11481 ANSI standards.  When used at link time, it may include libraries
11482 or startup files that change the default FPU control word or other
11483 similar optimizations.
11484
11485 This option is not turned on by any @option{-O} option since
11486 it can result in incorrect output for programs that depend on
11487 an exact implementation of IEEE or ISO rules/specifications for
11488 math functions. It may, however, yield faster code for programs
11489 that do not require the guarantees of these specifications.
11490 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
11491 @option{-fassociative-math} and @option{-freciprocal-math}.
11492
11493 The default is @option{-fno-unsafe-math-optimizations}.
11494
11495 @item -fassociative-math
11496 @opindex fassociative-math
11497
11498 Allow re-association of operands in series of floating-point operations.
11499 This violates the ISO C and C++ language standard by possibly changing
11500 computation result.  NOTE: re-ordering may change the sign of zero as
11501 well as ignore NaNs and inhibit or create underflow or overflow (and
11502 thus cannot be used on code that relies on rounding behavior like
11503 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
11504 and thus may not be used when ordered comparisons are required.
11505 This option requires that both @option{-fno-signed-zeros} and
11506 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
11507 much sense with @option{-frounding-math}. For Fortran the option
11508 is automatically enabled when both @option{-fno-signed-zeros} and
11509 @option{-fno-trapping-math} are in effect.
11510
11511 The default is @option{-fno-associative-math}.
11512
11513 @item -freciprocal-math
11514 @opindex freciprocal-math
11515
11516 Allow the reciprocal of a value to be used instead of dividing by
11517 the value if this enables optimizations.  For example @code{x / y}
11518 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
11519 is subject to common subexpression elimination.  Note that this loses
11520 precision and increases the number of flops operating on the value.
11521
11522 The default is @option{-fno-reciprocal-math}.
11523
11524 @item -ffinite-math-only
11525 @opindex ffinite-math-only
11526 Allow optimizations for floating-point arithmetic that assume
11527 that arguments and results are not NaNs or +-Infs.
11528
11529 This option is not turned on by any @option{-O} option since
11530 it can result in incorrect output for programs that depend on
11531 an exact implementation of IEEE or ISO rules/specifications for
11532 math functions. It may, however, yield faster code for programs
11533 that do not require the guarantees of these specifications.
11534
11535 The default is @option{-fno-finite-math-only}.
11536
11537 @item -fno-signed-zeros
11538 @opindex fno-signed-zeros
11539 @opindex fsigned-zeros
11540 Allow optimizations for floating-point arithmetic that ignore the
11541 signedness of zero.  IEEE arithmetic specifies the behavior of
11542 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
11543 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
11544 This option implies that the sign of a zero result isn't significant.
11545
11546 The default is @option{-fsigned-zeros}.
11547
11548 @item -fno-trapping-math
11549 @opindex fno-trapping-math
11550 @opindex ftrapping-math
11551 Compile code assuming that floating-point operations cannot generate
11552 user-visible traps.  These traps include division by zero, overflow,
11553 underflow, inexact result and invalid operation.  This option requires
11554 that @option{-fno-signaling-nans} be in effect.  Setting this option may
11555 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
11556
11557 This option should never be turned on by any @option{-O} option since
11558 it can result in incorrect output for programs that depend on
11559 an exact implementation of IEEE or ISO rules/specifications for
11560 math functions.
11561
11562 The default is @option{-ftrapping-math}.
11563
11564 @item -frounding-math
11565 @opindex frounding-math
11566 Disable transformations and optimizations that assume default floating-point
11567 rounding behavior.  This is round-to-zero for all floating point
11568 to integer conversions, and round-to-nearest for all other arithmetic
11569 truncations.  This option should be specified for programs that change
11570 the FP rounding mode dynamically, or that may be executed with a
11571 non-default rounding mode.  This option disables constant folding of
11572 floating-point expressions at compile time (which may be affected by
11573 rounding mode) and arithmetic transformations that are unsafe in the
11574 presence of sign-dependent rounding modes.
11575
11576 The default is @option{-fno-rounding-math}.
11577
11578 This option is experimental and does not currently guarantee to
11579 disable all GCC optimizations that are affected by rounding mode.
11580 Future versions of GCC may provide finer control of this setting
11581 using C99's @code{FENV_ACCESS} pragma.  This command-line option
11582 will be used to specify the default state for @code{FENV_ACCESS}.
11583
11584 @item -fsignaling-nans
11585 @opindex fsignaling-nans
11586 Compile code assuming that IEEE signaling NaNs may generate user-visible
11587 traps during floating-point operations.  Setting this option disables
11588 optimizations that may change the number of exceptions visible with
11589 signaling NaNs.  This option implies @option{-ftrapping-math}.
11590
11591 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
11592 be defined.
11593
11594 The default is @option{-fno-signaling-nans}.
11595
11596 This option is experimental and does not currently guarantee to
11597 disable all GCC optimizations that affect signaling NaN behavior.
11598
11599 @item -fno-fp-int-builtin-inexact
11600 @opindex fno-fp-int-builtin-inexact
11601 @opindex ffp-int-builtin-inexact
11602 Do not allow the built-in functions @code{ceil}, @code{floor},
11603 @code{round} and @code{trunc}, and their @code{float} and @code{long
11604 double} variants, to generate code that raises the ``inexact''
11605 floating-point exception for noninteger arguments.  ISO C99 and C11
11606 allow these functions to raise the ``inexact'' exception, but ISO/IEC
11607 TS 18661-1:2014, the C bindings to IEEE 754-2008, as integrated into
11608 ISO C2X, does not allow these functions to do so.
11609
11610 The default is @option{-ffp-int-builtin-inexact}, allowing the
11611 exception to be raised, unless C2X or a later C standard is selected.
11612 This option does nothing unless @option{-ftrapping-math} is in effect.
11613
11614 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
11615 generate a call to a library function then the ``inexact'' exception
11616 may be raised if the library implementation does not follow TS 18661.
11617
11618 @item -fsingle-precision-constant
11619 @opindex fsingle-precision-constant
11620 Treat floating-point constants as single precision instead of
11621 implicitly converting them to double-precision constants.
11622
11623 @item -fcx-limited-range
11624 @opindex fcx-limited-range
11625 When enabled, this option states that a range reduction step is not
11626 needed when performing complex division.  Also, there is no checking
11627 whether the result of a complex multiplication or division is @code{NaN
11628 + I*NaN}, with an attempt to rescue the situation in that case.  The
11629 default is @option{-fno-cx-limited-range}, but is enabled by
11630 @option{-ffast-math}.
11631
11632 This option controls the default setting of the ISO C99
11633 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
11634 all languages.
11635
11636 @item -fcx-fortran-rules
11637 @opindex fcx-fortran-rules
11638 Complex multiplication and division follow Fortran rules.  Range
11639 reduction is done as part of complex division, but there is no checking
11640 whether the result of a complex multiplication or division is @code{NaN
11641 + I*NaN}, with an attempt to rescue the situation in that case.
11642
11643 The default is @option{-fno-cx-fortran-rules}.
11644
11645 @end table
11646
11647 The following options control optimizations that may improve
11648 performance, but are not enabled by any @option{-O} options.  This
11649 section includes experimental options that may produce broken code.
11650
11651 @table @gcctabopt
11652 @item -fbranch-probabilities
11653 @opindex fbranch-probabilities
11654 After running a program compiled with @option{-fprofile-arcs}
11655 (@pxref{Instrumentation Options}),
11656 you can compile it a second time using
11657 @option{-fbranch-probabilities}, to improve optimizations based on
11658 the number of times each branch was taken.  When a program
11659 compiled with @option{-fprofile-arcs} exits, it saves arc execution
11660 counts to a file called @file{@var{sourcename}.gcda} for each source
11661 file.  The information in this data file is very dependent on the
11662 structure of the generated code, so you must use the same source code
11663 and the same optimization options for both compilations.
11664
11665 With @option{-fbranch-probabilities}, GCC puts a
11666 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
11667 These can be used to improve optimization.  Currently, they are only
11668 used in one place: in @file{reorg.c}, instead of guessing which path a
11669 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
11670 exactly determine which path is taken more often.
11671
11672 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11673
11674 @item -fprofile-values
11675 @opindex fprofile-values
11676 If combined with @option{-fprofile-arcs}, it adds code so that some
11677 data about values of expressions in the program is gathered.
11678
11679 With @option{-fbranch-probabilities}, it reads back the data gathered
11680 from profiling values of expressions for usage in optimizations.
11681
11682 Enabled by @option{-fprofile-generate}, @option{-fprofile-use}, and
11683 @option{-fauto-profile}.
11684
11685 @item -fprofile-reorder-functions
11686 @opindex fprofile-reorder-functions
11687 Function reordering based on profile instrumentation collects
11688 first time of execution of a function and orders these functions
11689 in ascending order.
11690
11691 Enabled with @option{-fprofile-use}.
11692
11693 @item -fvpt
11694 @opindex fvpt
11695 If combined with @option{-fprofile-arcs}, this option instructs the compiler
11696 to add code to gather information about values of expressions.
11697
11698 With @option{-fbranch-probabilities}, it reads back the data gathered
11699 and actually performs the optimizations based on them.
11700 Currently the optimizations include specialization of division operations
11701 using the knowledge about the value of the denominator.
11702
11703 Enabled with @option{-fprofile-use} and @option{-fauto-profile}.
11704
11705 @item -frename-registers
11706 @opindex frename-registers
11707 Attempt to avoid false dependencies in scheduled code by making use
11708 of registers left over after register allocation.  This optimization
11709 most benefits processors with lots of registers.  Depending on the
11710 debug information format adopted by the target, however, it can
11711 make debugging impossible, since variables no longer stay in
11712 a ``home register''.
11713
11714 Enabled by default with @option{-funroll-loops}.
11715
11716 @item -fschedule-fusion
11717 @opindex fschedule-fusion
11718 Performs a target dependent pass over the instruction stream to schedule
11719 instructions of same type together because target machine can execute them
11720 more efficiently if they are adjacent to each other in the instruction flow.
11721
11722 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
11723
11724 @item -ftracer
11725 @opindex ftracer
11726 Perform tail duplication to enlarge superblock size.  This transformation
11727 simplifies the control flow of the function allowing other optimizations to do
11728 a better job.
11729
11730 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11731
11732 @item -funroll-loops
11733 @opindex funroll-loops
11734 Unroll loops whose number of iterations can be determined at compile time or
11735 upon entry to the loop.  @option{-funroll-loops} implies
11736 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
11737 It also turns on complete loop peeling (i.e.@: complete removal of loops with
11738 a small constant number of iterations).  This option makes code larger, and may
11739 or may not make it run faster.
11740
11741 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11742
11743 @item -funroll-all-loops
11744 @opindex funroll-all-loops
11745 Unroll all loops, even if their number of iterations is uncertain when
11746 the loop is entered.  This usually makes programs run more slowly.
11747 @option{-funroll-all-loops} implies the same options as
11748 @option{-funroll-loops}.
11749
11750 @item -fpeel-loops
11751 @opindex fpeel-loops
11752 Peels loops for which there is enough information that they do not
11753 roll much (from profile feedback or static analysis).  It also turns on
11754 complete loop peeling (i.e.@: complete removal of loops with small constant
11755 number of iterations).
11756
11757 Enabled by @option{-O3}, @option{-fprofile-use}, and @option{-fauto-profile}.
11758
11759 @item -fmove-loop-invariants
11760 @opindex fmove-loop-invariants
11761 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
11762 at level @option{-O1} and higher, except for @option{-Og}.
11763
11764 @item -fsplit-loops
11765 @opindex fsplit-loops
11766 Split a loop into two if it contains a condition that's always true
11767 for one side of the iteration space and false for the other.
11768
11769 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11770
11771 @item -funswitch-loops
11772 @opindex funswitch-loops
11773 Move branches with loop invariant conditions out of the loop, with duplicates
11774 of the loop on both branches (modified according to result of the condition).
11775
11776 Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11777
11778 @item -fversion-loops-for-strides
11779 @opindex fversion-loops-for-strides
11780 If a loop iterates over an array with a variable stride, create another
11781 version of the loop that assumes the stride is always one.  For example:
11782
11783 @smallexample
11784 for (int i = 0; i < n; ++i)
11785   x[i * stride] = @dots{};
11786 @end smallexample
11787
11788 becomes:
11789
11790 @smallexample
11791 if (stride == 1)
11792   for (int i = 0; i < n; ++i)
11793     x[i] = @dots{};
11794 else
11795   for (int i = 0; i < n; ++i)
11796     x[i * stride] = @dots{};
11797 @end smallexample
11798
11799 This is particularly useful for assumed-shape arrays in Fortran where
11800 (for example) it allows better vectorization assuming contiguous accesses.
11801 This flag is enabled by default at @option{-O3}.
11802 It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
11803
11804 @item -ffunction-sections
11805 @itemx -fdata-sections
11806 @opindex ffunction-sections
11807 @opindex fdata-sections
11808 Place each function or data item into its own section in the output
11809 file if the target supports arbitrary sections.  The name of the
11810 function or the name of the data item determines the section's name
11811 in the output file.
11812
11813 Use these options on systems where the linker can perform optimizations to
11814 improve locality of reference in the instruction space.  Most systems using the
11815 ELF object format have linkers with such optimizations.  On AIX, the linker
11816 rearranges sections (CSECTs) based on the call graph.  The performance impact
11817 varies.
11818
11819 Together with a linker garbage collection (linker @option{--gc-sections}
11820 option) these options may lead to smaller statically-linked executables (after
11821 stripping).
11822
11823 On ELF/DWARF systems these options do not degenerate the quality of the debug
11824 information.  There could be issues with other object files/debug info formats.
11825
11826 Only use these options when there are significant benefits from doing so.  When
11827 you specify these options, the assembler and linker create larger object and
11828 executable files and are also slower.  These options affect code generation.
11829 They prevent optimizations by the compiler and assembler using relative
11830 locations inside a translation unit since the locations are unknown until
11831 link time.  An example of such an optimization is relaxing calls to short call
11832 instructions.
11833
11834 @item -fstdarg-opt
11835 @opindex fstdarg-opt
11836 Optimize the prologue of variadic argument functions with respect to usage of
11837 those arguments.
11838
11839 @item -fsection-anchors
11840 @opindex fsection-anchors
11841 Try to reduce the number of symbolic address calculations by using
11842 shared ``anchor'' symbols to address nearby objects.  This transformation
11843 can help to reduce the number of GOT entries and GOT accesses on some
11844 targets.
11845
11846 For example, the implementation of the following function @code{foo}:
11847
11848 @smallexample
11849 static int a, b, c;
11850 int foo (void) @{ return a + b + c; @}
11851 @end smallexample
11852
11853 @noindent
11854 usually calculates the addresses of all three variables, but if you
11855 compile it with @option{-fsection-anchors}, it accesses the variables
11856 from a common anchor point instead.  The effect is similar to the
11857 following pseudocode (which isn't valid C):
11858
11859 @smallexample
11860 int foo (void)
11861 @{
11862   register int *xr = &x;
11863   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
11864 @}
11865 @end smallexample
11866
11867 Not all targets support this option.
11868
11869 @item --param @var{name}=@var{value}
11870 @opindex param
11871 In some places, GCC uses various constants to control the amount of
11872 optimization that is done.  For example, GCC does not inline functions
11873 that contain more than a certain number of instructions.  You can
11874 control some of these constants on the command line using the
11875 @option{--param} option.
11876
11877 The names of specific parameters, and the meaning of the values, are
11878 tied to the internals of the compiler, and are subject to change
11879 without notice in future releases.
11880
11881 In order to get minimal, maximal and default value of a parameter,
11882 one can use @option{--help=param -Q} options.
11883
11884 In each case, the @var{value} is an integer.  The following choices
11885 of @var{name} are recognized for all targets:
11886
11887 @table @gcctabopt
11888 @item predictable-branch-outcome
11889 When branch is predicted to be taken with probability lower than this threshold
11890 (in percent), then it is considered well predictable.
11891
11892 @item max-rtl-if-conversion-insns
11893 RTL if-conversion tries to remove conditional branches around a block and
11894 replace them with conditionally executed instructions.  This parameter
11895 gives the maximum number of instructions in a block which should be
11896 considered for if-conversion.  The compiler will
11897 also use other heuristics to decide whether if-conversion is likely to be
11898 profitable.
11899
11900 @item max-rtl-if-conversion-predictable-cost
11901 @itemx max-rtl-if-conversion-unpredictable-cost
11902 RTL if-conversion will try to remove conditional branches around a block
11903 and replace them with conditionally executed instructions.  These parameters
11904 give the maximum permissible cost for the sequence that would be generated
11905 by if-conversion depending on whether the branch is statically determined
11906 to be predictable or not.  The units for this parameter are the same as
11907 those for the GCC internal seq_cost metric.  The compiler will try to
11908 provide a reasonable default for this parameter using the BRANCH_COST
11909 target macro.
11910
11911 @item max-crossjump-edges
11912 The maximum number of incoming edges to consider for cross-jumping.
11913 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
11914 the number of edges incoming to each block.  Increasing values mean
11915 more aggressive optimization, making the compilation time increase with
11916 probably small improvement in executable size.
11917
11918 @item min-crossjump-insns
11919 The minimum number of instructions that must be matched at the end
11920 of two blocks before cross-jumping is performed on them.  This
11921 value is ignored in the case where all instructions in the block being
11922 cross-jumped from are matched.
11923
11924 @item max-grow-copy-bb-insns
11925 The maximum code size expansion factor when copying basic blocks
11926 instead of jumping.  The expansion is relative to a jump instruction.
11927
11928 @item max-goto-duplication-insns
11929 The maximum number of instructions to duplicate to a block that jumps
11930 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
11931 passes, GCC factors computed gotos early in the compilation process,
11932 and unfactors them as late as possible.  Only computed jumps at the
11933 end of a basic blocks with no more than max-goto-duplication-insns are
11934 unfactored.
11935
11936 @item max-delay-slot-insn-search
11937 The maximum number of instructions to consider when looking for an
11938 instruction to fill a delay slot.  If more than this arbitrary number of
11939 instructions are searched, the time savings from filling the delay slot
11940 are minimal, so stop searching.  Increasing values mean more
11941 aggressive optimization, making the compilation time increase with probably
11942 small improvement in execution time.
11943
11944 @item max-delay-slot-live-search
11945 When trying to fill delay slots, the maximum number of instructions to
11946 consider when searching for a block with valid live register
11947 information.  Increasing this arbitrarily chosen value means more
11948 aggressive optimization, increasing the compilation time.  This parameter
11949 should be removed when the delay slot code is rewritten to maintain the
11950 control-flow graph.
11951
11952 @item max-gcse-memory
11953 The approximate maximum amount of memory that can be allocated in
11954 order to perform the global common subexpression elimination
11955 optimization.  If more memory than specified is required, the
11956 optimization is not done.
11957
11958 @item max-gcse-insertion-ratio
11959 If the ratio of expression insertions to deletions is larger than this value
11960 for any expression, then RTL PRE inserts or removes the expression and thus
11961 leaves partially redundant computations in the instruction stream.
11962
11963 @item max-pending-list-length
11964 The maximum number of pending dependencies scheduling allows
11965 before flushing the current state and starting over.  Large functions
11966 with few branches or calls can create excessively large lists which
11967 needlessly consume memory and resources.
11968
11969 @item max-modulo-backtrack-attempts
11970 The maximum number of backtrack attempts the scheduler should make
11971 when modulo scheduling a loop.  Larger values can exponentially increase
11972 compilation time.
11973
11974 @item max-inline-insns-single
11975 Several parameters control the tree inliner used in GCC@.  This number sets the
11976 maximum number of instructions (counted in GCC's internal representation) in a
11977 single function that the tree inliner considers for inlining.  This only
11978 affects functions declared inline and methods implemented in a class
11979 declaration (C++). 
11980
11981
11982 @item max-inline-insns-auto
11983 When you use @option{-finline-functions} (included in @option{-O3}),
11984 a lot of functions that would otherwise not be considered for inlining
11985 by the compiler are investigated.  To those functions, a different
11986 (more restrictive) limit compared to functions declared inline can
11987 be applied (@option{--param max-inline-insns-auto}).
11988
11989 @item max-inline-insns-small
11990 This is bound applied to calls which are considered relevant with
11991 @option{-finline-small-functions}.
11992
11993 @item max-inline-insns-size
11994 This is bound applied to calls which are optimized for size. Small growth
11995 may be desirable to anticipate optimization oppurtunities exposed by inlining.
11996
11997 @item uninlined-function-insns
11998 Number of instructions accounted by inliner for function overhead such as
11999 function prologue and epilogue.
12000
12001 @item uninlined-function-time
12002 Extra time accounted by inliner for function overhead such as time needed to
12003 execute function prologue and epilogue
12004
12005 @item inline-heuristics-hint-percent
12006 The scale (in percents) applied to @option{inline-insns-single},
12007 @option{inline-insns-single-O2}, @option{inline-insns-auto}
12008 when inline heuristics hints that inlining is
12009 very profitable (will enable later optimizations).
12010
12011 @item uninlined-thunk-insns
12012 @item uninlined-thunk-time
12013 Same as @option{--param uninlined-function-insns} and
12014 @option{--param uninlined-function-time} but applied to function thunks
12015
12016 @item inline-min-speedup
12017 When estimated performance improvement of caller + callee runtime exceeds this
12018 threshold (in percent), the function can be inlined regardless of the limit on
12019 @option{--param max-inline-insns-single} and @option{--param
12020 max-inline-insns-auto}.
12021
12022 @item large-function-insns
12023 The limit specifying really large functions.  For functions larger than this
12024 limit after inlining, inlining is constrained by
12025 @option{--param large-function-growth}.  This parameter is useful primarily
12026 to avoid extreme compilation time caused by non-linear algorithms used by the
12027 back end.
12028
12029 @item large-function-growth
12030 Specifies maximal growth of large function caused by inlining in percents.
12031 For example, parameter value 100 limits large function growth to 2.0 times
12032 the original size.
12033
12034 @item large-unit-insns
12035 The limit specifying large translation unit.  Growth caused by inlining of
12036 units larger than this limit is limited by @option{--param inline-unit-growth}.
12037 For small units this might be too tight.
12038 For example, consider a unit consisting of function A
12039 that is inline and B that just calls A three times.  If B is small relative to
12040 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
12041 large units consisting of small inlineable functions, however, the overall unit
12042 growth limit is needed to avoid exponential explosion of code size.  Thus for
12043 smaller units, the size is increased to @option{--param large-unit-insns}
12044 before applying @option{--param inline-unit-growth}.
12045
12046 @item inline-unit-growth
12047 Specifies maximal overall growth of the compilation unit caused by inlining.
12048 For example, parameter value 20 limits unit growth to 1.2 times the original
12049 size. Cold functions (either marked cold via an attribute or by profile
12050 feedback) are not accounted into the unit size.
12051
12052 @item ipcp-unit-growth
12053 Specifies maximal overall growth of the compilation unit caused by
12054 interprocedural constant propagation.  For example, parameter value 10 limits
12055 unit growth to 1.1 times the original size.
12056
12057 @item large-stack-frame
12058 The limit specifying large stack frames.  While inlining the algorithm is trying
12059 to not grow past this limit too much.
12060
12061 @item large-stack-frame-growth
12062 Specifies maximal growth of large stack frames caused by inlining in percents.
12063 For example, parameter value 1000 limits large stack frame growth to 11 times
12064 the original size.
12065
12066 @item max-inline-insns-recursive
12067 @itemx max-inline-insns-recursive-auto
12068 Specifies the maximum number of instructions an out-of-line copy of a
12069 self-recursive inline
12070 function can grow into by performing recursive inlining.
12071
12072 @option{--param max-inline-insns-recursive} applies to functions
12073 declared inline.
12074 For functions not declared inline, recursive inlining
12075 happens only when @option{-finline-functions} (included in @option{-O3}) is
12076 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.
12077
12078 @item max-inline-recursive-depth
12079 @itemx max-inline-recursive-depth-auto
12080 Specifies the maximum recursion depth used for recursive inlining.
12081
12082 @option{--param max-inline-recursive-depth} applies to functions
12083 declared inline.  For functions not declared inline, recursive inlining
12084 happens only when @option{-finline-functions} (included in @option{-O3}) is
12085 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.
12086
12087 @item min-inline-recursive-probability
12088 Recursive inlining is profitable only for function having deep recursion
12089 in average and can hurt for function having little recursion depth by
12090 increasing the prologue size or complexity of function body to other
12091 optimizers.
12092
12093 When profile feedback is available (see @option{-fprofile-generate}) the actual
12094 recursion depth can be guessed from the probability that function recurses
12095 via a given call expression.  This parameter limits inlining only to call
12096 expressions whose probability exceeds the given threshold (in percents).
12097
12098 @item early-inlining-insns
12099 Specify growth that the early inliner can make.  In effect it increases
12100 the amount of inlining for code having a large abstraction penalty.
12101
12102 @item max-early-inliner-iterations
12103 Limit of iterations of the early inliner.  This basically bounds
12104 the number of nested indirect calls the early inliner can resolve.
12105 Deeper chains are still handled by late inlining.
12106
12107 @item comdat-sharing-probability
12108 Probability (in percent) that C++ inline function with comdat visibility
12109 are shared across multiple compilation units.
12110
12111 @item profile-func-internal-id
12112 A parameter to control whether to use function internal id in profile
12113 database lookup. If the value is 0, the compiler uses an id that
12114 is based on function assembler name and filename, which makes old profile
12115 data more tolerant to source changes such as function reordering etc.
12116
12117 @item min-vect-loop-bound
12118 The minimum number of iterations under which loops are not vectorized
12119 when @option{-ftree-vectorize} is used.  The number of iterations after
12120 vectorization needs to be greater than the value specified by this option
12121 to allow vectorization.
12122
12123 @item gcse-cost-distance-ratio
12124 Scaling factor in calculation of maximum distance an expression
12125 can be moved by GCSE optimizations.  This is currently supported only in the
12126 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
12127 is with simple expressions, i.e., the expressions that have cost
12128 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
12129 hoisting of simple expressions.
12130
12131 @item gcse-unrestricted-cost
12132 Cost, roughly measured as the cost of a single typical machine
12133 instruction, at which GCSE optimizations do not constrain
12134 the distance an expression can travel.  This is currently
12135 supported only in the code hoisting pass.  The lesser the cost,
12136 the more aggressive code hoisting is.  Specifying 0 
12137 allows all expressions to travel unrestricted distances.
12138
12139 @item max-hoist-depth
12140 The depth of search in the dominator tree for expressions to hoist.
12141 This is used to avoid quadratic behavior in hoisting algorithm.
12142 The value of 0 does not limit on the search, but may slow down compilation
12143 of huge functions.
12144
12145 @item max-tail-merge-comparisons
12146 The maximum amount of similar bbs to compare a bb with.  This is used to
12147 avoid quadratic behavior in tree tail merging.
12148
12149 @item max-tail-merge-iterations
12150 The maximum amount of iterations of the pass over the function.  This is used to
12151 limit compilation time in tree tail merging.
12152
12153 @item store-merging-allow-unaligned
12154 Allow the store merging pass to introduce unaligned stores if it is legal to
12155 do so.
12156
12157 @item max-stores-to-merge
12158 The maximum number of stores to attempt to merge into wider stores in the store
12159 merging pass.
12160
12161 @item max-unrolled-insns
12162 The maximum number of instructions that a loop may have to be unrolled.
12163 If a loop is unrolled, this parameter also determines how many times
12164 the loop code is unrolled.
12165
12166 @item max-average-unrolled-insns
12167 The maximum number of instructions biased by probabilities of their execution
12168 that a loop may have to be unrolled.  If a loop is unrolled,
12169 this parameter also determines how many times the loop code is unrolled.
12170
12171 @item max-unroll-times
12172 The maximum number of unrollings of a single loop.
12173
12174 @item max-peeled-insns
12175 The maximum number of instructions that a loop may have to be peeled.
12176 If a loop is peeled, this parameter also determines how many times
12177 the loop code is peeled.
12178
12179 @item max-peel-times
12180 The maximum number of peelings of a single loop.
12181
12182 @item max-peel-branches
12183 The maximum number of branches on the hot path through the peeled sequence.
12184
12185 @item max-completely-peeled-insns
12186 The maximum number of insns of a completely peeled loop.
12187
12188 @item max-completely-peel-times
12189 The maximum number of iterations of a loop to be suitable for complete peeling.
12190
12191 @item max-completely-peel-loop-nest-depth
12192 The maximum depth of a loop nest suitable for complete peeling.
12193
12194 @item max-unswitch-insns
12195 The maximum number of insns of an unswitched loop.
12196
12197 @item max-unswitch-level
12198 The maximum number of branches unswitched in a single loop.
12199
12200 @item lim-expensive
12201 The minimum cost of an expensive expression in the loop invariant motion.
12202
12203 @item min-loop-cond-split-prob
12204 When FDO profile information is available, @option{min-loop-cond-split-prob}
12205 specifies minimum threshold for probability of semi-invariant condition
12206 statement to trigger loop split.
12207
12208 @item iv-consider-all-candidates-bound
12209 Bound on number of candidates for induction variables, below which
12210 all candidates are considered for each use in induction variable
12211 optimizations.  If there are more candidates than this,
12212 only the most relevant ones are considered to avoid quadratic time complexity.
12213
12214 @item iv-max-considered-uses
12215 The induction variable optimizations give up on loops that contain more
12216 induction variable uses.
12217
12218 @item iv-always-prune-cand-set-bound
12219 If the number of candidates in the set is smaller than this value,
12220 always try to remove unnecessary ivs from the set
12221 when adding a new one.
12222
12223 @item avg-loop-niter
12224 Average number of iterations of a loop.
12225
12226 @item dse-max-object-size
12227 Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
12228 Larger values may result in larger compilation times.
12229
12230 @item dse-max-alias-queries-per-store
12231 Maximum number of queries into the alias oracle per store.
12232 Larger values result in larger compilation times and may result in more
12233 removed dead stores.
12234
12235 @item scev-max-expr-size
12236 Bound on size of expressions used in the scalar evolutions analyzer.
12237 Large expressions slow the analyzer.
12238
12239 @item scev-max-expr-complexity
12240 Bound on the complexity of the expressions in the scalar evolutions analyzer.
12241 Complex expressions slow the analyzer.
12242
12243 @item max-tree-if-conversion-phi-args
12244 Maximum number of arguments in a PHI supported by TREE if conversion
12245 unless the loop is marked with simd pragma.
12246
12247 @item vect-max-version-for-alignment-checks
12248 The maximum number of run-time checks that can be performed when
12249 doing loop versioning for alignment in the vectorizer.
12250
12251 @item vect-max-version-for-alias-checks
12252 The maximum number of run-time checks that can be performed when
12253 doing loop versioning for alias in the vectorizer.
12254
12255 @item vect-max-peeling-for-alignment
12256 The maximum number of loop peels to enhance access alignment
12257 for vectorizer. Value -1 means no limit.
12258
12259 @item max-iterations-to-track
12260 The maximum number of iterations of a loop the brute-force algorithm
12261 for analysis of the number of iterations of the loop tries to evaluate.
12262
12263 @item hot-bb-count-fraction
12264 The denominator n of fraction 1/n of the maximal execution count of a
12265 basic block in the entire program that a basic block needs to at least
12266 have in order to be considered hot.  The default is 10000, which means
12267 that a basic block is considered hot if its execution count is greater
12268 than 1/10000 of the maximal execution count.  0 means that it is never
12269 considered hot.  Used in non-LTO mode.
12270
12271 @item hot-bb-count-ws-permille
12272 The number of most executed permilles, ranging from 0 to 1000, of the
12273 profiled execution of the entire program to which the execution count
12274 of a basic block must be part of in order to be considered hot.  The
12275 default is 990, which means that a basic block is considered hot if
12276 its execution count contributes to the upper 990 permilles, or 99.0%,
12277 of the profiled execution of the entire program.  0 means that it is
12278 never considered hot.  Used in LTO mode.
12279
12280 @item hot-bb-frequency-fraction
12281 The denominator n of fraction 1/n of the execution frequency of the
12282 entry block of a function that a basic block of this function needs
12283 to at least have in order to be considered hot.  The default is 1000,
12284 which means that a basic block is considered hot in a function if it
12285 is executed more frequently than 1/1000 of the frequency of the entry
12286 block of the function.  0 means that it is never considered hot.
12287
12288 @item unlikely-bb-count-fraction
12289 The denominator n of fraction 1/n of the number of profiled runs of
12290 the entire program below which the execution count of a basic block
12291 must be in order for the basic block to be considered unlikely executed.
12292 The default is 20, which means that a basic block is considered unlikely
12293 executed if it is executed in fewer than 1/20, or 5%, of the runs of
12294 the program.  0 means that it is always considered unlikely executed.
12295
12296 @item max-predicted-iterations
12297 The maximum number of loop iterations we predict statically.  This is useful
12298 in cases where a function contains a single loop with known bound and
12299 another loop with unknown bound.
12300 The known number of iterations is predicted correctly, while
12301 the unknown number of iterations average to roughly 10.  This means that the
12302 loop without bounds appears artificially cold relative to the other one.
12303
12304 @item builtin-expect-probability
12305 Control the probability of the expression having the specified value. This
12306 parameter takes a percentage (i.e.@: 0 ... 100) as input.
12307
12308 @item builtin-string-cmp-inline-length
12309 The maximum length of a constant string for a builtin string cmp call 
12310 eligible for inlining.
12311
12312 @item align-threshold
12313
12314 Select fraction of the maximal frequency of executions of a basic block in
12315 a function to align the basic block.
12316
12317 @item align-loop-iterations
12318
12319 A loop expected to iterate at least the selected number of iterations is
12320 aligned.
12321
12322 @item tracer-dynamic-coverage
12323 @itemx tracer-dynamic-coverage-feedback
12324
12325 This value is used to limit superblock formation once the given percentage of
12326 executed instructions is covered.  This limits unnecessary code size
12327 expansion.
12328
12329 The @option{tracer-dynamic-coverage-feedback} parameter
12330 is used only when profile
12331 feedback is available.  The real profiles (as opposed to statically estimated
12332 ones) are much less balanced allowing the threshold to be larger value.
12333
12334 @item tracer-max-code-growth
12335 Stop tail duplication once code growth has reached given percentage.  This is
12336 a rather artificial limit, as most of the duplicates are eliminated later in
12337 cross jumping, so it may be set to much higher values than is the desired code
12338 growth.
12339
12340 @item tracer-min-branch-ratio
12341
12342 Stop reverse growth when the reverse probability of best edge is less than this
12343 threshold (in percent).
12344
12345 @item tracer-min-branch-probability
12346 @itemx tracer-min-branch-probability-feedback
12347
12348 Stop forward growth if the best edge has probability lower than this
12349 threshold.
12350
12351 Similarly to @option{tracer-dynamic-coverage} two parameters are
12352 provided.  @option{tracer-min-branch-probability-feedback} is used for
12353 compilation with profile feedback and @option{tracer-min-branch-probability}
12354 compilation without.  The value for compilation with profile feedback
12355 needs to be more conservative (higher) in order to make tracer
12356 effective.
12357
12358 @item stack-clash-protection-guard-size
12359 Specify the size of the operating system provided stack guard as
12360 2 raised to @var{num} bytes.  Higher values may reduce the
12361 number of explicit probes, but a value larger than the operating system
12362 provided guard will leave code vulnerable to stack clash style attacks.
12363
12364 @item stack-clash-protection-probe-interval
12365 Stack clash protection involves probing stack space as it is allocated.  This
12366 param controls the maximum distance between probes into the stack as 2 raised
12367 to @var{num} bytes.  Higher values may reduce the number of explicit probes, but a value
12368 larger than the operating system provided guard will leave code vulnerable to
12369 stack clash style attacks.
12370
12371 @item max-cse-path-length
12372
12373 The maximum number of basic blocks on path that CSE considers.
12374
12375 @item max-cse-insns
12376 The maximum number of instructions CSE processes before flushing.
12377
12378 @item ggc-min-expand
12379
12380 GCC uses a garbage collector to manage its own memory allocation.  This
12381 parameter specifies the minimum percentage by which the garbage
12382 collector's heap should be allowed to expand between collections.
12383 Tuning this may improve compilation speed; it has no effect on code
12384 generation.
12385
12386 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
12387 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
12388 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
12389 GCC is not able to calculate RAM on a particular platform, the lower
12390 bound of 30% is used.  Setting this parameter and
12391 @option{ggc-min-heapsize} to zero causes a full collection to occur at
12392 every opportunity.  This is extremely slow, but can be useful for
12393 debugging.
12394
12395 @item ggc-min-heapsize
12396
12397 Minimum size of the garbage collector's heap before it begins bothering
12398 to collect garbage.  The first collection occurs after the heap expands
12399 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
12400 tuning this may improve compilation speed, and has no effect on code
12401 generation.
12402
12403 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
12404 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
12405 with a lower bound of 4096 (four megabytes) and an upper bound of
12406 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
12407 particular platform, the lower bound is used.  Setting this parameter
12408 very large effectively disables garbage collection.  Setting this
12409 parameter and @option{ggc-min-expand} to zero causes a full collection
12410 to occur at every opportunity.
12411
12412 @item max-reload-search-insns
12413 The maximum number of instruction reload should look backward for equivalent
12414 register.  Increasing values mean more aggressive optimization, making the
12415 compilation time increase with probably slightly better performance.
12416
12417 @item max-cselib-memory-locations
12418 The maximum number of memory locations cselib should take into account.
12419 Increasing values mean more aggressive optimization, making the compilation time
12420 increase with probably slightly better performance.
12421
12422 @item max-sched-ready-insns
12423 The maximum number of instructions ready to be issued the scheduler should
12424 consider at any given time during the first scheduling pass.  Increasing
12425 values mean more thorough searches, making the compilation time increase
12426 with probably little benefit.
12427
12428 @item max-sched-region-blocks
12429 The maximum number of blocks in a region to be considered for
12430 interblock scheduling.
12431
12432 @item max-pipeline-region-blocks
12433 The maximum number of blocks in a region to be considered for
12434 pipelining in the selective scheduler.
12435
12436 @item max-sched-region-insns
12437 The maximum number of insns in a region to be considered for
12438 interblock scheduling.
12439
12440 @item max-pipeline-region-insns
12441 The maximum number of insns in a region to be considered for
12442 pipelining in the selective scheduler.
12443
12444 @item min-spec-prob
12445 The minimum probability (in percents) of reaching a source block
12446 for interblock speculative scheduling.
12447
12448 @item max-sched-extend-regions-iters
12449 The maximum number of iterations through CFG to extend regions.
12450 A value of 0 disables region extensions.
12451
12452 @item max-sched-insn-conflict-delay
12453 The maximum conflict delay for an insn to be considered for speculative motion.
12454
12455 @item sched-spec-prob-cutoff
12456 The minimal probability of speculation success (in percents), so that
12457 speculative insns are scheduled.
12458
12459 @item sched-state-edge-prob-cutoff
12460 The minimum probability an edge must have for the scheduler to save its
12461 state across it.
12462
12463 @item sched-mem-true-dep-cost
12464 Minimal distance (in CPU cycles) between store and load targeting same
12465 memory locations.
12466
12467 @item selsched-max-lookahead
12468 The maximum size of the lookahead window of selective scheduling.  It is a
12469 depth of search for available instructions.
12470
12471 @item selsched-max-sched-times
12472 The maximum number of times that an instruction is scheduled during
12473 selective scheduling.  This is the limit on the number of iterations
12474 through which the instruction may be pipelined.
12475
12476 @item selsched-insns-to-rename
12477 The maximum number of best instructions in the ready list that are considered
12478 for renaming in the selective scheduler.
12479
12480 @item sms-min-sc
12481 The minimum value of stage count that swing modulo scheduler
12482 generates.
12483
12484 @item max-last-value-rtl
12485 The maximum size measured as number of RTLs that can be recorded in an expression
12486 in combiner for a pseudo register as last known value of that register.
12487
12488 @item max-combine-insns
12489 The maximum number of instructions the RTL combiner tries to combine.
12490
12491 @item integer-share-limit
12492 Small integer constants can use a shared data structure, reducing the
12493 compiler's memory usage and increasing its speed.  This sets the maximum
12494 value of a shared integer constant.
12495
12496 @item ssp-buffer-size
12497 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
12498 protection when @option{-fstack-protection} is used.
12499
12500 @item min-size-for-stack-sharing
12501 The minimum size of variables taking part in stack slot sharing when not
12502 optimizing.
12503
12504 @item max-jump-thread-duplication-stmts
12505 Maximum number of statements allowed in a block that needs to be
12506 duplicated when threading jumps.
12507
12508 @item max-fields-for-field-sensitive
12509 Maximum number of fields in a structure treated in
12510 a field sensitive manner during pointer analysis.
12511
12512 @item prefetch-latency
12513 Estimate on average number of instructions that are executed before
12514 prefetch finishes.  The distance prefetched ahead is proportional
12515 to this constant.  Increasing this number may also lead to less
12516 streams being prefetched (see @option{simultaneous-prefetches}).
12517
12518 @item simultaneous-prefetches
12519 Maximum number of prefetches that can run at the same time.
12520
12521 @item l1-cache-line-size
12522 The size of cache line in L1 data cache, in bytes.
12523
12524 @item l1-cache-size
12525 The size of L1 data cache, in kilobytes.
12526
12527 @item l2-cache-size
12528 The size of L2 data cache, in kilobytes.
12529
12530 @item prefetch-dynamic-strides
12531 Whether the loop array prefetch pass should issue software prefetch hints
12532 for strides that are non-constant.  In some cases this may be
12533 beneficial, though the fact the stride is non-constant may make it
12534 hard to predict when there is clear benefit to issuing these hints.
12535
12536 Set to 1 if the prefetch hints should be issued for non-constant
12537 strides.  Set to 0 if prefetch hints should be issued only for strides that
12538 are known to be constant and below @option{prefetch-minimum-stride}.
12539
12540 @item prefetch-minimum-stride
12541 Minimum constant stride, in bytes, to start using prefetch hints for.  If
12542 the stride is less than this threshold, prefetch hints will not be issued.
12543
12544 This setting is useful for processors that have hardware prefetchers, in
12545 which case there may be conflicts between the hardware prefetchers and
12546 the software prefetchers.  If the hardware prefetchers have a maximum
12547 stride they can handle, it should be used here to improve the use of
12548 software prefetchers.
12549
12550 A value of -1 means we don't have a threshold and therefore
12551 prefetch hints can be issued for any constant stride.
12552
12553 This setting is only useful for strides that are known and constant.
12554
12555 @item loop-interchange-max-num-stmts
12556 The maximum number of stmts in a loop to be interchanged.
12557
12558 @item loop-interchange-stride-ratio
12559 The minimum ratio between stride of two loops for interchange to be profitable.
12560
12561 @item min-insn-to-prefetch-ratio
12562 The minimum ratio between the number of instructions and the
12563 number of prefetches to enable prefetching in a loop.
12564
12565 @item prefetch-min-insn-to-mem-ratio
12566 The minimum ratio between the number of instructions and the
12567 number of memory references to enable prefetching in a loop.
12568
12569 @item use-canonical-types
12570 Whether the compiler should use the ``canonical'' type system.
12571 Should always be 1, which uses a more efficient internal
12572 mechanism for comparing types in C++ and Objective-C++.  However, if
12573 bugs in the canonical type system are causing compilation failures,
12574 set this value to 0 to disable canonical types.
12575
12576 @item switch-conversion-max-branch-ratio
12577 Switch initialization conversion refuses to create arrays that are
12578 bigger than @option{switch-conversion-max-branch-ratio} times the number of
12579 branches in the switch.
12580
12581 @item max-partial-antic-length
12582 Maximum length of the partial antic set computed during the tree
12583 partial redundancy elimination optimization (@option{-ftree-pre}) when
12584 optimizing at @option{-O3} and above.  For some sorts of source code
12585 the enhanced partial redundancy elimination optimization can run away,
12586 consuming all of the memory available on the host machine.  This
12587 parameter sets a limit on the length of the sets that are computed,
12588 which prevents the runaway behavior.  Setting a value of 0 for
12589 this parameter allows an unlimited set length.
12590
12591 @item rpo-vn-max-loop-depth
12592 Maximum loop depth that is value-numbered optimistically.
12593 When the limit hits the innermost
12594 @var{rpo-vn-max-loop-depth} loops and the outermost loop in the
12595 loop nest are value-numbered optimistically and the remaining ones not.
12596
12597 @item sccvn-max-alias-queries-per-access
12598 Maximum number of alias-oracle queries we perform when looking for
12599 redundancies for loads and stores.  If this limit is hit the search
12600 is aborted and the load or store is not considered redundant.  The
12601 number of queries is algorithmically limited to the number of
12602 stores on all paths from the load to the function entry.
12603
12604 @item ira-max-loops-num
12605 IRA uses regional register allocation by default.  If a function
12606 contains more loops than the number given by this parameter, only at most
12607 the given number of the most frequently-executed loops form regions
12608 for regional register allocation.
12609
12610 @item ira-max-conflict-table-size 
12611 Although IRA uses a sophisticated algorithm to compress the conflict
12612 table, the table can still require excessive amounts of memory for
12613 huge functions.  If the conflict table for a function could be more
12614 than the size in MB given by this parameter, the register allocator
12615 instead uses a faster, simpler, and lower-quality
12616 algorithm that does not require building a pseudo-register conflict table.  
12617
12618 @item ira-loop-reserved-regs
12619 IRA can be used to evaluate more accurate register pressure in loops
12620 for decisions to move loop invariants (see @option{-O3}).  The number
12621 of available registers reserved for some other purposes is given
12622 by this parameter.  Default of the parameter
12623 is the best found from numerous experiments.
12624
12625 @item lra-inheritance-ebb-probability-cutoff
12626 LRA tries to reuse values reloaded in registers in subsequent insns.
12627 This optimization is called inheritance.  EBB is used as a region to
12628 do this optimization.  The parameter defines a minimal fall-through
12629 edge probability in percentage used to add BB to inheritance EBB in
12630 LRA.  The default value was chosen
12631 from numerous runs of SPEC2000 on x86-64.
12632
12633 @item loop-invariant-max-bbs-in-loop
12634 Loop invariant motion can be very expensive, both in compilation time and
12635 in amount of needed compile-time memory, with very large loops.  Loops
12636 with more basic blocks than this parameter won't have loop invariant
12637 motion optimization performed on them.
12638
12639 @item loop-max-datarefs-for-datadeps
12640 Building data dependencies is expensive for very large loops.  This
12641 parameter limits the number of data references in loops that are
12642 considered for data dependence analysis.  These large loops are no
12643 handled by the optimizations using loop data dependencies.
12644
12645 @item max-vartrack-size
12646 Sets a maximum number of hash table slots to use during variable
12647 tracking dataflow analysis of any function.  If this limit is exceeded
12648 with variable tracking at assignments enabled, analysis for that
12649 function is retried without it, after removing all debug insns from
12650 the function.  If the limit is exceeded even without debug insns, var
12651 tracking analysis is completely disabled for the function.  Setting
12652 the parameter to zero makes it unlimited.
12653
12654 @item max-vartrack-expr-depth
12655 Sets a maximum number of recursion levels when attempting to map
12656 variable names or debug temporaries to value expressions.  This trades
12657 compilation time for more complete debug information.  If this is set too
12658 low, value expressions that are available and could be represented in
12659 debug information may end up not being used; setting this higher may
12660 enable the compiler to find more complex debug expressions, but compile
12661 time and memory use may grow.
12662
12663 @item max-debug-marker-count
12664 Sets a threshold on the number of debug markers (e.g.@: begin stmt
12665 markers) to avoid complexity explosion at inlining or expanding to RTL.
12666 If a function has more such gimple stmts than the set limit, such stmts
12667 will be dropped from the inlined copy of a function, and from its RTL
12668 expansion.
12669
12670 @item min-nondebug-insn-uid
12671 Use uids starting at this parameter for nondebug insns.  The range below
12672 the parameter is reserved exclusively for debug insns created by
12673 @option{-fvar-tracking-assignments}, but debug insns may get
12674 (non-overlapping) uids above it if the reserved range is exhausted.
12675
12676 @item ipa-sra-ptr-growth-factor
12677 IPA-SRA replaces a pointer to an aggregate with one or more new
12678 parameters only when their cumulative size is less or equal to
12679 @option{ipa-sra-ptr-growth-factor} times the size of the original
12680 pointer parameter.
12681
12682 @item ipa-sra-max-replacements
12683 Maximum pieces of an aggregate that IPA-SRA tracks.  As a
12684 consequence, it is also the maximum number of replacements of a formal
12685 parameter.
12686
12687 @item sra-max-scalarization-size-Ospeed
12688 @itemx sra-max-scalarization-size-Osize
12689 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
12690 replace scalar parts of aggregates with uses of independent scalar
12691 variables.  These parameters control the maximum size, in storage units,
12692 of aggregate which is considered for replacement when compiling for
12693 speed
12694 (@option{sra-max-scalarization-size-Ospeed}) or size
12695 (@option{sra-max-scalarization-size-Osize}) respectively.
12696
12697 @item tm-max-aggregate-size
12698 When making copies of thread-local variables in a transaction, this
12699 parameter specifies the size in bytes after which variables are
12700 saved with the logging functions as opposed to save/restore code
12701 sequence pairs.  This option only applies when using
12702 @option{-fgnu-tm}.
12703
12704 @item graphite-max-nb-scop-params
12705 To avoid exponential effects in the Graphite loop transforms, the
12706 number of parameters in a Static Control Part (SCoP) is bounded.
12707 A value of zero can be used to lift
12708 the bound.  A variable whose value is unknown at compilation time and
12709 defined outside a SCoP is a parameter of the SCoP.
12710
12711 @item loop-block-tile-size
12712 Loop blocking or strip mining transforms, enabled with
12713 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
12714 loop in the loop nest by a given number of iterations.  The strip
12715 length can be changed using the @option{loop-block-tile-size}
12716 parameter.
12717
12718 @item ipa-cp-value-list-size
12719 IPA-CP attempts to track all possible values and types passed to a function's
12720 parameter in order to propagate them and perform devirtualization.
12721 @option{ipa-cp-value-list-size} is the maximum number of values and types it
12722 stores per one formal parameter of a function.
12723
12724 @item ipa-cp-eval-threshold
12725 IPA-CP calculates its own score of cloning profitability heuristics
12726 and performs those cloning opportunities with scores that exceed
12727 @option{ipa-cp-eval-threshold}.
12728
12729 @item ipa-cp-max-recursive-depth
12730 Maximum depth of recursive cloning for self-recursive function.
12731
12732 @item ipa-cp-min-recursive-probability
12733 Recursive cloning only when the probability of call being executed exceeds
12734 the parameter.
12735
12736 @item ipa-cp-recursion-penalty
12737 Percentage penalty the recursive functions will receive when they
12738 are evaluated for cloning.
12739
12740 @item ipa-cp-single-call-penalty
12741 Percentage penalty functions containing a single call to another
12742 function will receive when they are evaluated for cloning.
12743
12744 @item ipa-max-agg-items
12745 IPA-CP is also capable to propagate a number of scalar values passed
12746 in an aggregate. @option{ipa-max-agg-items} controls the maximum
12747 number of such values per one parameter.
12748
12749 @item ipa-cp-loop-hint-bonus
12750 When IPA-CP determines that a cloning candidate would make the number
12751 of iterations of a loop known, it adds a bonus of
12752 @option{ipa-cp-loop-hint-bonus} to the profitability score of
12753 the candidate.
12754
12755 @item ipa-max-aa-steps
12756 During its analysis of function bodies, IPA-CP employs alias analysis
12757 in order to track values pointed to by function parameters.  In order
12758 not spend too much time analyzing huge functions, it gives up and
12759 consider all memory clobbered after examining
12760 @option{ipa-max-aa-steps} statements modifying memory.
12761
12762 @item ipa-max-switch-predicate-bounds
12763 Maximal number of boundary endpoints of case ranges of switch statement.
12764 For switch exceeding this limit, IPA-CP will not construct cloning cost
12765 predicate, which is used to estimate cloning benefit, for default case
12766 of the switch statement.
12767
12768 @item ipa-max-param-expr-ops
12769 IPA-CP will analyze conditional statement that references some function
12770 parameter to estimate benefit for cloning upon certain constant value.
12771 But if number of operations in a parameter expression exceeds
12772 @option{ipa-max-param-expr-ops}, the expression is treated as complicated
12773 one, and is not handled by IPA analysis.
12774
12775 @item lto-partitions
12776 Specify desired number of partitions produced during WHOPR compilation.
12777 The number of partitions should exceed the number of CPUs used for compilation.
12778
12779 @item lto-min-partition
12780 Size of minimal partition for WHOPR (in estimated instructions).
12781 This prevents expenses of splitting very small programs into too many
12782 partitions.
12783
12784 @item lto-max-partition
12785 Size of max partition for WHOPR (in estimated instructions).
12786 to provide an upper bound for individual size of partition.
12787 Meant to be used only with balanced partitioning.
12788
12789 @item lto-max-streaming-parallelism
12790 Maximal number of parallel processes used for LTO streaming.
12791
12792 @item cxx-max-namespaces-for-diagnostic-help
12793 The maximum number of namespaces to consult for suggestions when C++
12794 name lookup fails for an identifier.
12795
12796 @item sink-frequency-threshold
12797 The maximum relative execution frequency (in percents) of the target block
12798 relative to a statement's original block to allow statement sinking of a
12799 statement.  Larger numbers result in more aggressive statement sinking.
12800 A small positive adjustment is applied for
12801 statements with memory operands as those are even more profitable so sink.
12802
12803 @item max-stores-to-sink
12804 The maximum number of conditional store pairs that can be sunk.  Set to 0
12805 if either vectorization (@option{-ftree-vectorize}) or if-conversion
12806 (@option{-ftree-loop-if-convert}) is disabled.
12807
12808 @item case-values-threshold
12809 The smallest number of different values for which it is best to use a
12810 jump-table instead of a tree of conditional branches.  If the value is
12811 0, use the default for the machine.
12812
12813 @item jump-table-max-growth-ratio-for-size
12814 The maximum code size growth ratio when expanding
12815 into a jump table (in percent).  The parameter is used when
12816 optimizing for size.
12817
12818 @item jump-table-max-growth-ratio-for-speed
12819 The maximum code size growth ratio when expanding
12820 into a jump table (in percent).  The parameter is used when
12821 optimizing for speed.
12822
12823 @item tree-reassoc-width
12824 Set the maximum number of instructions executed in parallel in
12825 reassociated tree. This parameter overrides target dependent
12826 heuristics used by default if has non zero value.
12827
12828 @item sched-pressure-algorithm
12829 Choose between the two available implementations of
12830 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
12831 and is the more likely to prevent instructions from being reordered.
12832 Algorithm 2 was designed to be a compromise between the relatively
12833 conservative approach taken by algorithm 1 and the rather aggressive
12834 approach taken by the default scheduler.  It relies more heavily on
12835 having a regular register file and accurate register pressure classes.
12836 See @file{haifa-sched.c} in the GCC sources for more details.
12837
12838 The default choice depends on the target.
12839
12840 @item max-slsr-cand-scan
12841 Set the maximum number of existing candidates that are considered when
12842 seeking a basis for a new straight-line strength reduction candidate.
12843
12844 @item asan-globals
12845 Enable buffer overflow detection for global objects.  This kind
12846 of protection is enabled by default if you are using
12847 @option{-fsanitize=address} option.
12848 To disable global objects protection use @option{--param asan-globals=0}.
12849
12850 @item asan-stack
12851 Enable buffer overflow detection for stack objects.  This kind of
12852 protection is enabled by default when using @option{-fsanitize=address}.
12853 To disable stack protection use @option{--param asan-stack=0} option.
12854
12855 @item asan-instrument-reads
12856 Enable buffer overflow detection for memory reads.  This kind of
12857 protection is enabled by default when using @option{-fsanitize=address}.
12858 To disable memory reads protection use
12859 @option{--param asan-instrument-reads=0}.
12860
12861 @item asan-instrument-writes
12862 Enable buffer overflow detection for memory writes.  This kind of
12863 protection is enabled by default when using @option{-fsanitize=address}.
12864 To disable memory writes protection use
12865 @option{--param asan-instrument-writes=0} option.
12866
12867 @item asan-memintrin
12868 Enable detection for built-in functions.  This kind of protection
12869 is enabled by default when using @option{-fsanitize=address}.
12870 To disable built-in functions protection use
12871 @option{--param asan-memintrin=0}.
12872
12873 @item asan-use-after-return
12874 Enable detection of use-after-return.  This kind of protection
12875 is enabled by default when using the @option{-fsanitize=address} option.
12876 To disable it use @option{--param asan-use-after-return=0}.
12877
12878 Note: By default the check is disabled at run time.  To enable it,
12879 add @code{detect_stack_use_after_return=1} to the environment variable
12880 @env{ASAN_OPTIONS}.
12881
12882 @item asan-instrumentation-with-call-threshold
12883 If number of memory accesses in function being instrumented
12884 is greater or equal to this number, use callbacks instead of inline checks.
12885 E.g. to disable inline code use
12886 @option{--param asan-instrumentation-with-call-threshold=0}.
12887
12888 @item use-after-scope-direct-emission-threshold
12889 If the size of a local variable in bytes is smaller or equal to this
12890 number, directly poison (or unpoison) shadow memory instead of using
12891 run-time callbacks.
12892
12893 @item max-fsm-thread-path-insns
12894 Maximum number of instructions to copy when duplicating blocks on a
12895 finite state automaton jump thread path.
12896
12897 @item max-fsm-thread-length
12898 Maximum number of basic blocks on a finite state automaton jump thread
12899 path.
12900
12901 @item max-fsm-thread-paths
12902 Maximum number of new jump thread paths to create for a finite state
12903 automaton.
12904
12905 @item parloops-chunk-size
12906 Chunk size of omp schedule for loops parallelized by parloops.
12907
12908 @item parloops-schedule
12909 Schedule type of omp schedule for loops parallelized by parloops (static,
12910 dynamic, guided, auto, runtime).
12911
12912 @item parloops-min-per-thread
12913 The minimum number of iterations per thread of an innermost parallelized
12914 loop for which the parallelized variant is preferred over the single threaded
12915 one.  Note that for a parallelized loop nest the
12916 minimum number of iterations of the outermost loop per thread is two.
12917
12918 @item max-ssa-name-query-depth
12919 Maximum depth of recursion when querying properties of SSA names in things
12920 like fold routines.  One level of recursion corresponds to following a
12921 use-def chain.
12922
12923 @item hsa-gen-debug-stores
12924 Enable emission of special debug stores within HSA kernels which are
12925 then read and reported by libgomp plugin.  Generation of these stores
12926 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
12927 enable it.
12928
12929 @item max-speculative-devirt-maydefs
12930 The maximum number of may-defs we analyze when looking for a must-def
12931 specifying the dynamic type of an object that invokes a virtual call
12932 we may be able to devirtualize speculatively.
12933
12934 @item max-vrp-switch-assertions
12935 The maximum number of assertions to add along the default edge of a switch
12936 statement during VRP.
12937
12938 @item unroll-jam-min-percent
12939 The minimum percentage of memory references that must be optimized
12940 away for the unroll-and-jam transformation to be considered profitable.
12941
12942 @item unroll-jam-max-unroll
12943 The maximum number of times the outer loop should be unrolled by
12944 the unroll-and-jam transformation.
12945
12946 @item max-rtl-if-conversion-unpredictable-cost
12947 Maximum permissible cost for the sequence that would be generated
12948 by the RTL if-conversion pass for a branch that is considered unpredictable.
12949
12950 @item max-variable-expansions-in-unroller
12951 If @option{-fvariable-expansion-in-unroller} is used, the maximum number
12952 of times that an individual variable will be expanded during loop unrolling.
12953
12954 @item tracer-min-branch-probability-feedback
12955 Stop forward growth if the probability of best edge is less than
12956 this threshold (in percent). Used when profile feedback is available.
12957
12958 @item partial-inlining-entry-probability
12959 Maximum probability of the entry BB of split region
12960 (in percent relative to entry BB of the function)
12961 to make partial inlining happen.
12962
12963 @item max-tracked-strlens
12964 Maximum number of strings for which strlen optimization pass will
12965 track string lengths.
12966
12967 @item gcse-after-reload-partial-fraction
12968 The threshold ratio for performing partial redundancy
12969 elimination after reload.
12970
12971 @item gcse-after-reload-critical-fraction
12972 The threshold ratio of critical edges execution count that
12973 permit performing redundancy elimination after reload.
12974
12975 @item max-loop-header-insns
12976 The maximum number of insns in loop header duplicated
12977 by the copy loop headers pass.
12978
12979 @item vect-epilogues-nomask
12980 Enable loop epilogue vectorization using smaller vector size.
12981
12982 @item slp-max-insns-in-bb
12983 Maximum number of instructions in basic block to be
12984 considered for SLP vectorization.
12985
12986 @item avoid-fma-max-bits
12987 Maximum number of bits for which we avoid creating FMAs.
12988
12989 @item sms-loop-average-count-threshold
12990 A threshold on the average loop count considered by the swing modulo scheduler.
12991
12992 @item sms-dfa-history
12993 The number of cycles the swing modulo scheduler considers when checking
12994 conflicts using DFA.
12995
12996 @item max-inline-insns-recursive-auto
12997 The maximum number of instructions non-inline function
12998 can grow to via recursive inlining.
12999
13000 @item graphite-allow-codegen-errors
13001 Whether codegen errors should be ICEs when @option{-fchecking}.
13002
13003 @item sms-max-ii-factor
13004 A factor for tuning the upper bound that swing modulo scheduler
13005 uses for scheduling a loop.
13006
13007 @item lra-max-considered-reload-pseudos
13008 The max number of reload pseudos which are considered during
13009 spilling a non-reload pseudo.
13010
13011 @item max-pow-sqrt-depth
13012 Maximum depth of sqrt chains to use when synthesizing exponentiation
13013 by a real constant.
13014
13015 @item max-dse-active-local-stores
13016 Maximum number of active local stores in RTL dead store elimination.
13017
13018 @item asan-instrument-allocas
13019 Enable asan allocas/VLAs protection.
13020
13021 @item max-iterations-computation-cost
13022 Bound on the cost of an expression to compute the number of iterations.
13023
13024 @item max-isl-operations
13025 Maximum number of isl operations, 0 means unlimited.
13026
13027 @item graphite-max-arrays-per-scop
13028 Maximum number of arrays per scop.
13029
13030 @item max-vartrack-reverse-op-size
13031 Max. size of loc list for which reverse ops should be added.
13032
13033 @item tracer-dynamic-coverage-feedback
13034 The percentage of function, weighted by execution frequency,
13035 that must be covered by trace formation.
13036 Used when profile feedback is available.
13037
13038 @item max-inline-recursive-depth-auto
13039 The maximum depth of recursive inlining for non-inline functions.
13040
13041 @item fsm-scale-path-stmts
13042 Scale factor to apply to the number of statements in a threading path
13043 when comparing to the number of (scaled) blocks.
13044
13045 @item fsm-maximum-phi-arguments
13046 Maximum number of arguments a PHI may have before the FSM threader
13047 will not try to thread through its block.
13048
13049 @item uninit-control-dep-attempts
13050 Maximum number of nested calls to search for control dependencies
13051 during uninitialized variable analysis.
13052
13053 @item max-once-peeled-insns
13054 The maximum number of insns of a peeled loop that rolls only once.
13055
13056 @item sra-max-scalarization-size-Osize
13057 Maximum size, in storage units, of an aggregate
13058 which should be considered for scalarization when compiling for size.
13059
13060 @item fsm-scale-path-blocks
13061 Scale factor to apply to the number of blocks in a threading path
13062 when comparing to the number of (scaled) statements.
13063
13064 @item sched-autopref-queue-depth
13065 Hardware autoprefetcher scheduler model control flag.
13066 Number of lookahead cycles the model looks into; at '
13067 ' only enable instruction sorting heuristic.
13068
13069 @item loop-versioning-max-inner-insns
13070 The maximum number of instructions that an inner loop can have
13071 before the loop versioning pass considers it too big to copy.
13072
13073 @item loop-versioning-max-outer-insns
13074 The maximum number of instructions that an outer loop can have
13075 before the loop versioning pass considers it too big to copy,
13076 discounting any instructions in inner loops that directly benefit
13077 from versioning.
13078
13079 @item ssa-name-def-chain-limit
13080 The maximum number of SSA_NAME assignments to follow in determining
13081 a property of a variable such as its value.  This limits the number
13082 of iterations or recursive calls GCC performs when optimizing certain
13083 statements or when determining their validity prior to issuing
13084 diagnostics.
13085
13086 @end table
13087
13088 The following choices of @var{name} are available on AArch64 targets:
13089
13090 @table @gcctabopt
13091 @item aarch64-sve-compare-costs
13092 When vectorizing for SVE, consider using ``unpacked'' vectors for
13093 smaller elements and use the cost model to pick the cheapest approach.
13094 Also use the cost model to choose between SVE and Advanced SIMD vectorization.
13095
13096 Using unpacked vectors includes storing smaller elements in larger
13097 containers and accessing elements with extending loads and truncating
13098 stores.
13099 @end table
13100
13101 @end table
13102
13103 @node Instrumentation Options
13104 @section Program Instrumentation Options
13105 @cindex instrumentation options
13106 @cindex program instrumentation options
13107 @cindex run-time error checking options
13108 @cindex profiling options
13109 @cindex options, program instrumentation
13110 @cindex options, run-time error checking
13111 @cindex options, profiling
13112
13113 GCC supports a number of command-line options that control adding
13114 run-time instrumentation to the code it normally generates.  
13115 For example, one purpose of instrumentation is collect profiling
13116 statistics for use in finding program hot spots, code coverage
13117 analysis, or profile-guided optimizations.
13118 Another class of program instrumentation is adding run-time checking 
13119 to detect programming errors like invalid pointer
13120 dereferences or out-of-bounds array accesses, as well as deliberately
13121 hostile attacks such as stack smashing or C++ vtable hijacking.
13122 There is also a general hook which can be used to implement other
13123 forms of tracing or function-level instrumentation for debug or
13124 program analysis purposes.
13125
13126 @table @gcctabopt
13127 @cindex @command{prof}
13128 @cindex @command{gprof}
13129 @item -p
13130 @itemx -pg
13131 @opindex p
13132 @opindex pg
13133 Generate extra code to write profile information suitable for the
13134 analysis program @command{prof} (for @option{-p}) or @command{gprof}
13135 (for @option{-pg}).  You must use this option when compiling
13136 the source files you want data about, and you must also use it when
13137 linking.
13138
13139 You can use the function attribute @code{no_instrument_function} to
13140 suppress profiling of individual functions when compiling with these options.
13141 @xref{Common Function Attributes}.
13142
13143 @item -fprofile-arcs
13144 @opindex fprofile-arcs
13145 Add code so that program flow @dfn{arcs} are instrumented.  During
13146 execution the program records how many times each branch and call is
13147 executed and how many times it is taken or returns.  On targets that support
13148 constructors with priority support, profiling properly handles constructors,
13149 destructors and C++ constructors (and destructors) of classes which are used
13150 as a type of a global variable.
13151
13152 When the compiled
13153 program exits it saves this data to a file called
13154 @file{@var{auxname}.gcda} for each source file.  The data may be used for
13155 profile-directed optimizations (@option{-fbranch-probabilities}), or for
13156 test coverage analysis (@option{-ftest-coverage}).  Each object file's
13157 @var{auxname} is generated from the name of the output file, if
13158 explicitly specified and it is not the final executable, otherwise it is
13159 the basename of the source file.  In both cases any suffix is removed
13160 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
13161 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
13162 @xref{Cross-profiling}.
13163
13164 @cindex @command{gcov}
13165 @item --coverage
13166 @opindex coverage
13167
13168 This option is used to compile and link code instrumented for coverage
13169 analysis.  The option is a synonym for @option{-fprofile-arcs}
13170 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
13171 linking).  See the documentation for those options for more details.
13172
13173 @itemize
13174
13175 @item
13176 Compile the source files with @option{-fprofile-arcs} plus optimization
13177 and code generation options.  For test coverage analysis, use the
13178 additional @option{-ftest-coverage} option.  You do not need to profile
13179 every source file in a program.
13180
13181 @item
13182 Compile the source files additionally with @option{-fprofile-abs-path}
13183 to create absolute path names in the @file{.gcno} files.  This allows
13184 @command{gcov} to find the correct sources in projects where compilations
13185 occur with different working directories.
13186
13187 @item
13188 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
13189 (the latter implies the former).
13190
13191 @item
13192 Run the program on a representative workload to generate the arc profile
13193 information.  This may be repeated any number of times.  You can run
13194 concurrent instances of your program, and provided that the file system
13195 supports locking, the data files will be correctly updated.  Unless
13196 a strict ISO C dialect option is in effect, @code{fork} calls are
13197 detected and correctly handled without double counting.
13198
13199 @item
13200 For profile-directed optimizations, compile the source files again with
13201 the same optimization and code generation options plus
13202 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
13203 Control Optimization}).
13204
13205 @item
13206 For test coverage analysis, use @command{gcov} to produce human readable
13207 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
13208 @command{gcov} documentation for further information.
13209
13210 @end itemize
13211
13212 With @option{-fprofile-arcs}, for each function of your program GCC
13213 creates a program flow graph, then finds a spanning tree for the graph.
13214 Only arcs that are not on the spanning tree have to be instrumented: the
13215 compiler adds code to count the number of times that these arcs are
13216 executed.  When an arc is the only exit or only entrance to a block, the
13217 instrumentation code can be added to the block; otherwise, a new basic
13218 block must be created to hold the instrumentation code.
13219
13220 @need 2000
13221 @item -ftest-coverage
13222 @opindex ftest-coverage
13223 Produce a notes file that the @command{gcov} code-coverage utility
13224 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
13225 show program coverage.  Each source file's note file is called
13226 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
13227 above for a description of @var{auxname} and instructions on how to
13228 generate test coverage data.  Coverage data matches the source files
13229 more closely if you do not optimize.
13230
13231 @item -fprofile-abs-path
13232 @opindex fprofile-abs-path
13233 Automatically convert relative source file names to absolute path names
13234 in the @file{.gcno} files.  This allows @command{gcov} to find the correct
13235 sources in projects where compilations occur with different working
13236 directories.
13237
13238 @item -fprofile-dir=@var{path}
13239 @opindex fprofile-dir
13240
13241 Set the directory to search for the profile data files in to @var{path}.
13242 This option affects only the profile data generated by
13243 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
13244 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
13245 and its related options.  Both absolute and relative paths can be used.
13246 By default, GCC uses the current directory as @var{path}, thus the
13247 profile data file appears in the same directory as the object file.
13248 In order to prevent the file name clashing, if the object file name is
13249 not an absolute path, we mangle the absolute path of the
13250 @file{@var{sourcename}.gcda} file and use it as the file name of a
13251 @file{.gcda} file.  See similar option @option{-fprofile-note}.
13252
13253 When an executable is run in a massive parallel environment, it is recommended
13254 to save profile to different folders.  That can be done with variables
13255 in @var{path} that are exported during run-time:
13256
13257 @table @gcctabopt
13258
13259 @item %p
13260 process ID.
13261
13262 @item %q@{VAR@}
13263 value of environment variable @var{VAR}
13264
13265 @end table
13266
13267 @item -fprofile-generate
13268 @itemx -fprofile-generate=@var{path}
13269 @opindex fprofile-generate
13270
13271 Enable options usually used for instrumenting application to produce
13272 profile useful for later recompilation with profile feedback based
13273 optimization.  You must use @option{-fprofile-generate} both when
13274 compiling and when linking your program.
13275
13276 The following options are enabled:
13277 @option{-fprofile-arcs}, @option{-fprofile-values},
13278 @option{-finline-functions}, and @option{-fipa-bit-cp}.
13279
13280 If @var{path} is specified, GCC looks at the @var{path} to find
13281 the profile feedback data files. See @option{-fprofile-dir}.
13282
13283 To optimize the program based on the collected profile information, use
13284 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
13285
13286 @item -fprofile-note=@var{path}
13287 @opindex fprofile-note
13288
13289 If @var{path} is specified, GCC saves @file{.gcno} file into @var{path}
13290 location.  If you combine the option with multiple source files,
13291 the @file{.gcno} file will be overwritten.
13292
13293 @item -fprofile-update=@var{method}
13294 @opindex fprofile-update
13295
13296 Alter the update method for an application instrumented for profile
13297 feedback based optimization.  The @var{method} argument should be one of
13298 @samp{single}, @samp{atomic} or @samp{prefer-atomic}.
13299 The first one is useful for single-threaded applications,
13300 while the second one prevents profile corruption by emitting thread-safe code.
13301
13302 @strong{Warning:} When an application does not properly join all threads
13303 (or creates an detached thread), a profile file can be still corrupted.
13304
13305 Using @samp{prefer-atomic} would be transformed either to @samp{atomic},
13306 when supported by a target, or to @samp{single} otherwise.  The GCC driver
13307 automatically selects @samp{prefer-atomic} when @option{-pthread}
13308 is present in the command line.
13309
13310 @item -fprofile-filter-files=@var{regex}
13311 @opindex fprofile-filter-files
13312
13313 Instrument only functions from files where names match
13314 any regular expression (separated by a semi-colon).
13315
13316 For example, @option{-fprofile-filter-files=main.c;module.*.c} will instrument
13317 only @file{main.c} and all C files starting with 'module'.
13318
13319 @item -fprofile-exclude-files=@var{regex}
13320 @opindex fprofile-exclude-files
13321
13322 Instrument only functions from files where names do not match
13323 all the regular expressions (separated by a semi-colon).
13324
13325 For example, @option{-fprofile-exclude-files=/usr/*} will prevent instrumentation
13326 of all files that are located in @file{/usr/} folder.
13327
13328 @item -fsanitize=address
13329 @opindex fsanitize=address
13330 Enable AddressSanitizer, a fast memory error detector.
13331 Memory access instructions are instrumented to detect
13332 out-of-bounds and use-after-free bugs.
13333 The option enables @option{-fsanitize-address-use-after-scope}.
13334 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
13335 more details.  The run-time behavior can be influenced using the
13336 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
13337 the available options are shown at startup of the instrumented program.  See
13338 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
13339 for a list of supported options.
13340 The option cannot be combined with @option{-fsanitize=thread}.
13341
13342 @item -fsanitize=kernel-address
13343 @opindex fsanitize=kernel-address
13344 Enable AddressSanitizer for Linux kernel.
13345 See @uref{https://github.com/google/kasan/wiki} for more details.
13346
13347 @item -fsanitize=pointer-compare
13348 @opindex fsanitize=pointer-compare
13349 Instrument comparison operation (<, <=, >, >=) with pointer operands.
13350 The option must be combined with either @option{-fsanitize=kernel-address} or
13351 @option{-fsanitize=address}
13352 The option cannot be combined with @option{-fsanitize=thread}.
13353 Note: By default the check is disabled at run time.  To enable it,
13354 add @code{detect_invalid_pointer_pairs=2} to the environment variable
13355 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
13356 invalid operation only when both pointers are non-null.
13357
13358 @item -fsanitize=pointer-subtract
13359 @opindex fsanitize=pointer-subtract
13360 Instrument subtraction with pointer operands.
13361 The option must be combined with either @option{-fsanitize=kernel-address} or
13362 @option{-fsanitize=address}
13363 The option cannot be combined with @option{-fsanitize=thread}.
13364 Note: By default the check is disabled at run time.  To enable it,
13365 add @code{detect_invalid_pointer_pairs=2} to the environment variable
13366 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
13367 invalid operation only when both pointers are non-null.
13368
13369 @item -fsanitize=thread
13370 @opindex fsanitize=thread
13371 Enable ThreadSanitizer, a fast data race detector.
13372 Memory access instructions are instrumented to detect
13373 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
13374 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
13375 environment variable; see
13376 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
13377 supported options.
13378 The option cannot be combined with @option{-fsanitize=address},
13379 @option{-fsanitize=leak}.
13380
13381 Note that sanitized atomic builtins cannot throw exceptions when
13382 operating on invalid memory addresses with non-call exceptions
13383 (@option{-fnon-call-exceptions}).
13384
13385 @item -fsanitize=leak
13386 @opindex fsanitize=leak
13387 Enable LeakSanitizer, a memory leak detector.
13388 This option only matters for linking of executables and
13389 the executable is linked against a library that overrides @code{malloc}
13390 and other allocator functions.  See
13391 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
13392 details.  The run-time behavior can be influenced using the
13393 @env{LSAN_OPTIONS} environment variable.
13394 The option cannot be combined with @option{-fsanitize=thread}.
13395
13396 @item -fsanitize=undefined
13397 @opindex fsanitize=undefined
13398 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
13399 Various computations are instrumented to detect undefined behavior
13400 at runtime.  Current suboptions are:
13401
13402 @table @gcctabopt
13403
13404 @item -fsanitize=shift
13405 @opindex fsanitize=shift
13406 This option enables checking that the result of a shift operation is
13407 not undefined.  Note that what exactly is considered undefined differs
13408 slightly between C and C++, as well as between ISO C90 and C99, etc.
13409 This option has two suboptions, @option{-fsanitize=shift-base} and
13410 @option{-fsanitize=shift-exponent}.
13411
13412 @item -fsanitize=shift-exponent
13413 @opindex fsanitize=shift-exponent
13414 This option enables checking that the second argument of a shift operation
13415 is not negative and is smaller than the precision of the promoted first
13416 argument.
13417
13418 @item -fsanitize=shift-base
13419 @opindex fsanitize=shift-base
13420 If the second argument of a shift operation is within range, check that the
13421 result of a shift operation is not undefined.  Note that what exactly is
13422 considered undefined differs slightly between C and C++, as well as between
13423 ISO C90 and C99, etc.
13424
13425 @item -fsanitize=integer-divide-by-zero
13426 @opindex fsanitize=integer-divide-by-zero
13427 Detect integer division by zero as well as @code{INT_MIN / -1} division.
13428
13429 @item -fsanitize=unreachable
13430 @opindex fsanitize=unreachable
13431 With this option, the compiler turns the @code{__builtin_unreachable}
13432 call into a diagnostics message call instead.  When reaching the
13433 @code{__builtin_unreachable} call, the behavior is undefined.
13434
13435 @item -fsanitize=vla-bound
13436 @opindex fsanitize=vla-bound
13437 This option instructs the compiler to check that the size of a variable
13438 length array is positive.
13439
13440 @item -fsanitize=null
13441 @opindex fsanitize=null
13442 This option enables pointer checking.  Particularly, the application
13443 built with this option turned on will issue an error message when it
13444 tries to dereference a NULL pointer, or if a reference (possibly an
13445 rvalue reference) is bound to a NULL pointer, or if a method is invoked
13446 on an object pointed by a NULL pointer.
13447
13448 @item -fsanitize=return
13449 @opindex fsanitize=return
13450 This option enables return statement checking.  Programs
13451 built with this option turned on will issue an error message
13452 when the end of a non-void function is reached without actually
13453 returning a value.  This option works in C++ only.
13454
13455 @item -fsanitize=signed-integer-overflow
13456 @opindex fsanitize=signed-integer-overflow
13457 This option enables signed integer overflow checking.  We check that
13458 the result of @code{+}, @code{*}, and both unary and binary @code{-}
13459 does not overflow in the signed arithmetics.  Note, integer promotion
13460 rules must be taken into account.  That is, the following is not an
13461 overflow:
13462 @smallexample
13463 signed char a = SCHAR_MAX;
13464 a++;
13465 @end smallexample
13466
13467 @item -fsanitize=bounds
13468 @opindex fsanitize=bounds
13469 This option enables instrumentation of array bounds.  Various out of bounds
13470 accesses are detected.  Flexible array members, flexible array member-like
13471 arrays, and initializers of variables with static storage are not instrumented.
13472
13473 @item -fsanitize=bounds-strict
13474 @opindex fsanitize=bounds-strict
13475 This option enables strict instrumentation of array bounds.  Most out of bounds
13476 accesses are detected, including flexible array members and flexible array
13477 member-like arrays.  Initializers of variables with static storage are not
13478 instrumented.
13479
13480 @item -fsanitize=alignment
13481 @opindex fsanitize=alignment
13482
13483 This option enables checking of alignment of pointers when they are
13484 dereferenced, or when a reference is bound to insufficiently aligned target,
13485 or when a method or constructor is invoked on insufficiently aligned object.
13486
13487 @item -fsanitize=object-size
13488 @opindex fsanitize=object-size
13489 This option enables instrumentation of memory references using the
13490 @code{__builtin_object_size} function.  Various out of bounds pointer
13491 accesses are detected.
13492
13493 @item -fsanitize=float-divide-by-zero
13494 @opindex fsanitize=float-divide-by-zero
13495 Detect floating-point division by zero.  Unlike other similar options,
13496 @option{-fsanitize=float-divide-by-zero} is not enabled by
13497 @option{-fsanitize=undefined}, since floating-point division by zero can
13498 be a legitimate way of obtaining infinities and NaNs.
13499
13500 @item -fsanitize=float-cast-overflow
13501 @opindex fsanitize=float-cast-overflow
13502 This option enables floating-point type to integer conversion checking.
13503 We check that the result of the conversion does not overflow.
13504 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
13505 not enabled by @option{-fsanitize=undefined}.
13506 This option does not work well with @code{FE_INVALID} exceptions enabled.
13507
13508 @item -fsanitize=nonnull-attribute
13509 @opindex fsanitize=nonnull-attribute
13510
13511 This option enables instrumentation of calls, checking whether null values
13512 are not passed to arguments marked as requiring a non-null value by the
13513 @code{nonnull} function attribute.
13514
13515 @item -fsanitize=returns-nonnull-attribute
13516 @opindex fsanitize=returns-nonnull-attribute
13517
13518 This option enables instrumentation of return statements in functions
13519 marked with @code{returns_nonnull} function attribute, to detect returning
13520 of null values from such functions.
13521
13522 @item -fsanitize=bool
13523 @opindex fsanitize=bool
13524
13525 This option enables instrumentation of loads from bool.  If a value other
13526 than 0/1 is loaded, a run-time error is issued.
13527
13528 @item -fsanitize=enum
13529 @opindex fsanitize=enum
13530
13531 This option enables instrumentation of loads from an enum type.  If
13532 a value outside the range of values for the enum type is loaded,
13533 a run-time error is issued.
13534
13535 @item -fsanitize=vptr
13536 @opindex fsanitize=vptr
13537
13538 This option enables instrumentation of C++ member function calls, member
13539 accesses and some conversions between pointers to base and derived classes,
13540 to verify the referenced object has the correct dynamic type.
13541
13542 @item -fsanitize=pointer-overflow
13543 @opindex fsanitize=pointer-overflow
13544
13545 This option enables instrumentation of pointer arithmetics.  If the pointer
13546 arithmetics overflows, a run-time error is issued.
13547
13548 @item -fsanitize=builtin
13549 @opindex fsanitize=builtin
13550
13551 This option enables instrumentation of arguments to selected builtin
13552 functions.  If an invalid value is passed to such arguments, a run-time
13553 error is issued.  E.g.@ passing 0 as the argument to @code{__builtin_ctz}
13554 or @code{__builtin_clz} invokes undefined behavior and is diagnosed
13555 by this option.
13556
13557 @end table
13558
13559 While @option{-ftrapv} causes traps for signed overflows to be emitted,
13560 @option{-fsanitize=undefined} gives a diagnostic message.
13561 This currently works only for the C family of languages.
13562
13563 @item -fno-sanitize=all
13564 @opindex fno-sanitize=all
13565
13566 This option disables all previously enabled sanitizers.
13567 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
13568 together.
13569
13570 @item -fasan-shadow-offset=@var{number}
13571 @opindex fasan-shadow-offset
13572 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
13573 It is useful for experimenting with different shadow memory layouts in
13574 Kernel AddressSanitizer.
13575
13576 @item -fsanitize-sections=@var{s1},@var{s2},...
13577 @opindex fsanitize-sections
13578 Sanitize global variables in selected user-defined sections.  @var{si} may
13579 contain wildcards.
13580
13581 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
13582 @opindex fsanitize-recover
13583 @opindex fno-sanitize-recover
13584 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
13585 mentioned in comma-separated list of @var{opts}.  Enabling this option
13586 for a sanitizer component causes it to attempt to continue
13587 running the program as if no error happened.  This means multiple
13588 runtime errors can be reported in a single program run, and the exit
13589 code of the program may indicate success even when errors
13590 have been reported.  The @option{-fno-sanitize-recover=} option
13591 can be used to alter
13592 this behavior: only the first detected error is reported
13593 and program then exits with a non-zero exit code.
13594
13595 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
13596 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
13597 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
13598 @option{-fsanitize=bounds-strict},
13599 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
13600 For these sanitizers error recovery is turned on by default,
13601 except @option{-fsanitize=address}, for which this feature is experimental.
13602 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
13603 accepted, the former enables recovery for all sanitizers that support it,
13604 the latter disables recovery for all sanitizers that support it.
13605
13606 Even if a recovery mode is turned on the compiler side, it needs to be also
13607 enabled on the runtime library side, otherwise the failures are still fatal.
13608 The runtime library defaults to @code{halt_on_error=0} for
13609 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
13610 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
13611 setting the @code{halt_on_error} flag in the corresponding environment variable.
13612
13613 Syntax without an explicit @var{opts} parameter is deprecated.  It is
13614 equivalent to specifying an @var{opts} list of:
13615
13616 @smallexample
13617 undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
13618 @end smallexample
13619
13620 @item -fsanitize-address-use-after-scope
13621 @opindex fsanitize-address-use-after-scope
13622 Enable sanitization of local variables to detect use-after-scope bugs.
13623 The option sets @option{-fstack-reuse} to @samp{none}.
13624
13625 @item -fsanitize-undefined-trap-on-error
13626 @opindex fsanitize-undefined-trap-on-error
13627 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
13628 report undefined behavior using @code{__builtin_trap} rather than
13629 a @code{libubsan} library routine.  The advantage of this is that the
13630 @code{libubsan} library is not needed and is not linked in, so this
13631 is usable even in freestanding environments.
13632
13633 @item -fsanitize-coverage=trace-pc
13634 @opindex fsanitize-coverage=trace-pc
13635 Enable coverage-guided fuzzing code instrumentation.
13636 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
13637
13638 @item -fsanitize-coverage=trace-cmp
13639 @opindex fsanitize-coverage=trace-cmp
13640 Enable dataflow guided fuzzing code instrumentation.
13641 Inserts a call to @code{__sanitizer_cov_trace_cmp1},
13642 @code{__sanitizer_cov_trace_cmp2}, @code{__sanitizer_cov_trace_cmp4} or
13643 @code{__sanitizer_cov_trace_cmp8} for integral comparison with both operands
13644 variable or @code{__sanitizer_cov_trace_const_cmp1},
13645 @code{__sanitizer_cov_trace_const_cmp2},
13646 @code{__sanitizer_cov_trace_const_cmp4} or
13647 @code{__sanitizer_cov_trace_const_cmp8} for integral comparison with one
13648 operand constant, @code{__sanitizer_cov_trace_cmpf} or
13649 @code{__sanitizer_cov_trace_cmpd} for float or double comparisons and
13650 @code{__sanitizer_cov_trace_switch} for switch statements.
13651
13652 @item -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]}
13653 @opindex fcf-protection
13654 Enable code instrumentation of control-flow transfers to increase
13655 program security by checking that target addresses of control-flow
13656 transfer instructions (such as indirect function call, function return,
13657 indirect jump) are valid.  This prevents diverting the flow of control
13658 to an unexpected target.  This is intended to protect against such
13659 threats as Return-oriented Programming (ROP), and similarly
13660 call/jmp-oriented programming (COP/JOP).
13661
13662 The value @code{branch} tells the compiler to implement checking of
13663 validity of control-flow transfer at the point of indirect branch
13664 instructions, i.e.@: call/jmp instructions.  The value @code{return}
13665 implements checking of validity at the point of returning from a
13666 function.  The value @code{full} is an alias for specifying both
13667 @code{branch} and @code{return}. The value @code{none} turns off
13668 instrumentation.
13669
13670 The macro @code{__CET__} is defined when @option{-fcf-protection} is
13671 used.  The first bit of @code{__CET__} is set to 1 for the value
13672 @code{branch} and the second bit of @code{__CET__} is set to 1 for
13673 the @code{return}.
13674
13675 You can also use the @code{nocf_check} attribute to identify
13676 which functions and calls should be skipped from instrumentation
13677 (@pxref{Function Attributes}).
13678
13679 Currently the x86 GNU/Linux target provides an implementation based
13680 on Intel Control-flow Enforcement Technology (CET).
13681
13682 @item -fstack-protector
13683 @opindex fstack-protector
13684 Emit extra code to check for buffer overflows, such as stack smashing
13685 attacks.  This is done by adding a guard variable to functions with
13686 vulnerable objects.  This includes functions that call @code{alloca}, and
13687 functions with buffers larger than or equal to 8 bytes.  The guards are
13688 initialized when a function is entered and then checked when the function
13689 exits.  If a guard check fails, an error message is printed and the program
13690 exits.  Only variables that are actually allocated on the stack are
13691 considered, optimized away variables or variables allocated in registers
13692 don't count.
13693
13694 @item -fstack-protector-all
13695 @opindex fstack-protector-all
13696 Like @option{-fstack-protector} except that all functions are protected.
13697
13698 @item -fstack-protector-strong
13699 @opindex fstack-protector-strong
13700 Like @option{-fstack-protector} but includes additional functions to
13701 be protected --- those that have local array definitions, or have
13702 references to local frame addresses.  Only variables that are actually
13703 allocated on the stack are considered, optimized away variables or variables
13704 allocated in registers don't count.
13705
13706 @item -fstack-protector-explicit
13707 @opindex fstack-protector-explicit
13708 Like @option{-fstack-protector} but only protects those functions which
13709 have the @code{stack_protect} attribute.
13710
13711 @item -fstack-check
13712 @opindex fstack-check
13713 Generate code to verify that you do not go beyond the boundary of the
13714 stack.  You should specify this flag if you are running in an
13715 environment with multiple threads, but you only rarely need to specify it in
13716 a single-threaded environment since stack overflow is automatically
13717 detected on nearly all systems if there is only one stack.
13718
13719 Note that this switch does not actually cause checking to be done; the
13720 operating system or the language runtime must do that.  The switch causes
13721 generation of code to ensure that they see the stack being extended.
13722
13723 You can additionally specify a string parameter: @samp{no} means no
13724 checking, @samp{generic} means force the use of old-style checking,
13725 @samp{specific} means use the best checking method and is equivalent
13726 to bare @option{-fstack-check}.
13727
13728 Old-style checking is a generic mechanism that requires no specific
13729 target support in the compiler but comes with the following drawbacks:
13730
13731 @enumerate
13732 @item
13733 Modified allocation strategy for large objects: they are always
13734 allocated dynamically if their size exceeds a fixed threshold.  Note this
13735 may change the semantics of some code.
13736
13737 @item
13738 Fixed limit on the size of the static frame of functions: when it is
13739 topped by a particular function, stack checking is not reliable and
13740 a warning is issued by the compiler.
13741
13742 @item
13743 Inefficiency: because of both the modified allocation strategy and the
13744 generic implementation, code performance is hampered.
13745 @end enumerate
13746
13747 Note that old-style stack checking is also the fallback method for
13748 @samp{specific} if no target support has been added in the compiler.
13749
13750 @samp{-fstack-check=} is designed for Ada's needs to detect infinite recursion
13751 and stack overflows.  @samp{specific} is an excellent choice when compiling
13752 Ada code.  It is not generally sufficient to protect against stack-clash
13753 attacks.  To protect against those you want @samp{-fstack-clash-protection}.
13754
13755 @item -fstack-clash-protection
13756 @opindex fstack-clash-protection
13757 Generate code to prevent stack clash style attacks.  When this option is
13758 enabled, the compiler will only allocate one page of stack space at a time
13759 and each page is accessed immediately after allocation.  Thus, it prevents
13760 allocations from jumping over any stack guard page provided by the
13761 operating system.
13762
13763 Most targets do not fully support stack clash protection.  However, on
13764 those targets @option{-fstack-clash-protection} will protect dynamic stack
13765 allocations.  @option{-fstack-clash-protection} may also provide limited
13766 protection for static stack allocations if the target supports
13767 @option{-fstack-check=specific}.
13768
13769 @item -fstack-limit-register=@var{reg}
13770 @itemx -fstack-limit-symbol=@var{sym}
13771 @itemx -fno-stack-limit
13772 @opindex fstack-limit-register
13773 @opindex fstack-limit-symbol
13774 @opindex fno-stack-limit
13775 Generate code to ensure that the stack does not grow beyond a certain value,
13776 either the value of a register or the address of a symbol.  If a larger
13777 stack is required, a signal is raised at run time.  For most targets,
13778 the signal is raised before the stack overruns the boundary, so
13779 it is possible to catch the signal without taking special precautions.
13780
13781 For instance, if the stack starts at absolute address @samp{0x80000000}
13782 and grows downwards, you can use the flags
13783 @option{-fstack-limit-symbol=__stack_limit} and
13784 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
13785 of 128KB@.  Note that this may only work with the GNU linker.
13786
13787 You can locally override stack limit checking by using the
13788 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
13789
13790 @item -fsplit-stack
13791 @opindex fsplit-stack
13792 Generate code to automatically split the stack before it overflows.
13793 The resulting program has a discontiguous stack which can only
13794 overflow if the program is unable to allocate any more memory.  This
13795 is most useful when running threaded programs, as it is no longer
13796 necessary to calculate a good stack size to use for each thread.  This
13797 is currently only implemented for the x86 targets running
13798 GNU/Linux.
13799
13800 When code compiled with @option{-fsplit-stack} calls code compiled
13801 without @option{-fsplit-stack}, there may not be much stack space
13802 available for the latter code to run.  If compiling all code,
13803 including library code, with @option{-fsplit-stack} is not an option,
13804 then the linker can fix up these calls so that the code compiled
13805 without @option{-fsplit-stack} always has a large stack.  Support for
13806 this is implemented in the gold linker in GNU binutils release 2.21
13807 and later.
13808
13809 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
13810 @opindex fvtable-verify
13811 This option is only available when compiling C++ code.
13812 It turns on (or off, if using @option{-fvtable-verify=none}) the security
13813 feature that verifies at run time, for every virtual call, that
13814 the vtable pointer through which the call is made is valid for the type of
13815 the object, and has not been corrupted or overwritten.  If an invalid vtable
13816 pointer is detected at run time, an error is reported and execution of the
13817 program is immediately halted.
13818
13819 This option causes run-time data structures to be built at program startup,
13820 which are used for verifying the vtable pointers.  
13821 The options @samp{std} and @samp{preinit}
13822 control the timing of when these data structures are built.  In both cases the
13823 data structures are built before execution reaches @code{main}.  Using
13824 @option{-fvtable-verify=std} causes the data structures to be built after
13825 shared libraries have been loaded and initialized.
13826 @option{-fvtable-verify=preinit} causes them to be built before shared
13827 libraries have been loaded and initialized.
13828
13829 If this option appears multiple times in the command line with different
13830 values specified, @samp{none} takes highest priority over both @samp{std} and
13831 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
13832
13833 @item -fvtv-debug
13834 @opindex fvtv-debug
13835 When used in conjunction with @option{-fvtable-verify=std} or 
13836 @option{-fvtable-verify=preinit}, causes debug versions of the 
13837 runtime functions for the vtable verification feature to be called.  
13838 This flag also causes the compiler to log information about which 
13839 vtable pointers it finds for each class.
13840 This information is written to a file named @file{vtv_set_ptr_data.log} 
13841 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
13842 if that is defined or the current working directory otherwise.
13843
13844 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
13845 file, be sure to delete any existing one.
13846
13847 @item -fvtv-counts
13848 @opindex fvtv-counts
13849 This is a debugging flag.  When used in conjunction with
13850 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
13851 causes the compiler to keep track of the total number of virtual calls
13852 it encounters and the number of verifications it inserts.  It also
13853 counts the number of calls to certain run-time library functions
13854 that it inserts and logs this information for each compilation unit.
13855 The compiler writes this information to a file named
13856 @file{vtv_count_data.log} in the directory named by the environment
13857 variable @env{VTV_LOGS_DIR} if that is defined or the current working
13858 directory otherwise.  It also counts the size of the vtable pointer sets
13859 for each class, and writes this information to @file{vtv_class_set_sizes.log}
13860 in the same directory.
13861
13862 Note:  This feature @emph{appends} data to the log files.  To get fresh log
13863 files, be sure to delete any existing ones.
13864
13865 @item -finstrument-functions
13866 @opindex finstrument-functions
13867 Generate instrumentation calls for entry and exit to functions.  Just
13868 after function entry and just before function exit, the following
13869 profiling functions are called with the address of the current
13870 function and its call site.  (On some platforms,
13871 @code{__builtin_return_address} does not work beyond the current
13872 function, so the call site information may not be available to the
13873 profiling functions otherwise.)
13874
13875 @smallexample
13876 void __cyg_profile_func_enter (void *this_fn,
13877                                void *call_site);
13878 void __cyg_profile_func_exit  (void *this_fn,
13879                                void *call_site);
13880 @end smallexample
13881
13882 The first argument is the address of the start of the current function,
13883 which may be looked up exactly in the symbol table.
13884
13885 This instrumentation is also done for functions expanded inline in other
13886 functions.  The profiling calls indicate where, conceptually, the
13887 inline function is entered and exited.  This means that addressable
13888 versions of such functions must be available.  If all your uses of a
13889 function are expanded inline, this may mean an additional expansion of
13890 code size.  If you use @code{extern inline} in your C code, an
13891 addressable version of such functions must be provided.  (This is
13892 normally the case anyway, but if you get lucky and the optimizer always
13893 expands the functions inline, you might have gotten away without
13894 providing static copies.)
13895
13896 A function may be given the attribute @code{no_instrument_function}, in
13897 which case this instrumentation is not done.  This can be used, for
13898 example, for the profiling functions listed above, high-priority
13899 interrupt routines, and any functions from which the profiling functions
13900 cannot safely be called (perhaps signal handlers, if the profiling
13901 routines generate output or allocate memory).
13902 @xref{Common Function Attributes}.
13903
13904 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
13905 @opindex finstrument-functions-exclude-file-list
13906
13907 Set the list of functions that are excluded from instrumentation (see
13908 the description of @option{-finstrument-functions}).  If the file that
13909 contains a function definition matches with one of @var{file}, then
13910 that function is not instrumented.  The match is done on substrings:
13911 if the @var{file} parameter is a substring of the file name, it is
13912 considered to be a match.
13913
13914 For example:
13915
13916 @smallexample
13917 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
13918 @end smallexample
13919
13920 @noindent
13921 excludes any inline function defined in files whose pathnames
13922 contain @file{/bits/stl} or @file{include/sys}.
13923
13924 If, for some reason, you want to include letter @samp{,} in one of
13925 @var{sym}, write @samp{\,}. For example,
13926 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
13927 (note the single quote surrounding the option).
13928
13929 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
13930 @opindex finstrument-functions-exclude-function-list
13931
13932 This is similar to @option{-finstrument-functions-exclude-file-list},
13933 but this option sets the list of function names to be excluded from
13934 instrumentation.  The function name to be matched is its user-visible
13935 name, such as @code{vector<int> blah(const vector<int> &)}, not the
13936 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
13937 match is done on substrings: if the @var{sym} parameter is a substring
13938 of the function name, it is considered to be a match.  For C99 and C++
13939 extended identifiers, the function name must be given in UTF-8, not
13940 using universal character names.
13941
13942 @item -fpatchable-function-entry=@var{N}[,@var{M}]
13943 @opindex fpatchable-function-entry
13944 Generate @var{N} NOPs right at the beginning
13945 of each function, with the function entry point before the @var{M}th NOP.
13946 If @var{M} is omitted, it defaults to @code{0} so the
13947 function entry points to the address just at the first NOP.
13948 The NOP instructions reserve extra space which can be used to patch in
13949 any desired instrumentation at run time, provided that the code segment
13950 is writable.  The amount of space is controllable indirectly via
13951 the number of NOPs; the NOP instruction used corresponds to the instruction
13952 emitted by the internal GCC back-end interface @code{gen_nop}.  This behavior
13953 is target-specific and may also depend on the architecture variant and/or
13954 other compilation options.
13955
13956 For run-time identification, the starting addresses of these areas,
13957 which correspond to their respective function entries minus @var{M},
13958 are additionally collected in the @code{__patchable_function_entries}
13959 section of the resulting binary.
13960
13961 Note that the value of @code{__attribute__ ((patchable_function_entry
13962 (N,M)))} takes precedence over command-line option
13963 @option{-fpatchable-function-entry=N,M}.  This can be used to increase
13964 the area size or to remove it completely on a single function.
13965 If @code{N=0}, no pad location is recorded.
13966
13967 The NOP instructions are inserted at---and maybe before, depending on
13968 @var{M}---the function entry address, even before the prologue.
13969
13970 @end table
13971
13972
13973 @node Preprocessor Options
13974 @section Options Controlling the Preprocessor
13975 @cindex preprocessor options
13976 @cindex options, preprocessor
13977
13978 These options control the C preprocessor, which is run on each C source
13979 file before actual compilation.
13980
13981 If you use the @option{-E} option, nothing is done except preprocessing.
13982 Some of these options make sense only together with @option{-E} because
13983 they cause the preprocessor output to be unsuitable for actual
13984 compilation.
13985
13986 In addition to the options listed here, there are a number of options 
13987 to control search paths for include files documented in 
13988 @ref{Directory Options}.  
13989 Options to control preprocessor diagnostics are listed in 
13990 @ref{Warning Options}.
13991
13992 @table @gcctabopt
13993 @include cppopts.texi
13994
13995 @item -Wp,@var{option}
13996 @opindex Wp
13997 You can use @option{-Wp,@var{option}} to bypass the compiler driver
13998 and pass @var{option} directly through to the preprocessor.  If
13999 @var{option} contains commas, it is split into multiple options at the
14000 commas.  However, many options are modified, translated or interpreted
14001 by the compiler driver before being passed to the preprocessor, and
14002 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
14003 interface is undocumented and subject to change, so whenever possible
14004 you should avoid using @option{-Wp} and let the driver handle the
14005 options instead.
14006
14007 @item -Xpreprocessor @var{option}
14008 @opindex Xpreprocessor
14009 Pass @var{option} as an option to the preprocessor.  You can use this to
14010 supply system-specific preprocessor options that GCC does not 
14011 recognize.
14012
14013 If you want to pass an option that takes an argument, you must use
14014 @option{-Xpreprocessor} twice, once for the option and once for the argument.
14015
14016 @item -no-integrated-cpp
14017 @opindex no-integrated-cpp
14018 Perform preprocessing as a separate pass before compilation.
14019 By default, GCC performs preprocessing as an integrated part of
14020 input tokenization and parsing.
14021 If this option is provided, the appropriate language front end
14022 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
14023 and Objective-C, respectively) is instead invoked twice,
14024 once for preprocessing only and once for actual compilation
14025 of the preprocessed input.
14026 This option may be useful in conjunction with the @option{-B} or
14027 @option{-wrapper} options to specify an alternate preprocessor or
14028 perform additional processing of the program source between
14029 normal preprocessing and compilation.
14030
14031 @end table
14032
14033 @node Assembler Options
14034 @section Passing Options to the Assembler
14035
14036 @c prevent bad page break with this line
14037 You can pass options to the assembler.
14038
14039 @table @gcctabopt
14040 @item -Wa,@var{option}
14041 @opindex Wa
14042 Pass @var{option} as an option to the assembler.  If @var{option}
14043 contains commas, it is split into multiple options at the commas.
14044
14045 @item -Xassembler @var{option}
14046 @opindex Xassembler
14047 Pass @var{option} as an option to the assembler.  You can use this to
14048 supply system-specific assembler options that GCC does not
14049 recognize.
14050
14051 If you want to pass an option that takes an argument, you must use
14052 @option{-Xassembler} twice, once for the option and once for the argument.
14053
14054 @end table
14055
14056 @node Link Options
14057 @section Options for Linking
14058 @cindex link options
14059 @cindex options, linking
14060
14061 These options come into play when the compiler links object files into
14062 an executable output file.  They are meaningless if the compiler is
14063 not doing a link step.
14064
14065 @table @gcctabopt
14066 @cindex file names
14067 @item @var{object-file-name}
14068 A file name that does not end in a special recognized suffix is
14069 considered to name an object file or library.  (Object files are
14070 distinguished from libraries by the linker according to the file
14071 contents.)  If linking is done, these object files are used as input
14072 to the linker.
14073
14074 @item -c
14075 @itemx -S
14076 @itemx -E
14077 @opindex c
14078 @opindex S
14079 @opindex E
14080 If any of these options is used, then the linker is not run, and
14081 object file names should not be used as arguments.  @xref{Overall
14082 Options}.
14083
14084 @item -flinker-output=@var{type}
14085 @opindex flinker-output
14086 This option controls code generation of the link-time optimizer.  By
14087 default the linker output is automatically determined by the linker
14088 plugin.  For debugging the compiler and if incremental linking with a 
14089 non-LTO object file is desired, it may be useful to control the type
14090 manually.
14091
14092 If @var{type} is @samp{exec}, code generation produces a static
14093 binary. In this case @option{-fpic} and @option{-fpie} are both
14094 disabled.
14095
14096 If @var{type} is @samp{dyn}, code generation produces a shared
14097 library.  In this case @option{-fpic} or @option{-fPIC} is preserved,
14098 but not enabled automatically.  This allows to build shared libraries
14099 without position-independent code on architectures where this is
14100 possible, i.e.@: on x86.
14101
14102 If @var{type} is @samp{pie}, code generation produces an @option{-fpie}
14103 executable. This results in similar optimizations as @samp{exec}
14104 except that @option{-fpie} is not disabled if specified at compilation
14105 time.
14106
14107 If @var{type} is @samp{rel}, the compiler assumes that incremental linking is
14108 done.  The sections containing intermediate code for link-time optimization are
14109 merged, pre-optimized, and output to the resulting object file. In addition, if
14110 @option{-ffat-lto-objects} is specified, binary code is produced for future
14111 non-LTO linking. The object file produced by incremental linking is smaller
14112 than a static library produced from the same object files.  At link time the
14113 result of incremental linking also loads faster than a static
14114 library assuming that the majority of objects in the library are used.
14115
14116 Finally @samp{nolto-rel} configures the compiler for incremental linking where
14117 code generation is forced, a final binary is produced, and the intermediate
14118 code for later link-time optimization is stripped. When multiple object files
14119 are linked together the resulting code is better optimized than with
14120 link-time optimizations disabled (for example, cross-module inlining 
14121 happens), but most of benefits of whole program optimizations are lost. 
14122
14123 During the incremental link (by @option{-r}) the linker plugin defaults to
14124 @option{rel}. With current interfaces to GNU Binutils it is however not
14125 possible to incrementally link LTO objects and non-LTO objects into a single
14126 mixed object file.  If any of object files in incremental link cannot
14127 be used for link-time optimization, the linker plugin issues a warning and
14128 uses @samp{nolto-rel}. To maintain whole program optimization, it is
14129 recommended to link such objects into static library instead. Alternatively it
14130 is possible to use H.J. Lu's binutils with support for mixed objects.
14131
14132 @item -fuse-ld=bfd
14133 @opindex fuse-ld=bfd
14134 Use the @command{bfd} linker instead of the default linker.
14135
14136 @item -fuse-ld=gold
14137 @opindex fuse-ld=gold
14138 Use the @command{gold} linker instead of the default linker.
14139
14140 @item -fuse-ld=lld
14141 @opindex fuse-ld=lld
14142 Use the LLVM @command{lld} linker instead of the default linker.
14143
14144 @cindex Libraries
14145 @item -l@var{library}
14146 @itemx -l @var{library}
14147 @opindex l
14148 Search the library named @var{library} when linking.  (The second
14149 alternative with the library as a separate argument is only for
14150 POSIX compliance and is not recommended.)
14151
14152 The @option{-l} option is passed directly to the linker by GCC.  Refer
14153 to your linker documentation for exact details.  The general
14154 description below applies to the GNU linker.  
14155
14156 The linker searches a standard list of directories for the library.
14157 The directories searched include several standard system directories
14158 plus any that you specify with @option{-L}.
14159
14160 Static libraries are archives of object files, and have file names
14161 like @file{lib@var{library}.a}.  Some targets also support shared
14162 libraries, which typically have names like @file{lib@var{library}.so}.
14163 If both static and shared libraries are found, the linker gives
14164 preference to linking with the shared library unless the
14165 @option{-static} option is used.
14166
14167 It makes a difference where in the command you write this option; the
14168 linker searches and processes libraries and object files in the order they
14169 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
14170 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
14171 to functions in @samp{z}, those functions may not be loaded.
14172
14173 @item -lobjc
14174 @opindex lobjc
14175 You need this special case of the @option{-l} option in order to
14176 link an Objective-C or Objective-C++ program.
14177
14178 @item -nostartfiles
14179 @opindex nostartfiles
14180 Do not use the standard system startup files when linking.
14181 The standard system libraries are used normally, unless @option{-nostdlib},
14182 @option{-nolibc}, or @option{-nodefaultlibs} is used.
14183
14184 @item -nodefaultlibs
14185 @opindex nodefaultlibs
14186 Do not use the standard system libraries when linking.
14187 Only the libraries you specify are passed to the linker, and options
14188 specifying linkage of the system libraries, such as @option{-static-libgcc}
14189 or @option{-shared-libgcc}, are ignored.  
14190 The standard startup files are used normally, unless @option{-nostartfiles}
14191 is used.  
14192
14193 The compiler may generate calls to @code{memcmp},
14194 @code{memset}, @code{memcpy} and @code{memmove}.
14195 These entries are usually resolved by entries in
14196 libc.  These entry points should be supplied through some other
14197 mechanism when this option is specified.
14198
14199 @item -nolibc
14200 @opindex nolibc
14201 Do not use the C library or system libraries tightly coupled with it when
14202 linking.  Still link with the startup files, @file{libgcc} or toolchain
14203 provided language support libraries such as @file{libgnat}, @file{libgfortran}
14204 or @file{libstdc++} unless options preventing their inclusion are used as
14205 well.  This typically removes @option{-lc} from the link command line, as well
14206 as system libraries that normally go with it and become meaningless when
14207 absence of a C library is assumed, for example @option{-lpthread} or
14208 @option{-lm} in some configurations.  This is intended for bare-board
14209 targets when there is indeed no C library available.
14210
14211 @item -nostdlib
14212 @opindex nostdlib
14213 Do not use the standard system startup files or libraries when linking.
14214 No startup files and only the libraries you specify are passed to
14215 the linker, and options specifying linkage of the system libraries, such as
14216 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
14217
14218 The compiler may generate calls to @code{memcmp}, @code{memset},
14219 @code{memcpy} and @code{memmove}.
14220 These entries are usually resolved by entries in
14221 libc.  These entry points should be supplied through some other
14222 mechanism when this option is specified.
14223
14224 @cindex @option{-lgcc}, use with @option{-nostdlib}
14225 @cindex @option{-nostdlib} and unresolved references
14226 @cindex unresolved references and @option{-nostdlib}
14227 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
14228 @cindex @option{-nodefaultlibs} and unresolved references
14229 @cindex unresolved references and @option{-nodefaultlibs}
14230 One of the standard libraries bypassed by @option{-nostdlib} and
14231 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
14232 which GCC uses to overcome shortcomings of particular machines, or special
14233 needs for some languages.
14234 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
14235 Collection (GCC) Internals},
14236 for more discussion of @file{libgcc.a}.)
14237 In most cases, you need @file{libgcc.a} even when you want to avoid
14238 other standard libraries.  In other words, when you specify @option{-nostdlib}
14239 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
14240 This ensures that you have no unresolved references to internal GCC
14241 library subroutines.
14242 (An example of such an internal subroutine is @code{__main}, used to ensure C++
14243 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
14244 GNU Compiler Collection (GCC) Internals}.)
14245
14246 @item -e @var{entry}
14247 @itemx --entry=@var{entry}
14248 @opindex e
14249 @opindex entry
14250
14251 Specify that the program entry point is @var{entry}.  The argument is
14252 interpreted by the linker; the GNU linker accepts either a symbol name
14253 or an address.
14254
14255 @item -pie
14256 @opindex pie
14257 Produce a dynamically linked position independent executable on targets
14258 that support it.  For predictable results, you must also specify the same
14259 set of options used for compilation (@option{-fpie}, @option{-fPIE},
14260 or model suboptions) when you specify this linker option.
14261
14262 @item -no-pie
14263 @opindex no-pie
14264 Don't produce a dynamically linked position independent executable.
14265
14266 @item -static-pie
14267 @opindex static-pie
14268 Produce a static position independent executable on targets that support
14269 it.  A static position independent executable is similar to a static
14270 executable, but can be loaded at any address without a dynamic linker.
14271 For predictable results, you must also specify the same set of options
14272 used for compilation (@option{-fpie}, @option{-fPIE}, or model
14273 suboptions) when you specify this linker option.
14274
14275 @item -pthread
14276 @opindex pthread
14277 Link with the POSIX threads library.  This option is supported on 
14278 GNU/Linux targets, most other Unix derivatives, and also on 
14279 x86 Cygwin and MinGW targets.  On some targets this option also sets 
14280 flags for the preprocessor, so it should be used consistently for both
14281 compilation and linking.
14282
14283 @item -r
14284 @opindex r
14285 Produce a relocatable object as output.  This is also known as partial
14286 linking.
14287
14288 @item -rdynamic
14289 @opindex rdynamic
14290 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
14291 that support it. This instructs the linker to add all symbols, not
14292 only used ones, to the dynamic symbol table. This option is needed
14293 for some uses of @code{dlopen} or to allow obtaining backtraces
14294 from within a program.
14295
14296 @item -s
14297 @opindex s
14298 Remove all symbol table and relocation information from the executable.
14299
14300 @item -static
14301 @opindex static
14302 On systems that support dynamic linking, this overrides @option{-pie}
14303 and prevents linking with the shared libraries.  On other systems, this
14304 option has no effect.
14305
14306 @item -shared
14307 @opindex shared
14308 Produce a shared object which can then be linked with other objects to
14309 form an executable.  Not all systems support this option.  For predictable
14310 results, you must also specify the same set of options used for compilation
14311 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
14312 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
14313 needs to build supplementary stub code for constructors to work.  On
14314 multi-libbed systems, @samp{gcc -shared} must select the correct support
14315 libraries to link against.  Failing to supply the correct flags may lead
14316 to subtle defects.  Supplying them in cases where they are not necessary
14317 is innocuous.}
14318
14319 @item -shared-libgcc
14320 @itemx -static-libgcc
14321 @opindex shared-libgcc
14322 @opindex static-libgcc
14323 On systems that provide @file{libgcc} as a shared library, these options
14324 force the use of either the shared or static version, respectively.
14325 If no shared version of @file{libgcc} was built when the compiler was
14326 configured, these options have no effect.
14327
14328 There are several situations in which an application should use the
14329 shared @file{libgcc} instead of the static version.  The most common
14330 of these is when the application wishes to throw and catch exceptions
14331 across different shared libraries.  In that case, each of the libraries
14332 as well as the application itself should use the shared @file{libgcc}.
14333
14334 Therefore, the G++ driver automatically adds @option{-shared-libgcc}
14335 whenever you build a shared library or a main executable, because C++
14336 programs typically use exceptions, so this is the right thing to do.
14337
14338 If, instead, you use the GCC driver to create shared libraries, you may
14339 find that they are not always linked with the shared @file{libgcc}.
14340 If GCC finds, at its configuration time, that you have a non-GNU linker
14341 or a GNU linker that does not support option @option{--eh-frame-hdr},
14342 it links the shared version of @file{libgcc} into shared libraries
14343 by default.  Otherwise, it takes advantage of the linker and optimizes
14344 away the linking with the shared version of @file{libgcc}, linking with
14345 the static version of libgcc by default.  This allows exceptions to
14346 propagate through such shared libraries, without incurring relocation
14347 costs at library load time.
14348
14349 However, if a library or main executable is supposed to throw or catch
14350 exceptions, you must link it using the G++ driver, or using the option
14351 @option{-shared-libgcc}, such that it is linked with the shared
14352 @file{libgcc}.
14353
14354 @item -static-libasan
14355 @opindex static-libasan
14356 When the @option{-fsanitize=address} option is used to link a program,
14357 the GCC driver automatically links against @option{libasan}.  If
14358 @file{libasan} is available as a shared library, and the @option{-static}
14359 option is not used, then this links against the shared version of
14360 @file{libasan}.  The @option{-static-libasan} option directs the GCC
14361 driver to link @file{libasan} statically, without necessarily linking
14362 other libraries statically.
14363
14364 @item -static-libtsan
14365 @opindex static-libtsan
14366 When the @option{-fsanitize=thread} option is used to link a program,
14367 the GCC driver automatically links against @option{libtsan}.  If
14368 @file{libtsan} is available as a shared library, and the @option{-static}
14369 option is not used, then this links against the shared version of
14370 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
14371 driver to link @file{libtsan} statically, without necessarily linking
14372 other libraries statically.
14373
14374 @item -static-liblsan
14375 @opindex static-liblsan
14376 When the @option{-fsanitize=leak} option is used to link a program,
14377 the GCC driver automatically links against @option{liblsan}.  If
14378 @file{liblsan} is available as a shared library, and the @option{-static}
14379 option is not used, then this links against the shared version of
14380 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
14381 driver to link @file{liblsan} statically, without necessarily linking
14382 other libraries statically.
14383
14384 @item -static-libubsan
14385 @opindex static-libubsan
14386 When the @option{-fsanitize=undefined} option is used to link a program,
14387 the GCC driver automatically links against @option{libubsan}.  If
14388 @file{libubsan} is available as a shared library, and the @option{-static}
14389 option is not used, then this links against the shared version of
14390 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
14391 driver to link @file{libubsan} statically, without necessarily linking
14392 other libraries statically.
14393
14394 @item -static-libstdc++
14395 @opindex static-libstdc++
14396 When the @command{g++} program is used to link a C++ program, it
14397 normally automatically links against @option{libstdc++}.  If
14398 @file{libstdc++} is available as a shared library, and the
14399 @option{-static} option is not used, then this links against the
14400 shared version of @file{libstdc++}.  That is normally fine.  However, it
14401 is sometimes useful to freeze the version of @file{libstdc++} used by
14402 the program without going all the way to a fully static link.  The
14403 @option{-static-libstdc++} option directs the @command{g++} driver to
14404 link @file{libstdc++} statically, without necessarily linking other
14405 libraries statically.
14406
14407 @item -symbolic
14408 @opindex symbolic
14409 Bind references to global symbols when building a shared object.  Warn
14410 about any unresolved references (unless overridden by the link editor
14411 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
14412 this option.
14413
14414 @item -T @var{script}
14415 @opindex T
14416 @cindex linker script
14417 Use @var{script} as the linker script.  This option is supported by most
14418 systems using the GNU linker.  On some targets, such as bare-board
14419 targets without an operating system, the @option{-T} option may be required
14420 when linking to avoid references to undefined symbols.
14421
14422 @item -Xlinker @var{option}
14423 @opindex Xlinker
14424 Pass @var{option} as an option to the linker.  You can use this to
14425 supply system-specific linker options that GCC does not recognize.
14426
14427 If you want to pass an option that takes a separate argument, you must use
14428 @option{-Xlinker} twice, once for the option and once for the argument.
14429 For example, to pass @option{-assert definitions}, you must write
14430 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
14431 @option{-Xlinker "-assert definitions"}, because this passes the entire
14432 string as a single argument, which is not what the linker expects.
14433
14434 When using the GNU linker, it is usually more convenient to pass
14435 arguments to linker options using the @option{@var{option}=@var{value}}
14436 syntax than as separate arguments.  For example, you can specify
14437 @option{-Xlinker -Map=output.map} rather than
14438 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
14439 this syntax for command-line options.
14440
14441 @item -Wl,@var{option}
14442 @opindex Wl
14443 Pass @var{option} as an option to the linker.  If @var{option} contains
14444 commas, it is split into multiple options at the commas.  You can use this
14445 syntax to pass an argument to the option.
14446 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
14447 linker.  When using the GNU linker, you can also get the same effect with
14448 @option{-Wl,-Map=output.map}.
14449
14450 @item -u @var{symbol}
14451 @opindex u
14452 Pretend the symbol @var{symbol} is undefined, to force linking of
14453 library modules to define it.  You can use @option{-u} multiple times with
14454 different symbols to force loading of additional library modules.
14455
14456 @item -z @var{keyword}
14457 @opindex z
14458 @option{-z} is passed directly on to the linker along with the keyword
14459 @var{keyword}. See the section in the documentation of your linker for
14460 permitted values and their meanings.
14461 @end table
14462
14463 @node Directory Options
14464 @section Options for Directory Search
14465 @cindex directory options
14466 @cindex options, directory search
14467 @cindex search path
14468
14469 These options specify directories to search for header files, for
14470 libraries and for parts of the compiler:
14471
14472 @table @gcctabopt
14473 @include cppdiropts.texi
14474
14475 @item -iplugindir=@var{dir}
14476 @opindex iplugindir=
14477 Set the directory to search for plugins that are passed
14478 by @option{-fplugin=@var{name}} instead of
14479 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
14480 to be used by the user, but only passed by the driver.
14481
14482 @item -L@var{dir}
14483 @opindex L
14484 Add directory @var{dir} to the list of directories to be searched
14485 for @option{-l}.
14486
14487 @item -B@var{prefix}
14488 @opindex B
14489 This option specifies where to find the executables, libraries,
14490 include files, and data files of the compiler itself.
14491
14492 The compiler driver program runs one or more of the subprograms
14493 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
14494 @var{prefix} as a prefix for each program it tries to run, both with and
14495 without @samp{@var{machine}/@var{version}/} for the corresponding target
14496 machine and compiler version.
14497
14498 For each subprogram to be run, the compiler driver first tries the
14499 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
14500 is not specified, the driver tries two standard prefixes, 
14501 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
14502 those results in a file name that is found, the unmodified program
14503 name is searched for using the directories specified in your
14504 @env{PATH} environment variable.
14505
14506 The compiler checks to see if the path provided by @option{-B}
14507 refers to a directory, and if necessary it adds a directory
14508 separator character at the end of the path.
14509
14510 @option{-B} prefixes that effectively specify directory names also apply
14511 to libraries in the linker, because the compiler translates these
14512 options into @option{-L} options for the linker.  They also apply to
14513 include files in the preprocessor, because the compiler translates these
14514 options into @option{-isystem} options for the preprocessor.  In this case,
14515 the compiler appends @samp{include} to the prefix.
14516
14517 The runtime support file @file{libgcc.a} can also be searched for using
14518 the @option{-B} prefix, if needed.  If it is not found there, the two
14519 standard prefixes above are tried, and that is all.  The file is left
14520 out of the link if it is not found by those means.
14521
14522 Another way to specify a prefix much like the @option{-B} prefix is to use
14523 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
14524 Variables}.
14525
14526 As a special kludge, if the path provided by @option{-B} is
14527 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
14528 9, then it is replaced by @file{[dir/]include}.  This is to help
14529 with boot-strapping the compiler.
14530
14531 @item -no-canonical-prefixes
14532 @opindex no-canonical-prefixes
14533 Do not expand any symbolic links, resolve references to @samp{/../}
14534 or @samp{/./}, or make the path absolute when generating a relative
14535 prefix.
14536
14537 @item --sysroot=@var{dir}
14538 @opindex sysroot
14539 Use @var{dir} as the logical root directory for headers and libraries.
14540 For example, if the compiler normally searches for headers in
14541 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
14542 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
14543
14544 If you use both this option and the @option{-isysroot} option, then
14545 the @option{--sysroot} option applies to libraries, but the
14546 @option{-isysroot} option applies to header files.
14547
14548 The GNU linker (beginning with version 2.16) has the necessary support
14549 for this option.  If your linker does not support this option, the
14550 header file aspect of @option{--sysroot} still works, but the
14551 library aspect does not.
14552
14553 @item --no-sysroot-suffix
14554 @opindex no-sysroot-suffix
14555 For some targets, a suffix is added to the root directory specified
14556 with @option{--sysroot}, depending on the other options used, so that
14557 headers may for example be found in
14558 @file{@var{dir}/@var{suffix}/usr/include} instead of
14559 @file{@var{dir}/usr/include}.  This option disables the addition of
14560 such a suffix.
14561
14562 @end table
14563
14564 @node Code Gen Options
14565 @section Options for Code Generation Conventions
14566 @cindex code generation conventions
14567 @cindex options, code generation
14568 @cindex run-time options
14569
14570 These machine-independent options control the interface conventions
14571 used in code generation.
14572
14573 Most of them have both positive and negative forms; the negative form
14574 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
14575 one of the forms is listed---the one that is not the default.  You
14576 can figure out the other form by either removing @samp{no-} or adding
14577 it.
14578
14579 @table @gcctabopt
14580 @item -fstack-reuse=@var{reuse-level}
14581 @opindex fstack_reuse
14582 This option controls stack space reuse for user declared local/auto variables
14583 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
14584 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
14585 local variables and temporaries, @samp{named_vars} enables the reuse only for
14586 user defined local variables with names, and @samp{none} disables stack reuse
14587 completely. The default value is @samp{all}. The option is needed when the
14588 program extends the lifetime of a scoped local variable or a compiler generated
14589 temporary beyond the end point defined by the language.  When a lifetime of
14590 a variable ends, and if the variable lives in memory, the optimizing compiler
14591 has the freedom to reuse its stack space with other temporaries or scoped
14592 local variables whose live range does not overlap with it. Legacy code extending
14593 local lifetime is likely to break with the stack reuse optimization.
14594
14595 For example,
14596
14597 @smallexample
14598    int *p;
14599    @{
14600      int local1;
14601
14602      p = &local1;
14603      local1 = 10;
14604      ....
14605    @}
14606    @{
14607       int local2;
14608       local2 = 20;
14609       ...
14610    @}
14611
14612    if (*p == 10)  // out of scope use of local1
14613      @{
14614
14615      @}
14616 @end smallexample
14617
14618 Another example:
14619 @smallexample
14620
14621    struct A
14622    @{
14623        A(int k) : i(k), j(k) @{ @}
14624        int i;
14625        int j;
14626    @};
14627
14628    A *ap;
14629
14630    void foo(const A& ar)
14631    @{
14632       ap = &ar;
14633    @}
14634
14635    void bar()
14636    @{
14637       foo(A(10)); // temp object's lifetime ends when foo returns
14638
14639       @{
14640         A a(20);
14641         ....
14642       @}
14643       ap->i+= 10;  // ap references out of scope temp whose space
14644                    // is reused with a. What is the value of ap->i?
14645    @}
14646
14647 @end smallexample
14648
14649 The lifetime of a compiler generated temporary is well defined by the C++
14650 standard. When a lifetime of a temporary ends, and if the temporary lives
14651 in memory, the optimizing compiler has the freedom to reuse its stack
14652 space with other temporaries or scoped local variables whose live range
14653 does not overlap with it. However some of the legacy code relies on
14654 the behavior of older compilers in which temporaries' stack space is
14655 not reused, the aggressive stack reuse can lead to runtime errors. This
14656 option is used to control the temporary stack reuse optimization.
14657
14658 @item -ftrapv
14659 @opindex ftrapv
14660 This option generates traps for signed overflow on addition, subtraction,
14661 multiplication operations.
14662 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
14663 @option{-ftrapv} @option{-fwrapv} on the command-line results in
14664 @option{-fwrapv} being effective.  Note that only active options override, so
14665 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
14666 results in @option{-ftrapv} being effective.
14667
14668 @item -fwrapv
14669 @opindex fwrapv
14670 This option instructs the compiler to assume that signed arithmetic
14671 overflow of addition, subtraction and multiplication wraps around
14672 using twos-complement representation.  This flag enables some optimizations
14673 and disables others.
14674 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
14675 @option{-ftrapv} @option{-fwrapv} on the command-line results in
14676 @option{-fwrapv} being effective.  Note that only active options override, so
14677 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
14678 results in @option{-ftrapv} being effective.
14679
14680 @item -fwrapv-pointer
14681 @opindex fwrapv-pointer
14682 This option instructs the compiler to assume that pointer arithmetic
14683 overflow on addition and subtraction wraps around using twos-complement
14684 representation.  This flag disables some optimizations which assume
14685 pointer overflow is invalid.
14686
14687 @item -fstrict-overflow
14688 @opindex fstrict-overflow
14689 This option implies @option{-fno-wrapv} @option{-fno-wrapv-pointer} and when
14690 negated implies @option{-fwrapv} @option{-fwrapv-pointer}.
14691
14692 @item -fexceptions
14693 @opindex fexceptions
14694 Enable exception handling.  Generates extra code needed to propagate
14695 exceptions.  For some targets, this implies GCC generates frame
14696 unwind information for all functions, which can produce significant data
14697 size overhead, although it does not affect execution.  If you do not
14698 specify this option, GCC enables it by default for languages like
14699 C++ that normally require exception handling, and disables it for
14700 languages like C that do not normally require it.  However, you may need
14701 to enable this option when compiling C code that needs to interoperate
14702 properly with exception handlers written in C++.  You may also wish to
14703 disable this option if you are compiling older C++ programs that don't
14704 use exception handling.
14705
14706 @item -fnon-call-exceptions
14707 @opindex fnon-call-exceptions
14708 Generate code that allows trapping instructions to throw exceptions.
14709 Note that this requires platform-specific runtime support that does
14710 not exist everywhere.  Moreover, it only allows @emph{trapping}
14711 instructions to throw exceptions, i.e.@: memory references or floating-point
14712 instructions.  It does not allow exceptions to be thrown from
14713 arbitrary signal handlers such as @code{SIGALRM}.
14714
14715 @item -fdelete-dead-exceptions
14716 @opindex fdelete-dead-exceptions
14717 Consider that instructions that may throw exceptions but don't otherwise
14718 contribute to the execution of the program can be optimized away.
14719 This option is enabled by default for the Ada front end, as permitted by
14720 the Ada language specification.
14721 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
14722
14723 @item -funwind-tables
14724 @opindex funwind-tables
14725 Similar to @option{-fexceptions}, except that it just generates any needed
14726 static data, but does not affect the generated code in any other way.
14727 You normally do not need to enable this option; instead, a language processor
14728 that needs this handling enables it on your behalf.
14729
14730 @item -fasynchronous-unwind-tables
14731 @opindex fasynchronous-unwind-tables
14732 Generate unwind table in DWARF format, if supported by target machine.  The
14733 table is exact at each instruction boundary, so it can be used for stack
14734 unwinding from asynchronous events (such as debugger or garbage collector).
14735
14736 @item -fno-gnu-unique
14737 @opindex fno-gnu-unique
14738 @opindex fgnu-unique
14739 On systems with recent GNU assembler and C library, the C++ compiler
14740 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
14741 of template static data members and static local variables in inline
14742 functions are unique even in the presence of @code{RTLD_LOCAL}; this
14743 is necessary to avoid problems with a library used by two different
14744 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
14745 therefore disagreeing with the other one about the binding of the
14746 symbol.  But this causes @code{dlclose} to be ignored for affected
14747 DSOs; if your program relies on reinitialization of a DSO via
14748 @code{dlclose} and @code{dlopen}, you can use
14749 @option{-fno-gnu-unique}.
14750
14751 @item -fpcc-struct-return
14752 @opindex fpcc-struct-return
14753 Return ``short'' @code{struct} and @code{union} values in memory like
14754 longer ones, rather than in registers.  This convention is less
14755 efficient, but it has the advantage of allowing intercallability between
14756 GCC-compiled files and files compiled with other compilers, particularly
14757 the Portable C Compiler (pcc).
14758
14759 The precise convention for returning structures in memory depends
14760 on the target configuration macros.
14761
14762 Short structures and unions are those whose size and alignment match
14763 that of some integer type.
14764
14765 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
14766 switch is not binary compatible with code compiled with the
14767 @option{-freg-struct-return} switch.
14768 Use it to conform to a non-default application binary interface.
14769
14770 @item -freg-struct-return
14771 @opindex freg-struct-return
14772 Return @code{struct} and @code{union} values in registers when possible.
14773 This is more efficient for small structures than
14774 @option{-fpcc-struct-return}.
14775
14776 If you specify neither @option{-fpcc-struct-return} nor
14777 @option{-freg-struct-return}, GCC defaults to whichever convention is
14778 standard for the target.  If there is no standard convention, GCC
14779 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14780 the principal compiler.  In those cases, we can choose the standard, and
14781 we chose the more efficient register return alternative.
14782
14783 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14784 switch is not binary compatible with code compiled with the
14785 @option{-fpcc-struct-return} switch.
14786 Use it to conform to a non-default application binary interface.
14787
14788 @item -fshort-enums
14789 @opindex fshort-enums
14790 Allocate to an @code{enum} type only as many bytes as it needs for the
14791 declared range of possible values.  Specifically, the @code{enum} type
14792 is equivalent to the smallest integer type that has enough room.
14793
14794 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14795 code that is not binary compatible with code generated without that switch.
14796 Use it to conform to a non-default application binary interface.
14797
14798 @item -fshort-wchar
14799 @opindex fshort-wchar
14800 Override the underlying type for @code{wchar_t} to be @code{short
14801 unsigned int} instead of the default for the target.  This option is
14802 useful for building programs to run under WINE@.
14803
14804 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14805 code that is not binary compatible with code generated without that switch.
14806 Use it to conform to a non-default application binary interface.
14807
14808 @item -fcommon
14809 @opindex fcommon
14810 @opindex fno-common
14811 @cindex tentative definitions
14812 In C code, this option controls the placement of global variables
14813 defined without an initializer, known as @dfn{tentative definitions}
14814 in the C standard.  Tentative definitions are distinct from declarations
14815 of a variable with the @code{extern} keyword, which do not allocate storage.
14816
14817 The default is @option{-fno-common}, which specifies that the compiler places
14818 uninitialized global variables in the BSS section of the object file.
14819 This inhibits the merging of tentative definitions by the linker so you get a
14820 multiple-definition error if the same variable is accidentally defined in more
14821 than one compilation unit.
14822
14823 The @option{-fcommon} places uninitialized global variables in a common block.
14824 This allows the linker to resolve all tentative definitions of the same variable
14825 in different compilation units to the same object, or to a non-tentative
14826 definition.  This behavior is inconsistent with C++, and on many targets implies
14827 a speed and code size penalty on global variable references.  It is mainly
14828 useful to enable legacy code to link without errors.
14829
14830 @item -fno-ident
14831 @opindex fno-ident
14832 @opindex fident
14833 Ignore the @code{#ident} directive.
14834
14835 @item -finhibit-size-directive
14836 @opindex finhibit-size-directive
14837 Don't output a @code{.size} assembler directive, or anything else that
14838 would cause trouble if the function is split in the middle, and the
14839 two halves are placed at locations far apart in memory.  This option is
14840 used when compiling @file{crtstuff.c}; you should not need to use it
14841 for anything else.
14842
14843 @item -fverbose-asm
14844 @opindex fverbose-asm
14845 Put extra commentary information in the generated assembly code to
14846 make it more readable.  This option is generally only of use to those
14847 who actually need to read the generated assembly code (perhaps while
14848 debugging the compiler itself).
14849
14850 @option{-fno-verbose-asm}, the default, causes the
14851 extra information to be omitted and is useful when comparing two assembler
14852 files.
14853
14854 The added comments include:
14855
14856 @itemize @bullet
14857
14858 @item
14859 information on the compiler version and command-line options,
14860
14861 @item
14862 the source code lines associated with the assembly instructions,
14863 in the form FILENAME:LINENUMBER:CONTENT OF LINE,
14864
14865 @item
14866 hints on which high-level expressions correspond to
14867 the various assembly instruction operands.
14868
14869 @end itemize
14870
14871 For example, given this C source file:
14872
14873 @smallexample
14874 int test (int n)
14875 @{
14876   int i;
14877   int total = 0;
14878
14879   for (i = 0; i < n; i++)
14880     total += i * i;
14881
14882   return total;
14883 @}
14884 @end smallexample
14885
14886 compiling to (x86_64) assembly via @option{-S} and emitting the result
14887 direct to stdout via @option{-o} @option{-}
14888
14889 @smallexample
14890 gcc -S test.c -fverbose-asm -Os -o -
14891 @end smallexample
14892
14893 gives output similar to this:
14894
14895 @smallexample
14896         .file   "test.c"
14897 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
14898   [...snip...]
14899 # options passed:
14900   [...snip...]
14901
14902         .text
14903         .globl  test
14904         .type   test, @@function
14905 test:
14906 .LFB0:
14907         .cfi_startproc
14908 # test.c:4:   int total = 0;
14909         xorl    %eax, %eax      # <retval>
14910 # test.c:6:   for (i = 0; i < n; i++)
14911         xorl    %edx, %edx      # i
14912 .L2:
14913 # test.c:6:   for (i = 0; i < n; i++)
14914         cmpl    %edi, %edx      # n, i
14915         jge     .L5     #,
14916 # test.c:7:     total += i * i;
14917         movl    %edx, %ecx      # i, tmp92
14918         imull   %edx, %ecx      # i, tmp92
14919 # test.c:6:   for (i = 0; i < n; i++)
14920         incl    %edx    # i
14921 # test.c:7:     total += i * i;
14922         addl    %ecx, %eax      # tmp92, <retval>
14923         jmp     .L2     #
14924 .L5:
14925 # test.c:10: @}
14926         ret
14927         .cfi_endproc
14928 .LFE0:
14929         .size   test, .-test
14930         .ident  "GCC: (GNU) 7.0.0 20160809 (experimental)"
14931         .section        .note.GNU-stack,"",@@progbits
14932 @end smallexample
14933
14934 The comments are intended for humans rather than machines and hence the
14935 precise format of the comments is subject to change.
14936
14937 @item -frecord-gcc-switches
14938 @opindex frecord-gcc-switches
14939 This switch causes the command line used to invoke the
14940 compiler to be recorded into the object file that is being created.
14941 This switch is only implemented on some targets and the exact format
14942 of the recording is target and binary file format dependent, but it
14943 usually takes the form of a section containing ASCII text.  This
14944 switch is related to the @option{-fverbose-asm} switch, but that
14945 switch only records information in the assembler output file as
14946 comments, so it never reaches the object file.
14947 See also @option{-grecord-gcc-switches} for another
14948 way of storing compiler options into the object file.
14949
14950 @item -fpic
14951 @opindex fpic
14952 @cindex global offset table
14953 @cindex PIC
14954 Generate position-independent code (PIC) suitable for use in a shared
14955 library, if supported for the target machine.  Such code accesses all
14956 constant addresses through a global offset table (GOT)@.  The dynamic
14957 loader resolves the GOT entries when the program starts (the dynamic
14958 loader is not part of GCC; it is part of the operating system).  If
14959 the GOT size for the linked executable exceeds a machine-specific
14960 maximum size, you get an error message from the linker indicating that
14961 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14962 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
14963 on the m68k and RS/6000.  The x86 has no such limit.)
14964
14965 Position-independent code requires special support, and therefore works
14966 only on certain machines.  For the x86, GCC supports PIC for System V
14967 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14968 position-independent.
14969
14970 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14971 are defined to 1.
14972
14973 @item -fPIC
14974 @opindex fPIC
14975 If supported for the target machine, emit position-independent code,
14976 suitable for dynamic linking and avoiding any limit on the size of the
14977 global offset table.  This option makes a difference on AArch64, m68k,
14978 PowerPC and SPARC@.
14979
14980 Position-independent code requires special support, and therefore works
14981 only on certain machines.
14982
14983 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14984 are defined to 2.
14985
14986 @item -fpie
14987 @itemx -fPIE
14988 @opindex fpie
14989 @opindex fPIE
14990 These options are similar to @option{-fpic} and @option{-fPIC}, but the
14991 generated position-independent code can be only linked into executables.
14992 Usually these options are used to compile code that will be linked using
14993 the @option{-pie} GCC option.
14994
14995 @option{-fpie} and @option{-fPIE} both define the macros
14996 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
14997 for @option{-fpie} and 2 for @option{-fPIE}.
14998
14999 @item -fno-plt
15000 @opindex fno-plt
15001 @opindex fplt
15002 Do not use the PLT for external function calls in position-independent code.
15003 Instead, load the callee address at call sites from the GOT and branch to it.
15004 This leads to more efficient code by eliminating PLT stubs and exposing
15005 GOT loads to optimizations.  On architectures such as 32-bit x86 where
15006 PLT stubs expect the GOT pointer in a specific register, this gives more
15007 register allocation freedom to the compiler.
15008 Lazy binding requires use of the PLT; 
15009 with @option{-fno-plt} all external symbols are resolved at load time.
15010
15011 Alternatively, the function attribute @code{noplt} can be used to avoid calls
15012 through the PLT for specific external functions.
15013
15014 In position-dependent code, a few targets also convert calls to
15015 functions that are marked to not use the PLT to use the GOT instead.
15016
15017 @item -fno-jump-tables
15018 @opindex fno-jump-tables
15019 @opindex fjump-tables
15020 Do not use jump tables for switch statements even where it would be
15021 more efficient than other code generation strategies.  This option is
15022 of use in conjunction with @option{-fpic} or @option{-fPIC} for
15023 building code that forms part of a dynamic linker and cannot
15024 reference the address of a jump table.  On some targets, jump tables
15025 do not require a GOT and this option is not needed.
15026
15027 @item -ffixed-@var{reg}
15028 @opindex ffixed
15029 Treat the register named @var{reg} as a fixed register; generated code
15030 should never refer to it (except perhaps as a stack pointer, frame
15031 pointer or in some other fixed role).
15032
15033 @var{reg} must be the name of a register.  The register names accepted
15034 are machine-specific and are defined in the @code{REGISTER_NAMES}
15035 macro in the machine description macro file.
15036
15037 This flag does not have a negative form, because it specifies a
15038 three-way choice.
15039
15040 @item -fcall-used-@var{reg}
15041 @opindex fcall-used
15042 Treat the register named @var{reg} as an allocable register that is
15043 clobbered by function calls.  It may be allocated for temporaries or
15044 variables that do not live across a call.  Functions compiled this way
15045 do not save and restore the register @var{reg}.
15046
15047 It is an error to use this flag with the frame pointer or stack pointer.
15048 Use of this flag for other registers that have fixed pervasive roles in
15049 the machine's execution model produces disastrous results.
15050
15051 This flag does not have a negative form, because it specifies a
15052 three-way choice.
15053
15054 @item -fcall-saved-@var{reg}
15055 @opindex fcall-saved
15056 Treat the register named @var{reg} as an allocable register saved by
15057 functions.  It may be allocated even for temporaries or variables that
15058 live across a call.  Functions compiled this way save and restore
15059 the register @var{reg} if they use it.
15060
15061 It is an error to use this flag with the frame pointer or stack pointer.
15062 Use of this flag for other registers that have fixed pervasive roles in
15063 the machine's execution model produces disastrous results.
15064
15065 A different sort of disaster results from the use of this flag for
15066 a register in which function values may be returned.
15067
15068 This flag does not have a negative form, because it specifies a
15069 three-way choice.
15070
15071 @item -fpack-struct[=@var{n}]
15072 @opindex fpack-struct
15073 Without a value specified, pack all structure members together without
15074 holes.  When a value is specified (which must be a small power of two), pack
15075 structure members according to this value, representing the maximum
15076 alignment (that is, objects with default alignment requirements larger than
15077 this are output potentially unaligned at the next fitting location.
15078
15079 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
15080 code that is not binary compatible with code generated without that switch.
15081 Additionally, it makes the code suboptimal.
15082 Use it to conform to a non-default application binary interface.
15083
15084 @item -fleading-underscore
15085 @opindex fleading-underscore
15086 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
15087 change the way C symbols are represented in the object file.  One use
15088 is to help link with legacy assembly code.
15089
15090 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
15091 generate code that is not binary compatible with code generated without that
15092 switch.  Use it to conform to a non-default application binary interface.
15093 Not all targets provide complete support for this switch.
15094
15095 @item -ftls-model=@var{model}
15096 @opindex ftls-model
15097 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
15098 The @var{model} argument should be one of @samp{global-dynamic},
15099 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
15100 Note that the choice is subject to optimization: the compiler may use
15101 a more efficient model for symbols not visible outside of the translation
15102 unit, or if @option{-fpic} is not given on the command line.
15103
15104 The default without @option{-fpic} is @samp{initial-exec}; with
15105 @option{-fpic} the default is @samp{global-dynamic}.
15106
15107 @item -ftrampolines
15108 @opindex ftrampolines
15109 For targets that normally need trampolines for nested functions, always
15110 generate them instead of using descriptors.  Otherwise, for targets that
15111 do not need them, like for example HP-PA or IA-64, do nothing.
15112
15113 A trampoline is a small piece of code that is created at run time on the
15114 stack when the address of a nested function is taken, and is used to call
15115 the nested function indirectly.  Therefore, it requires the stack to be
15116 made executable in order for the program to work properly.
15117
15118 @option{-fno-trampolines} is enabled by default on a language by language
15119 basis to let the compiler avoid generating them, if it computes that this
15120 is safe, and replace them with descriptors.  Descriptors are made up of data
15121 only, but the generated code must be prepared to deal with them.  As of this
15122 writing, @option{-fno-trampolines} is enabled by default only for Ada.
15123
15124 Moreover, code compiled with @option{-ftrampolines} and code compiled with
15125 @option{-fno-trampolines} are not binary compatible if nested functions are
15126 present.  This option must therefore be used on a program-wide basis and be
15127 manipulated with extreme care.
15128
15129 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
15130 @opindex fvisibility
15131 Set the default ELF image symbol visibility to the specified option---all
15132 symbols are marked with this unless overridden within the code.
15133 Using this feature can very substantially improve linking and
15134 load times of shared object libraries, produce more optimized
15135 code, provide near-perfect API export and prevent symbol clashes.
15136 It is @strong{strongly} recommended that you use this in any shared objects
15137 you distribute.
15138
15139 Despite the nomenclature, @samp{default} always means public; i.e.,
15140 available to be linked against from outside the shared object.
15141 @samp{protected} and @samp{internal} are pretty useless in real-world
15142 usage so the only other commonly used option is @samp{hidden}.
15143 The default if @option{-fvisibility} isn't specified is
15144 @samp{default}, i.e., make every symbol public.
15145
15146 A good explanation of the benefits offered by ensuring ELF
15147 symbols have the correct visibility is given by ``How To Write
15148 Shared Libraries'' by Ulrich Drepper (which can be found at
15149 @w{@uref{https://www.akkadia.org/drepper/}})---however a superior
15150 solution made possible by this option to marking things hidden when
15151 the default is public is to make the default hidden and mark things
15152 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
15153 and @code{__attribute__ ((visibility("default")))} instead of
15154 @code{__declspec(dllexport)} you get almost identical semantics with
15155 identical syntax.  This is a great boon to those working with
15156 cross-platform projects.
15157
15158 For those adding visibility support to existing code, you may find
15159 @code{#pragma GCC visibility} of use.  This works by you enclosing
15160 the declarations you wish to set visibility for with (for example)
15161 @code{#pragma GCC visibility push(hidden)} and
15162 @code{#pragma GCC visibility pop}.
15163 Bear in mind that symbol visibility should be viewed @strong{as
15164 part of the API interface contract} and thus all new code should
15165 always specify visibility when it is not the default; i.e., declarations
15166 only for use within the local DSO should @strong{always} be marked explicitly
15167 as hidden as so to avoid PLT indirection overheads---making this
15168 abundantly clear also aids readability and self-documentation of the code.
15169 Note that due to ISO C++ specification requirements, @code{operator new} and
15170 @code{operator delete} must always be of default visibility.
15171
15172 Be aware that headers from outside your project, in particular system
15173 headers and headers from any other library you use, may not be
15174 expecting to be compiled with visibility other than the default.  You
15175 may need to explicitly say @code{#pragma GCC visibility push(default)}
15176 before including any such headers.
15177
15178 @code{extern} declarations are not affected by @option{-fvisibility}, so
15179 a lot of code can be recompiled with @option{-fvisibility=hidden} with
15180 no modifications.  However, this means that calls to @code{extern}
15181 functions with no explicit visibility use the PLT, so it is more
15182 effective to use @code{__attribute ((visibility))} and/or
15183 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
15184 declarations should be treated as hidden.
15185
15186 Note that @option{-fvisibility} does affect C++ vague linkage
15187 entities. This means that, for instance, an exception class that is
15188 be thrown between DSOs must be explicitly marked with default
15189 visibility so that the @samp{type_info} nodes are unified between
15190 the DSOs.
15191
15192 An overview of these techniques, their benefits and how to use them
15193 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
15194
15195 @item -fstrict-volatile-bitfields
15196 @opindex fstrict-volatile-bitfields
15197 This option should be used if accesses to volatile bit-fields (or other
15198 structure fields, although the compiler usually honors those types
15199 anyway) should use a single access of the width of the
15200 field's type, aligned to a natural alignment if possible.  For
15201 example, targets with memory-mapped peripheral registers might require
15202 all such accesses to be 16 bits wide; with this flag you can
15203 declare all peripheral bit-fields as @code{unsigned short} (assuming short
15204 is 16 bits on these targets) to force GCC to use 16-bit accesses
15205 instead of, perhaps, a more efficient 32-bit access.
15206
15207 If this option is disabled, the compiler uses the most efficient
15208 instruction.  In the previous example, that might be a 32-bit load
15209 instruction, even though that accesses bytes that do not contain
15210 any portion of the bit-field, or memory-mapped registers unrelated to
15211 the one being updated.
15212
15213 In some cases, such as when the @code{packed} attribute is applied to a 
15214 structure field, it may not be possible to access the field with a single
15215 read or write that is correctly aligned for the target machine.  In this
15216 case GCC falls back to generating multiple accesses rather than code that 
15217 will fault or truncate the result at run time.
15218
15219 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
15220 not allowed to touch non bit-field members.  It is therefore recommended
15221 to define all bits of the field's type as bit-field members.
15222
15223 The default value of this option is determined by the application binary
15224 interface for the target processor.
15225
15226 @item -fsync-libcalls
15227 @opindex fsync-libcalls
15228 This option controls whether any out-of-line instance of the @code{__sync}
15229 family of functions may be used to implement the C++11 @code{__atomic}
15230 family of functions.
15231
15232 The default value of this option is enabled, thus the only useful form
15233 of the option is @option{-fno-sync-libcalls}.  This option is used in
15234 the implementation of the @file{libatomic} runtime library.
15235
15236 @end table
15237
15238 @node Developer Options
15239 @section GCC Developer Options
15240 @cindex developer options
15241 @cindex debugging GCC
15242 @cindex debug dump options
15243 @cindex dump options
15244 @cindex compilation statistics
15245
15246 This section describes command-line options that are primarily of
15247 interest to GCC developers, including options to support compiler
15248 testing and investigation of compiler bugs and compile-time
15249 performance problems.  This includes options that produce debug dumps
15250 at various points in the compilation; that print statistics such as
15251 memory use and execution time; and that print information about GCC's
15252 configuration, such as where it searches for libraries.  You should
15253 rarely need to use any of these options for ordinary compilation and
15254 linking tasks.
15255
15256 Many developer options that cause GCC to dump output to a file take an
15257 optional @samp{=@var{filename}} suffix. You can specify @samp{stdout}
15258 or @samp{-} to dump to standard output, and @samp{stderr} for standard
15259 error.
15260
15261 If @samp{=@var{filename}} is omitted, a default dump file name is
15262 constructed by concatenating the base dump file name, a pass number,
15263 phase letter, and pass name.  The base dump file name is the name of
15264 output file produced by the compiler if explicitly specified and not
15265 an executable; otherwise it is the source file name.
15266 The pass number is determined by the order passes are registered with
15267 the compiler's pass manager. 
15268 This is generally the same as the order of execution, but passes
15269 registered by plugins, target-specific passes, or passes that are
15270 otherwise registered late are numbered higher than the pass named
15271 @samp{final}, even if they are executed earlier.  The phase letter is
15272 one of @samp{i} (inter-procedural analysis), @samp{l}
15273 (language-specific), @samp{r} (RTL), or @samp{t} (tree). 
15274 The files are created in the directory of the output file. 
15275
15276 @table @gcctabopt
15277
15278 @item -fcallgraph-info
15279 @itemx -fcallgraph-info=@var{MARKERS}
15280 @opindex fcallgraph-info
15281 Makes the compiler output callgraph information for the program, on a
15282 per-object-file basis.  The information is generated in the common VCG
15283 format.  It can be decorated with additional, per-node and/or per-edge
15284 information, if a list of comma-separated markers is additionally
15285 specified.  When the @code{su} marker is specified, the callgraph is
15286 decorated with stack usage information; it is equivalent to
15287 @option{-fstack-usage}.  When the @code{da} marker is specified, the
15288 callgraph is decorated with information about dynamically allocated
15289 objects.
15290
15291 When compiling with @option{-flto}, no callgraph information is output
15292 along with the object file.  At LTO link time, @option{-fcallgraph-info}
15293 may generate multiple callgraph information files next to intermediate
15294 LTO output files.
15295
15296 @item -d@var{letters}
15297 @itemx -fdump-rtl-@var{pass}
15298 @itemx -fdump-rtl-@var{pass}=@var{filename}
15299 @opindex d
15300 @opindex fdump-rtl-@var{pass}
15301 Says to make debugging dumps during compilation at times specified by
15302 @var{letters}.  This is used for debugging the RTL-based passes of the
15303 compiler.
15304
15305 Some @option{-d@var{letters}} switches have different meaning when
15306 @option{-E} is used for preprocessing.  @xref{Preprocessor Options},
15307 for information about preprocessor-specific dump options.
15308
15309 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
15310 @option{-d} option @var{letters}.  Here are the possible
15311 letters for use in @var{pass} and @var{letters}, and their meanings:
15312
15313 @table @gcctabopt
15314
15315 @item -fdump-rtl-alignments
15316 @opindex fdump-rtl-alignments
15317 Dump after branch alignments have been computed.
15318
15319 @item -fdump-rtl-asmcons
15320 @opindex fdump-rtl-asmcons
15321 Dump after fixing rtl statements that have unsatisfied in/out constraints.
15322
15323 @item -fdump-rtl-auto_inc_dec
15324 @opindex fdump-rtl-auto_inc_dec
15325 Dump after auto-inc-dec discovery.  This pass is only run on
15326 architectures that have auto inc or auto dec instructions.
15327
15328 @item -fdump-rtl-barriers
15329 @opindex fdump-rtl-barriers
15330 Dump after cleaning up the barrier instructions.
15331
15332 @item -fdump-rtl-bbpart
15333 @opindex fdump-rtl-bbpart
15334 Dump after partitioning hot and cold basic blocks.
15335
15336 @item -fdump-rtl-bbro
15337 @opindex fdump-rtl-bbro
15338 Dump after block reordering.
15339
15340 @item -fdump-rtl-btl1
15341 @itemx -fdump-rtl-btl2
15342 @opindex fdump-rtl-btl2
15343 @opindex fdump-rtl-btl2
15344 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
15345 after the two branch
15346 target load optimization passes.
15347
15348 @item -fdump-rtl-bypass
15349 @opindex fdump-rtl-bypass
15350 Dump after jump bypassing and control flow optimizations.
15351
15352 @item -fdump-rtl-combine
15353 @opindex fdump-rtl-combine
15354 Dump after the RTL instruction combination pass.
15355
15356 @item -fdump-rtl-compgotos
15357 @opindex fdump-rtl-compgotos
15358 Dump after duplicating the computed gotos.
15359
15360 @item -fdump-rtl-ce1
15361 @itemx -fdump-rtl-ce2
15362 @itemx -fdump-rtl-ce3
15363 @opindex fdump-rtl-ce1
15364 @opindex fdump-rtl-ce2
15365 @opindex fdump-rtl-ce3
15366 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
15367 @option{-fdump-rtl-ce3} enable dumping after the three
15368 if conversion passes.
15369
15370 @item -fdump-rtl-cprop_hardreg
15371 @opindex fdump-rtl-cprop_hardreg
15372 Dump after hard register copy propagation.
15373
15374 @item -fdump-rtl-csa
15375 @opindex fdump-rtl-csa
15376 Dump after combining stack adjustments.
15377
15378 @item -fdump-rtl-cse1
15379 @itemx -fdump-rtl-cse2
15380 @opindex fdump-rtl-cse1
15381 @opindex fdump-rtl-cse2
15382 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
15383 the two common subexpression elimination passes.
15384
15385 @item -fdump-rtl-dce
15386 @opindex fdump-rtl-dce
15387 Dump after the standalone dead code elimination passes.
15388
15389 @item -fdump-rtl-dbr
15390 @opindex fdump-rtl-dbr
15391 Dump after delayed branch scheduling.
15392
15393 @item -fdump-rtl-dce1
15394 @itemx -fdump-rtl-dce2
15395 @opindex fdump-rtl-dce1
15396 @opindex fdump-rtl-dce2
15397 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
15398 the two dead store elimination passes.
15399
15400 @item -fdump-rtl-eh
15401 @opindex fdump-rtl-eh
15402 Dump after finalization of EH handling code.
15403
15404 @item -fdump-rtl-eh_ranges
15405 @opindex fdump-rtl-eh_ranges
15406 Dump after conversion of EH handling range regions.
15407
15408 @item -fdump-rtl-expand
15409 @opindex fdump-rtl-expand
15410 Dump after RTL generation.
15411
15412 @item -fdump-rtl-fwprop1
15413 @itemx -fdump-rtl-fwprop2
15414 @opindex fdump-rtl-fwprop1
15415 @opindex fdump-rtl-fwprop2
15416 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
15417 dumping after the two forward propagation passes.
15418
15419 @item -fdump-rtl-gcse1
15420 @itemx -fdump-rtl-gcse2
15421 @opindex fdump-rtl-gcse1
15422 @opindex fdump-rtl-gcse2
15423 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
15424 after global common subexpression elimination.
15425
15426 @item -fdump-rtl-init-regs
15427 @opindex fdump-rtl-init-regs
15428 Dump after the initialization of the registers.
15429
15430 @item -fdump-rtl-initvals
15431 @opindex fdump-rtl-initvals
15432 Dump after the computation of the initial value sets.
15433
15434 @item -fdump-rtl-into_cfglayout
15435 @opindex fdump-rtl-into_cfglayout
15436 Dump after converting to cfglayout mode.
15437
15438 @item -fdump-rtl-ira
15439 @opindex fdump-rtl-ira
15440 Dump after iterated register allocation.
15441
15442 @item -fdump-rtl-jump
15443 @opindex fdump-rtl-jump
15444 Dump after the second jump optimization.
15445
15446 @item -fdump-rtl-loop2
15447 @opindex fdump-rtl-loop2
15448 @option{-fdump-rtl-loop2} enables dumping after the rtl
15449 loop optimization passes.
15450
15451 @item -fdump-rtl-mach
15452 @opindex fdump-rtl-mach
15453 Dump after performing the machine dependent reorganization pass, if that
15454 pass exists.
15455
15456 @item -fdump-rtl-mode_sw
15457 @opindex fdump-rtl-mode_sw
15458 Dump after removing redundant mode switches.
15459
15460 @item -fdump-rtl-rnreg
15461 @opindex fdump-rtl-rnreg
15462 Dump after register renumbering.
15463
15464 @item -fdump-rtl-outof_cfglayout
15465 @opindex fdump-rtl-outof_cfglayout
15466 Dump after converting from cfglayout mode.
15467
15468 @item -fdump-rtl-peephole2
15469 @opindex fdump-rtl-peephole2
15470 Dump after the peephole pass.
15471
15472 @item -fdump-rtl-postreload
15473 @opindex fdump-rtl-postreload
15474 Dump after post-reload optimizations.
15475
15476 @item -fdump-rtl-pro_and_epilogue
15477 @opindex fdump-rtl-pro_and_epilogue
15478 Dump after generating the function prologues and epilogues.
15479
15480 @item -fdump-rtl-sched1
15481 @itemx -fdump-rtl-sched2
15482 @opindex fdump-rtl-sched1
15483 @opindex fdump-rtl-sched2
15484 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
15485 after the basic block scheduling passes.
15486
15487 @item -fdump-rtl-ree
15488 @opindex fdump-rtl-ree
15489 Dump after sign/zero extension elimination.
15490
15491 @item -fdump-rtl-seqabstr
15492 @opindex fdump-rtl-seqabstr
15493 Dump after common sequence discovery.
15494
15495 @item -fdump-rtl-shorten
15496 @opindex fdump-rtl-shorten
15497 Dump after shortening branches.
15498
15499 @item -fdump-rtl-sibling
15500 @opindex fdump-rtl-sibling
15501 Dump after sibling call optimizations.
15502
15503 @item -fdump-rtl-split1
15504 @itemx -fdump-rtl-split2
15505 @itemx -fdump-rtl-split3
15506 @itemx -fdump-rtl-split4
15507 @itemx -fdump-rtl-split5
15508 @opindex fdump-rtl-split1
15509 @opindex fdump-rtl-split2
15510 @opindex fdump-rtl-split3
15511 @opindex fdump-rtl-split4
15512 @opindex fdump-rtl-split5
15513 These options enable dumping after five rounds of
15514 instruction splitting.
15515
15516 @item -fdump-rtl-sms
15517 @opindex fdump-rtl-sms
15518 Dump after modulo scheduling.  This pass is only run on some
15519 architectures.
15520
15521 @item -fdump-rtl-stack
15522 @opindex fdump-rtl-stack
15523 Dump after conversion from GCC's ``flat register file'' registers to the
15524 x87's stack-like registers.  This pass is only run on x86 variants.
15525
15526 @item -fdump-rtl-subreg1
15527 @itemx -fdump-rtl-subreg2
15528 @opindex fdump-rtl-subreg1
15529 @opindex fdump-rtl-subreg2
15530 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
15531 the two subreg expansion passes.
15532
15533 @item -fdump-rtl-unshare
15534 @opindex fdump-rtl-unshare
15535 Dump after all rtl has been unshared.
15536
15537 @item -fdump-rtl-vartrack
15538 @opindex fdump-rtl-vartrack
15539 Dump after variable tracking.
15540
15541 @item -fdump-rtl-vregs
15542 @opindex fdump-rtl-vregs
15543 Dump after converting virtual registers to hard registers.
15544
15545 @item -fdump-rtl-web
15546 @opindex fdump-rtl-web
15547 Dump after live range splitting.
15548
15549 @item -fdump-rtl-regclass
15550 @itemx -fdump-rtl-subregs_of_mode_init
15551 @itemx -fdump-rtl-subregs_of_mode_finish
15552 @itemx -fdump-rtl-dfinit
15553 @itemx -fdump-rtl-dfinish
15554 @opindex fdump-rtl-regclass
15555 @opindex fdump-rtl-subregs_of_mode_init
15556 @opindex fdump-rtl-subregs_of_mode_finish
15557 @opindex fdump-rtl-dfinit
15558 @opindex fdump-rtl-dfinish
15559 These dumps are defined but always produce empty files.
15560
15561 @item -da
15562 @itemx -fdump-rtl-all
15563 @opindex da
15564 @opindex fdump-rtl-all
15565 Produce all the dumps listed above.
15566
15567 @item -dA
15568 @opindex dA
15569 Annotate the assembler output with miscellaneous debugging information.
15570
15571 @item -dD
15572 @opindex dD
15573 Dump all macro definitions, at the end of preprocessing, in addition to
15574 normal output.
15575
15576 @item -dH
15577 @opindex dH
15578 Produce a core dump whenever an error occurs.
15579
15580 @item -dp
15581 @opindex dp
15582 Annotate the assembler output with a comment indicating which
15583 pattern and alternative is used.  The length and cost of each instruction are
15584 also printed.
15585
15586 @item -dP
15587 @opindex dP
15588 Dump the RTL in the assembler output as a comment before each instruction.
15589 Also turns on @option{-dp} annotation.
15590
15591 @item -dx
15592 @opindex dx
15593 Just generate RTL for a function instead of compiling it.  Usually used
15594 with @option{-fdump-rtl-expand}.
15595 @end table
15596
15597 @item -fdump-debug
15598 @opindex fdump-debug
15599 Dump debugging information generated during the debug
15600 generation phase.
15601
15602 @item -fdump-earlydebug
15603 @opindex fdump-earlydebug
15604 Dump debugging information generated during the early debug
15605 generation phase.
15606
15607 @item -fdump-noaddr
15608 @opindex fdump-noaddr
15609 When doing debugging dumps, suppress address output.  This makes it more
15610 feasible to use diff on debugging dumps for compiler invocations with
15611 different compiler binaries and/or different
15612 text / bss / data / heap / stack / dso start locations.
15613
15614 @item -freport-bug
15615 @opindex freport-bug
15616 Collect and dump debug information into a temporary file if an
15617 internal compiler error (ICE) occurs.
15618
15619 @item -fdump-unnumbered
15620 @opindex fdump-unnumbered
15621 When doing debugging dumps, suppress instruction numbers and address output.
15622 This makes it more feasible to use diff on debugging dumps for compiler
15623 invocations with different options, in particular with and without
15624 @option{-g}.
15625
15626 @item -fdump-unnumbered-links
15627 @opindex fdump-unnumbered-links
15628 When doing debugging dumps (see @option{-d} option above), suppress
15629 instruction numbers for the links to the previous and next instructions
15630 in a sequence.
15631
15632 @item -fdump-ipa-@var{switch}
15633 @itemx -fdump-ipa-@var{switch}-@var{options}
15634 @opindex fdump-ipa
15635 Control the dumping at various stages of inter-procedural analysis
15636 language tree to a file.  The file name is generated by appending a
15637 switch specific suffix to the source file name, and the file is created
15638 in the same directory as the output file.  The following dumps are
15639 possible:
15640
15641 @table @samp
15642 @item all
15643 Enables all inter-procedural analysis dumps.
15644
15645 @item cgraph
15646 Dumps information about call-graph optimization, unused function removal,
15647 and inlining decisions.
15648
15649 @item inline
15650 Dump after function inlining.
15651
15652 @end table
15653
15654 Additionally, the options @option{-optimized}, @option{-missed},
15655 @option{-note}, and @option{-all} can be provided, with the same meaning
15656 as for @option{-fopt-info}, defaulting to @option{-optimized}.
15657
15658 For example, @option{-fdump-ipa-inline-optimized-missed} will emit
15659 information on callsites that were inlined, along with callsites
15660 that were not inlined.
15661
15662 By default, the dump will contain messages about successful
15663 optimizations (equivalent to @option{-optimized}) together with
15664 low-level details about the analysis.
15665
15666 @item -fdump-lang-all
15667 @itemx -fdump-lang-@var{switch}
15668 @itemx -fdump-lang-@var{switch}-@var{options}
15669 @itemx -fdump-lang-@var{switch}-@var{options}=@var{filename}
15670 @opindex fdump-lang-all
15671 @opindex fdump-lang
15672 Control the dumping of language-specific information.  The @var{options}
15673 and @var{filename} portions behave as described in the
15674 @option{-fdump-tree} option.  The following @var{switch} values are
15675 accepted:
15676
15677 @table @samp
15678 @item all
15679
15680 Enable all language-specific dumps.
15681
15682 @item class
15683 Dump class hierarchy information.  Virtual table information is emitted
15684 unless '@option{slim}' is specified.  This option is applicable to C++ only.
15685
15686 @item raw
15687 Dump the raw internal tree data.  This option is applicable to C++ only.
15688
15689 @end table
15690
15691 @item -fdump-passes
15692 @opindex fdump-passes
15693 Print on @file{stderr} the list of optimization passes that are turned
15694 on and off by the current command-line options.
15695
15696 @item -fdump-statistics-@var{option}
15697 @opindex fdump-statistics
15698 Enable and control dumping of pass statistics in a separate file.  The
15699 file name is generated by appending a suffix ending in
15700 @samp{.statistics} to the source file name, and the file is created in
15701 the same directory as the output file.  If the @samp{-@var{option}}
15702 form is used, @samp{-stats} causes counters to be summed over the
15703 whole compilation unit while @samp{-details} dumps every event as
15704 the passes generate them.  The default with no option is to sum
15705 counters for each function compiled.
15706
15707 @item -fdump-tree-all
15708 @itemx -fdump-tree-@var{switch}
15709 @itemx -fdump-tree-@var{switch}-@var{options}
15710 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
15711 @opindex fdump-tree-all
15712 @opindex fdump-tree
15713 Control the dumping at various stages of processing the intermediate
15714 language tree to a file.  If the @samp{-@var{options}}
15715 form is used, @var{options} is a list of @samp{-} separated options
15716 which control the details of the dump.  Not all options are applicable
15717 to all dumps; those that are not meaningful are ignored.  The
15718 following options are available
15719
15720 @table @samp
15721 @item address
15722 Print the address of each node.  Usually this is not meaningful as it
15723 changes according to the environment and source file.  Its primary use
15724 is for tying up a dump file with a debug environment.
15725 @item asmname
15726 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
15727 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
15728 use working backward from mangled names in the assembly file.
15729 @item slim
15730 When dumping front-end intermediate representations, inhibit dumping
15731 of members of a scope or body of a function merely because that scope
15732 has been reached.  Only dump such items when they are directly reachable
15733 by some other path.
15734
15735 When dumping pretty-printed trees, this option inhibits dumping the
15736 bodies of control structures.
15737
15738 When dumping RTL, print the RTL in slim (condensed) form instead of
15739 the default LISP-like representation.
15740 @item raw
15741 Print a raw representation of the tree.  By default, trees are
15742 pretty-printed into a C-like representation.
15743 @item details
15744 Enable more detailed dumps (not honored by every dump option). Also
15745 include information from the optimization passes.
15746 @item stats
15747 Enable dumping various statistics about the pass (not honored by every dump
15748 option).
15749 @item blocks
15750 Enable showing basic block boundaries (disabled in raw dumps).
15751 @item graph
15752 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
15753 dump a representation of the control flow graph suitable for viewing with
15754 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
15755 the file is pretty-printed as a subgraph, so that GraphViz can render them
15756 all in a single plot.
15757
15758 This option currently only works for RTL dumps, and the RTL is always
15759 dumped in slim form.
15760 @item vops
15761 Enable showing virtual operands for every statement.
15762 @item lineno
15763 Enable showing line numbers for statements.
15764 @item uid
15765 Enable showing the unique ID (@code{DECL_UID}) for each variable.
15766 @item verbose
15767 Enable showing the tree dump for each statement.
15768 @item eh
15769 Enable showing the EH region number holding each statement.
15770 @item scev
15771 Enable showing scalar evolution analysis details.
15772 @item optimized
15773 Enable showing optimization information (only available in certain
15774 passes).
15775 @item missed
15776 Enable showing missed optimization information (only available in certain
15777 passes).
15778 @item note
15779 Enable other detailed optimization information (only available in
15780 certain passes).
15781 @item all
15782 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
15783 and @option{lineno}.
15784 @item optall
15785 Turn on all optimization options, i.e., @option{optimized},
15786 @option{missed}, and @option{note}.
15787 @end table
15788
15789 To determine what tree dumps are available or find the dump for a pass
15790 of interest follow the steps below.
15791
15792 @enumerate
15793 @item
15794 Invoke GCC with @option{-fdump-passes} and in the @file{stderr} output
15795 look for a code that corresponds to the pass you are interested in.
15796 For example, the codes @code{tree-evrp}, @code{tree-vrp1}, and
15797 @code{tree-vrp2} correspond to the three Value Range Propagation passes.
15798 The number at the end distinguishes distinct invocations of the same pass.
15799 @item
15800 To enable the creation of the dump file, append the pass code to
15801 the @option{-fdump-} option prefix and invoke GCC with it.  For example,
15802 to enable the dump from the Early Value Range Propagation pass, invoke
15803 GCC with the @option{-fdump-tree-evrp} option.  Optionally, you may
15804 specify the name of the dump file.  If you don't specify one, GCC
15805 creates as described below.
15806 @item
15807 Find the pass dump in a file whose name is composed of three components
15808 separated by a period: the name of the source file GCC was invoked to
15809 compile, a numeric suffix indicating the pass number followed by the
15810 letter @samp{t} for tree passes (and the letter @samp{r} for RTL passes),
15811 and finally the pass code.  For example, the Early VRP pass dump might
15812 be in a file named @file{myfile.c.038t.evrp} in the current working
15813 directory.  Note that the numeric codes are not stable and may change
15814 from one version of GCC to another.
15815 @end enumerate
15816
15817 @item -fopt-info
15818 @itemx -fopt-info-@var{options}
15819 @itemx -fopt-info-@var{options}=@var{filename}
15820 @opindex fopt-info
15821 Controls optimization dumps from various optimization passes. If the
15822 @samp{-@var{options}} form is used, @var{options} is a list of
15823 @samp{-} separated option keywords to select the dump details and
15824 optimizations.  
15825
15826 The @var{options} can be divided into three groups:
15827 @enumerate
15828 @item
15829 options describing what kinds of messages should be emitted,
15830 @item
15831 options describing the verbosity of the dump, and
15832 @item
15833 options describing which optimizations should be included.
15834 @end enumerate
15835 The options from each group can be freely mixed as they are
15836 non-overlapping. However, in case of any conflicts,
15837 the later options override the earlier options on the command
15838 line. 
15839
15840 The following options control which kinds of messages should be emitted:
15841
15842 @table @samp
15843 @item optimized
15844 Print information when an optimization is successfully applied. It is
15845 up to a pass to decide which information is relevant. For example, the
15846 vectorizer passes print the source location of loops which are
15847 successfully vectorized.
15848 @item missed
15849 Print information about missed optimizations. Individual passes
15850 control which information to include in the output. 
15851 @item note
15852 Print verbose information about optimizations, such as certain
15853 transformations, more detailed messages about decisions etc.
15854 @item all
15855 Print detailed optimization information. This includes
15856 @samp{optimized}, @samp{missed}, and @samp{note}.
15857 @end table
15858
15859 The following option controls the dump verbosity:
15860
15861 @table @samp
15862 @item internals
15863 By default, only ``high-level'' messages are emitted. This option enables
15864 additional, more detailed, messages, which are likely to only be of interest
15865 to GCC developers.
15866 @end table
15867
15868 One or more of the following option keywords can be used to describe a
15869 group of optimizations:
15870
15871 @table @samp
15872 @item ipa
15873 Enable dumps from all interprocedural optimizations.
15874 @item loop
15875 Enable dumps from all loop optimizations.
15876 @item inline
15877 Enable dumps from all inlining optimizations.
15878 @item omp
15879 Enable dumps from all OMP (Offloading and Multi Processing) optimizations.
15880 @item vec
15881 Enable dumps from all vectorization optimizations.
15882 @item optall
15883 Enable dumps from all optimizations. This is a superset of
15884 the optimization groups listed above.
15885 @end table
15886
15887 If @var{options} is
15888 omitted, it defaults to @samp{optimized-optall}, which means to dump messages
15889 about successful optimizations from all the passes, omitting messages
15890 that are treated as ``internals''.
15891
15892 If the @var{filename} is provided, then the dumps from all the
15893 applicable optimizations are concatenated into the @var{filename}.
15894 Otherwise the dump is output onto @file{stderr}. Though multiple
15895 @option{-fopt-info} options are accepted, only one of them can include
15896 a @var{filename}. If other filenames are provided then all but the
15897 first such option are ignored.
15898
15899 Note that the output @var{filename} is overwritten
15900 in case of multiple translation units. If a combined output from
15901 multiple translation units is desired, @file{stderr} should be used
15902 instead.
15903
15904 In the following example, the optimization info is output to
15905 @file{stderr}:
15906
15907 @smallexample
15908 gcc -O3 -fopt-info
15909 @end smallexample
15910
15911 This example:
15912 @smallexample
15913 gcc -O3 -fopt-info-missed=missed.all
15914 @end smallexample
15915
15916 @noindent
15917 outputs missed optimization report from all the passes into
15918 @file{missed.all}, and this one:
15919
15920 @smallexample
15921 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
15922 @end smallexample
15923
15924 @noindent
15925 prints information about missed optimization opportunities from
15926 vectorization passes on @file{stderr}.  
15927 Note that @option{-fopt-info-vec-missed} is equivalent to 
15928 @option{-fopt-info-missed-vec}.  The order of the optimization group
15929 names and message types listed after @option{-fopt-info} does not matter.
15930
15931 As another example,
15932 @smallexample
15933 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
15934 @end smallexample
15935
15936 @noindent
15937 outputs information about missed optimizations as well as
15938 optimized locations from all the inlining passes into
15939 @file{inline.txt}.
15940
15941 Finally, consider:
15942
15943 @smallexample
15944 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
15945 @end smallexample
15946
15947 @noindent
15948 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
15949 in conflict since only one output file is allowed. In this case, only
15950 the first option takes effect and the subsequent options are
15951 ignored. Thus only @file{vec.miss} is produced which contains
15952 dumps from the vectorizer about missed opportunities.
15953
15954 @item -fsave-optimization-record
15955 @opindex fsave-optimization-record
15956 Write a SRCFILE.opt-record.json.gz file detailing what optimizations
15957 were performed, for those optimizations that support @option{-fopt-info}.
15958
15959 This option is experimental and the format of the data within the
15960 compressed JSON file is subject to change.
15961
15962 It is roughly equivalent to a machine-readable version of
15963 @option{-fopt-info-all}, as a collection of messages with source file,
15964 line number and column number, with the following additional data for
15965 each message:
15966
15967 @itemize @bullet
15968
15969 @item
15970 the execution count of the code being optimized, along with metadata about
15971 whether this was from actual profile data, or just an estimate, allowing
15972 consumers to prioritize messages by code hotness,
15973
15974 @item
15975 the function name of the code being optimized, where applicable,
15976
15977 @item
15978 the ``inlining chain'' for the code being optimized, so that when
15979 a function is inlined into several different places (which might
15980 themselves be inlined), the reader can distinguish between the copies,
15981
15982 @item
15983 objects identifying those parts of the message that refer to expressions,
15984 statements or symbol-table nodes, which of these categories they are, and,
15985 when available, their source code location,
15986
15987 @item
15988 the GCC pass that emitted the message, and
15989
15990 @item
15991 the location in GCC's own code from which the message was emitted
15992
15993 @end itemize
15994
15995 Additionally, some messages are logically nested within other
15996 messages, reflecting implementation details of the optimization
15997 passes.
15998
15999 @item -fsched-verbose=@var{n}
16000 @opindex fsched-verbose
16001 On targets that use instruction scheduling, this option controls the
16002 amount of debugging output the scheduler prints to the dump files.
16003
16004 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
16005 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
16006 For @var{n} greater than one, it also output basic block probabilities,
16007 detailed ready list information and unit/insn info.  For @var{n} greater
16008 than two, it includes RTL at abort point, control-flow and regions info.
16009 And for @var{n} over four, @option{-fsched-verbose} also includes
16010 dependence info.
16011
16012
16013
16014 @item -fenable-@var{kind}-@var{pass}
16015 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
16016 @opindex fdisable-
16017 @opindex fenable-
16018
16019 This is a set of options that are used to explicitly disable/enable
16020 optimization passes.  These options are intended for use for debugging GCC.
16021 Compiler users should use regular options for enabling/disabling
16022 passes instead.
16023
16024 @table @gcctabopt
16025
16026 @item -fdisable-ipa-@var{pass}
16027 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
16028 statically invoked in the compiler multiple times, the pass name should be
16029 appended with a sequential number starting from 1.
16030
16031 @item -fdisable-rtl-@var{pass}
16032 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
16033 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
16034 statically invoked in the compiler multiple times, the pass name should be
16035 appended with a sequential number starting from 1.  @var{range-list} is a 
16036 comma-separated list of function ranges or assembler names.  Each range is a number
16037 pair separated by a colon.  The range is inclusive in both ends.  If the range
16038 is trivial, the number pair can be simplified as a single number.  If the
16039 function's call graph node's @var{uid} falls within one of the specified ranges,
16040 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
16041 function header of a dump file, and the pass names can be dumped by using
16042 option @option{-fdump-passes}.
16043
16044 @item -fdisable-tree-@var{pass}
16045 @itemx -fdisable-tree-@var{pass}=@var{range-list}
16046 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
16047 option arguments.
16048
16049 @item -fenable-ipa-@var{pass}
16050 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
16051 statically invoked in the compiler multiple times, the pass name should be
16052 appended with a sequential number starting from 1.
16053
16054 @item -fenable-rtl-@var{pass}
16055 @itemx -fenable-rtl-@var{pass}=@var{range-list}
16056 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
16057 description and examples.
16058
16059 @item -fenable-tree-@var{pass}
16060 @itemx -fenable-tree-@var{pass}=@var{range-list}
16061 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
16062 of option arguments.
16063
16064 @end table
16065
16066 Here are some examples showing uses of these options.
16067
16068 @smallexample
16069
16070 # disable ccp1 for all functions
16071    -fdisable-tree-ccp1
16072 # disable complete unroll for function whose cgraph node uid is 1
16073    -fenable-tree-cunroll=1
16074 # disable gcse2 for functions at the following ranges [1,1],
16075 # [300,400], and [400,1000]
16076 # disable gcse2 for functions foo and foo2
16077    -fdisable-rtl-gcse2=foo,foo2
16078 # disable early inlining
16079    -fdisable-tree-einline
16080 # disable ipa inlining
16081    -fdisable-ipa-inline
16082 # enable tree full unroll
16083    -fenable-tree-unroll
16084
16085 @end smallexample
16086
16087 @item -fchecking
16088 @itemx -fchecking=@var{n}
16089 @opindex fchecking
16090 @opindex fno-checking
16091 Enable internal consistency checking.  The default depends on
16092 the compiler configuration.  @option{-fchecking=2} enables further
16093 internal consistency checking that might affect code generation.
16094
16095 @item -frandom-seed=@var{string}
16096 @opindex frandom-seed
16097 This option provides a seed that GCC uses in place of
16098 random numbers in generating certain symbol names
16099 that have to be different in every compiled file.  It is also used to
16100 place unique stamps in coverage data files and the object files that
16101 produce them.  You can use the @option{-frandom-seed} option to produce
16102 reproducibly identical object files.
16103
16104 The @var{string} can either be a number (decimal, octal or hex) or an
16105 arbitrary string (in which case it's converted to a number by
16106 computing CRC32).
16107
16108 The @var{string} should be different for every file you compile.
16109
16110 @item -save-temps
16111 @itemx -save-temps=cwd
16112 @opindex save-temps
16113 Store the usual ``temporary'' intermediate files permanently; place them
16114 in the current directory and name them based on the source file.  Thus,
16115 compiling @file{foo.c} with @option{-c -save-temps} produces files
16116 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
16117 preprocessed @file{foo.i} output file even though the compiler now
16118 normally uses an integrated preprocessor.
16119
16120 When used in combination with the @option{-x} command-line option,
16121 @option{-save-temps} is sensible enough to avoid over writing an
16122 input source file with the same extension as an intermediate file.
16123 The corresponding intermediate file may be obtained by renaming the
16124 source file before using @option{-save-temps}.
16125
16126 If you invoke GCC in parallel, compiling several different source
16127 files that share a common base name in different subdirectories or the
16128 same source file compiled for multiple output destinations, it is
16129 likely that the different parallel compilers will interfere with each
16130 other, and overwrite the temporary files.  For instance:
16131
16132 @smallexample
16133 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
16134 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
16135 @end smallexample
16136
16137 may result in @file{foo.i} and @file{foo.o} being written to
16138 simultaneously by both compilers.
16139
16140 @item -save-temps=obj
16141 @opindex save-temps=obj
16142 Store the usual ``temporary'' intermediate files permanently.  If the
16143 @option{-o} option is used, the temporary files are based on the
16144 object file.  If the @option{-o} option is not used, the
16145 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
16146
16147 For example:
16148
16149 @smallexample
16150 gcc -save-temps=obj -c foo.c
16151 gcc -save-temps=obj -c bar.c -o dir/xbar.o
16152 gcc -save-temps=obj foobar.c -o dir2/yfoobar
16153 @end smallexample
16154
16155 @noindent
16156 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
16157 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
16158 @file{dir2/yfoobar.o}.
16159
16160 @item -time@r{[}=@var{file}@r{]}
16161 @opindex time
16162 Report the CPU time taken by each subprocess in the compilation
16163 sequence.  For C source files, this is the compiler proper and assembler
16164 (plus the linker if linking is done).
16165
16166 Without the specification of an output file, the output looks like this:
16167
16168 @smallexample
16169 # cc1 0.12 0.01
16170 # as 0.00 0.01
16171 @end smallexample
16172
16173 The first number on each line is the ``user time'', that is time spent
16174 executing the program itself.  The second number is ``system time'',
16175 time spent executing operating system routines on behalf of the program.
16176 Both numbers are in seconds.
16177
16178 With the specification of an output file, the output is appended to the
16179 named file, and it looks like this:
16180
16181 @smallexample
16182 0.12 0.01 cc1 @var{options}
16183 0.00 0.01 as @var{options}
16184 @end smallexample
16185
16186 The ``user time'' and the ``system time'' are moved before the program
16187 name, and the options passed to the program are displayed, so that one
16188 can later tell what file was being compiled, and with which options.
16189
16190 @item -fdump-final-insns@r{[}=@var{file}@r{]}
16191 @opindex fdump-final-insns
16192 Dump the final internal representation (RTL) to @var{file}.  If the
16193 optional argument is omitted (or if @var{file} is @code{.}), the name
16194 of the dump file is determined by appending @code{.gkd} to the
16195 compilation output file name.
16196
16197 @item -fcompare-debug@r{[}=@var{opts}@r{]}
16198 @opindex fcompare-debug
16199 @opindex fno-compare-debug
16200 If no error occurs during compilation, run the compiler a second time,
16201 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
16202 passed to the second compilation.  Dump the final internal
16203 representation in both compilations, and print an error if they differ.
16204
16205 If the equal sign is omitted, the default @option{-gtoggle} is used.
16206
16207 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
16208 and nonzero, implicitly enables @option{-fcompare-debug}.  If
16209 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
16210 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
16211 is used.
16212
16213 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
16214 is equivalent to @option{-fno-compare-debug}, which disables the dumping
16215 of the final representation and the second compilation, preventing even
16216 @env{GCC_COMPARE_DEBUG} from taking effect.
16217
16218 To verify full coverage during @option{-fcompare-debug} testing, set
16219 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
16220 which GCC rejects as an invalid option in any actual compilation
16221 (rather than preprocessing, assembly or linking).  To get just a
16222 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
16223 not overridden} will do.
16224
16225 @item -fcompare-debug-second
16226 @opindex fcompare-debug-second
16227 This option is implicitly passed to the compiler for the second
16228 compilation requested by @option{-fcompare-debug}, along with options to
16229 silence warnings, and omitting other options that would cause the compiler
16230 to produce output to files or to standard output as a side effect.  Dump
16231 files and preserved temporary files are renamed so as to contain the
16232 @code{.gk} additional extension during the second compilation, to avoid
16233 overwriting those generated by the first.
16234
16235 When this option is passed to the compiler driver, it causes the
16236 @emph{first} compilation to be skipped, which makes it useful for little
16237 other than debugging the compiler proper.
16238
16239 @item -gtoggle
16240 @opindex gtoggle
16241 Turn off generation of debug info, if leaving out this option
16242 generates it, or turn it on at level 2 otherwise.  The position of this
16243 argument in the command line does not matter; it takes effect after all
16244 other options are processed, and it does so only once, no matter how
16245 many times it is given.  This is mainly intended to be used with
16246 @option{-fcompare-debug}.
16247
16248 @item -fvar-tracking-assignments-toggle
16249 @opindex fvar-tracking-assignments-toggle
16250 @opindex fno-var-tracking-assignments-toggle
16251 Toggle @option{-fvar-tracking-assignments}, in the same way that
16252 @option{-gtoggle} toggles @option{-g}.
16253
16254 @item -Q
16255 @opindex Q
16256 Makes the compiler print out each function name as it is compiled, and
16257 print some statistics about each pass when it finishes.
16258
16259 @item -ftime-report
16260 @opindex ftime-report
16261 Makes the compiler print some statistics about the time consumed by each
16262 pass when it finishes.
16263
16264 @item -ftime-report-details
16265 @opindex ftime-report-details
16266 Record the time consumed by infrastructure parts separately for each pass.
16267
16268 @item -fira-verbose=@var{n}
16269 @opindex fira-verbose
16270 Control the verbosity of the dump file for the integrated register allocator.
16271 The default value is 5.  If the value @var{n} is greater or equal to 10,
16272 the dump output is sent to stderr using the same format as @var{n} minus 10.
16273
16274 @item -flto-report
16275 @opindex flto-report
16276 Prints a report with internal details on the workings of the link-time
16277 optimizer.  The contents of this report vary from version to version.
16278 It is meant to be useful to GCC developers when processing object
16279 files in LTO mode (via @option{-flto}).
16280
16281 Disabled by default.
16282
16283 @item -flto-report-wpa
16284 @opindex flto-report-wpa
16285 Like @option{-flto-report}, but only print for the WPA phase of link-time
16286 optimization.
16287
16288 @item -fmem-report
16289 @opindex fmem-report
16290 Makes the compiler print some statistics about permanent memory
16291 allocation when it finishes.
16292
16293 @item -fmem-report-wpa
16294 @opindex fmem-report-wpa
16295 Makes the compiler print some statistics about permanent memory
16296 allocation for the WPA phase only.
16297
16298 @item -fpre-ipa-mem-report
16299 @opindex fpre-ipa-mem-report
16300 @item -fpost-ipa-mem-report
16301 @opindex fpost-ipa-mem-report
16302 Makes the compiler print some statistics about permanent memory
16303 allocation before or after interprocedural optimization.
16304
16305 @item -fprofile-report
16306 @opindex fprofile-report
16307 Makes the compiler print some statistics about consistency of the
16308 (estimated) profile and effect of individual passes.
16309
16310 @item -fstack-usage
16311 @opindex fstack-usage
16312 Makes the compiler output stack usage information for the program, on a
16313 per-function basis.  The filename for the dump is made by appending
16314 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
16315 the output file, if explicitly specified and it is not an executable,
16316 otherwise it is the basename of the source file.  An entry is made up
16317 of three fields:
16318
16319 @itemize
16320 @item
16321 The name of the function.
16322 @item
16323 A number of bytes.
16324 @item
16325 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
16326 @end itemize
16327
16328 The qualifier @code{static} means that the function manipulates the stack
16329 statically: a fixed number of bytes are allocated for the frame on function
16330 entry and released on function exit; no stack adjustments are otherwise made
16331 in the function.  The second field is this fixed number of bytes.
16332
16333 The qualifier @code{dynamic} means that the function manipulates the stack
16334 dynamically: in addition to the static allocation described above, stack
16335 adjustments are made in the body of the function, for example to push/pop
16336 arguments around function calls.  If the qualifier @code{bounded} is also
16337 present, the amount of these adjustments is bounded at compile time and
16338 the second field is an upper bound of the total amount of stack used by
16339 the function.  If it is not present, the amount of these adjustments is
16340 not bounded at compile time and the second field only represents the
16341 bounded part.
16342
16343 @item -fstats
16344 @opindex fstats
16345 Emit statistics about front-end processing at the end of the compilation.
16346 This option is supported only by the C++ front end, and
16347 the information is generally only useful to the G++ development team.
16348
16349 @item -fdbg-cnt-list
16350 @opindex fdbg-cnt-list
16351 Print the name and the counter upper bound for all debug counters.
16352
16353
16354 @item -fdbg-cnt=@var{counter-value-list}
16355 @opindex fdbg-cnt
16356 Set the internal debug counter lower and upper bound.  @var{counter-value-list}
16357 is a comma-separated list of @var{name}:@var{lower_bound1}-@var{upper_bound1}
16358 [:@var{lower_bound2}-@var{upper_bound2}...] tuples which sets
16359 the name of the counter and list of closed intervals.
16360 The @var{lower_bound} is optional and is zero
16361 initialized if not set.
16362 For example, with @option{-fdbg-cnt=dce:2-4:10-11,tail_call:10},
16363 @code{dbg_cnt(dce)} returns true only for second, third, fourth, tenth and
16364 eleventh invocation.
16365 For @code{dbg_cnt(tail_call)} true is returned for first 10 invocations.
16366
16367 @item -print-file-name=@var{library}
16368 @opindex print-file-name
16369 Print the full absolute name of the library file @var{library} that
16370 would be used when linking---and don't do anything else.  With this
16371 option, GCC does not compile or link anything; it just prints the
16372 file name.
16373
16374 @item -print-multi-directory
16375 @opindex print-multi-directory
16376 Print the directory name corresponding to the multilib selected by any
16377 other switches present in the command line.  This directory is supposed
16378 to exist in @env{GCC_EXEC_PREFIX}.
16379
16380 @item -print-multi-lib
16381 @opindex print-multi-lib
16382 Print the mapping from multilib directory names to compiler switches
16383 that enable them.  The directory name is separated from the switches by
16384 @samp{;}, and each switch starts with an @samp{@@} instead of the
16385 @samp{-}, without spaces between multiple switches.  This is supposed to
16386 ease shell processing.
16387
16388 @item -print-multi-os-directory
16389 @opindex print-multi-os-directory
16390 Print the path to OS libraries for the selected
16391 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
16392 present in the @file{lib} subdirectory and no multilibs are used, this is
16393 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
16394 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
16395 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
16396 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
16397
16398 @item -print-multiarch
16399 @opindex print-multiarch
16400 Print the path to OS libraries for the selected multiarch,
16401 relative to some @file{lib} subdirectory.
16402
16403 @item -print-prog-name=@var{program}
16404 @opindex print-prog-name
16405 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
16406
16407 @item -print-libgcc-file-name
16408 @opindex print-libgcc-file-name
16409 Same as @option{-print-file-name=libgcc.a}.
16410
16411 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
16412 but you do want to link with @file{libgcc.a}.  You can do:
16413
16414 @smallexample
16415 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
16416 @end smallexample
16417
16418 @item -print-search-dirs
16419 @opindex print-search-dirs
16420 Print the name of the configured installation directory and a list of
16421 program and library directories @command{gcc} searches---and don't do anything else.
16422
16423 This is useful when @command{gcc} prints the error message
16424 @samp{installation problem, cannot exec cpp0: No such file or directory}.
16425 To resolve this you either need to put @file{cpp0} and the other compiler
16426 components where @command{gcc} expects to find them, or you can set the environment
16427 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
16428 Don't forget the trailing @samp{/}.
16429 @xref{Environment Variables}.
16430
16431 @item -print-sysroot
16432 @opindex print-sysroot
16433 Print the target sysroot directory that is used during
16434 compilation.  This is the target sysroot specified either at configure
16435 time or using the @option{--sysroot} option, possibly with an extra
16436 suffix that depends on compilation options.  If no target sysroot is
16437 specified, the option prints nothing.
16438
16439 @item -print-sysroot-headers-suffix
16440 @opindex print-sysroot-headers-suffix
16441 Print the suffix added to the target sysroot when searching for
16442 headers, or give an error if the compiler is not configured with such
16443 a suffix---and don't do anything else.
16444
16445 @item -dumpmachine
16446 @opindex dumpmachine
16447 Print the compiler's target machine (for example,
16448 @samp{i686-pc-linux-gnu})---and don't do anything else.
16449
16450 @item -dumpversion
16451 @opindex dumpversion
16452 Print the compiler version (for example, @code{3.0}, @code{6.3.0} or @code{7})---and don't do
16453 anything else.  This is the compiler version used in filesystem paths and
16454 specs. Depending on how the compiler has been configured it can be just
16455 a single number (major version), two numbers separated by a dot (major and
16456 minor version) or three numbers separated by dots (major, minor and patchlevel
16457 version).
16458
16459 @item -dumpfullversion
16460 @opindex dumpfullversion
16461 Print the full compiler version---and don't do anything else. The output is
16462 always three numbers separated by dots, major, minor and patchlevel version.
16463
16464 @item -dumpspecs
16465 @opindex dumpspecs
16466 Print the compiler's built-in specs---and don't do anything else.  (This
16467 is used when GCC itself is being built.)  @xref{Spec Files}.
16468 @end table
16469
16470 @node Submodel Options
16471 @section Machine-Dependent Options
16472 @cindex submodel options
16473 @cindex specifying hardware config
16474 @cindex hardware models and configurations, specifying
16475 @cindex target-dependent options
16476 @cindex machine-dependent options
16477
16478 Each target machine supported by GCC can have its own options---for
16479 example, to allow you to compile for a particular processor variant or
16480 ABI, or to control optimizations specific to that machine.  By
16481 convention, the names of machine-specific options start with
16482 @samp{-m}.
16483
16484 Some configurations of the compiler also support additional target-specific
16485 options, usually for compatibility with other compilers on the same
16486 platform.
16487
16488 @c This list is ordered alphanumerically by subsection name.
16489 @c It should be the same order and spelling as these options are listed
16490 @c in Machine Dependent Options
16491
16492 @menu
16493 * AArch64 Options::
16494 * Adapteva Epiphany Options::
16495 * AMD GCN Options::
16496 * ARC Options::
16497 * ARM Options::
16498 * AVR Options::
16499 * Blackfin Options::
16500 * C6X Options::
16501 * CRIS Options::
16502 * CR16 Options::
16503 * C-SKY Options::
16504 * Darwin Options::
16505 * DEC Alpha Options::
16506 * eBPF Options::
16507 * FR30 Options::
16508 * FT32 Options::
16509 * FRV Options::
16510 * GNU/Linux Options::
16511 * H8/300 Options::
16512 * HPPA Options::
16513 * IA-64 Options::
16514 * LM32 Options::
16515 * M32C Options::
16516 * M32R/D Options::
16517 * M680x0 Options::
16518 * MCore Options::
16519 * MeP Options::
16520 * MicroBlaze Options::
16521 * MIPS Options::
16522 * MMIX Options::
16523 * MN10300 Options::
16524 * Moxie Options::
16525 * MSP430 Options::
16526 * NDS32 Options::
16527 * Nios II Options::
16528 * Nvidia PTX Options::
16529 * OpenRISC Options::
16530 * PDP-11 Options::
16531 * picoChip Options::
16532 * PowerPC Options::
16533 * PRU Options::
16534 * RISC-V Options::
16535 * RL78 Options::
16536 * RS/6000 and PowerPC Options::
16537 * RX Options::
16538 * S/390 and zSeries Options::
16539 * Score Options::
16540 * SH Options::
16541 * Solaris 2 Options::
16542 * SPARC Options::
16543 * System V Options::
16544 * TILE-Gx Options::
16545 * TILEPro Options::
16546 * V850 Options::
16547 * VAX Options::
16548 * Visium Options::
16549 * VMS Options::
16550 * VxWorks Options::
16551 * x86 Options::
16552 * x86 Windows Options::
16553 * Xstormy16 Options::
16554 * Xtensa Options::
16555 * zSeries Options::
16556 @end menu
16557
16558 @node AArch64 Options
16559 @subsection AArch64 Options
16560 @cindex AArch64 Options
16561
16562 These options are defined for AArch64 implementations:
16563
16564 @table @gcctabopt
16565
16566 @item -mabi=@var{name}
16567 @opindex mabi
16568 Generate code for the specified data model.  Permissible values
16569 are @samp{ilp32} for SysV-like data model where int, long int and pointers
16570 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
16571 but long int and pointers are 64 bits.
16572
16573 The default depends on the specific target configuration.  Note that
16574 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
16575 entire program with the same ABI, and link with a compatible set of libraries.
16576
16577 @item -mbig-endian
16578 @opindex mbig-endian
16579 Generate big-endian code.  This is the default when GCC is configured for an
16580 @samp{aarch64_be-*-*} target.
16581
16582 @item -mgeneral-regs-only
16583 @opindex mgeneral-regs-only
16584 Generate code which uses only the general-purpose registers.  This will prevent
16585 the compiler from using floating-point and Advanced SIMD registers but will not
16586 impose any restrictions on the assembler.
16587
16588 @item -mlittle-endian
16589 @opindex mlittle-endian
16590 Generate little-endian code.  This is the default when GCC is configured for an
16591 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
16592
16593 @item -mcmodel=tiny
16594 @opindex mcmodel=tiny
16595 Generate code for the tiny code model.  The program and its statically defined
16596 symbols must be within 1MB of each other.  Programs can be statically or
16597 dynamically linked.
16598
16599 @item -mcmodel=small
16600 @opindex mcmodel=small
16601 Generate code for the small code model.  The program and its statically defined
16602 symbols must be within 4GB of each other.  Programs can be statically or
16603 dynamically linked.  This is the default code model.
16604
16605 @item -mcmodel=large
16606 @opindex mcmodel=large
16607 Generate code for the large code model.  This makes no assumptions about
16608 addresses and sizes of sections.  Programs can be statically linked only.
16609
16610 @item -mstrict-align
16611 @itemx -mno-strict-align
16612 @opindex mstrict-align
16613 @opindex mno-strict-align
16614 Avoid or allow generating memory accesses that may not be aligned on a natural
16615 object boundary as described in the architecture specification.
16616
16617 @item -momit-leaf-frame-pointer
16618 @itemx -mno-omit-leaf-frame-pointer
16619 @opindex momit-leaf-frame-pointer
16620 @opindex mno-omit-leaf-frame-pointer
16621 Omit or keep the frame pointer in leaf functions.  The former behavior is the
16622 default.
16623
16624 @item -mstack-protector-guard=@var{guard}
16625 @itemx -mstack-protector-guard-reg=@var{reg}
16626 @itemx -mstack-protector-guard-offset=@var{offset}
16627 @opindex mstack-protector-guard
16628 @opindex mstack-protector-guard-reg
16629 @opindex mstack-protector-guard-offset
16630 Generate stack protection code using canary at @var{guard}.  Supported
16631 locations are @samp{global} for a global canary or @samp{sysreg} for a
16632 canary in an appropriate system register.
16633
16634 With the latter choice the options
16635 @option{-mstack-protector-guard-reg=@var{reg}} and
16636 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
16637 which system register to use as base register for reading the canary,
16638 and from what offset from that base register. There is no default
16639 register or offset as this is entirely for use within the Linux
16640 kernel.
16641
16642 @item -mstack-protector-guard=@var{guard}
16643 @itemx -mstack-protector-guard-reg=@var{reg}
16644 @itemx -mstack-protector-guard-offset=@var{offset}
16645 @opindex mstack-protector-guard
16646 @opindex mstack-protector-guard-reg
16647 @opindex mstack-protector-guard-offset
16648 Generate stack protection code using canary at @var{guard}.  Supported
16649 locations are @samp{global} for a global canary or @samp{sysreg} for a
16650 canary in an appropriate system register.
16651
16652 With the latter choice the options
16653 @option{-mstack-protector-guard-reg=@var{reg}} and
16654 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
16655 which system register to use as base register for reading the canary,
16656 and from what offset from that base register. There is no default
16657 register or offset as this is entirely for use within the Linux
16658 kernel.
16659
16660 @item -mtls-dialect=desc
16661 @opindex mtls-dialect=desc
16662 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
16663 of TLS variables.  This is the default.
16664
16665 @item -mtls-dialect=traditional
16666 @opindex mtls-dialect=traditional
16667 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
16668 of TLS variables.
16669
16670 @item -mtls-size=@var{size}
16671 @opindex mtls-size
16672 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
16673 This option requires binutils 2.26 or newer.
16674
16675 @item -mfix-cortex-a53-835769
16676 @itemx -mno-fix-cortex-a53-835769
16677 @opindex mfix-cortex-a53-835769
16678 @opindex mno-fix-cortex-a53-835769
16679 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
16680 This involves inserting a NOP instruction between memory instructions and
16681 64-bit integer multiply-accumulate instructions.
16682
16683 @item -mfix-cortex-a53-843419
16684 @itemx -mno-fix-cortex-a53-843419
16685 @opindex mfix-cortex-a53-843419
16686 @opindex mno-fix-cortex-a53-843419
16687 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
16688 This erratum workaround is made at link time and this will only pass the
16689 corresponding flag to the linker.
16690
16691 @item -mlow-precision-recip-sqrt
16692 @itemx -mno-low-precision-recip-sqrt
16693 @opindex mlow-precision-recip-sqrt
16694 @opindex mno-low-precision-recip-sqrt
16695 Enable or disable the reciprocal square root approximation.
16696 This option only has an effect if @option{-ffast-math} or
16697 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
16698 precision of reciprocal square root results to about 16 bits for
16699 single precision and to 32 bits for double precision.
16700
16701 @item -mlow-precision-sqrt
16702 @itemx -mno-low-precision-sqrt
16703 @opindex mlow-precision-sqrt
16704 @opindex mno-low-precision-sqrt
16705 Enable or disable the square root approximation.
16706 This option only has an effect if @option{-ffast-math} or
16707 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
16708 precision of square root results to about 16 bits for
16709 single precision and to 32 bits for double precision.
16710 If enabled, it implies @option{-mlow-precision-recip-sqrt}.
16711
16712 @item -mlow-precision-div
16713 @itemx -mno-low-precision-div
16714 @opindex mlow-precision-div
16715 @opindex mno-low-precision-div
16716 Enable or disable the division approximation.
16717 This option only has an effect if @option{-ffast-math} or
16718 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
16719 precision of division results to about 16 bits for
16720 single precision and to 32 bits for double precision.
16721
16722 @item -mtrack-speculation
16723 @itemx -mno-track-speculation
16724 Enable or disable generation of additional code to track speculative
16725 execution through conditional branches.  The tracking state can then
16726 be used by the compiler when expanding calls to
16727 @code{__builtin_speculation_safe_copy} to permit a more efficient code
16728 sequence to be generated.
16729
16730 @item -moutline-atomics
16731 @itemx -mno-outline-atomics
16732 Enable or disable calls to out-of-line helpers to implement atomic operations.
16733 These helpers will, at runtime, determine if the LSE instructions from
16734 ARMv8.1-A can be used; if not, they will use the load/store-exclusive
16735 instructions that are present in the base ARMv8.0 ISA.
16736
16737 This option is only applicable when compiling for the base ARMv8.0
16738 instruction set.  If using a later revision, e.g. @option{-march=armv8.1-a}
16739 or @option{-march=armv8-a+lse}, the ARMv8.1-Atomics instructions will be
16740 used directly.  The same applies when using @option{-mcpu=} when the
16741 selected cpu supports the @samp{lse} feature.
16742
16743 @item -march=@var{name}
16744 @opindex march
16745 Specify the name of the target architecture and, optionally, one or
16746 more feature modifiers.  This option has the form
16747 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
16748
16749 The table below summarizes the permissible values for @var{arch}
16750 and the features that they enable by default:
16751
16752 @multitable @columnfractions 0.20 0.20 0.60
16753 @headitem @var{arch} value @tab Architecture @tab Includes by default
16754 @item @samp{armv8-a} @tab Armv8-A @tab @samp{+fp}, @samp{+simd}
16755 @item @samp{armv8.1-a} @tab Armv8.1-A @tab @samp{armv8-a}, @samp{+crc}, @samp{+lse}, @samp{+rdma}
16756 @item @samp{armv8.2-a} @tab Armv8.2-A @tab @samp{armv8.1-a}
16757 @item @samp{armv8.3-a} @tab Armv8.3-A @tab @samp{armv8.2-a}
16758 @item @samp{armv8.4-a} @tab Armv8.4-A @tab @samp{armv8.3-a}, @samp{+fp16fml}, @samp{+dotprod}
16759 @item @samp{armv8.5-a} @tab Armv8.5-A @tab @samp{armv8.4-a}, @samp{+sb}, @samp{+ssbs}, @samp{+predres}
16760 @item @samp{armv8.6-a} @tab Armv8.6-A @tab @samp{armv8.5-a}, @samp{+bf16}, @samp{+i8mm}
16761 @end multitable
16762
16763 The value @samp{native} is available on native AArch64 GNU/Linux and
16764 causes the compiler to pick the architecture of the host system.  This
16765 option has no effect if the compiler is unable to recognize the
16766 architecture of the host system,
16767
16768 The permissible values for @var{feature} are listed in the sub-section
16769 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
16770 Feature Modifiers}.  Where conflicting feature modifiers are
16771 specified, the right-most feature is used.
16772
16773 GCC uses @var{name} to determine what kind of instructions it can emit
16774 when generating assembly code.  If @option{-march} is specified
16775 without either of @option{-mtune} or @option{-mcpu} also being
16776 specified, the code is tuned to perform well across a range of target
16777 processors implementing the target architecture.
16778
16779 @item -mtune=@var{name}
16780 @opindex mtune
16781 Specify the name of the target processor for which GCC should tune the
16782 performance of the code.  Permissible values for this option are:
16783 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
16784 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
16785 @samp{cortex-a76}, @samp{cortex-a76ae}, @samp{cortex-a77},
16786 @samp{cortex-a65}, @samp{cortex-a65ae}, @samp{cortex-a34},
16787 @samp{ares}, @samp{exynos-m1}, @samp{emag}, @samp{falkor},
16788 @samp{neoverse-e1},@samp{neoverse-n1},@samp{qdf24xx}, @samp{saphira},
16789 @samp{phecda}, @samp{xgene1}, @samp{vulcan}, @samp{octeontx},
16790 @samp{octeontx81},  @samp{octeontx83},
16791 @samp{octeontx2}, @samp{octeontx2t98}, @samp{octeontx2t96}
16792 @samp{octeontx2t93}, @samp{octeontx2f95}, @samp{octeontx2f95n},
16793 @samp{octeontx2f95mm}
16794 @samp{thunderx}, @samp{thunderxt88},
16795 @samp{thunderxt88p1}, @samp{thunderxt81}, @samp{tsv110},
16796 @samp{thunderxt83}, @samp{thunderx2t99},
16797 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
16798 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
16799 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55}
16800 @samp{native}.
16801
16802 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
16803 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
16804 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55} specify that GCC
16805 should tune for a big.LITTLE system.
16806
16807 Additionally on native AArch64 GNU/Linux systems the value
16808 @samp{native} tunes performance to the host system.  This option has no effect
16809 if the compiler is unable to recognize the processor of the host system.
16810
16811 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
16812 are specified, the code is tuned to perform well across a range
16813 of target processors.
16814
16815 This option cannot be suffixed by feature modifiers.
16816
16817 @item -mcpu=@var{name}
16818 @opindex mcpu
16819 Specify the name of the target processor, optionally suffixed by one
16820 or more feature modifiers.  This option has the form
16821 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
16822 the permissible values for @var{cpu} are the same as those available
16823 for @option{-mtune}.  The permissible values for @var{feature} are
16824 documented in the sub-section on
16825 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
16826 Feature Modifiers}.  Where conflicting feature modifiers are
16827 specified, the right-most feature is used.
16828
16829 GCC uses @var{name} to determine what kind of instructions it can emit when
16830 generating assembly code (as if by @option{-march}) and to determine
16831 the target processor for which to tune for performance (as if
16832 by @option{-mtune}).  Where this option is used in conjunction
16833 with @option{-march} or @option{-mtune}, those options take precedence
16834 over the appropriate part of this option.
16835
16836 @item -moverride=@var{string}
16837 @opindex moverride
16838 Override tuning decisions made by the back-end in response to a
16839 @option{-mtune=} switch.  The syntax, semantics, and accepted values
16840 for @var{string} in this option are not guaranteed to be consistent
16841 across releases.
16842
16843 This option is only intended to be useful when developing GCC.
16844
16845 @item -mverbose-cost-dump
16846 @opindex mverbose-cost-dump
16847 Enable verbose cost model dumping in the debug dump files.  This option is
16848 provided for use in debugging the compiler.
16849
16850 @item -mpc-relative-literal-loads
16851 @itemx -mno-pc-relative-literal-loads
16852 @opindex mpc-relative-literal-loads
16853 @opindex mno-pc-relative-literal-loads
16854 Enable or disable PC-relative literal loads.  With this option literal pools are
16855 accessed using a single instruction and emitted after each function.  This
16856 limits the maximum size of functions to 1MB.  This is enabled by default for
16857 @option{-mcmodel=tiny}.
16858
16859 @item -msign-return-address=@var{scope}
16860 @opindex msign-return-address
16861 Select the function scope on which return address signing will be applied.
16862 Permissible values are @samp{none}, which disables return address signing,
16863 @samp{non-leaf}, which enables pointer signing for functions which are not leaf
16864 functions, and @samp{all}, which enables pointer signing for all functions.  The
16865 default value is @samp{none}. This option has been deprecated by
16866 -mbranch-protection.
16867
16868 @item -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}+@var{b-key}]|@var{bti}
16869 @opindex mbranch-protection
16870 Select the branch protection features to use.
16871 @samp{none} is the default and turns off all types of branch protection.
16872 @samp{standard} turns on all types of branch protection features.  If a feature
16873 has additional tuning options, then @samp{standard} sets it to its standard
16874 level.
16875 @samp{pac-ret[+@var{leaf}]} turns on return address signing to its standard
16876 level: signing functions that save the return address to memory (non-leaf
16877 functions will practically always do this) using the a-key.  The optional
16878 argument @samp{leaf} can be used to extend the signing to include leaf
16879 functions.  The optional argument @samp{b-key} can be used to sign the functions
16880 with the B-key instead of the A-key.
16881 @samp{bti} turns on branch target identification mechanism.
16882
16883 @item -msve-vector-bits=@var{bits}
16884 @opindex msve-vector-bits
16885 Specify the number of bits in an SVE vector register.  This option only has
16886 an effect when SVE is enabled.
16887
16888 GCC supports two forms of SVE code generation: ``vector-length
16889 agnostic'' output that works with any size of vector register and
16890 ``vector-length specific'' output that allows GCC to make assumptions
16891 about the vector length when it is useful for optimization reasons.
16892 The possible values of @samp{bits} are: @samp{scalable}, @samp{128},
16893 @samp{256}, @samp{512}, @samp{1024} and @samp{2048}.
16894 Specifying @samp{scalable} selects vector-length agnostic
16895 output.  At present @samp{-msve-vector-bits=128} also generates vector-length
16896 agnostic output for big-endian targets.  All other values generate
16897 vector-length specific code.  The behavior of these values may change
16898 in future releases and no value except @samp{scalable} should be
16899 relied on for producing code that is portable across different
16900 hardware SVE vector lengths.
16901
16902 The default is @samp{-msve-vector-bits=scalable}, which produces
16903 vector-length agnostic code.
16904 @end table
16905
16906 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
16907 @anchor{aarch64-feature-modifiers}
16908 @cindex @option{-march} feature modifiers
16909 @cindex @option{-mcpu} feature modifiers
16910 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
16911 the following and their inverses @option{no@var{feature}}:
16912
16913 @table @samp
16914 @item crc
16915 Enable CRC extension.  This is on by default for
16916 @option{-march=armv8.1-a}.
16917 @item crypto
16918 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
16919 instructions.
16920 @item fp
16921 Enable floating-point instructions.  This is on by default for all possible
16922 values for options @option{-march} and @option{-mcpu}.
16923 @item simd
16924 Enable Advanced SIMD instructions.  This also enables floating-point
16925 instructions.  This is on by default for all possible values for options
16926 @option{-march} and @option{-mcpu}.
16927 @item sve
16928 Enable Scalable Vector Extension instructions.  This also enables Advanced
16929 SIMD and floating-point instructions.
16930 @item lse
16931 Enable Large System Extension instructions.  This is on by default for
16932 @option{-march=armv8.1-a}.
16933 @item rdma
16934 Enable Round Double Multiply Accumulate instructions.  This is on by default
16935 for @option{-march=armv8.1-a}.
16936 @item fp16
16937 Enable FP16 extension.  This also enables floating-point instructions.
16938 @item fp16fml
16939 Enable FP16 fmla extension.  This also enables FP16 extensions and
16940 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.
16941
16942 @item rcpc
16943 Enable the RcPc extension.  This does not change code generation from GCC,
16944 but is passed on to the assembler, enabling inline asm statements to use
16945 instructions from the RcPc extension.
16946 @item dotprod
16947 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
16948 @item aes
16949 Enable the Armv8-a aes and pmull crypto extension.  This also enables Advanced
16950 SIMD instructions.
16951 @item sha2
16952 Enable the Armv8-a sha2 crypto extension.  This also enables Advanced SIMD instructions.
16953 @item sha3
16954 Enable the sha512 and sha3 crypto extension.  This also enables Advanced SIMD
16955 instructions. Use of this option with architectures prior to Armv8.2-A is not supported.
16956 @item sm4
16957 Enable the sm3 and sm4 crypto extension.  This also enables Advanced SIMD instructions.
16958 Use of this option with architectures prior to Armv8.2-A is not supported.
16959 @item profile
16960 Enable the Statistical Profiling extension.  This option is only to enable the
16961 extension at the assembler level and does not affect code generation.
16962 @item rng
16963 Enable the Armv8.5-a Random Number instructions.  This option is only to
16964 enable the extension at the assembler level and does not affect code
16965 generation.
16966 @item memtag
16967 Enable the Armv8.5-a Memory Tagging Extensions.
16968 Use of this option with architectures prior to Armv8.5-A is not supported.
16969 @item sb
16970 Enable the Armv8-a Speculation Barrier instruction.  This option is only to
16971 enable the extension at the assembler level and does not affect code
16972 generation.  This option is enabled by default for @option{-march=armv8.5-a}.
16973 @item ssbs
16974 Enable the Armv8-a Speculative Store Bypass Safe instruction.  This option
16975 is only to enable the extension at the assembler level and does not affect code
16976 generation.  This option is enabled by default for @option{-march=armv8.5-a}.
16977 @item predres
16978 Enable the Armv8-a Execution and Data Prediction Restriction instructions.
16979 This option is only to enable the extension at the assembler level and does
16980 not affect code generation.  This option is enabled by default for
16981 @option{-march=armv8.5-a}.
16982 @item sve2
16983 Enable the Armv8-a Scalable Vector Extension 2.  This also enables SVE
16984 instructions.
16985 @item sve2-bitperm
16986 Enable SVE2 bitperm instructions.  This also enables SVE2 instructions.
16987 @item sve2-sm4
16988 Enable SVE2 sm4 instructions.  This also enables SVE2 instructions.
16989 @item sve2-aes
16990 Enable SVE2 aes instructions.  This also enables SVE2 instructions.
16991 @item sve2-sha3
16992 Enable SVE2 sha3 instructions.  This also enables SVE2 instructions.
16993 @item tme
16994 Enable the Transactional Memory Extension.
16995 @item i8mm
16996 Enable 8-bit Integer Matrix Multiply instructions.  This also enables
16997 Advanced SIMD and floating-point instructions.  This option is enabled by
16998 default for @option{-march=armv8.6-a}.  Use of this option with architectures
16999 prior to Armv8.2-A is not supported.
17000 @item f32mm
17001 Enable 32-bit Floating point Matrix Multiply instructions.  This also enables
17002 SVE instructions.  Use of this option with architectures prior to Armv8.2-A is
17003 not supported.
17004 @item f64mm
17005 Enable 64-bit Floating point Matrix Multiply instructions.  This also enables
17006 SVE instructions.  Use of this option with architectures prior to Armv8.2-A is
17007 not supported.
17008 @item bf16
17009 Enable brain half-precision floating-point instructions.  This also enables
17010 Advanced SIMD and floating-point instructions.  This option is enabled by
17011 default for @option{-march=armv8.6-a}.  Use of this option with architectures
17012 prior to Armv8.2-A is not supported.
17013
17014 @end table
17015
17016 Feature @option{crypto} implies @option{aes}, @option{sha2}, and @option{simd},
17017 which implies @option{fp}.
17018 Conversely, @option{nofp} implies @option{nosimd}, which implies
17019 @option{nocrypto}, @option{noaes} and @option{nosha2}.
17020
17021 @node Adapteva Epiphany Options
17022 @subsection Adapteva Epiphany Options
17023
17024 These @samp{-m} options are defined for Adapteva Epiphany:
17025
17026 @table @gcctabopt
17027 @item -mhalf-reg-file
17028 @opindex mhalf-reg-file
17029 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
17030 That allows code to run on hardware variants that lack these registers.
17031
17032 @item -mprefer-short-insn-regs
17033 @opindex mprefer-short-insn-regs
17034 Preferentially allocate registers that allow short instruction generation.
17035 This can result in increased instruction count, so this may either reduce or
17036 increase overall code size.
17037
17038 @item -mbranch-cost=@var{num}
17039 @opindex mbranch-cost
17040 Set the cost of branches to roughly @var{num} ``simple'' instructions.
17041 This cost is only a heuristic and is not guaranteed to produce
17042 consistent results across releases.
17043
17044 @item -mcmove
17045 @opindex mcmove
17046 Enable the generation of conditional moves.
17047
17048 @item -mnops=@var{num}
17049 @opindex mnops
17050 Emit @var{num} NOPs before every other generated instruction.
17051
17052 @item -mno-soft-cmpsf
17053 @opindex mno-soft-cmpsf
17054 @opindex msoft-cmpsf
17055 For single-precision floating-point comparisons, emit an @code{fsub} instruction
17056 and test the flags.  This is faster than a software comparison, but can
17057 get incorrect results in the presence of NaNs, or when two different small
17058 numbers are compared such that their difference is calculated as zero.
17059 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
17060 software comparisons.
17061
17062 @item -mstack-offset=@var{num}
17063 @opindex mstack-offset
17064 Set the offset between the top of the stack and the stack pointer.
17065 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
17066 can be used by leaf functions without stack allocation.
17067 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
17068 Note also that this option changes the ABI; compiling a program with a
17069 different stack offset than the libraries have been compiled with
17070 generally does not work.
17071 This option can be useful if you want to evaluate if a different stack
17072 offset would give you better code, but to actually use a different stack
17073 offset to build working programs, it is recommended to configure the
17074 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
17075
17076 @item -mno-round-nearest
17077 @opindex mno-round-nearest
17078 @opindex mround-nearest
17079 Make the scheduler assume that the rounding mode has been set to
17080 truncating.  The default is @option{-mround-nearest}.
17081
17082 @item -mlong-calls
17083 @opindex mlong-calls
17084 If not otherwise specified by an attribute, assume all calls might be beyond
17085 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
17086 function address into a register before performing a (otherwise direct) call.
17087 This is the default.
17088
17089 @item -mshort-calls
17090 @opindex short-calls
17091 If not otherwise specified by an attribute, assume all direct calls are
17092 in the range of the @code{b} / @code{bl} instructions, so use these instructions
17093 for direct calls.  The default is @option{-mlong-calls}.
17094
17095 @item -msmall16
17096 @opindex msmall16
17097 Assume addresses can be loaded as 16-bit unsigned values.  This does not
17098 apply to function addresses for which @option{-mlong-calls} semantics
17099 are in effect.
17100
17101 @item -mfp-mode=@var{mode}
17102 @opindex mfp-mode
17103 Set the prevailing mode of the floating-point unit.
17104 This determines the floating-point mode that is provided and expected
17105 at function call and return time.  Making this mode match the mode you
17106 predominantly need at function start can make your programs smaller and
17107 faster by avoiding unnecessary mode switches.
17108
17109 @var{mode} can be set to one the following values:
17110
17111 @table @samp
17112 @item caller
17113 Any mode at function entry is valid, and retained or restored when
17114 the function returns, and when it calls other functions.
17115 This mode is useful for compiling libraries or other compilation units
17116 you might want to incorporate into different programs with different
17117 prevailing FPU modes, and the convenience of being able to use a single
17118 object file outweighs the size and speed overhead for any extra
17119 mode switching that might be needed, compared with what would be needed
17120 with a more specific choice of prevailing FPU mode.
17121
17122 @item truncate
17123 This is the mode used for floating-point calculations with
17124 truncating (i.e.@: round towards zero) rounding mode.  That includes
17125 conversion from floating point to integer.
17126
17127 @item round-nearest
17128 This is the mode used for floating-point calculations with
17129 round-to-nearest-or-even rounding mode.
17130
17131 @item int
17132 This is the mode used to perform integer calculations in the FPU, e.g.@:
17133 integer multiply, or integer multiply-and-accumulate.
17134 @end table
17135
17136 The default is @option{-mfp-mode=caller}
17137
17138 @item -mno-split-lohi
17139 @itemx -mno-postinc
17140 @itemx -mno-postmodify
17141 @opindex mno-split-lohi
17142 @opindex msplit-lohi
17143 @opindex mno-postinc
17144 @opindex mpostinc
17145 @opindex mno-postmodify
17146 @opindex mpostmodify
17147 Code generation tweaks that disable, respectively, splitting of 32-bit
17148 loads, generation of post-increment addresses, and generation of
17149 post-modify addresses.  The defaults are @option{msplit-lohi},
17150 @option{-mpost-inc}, and @option{-mpost-modify}.
17151
17152 @item -mnovect-double
17153 @opindex mno-vect-double
17154 @opindex mvect-double
17155 Change the preferred SIMD mode to SImode.  The default is
17156 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
17157
17158 @item -max-vect-align=@var{num}
17159 @opindex max-vect-align
17160 The maximum alignment for SIMD vector mode types.
17161 @var{num} may be 4 or 8.  The default is 8.
17162 Note that this is an ABI change, even though many library function
17163 interfaces are unaffected if they don't use SIMD vector modes
17164 in places that affect size and/or alignment of relevant types.
17165
17166 @item -msplit-vecmove-early
17167 @opindex msplit-vecmove-early
17168 Split vector moves into single word moves before reload.  In theory this
17169 can give better register allocation, but so far the reverse seems to be
17170 generally the case.
17171
17172 @item -m1reg-@var{reg}
17173 @opindex m1reg-
17174 Specify a register to hold the constant @minus{}1, which makes loading small negative
17175 constants and certain bitmasks faster.
17176 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
17177 which specify use of that register as a fixed register,
17178 and @samp{none}, which means that no register is used for this
17179 purpose.  The default is @option{-m1reg-none}.
17180
17181 @end table
17182
17183 @node AMD GCN Options
17184 @subsection AMD GCN Options
17185 @cindex AMD GCN Options
17186
17187 These options are defined specifically for the AMD GCN port.
17188
17189 @table @gcctabopt
17190
17191 @item -march=@var{gpu}
17192 @opindex march
17193 @itemx -mtune=@var{gpu}
17194 @opindex mtune
17195 Set architecture type or tuning for @var{gpu}. Supported values for @var{gpu}
17196 are
17197
17198 @table @samp
17199 @opindex fiji
17200 @item fiji
17201 Compile for GCN3 Fiji devices (gfx803).
17202
17203 @item gfx900
17204 Compile for GCN5 Vega 10 devices (gfx900).
17205
17206 @item gfx906
17207 Compile for GCN5 Vega 20 devices (gfx906).
17208
17209 @end table
17210
17211 @item -mstack-size=@var{bytes}
17212 @opindex mstack-size
17213 Specify how many @var{bytes} of stack space will be requested for each GPU
17214 thread (wave-front).  Beware that there may be many threads and limited memory
17215 available.  The size of the stack allocation may also have an impact on
17216 run-time performance.  The default is 32KB when using OpenACC or OpenMP, and
17217 1MB otherwise.
17218
17219 @end table
17220
17221 @node ARC Options
17222 @subsection ARC Options
17223 @cindex ARC options
17224
17225 The following options control the architecture variant for which code
17226 is being compiled:
17227
17228 @c architecture variants
17229 @table @gcctabopt
17230
17231 @item -mbarrel-shifter
17232 @opindex mbarrel-shifter
17233 Generate instructions supported by barrel shifter.  This is the default
17234 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
17235
17236 @item -mjli-always
17237 @opindex mjli-alawys
17238 Force to call a function using jli_s instruction.  This option is
17239 valid only for ARCv2 architecture.
17240
17241 @item -mcpu=@var{cpu}
17242 @opindex mcpu
17243 Set architecture type, register usage, and instruction scheduling
17244 parameters for @var{cpu}.  There are also shortcut alias options
17245 available for backward compatibility and convenience.  Supported
17246 values for @var{cpu} are
17247
17248 @table @samp
17249 @opindex mA6
17250 @opindex mARC600
17251 @item arc600
17252 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
17253
17254 @item arc601
17255 @opindex mARC601
17256 Compile for ARC601.  Alias: @option{-mARC601}.
17257
17258 @item arc700
17259 @opindex mA7
17260 @opindex mARC700
17261 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
17262 This is the default when configured with @option{--with-cpu=arc700}@.
17263
17264 @item arcem
17265 Compile for ARC EM.
17266
17267 @item archs
17268 Compile for ARC HS.
17269
17270 @item em
17271 Compile for ARC EM CPU with no hardware extensions.
17272
17273 @item em4
17274 Compile for ARC EM4 CPU.
17275
17276 @item em4_dmips
17277 Compile for ARC EM4 DMIPS CPU.
17278
17279 @item em4_fpus
17280 Compile for ARC EM4 DMIPS CPU with the single-precision floating-point
17281 extension.
17282
17283 @item em4_fpuda
17284 Compile for ARC EM4 DMIPS CPU with single-precision floating-point and
17285 double assist instructions.
17286
17287 @item hs
17288 Compile for ARC HS CPU with no hardware extensions except the atomic
17289 instructions.
17290
17291 @item hs34
17292 Compile for ARC HS34 CPU.
17293
17294 @item hs38
17295 Compile for ARC HS38 CPU.
17296
17297 @item hs38_linux
17298 Compile for ARC HS38 CPU with all hardware extensions on.
17299
17300 @item arc600_norm
17301 Compile for ARC 600 CPU with @code{norm} instructions enabled.
17302
17303 @item arc600_mul32x16
17304 Compile for ARC 600 CPU with @code{norm} and 32x16-bit multiply 
17305 instructions enabled.
17306
17307 @item arc600_mul64
17308 Compile for ARC 600 CPU with @code{norm} and @code{mul64}-family 
17309 instructions enabled.
17310
17311 @item arc601_norm
17312 Compile for ARC 601 CPU with @code{norm} instructions enabled.
17313
17314 @item arc601_mul32x16
17315 Compile for ARC 601 CPU with @code{norm} and 32x16-bit multiply
17316 instructions enabled.
17317
17318 @item arc601_mul64
17319 Compile for ARC 601 CPU with @code{norm} and @code{mul64}-family
17320 instructions enabled.
17321
17322 @item nps400
17323 Compile for ARC 700 on NPS400 chip.
17324
17325 @item em_mini
17326 Compile for ARC EM minimalist configuration featuring reduced register
17327 set.
17328
17329 @end table
17330
17331 @item -mdpfp
17332 @opindex mdpfp
17333 @itemx -mdpfp-compact
17334 @opindex mdpfp-compact
17335 Generate double-precision FPX instructions, tuned for the compact
17336 implementation.
17337
17338 @item -mdpfp-fast
17339 @opindex mdpfp-fast
17340 Generate double-precision FPX instructions, tuned for the fast
17341 implementation.
17342
17343 @item -mno-dpfp-lrsr
17344 @opindex mno-dpfp-lrsr
17345 Disable @code{lr} and @code{sr} instructions from using FPX extension
17346 aux registers.
17347
17348 @item -mea
17349 @opindex mea
17350 Generate extended arithmetic instructions.  Currently only
17351 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
17352 supported.  Only valid for @option{-mcpu=ARC700}.
17353
17354 @item -mno-mpy
17355 @opindex mno-mpy
17356 @opindex mmpy
17357 Do not generate @code{mpy}-family instructions for ARC700.  This option is
17358 deprecated.
17359
17360 @item -mmul32x16
17361 @opindex mmul32x16
17362 Generate 32x16-bit multiply and multiply-accumulate instructions.
17363
17364 @item -mmul64
17365 @opindex mmul64
17366 Generate @code{mul64} and @code{mulu64} instructions.  
17367 Only valid for @option{-mcpu=ARC600}.
17368
17369 @item -mnorm
17370 @opindex mnorm
17371 Generate @code{norm} instructions.  This is the default if @option{-mcpu=ARC700}
17372 is in effect.
17373
17374 @item -mspfp
17375 @opindex mspfp
17376 @itemx -mspfp-compact
17377 @opindex mspfp-compact
17378 Generate single-precision FPX instructions, tuned for the compact
17379 implementation.
17380
17381 @item -mspfp-fast
17382 @opindex mspfp-fast
17383 Generate single-precision FPX instructions, tuned for the fast
17384 implementation.
17385
17386 @item -msimd
17387 @opindex msimd
17388 Enable generation of ARC SIMD instructions via target-specific
17389 builtins.  Only valid for @option{-mcpu=ARC700}.
17390
17391 @item -msoft-float
17392 @opindex msoft-float
17393 This option ignored; it is provided for compatibility purposes only.
17394 Software floating-point code is emitted by default, and this default
17395 can overridden by FPX options; @option{-mspfp}, @option{-mspfp-compact}, or
17396 @option{-mspfp-fast} for single precision, and @option{-mdpfp},
17397 @option{-mdpfp-compact}, or @option{-mdpfp-fast} for double precision.
17398
17399 @item -mswap
17400 @opindex mswap
17401 Generate @code{swap} instructions.
17402
17403 @item -matomic
17404 @opindex matomic
17405 This enables use of the locked load/store conditional extension to implement
17406 atomic memory built-in functions.  Not available for ARC 6xx or ARC
17407 EM cores.
17408
17409 @item -mdiv-rem
17410 @opindex mdiv-rem
17411 Enable @code{div} and @code{rem} instructions for ARCv2 cores.
17412
17413 @item -mcode-density
17414 @opindex mcode-density
17415 Enable code density instructions for ARC EM.  
17416 This option is on by default for ARC HS.
17417
17418 @item -mll64
17419 @opindex mll64
17420 Enable double load/store operations for ARC HS cores.
17421
17422 @item -mtp-regno=@var{regno}
17423 @opindex mtp-regno
17424 Specify thread pointer register number.
17425
17426 @item -mmpy-option=@var{multo}
17427 @opindex mmpy-option
17428 Compile ARCv2 code with a multiplier design option.  You can specify 
17429 the option using either a string or numeric value for @var{multo}.  
17430 @samp{wlh1} is the default value.  The recognized values are:
17431
17432 @table @samp
17433 @item 0
17434 @itemx none
17435 No multiplier available.
17436
17437 @item 1
17438 @itemx w
17439 16x16 multiplier, fully pipelined.
17440 The following instructions are enabled: @code{mpyw} and @code{mpyuw}.
17441
17442 @item 2
17443 @itemx wlh1
17444 32x32 multiplier, fully
17445 pipelined (1 stage).  The following instructions are additionally
17446 enabled: @code{mpy}, @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
17447
17448 @item 3
17449 @itemx wlh2
17450 32x32 multiplier, fully pipelined
17451 (2 stages).  The following instructions are additionally enabled: @code{mpy},
17452 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
17453
17454 @item 4
17455 @itemx wlh3
17456 Two 16x16 multipliers, blocking,
17457 sequential.  The following instructions are additionally enabled: @code{mpy},
17458 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
17459
17460 @item 5
17461 @itemx wlh4
17462 One 16x16 multiplier, blocking,
17463 sequential.  The following instructions are additionally enabled: @code{mpy},
17464 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
17465
17466 @item 6
17467 @itemx wlh5
17468 One 32x4 multiplier, blocking,
17469 sequential.  The following instructions are additionally enabled: @code{mpy},
17470 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
17471
17472 @item 7
17473 @itemx plus_dmpy
17474 ARC HS SIMD support.
17475
17476 @item 8
17477 @itemx plus_macd
17478 ARC HS SIMD support.
17479
17480 @item 9
17481 @itemx plus_qmacw
17482 ARC HS SIMD support.
17483
17484 @end table
17485
17486 This option is only available for ARCv2 cores@.
17487
17488 @item -mfpu=@var{fpu}
17489 @opindex mfpu
17490 Enables support for specific floating-point hardware extensions for ARCv2
17491 cores.  Supported values for @var{fpu} are:
17492
17493 @table @samp
17494
17495 @item fpus
17496 Enables support for single-precision floating-point hardware
17497 extensions@.
17498
17499 @item fpud
17500 Enables support for double-precision floating-point hardware
17501 extensions.  The single-precision floating-point extension is also
17502 enabled.  Not available for ARC EM@.
17503
17504 @item fpuda
17505 Enables support for double-precision floating-point hardware
17506 extensions using double-precision assist instructions.  The single-precision
17507 floating-point extension is also enabled.  This option is
17508 only available for ARC EM@.
17509
17510 @item fpuda_div
17511 Enables support for double-precision floating-point hardware
17512 extensions using double-precision assist instructions.
17513 The single-precision floating-point, square-root, and divide 
17514 extensions are also enabled.  This option is
17515 only available for ARC EM@.
17516
17517 @item fpuda_fma
17518 Enables support for double-precision floating-point hardware
17519 extensions using double-precision assist instructions.
17520 The single-precision floating-point and fused multiply and add 
17521 hardware extensions are also enabled.  This option is
17522 only available for ARC EM@.
17523
17524 @item fpuda_all
17525 Enables support for double-precision floating-point hardware
17526 extensions using double-precision assist instructions.
17527 All single-precision floating-point hardware extensions are also
17528 enabled.  This option is only available for ARC EM@.
17529
17530 @item fpus_div
17531 Enables support for single-precision floating-point, square-root and divide 
17532 hardware extensions@.
17533
17534 @item fpud_div
17535 Enables support for double-precision floating-point, square-root and divide 
17536 hardware extensions.  This option
17537 includes option @samp{fpus_div}. Not available for ARC EM@.
17538
17539 @item fpus_fma
17540 Enables support for single-precision floating-point and 
17541 fused multiply and add hardware extensions@.
17542
17543 @item fpud_fma
17544 Enables support for double-precision floating-point and 
17545 fused multiply and add hardware extensions.  This option
17546 includes option @samp{fpus_fma}.  Not available for ARC EM@.
17547
17548 @item fpus_all
17549 Enables support for all single-precision floating-point hardware
17550 extensions@.
17551
17552 @item fpud_all
17553 Enables support for all single- and double-precision floating-point
17554 hardware extensions.  Not available for ARC EM@.
17555
17556 @end table
17557
17558 @item -mirq-ctrl-saved=@var{register-range}, @var{blink}, @var{lp_count}
17559 @opindex mirq-ctrl-saved
17560 Specifies general-purposes registers that the processor automatically
17561 saves/restores on interrupt entry and exit.  @var{register-range} is
17562 specified as two registers separated by a dash.  The register range
17563 always starts with @code{r0}, the upper limit is @code{fp} register.
17564 @var{blink} and @var{lp_count} are optional.  This option is only
17565 valid for ARC EM and ARC HS cores.
17566
17567 @item -mrgf-banked-regs=@var{number}
17568 @opindex mrgf-banked-regs
17569 Specifies the number of registers replicated in second register bank
17570 on entry to fast interrupt.  Fast interrupts are interrupts with the
17571 highest priority level P0.  These interrupts save only PC and STATUS32
17572 registers to avoid memory transactions during interrupt entry and exit
17573 sequences.  Use this option when you are using fast interrupts in an
17574 ARC V2 family processor.  Permitted values are 4, 8, 16, and 32.
17575
17576 @item -mlpc-width=@var{width}
17577 @opindex mlpc-width
17578 Specify the width of the @code{lp_count} register.  Valid values for
17579 @var{width} are 8, 16, 20, 24, 28 and 32 bits.  The default width is
17580 fixed to 32 bits.  If the width is less than 32, the compiler does not
17581 attempt to transform loops in your program to use the zero-delay loop
17582 mechanism unless it is known that the @code{lp_count} register can
17583 hold the required loop-counter value.  Depending on the width
17584 specified, the compiler and run-time library might continue to use the
17585 loop mechanism for various needs.  This option defines macro
17586 @code{__ARC_LPC_WIDTH__} with the value of @var{width}.
17587
17588 @item -mrf16
17589 @opindex mrf16
17590 This option instructs the compiler to generate code for a 16-entry
17591 register file.  This option defines the @code{__ARC_RF16__}
17592 preprocessor macro.
17593
17594 @item -mbranch-index
17595 @opindex mbranch-index
17596 Enable use of @code{bi} or @code{bih} instructions to implement jump
17597 tables.
17598
17599 @end table
17600
17601 The following options are passed through to the assembler, and also
17602 define preprocessor macro symbols.
17603
17604 @c Flags used by the assembler, but for which we define preprocessor
17605 @c macro symbols as well.
17606 @table @gcctabopt
17607 @item -mdsp-packa
17608 @opindex mdsp-packa
17609 Passed down to the assembler to enable the DSP Pack A extensions.
17610 Also sets the preprocessor symbol @code{__Xdsp_packa}.  This option is
17611 deprecated.
17612
17613 @item -mdvbf
17614 @opindex mdvbf
17615 Passed down to the assembler to enable the dual Viterbi butterfly
17616 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.  This
17617 option is deprecated.
17618
17619 @c ARC700 4.10 extension instruction
17620 @item -mlock
17621 @opindex mlock
17622 Passed down to the assembler to enable the locked load/store
17623 conditional extension.  Also sets the preprocessor symbol
17624 @code{__Xlock}.
17625
17626 @item -mmac-d16
17627 @opindex mmac-d16
17628 Passed down to the assembler.  Also sets the preprocessor symbol
17629 @code{__Xxmac_d16}.  This option is deprecated.
17630
17631 @item -mmac-24
17632 @opindex mmac-24
17633 Passed down to the assembler.  Also sets the preprocessor symbol
17634 @code{__Xxmac_24}.  This option is deprecated.
17635
17636 @c ARC700 4.10 extension instruction
17637 @item -mrtsc
17638 @opindex mrtsc
17639 Passed down to the assembler to enable the 64-bit time-stamp counter
17640 extension instruction.  Also sets the preprocessor symbol
17641 @code{__Xrtsc}.  This option is deprecated.
17642
17643 @c ARC700 4.10 extension instruction
17644 @item -mswape
17645 @opindex mswape
17646 Passed down to the assembler to enable the swap byte ordering
17647 extension instruction.  Also sets the preprocessor symbol
17648 @code{__Xswape}.
17649
17650 @item -mtelephony
17651 @opindex mtelephony
17652 Passed down to the assembler to enable dual- and single-operand
17653 instructions for telephony.  Also sets the preprocessor symbol
17654 @code{__Xtelephony}.  This option is deprecated.
17655
17656 @item -mxy
17657 @opindex mxy
17658 Passed down to the assembler to enable the XY memory extension.  Also
17659 sets the preprocessor symbol @code{__Xxy}.
17660
17661 @end table
17662
17663 The following options control how the assembly code is annotated:
17664
17665 @c Assembly annotation options
17666 @table @gcctabopt
17667 @item -misize
17668 @opindex misize
17669 Annotate assembler instructions with estimated addresses.
17670
17671 @item -mannotate-align
17672 @opindex mannotate-align
17673 Explain what alignment considerations lead to the decision to make an
17674 instruction short or long.
17675
17676 @end table
17677
17678 The following options are passed through to the linker:
17679
17680 @c options passed through to the linker
17681 @table @gcctabopt
17682 @item -marclinux
17683 @opindex marclinux
17684 Passed through to the linker, to specify use of the @code{arclinux} emulation.
17685 This option is enabled by default in tool chains built for
17686 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
17687 when profiling is not requested.
17688
17689 @item -marclinux_prof
17690 @opindex marclinux_prof
17691 Passed through to the linker, to specify use of the
17692 @code{arclinux_prof} emulation.  This option is enabled by default in
17693 tool chains built for @w{@code{arc-linux-uclibc}} and
17694 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
17695
17696 @end table
17697
17698 The following options control the semantics of generated code:
17699
17700 @c semantically relevant code generation options
17701 @table @gcctabopt
17702 @item -mlong-calls
17703 @opindex mlong-calls
17704 Generate calls as register indirect calls, thus providing access
17705 to the full 32-bit address range.
17706
17707 @item -mmedium-calls
17708 @opindex mmedium-calls
17709 Don't use less than 25-bit addressing range for calls, which is the
17710 offset available for an unconditional branch-and-link
17711 instruction.  Conditional execution of function calls is suppressed, to
17712 allow use of the 25-bit range, rather than the 21-bit range with
17713 conditional branch-and-link.  This is the default for tool chains built
17714 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
17715
17716 @item -G @var{num}
17717 @opindex G
17718 Put definitions of externally-visible data in a small data section if
17719 that data is no bigger than @var{num} bytes.  The default value of
17720 @var{num} is 4 for any ARC configuration, or 8 when we have double
17721 load/store operations.
17722
17723 @item -mno-sdata
17724 @opindex mno-sdata
17725 @opindex msdata
17726 Do not generate sdata references.  This is the default for tool chains
17727 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
17728 targets.
17729
17730 @item -mvolatile-cache
17731 @opindex mvolatile-cache
17732 Use ordinarily cached memory accesses for volatile references.  This is the
17733 default.
17734
17735 @item -mno-volatile-cache
17736 @opindex mno-volatile-cache
17737 @opindex mvolatile-cache
17738 Enable cache bypass for volatile references.
17739
17740 @end table
17741
17742 The following options fine tune code generation:
17743 @c code generation tuning options
17744 @table @gcctabopt
17745 @item -malign-call
17746 @opindex malign-call
17747 Do alignment optimizations for call instructions.
17748
17749 @item -mauto-modify-reg
17750 @opindex mauto-modify-reg
17751 Enable the use of pre/post modify with register displacement.
17752
17753 @item -mbbit-peephole
17754 @opindex mbbit-peephole
17755 Enable bbit peephole2.
17756
17757 @item -mno-brcc
17758 @opindex mno-brcc
17759 This option disables a target-specific pass in @file{arc_reorg} to
17760 generate compare-and-branch (@code{br@var{cc}}) instructions.  
17761 It has no effect on
17762 generation of these instructions driven by the combiner pass.
17763
17764 @item -mcase-vector-pcrel
17765 @opindex mcase-vector-pcrel
17766 Use PC-relative switch case tables to enable case table shortening.
17767 This is the default for @option{-Os}.
17768
17769 @item -mcompact-casesi
17770 @opindex mcompact-casesi
17771 Enable compact @code{casesi} pattern.  This is the default for @option{-Os},
17772 and only available for ARCv1 cores.  This option is deprecated.
17773
17774 @item -mno-cond-exec
17775 @opindex mno-cond-exec
17776 Disable the ARCompact-specific pass to generate conditional 
17777 execution instructions.
17778
17779 Due to delay slot scheduling and interactions between operand numbers,
17780 literal sizes, instruction lengths, and the support for conditional execution,
17781 the target-independent pass to generate conditional execution is often lacking,
17782 so the ARC port has kept a special pass around that tries to find more
17783 conditional execution generation opportunities after register allocation,
17784 branch shortening, and delay slot scheduling have been done.  This pass
17785 generally, but not always, improves performance and code size, at the cost of
17786 extra compilation time, which is why there is an option to switch it off.
17787 If you have a problem with call instructions exceeding their allowable
17788 offset range because they are conditionalized, you should consider using
17789 @option{-mmedium-calls} instead.
17790
17791 @item -mearly-cbranchsi
17792 @opindex mearly-cbranchsi
17793 Enable pre-reload use of the @code{cbranchsi} pattern.
17794
17795 @item -mexpand-adddi
17796 @opindex mexpand-adddi
17797 Expand @code{adddi3} and @code{subdi3} at RTL generation time into
17798 @code{add.f}, @code{adc} etc.  This option is deprecated.
17799
17800 @item -mindexed-loads
17801 @opindex mindexed-loads
17802 Enable the use of indexed loads.  This can be problematic because some
17803 optimizers then assume that indexed stores exist, which is not
17804 the case.
17805
17806 @item -mlra
17807 @opindex mlra
17808 Enable Local Register Allocation.  This is still experimental for ARC,
17809 so by default the compiler uses standard reload
17810 (i.e.@: @option{-mno-lra}).
17811
17812 @item -mlra-priority-none
17813 @opindex mlra-priority-none
17814 Don't indicate any priority for target registers.
17815
17816 @item -mlra-priority-compact
17817 @opindex mlra-priority-compact
17818 Indicate target register priority for r0..r3 / r12..r15.
17819
17820 @item -mlra-priority-noncompact
17821 @opindex mlra-priority-noncompact
17822 Reduce target register priority for r0..r3 / r12..r15.
17823
17824 @item -mmillicode
17825 @opindex mmillicode
17826 When optimizing for size (using @option{-Os}), prologues and epilogues
17827 that have to save or restore a large number of registers are often
17828 shortened by using call to a special function in libgcc; this is
17829 referred to as a @emph{millicode} call.  As these calls can pose
17830 performance issues, and/or cause linking issues when linking in a
17831 nonstandard way, this option is provided to turn on or off millicode
17832 call generation.
17833
17834 @item -mcode-density-frame
17835 @opindex mcode-density-frame
17836 This option enable the compiler to emit @code{enter} and @code{leave}
17837 instructions.  These instructions are only valid for CPUs with
17838 code-density feature.
17839
17840 @item -mmixed-code
17841 @opindex mmixed-code
17842 Tweak register allocation to help 16-bit instruction generation.
17843 This generally has the effect of decreasing the average instruction size
17844 while increasing the instruction count.
17845
17846 @item -mq-class
17847 @opindex mq-class
17848 Ths option is deprecated.  Enable @samp{q} instruction alternatives.
17849 This is the default for @option{-Os}.
17850
17851 @item -mRcq
17852 @opindex mRcq
17853 Enable @samp{Rcq} constraint handling.  
17854 Most short code generation depends on this.
17855 This is the default.
17856
17857 @item -mRcw
17858 @opindex mRcw
17859 Enable @samp{Rcw} constraint handling.  
17860 Most ccfsm condexec mostly depends on this.
17861 This is the default.
17862
17863 @item -msize-level=@var{level}
17864 @opindex msize-level
17865 Fine-tune size optimization with regards to instruction lengths and alignment.
17866 The recognized values for @var{level} are:
17867 @table @samp
17868 @item 0
17869 No size optimization.  This level is deprecated and treated like @samp{1}.
17870
17871 @item 1
17872 Short instructions are used opportunistically.
17873
17874 @item 2
17875 In addition, alignment of loops and of code after barriers are dropped.
17876
17877 @item 3
17878 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
17879
17880 @end table
17881
17882 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
17883 the behavior when this is not set is equivalent to level @samp{1}.
17884
17885 @item -mtune=@var{cpu}
17886 @opindex mtune
17887 Set instruction scheduling parameters for @var{cpu}, overriding any implied
17888 by @option{-mcpu=}.
17889
17890 Supported values for @var{cpu} are
17891
17892 @table @samp
17893 @item ARC600
17894 Tune for ARC600 CPU.
17895
17896 @item ARC601
17897 Tune for ARC601 CPU.
17898
17899 @item ARC700
17900 Tune for ARC700 CPU with standard multiplier block.
17901
17902 @item ARC700-xmac
17903 Tune for ARC700 CPU with XMAC block.
17904
17905 @item ARC725D
17906 Tune for ARC725D CPU.
17907
17908 @item ARC750D
17909 Tune for ARC750D CPU.
17910
17911 @end table
17912
17913 @item -mmultcost=@var{num}
17914 @opindex mmultcost
17915 Cost to assume for a multiply instruction, with @samp{4} being equal to a
17916 normal instruction.
17917
17918 @item -munalign-prob-threshold=@var{probability}
17919 @opindex munalign-prob-threshold
17920 Set probability threshold for unaligning branches.
17921 When tuning for @samp{ARC700} and optimizing for speed, branches without
17922 filled delay slot are preferably emitted unaligned and long, unless
17923 profiling indicates that the probability for the branch to be taken
17924 is below @var{probability}.  @xref{Cross-profiling}.
17925 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
17926
17927 @end table
17928
17929 The following options are maintained for backward compatibility, but
17930 are now deprecated and will be removed in a future release:
17931
17932 @c Deprecated options
17933 @table @gcctabopt
17934
17935 @item -margonaut
17936 @opindex margonaut
17937 Obsolete FPX.
17938
17939 @item -mbig-endian
17940 @opindex mbig-endian
17941 @itemx -EB
17942 @opindex EB
17943 Compile code for big-endian targets.  Use of these options is now
17944 deprecated.  Big-endian code is supported by configuring GCC to build
17945 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets,
17946 for which big endian is the default.
17947
17948 @item -mlittle-endian
17949 @opindex mlittle-endian
17950 @itemx -EL
17951 @opindex EL
17952 Compile code for little-endian targets.  Use of these options is now
17953 deprecated.  Little-endian code is supported by configuring GCC to build 
17954 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets,
17955 for which little endian is the default.
17956
17957 @item -mbarrel_shifter
17958 @opindex mbarrel_shifter
17959 Replaced by @option{-mbarrel-shifter}.
17960
17961 @item -mdpfp_compact
17962 @opindex mdpfp_compact
17963 Replaced by @option{-mdpfp-compact}.
17964
17965 @item -mdpfp_fast
17966 @opindex mdpfp_fast
17967 Replaced by @option{-mdpfp-fast}.
17968
17969 @item -mdsp_packa
17970 @opindex mdsp_packa
17971 Replaced by @option{-mdsp-packa}.
17972
17973 @item -mEA
17974 @opindex mEA
17975 Replaced by @option{-mea}.
17976
17977 @item -mmac_24
17978 @opindex mmac_24
17979 Replaced by @option{-mmac-24}.
17980
17981 @item -mmac_d16
17982 @opindex mmac_d16
17983 Replaced by @option{-mmac-d16}.
17984
17985 @item -mspfp_compact
17986 @opindex mspfp_compact
17987 Replaced by @option{-mspfp-compact}.
17988
17989 @item -mspfp_fast
17990 @opindex mspfp_fast
17991 Replaced by @option{-mspfp-fast}.
17992
17993 @item -mtune=@var{cpu}
17994 @opindex mtune
17995 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
17996 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
17997 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively.
17998
17999 @item -multcost=@var{num}
18000 @opindex multcost
18001 Replaced by @option{-mmultcost}.
18002
18003 @end table
18004
18005 @node ARM Options
18006 @subsection ARM Options
18007 @cindex ARM options
18008
18009 These @samp{-m} options are defined for the ARM port:
18010
18011 @table @gcctabopt
18012 @item -mabi=@var{name}
18013 @opindex mabi
18014 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
18015 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
18016
18017 @item -mapcs-frame
18018 @opindex mapcs-frame
18019 Generate a stack frame that is compliant with the ARM Procedure Call
18020 Standard for all functions, even if this is not strictly necessary for
18021 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
18022 with this option causes the stack frames not to be generated for
18023 leaf functions.  The default is @option{-mno-apcs-frame}.
18024 This option is deprecated.
18025
18026 @item -mapcs
18027 @opindex mapcs
18028 This is a synonym for @option{-mapcs-frame} and is deprecated.
18029
18030 @ignore
18031 @c not currently implemented
18032 @item -mapcs-stack-check
18033 @opindex mapcs-stack-check
18034 Generate code to check the amount of stack space available upon entry to
18035 every function (that actually uses some stack space).  If there is
18036 insufficient space available then either the function
18037 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
18038 called, depending upon the amount of stack space required.  The runtime
18039 system is required to provide these functions.  The default is
18040 @option{-mno-apcs-stack-check}, since this produces smaller code.
18041
18042 @c not currently implemented
18043 @item -mapcs-reentrant
18044 @opindex mapcs-reentrant
18045 Generate reentrant, position-independent code.  The default is
18046 @option{-mno-apcs-reentrant}.
18047 @end ignore
18048
18049 @item -mthumb-interwork
18050 @opindex mthumb-interwork
18051 Generate code that supports calling between the ARM and Thumb
18052 instruction sets.  Without this option, on pre-v5 architectures, the
18053 two instruction sets cannot be reliably used inside one program.  The
18054 default is @option{-mno-thumb-interwork}, since slightly larger code
18055 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
18056 configurations this option is meaningless.
18057
18058 @item -mno-sched-prolog
18059 @opindex mno-sched-prolog
18060 @opindex msched-prolog
18061 Prevent the reordering of instructions in the function prologue, or the
18062 merging of those instruction with the instructions in the function's
18063 body.  This means that all functions start with a recognizable set
18064 of instructions (or in fact one of a choice from a small set of
18065 different function prologues), and this information can be used to
18066 locate the start of functions inside an executable piece of code.  The
18067 default is @option{-msched-prolog}.
18068
18069 @item -mfloat-abi=@var{name}
18070 @opindex mfloat-abi
18071 Specifies which floating-point ABI to use.  Permissible values
18072 are: @samp{soft}, @samp{softfp} and @samp{hard}.
18073
18074 Specifying @samp{soft} causes GCC to generate output containing
18075 library calls for floating-point operations.
18076 @samp{softfp} allows the generation of code using hardware floating-point
18077 instructions, but still uses the soft-float calling conventions.
18078 @samp{hard} allows generation of floating-point instructions
18079 and uses FPU-specific calling conventions.
18080
18081 The default depends on the specific target configuration.  Note that
18082 the hard-float and soft-float ABIs are not link-compatible; you must
18083 compile your entire program with the same ABI, and link with a
18084 compatible set of libraries.
18085
18086 @item -mgeneral-regs-only
18087 @opindex mgeneral-regs-only
18088 Generate code which uses only the general-purpose registers.  This will prevent
18089 the compiler from using floating-point and Advanced SIMD registers but will not
18090 impose any restrictions on the assembler.
18091
18092 @item -mlittle-endian
18093 @opindex mlittle-endian
18094 Generate code for a processor running in little-endian mode.  This is
18095 the default for all standard configurations.
18096
18097 @item -mbig-endian
18098 @opindex mbig-endian
18099 Generate code for a processor running in big-endian mode; the default is
18100 to compile code for a little-endian processor.
18101
18102 @item -mbe8
18103 @itemx -mbe32
18104 @opindex mbe8
18105 When linking a big-endian image select between BE8 and BE32 formats.
18106 The option has no effect for little-endian images and is ignored.  The
18107 default is dependent on the selected target architecture.  For ARMv6
18108 and later architectures the default is BE8, for older architectures
18109 the default is BE32.  BE32 format has been deprecated by ARM.
18110
18111 @item -march=@var{name}@r{[}+extension@dots{}@r{]}
18112 @opindex march
18113 This specifies the name of the target ARM architecture.  GCC uses this
18114 name to determine what kind of instructions it can emit when generating
18115 assembly code.  This option can be used in conjunction with or instead
18116 of the @option{-mcpu=} option.
18117
18118 Permissible names are:
18119 @samp{armv4t},
18120 @samp{armv5t}, @samp{armv5te},
18121 @samp{armv6}, @samp{armv6j}, @samp{armv6k}, @samp{armv6kz}, @samp{armv6t2},
18122 @samp{armv6z}, @samp{armv6zk},
18123 @samp{armv7}, @samp{armv7-a}, @samp{armv7ve}, 
18124 @samp{armv8-a}, @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a},
18125 @samp{armv8.4-a},
18126 @samp{armv8.5-a},
18127 @samp{armv8.6-a},
18128 @samp{armv7-r},
18129 @samp{armv8-r},
18130 @samp{armv6-m}, @samp{armv6s-m},
18131 @samp{armv7-m}, @samp{armv7e-m},
18132 @samp{armv8-m.base}, @samp{armv8-m.main},
18133 @samp{armv8.1-m.main},
18134 @samp{iwmmxt} and @samp{iwmmxt2}.
18135
18136 Additionally, the following architectures, which lack support for the
18137 Thumb execution state, are recognized but support is deprecated: @samp{armv4}.
18138
18139 Many of the architectures support extensions.  These can be added by
18140 appending @samp{+@var{extension}} to the architecture name.  Extension
18141 options are processed in order and capabilities accumulate.  An extension
18142 will also enable any necessary base extensions
18143 upon which it depends.  For example, the @samp{+crypto} extension
18144 will always enable the @samp{+simd} extension.  The exception to the
18145 additive construction is for extensions that are prefixed with
18146 @samp{+no@dots{}}: these extensions disable the specified option and
18147 any other extensions that may depend on the presence of that
18148 extension.
18149
18150 For example, @samp{-march=armv7-a+simd+nofp+vfpv4} is equivalent to
18151 writing @samp{-march=armv7-a+vfpv4} since the @samp{+simd} option is
18152 entirely disabled by the @samp{+nofp} option that follows it.
18153
18154 Most extension names are generically named, but have an effect that is
18155 dependent upon the architecture to which it is applied.  For example,
18156 the @samp{+simd} option can be applied to both @samp{armv7-a} and
18157 @samp{armv8-a} architectures, but will enable the original ARMv7-A
18158 Advanced SIMD (Neon) extensions for @samp{armv7-a} and the ARMv8-A
18159 variant for @samp{armv8-a}.
18160
18161 The table below lists the supported extensions for each architecture.
18162 Architectures not mentioned do not support any extensions.
18163
18164 @table @samp
18165 @item armv5te
18166 @itemx armv6
18167 @itemx armv6j
18168 @itemx armv6k
18169 @itemx armv6kz
18170 @itemx armv6t2
18171 @itemx armv6z
18172 @itemx armv6zk
18173 @table @samp
18174 @item +fp
18175 The VFPv2 floating-point instructions.  The extension @samp{+vfpv2} can be
18176 used as an alias for this extension.
18177
18178 @item +nofp
18179 Disable the floating-point instructions.
18180 @end table
18181
18182 @item armv7
18183 The common subset of the ARMv7-A, ARMv7-R and ARMv7-M architectures.
18184 @table @samp
18185 @item +fp
18186 The VFPv3 floating-point instructions, with 16 double-precision
18187 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
18188 for this extension.  Note that floating-point is not supported by the
18189 base ARMv7-M architecture, but is compatible with both the ARMv7-A and
18190 ARMv7-R architectures.
18191
18192 @item +nofp
18193 Disable the floating-point instructions.
18194 @end table
18195
18196 @item armv7-a
18197 @table @samp
18198 @item +mp
18199 The multiprocessing extension.
18200
18201 @item +sec
18202 The security extension.
18203
18204 @item +fp
18205 The VFPv3 floating-point instructions, with 16 double-precision
18206 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
18207 for this extension.
18208
18209 @item +simd
18210 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
18211 The extensions @samp{+neon} and @samp{+neon-vfpv3} can be used as aliases
18212 for this extension.
18213
18214 @item +vfpv3
18215 The VFPv3 floating-point instructions, with 32 double-precision
18216 registers.
18217
18218 @item +vfpv3-d16-fp16
18219 The VFPv3 floating-point instructions, with 16 double-precision
18220 registers and the half-precision floating-point conversion operations.
18221
18222 @item +vfpv3-fp16
18223 The VFPv3 floating-point instructions, with 32 double-precision
18224 registers and the half-precision floating-point conversion operations.
18225
18226 @item +vfpv4-d16
18227 The VFPv4 floating-point instructions, with 16 double-precision
18228 registers.
18229
18230 @item +vfpv4
18231 The VFPv4 floating-point instructions, with 32 double-precision
18232 registers.
18233
18234 @item +neon-fp16
18235 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
18236 the half-precision floating-point conversion operations.
18237
18238 @item +neon-vfpv4
18239 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.
18240
18241 @item +nosimd
18242 Disable the Advanced SIMD instructions (does not disable floating point).
18243
18244 @item +nofp
18245 Disable the floating-point and Advanced SIMD instructions.
18246 @end table
18247
18248 @item armv7ve
18249 The extended version of the ARMv7-A architecture with support for
18250 virtualization.
18251 @table @samp
18252 @item +fp
18253 The VFPv4 floating-point instructions, with 16 double-precision registers.
18254 The extension @samp{+vfpv4-d16} can be used as an alias for this extension.
18255
18256 @item +simd
18257 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.  The
18258 extension @samp{+neon-vfpv4} can be used as an alias for this extension.
18259
18260 @item +vfpv3-d16
18261 The VFPv3 floating-point instructions, with 16 double-precision
18262 registers.
18263
18264 @item +vfpv3
18265 The VFPv3 floating-point instructions, with 32 double-precision
18266 registers.
18267
18268 @item +vfpv3-d16-fp16
18269 The VFPv3 floating-point instructions, with 16 double-precision
18270 registers and the half-precision floating-point conversion operations.
18271
18272 @item +vfpv3-fp16
18273 The VFPv3 floating-point instructions, with 32 double-precision
18274 registers and the half-precision floating-point conversion operations.
18275
18276 @item +vfpv4-d16
18277 The VFPv4 floating-point instructions, with 16 double-precision
18278 registers.
18279
18280 @item +vfpv4
18281 The VFPv4 floating-point instructions, with 32 double-precision
18282 registers.
18283
18284 @item +neon
18285 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
18286 The extension @samp{+neon-vfpv3} can be used as an alias for this extension.
18287
18288 @item +neon-fp16
18289 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
18290 the half-precision floating-point conversion operations.
18291
18292 @item +nosimd
18293 Disable the Advanced SIMD instructions (does not disable floating point).
18294
18295 @item +nofp
18296 Disable the floating-point and Advanced SIMD instructions.
18297 @end table
18298
18299 @item armv8-a
18300 @table @samp
18301 @item +crc
18302 The Cyclic Redundancy Check (CRC) instructions.
18303 @item +simd
18304 The ARMv8-A Advanced SIMD and floating-point instructions.
18305 @item +crypto
18306 The cryptographic instructions.
18307 @item +nocrypto
18308 Disable the cryptographic instructions.
18309 @item +nofp
18310 Disable the floating-point, Advanced SIMD and cryptographic instructions.
18311 @item +sb
18312 Speculation Barrier Instruction.
18313 @item +predres
18314 Execution and Data Prediction Restriction Instructions.
18315 @end table
18316
18317 @item armv8.1-a
18318 @table @samp
18319 @item +simd
18320 The ARMv8.1-A Advanced SIMD and floating-point instructions.
18321
18322 @item +crypto
18323 The cryptographic instructions.  This also enables the Advanced SIMD and
18324 floating-point instructions.
18325
18326 @item +nocrypto
18327 Disable the cryptographic instructions.
18328
18329 @item +nofp
18330 Disable the floating-point, Advanced SIMD and cryptographic instructions.
18331
18332 @item +sb
18333 Speculation Barrier Instruction.
18334
18335 @item +predres
18336 Execution and Data Prediction Restriction Instructions.
18337 @end table
18338
18339 @item armv8.2-a
18340 @itemx armv8.3-a
18341 @table @samp
18342 @item +fp16
18343 The half-precision floating-point data processing instructions.
18344 This also enables the Advanced SIMD and floating-point instructions.
18345
18346 @item +fp16fml
18347 The half-precision floating-point fmla extension.  This also enables
18348 the half-precision floating-point extension and Advanced SIMD and
18349 floating-point instructions.
18350
18351 @item +simd
18352 The ARMv8.1-A Advanced SIMD and floating-point instructions.
18353
18354 @item +crypto
18355 The cryptographic instructions.  This also enables the Advanced SIMD and
18356 floating-point instructions.
18357
18358 @item +dotprod
18359 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
18360
18361 @item +nocrypto
18362 Disable the cryptographic extension.
18363
18364 @item +nofp
18365 Disable the floating-point, Advanced SIMD and cryptographic instructions.
18366
18367 @item +sb
18368 Speculation Barrier Instruction.
18369
18370 @item +predres
18371 Execution and Data Prediction Restriction Instructions.
18372
18373 @item +i8mm
18374 8-bit Integer Matrix Multiply instructions.
18375 This also enables Advanced SIMD and floating-point instructions.
18376
18377 @item +bf16
18378 Brain half-precision floating-point instructions.
18379 This also enables Advanced SIMD and floating-point instructions.
18380 @end table
18381
18382 @item armv8.4-a
18383 @table @samp
18384 @item +fp16
18385 The half-precision floating-point data processing instructions.
18386 This also enables the Advanced SIMD and floating-point instructions as well
18387 as the Dot Product extension and the half-precision floating-point fmla
18388 extension.
18389
18390 @item +simd
18391 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
18392 Dot Product extension.
18393
18394 @item +crypto
18395 The cryptographic instructions.  This also enables the Advanced SIMD and
18396 floating-point instructions as well as the Dot Product extension.
18397
18398 @item +nocrypto
18399 Disable the cryptographic extension.
18400
18401 @item +nofp
18402 Disable the floating-point, Advanced SIMD and cryptographic instructions.
18403
18404 @item +sb
18405 Speculation Barrier Instruction.
18406
18407 @item +predres
18408 Execution and Data Prediction Restriction Instructions.
18409
18410 @item +i8mm
18411 8-bit Integer Matrix Multiply instructions.
18412 This also enables Advanced SIMD and floating-point instructions.
18413
18414 @item +bf16
18415 Brain half-precision floating-point instructions.
18416 This also enables Advanced SIMD and floating-point instructions.
18417 @end table
18418
18419 @item armv8.5-a
18420 @table @samp
18421 @item +fp16
18422 The half-precision floating-point data processing instructions.
18423 This also enables the Advanced SIMD and floating-point instructions as well
18424 as the Dot Product extension and the half-precision floating-point fmla
18425 extension.
18426
18427 @item +simd
18428 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
18429 Dot Product extension.
18430
18431 @item +crypto
18432 The cryptographic instructions.  This also enables the Advanced SIMD and
18433 floating-point instructions as well as the Dot Product extension.
18434
18435 @item +nocrypto
18436 Disable the cryptographic extension.
18437
18438 @item +nofp
18439 Disable the floating-point, Advanced SIMD and cryptographic instructions.
18440
18441 @item +i8mm
18442 8-bit Integer Matrix Multiply instructions.
18443 This also enables Advanced SIMD and floating-point instructions.
18444
18445 @item +bf16
18446 Brain half-precision floating-point instructions.
18447 This also enables Advanced SIMD and floating-point instructions.
18448 @end table
18449
18450 @item armv8.6-a
18451 @table @samp
18452 @item +fp16
18453 The half-precision floating-point data processing instructions.
18454 This also enables the Advanced SIMD and floating-point instructions as well
18455 as the Dot Product extension and the half-precision floating-point fmla
18456 extension.
18457
18458 @item +simd
18459 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
18460 Dot Product extension.
18461
18462 @item +crypto
18463 The cryptographic instructions.  This also enables the Advanced SIMD and
18464 floating-point instructions as well as the Dot Product extension.
18465
18466 @item +nocrypto
18467 Disable the cryptographic extension.
18468
18469 @item +nofp
18470 Disable the floating-point, Advanced SIMD and cryptographic instructions.
18471
18472 @item +i8mm
18473 8-bit Integer Matrix Multiply instructions.
18474 This also enables Advanced SIMD and floating-point instructions.
18475
18476 @item +bf16
18477 Brain half-precision floating-point instructions.
18478 This also enables Advanced SIMD and floating-point instructions.
18479 @end table
18480
18481 @item armv7-r
18482 @table @samp
18483 @item +fp.sp
18484 The single-precision VFPv3 floating-point instructions.  The extension
18485 @samp{+vfpv3xd} can be used as an alias for this extension.
18486
18487 @item +fp
18488 The VFPv3 floating-point instructions with 16 double-precision registers.
18489 The extension +vfpv3-d16 can be used as an alias for this extension.
18490
18491 @item +vfpv3xd-d16-fp16
18492 The single-precision VFPv3 floating-point instructions with 16 double-precision
18493 registers and the half-precision floating-point conversion operations.
18494
18495 @item +vfpv3-d16-fp16
18496 The VFPv3 floating-point instructions with 16 double-precision
18497 registers and the half-precision floating-point conversion operations.
18498
18499 @item +nofp
18500 Disable the floating-point extension.
18501
18502 @item +idiv
18503 The ARM-state integer division instructions.
18504
18505 @item +noidiv
18506 Disable the ARM-state integer division extension.
18507 @end table
18508
18509 @item armv7e-m
18510 @table @samp
18511 @item +fp
18512 The single-precision VFPv4 floating-point instructions.
18513
18514 @item +fpv5
18515 The single-precision FPv5 floating-point instructions.
18516
18517 @item +fp.dp
18518 The single- and double-precision FPv5 floating-point instructions.
18519
18520 @item +nofp
18521 Disable the floating-point extensions.
18522 @end table
18523
18524 @item  armv8.1-m.main
18525 @table @samp
18526
18527 @item +dsp
18528 The DSP instructions.
18529
18530 @item +mve
18531 The M-Profile Vector Extension (MVE) integer instructions.
18532
18533 @item +mve.fp
18534 The M-Profile Vector Extension (MVE) integer and single precision
18535 floating-point instructions.
18536
18537 @item +fp
18538 The single-precision floating-point instructions.
18539
18540 @item +fp.dp
18541 The single- and double-precision floating-point instructions.
18542
18543 @item +nofp
18544 Disable the floating-point extension.
18545 @end table
18546
18547 @item  armv8-m.main
18548 @table @samp
18549 @item +dsp
18550 The DSP instructions.
18551
18552 @item +nodsp
18553 Disable the DSP extension.
18554
18555 @item +fp
18556 The single-precision floating-point instructions.
18557
18558 @item +fp.dp
18559 The single- and double-precision floating-point instructions.
18560
18561 @item +nofp
18562 Disable the floating-point extension.
18563 @end table
18564
18565 @item armv8-r
18566 @table @samp
18567 @item +crc
18568 The Cyclic Redundancy Check (CRC) instructions.
18569 @item +fp.sp
18570 The single-precision FPv5 floating-point instructions.
18571 @item +simd
18572 The ARMv8-A Advanced SIMD and floating-point instructions.
18573 @item +crypto
18574 The cryptographic instructions.
18575 @item +nocrypto
18576 Disable the cryptographic instructions.
18577 @item +nofp
18578 Disable the floating-point, Advanced SIMD and cryptographic instructions.
18579 @end table
18580
18581 @end table
18582
18583 @option{-march=native} causes the compiler to auto-detect the architecture
18584 of the build computer.  At present, this feature is only supported on
18585 GNU/Linux, and not all architectures are recognized.  If the auto-detect
18586 is unsuccessful the option has no effect.
18587
18588 @item -mtune=@var{name}
18589 @opindex mtune
18590 This option specifies the name of the target ARM processor for
18591 which GCC should tune the performance of the code.
18592 For some ARM implementations better performance can be obtained by using
18593 this option.
18594 Permissible names are: @samp{arm7tdmi}, @samp{arm7tdmi-s}, @samp{arm710t},
18595 @samp{arm720t}, @samp{arm740t}, @samp{strongarm}, @samp{strongarm110},
18596 @samp{strongarm1100}, 0@samp{strongarm1110}, @samp{arm8}, @samp{arm810},
18597 @samp{arm9}, @samp{arm9e}, @samp{arm920}, @samp{arm920t}, @samp{arm922t},
18598 @samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm926ej-s},
18599 @samp{arm940t}, @samp{arm9tdmi}, @samp{arm10tdmi}, @samp{arm1020t},
18600 @samp{arm1026ej-s}, @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
18601 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
18602 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
18603 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
18604 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
18605 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
18606 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
18607 @samp{cortex-a76}, @samp{cortex-a76ae}, @samp{cortex-a77},
18608 @samp{ares}, @samp{cortex-r4}, @samp{cortex-r4f},
18609 @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8}, @samp{cortex-r52},
18610 @samp{cortex-m0}, @samp{cortex-m0plus}, @samp{cortex-m1}, @samp{cortex-m3},
18611 @samp{cortex-m4}, @samp{cortex-m7}, @samp{cortex-m23}, @samp{cortex-m33},
18612 @samp{cortex-m35p},
18613 @samp{cortex-m1.small-multiply}, @samp{cortex-m0.small-multiply},
18614 @samp{cortex-m0plus.small-multiply}, @samp{exynos-m1}, @samp{marvell-pj4},
18615 @samp{neoverse-n1}, @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2},
18616 @samp{ep9312}, @samp{fa526}, @samp{fa626}, @samp{fa606te}, @samp{fa626te},
18617 @samp{fmp626}, @samp{fa726te}, @samp{xgene1}.
18618
18619 Additionally, this option can specify that GCC should tune the performance
18620 of the code for a big.LITTLE system.  Permissible names are:
18621 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
18622 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
18623 @samp{cortex-a72.cortex-a35}, @samp{cortex-a73.cortex-a53},
18624 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55}.
18625
18626 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
18627 performance for a blend of processors within architecture @var{arch}.
18628 The aim is to generate code that run well on the current most popular
18629 processors, balancing between optimizations that benefit some CPUs in the
18630 range, and avoiding performance pitfalls of other CPUs.  The effects of
18631 this option may change in future GCC versions as CPU models come and go.
18632
18633 @option{-mtune} permits the same extension options as @option{-mcpu}, but
18634 the extension options do not affect the tuning of the generated code.
18635
18636 @option{-mtune=native} causes the compiler to auto-detect the CPU
18637 of the build computer.  At present, this feature is only supported on
18638 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
18639 unsuccessful the option has no effect.
18640
18641 @item -mcpu=@var{name}@r{[}+extension@dots{}@r{]}
18642 @opindex mcpu
18643 This specifies the name of the target ARM processor.  GCC uses this name
18644 to derive the name of the target ARM architecture (as if specified
18645 by @option{-march}) and the ARM processor type for which to tune for
18646 performance (as if specified by @option{-mtune}).  Where this option
18647 is used in conjunction with @option{-march} or @option{-mtune},
18648 those options take precedence over the appropriate part of this option.
18649
18650 Many of the supported CPUs implement optional architectural
18651 extensions.  Where this is so the architectural extensions are
18652 normally enabled by default.  If implementations that lack the
18653 extension exist, then the extension syntax can be used to disable
18654 those extensions that have been omitted.  For floating-point and
18655 Advanced SIMD (Neon) instructions, the settings of the options
18656 @option{-mfloat-abi} and @option{-mfpu} must also be considered:
18657 floating-point and Advanced SIMD instructions will only be used if
18658 @option{-mfloat-abi} is not set to @samp{soft}; and any setting of
18659 @option{-mfpu} other than @samp{auto} will override the available
18660 floating-point and SIMD extension instructions.
18661
18662 For example, @samp{cortex-a9} can be found in three major
18663 configurations: integer only, with just a floating-point unit or with
18664 floating-point and Advanced SIMD.  The default is to enable all the
18665 instructions, but the extensions @samp{+nosimd} and @samp{+nofp} can
18666 be used to disable just the SIMD or both the SIMD and floating-point
18667 instructions respectively.
18668
18669 Permissible names for this option are the same as those for
18670 @option{-mtune}.
18671
18672 The following extension options are common to the listed CPUs:
18673
18674 @table @samp
18675 @item +nodsp
18676 Disable the DSP instructions on @samp{cortex-m33}, @samp{cortex-m35p}.
18677
18678 @item  +nofp
18679 Disables the floating-point instructions on @samp{arm9e},
18680 @samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm10e},
18681 @samp{arm1020e}, @samp{arm1022e}, @samp{arm926ej-s},
18682 @samp{arm1026ej-s}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
18683 @samp{cortex-m4}, @samp{cortex-m7}, @samp{cortex-m33} and @samp{cortex-m35p}.
18684 Disables the floating-point and SIMD instructions on
18685 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7},
18686 @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a12},
18687 @samp{cortex-a15}, @samp{cortex-a17}, @samp{cortex-a15.cortex-a7},
18688 @samp{cortex-a17.cortex-a7}, @samp{cortex-a32}, @samp{cortex-a35},
18689 @samp{cortex-a53} and @samp{cortex-a55}.
18690
18691 @item +nofp.dp
18692 Disables the double-precision component of the floating-point instructions
18693 on @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8}, @samp{cortex-r52} and
18694 @samp{cortex-m7}.
18695
18696 @item +nosimd
18697 Disables the SIMD (but not floating-point) instructions on
18698 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}
18699 and @samp{cortex-a9}.
18700
18701 @item +crypto
18702 Enables the cryptographic instructions on @samp{cortex-a32},
18703 @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55}, @samp{cortex-a57},
18704 @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75}, @samp{exynos-m1},
18705 @samp{xgene1}, @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
18706 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53} and
18707 @samp{cortex-a75.cortex-a55}.
18708 @end table
18709
18710 Additionally the @samp{generic-armv7-a} pseudo target defaults to
18711 VFPv3 with 16 double-precision registers.  It supports the following
18712 extension options: @samp{mp}, @samp{sec}, @samp{vfpv3-d16},
18713 @samp{vfpv3}, @samp{vfpv3-d16-fp16}, @samp{vfpv3-fp16},
18714 @samp{vfpv4-d16}, @samp{vfpv4}, @samp{neon}, @samp{neon-vfpv3},
18715 @samp{neon-fp16}, @samp{neon-vfpv4}.  The meanings are the same as for
18716 the extensions to @option{-march=armv7-a}.
18717
18718 @option{-mcpu=generic-@var{arch}} is also permissible, and is
18719 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
18720 See @option{-mtune} for more information.
18721
18722 @option{-mcpu=native} causes the compiler to auto-detect the CPU
18723 of the build computer.  At present, this feature is only supported on
18724 GNU/Linux, and not all architectures are recognized.  If the auto-detect
18725 is unsuccessful the option has no effect.
18726
18727 @item -mfpu=@var{name}
18728 @opindex mfpu
18729 This specifies what floating-point hardware (or hardware emulation) is
18730 available on the target.  Permissible names are: @samp{auto}, @samp{vfpv2},
18731 @samp{vfpv3},
18732 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
18733 @samp{vfpv3xd-fp16}, @samp{neon-vfpv3}, @samp{neon-fp16}, @samp{vfpv4},
18734 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
18735 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
18736 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
18737 Note that @samp{neon} is an alias for @samp{neon-vfpv3} and @samp{vfp}
18738 is an alias for @samp{vfpv2}.
18739
18740 The setting @samp{auto} is the default and is special.  It causes the
18741 compiler to select the floating-point and Advanced SIMD instructions
18742 based on the settings of @option{-mcpu} and @option{-march}.
18743
18744 If the selected floating-point hardware includes the NEON extension
18745 (e.g.@: @option{-mfpu=neon}), note that floating-point
18746 operations are not generated by GCC's auto-vectorization pass unless
18747 @option{-funsafe-math-optimizations} is also specified.  This is
18748 because NEON hardware does not fully implement the IEEE 754 standard for
18749 floating-point arithmetic (in particular denormal values are treated as
18750 zero), so the use of NEON instructions may lead to a loss of precision.
18751
18752 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}).
18753
18754 @item -mfp16-format=@var{name}
18755 @opindex mfp16-format
18756 Specify the format of the @code{__fp16} half-precision floating-point type.
18757 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
18758 the default is @samp{none}, in which case the @code{__fp16} type is not
18759 defined.  @xref{Half-Precision}, for more information.
18760
18761 @item -mstructure-size-boundary=@var{n}
18762 @opindex mstructure-size-boundary
18763 The sizes of all structures and unions are rounded up to a multiple
18764 of the number of bits set by this option.  Permissible values are 8, 32
18765 and 64.  The default value varies for different toolchains.  For the COFF
18766 targeted toolchain the default value is 8.  A value of 64 is only allowed
18767 if the underlying ABI supports it.
18768
18769 Specifying a larger number can produce faster, more efficient code, but
18770 can also increase the size of the program.  Different values are potentially
18771 incompatible.  Code compiled with one value cannot necessarily expect to
18772 work with code or libraries compiled with another value, if they exchange
18773 information using structures or unions.
18774
18775 This option is deprecated.
18776
18777 @item -mabort-on-noreturn
18778 @opindex mabort-on-noreturn
18779 Generate a call to the function @code{abort} at the end of a
18780 @code{noreturn} function.  It is executed if the function tries to
18781 return.
18782
18783 @item -mlong-calls
18784 @itemx -mno-long-calls
18785 @opindex mlong-calls
18786 @opindex mno-long-calls
18787 Tells the compiler to perform function calls by first loading the
18788 address of the function into a register and then performing a subroutine
18789 call on this register.  This switch is needed if the target function
18790 lies outside of the 64-megabyte addressing range of the offset-based
18791 version of subroutine call instruction.
18792
18793 Even if this switch is enabled, not all function calls are turned
18794 into long calls.  The heuristic is that static functions, functions
18795 that have the @code{short_call} attribute, functions that are inside
18796 the scope of a @code{#pragma no_long_calls} directive, and functions whose
18797 definitions have already been compiled within the current compilation
18798 unit are not turned into long calls.  The exceptions to this rule are
18799 that weak function definitions, functions with the @code{long_call}
18800 attribute or the @code{section} attribute, and functions that are within
18801 the scope of a @code{#pragma long_calls} directive are always
18802 turned into long calls.
18803
18804 This feature is not enabled by default.  Specifying
18805 @option{-mno-long-calls} restores the default behavior, as does
18806 placing the function calls within the scope of a @code{#pragma
18807 long_calls_off} directive.  Note these switches have no effect on how
18808 the compiler generates code to handle function calls via function
18809 pointers.
18810
18811 @item -msingle-pic-base
18812 @opindex msingle-pic-base
18813 Treat the register used for PIC addressing as read-only, rather than
18814 loading it in the prologue for each function.  The runtime system is
18815 responsible for initializing this register with an appropriate value
18816 before execution begins.
18817
18818 @item -mpic-register=@var{reg}
18819 @opindex mpic-register
18820 Specify the register to be used for PIC addressing.
18821 For standard PIC base case, the default is any suitable register
18822 determined by compiler.  For single PIC base case, the default is
18823 @samp{R9} if target is EABI based or stack-checking is enabled,
18824 otherwise the default is @samp{R10}.
18825
18826 @item -mpic-data-is-text-relative
18827 @opindex mpic-data-is-text-relative
18828 Assume that the displacement between the text and data segments is fixed
18829 at static link time.  This permits using PC-relative addressing
18830 operations to access data known to be in the data segment.  For
18831 non-VxWorks RTP targets, this option is enabled by default.  When
18832 disabled on such targets, it will enable @option{-msingle-pic-base} by
18833 default.
18834
18835 @item -mpoke-function-name
18836 @opindex mpoke-function-name
18837 Write the name of each function into the text section, directly
18838 preceding the function prologue.  The generated code is similar to this:
18839
18840 @smallexample
18841      t0
18842          .ascii "arm_poke_function_name", 0
18843          .align
18844      t1
18845          .word 0xff000000 + (t1 - t0)
18846      arm_poke_function_name
18847          mov     ip, sp
18848          stmfd   sp!, @{fp, ip, lr, pc@}
18849          sub     fp, ip, #4
18850 @end smallexample
18851
18852 When performing a stack backtrace, code can inspect the value of
18853 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
18854 location @code{pc - 12} and the top 8 bits are set, then we know that
18855 there is a function name embedded immediately preceding this location
18856 and has length @code{((pc[-3]) & 0xff000000)}.
18857
18858 @item -mthumb
18859 @itemx -marm
18860 @opindex marm
18861 @opindex mthumb
18862
18863 Select between generating code that executes in ARM and Thumb
18864 states.  The default for most configurations is to generate code
18865 that executes in ARM state, but the default can be changed by
18866 configuring GCC with the @option{--with-mode=}@var{state}
18867 configure option.
18868
18869 You can also override the ARM and Thumb mode for each function
18870 by using the @code{target("thumb")} and @code{target("arm")} function attributes
18871 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
18872
18873 @item -mflip-thumb 
18874 @opindex mflip-thumb
18875 Switch ARM/Thumb modes on alternating functions.
18876 This option is provided for regression testing of mixed Thumb/ARM code
18877 generation, and is not intended for ordinary use in compiling code.
18878
18879 @item -mtpcs-frame
18880 @opindex mtpcs-frame
18881 Generate a stack frame that is compliant with the Thumb Procedure Call
18882 Standard for all non-leaf functions.  (A leaf function is one that does
18883 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
18884
18885 @item -mtpcs-leaf-frame
18886 @opindex mtpcs-leaf-frame
18887 Generate a stack frame that is compliant with the Thumb Procedure Call
18888 Standard for all leaf functions.  (A leaf function is one that does
18889 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
18890
18891 @item -mcallee-super-interworking
18892 @opindex mcallee-super-interworking
18893 Gives all externally visible functions in the file being compiled an ARM
18894 instruction set header which switches to Thumb mode before executing the
18895 rest of the function.  This allows these functions to be called from
18896 non-interworking code.  This option is not valid in AAPCS configurations
18897 because interworking is enabled by default.
18898
18899 @item -mcaller-super-interworking
18900 @opindex mcaller-super-interworking
18901 Allows calls via function pointers (including virtual functions) to
18902 execute correctly regardless of whether the target code has been
18903 compiled for interworking or not.  There is a small overhead in the cost
18904 of executing a function pointer if this option is enabled.  This option
18905 is not valid in AAPCS configurations because interworking is enabled
18906 by default.
18907
18908 @item -mtp=@var{name}
18909 @opindex mtp
18910 Specify the access model for the thread local storage pointer.  The valid
18911 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
18912 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
18913 (supported in the arm6k architecture), and @samp{auto}, which uses the
18914 best available method for the selected processor.  The default setting is
18915 @samp{auto}.
18916
18917 @item -mtls-dialect=@var{dialect}
18918 @opindex mtls-dialect
18919 Specify the dialect to use for accessing thread local storage.  Two
18920 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
18921 @samp{gnu} dialect selects the original GNU scheme for supporting
18922 local and global dynamic TLS models.  The @samp{gnu2} dialect
18923 selects the GNU descriptor scheme, which provides better performance
18924 for shared libraries.  The GNU descriptor scheme is compatible with
18925 the original scheme, but does require new assembler, linker and
18926 library support.  Initial and local exec TLS models are unaffected by
18927 this option and always use the original scheme.
18928
18929 @item -mword-relocations
18930 @opindex mword-relocations
18931 Only generate absolute relocations on word-sized values (i.e.@: R_ARM_ABS32).
18932 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
18933 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
18934 is specified. This option conflicts with @option{-mslow-flash-data}.
18935
18936 @item -mfix-cortex-m3-ldrd
18937 @opindex mfix-cortex-m3-ldrd
18938 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
18939 with overlapping destination and base registers are used.  This option avoids
18940 generating these instructions.  This option is enabled by default when
18941 @option{-mcpu=cortex-m3} is specified.
18942
18943 @item -munaligned-access
18944 @itemx -mno-unaligned-access
18945 @opindex munaligned-access
18946 @opindex mno-unaligned-access
18947 Enables (or disables) reading and writing of 16- and 32- bit values
18948 from addresses that are not 16- or 32- bit aligned.  By default
18949 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
18950 ARMv8-M Baseline architectures, and enabled for all other
18951 architectures.  If unaligned access is not enabled then words in packed
18952 data structures are accessed a byte at a time.
18953
18954 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
18955 generated object file to either true or false, depending upon the
18956 setting of this option.  If unaligned access is enabled then the
18957 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
18958 defined.
18959
18960 @item -mneon-for-64bits
18961 @opindex mneon-for-64bits
18962 This option is deprecated and has no effect.
18963
18964 @item -mslow-flash-data
18965 @opindex mslow-flash-data
18966 Assume loading data from flash is slower than fetching instruction.
18967 Therefore literal load is minimized for better performance.
18968 This option is only supported when compiling for ARMv7 M-profile and
18969 off by default. It conflicts with @option{-mword-relocations}.
18970
18971 @item -masm-syntax-unified
18972 @opindex masm-syntax-unified
18973 Assume inline assembler is using unified asm syntax.  The default is
18974 currently off which implies divided syntax.  This option has no impact
18975 on Thumb2. However, this may change in future releases of GCC.
18976 Divided syntax should be considered deprecated.
18977
18978 @item -mrestrict-it
18979 @opindex mrestrict-it
18980 Restricts generation of IT blocks to conform to the rules of ARMv8-A.
18981 IT blocks can only contain a single 16-bit instruction from a select
18982 set of instructions. This option is on by default for ARMv8-A Thumb mode.
18983
18984 @item -mprint-tune-info
18985 @opindex mprint-tune-info
18986 Print CPU tuning information as comment in assembler file.  This is
18987 an option used only for regression testing of the compiler and not
18988 intended for ordinary use in compiling code.  This option is disabled
18989 by default.
18990
18991 @item -mverbose-cost-dump
18992 @opindex mverbose-cost-dump
18993 Enable verbose cost model dumping in the debug dump files.  This option is
18994 provided for use in debugging the compiler.
18995
18996 @item -mpure-code
18997 @opindex mpure-code
18998 Do not allow constant data to be placed in code sections.
18999 Additionally, when compiling for ELF object format give all text sections the
19000 ELF processor-specific section attribute @code{SHF_ARM_PURECODE}.  This option
19001 is only available when generating non-pic code for M-profile targets.
19002
19003 @item -mcmse
19004 @opindex mcmse
19005 Generate secure code as per the "ARMv8-M Security Extensions: Requirements on
19006 Development Tools Engineering Specification", which can be found on
19007 @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}.
19008
19009 @item -mfdpic
19010 @itemx -mno-fdpic
19011 @opindex mfdpic
19012 @opindex mno-fdpic
19013 Select the FDPIC ABI, which uses 64-bit function descriptors to
19014 represent pointers to functions.  When the compiler is configured for
19015 @code{arm-*-uclinuxfdpiceabi} targets, this option is on by default
19016 and implies @option{-fPIE} if none of the PIC/PIE-related options is
19017 provided.  On other targets, it only enables the FDPIC-specific code
19018 generation features, and the user should explicitly provide the
19019 PIC/PIE-related options as needed.
19020
19021 Note that static linking is not supported because it would still
19022 involve the dynamic linker when the program self-relocates.  If such
19023 behavior is acceptable, use -static and -Wl,-dynamic-linker options.
19024
19025 The opposite @option{-mno-fdpic} option is useful (and required) to
19026 build the Linux kernel using the same (@code{arm-*-uclinuxfdpiceabi})
19027 toolchain as the one used to build the userland programs.
19028
19029 @end table
19030
19031 @node AVR Options
19032 @subsection AVR Options
19033 @cindex AVR Options
19034
19035 These options are defined for AVR implementations:
19036
19037 @table @gcctabopt
19038 @item -mmcu=@var{mcu}
19039 @opindex mmcu
19040 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
19041
19042 The default for this option is@tie{}@samp{avr2}.
19043
19044 GCC supports the following AVR devices and ISAs:
19045
19046 @include avr-mmcu.texi
19047
19048 @item -mabsdata
19049 @opindex mabsdata
19050
19051 Assume that all data in static storage can be accessed by LDS / STS
19052 instructions.  This option has only an effect on reduced Tiny devices like
19053 ATtiny40.  See also the @code{absdata}
19054 @ref{AVR Variable Attributes,variable attribute}.
19055
19056 @item -maccumulate-args
19057 @opindex maccumulate-args
19058 Accumulate outgoing function arguments and acquire/release the needed
19059 stack space for outgoing function arguments once in function
19060 prologue/epilogue.  Without this option, outgoing arguments are pushed
19061 before calling a function and popped afterwards.
19062
19063 Popping the arguments after the function call can be expensive on
19064 AVR so that accumulating the stack space might lead to smaller
19065 executables because arguments need not be removed from the
19066 stack after such a function call.
19067
19068 This option can lead to reduced code size for functions that perform
19069 several calls to functions that get their arguments on the stack like
19070 calls to printf-like functions.
19071
19072 @item -mbranch-cost=@var{cost}
19073 @opindex mbranch-cost
19074 Set the branch costs for conditional branch instructions to
19075 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
19076 integers. The default branch cost is 0.
19077
19078 @item -mcall-prologues
19079 @opindex mcall-prologues
19080 Functions prologues/epilogues are expanded as calls to appropriate
19081 subroutines.  Code size is smaller.
19082
19083 @item -mdouble=@var{bits}
19084 @itemx -mlong-double=@var{bits}
19085 @opindex mdouble
19086 @opindex mlong-double
19087 Set the size (in bits) of the @code{double} or @code{long double} type,
19088 respectively.  Possible values for @var{bits} are 32 and 64.
19089 Whether or not a specific value for @var{bits} is allowed depends on
19090 the @code{--with-double=} and @code{--with-long-double=}
19091 @w{@uref{https://gcc.gnu.org/install/configure.html#avr,configure options}},
19092 and the same applies for the default values of the options.
19093
19094 @item -mgas-isr-prologues
19095 @opindex mgas-isr-prologues
19096 Interrupt service routines (ISRs) may use the @code{__gcc_isr} pseudo
19097 instruction supported by GNU Binutils.
19098 If this option is on, the feature can still be disabled for individual
19099 ISRs by means of the @ref{AVR Function Attributes,,@code{no_gccisr}}
19100 function attribute.  This feature is activated per default
19101 if optimization is on (but not with @option{-Og}, @pxref{Optimize Options}),
19102 and if GNU Binutils support @w{@uref{https://sourceware.org/PR21683,PR21683}}.
19103
19104 @item -mint8
19105 @opindex mint8
19106 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
19107 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
19108 and @code{long long} is 4 bytes.  Please note that this option does not
19109 conform to the C standards, but it results in smaller code
19110 size.
19111
19112 @item -mmain-is-OS_task
19113 @opindex mmain-is-OS_task
19114 Do not save registers in @code{main}.  The effect is the same like
19115 attaching attribute @ref{AVR Function Attributes,,@code{OS_task}}
19116 to @code{main}. It is activated per default if optimization is on.
19117
19118 @item -mn-flash=@var{num}
19119 @opindex mn-flash
19120 Assume that the flash memory has a size of 
19121 @var{num} times 64@tie{}KiB.
19122
19123 @item -mno-interrupts
19124 @opindex mno-interrupts
19125 Generated code is not compatible with hardware interrupts.
19126 Code size is smaller.
19127
19128 @item -mrelax
19129 @opindex mrelax
19130 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
19131 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
19132 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
19133 the assembler's command line and the @option{--relax} option to the
19134 linker's command line.
19135
19136 Jump relaxing is performed by the linker because jump offsets are not
19137 known before code is located. Therefore, the assembler code generated by the
19138 compiler is the same, but the instructions in the executable may
19139 differ from instructions in the assembler code.
19140
19141 Relaxing must be turned on if linker stubs are needed, see the
19142 section on @code{EIND} and linker stubs below.
19143
19144 @item -mrmw
19145 @opindex mrmw
19146 Assume that the device supports the Read-Modify-Write
19147 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
19148
19149 @item -mshort-calls
19150 @opindex mshort-calls
19151
19152 Assume that @code{RJMP} and @code{RCALL} can target the whole
19153 program memory.
19154
19155 This option is used internally for multilib selection.  It is
19156 not an optimization option, and you don't need to set it by hand.
19157
19158 @item -msp8
19159 @opindex msp8
19160 Treat the stack pointer register as an 8-bit register,
19161 i.e.@: assume the high byte of the stack pointer is zero.
19162 In general, you don't need to set this option by hand.
19163
19164 This option is used internally by the compiler to select and
19165 build multilibs for architectures @code{avr2} and @code{avr25}.
19166 These architectures mix devices with and without @code{SPH}.
19167 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
19168 the compiler driver adds or removes this option from the compiler
19169 proper's command line, because the compiler then knows if the device
19170 or architecture has an 8-bit stack pointer and thus no @code{SPH}
19171 register or not.
19172
19173 @item -mstrict-X
19174 @opindex mstrict-X
19175 Use address register @code{X} in a way proposed by the hardware.  This means
19176 that @code{X} is only used in indirect, post-increment or
19177 pre-decrement addressing.
19178
19179 Without this option, the @code{X} register may be used in the same way
19180 as @code{Y} or @code{Z} which then is emulated by additional
19181 instructions.  
19182 For example, loading a value with @code{X+const} addressing with a
19183 small non-negative @code{const < 64} to a register @var{Rn} is
19184 performed as
19185
19186 @example
19187 adiw r26, const   ; X += const
19188 ld   @var{Rn}, X        ; @var{Rn} = *X
19189 sbiw r26, const   ; X -= const
19190 @end example
19191
19192 @item -mtiny-stack
19193 @opindex mtiny-stack
19194 Only change the lower 8@tie{}bits of the stack pointer.
19195
19196 @item -mfract-convert-truncate
19197 @opindex mfract-convert-truncate
19198 Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
19199
19200 @item -nodevicelib
19201 @opindex nodevicelib
19202 Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
19203
19204 @item -nodevicespecs
19205 @opindex nodevicespecs
19206 Don't add @option{-specs=device-specs/specs-@var{mcu}} to the compiler driver's
19207 command line.  The user takes responsibility for supplying the sub-processes
19208 like compiler proper, assembler and linker with appropriate command line
19209 options.  This means that the user has to supply her private device specs
19210 file by means of @option{-specs=@var{path-to-specs-file}}.  There is no
19211 more need for option @option{-mmcu=@var{mcu}}.
19212
19213 This option can also serve as a replacement for the older way of
19214 specifying custom device-specs files that needed @option{-B @var{some-path}} to point to a directory
19215 which contains a folder named @code{device-specs} which contains a specs file named
19216 @code{specs-@var{mcu}}, where @var{mcu} was specified by @option{-mmcu=@var{mcu}}.
19217
19218 @item -Waddr-space-convert
19219 @opindex Waddr-space-convert
19220 @opindex Wno-addr-space-convert
19221 Warn about conversions between address spaces in the case where the
19222 resulting address space is not contained in the incoming address space.
19223
19224 @item -Wmisspelled-isr
19225 @opindex Wmisspelled-isr
19226 @opindex Wno-misspelled-isr
19227 Warn if the ISR is misspelled, i.e.@: without __vector prefix.
19228 Enabled by default.
19229 @end table
19230
19231 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
19232 @cindex @code{EIND}
19233 Pointers in the implementation are 16@tie{}bits wide.
19234 The address of a function or label is represented as word address so
19235 that indirect jumps and calls can target any code address in the
19236 range of 64@tie{}Ki words.
19237
19238 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
19239 bytes of program memory space, there is a special function register called
19240 @code{EIND} that serves as most significant part of the target address
19241 when @code{EICALL} or @code{EIJMP} instructions are used.
19242
19243 Indirect jumps and calls on these devices are handled as follows by
19244 the compiler and are subject to some limitations:
19245
19246 @itemize @bullet
19247
19248 @item
19249 The compiler never sets @code{EIND}.
19250
19251 @item
19252 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
19253 instructions or might read @code{EIND} directly in order to emulate an
19254 indirect call/jump by means of a @code{RET} instruction.
19255
19256 @item
19257 The compiler assumes that @code{EIND} never changes during the startup
19258 code or during the application. In particular, @code{EIND} is not
19259 saved/restored in function or interrupt service routine
19260 prologue/epilogue.
19261
19262 @item
19263 For indirect calls to functions and computed goto, the linker
19264 generates @emph{stubs}. Stubs are jump pads sometimes also called
19265 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
19266 The stub contains a direct jump to the desired address.
19267
19268 @item
19269 Linker relaxation must be turned on so that the linker generates
19270 the stubs correctly in all situations. See the compiler option
19271 @option{-mrelax} and the linker option @option{--relax}.
19272 There are corner cases where the linker is supposed to generate stubs
19273 but aborts without relaxation and without a helpful error message.
19274
19275 @item
19276 The default linker script is arranged for code with @code{EIND = 0}.
19277 If code is supposed to work for a setup with @code{EIND != 0}, a custom
19278 linker script has to be used in order to place the sections whose
19279 name start with @code{.trampolines} into the segment where @code{EIND}
19280 points to.
19281
19282 @item
19283 The startup code from libgcc never sets @code{EIND}.
19284 Notice that startup code is a blend of code from libgcc and AVR-LibC.
19285 For the impact of AVR-LibC on @code{EIND}, see the
19286 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
19287
19288 @item
19289 It is legitimate for user-specific startup code to set up @code{EIND}
19290 early, for example by means of initialization code located in
19291 section @code{.init3}. Such code runs prior to general startup code
19292 that initializes RAM and calls constructors, but after the bit
19293 of startup code from AVR-LibC that sets @code{EIND} to the segment
19294 where the vector table is located.
19295 @example
19296 #include <avr/io.h>
19297
19298 static void
19299 __attribute__((section(".init3"),naked,used,no_instrument_function))
19300 init3_set_eind (void)
19301 @{
19302   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
19303                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
19304 @}
19305 @end example
19306
19307 @noindent
19308 The @code{__trampolines_start} symbol is defined in the linker script.
19309
19310 @item
19311 Stubs are generated automatically by the linker if
19312 the following two conditions are met:
19313 @itemize @minus
19314
19315 @item The address of a label is taken by means of the @code{gs} modifier
19316 (short for @emph{generate stubs}) like so:
19317 @example
19318 LDI r24, lo8(gs(@var{func}))
19319 LDI r25, hi8(gs(@var{func}))
19320 @end example
19321 @item The final location of that label is in a code segment
19322 @emph{outside} the segment where the stubs are located.
19323 @end itemize
19324
19325 @item
19326 The compiler emits such @code{gs} modifiers for code labels in the
19327 following situations:
19328 @itemize @minus
19329 @item Taking address of a function or code label.
19330 @item Computed goto.
19331 @item If prologue-save function is used, see @option{-mcall-prologues}
19332 command-line option.
19333 @item Switch/case dispatch tables. If you do not want such dispatch
19334 tables you can specify the @option{-fno-jump-tables} command-line option.
19335 @item C and C++ constructors/destructors called during startup/shutdown.
19336 @item If the tools hit a @code{gs()} modifier explained above.
19337 @end itemize
19338
19339 @item
19340 Jumping to non-symbolic addresses like so is @emph{not} supported:
19341
19342 @example
19343 int main (void)
19344 @{
19345     /* Call function at word address 0x2 */
19346     return ((int(*)(void)) 0x2)();
19347 @}
19348 @end example
19349
19350 Instead, a stub has to be set up, i.e.@: the function has to be called
19351 through a symbol (@code{func_4} in the example):
19352
19353 @example
19354 int main (void)
19355 @{
19356     extern int func_4 (void);
19357
19358     /* Call function at byte address 0x4 */
19359     return func_4();
19360 @}
19361 @end example
19362
19363 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
19364 Alternatively, @code{func_4} can be defined in the linker script.
19365 @end itemize
19366
19367 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
19368 @cindex @code{RAMPD}
19369 @cindex @code{RAMPX}
19370 @cindex @code{RAMPY}
19371 @cindex @code{RAMPZ}
19372 Some AVR devices support memories larger than the 64@tie{}KiB range
19373 that can be accessed with 16-bit pointers.  To access memory locations
19374 outside this 64@tie{}KiB range, the content of a @code{RAMP}
19375 register is used as high part of the address:
19376 The @code{X}, @code{Y}, @code{Z} address register is concatenated
19377 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
19378 register, respectively, to get a wide address. Similarly,
19379 @code{RAMPD} is used together with direct addressing.
19380
19381 @itemize
19382 @item
19383 The startup code initializes the @code{RAMP} special function
19384 registers with zero.
19385
19386 @item
19387 If a @ref{AVR Named Address Spaces,named address space} other than
19388 generic or @code{__flash} is used, then @code{RAMPZ} is set
19389 as needed before the operation.
19390
19391 @item
19392 If the device supports RAM larger than 64@tie{}KiB and the compiler
19393 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
19394 is reset to zero after the operation.
19395
19396 @item
19397 If the device comes with a specific @code{RAMP} register, the ISR
19398 prologue/epilogue saves/restores that SFR and initializes it with
19399 zero in case the ISR code might (implicitly) use it.
19400
19401 @item
19402 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
19403 If you use inline assembler to read from locations outside the
19404 16-bit address range and change one of the @code{RAMP} registers,
19405 you must reset it to zero after the access.
19406
19407 @end itemize
19408
19409 @subsubsection AVR Built-in Macros
19410
19411 GCC defines several built-in macros so that the user code can test
19412 for the presence or absence of features.  Almost any of the following
19413 built-in macros are deduced from device capabilities and thus
19414 triggered by the @option{-mmcu=} command-line option.
19415
19416 For even more AVR-specific built-in macros see
19417 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
19418
19419 @table @code
19420
19421 @item __AVR_ARCH__
19422 Build-in macro that resolves to a decimal number that identifies the
19423 architecture and depends on the @option{-mmcu=@var{mcu}} option.
19424 Possible values are:
19425
19426 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
19427 @code{4}, @code{5}, @code{51}, @code{6}
19428
19429 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
19430 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
19431
19432 respectively and
19433
19434 @code{100},
19435 @code{102}, @code{103}, @code{104},
19436 @code{105}, @code{106}, @code{107}
19437
19438 for @var{mcu}=@code{avrtiny},
19439 @code{avrxmega2}, @code{avrxmega3}, @code{avrxmega4},
19440 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
19441 If @var{mcu} specifies a device, this built-in macro is set
19442 accordingly. For example, with @option{-mmcu=atmega8} the macro is
19443 defined to @code{4}.
19444
19445 @item __AVR_@var{Device}__
19446 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
19447 the device's name. For example, @option{-mmcu=atmega8} defines the
19448 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
19449 @code{__AVR_ATtiny261A__}, etc.
19450
19451 The built-in macros' names follow
19452 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
19453 the device name as from the AVR user manual. The difference between
19454 @var{Device} in the built-in macro and @var{device} in
19455 @option{-mmcu=@var{device}} is that the latter is always lowercase.
19456
19457 If @var{device} is not a device but only a core architecture like
19458 @samp{avr51}, this macro is not defined.
19459
19460 @item __AVR_DEVICE_NAME__
19461 Setting @option{-mmcu=@var{device}} defines this built-in macro to
19462 the device's name. For example, with @option{-mmcu=atmega8} the macro
19463 is defined to @code{atmega8}.
19464
19465 If @var{device} is not a device but only a core architecture like
19466 @samp{avr51}, this macro is not defined.
19467
19468 @item __AVR_XMEGA__
19469 The device / architecture belongs to the XMEGA family of devices.
19470
19471 @item __AVR_HAVE_ELPM__
19472 The device has the @code{ELPM} instruction.
19473
19474 @item __AVR_HAVE_ELPMX__
19475 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
19476 R@var{n},Z+} instructions.
19477
19478 @item __AVR_HAVE_MOVW__
19479 The device has the @code{MOVW} instruction to perform 16-bit
19480 register-register moves.
19481
19482 @item __AVR_HAVE_LPMX__
19483 The device has the @code{LPM R@var{n},Z} and
19484 @code{LPM R@var{n},Z+} instructions.
19485
19486 @item __AVR_HAVE_MUL__
19487 The device has a hardware multiplier. 
19488
19489 @item __AVR_HAVE_JMP_CALL__
19490 The device has the @code{JMP} and @code{CALL} instructions.
19491 This is the case for devices with more than 8@tie{}KiB of program
19492 memory.
19493
19494 @item __AVR_HAVE_EIJMP_EICALL__
19495 @itemx __AVR_3_BYTE_PC__
19496 The device has the @code{EIJMP} and @code{EICALL} instructions.
19497 This is the case for devices with more than 128@tie{}KiB of program memory.
19498 This also means that the program counter
19499 (PC) is 3@tie{}bytes wide.
19500
19501 @item __AVR_2_BYTE_PC__
19502 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
19503 with up to 128@tie{}KiB of program memory.
19504
19505 @item __AVR_HAVE_8BIT_SP__
19506 @itemx __AVR_HAVE_16BIT_SP__
19507 The stack pointer (SP) register is treated as 8-bit respectively
19508 16-bit register by the compiler.
19509 The definition of these macros is affected by @option{-mtiny-stack}.
19510
19511 @item __AVR_HAVE_SPH__
19512 @itemx __AVR_SP8__
19513 The device has the SPH (high part of stack pointer) special function
19514 register or has an 8-bit stack pointer, respectively.
19515 The definition of these macros is affected by @option{-mmcu=} and
19516 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
19517 by @option{-msp8}.
19518
19519 @item __AVR_HAVE_RAMPD__
19520 @itemx __AVR_HAVE_RAMPX__
19521 @itemx __AVR_HAVE_RAMPY__
19522 @itemx __AVR_HAVE_RAMPZ__
19523 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
19524 @code{RAMPZ} special function register, respectively.
19525
19526 @item __NO_INTERRUPTS__
19527 This macro reflects the @option{-mno-interrupts} command-line option.
19528
19529 @item __AVR_ERRATA_SKIP__
19530 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
19531 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
19532 instructions because of a hardware erratum.  Skip instructions are
19533 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
19534 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
19535 set.
19536
19537 @item __AVR_ISA_RMW__
19538 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
19539
19540 @item __AVR_SFR_OFFSET__=@var{offset}
19541 Instructions that can address I/O special function registers directly
19542 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
19543 address as if addressed by an instruction to access RAM like @code{LD}
19544 or @code{STS}. This offset depends on the device architecture and has
19545 to be subtracted from the RAM address in order to get the
19546 respective I/O@tie{}address.
19547
19548 @item __AVR_SHORT_CALLS__
19549 The @option{-mshort-calls} command line option is set.
19550
19551 @item __AVR_PM_BASE_ADDRESS__=@var{addr}
19552 Some devices support reading from flash memory by means of @code{LD*}
19553 instructions.  The flash memory is seen in the data address space
19554 at an offset of @code{__AVR_PM_BASE_ADDRESS__}.  If this macro
19555 is not defined, this feature is not available.  If defined,
19556 the address space is linear and there is no need to put
19557 @code{.rodata} into RAM.  This is handled by the default linker
19558 description file, and is currently available for
19559 @code{avrtiny} and @code{avrxmega3}.  Even more convenient,
19560 there is no need to use address spaces like @code{__flash} or
19561 features like attribute @code{progmem} and @code{pgm_read_*}.
19562
19563 @item __WITH_AVRLIBC__
19564 The compiler is configured to be used together with AVR-Libc.
19565 See the @option{--with-avrlibc} configure option.
19566
19567 @item __HAVE_DOUBLE_MULTILIB__
19568 Defined if @option{-mdouble=} acts as a multilib option.
19569
19570 @item __HAVE_DOUBLE32__
19571 @itemx __HAVE_DOUBLE64__
19572 Defined if the compiler supports 32-bit double resp. 64-bit double.
19573 The actual layout is specified by option @option{-mdouble=}.
19574
19575 @item __DEFAULT_DOUBLE__
19576 The size in bits of @code{double} if @option{-mdouble=} is not set.
19577 To test the layout of @code{double} in a program, use the built-in
19578 macro @code{__SIZEOF_DOUBLE__}.
19579
19580 @item __HAVE_LONG_DOUBLE32__
19581 @itemx __HAVE_LONG_DOUBLE64__
19582 @itemx __HAVE_LONG_DOUBLE_MULTILIB__
19583 @itemx __DEFAULT_LONG_DOUBLE__
19584 Same as above, but for @code{long double} instead of @code{double}.
19585
19586 @item __WITH_DOUBLE_COMPARISON__
19587 Reflects the @code{--with-double-comparison=@{tristate|bool|libf7@}}
19588 @w{@uref{https://gcc.gnu.org/install/configure.html#avr,configure option}}
19589 and is defined to @code{2} or @code{3}.
19590
19591 @item __WITH_LIBF7_LIBGCC__
19592 @itemx __WITH_LIBF7_MATH__
19593 @itemx __WITH_LIBF7_MATH_SYMBOLS__
19594 Reflects the @code{--with-libf7=@{libgcc|math|math-symbols@}}
19595 @w{@uref{https://gcc.gnu.org/install/configure.html#avr,configure option}}.
19596
19597 @end table
19598
19599 @node Blackfin Options
19600 @subsection Blackfin Options
19601 @cindex Blackfin Options
19602
19603 @table @gcctabopt
19604 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
19605 @opindex mcpu=
19606 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
19607 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
19608 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
19609 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
19610 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
19611 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
19612 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
19613 @samp{bf561}, @samp{bf592}.
19614
19615 The optional @var{sirevision} specifies the silicon revision of the target
19616 Blackfin processor.  Any workarounds available for the targeted silicon revision
19617 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
19618 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
19619 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
19620 hexadecimal digits representing the major and minor numbers in the silicon
19621 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
19622 is not defined.  If @var{sirevision} is @samp{any}, the
19623 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
19624 If this optional @var{sirevision} is not used, GCC assumes the latest known
19625 silicon revision of the targeted Blackfin processor.
19626
19627 GCC defines a preprocessor macro for the specified @var{cpu}.
19628 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
19629 provided by libgloss to be linked in if @option{-msim} is not given.
19630
19631 Without this option, @samp{bf532} is used as the processor by default.
19632
19633 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
19634 only the preprocessor macro is defined.
19635
19636 @item -msim
19637 @opindex msim
19638 Specifies that the program will be run on the simulator.  This causes
19639 the simulator BSP provided by libgloss to be linked in.  This option
19640 has effect only for @samp{bfin-elf} toolchain.
19641 Certain other options, such as @option{-mid-shared-library} and
19642 @option{-mfdpic}, imply @option{-msim}.
19643
19644 @item -momit-leaf-frame-pointer
19645 @opindex momit-leaf-frame-pointer
19646 Don't keep the frame pointer in a register for leaf functions.  This
19647 avoids the instructions to save, set up and restore frame pointers and
19648 makes an extra register available in leaf functions.
19649
19650 @item -mspecld-anomaly
19651 @opindex mspecld-anomaly
19652 When enabled, the compiler ensures that the generated code does not
19653 contain speculative loads after jump instructions. If this option is used,
19654 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
19655
19656 @item -mno-specld-anomaly
19657 @opindex mno-specld-anomaly
19658 @opindex mspecld-anomaly
19659 Don't generate extra code to prevent speculative loads from occurring.
19660
19661 @item -mcsync-anomaly
19662 @opindex mcsync-anomaly
19663 When enabled, the compiler ensures that the generated code does not
19664 contain CSYNC or SSYNC instructions too soon after conditional branches.
19665 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
19666
19667 @item -mno-csync-anomaly
19668 @opindex mno-csync-anomaly
19669 @opindex mcsync-anomaly
19670 Don't generate extra code to prevent CSYNC or SSYNC instructions from
19671 occurring too soon after a conditional branch.
19672
19673 @item -mlow64k
19674 @opindex mlow64k
19675 When enabled, the compiler is free to take advantage of the knowledge that
19676 the entire program fits into the low 64k of memory.
19677
19678 @item -mno-low64k
19679 @opindex mno-low64k
19680 Assume that the program is arbitrarily large.  This is the default.
19681
19682 @item -mstack-check-l1
19683 @opindex mstack-check-l1
19684 Do stack checking using information placed into L1 scratchpad memory by the
19685 uClinux kernel.
19686
19687 @item -mid-shared-library
19688 @opindex mid-shared-library
19689 Generate code that supports shared libraries via the library ID method.
19690 This allows for execute in place and shared libraries in an environment
19691 without virtual memory management.  This option implies @option{-fPIC}.
19692 With a @samp{bfin-elf} target, this option implies @option{-msim}.
19693
19694 @item -mno-id-shared-library
19695 @opindex mno-id-shared-library
19696 @opindex mid-shared-library
19697 Generate code that doesn't assume ID-based shared libraries are being used.
19698 This is the default.
19699
19700 @item -mleaf-id-shared-library
19701 @opindex mleaf-id-shared-library
19702 Generate code that supports shared libraries via the library ID method,
19703 but assumes that this library or executable won't link against any other
19704 ID shared libraries.  That allows the compiler to use faster code for jumps
19705 and calls.
19706
19707 @item -mno-leaf-id-shared-library
19708 @opindex mno-leaf-id-shared-library
19709 @opindex mleaf-id-shared-library
19710 Do not assume that the code being compiled won't link against any ID shared
19711 libraries.  Slower code is generated for jump and call insns.
19712
19713 @item -mshared-library-id=n
19714 @opindex mshared-library-id
19715 Specifies the identification number of the ID-based shared library being
19716 compiled.  Specifying a value of 0 generates more compact code; specifying
19717 other values forces the allocation of that number to the current
19718 library but is no more space- or time-efficient than omitting this option.
19719
19720 @item -msep-data
19721 @opindex msep-data
19722 Generate code that allows the data segment to be located in a different
19723 area of memory from the text segment.  This allows for execute in place in
19724 an environment without virtual memory management by eliminating relocations
19725 against the text section.
19726
19727 @item -mno-sep-data
19728 @opindex mno-sep-data
19729 @opindex msep-data
19730 Generate code that assumes that the data segment follows the text segment.
19731 This is the default.
19732
19733 @item -mlong-calls
19734 @itemx -mno-long-calls
19735 @opindex mlong-calls
19736 @opindex mno-long-calls
19737 Tells the compiler to perform function calls by first loading the
19738 address of the function into a register and then performing a subroutine
19739 call on this register.  This switch is needed if the target function
19740 lies outside of the 24-bit addressing range of the offset-based
19741 version of subroutine call instruction.
19742
19743 This feature is not enabled by default.  Specifying
19744 @option{-mno-long-calls} restores the default behavior.  Note these
19745 switches have no effect on how the compiler generates code to handle
19746 function calls via function pointers.
19747
19748 @item -mfast-fp
19749 @opindex mfast-fp
19750 Link with the fast floating-point library. This library relaxes some of
19751 the IEEE floating-point standard's rules for checking inputs against
19752 Not-a-Number (NAN), in the interest of performance.
19753
19754 @item -minline-plt
19755 @opindex minline-plt
19756 Enable inlining of PLT entries in function calls to functions that are
19757 not known to bind locally.  It has no effect without @option{-mfdpic}.
19758
19759 @item -mmulticore
19760 @opindex mmulticore
19761 Build a standalone application for multicore Blackfin processors. 
19762 This option causes proper start files and link scripts supporting 
19763 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
19764 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
19765
19766 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
19767 selects the one-application-per-core programming model.  Without
19768 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
19769 programming model is used. In this model, the main function of Core B
19770 should be named as @code{coreb_main}.
19771
19772 If this option is not used, the single-core application programming
19773 model is used.
19774
19775 @item -mcorea
19776 @opindex mcorea
19777 Build a standalone application for Core A of BF561 when using
19778 the one-application-per-core programming model. Proper start files
19779 and link scripts are used to support Core A, and the macro
19780 @code{__BFIN_COREA} is defined.
19781 This option can only be used in conjunction with @option{-mmulticore}.
19782
19783 @item -mcoreb
19784 @opindex mcoreb
19785 Build a standalone application for Core B of BF561 when using
19786 the one-application-per-core programming model. Proper start files
19787 and link scripts are used to support Core B, and the macro
19788 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
19789 should be used instead of @code{main}. 
19790 This option can only be used in conjunction with @option{-mmulticore}.
19791
19792 @item -msdram
19793 @opindex msdram
19794 Build a standalone application for SDRAM. Proper start files and
19795 link scripts are used to put the application into SDRAM, and the macro
19796 @code{__BFIN_SDRAM} is defined.
19797 The loader should initialize SDRAM before loading the application.
19798
19799 @item -micplb
19800 @opindex micplb
19801 Assume that ICPLBs are enabled at run time.  This has an effect on certain
19802 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
19803 are enabled; for standalone applications the default is off.
19804 @end table
19805
19806 @node C6X Options
19807 @subsection C6X Options
19808 @cindex C6X Options
19809
19810 @table @gcctabopt
19811 @item -march=@var{name}
19812 @opindex march
19813 This specifies the name of the target architecture.  GCC uses this
19814 name to determine what kind of instructions it can emit when generating
19815 assembly code.  Permissible names are: @samp{c62x},
19816 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
19817
19818 @item -mbig-endian
19819 @opindex mbig-endian
19820 Generate code for a big-endian target.
19821
19822 @item -mlittle-endian
19823 @opindex mlittle-endian
19824 Generate code for a little-endian target.  This is the default.
19825
19826 @item -msim
19827 @opindex msim
19828 Choose startup files and linker script suitable for the simulator.
19829
19830 @item -msdata=default
19831 @opindex msdata=default
19832 Put small global and static data in the @code{.neardata} section,
19833 which is pointed to by register @code{B14}.  Put small uninitialized
19834 global and static data in the @code{.bss} section, which is adjacent
19835 to the @code{.neardata} section.  Put small read-only data into the
19836 @code{.rodata} section.  The corresponding sections used for large
19837 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
19838
19839 @item -msdata=all
19840 @opindex msdata=all
19841 Put all data, not just small objects, into the sections reserved for
19842 small data, and use addressing relative to the @code{B14} register to
19843 access them.
19844
19845 @item -msdata=none
19846 @opindex msdata=none
19847 Make no use of the sections reserved for small data, and use absolute
19848 addresses to access all data.  Put all initialized global and static
19849 data in the @code{.fardata} section, and all uninitialized data in the
19850 @code{.far} section.  Put all constant data into the @code{.const}
19851 section.
19852 @end table
19853
19854 @node CRIS Options
19855 @subsection CRIS Options
19856 @cindex CRIS Options
19857
19858 These options are defined specifically for the CRIS ports.
19859
19860 @table @gcctabopt
19861 @item -march=@var{architecture-type}
19862 @itemx -mcpu=@var{architecture-type}
19863 @opindex march
19864 @opindex mcpu
19865 Generate code for the specified architecture.  The choices for
19866 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
19867 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
19868 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
19869 @samp{v10}.
19870
19871 @item -mtune=@var{architecture-type}
19872 @opindex mtune
19873 Tune to @var{architecture-type} everything applicable about the generated
19874 code, except for the ABI and the set of available instructions.  The
19875 choices for @var{architecture-type} are the same as for
19876 @option{-march=@var{architecture-type}}.
19877
19878 @item -mmax-stack-frame=@var{n}
19879 @opindex mmax-stack-frame
19880 Warn when the stack frame of a function exceeds @var{n} bytes.
19881
19882 @item -metrax4
19883 @itemx -metrax100
19884 @opindex metrax4
19885 @opindex metrax100
19886 The options @option{-metrax4} and @option{-metrax100} are synonyms for
19887 @option{-march=v3} and @option{-march=v8} respectively.
19888
19889 @item -mmul-bug-workaround
19890 @itemx -mno-mul-bug-workaround
19891 @opindex mmul-bug-workaround
19892 @opindex mno-mul-bug-workaround
19893 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
19894 models where it applies.  This option is active by default.
19895
19896 @item -mpdebug
19897 @opindex mpdebug
19898 Enable CRIS-specific verbose debug-related information in the assembly
19899 code.  This option also has the effect of turning off the @samp{#NO_APP}
19900 formatted-code indicator to the assembler at the beginning of the
19901 assembly file.
19902
19903 @item -mcc-init
19904 @opindex mcc-init
19905 Do not use condition-code results from previous instruction; always emit
19906 compare and test instructions before use of condition codes.
19907
19908 @item -mno-side-effects
19909 @opindex mno-side-effects
19910 @opindex mside-effects
19911 Do not emit instructions with side effects in addressing modes other than
19912 post-increment.
19913
19914 @item -mstack-align
19915 @itemx -mno-stack-align
19916 @itemx -mdata-align
19917 @itemx -mno-data-align
19918 @itemx -mconst-align
19919 @itemx -mno-const-align
19920 @opindex mstack-align
19921 @opindex mno-stack-align
19922 @opindex mdata-align
19923 @opindex mno-data-align
19924 @opindex mconst-align
19925 @opindex mno-const-align
19926 These options (@samp{no-} options) arrange (eliminate arrangements) for the
19927 stack frame, individual data and constants to be aligned for the maximum
19928 single data access size for the chosen CPU model.  The default is to
19929 arrange for 32-bit alignment.  ABI details such as structure layout are
19930 not affected by these options.
19931
19932 @item -m32-bit
19933 @itemx -m16-bit
19934 @itemx -m8-bit
19935 @opindex m32-bit
19936 @opindex m16-bit
19937 @opindex m8-bit
19938 Similar to the stack- data- and const-align options above, these options
19939 arrange for stack frame, writable data and constants to all be 32-bit,
19940 16-bit or 8-bit aligned.  The default is 32-bit alignment.
19941
19942 @item -mno-prologue-epilogue
19943 @itemx -mprologue-epilogue
19944 @opindex mno-prologue-epilogue
19945 @opindex mprologue-epilogue
19946 With @option{-mno-prologue-epilogue}, the normal function prologue and
19947 epilogue which set up the stack frame are omitted and no return
19948 instructions or return sequences are generated in the code.  Use this
19949 option only together with visual inspection of the compiled code: no
19950 warnings or errors are generated when call-saved registers must be saved,
19951 or storage for local variables needs to be allocated.
19952
19953 @item -mno-gotplt
19954 @itemx -mgotplt
19955 @opindex mno-gotplt
19956 @opindex mgotplt
19957 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
19958 instruction sequences that load addresses for functions from the PLT part
19959 of the GOT rather than (traditional on other architectures) calls to the
19960 PLT@.  The default is @option{-mgotplt}.
19961
19962 @item -melf
19963 @opindex melf
19964 Legacy no-op option only recognized with the cris-axis-elf and
19965 cris-axis-linux-gnu targets.
19966
19967 @item -mlinux
19968 @opindex mlinux
19969 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
19970
19971 @item -sim
19972 @opindex sim
19973 This option, recognized for the cris-axis-elf, arranges
19974 to link with input-output functions from a simulator library.  Code,
19975 initialized data and zero-initialized data are allocated consecutively.
19976
19977 @item -sim2
19978 @opindex sim2
19979 Like @option{-sim}, but pass linker options to locate initialized data at
19980 0x40000000 and zero-initialized data at 0x80000000.
19981 @end table
19982
19983 @node CR16 Options
19984 @subsection CR16 Options
19985 @cindex CR16 Options
19986
19987 These options are defined specifically for the CR16 ports.
19988
19989 @table @gcctabopt
19990
19991 @item -mmac
19992 @opindex mmac
19993 Enable the use of multiply-accumulate instructions. Disabled by default.
19994
19995 @item -mcr16cplus
19996 @itemx -mcr16c
19997 @opindex mcr16cplus
19998 @opindex mcr16c
19999 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
20000 is default.
20001
20002 @item -msim
20003 @opindex msim
20004 Links the library libsim.a which is in compatible with simulator. Applicable
20005 to ELF compiler only.
20006
20007 @item -mint32
20008 @opindex mint32
20009 Choose integer type as 32-bit wide.
20010
20011 @item -mbit-ops
20012 @opindex mbit-ops
20013 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
20014
20015 @item -mdata-model=@var{model}
20016 @opindex mdata-model
20017 Choose a data model. The choices for @var{model} are @samp{near},
20018 @samp{far} or @samp{medium}. @samp{medium} is default.
20019 However, @samp{far} is not valid with @option{-mcr16c}, as the
20020 CR16C architecture does not support the far data model.
20021 @end table
20022
20023 @node C-SKY Options
20024 @subsection C-SKY Options
20025 @cindex C-SKY Options
20026
20027 GCC supports these options when compiling for C-SKY V2 processors.
20028
20029 @table @gcctabopt
20030
20031 @item -march=@var{arch}
20032 @opindex march=
20033 Specify the C-SKY target architecture.  Valid values for @var{arch} are:
20034 @samp{ck801}, @samp{ck802}, @samp{ck803}, @samp{ck807}, and @samp{ck810}.
20035 The default is @samp{ck810}.
20036
20037 @item -mcpu=@var{cpu}
20038 @opindex mcpu=
20039 Specify the C-SKY target processor.  Valid values for @var{cpu} are:
20040 @samp{ck801}, @samp{ck801t},
20041 @samp{ck802}, @samp{ck802t}, @samp{ck802j},
20042 @samp{ck803}, @samp{ck803h}, @samp{ck803t}, @samp{ck803ht},
20043 @samp{ck803f}, @samp{ck803fh}, @samp{ck803e}, @samp{ck803eh},
20044 @samp{ck803et}, @samp{ck803eht}, @samp{ck803ef}, @samp{ck803efh},
20045 @samp{ck803ft}, @samp{ck803eft}, @samp{ck803efht}, @samp{ck803r1},
20046 @samp{ck803hr1}, @samp{ck803tr1}, @samp{ck803htr1}, @samp{ck803fr1},
20047 @samp{ck803fhr1}, @samp{ck803er1}, @samp{ck803ehr1}, @samp{ck803etr1},
20048 @samp{ck803ehtr1}, @samp{ck803efr1}, @samp{ck803efhr1}, @samp{ck803ftr1},
20049 @samp{ck803eftr1}, @samp{ck803efhtr1},
20050 @samp{ck803s}, @samp{ck803st}, @samp{ck803se}, @samp{ck803sf},
20051 @samp{ck803sef}, @samp{ck803seft},
20052 @samp{ck807e}, @samp{ck807ef}, @samp{ck807}, @samp{ck807f},
20053 @samp{ck810e}, @samp{ck810et}, @samp{ck810ef}, @samp{ck810eft},
20054 @samp{ck810}, @samp{ck810v}, @samp{ck810f}, @samp{ck810t}, @samp{ck810fv},
20055 @samp{ck810tv}, @samp{ck810ft}, and @samp{ck810ftv}.
20056
20057 @item -mbig-endian
20058 @opindex mbig-endian
20059 @itemx -EB
20060 @opindex EB
20061 @itemx -mlittle-endian
20062 @opindex mlittle-endian
20063 @itemx -EL
20064 @opindex EL
20065
20066 Select big- or little-endian code.  The default is little-endian.
20067
20068 @item -mhard-float
20069 @opindex mhard-float
20070 @itemx -msoft-float
20071 @opindex msoft-float
20072
20073 Select hardware or software floating-point implementations.
20074 The default is soft float.
20075
20076 @item -mdouble-float
20077 @itemx -mno-double-float
20078 @opindex mdouble-float
20079 When @option{-mhard-float} is in effect, enable generation of
20080 double-precision float instructions.  This is the default except
20081 when compiling for CK803.
20082
20083 @item -mfdivdu
20084 @itemx -mno-fdivdu
20085 @opindex mfdivdu
20086 When @option{-mhard-float} is in effect, enable generation of
20087 @code{frecipd}, @code{fsqrtd}, and @code{fdivd} instructions.
20088 This is the default except when compiling for CK803.
20089
20090 @item -mfpu=@var{fpu}
20091 @opindex mfpu=
20092 Select the floating-point processor.  This option can only be used with
20093 @option{-mhard-float}.
20094 Values for @var{fpu} are
20095 @samp{fpv2_sf} (equivalent to @samp{-mno-double-float -mno-fdivdu}),
20096 @samp{fpv2} (@samp{-mdouble-float -mno-divdu}), and
20097 @samp{fpv2_divd} (@samp{-mdouble-float -mdivdu}).
20098
20099 @item -melrw
20100 @itemx -mno-elrw
20101 @opindex melrw
20102 Enable the extended @code{lrw} instruction.  This option defaults to on
20103 for CK801 and off otherwise.
20104
20105 @item -mistack
20106 @itemx -mno-istack
20107 @opindex mistack
20108 Enable interrupt stack instructions; the default is off.
20109
20110 The @option{-mistack} option is required to handle the
20111 @code{interrupt} and @code{isr} function attributes
20112 (@pxref{C-SKY Function Attributes}).
20113
20114 @item -mmp
20115 @opindex mmp
20116 Enable multiprocessor instructions; the default is off.
20117
20118 @item -mcp
20119 @opindex mcp
20120 Enable coprocessor instructions; the default is off.
20121
20122 @item -mcache
20123 @opindex mcache
20124 Enable coprocessor instructions; the default is off.
20125
20126 @item -msecurity
20127 @opindex msecurity
20128 Enable C-SKY security instructions; the default is off.
20129
20130 @item -mtrust
20131 @opindex mtrust
20132 Enable C-SKY trust instructions; the default is off.
20133
20134 @item -mdsp
20135 @opindex mdsp
20136 @itemx -medsp
20137 @opindex medsp
20138 @itemx -mvdsp
20139 @opindex mvdsp
20140 Enable C-SKY DSP, Enhanced DSP, or Vector DSP instructions, respectively.
20141 All of these options default to off.
20142
20143 @item -mdiv
20144 @itemx -mno-div
20145 @opindex mdiv
20146 Generate divide instructions.  Default is off.
20147
20148 @item -msmart
20149 @itemx -mno-smart
20150 @opindex msmart
20151 Generate code for Smart Mode, using only registers numbered 0-7 to allow
20152 use of 16-bit instructions.  This option is ignored for CK801 where this
20153 is the required behavior, and it defaults to on for CK802.
20154 For other targets, the default is off.
20155
20156 @item -mhigh-registers
20157 @itemx -mno-high-registers
20158 @opindex mhigh-registers
20159 Generate code using the high registers numbered 16-31.  This option
20160 is not supported on CK801, CK802, or CK803, and is enabled by default
20161 for other processors.
20162
20163 @item -manchor
20164 @itemx -mno-anchor
20165 @opindex manchor
20166 Generate code using global anchor symbol addresses.
20167
20168 @item -mpushpop
20169 @itemx -mno-pushpop
20170 @opindex mpushpop
20171 Generate code using @code{push} and @code{pop} instructions.  This option
20172 defaults to on.
20173
20174 @item -mmultiple-stld
20175 @itemx -mstm
20176 @itemx -mno-multiple-stld
20177 @itemx -mno-stm
20178 @opindex mmultiple-stld
20179 Generate code using @code{stm} and @code{ldm} instructions.  This option
20180 isn't supported on CK801 but is enabled by default on other processors.
20181
20182 @item -mconstpool
20183 @itemx -mno-constpool
20184 @opindex mconstpool
20185 Create constant pools in the compiler instead of deferring it to the
20186 assembler.  This option is the default and required for correct code
20187 generation on CK801 and CK802, and is optional on other processors.
20188
20189 @item -mstack-size
20190 @item -mno-stack-size
20191 @opindex mstack-size
20192 Emit @code{.stack_size} directives for each function in the assembly
20193 output.  This option defaults to off.
20194
20195 @item -mccrt
20196 @itemx -mno-ccrt
20197 @opindex mccrt
20198 Generate code for the C-SKY compiler runtime instead of libgcc.  This
20199 option defaults to off.
20200
20201 @item -mbranch-cost=@var{n}
20202 @opindex mbranch-cost=
20203 Set the branch costs to roughly @code{n} instructions.  The default is 1.
20204
20205 @item -msched-prolog
20206 @itemx -mno-sched-prolog
20207 @opindex msched-prolog
20208 Permit scheduling of function prologue and epilogue sequences.  Using
20209 this option can result in code that is not compliant with the C-SKY V2 ABI
20210 prologue requirements and that cannot be debugged or backtraced.
20211 It is disabled by default.
20212
20213 @end table
20214
20215 @node Darwin Options
20216 @subsection Darwin Options
20217 @cindex Darwin options
20218
20219 These options are defined for all architectures running the Darwin operating
20220 system.
20221
20222 FSF GCC on Darwin does not create ``fat'' object files; it creates
20223 an object file for the single architecture that GCC was built to
20224 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
20225 @option{-arch} options are used; it does so by running the compiler or
20226 linker multiple times and joining the results together with
20227 @file{lipo}.
20228
20229 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
20230 @samp{i686}) is determined by the flags that specify the ISA
20231 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
20232 @option{-force_cpusubtype_ALL} option can be used to override this.
20233
20234 The Darwin tools vary in their behavior when presented with an ISA
20235 mismatch.  The assembler, @file{as}, only permits instructions to
20236 be used that are valid for the subtype of the file it is generating,
20237 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
20238 The linker for shared libraries, @file{/usr/bin/libtool}, fails
20239 and prints an error if asked to create a shared library with a less
20240 restrictive subtype than its input files (for instance, trying to put
20241 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
20242 for executables, @command{ld}, quietly gives the executable the most
20243 restrictive subtype of any of its input files.
20244
20245 @table @gcctabopt
20246 @item -F@var{dir}
20247 @opindex F
20248 Add the framework directory @var{dir} to the head of the list of
20249 directories to be searched for header files.  These directories are
20250 interleaved with those specified by @option{-I} options and are
20251 scanned in a left-to-right order.
20252
20253 A framework directory is a directory with frameworks in it.  A
20254 framework is a directory with a @file{Headers} and/or
20255 @file{PrivateHeaders} directory contained directly in it that ends
20256 in @file{.framework}.  The name of a framework is the name of this
20257 directory excluding the @file{.framework}.  Headers associated with
20258 the framework are found in one of those two directories, with
20259 @file{Headers} being searched first.  A subframework is a framework
20260 directory that is in a framework's @file{Frameworks} directory.
20261 Includes of subframework headers can only appear in a header of a
20262 framework that contains the subframework, or in a sibling subframework
20263 header.  Two subframeworks are siblings if they occur in the same
20264 framework.  A subframework should not have the same name as a
20265 framework; a warning is issued if this is violated.  Currently a
20266 subframework cannot have subframeworks; in the future, the mechanism
20267 may be extended to support this.  The standard frameworks can be found
20268 in @file{/System/Library/Frameworks} and
20269 @file{/Library/Frameworks}.  An example include looks like
20270 @code{#include <Framework/header.h>}, where @file{Framework} denotes
20271 the name of the framework and @file{header.h} is found in the
20272 @file{PrivateHeaders} or @file{Headers} directory.
20273
20274 @item -iframework@var{dir}
20275 @opindex iframework
20276 Like @option{-F} except the directory is a treated as a system
20277 directory.  The main difference between this @option{-iframework} and
20278 @option{-F} is that with @option{-iframework} the compiler does not
20279 warn about constructs contained within header files found via
20280 @var{dir}.  This option is valid only for the C family of languages.
20281
20282 @item -gused
20283 @opindex gused
20284 Emit debugging information for symbols that are used.  For stabs
20285 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
20286 This is by default ON@.
20287
20288 @item -gfull
20289 @opindex gfull
20290 Emit debugging information for all symbols and types.
20291
20292 @item -mmacosx-version-min=@var{version}
20293 The earliest version of MacOS X that this executable will run on
20294 is @var{version}.  Typical values of @var{version} include @code{10.1},
20295 @code{10.2}, and @code{10.3.9}.
20296
20297 If the compiler was built to use the system's headers by default,
20298 then the default for this option is the system version on which the
20299 compiler is running, otherwise the default is to make choices that
20300 are compatible with as many systems and code bases as possible.
20301
20302 @item -mkernel
20303 @opindex mkernel
20304 Enable kernel development mode.  The @option{-mkernel} option sets
20305 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
20306 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
20307 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
20308 applicable.  This mode also sets @option{-mno-altivec},
20309 @option{-msoft-float}, @option{-fno-builtin} and
20310 @option{-mlong-branch} for PowerPC targets.
20311
20312 @item -mone-byte-bool
20313 @opindex mone-byte-bool
20314 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
20315 By default @code{sizeof(bool)} is @code{4} when compiling for
20316 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
20317 option has no effect on x86.
20318
20319 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
20320 to generate code that is not binary compatible with code generated
20321 without that switch.  Using this switch may require recompiling all
20322 other modules in a program, including system libraries.  Use this
20323 switch to conform to a non-default data model.
20324
20325 @item -mfix-and-continue
20326 @itemx -ffix-and-continue
20327 @itemx -findirect-data
20328 @opindex mfix-and-continue
20329 @opindex ffix-and-continue
20330 @opindex findirect-data
20331 Generate code suitable for fast turnaround development, such as to
20332 allow GDB to dynamically load @file{.o} files into already-running
20333 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
20334 are provided for backwards compatibility.
20335
20336 @item -all_load
20337 @opindex all_load
20338 Loads all members of static archive libraries.
20339 See man ld(1) for more information.
20340
20341 @item -arch_errors_fatal
20342 @opindex arch_errors_fatal
20343 Cause the errors having to do with files that have the wrong architecture
20344 to be fatal.
20345
20346 @item -bind_at_load
20347 @opindex bind_at_load
20348 Causes the output file to be marked such that the dynamic linker will
20349 bind all undefined references when the file is loaded or launched.
20350
20351 @item -bundle
20352 @opindex bundle
20353 Produce a Mach-o bundle format file.
20354 See man ld(1) for more information.
20355
20356 @item -bundle_loader @var{executable}
20357 @opindex bundle_loader
20358 This option specifies the @var{executable} that will load the build
20359 output file being linked.  See man ld(1) for more information.
20360
20361 @item -dynamiclib
20362 @opindex dynamiclib
20363 When passed this option, GCC produces a dynamic library instead of
20364 an executable when linking, using the Darwin @file{libtool} command.
20365
20366 @item -force_cpusubtype_ALL
20367 @opindex force_cpusubtype_ALL
20368 This causes GCC's output file to have the @samp{ALL} subtype, instead of
20369 one controlled by the @option{-mcpu} or @option{-march} option.
20370
20371 @item -allowable_client  @var{client_name}
20372 @itemx -client_name
20373 @itemx -compatibility_version
20374 @itemx -current_version
20375 @itemx -dead_strip
20376 @itemx -dependency-file
20377 @itemx -dylib_file
20378 @itemx -dylinker_install_name
20379 @itemx -dynamic
20380 @itemx -exported_symbols_list
20381 @itemx -filelist
20382 @need 800
20383 @itemx -flat_namespace
20384 @itemx -force_flat_namespace
20385 @itemx -headerpad_max_install_names
20386 @itemx -image_base
20387 @itemx -init
20388 @itemx -install_name
20389 @itemx -keep_private_externs
20390 @itemx -multi_module
20391 @itemx -multiply_defined
20392 @itemx -multiply_defined_unused
20393 @need 800
20394 @itemx -noall_load
20395 @itemx -no_dead_strip_inits_and_terms
20396 @itemx -nofixprebinding
20397 @itemx -nomultidefs
20398 @itemx -noprebind
20399 @itemx -noseglinkedit
20400 @itemx -pagezero_size
20401 @itemx -prebind
20402 @itemx -prebind_all_twolevel_modules
20403 @itemx -private_bundle
20404 @need 800
20405 @itemx -read_only_relocs
20406 @itemx -sectalign
20407 @itemx -sectobjectsymbols
20408 @itemx -whyload
20409 @itemx -seg1addr
20410 @itemx -sectcreate
20411 @itemx -sectobjectsymbols
20412 @itemx -sectorder
20413 @itemx -segaddr
20414 @itemx -segs_read_only_addr
20415 @need 800
20416 @itemx -segs_read_write_addr
20417 @itemx -seg_addr_table
20418 @itemx -seg_addr_table_filename
20419 @itemx -seglinkedit
20420 @itemx -segprot
20421 @itemx -segs_read_only_addr
20422 @itemx -segs_read_write_addr
20423 @itemx -single_module
20424 @itemx -static
20425 @itemx -sub_library
20426 @need 800
20427 @itemx -sub_umbrella
20428 @itemx -twolevel_namespace
20429 @itemx -umbrella
20430 @itemx -undefined
20431 @itemx -unexported_symbols_list
20432 @itemx -weak_reference_mismatches
20433 @itemx -whatsloaded
20434 @opindex allowable_client
20435 @opindex client_name
20436 @opindex compatibility_version
20437 @opindex current_version
20438 @opindex dead_strip
20439 @opindex dependency-file
20440 @opindex dylib_file
20441 @opindex dylinker_install_name
20442 @opindex dynamic
20443 @opindex exported_symbols_list
20444 @opindex filelist
20445 @opindex flat_namespace
20446 @opindex force_flat_namespace
20447 @opindex headerpad_max_install_names
20448 @opindex image_base
20449 @opindex init
20450 @opindex install_name
20451 @opindex keep_private_externs
20452 @opindex multi_module
20453 @opindex multiply_defined
20454 @opindex multiply_defined_unused
20455 @opindex noall_load
20456 @opindex no_dead_strip_inits_and_terms
20457 @opindex nofixprebinding
20458 @opindex nomultidefs
20459 @opindex noprebind
20460 @opindex noseglinkedit
20461 @opindex pagezero_size
20462 @opindex prebind
20463 @opindex prebind_all_twolevel_modules
20464 @opindex private_bundle
20465 @opindex read_only_relocs
20466 @opindex sectalign
20467 @opindex sectobjectsymbols
20468 @opindex whyload
20469 @opindex seg1addr
20470 @opindex sectcreate
20471 @opindex sectobjectsymbols
20472 @opindex sectorder
20473 @opindex segaddr
20474 @opindex segs_read_only_addr
20475 @opindex segs_read_write_addr
20476 @opindex seg_addr_table
20477 @opindex seg_addr_table_filename
20478 @opindex seglinkedit
20479 @opindex segprot
20480 @opindex segs_read_only_addr
20481 @opindex segs_read_write_addr
20482 @opindex single_module
20483 @opindex static
20484 @opindex sub_library
20485 @opindex sub_umbrella
20486 @opindex twolevel_namespace
20487 @opindex umbrella
20488 @opindex undefined
20489 @opindex unexported_symbols_list
20490 @opindex weak_reference_mismatches
20491 @opindex whatsloaded
20492 These options are passed to the Darwin linker.  The Darwin linker man page
20493 describes them in detail.
20494 @end table
20495
20496 @node DEC Alpha Options
20497 @subsection DEC Alpha Options
20498
20499 These @samp{-m} options are defined for the DEC Alpha implementations:
20500
20501 @table @gcctabopt
20502 @item -mno-soft-float
20503 @itemx -msoft-float
20504 @opindex mno-soft-float
20505 @opindex msoft-float
20506 Use (do not use) the hardware floating-point instructions for
20507 floating-point operations.  When @option{-msoft-float} is specified,
20508 functions in @file{libgcc.a} are used to perform floating-point
20509 operations.  Unless they are replaced by routines that emulate the
20510 floating-point operations, or compiled in such a way as to call such
20511 emulations routines, these routines issue floating-point
20512 operations.   If you are compiling for an Alpha without floating-point
20513 operations, you must ensure that the library is built so as not to call
20514 them.
20515
20516 Note that Alpha implementations without floating-point operations are
20517 required to have floating-point registers.
20518
20519 @item -mfp-reg
20520 @itemx -mno-fp-regs
20521 @opindex mfp-reg
20522 @opindex mno-fp-regs
20523 Generate code that uses (does not use) the floating-point register set.
20524 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
20525 register set is not used, floating-point operands are passed in integer
20526 registers as if they were integers and floating-point results are passed
20527 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
20528 so any function with a floating-point argument or return value called by code
20529 compiled with @option{-mno-fp-regs} must also be compiled with that
20530 option.
20531
20532 A typical use of this option is building a kernel that does not use,
20533 and hence need not save and restore, any floating-point registers.
20534
20535 @item -mieee
20536 @opindex mieee
20537 The Alpha architecture implements floating-point hardware optimized for
20538 maximum performance.  It is mostly compliant with the IEEE floating-point
20539 standard.  However, for full compliance, software assistance is
20540 required.  This option generates code fully IEEE-compliant code
20541 @emph{except} that the @var{inexact-flag} is not maintained (see below).
20542 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
20543 defined during compilation.  The resulting code is less efficient but is
20544 able to correctly support denormalized numbers and exceptional IEEE
20545 values such as not-a-number and plus/minus infinity.  Other Alpha
20546 compilers call this option @option{-ieee_with_no_inexact}.
20547
20548 @item -mieee-with-inexact
20549 @opindex mieee-with-inexact
20550 This is like @option{-mieee} except the generated code also maintains
20551 the IEEE @var{inexact-flag}.  Turning on this option causes the
20552 generated code to implement fully-compliant IEEE math.  In addition to
20553 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
20554 macro.  On some Alpha implementations the resulting code may execute
20555 significantly slower than the code generated by default.  Since there is
20556 very little code that depends on the @var{inexact-flag}, you should
20557 normally not specify this option.  Other Alpha compilers call this
20558 option @option{-ieee_with_inexact}.
20559
20560 @item -mfp-trap-mode=@var{trap-mode}
20561 @opindex mfp-trap-mode
20562 This option controls what floating-point related traps are enabled.
20563 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
20564 The trap mode can be set to one of four values:
20565
20566 @table @samp
20567 @item n
20568 This is the default (normal) setting.  The only traps that are enabled
20569 are the ones that cannot be disabled in software (e.g., division by zero
20570 trap).
20571
20572 @item u
20573 In addition to the traps enabled by @samp{n}, underflow traps are enabled
20574 as well.
20575
20576 @item su
20577 Like @samp{u}, but the instructions are marked to be safe for software
20578 completion (see Alpha architecture manual for details).
20579
20580 @item sui
20581 Like @samp{su}, but inexact traps are enabled as well.
20582 @end table
20583
20584 @item -mfp-rounding-mode=@var{rounding-mode}
20585 @opindex mfp-rounding-mode
20586 Selects the IEEE rounding mode.  Other Alpha compilers call this option
20587 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
20588 of:
20589
20590 @table @samp
20591 @item n
20592 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
20593 the nearest machine number or towards the even machine number in case
20594 of a tie.
20595
20596 @item m
20597 Round towards minus infinity.
20598
20599 @item c
20600 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
20601
20602 @item d
20603 Dynamic rounding mode.  A field in the floating-point control register
20604 (@var{fpcr}, see Alpha architecture reference manual) controls the
20605 rounding mode in effect.  The C library initializes this register for
20606 rounding towards plus infinity.  Thus, unless your program modifies the
20607 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
20608 @end table
20609
20610 @item -mtrap-precision=@var{trap-precision}
20611 @opindex mtrap-precision
20612 In the Alpha architecture, floating-point traps are imprecise.  This
20613 means without software assistance it is impossible to recover from a
20614 floating trap and program execution normally needs to be terminated.
20615 GCC can generate code that can assist operating system trap handlers
20616 in determining the exact location that caused a floating-point trap.
20617 Depending on the requirements of an application, different levels of
20618 precisions can be selected:
20619
20620 @table @samp
20621 @item p
20622 Program precision.  This option is the default and means a trap handler
20623 can only identify which program caused a floating-point exception.
20624
20625 @item f
20626 Function precision.  The trap handler can determine the function that
20627 caused a floating-point exception.
20628
20629 @item i
20630 Instruction precision.  The trap handler can determine the exact
20631 instruction that caused a floating-point exception.
20632 @end table
20633
20634 Other Alpha compilers provide the equivalent options called
20635 @option{-scope_safe} and @option{-resumption_safe}.
20636
20637 @item -mieee-conformant
20638 @opindex mieee-conformant
20639 This option marks the generated code as IEEE conformant.  You must not
20640 use this option unless you also specify @option{-mtrap-precision=i} and either
20641 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
20642 is to emit the line @samp{.eflag 48} in the function prologue of the
20643 generated assembly file.
20644
20645 @item -mbuild-constants
20646 @opindex mbuild-constants
20647 Normally GCC examines a 32- or 64-bit integer constant to
20648 see if it can construct it from smaller constants in two or three
20649 instructions.  If it cannot, it outputs the constant as a literal and
20650 generates code to load it from the data segment at run time.
20651
20652 Use this option to require GCC to construct @emph{all} integer constants
20653 using code, even if it takes more instructions (the maximum is six).
20654
20655 You typically use this option to build a shared library dynamic
20656 loader.  Itself a shared library, it must relocate itself in memory
20657 before it can find the variables and constants in its own data segment.
20658
20659 @item -mbwx
20660 @itemx -mno-bwx
20661 @itemx -mcix
20662 @itemx -mno-cix
20663 @itemx -mfix
20664 @itemx -mno-fix
20665 @itemx -mmax
20666 @itemx -mno-max
20667 @opindex mbwx
20668 @opindex mno-bwx
20669 @opindex mcix
20670 @opindex mno-cix
20671 @opindex mfix
20672 @opindex mno-fix
20673 @opindex mmax
20674 @opindex mno-max
20675 Indicate whether GCC should generate code to use the optional BWX,
20676 CIX, FIX and MAX instruction sets.  The default is to use the instruction
20677 sets supported by the CPU type specified via @option{-mcpu=} option or that
20678 of the CPU on which GCC was built if none is specified.
20679
20680 @item -mfloat-vax
20681 @itemx -mfloat-ieee
20682 @opindex mfloat-vax
20683 @opindex mfloat-ieee
20684 Generate code that uses (does not use) VAX F and G floating-point
20685 arithmetic instead of IEEE single and double precision.
20686
20687 @item -mexplicit-relocs
20688 @itemx -mno-explicit-relocs
20689 @opindex mexplicit-relocs
20690 @opindex mno-explicit-relocs
20691 Older Alpha assemblers provided no way to generate symbol relocations
20692 except via assembler macros.  Use of these macros does not allow
20693 optimal instruction scheduling.  GNU binutils as of version 2.12
20694 supports a new syntax that allows the compiler to explicitly mark
20695 which relocations should apply to which instructions.  This option
20696 is mostly useful for debugging, as GCC detects the capabilities of
20697 the assembler when it is built and sets the default accordingly.
20698
20699 @item -msmall-data
20700 @itemx -mlarge-data
20701 @opindex msmall-data
20702 @opindex mlarge-data
20703 When @option{-mexplicit-relocs} is in effect, static data is
20704 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
20705 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
20706 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
20707 16-bit relocations off of the @code{$gp} register.  This limits the
20708 size of the small data area to 64KB, but allows the variables to be
20709 directly accessed via a single instruction.
20710
20711 The default is @option{-mlarge-data}.  With this option the data area
20712 is limited to just below 2GB@.  Programs that require more than 2GB of
20713 data must use @code{malloc} or @code{mmap} to allocate the data in the
20714 heap instead of in the program's data segment.
20715
20716 When generating code for shared libraries, @option{-fpic} implies
20717 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
20718
20719 @item -msmall-text
20720 @itemx -mlarge-text
20721 @opindex msmall-text
20722 @opindex mlarge-text
20723 When @option{-msmall-text} is used, the compiler assumes that the
20724 code of the entire program (or shared library) fits in 4MB, and is
20725 thus reachable with a branch instruction.  When @option{-msmall-data}
20726 is used, the compiler can assume that all local symbols share the
20727 same @code{$gp} value, and thus reduce the number of instructions
20728 required for a function call from 4 to 1.
20729
20730 The default is @option{-mlarge-text}.
20731
20732 @item -mcpu=@var{cpu_type}
20733 @opindex mcpu
20734 Set the instruction set and instruction scheduling parameters for
20735 machine type @var{cpu_type}.  You can specify either the @samp{EV}
20736 style name or the corresponding chip number.  GCC supports scheduling
20737 parameters for the EV4, EV5 and EV6 family of processors and
20738 chooses the default values for the instruction set from the processor
20739 you specify.  If you do not specify a processor type, GCC defaults
20740 to the processor on which the compiler was built.
20741
20742 Supported values for @var{cpu_type} are
20743
20744 @table @samp
20745 @item ev4
20746 @itemx ev45
20747 @itemx 21064
20748 Schedules as an EV4 and has no instruction set extensions.
20749
20750 @item ev5
20751 @itemx 21164
20752 Schedules as an EV5 and has no instruction set extensions.
20753
20754 @item ev56
20755 @itemx 21164a
20756 Schedules as an EV5 and supports the BWX extension.
20757
20758 @item pca56
20759 @itemx 21164pc
20760 @itemx 21164PC
20761 Schedules as an EV5 and supports the BWX and MAX extensions.
20762
20763 @item ev6
20764 @itemx 21264
20765 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
20766
20767 @item ev67
20768 @itemx 21264a
20769 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
20770 @end table
20771
20772 Native toolchains also support the value @samp{native},
20773 which selects the best architecture option for the host processor.
20774 @option{-mcpu=native} has no effect if GCC does not recognize
20775 the processor.
20776
20777 @item -mtune=@var{cpu_type}
20778 @opindex mtune
20779 Set only the instruction scheduling parameters for machine type
20780 @var{cpu_type}.  The instruction set is not changed.
20781
20782 Native toolchains also support the value @samp{native},
20783 which selects the best architecture option for the host processor.
20784 @option{-mtune=native} has no effect if GCC does not recognize
20785 the processor.
20786
20787 @item -mmemory-latency=@var{time}
20788 @opindex mmemory-latency
20789 Sets the latency the scheduler should assume for typical memory
20790 references as seen by the application.  This number is highly
20791 dependent on the memory access patterns used by the application
20792 and the size of the external cache on the machine.
20793
20794 Valid options for @var{time} are
20795
20796 @table @samp
20797 @item @var{number}
20798 A decimal number representing clock cycles.
20799
20800 @item L1
20801 @itemx L2
20802 @itemx L3
20803 @itemx main
20804 The compiler contains estimates of the number of clock cycles for
20805 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
20806 (also called Dcache, Scache, and Bcache), as well as to main memory.
20807 Note that L3 is only valid for EV5.
20808
20809 @end table
20810 @end table
20811
20812 @node eBPF Options
20813 @subsection eBPF Options
20814 @cindex eBPF Options
20815
20816 @table @gcctabopt
20817 @item -mframe-limit=@var{bytes}
20818 This specifies the hard limit for frame sizes, in bytes.  Currently,
20819 the value that can be specified should be less than or equal to
20820 @samp{32767}.  Defaults to whatever limit is imposed by the version of
20821 the Linux kernel targeted.
20822
20823 @item -mkernel=@var{version}
20824 @opindex mkernel
20825 This specifies the minimum version of the kernel that will run the
20826 compiled program.  GCC uses this version to determine which
20827 instructions to use, what kernel helpers to allow, etc.  Currently,
20828 @var{version} can be one of @samp{4.0}, @samp{4.1}, @samp{4.2},
20829 @samp{4.3}, @samp{4.4}, @samp{4.5}, @samp{4.6}, @samp{4.7},
20830 @samp{4.8}, @samp{4.9}, @samp{4.10}, @samp{4.11}, @samp{4.12},
20831 @samp{4.13}, @samp{4.14}, @samp{4.15}, @samp{4.16}, @samp{4.17},
20832 @samp{4.18}, @samp{4.19}, @samp{4.20}, @samp{5.0}, @samp{5.1},
20833 @samp{5.2}, @samp{latest} and @samp{native}.
20834
20835 @item -mbig-endian
20836 @opindex mbig-endian
20837 Generate code for a big-endian target.
20838
20839 @item -mlittle-endian
20840 @opindex mlittle-endian
20841 Generate code for a little-endian target.  This is the default.
20842 @end table
20843
20844 @node FR30 Options
20845 @subsection FR30 Options
20846 @cindex FR30 Options
20847
20848 These options are defined specifically for the FR30 port.
20849
20850 @table @gcctabopt
20851
20852 @item -msmall-model
20853 @opindex msmall-model
20854 Use the small address space model.  This can produce smaller code, but
20855 it does assume that all symbolic values and addresses fit into a
20856 20-bit range.
20857
20858 @item -mno-lsim
20859 @opindex mno-lsim
20860 Assume that runtime support has been provided and so there is no need
20861 to include the simulator library (@file{libsim.a}) on the linker
20862 command line.
20863
20864 @end table
20865
20866 @node FT32 Options
20867 @subsection FT32 Options
20868 @cindex FT32 Options
20869
20870 These options are defined specifically for the FT32 port.
20871
20872 @table @gcctabopt
20873
20874 @item -msim
20875 @opindex msim
20876 Specifies that the program will be run on the simulator.  This causes
20877 an alternate runtime startup and library to be linked.
20878 You must not use this option when generating programs that will run on
20879 real hardware; you must provide your own runtime library for whatever
20880 I/O functions are needed.
20881
20882 @item -mlra
20883 @opindex mlra
20884 Enable Local Register Allocation.  This is still experimental for FT32,
20885 so by default the compiler uses standard reload.
20886
20887 @item -mnodiv
20888 @opindex mnodiv
20889 Do not use div and mod instructions.
20890
20891 @item -mft32b
20892 @opindex mft32b
20893 Enable use of the extended instructions of the FT32B processor.
20894
20895 @item -mcompress
20896 @opindex mcompress
20897 Compress all code using the Ft32B code compression scheme.
20898
20899 @item -mnopm
20900 @opindex  mnopm
20901 Do not generate code that reads program memory.
20902
20903 @end table
20904
20905 @node FRV Options
20906 @subsection FRV Options
20907 @cindex FRV Options
20908
20909 @table @gcctabopt
20910 @item -mgpr-32
20911 @opindex mgpr-32
20912
20913 Only use the first 32 general-purpose registers.
20914
20915 @item -mgpr-64
20916 @opindex mgpr-64
20917
20918 Use all 64 general-purpose registers.
20919
20920 @item -mfpr-32
20921 @opindex mfpr-32
20922
20923 Use only the first 32 floating-point registers.
20924
20925 @item -mfpr-64
20926 @opindex mfpr-64
20927
20928 Use all 64 floating-point registers.
20929
20930 @item -mhard-float
20931 @opindex mhard-float
20932
20933 Use hardware instructions for floating-point operations.
20934
20935 @item -msoft-float
20936 @opindex msoft-float
20937
20938 Use library routines for floating-point operations.
20939
20940 @item -malloc-cc
20941 @opindex malloc-cc
20942
20943 Dynamically allocate condition code registers.
20944
20945 @item -mfixed-cc
20946 @opindex mfixed-cc
20947
20948 Do not try to dynamically allocate condition code registers, only
20949 use @code{icc0} and @code{fcc0}.
20950
20951 @item -mdword
20952 @opindex mdword
20953
20954 Change ABI to use double word insns.
20955
20956 @item -mno-dword
20957 @opindex mno-dword
20958 @opindex mdword
20959
20960 Do not use double word instructions.
20961
20962 @item -mdouble
20963 @opindex mdouble
20964
20965 Use floating-point double instructions.
20966
20967 @item -mno-double
20968 @opindex mno-double
20969
20970 Do not use floating-point double instructions.
20971
20972 @item -mmedia
20973 @opindex mmedia
20974
20975 Use media instructions.
20976
20977 @item -mno-media
20978 @opindex mno-media
20979
20980 Do not use media instructions.
20981
20982 @item -mmuladd
20983 @opindex mmuladd
20984
20985 Use multiply and add/subtract instructions.
20986
20987 @item -mno-muladd
20988 @opindex mno-muladd
20989
20990 Do not use multiply and add/subtract instructions.
20991
20992 @item -mfdpic
20993 @opindex mfdpic
20994
20995 Select the FDPIC ABI, which uses function descriptors to represent
20996 pointers to functions.  Without any PIC/PIE-related options, it
20997 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
20998 assumes GOT entries and small data are within a 12-bit range from the
20999 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
21000 are computed with 32 bits.
21001 With a @samp{bfin-elf} target, this option implies @option{-msim}.
21002
21003 @item -minline-plt
21004 @opindex minline-plt
21005
21006 Enable inlining of PLT entries in function calls to functions that are
21007 not known to bind locally.  It has no effect without @option{-mfdpic}.
21008 It's enabled by default if optimizing for speed and compiling for
21009 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
21010 optimization option such as @option{-O3} or above is present in the
21011 command line.
21012
21013 @item -mTLS
21014 @opindex mTLS
21015
21016 Assume a large TLS segment when generating thread-local code.
21017
21018 @item -mtls
21019 @opindex mtls
21020
21021 Do not assume a large TLS segment when generating thread-local code.
21022
21023 @item -mgprel-ro
21024 @opindex mgprel-ro
21025
21026 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
21027 that is known to be in read-only sections.  It's enabled by default,
21028 except for @option{-fpic} or @option{-fpie}: even though it may help
21029 make the global offset table smaller, it trades 1 instruction for 4.
21030 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
21031 one of which may be shared by multiple symbols, and it avoids the need
21032 for a GOT entry for the referenced symbol, so it's more likely to be a
21033 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
21034
21035 @item -multilib-library-pic
21036 @opindex multilib-library-pic
21037
21038 Link with the (library, not FD) pic libraries.  It's implied by
21039 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
21040 @option{-fpic} without @option{-mfdpic}.  You should never have to use
21041 it explicitly.
21042
21043 @item -mlinked-fp
21044 @opindex mlinked-fp
21045
21046 Follow the EABI requirement of always creating a frame pointer whenever
21047 a stack frame is allocated.  This option is enabled by default and can
21048 be disabled with @option{-mno-linked-fp}.
21049
21050 @item -mlong-calls
21051 @opindex mlong-calls
21052
21053 Use indirect addressing to call functions outside the current
21054 compilation unit.  This allows the functions to be placed anywhere
21055 within the 32-bit address space.
21056
21057 @item -malign-labels
21058 @opindex malign-labels
21059
21060 Try to align labels to an 8-byte boundary by inserting NOPs into the
21061 previous packet.  This option only has an effect when VLIW packing
21062 is enabled.  It doesn't create new packets; it merely adds NOPs to
21063 existing ones.
21064
21065 @item -mlibrary-pic
21066 @opindex mlibrary-pic
21067
21068 Generate position-independent EABI code.
21069
21070 @item -macc-4
21071 @opindex macc-4
21072
21073 Use only the first four media accumulator registers.
21074
21075 @item -macc-8
21076 @opindex macc-8
21077
21078 Use all eight media accumulator registers.
21079
21080 @item -mpack
21081 @opindex mpack
21082
21083 Pack VLIW instructions.
21084
21085 @item -mno-pack
21086 @opindex mno-pack
21087
21088 Do not pack VLIW instructions.
21089
21090 @item -mno-eflags
21091 @opindex mno-eflags
21092
21093 Do not mark ABI switches in e_flags.
21094
21095 @item -mcond-move
21096 @opindex mcond-move
21097
21098 Enable the use of conditional-move instructions (default).
21099
21100 This switch is mainly for debugging the compiler and will likely be removed
21101 in a future version.
21102
21103 @item -mno-cond-move
21104 @opindex mno-cond-move
21105
21106 Disable the use of conditional-move instructions.
21107
21108 This switch is mainly for debugging the compiler and will likely be removed
21109 in a future version.
21110
21111 @item -mscc
21112 @opindex mscc
21113
21114 Enable the use of conditional set instructions (default).
21115
21116 This switch is mainly for debugging the compiler and will likely be removed
21117 in a future version.
21118
21119 @item -mno-scc
21120 @opindex mno-scc
21121
21122 Disable the use of conditional set instructions.
21123
21124 This switch is mainly for debugging the compiler and will likely be removed
21125 in a future version.
21126
21127 @item -mcond-exec
21128 @opindex mcond-exec
21129
21130 Enable the use of conditional execution (default).
21131
21132 This switch is mainly for debugging the compiler and will likely be removed
21133 in a future version.
21134
21135 @item -mno-cond-exec
21136 @opindex mno-cond-exec
21137
21138 Disable the use of conditional execution.
21139
21140 This switch is mainly for debugging the compiler and will likely be removed
21141 in a future version.
21142
21143 @item -mvliw-branch
21144 @opindex mvliw-branch
21145
21146 Run a pass to pack branches into VLIW instructions (default).
21147
21148 This switch is mainly for debugging the compiler and will likely be removed
21149 in a future version.
21150
21151 @item -mno-vliw-branch
21152 @opindex mno-vliw-branch
21153
21154 Do not run a pass to pack branches into VLIW instructions.
21155
21156 This switch is mainly for debugging the compiler and will likely be removed
21157 in a future version.
21158
21159 @item -mmulti-cond-exec
21160 @opindex mmulti-cond-exec
21161
21162 Enable optimization of @code{&&} and @code{||} in conditional execution
21163 (default).
21164
21165 This switch is mainly for debugging the compiler and will likely be removed
21166 in a future version.
21167
21168 @item -mno-multi-cond-exec
21169 @opindex mno-multi-cond-exec
21170
21171 Disable optimization of @code{&&} and @code{||} in conditional execution.
21172
21173 This switch is mainly for debugging the compiler and will likely be removed
21174 in a future version.
21175
21176 @item -mnested-cond-exec
21177 @opindex mnested-cond-exec
21178
21179 Enable nested conditional execution optimizations (default).
21180
21181 This switch is mainly for debugging the compiler and will likely be removed
21182 in a future version.
21183
21184 @item -mno-nested-cond-exec
21185 @opindex mno-nested-cond-exec
21186
21187 Disable nested conditional execution optimizations.
21188
21189 This switch is mainly for debugging the compiler and will likely be removed
21190 in a future version.
21191
21192 @item -moptimize-membar
21193 @opindex moptimize-membar
21194
21195 This switch removes redundant @code{membar} instructions from the
21196 compiler-generated code.  It is enabled by default.
21197
21198 @item -mno-optimize-membar
21199 @opindex mno-optimize-membar
21200 @opindex moptimize-membar
21201
21202 This switch disables the automatic removal of redundant @code{membar}
21203 instructions from the generated code.
21204
21205 @item -mtomcat-stats
21206 @opindex mtomcat-stats
21207
21208 Cause gas to print out tomcat statistics.
21209
21210 @item -mcpu=@var{cpu}
21211 @opindex mcpu
21212
21213 Select the processor type for which to generate code.  Possible values are
21214 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
21215 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
21216
21217 @end table
21218
21219 @node GNU/Linux Options
21220 @subsection GNU/Linux Options
21221
21222 These @samp{-m} options are defined for GNU/Linux targets:
21223
21224 @table @gcctabopt
21225 @item -mglibc
21226 @opindex mglibc
21227 Use the GNU C library.  This is the default except
21228 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
21229 @samp{*-*-linux-*android*} targets.
21230
21231 @item -muclibc
21232 @opindex muclibc
21233 Use uClibc C library.  This is the default on
21234 @samp{*-*-linux-*uclibc*} targets.
21235
21236 @item -mmusl
21237 @opindex mmusl
21238 Use the musl C library.  This is the default on
21239 @samp{*-*-linux-*musl*} targets.
21240
21241 @item -mbionic
21242 @opindex mbionic
21243 Use Bionic C library.  This is the default on
21244 @samp{*-*-linux-*android*} targets.
21245
21246 @item -mandroid
21247 @opindex mandroid
21248 Compile code compatible with Android platform.  This is the default on
21249 @samp{*-*-linux-*android*} targets.
21250
21251 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
21252 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
21253 this option makes the GCC driver pass Android-specific options to the linker.
21254 Finally, this option causes the preprocessor macro @code{__ANDROID__}
21255 to be defined.
21256
21257 @item -tno-android-cc
21258 @opindex tno-android-cc
21259 Disable compilation effects of @option{-mandroid}, i.e., do not enable
21260 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
21261 @option{-fno-rtti} by default.
21262
21263 @item -tno-android-ld
21264 @opindex tno-android-ld
21265 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
21266 linking options to the linker.
21267
21268 @end table
21269
21270 @node H8/300 Options
21271 @subsection H8/300 Options
21272
21273 These @samp{-m} options are defined for the H8/300 implementations:
21274
21275 @table @gcctabopt
21276 @item -mrelax
21277 @opindex mrelax
21278 Shorten some address references at link time, when possible; uses the
21279 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
21280 ld, Using ld}, for a fuller description.
21281
21282 @item -mh
21283 @opindex mh
21284 Generate code for the H8/300H@.
21285
21286 @item -ms
21287 @opindex ms
21288 Generate code for the H8S@.
21289
21290 @item -mn
21291 @opindex mn
21292 Generate code for the H8S and H8/300H in the normal mode.  This switch
21293 must be used either with @option{-mh} or @option{-ms}.
21294
21295 @item -ms2600
21296 @opindex ms2600
21297 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
21298
21299 @item -mexr
21300 @opindex mexr
21301 Extended registers are stored on stack before execution of function
21302 with monitor attribute. Default option is @option{-mexr}.
21303 This option is valid only for H8S targets.
21304
21305 @item -mno-exr
21306 @opindex mno-exr
21307 @opindex mexr
21308 Extended registers are not stored on stack before execution of function 
21309 with monitor attribute. Default option is @option{-mno-exr}. 
21310 This option is valid only for H8S targets.
21311
21312 @item -mint32
21313 @opindex mint32
21314 Make @code{int} data 32 bits by default.
21315
21316 @item -malign-300
21317 @opindex malign-300
21318 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
21319 The default for the H8/300H and H8S is to align longs and floats on
21320 4-byte boundaries.
21321 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
21322 This option has no effect on the H8/300.
21323 @end table
21324
21325 @node HPPA Options
21326 @subsection HPPA Options
21327 @cindex HPPA Options
21328
21329 These @samp{-m} options are defined for the HPPA family of computers:
21330
21331 @table @gcctabopt
21332 @item -march=@var{architecture-type}
21333 @opindex march
21334 Generate code for the specified architecture.  The choices for
21335 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
21336 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
21337 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
21338 architecture option for your machine.  Code compiled for lower numbered
21339 architectures runs on higher numbered architectures, but not the
21340 other way around.
21341
21342 @item -mpa-risc-1-0
21343 @itemx -mpa-risc-1-1
21344 @itemx -mpa-risc-2-0
21345 @opindex mpa-risc-1-0
21346 @opindex mpa-risc-1-1
21347 @opindex mpa-risc-2-0
21348 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
21349
21350 @item -mcaller-copies
21351 @opindex mcaller-copies
21352 The caller copies function arguments passed by hidden reference.  This
21353 option should be used with care as it is not compatible with the default
21354 32-bit runtime.  However, only aggregates larger than eight bytes are
21355 passed by hidden reference and the option provides better compatibility
21356 with OpenMP.
21357
21358 @item -mjump-in-delay
21359 @opindex mjump-in-delay
21360 This option is ignored and provided for compatibility purposes only.
21361
21362 @item -mdisable-fpregs
21363 @opindex mdisable-fpregs
21364 Prevent floating-point registers from being used in any manner.  This is
21365 necessary for compiling kernels that perform lazy context switching of
21366 floating-point registers.  If you use this option and attempt to perform
21367 floating-point operations, the compiler aborts.
21368
21369 @item -mdisable-indexing
21370 @opindex mdisable-indexing
21371 Prevent the compiler from using indexing address modes.  This avoids some
21372 rather obscure problems when compiling MIG generated code under MACH@.
21373
21374 @item -mno-space-regs
21375 @opindex mno-space-regs
21376 @opindex mspace-regs
21377 Generate code that assumes the target has no space registers.  This allows
21378 GCC to generate faster indirect calls and use unscaled index address modes.
21379
21380 Such code is suitable for level 0 PA systems and kernels.
21381
21382 @item -mfast-indirect-calls
21383 @opindex mfast-indirect-calls
21384 Generate code that assumes calls never cross space boundaries.  This
21385 allows GCC to emit code that performs faster indirect calls.
21386
21387 This option does not work in the presence of shared libraries or nested
21388 functions.
21389
21390 @item -mfixed-range=@var{register-range}
21391 @opindex mfixed-range
21392 Generate code treating the given register range as fixed registers.
21393 A fixed register is one that the register allocator cannot use.  This is
21394 useful when compiling kernel code.  A register range is specified as
21395 two registers separated by a dash.  Multiple register ranges can be
21396 specified separated by a comma.
21397
21398 @item -mlong-load-store
21399 @opindex mlong-load-store
21400 Generate 3-instruction load and store sequences as sometimes required by
21401 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
21402 the HP compilers.
21403
21404 @item -mportable-runtime
21405 @opindex mportable-runtime
21406 Use the portable calling conventions proposed by HP for ELF systems.
21407
21408 @item -mgas
21409 @opindex mgas
21410 Enable the use of assembler directives only GAS understands.
21411
21412 @item -mschedule=@var{cpu-type}
21413 @opindex mschedule
21414 Schedule code according to the constraints for the machine type
21415 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
21416 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
21417 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
21418 proper scheduling option for your machine.  The default scheduling is
21419 @samp{8000}.
21420
21421 @item -mlinker-opt
21422 @opindex mlinker-opt
21423 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
21424 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
21425 linkers in which they give bogus error messages when linking some programs.
21426
21427 @item -msoft-float
21428 @opindex msoft-float
21429 Generate output containing library calls for floating point.
21430 @strong{Warning:} the requisite libraries are not available for all HPPA
21431 targets.  Normally the facilities of the machine's usual C compiler are
21432 used, but this cannot be done directly in cross-compilation.  You must make
21433 your own arrangements to provide suitable library functions for
21434 cross-compilation.
21435
21436 @option{-msoft-float} changes the calling convention in the output file;
21437 therefore, it is only useful if you compile @emph{all} of a program with
21438 this option.  In particular, you need to compile @file{libgcc.a}, the
21439 library that comes with GCC, with @option{-msoft-float} in order for
21440 this to work.
21441
21442 @item -msio
21443 @opindex msio
21444 Generate the predefine, @code{_SIO}, for server IO@.  The default is
21445 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
21446 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
21447 options are available under HP-UX and HI-UX@.
21448
21449 @item -mgnu-ld
21450 @opindex mgnu-ld
21451 Use options specific to GNU @command{ld}.
21452 This passes @option{-shared} to @command{ld} when
21453 building a shared library.  It is the default when GCC is configured,
21454 explicitly or implicitly, with the GNU linker.  This option does not
21455 affect which @command{ld} is called; it only changes what parameters
21456 are passed to that @command{ld}.
21457 The @command{ld} that is called is determined by the
21458 @option{--with-ld} configure option, GCC's program search path, and
21459 finally by the user's @env{PATH}.  The linker used by GCC can be printed
21460 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
21461 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
21462
21463 @item -mhp-ld
21464 @opindex mhp-ld
21465 Use options specific to HP @command{ld}.
21466 This passes @option{-b} to @command{ld} when building
21467 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
21468 links.  It is the default when GCC is configured, explicitly or
21469 implicitly, with the HP linker.  This option does not affect
21470 which @command{ld} is called; it only changes what parameters are passed to that
21471 @command{ld}.
21472 The @command{ld} that is called is determined by the @option{--with-ld}
21473 configure option, GCC's program search path, and finally by the user's
21474 @env{PATH}.  The linker used by GCC can be printed using @samp{which
21475 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
21476 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
21477
21478 @item -mlong-calls
21479 @opindex mno-long-calls
21480 @opindex mlong-calls
21481 Generate code that uses long call sequences.  This ensures that a call
21482 is always able to reach linker generated stubs.  The default is to generate
21483 long calls only when the distance from the call site to the beginning
21484 of the function or translation unit, as the case may be, exceeds a
21485 predefined limit set by the branch type being used.  The limits for
21486 normal calls are 7,600,000 and 240,000 bytes, respectively for the
21487 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
21488 240,000 bytes.
21489
21490 Distances are measured from the beginning of functions when using the
21491 @option{-ffunction-sections} option, or when using the @option{-mgas}
21492 and @option{-mno-portable-runtime} options together under HP-UX with
21493 the SOM linker.
21494
21495 It is normally not desirable to use this option as it degrades
21496 performance.  However, it may be useful in large applications,
21497 particularly when partial linking is used to build the application.
21498
21499 The types of long calls used depends on the capabilities of the
21500 assembler and linker, and the type of code being generated.  The
21501 impact on systems that support long absolute calls, and long pic
21502 symbol-difference or pc-relative calls should be relatively small.
21503 However, an indirect call is used on 32-bit ELF systems in pic code
21504 and it is quite long.
21505
21506 @item -munix=@var{unix-std}
21507 @opindex march
21508 Generate compiler predefines and select a startfile for the specified
21509 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
21510 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
21511 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
21512 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
21513 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
21514 and later.
21515
21516 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
21517 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
21518 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
21519 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
21520 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
21521 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
21522
21523 It is @emph{important} to note that this option changes the interfaces
21524 for various library routines.  It also affects the operational behavior
21525 of the C library.  Thus, @emph{extreme} care is needed in using this
21526 option.
21527
21528 Library code that is intended to operate with more than one UNIX
21529 standard must test, set and restore the variable @code{__xpg4_extended_mask}
21530 as appropriate.  Most GNU software doesn't provide this capability.
21531
21532 @item -nolibdld
21533 @opindex nolibdld
21534 Suppress the generation of link options to search libdld.sl when the
21535 @option{-static} option is specified on HP-UX 10 and later.
21536
21537 @item -static
21538 @opindex static
21539 The HP-UX implementation of setlocale in libc has a dependency on
21540 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
21541 when the @option{-static} option is specified, special link options
21542 are needed to resolve this dependency.
21543
21544 On HP-UX 10 and later, the GCC driver adds the necessary options to
21545 link with libdld.sl when the @option{-static} option is specified.
21546 This causes the resulting binary to be dynamic.  On the 64-bit port,
21547 the linkers generate dynamic binaries by default in any case.  The
21548 @option{-nolibdld} option can be used to prevent the GCC driver from
21549 adding these link options.
21550
21551 @item -threads
21552 @opindex threads
21553 Add support for multithreading with the @dfn{dce thread} library
21554 under HP-UX@.  This option sets flags for both the preprocessor and
21555 linker.
21556 @end table
21557
21558 @node IA-64 Options
21559 @subsection IA-64 Options
21560 @cindex IA-64 Options
21561
21562 These are the @samp{-m} options defined for the Intel IA-64 architecture.
21563
21564 @table @gcctabopt
21565 @item -mbig-endian
21566 @opindex mbig-endian
21567 Generate code for a big-endian target.  This is the default for HP-UX@.
21568
21569 @item -mlittle-endian
21570 @opindex mlittle-endian
21571 Generate code for a little-endian target.  This is the default for AIX5
21572 and GNU/Linux.
21573
21574 @item -mgnu-as
21575 @itemx -mno-gnu-as
21576 @opindex mgnu-as
21577 @opindex mno-gnu-as
21578 Generate (or don't) code for the GNU assembler.  This is the default.
21579 @c Also, this is the default if the configure option @option{--with-gnu-as}
21580 @c is used.
21581
21582 @item -mgnu-ld
21583 @itemx -mno-gnu-ld
21584 @opindex mgnu-ld
21585 @opindex mno-gnu-ld
21586 Generate (or don't) code for the GNU linker.  This is the default.
21587 @c Also, this is the default if the configure option @option{--with-gnu-ld}
21588 @c is used.
21589
21590 @item -mno-pic
21591 @opindex mno-pic
21592 Generate code that does not use a global pointer register.  The result
21593 is not position independent code, and violates the IA-64 ABI@.
21594
21595 @item -mvolatile-asm-stop
21596 @itemx -mno-volatile-asm-stop
21597 @opindex mvolatile-asm-stop
21598 @opindex mno-volatile-asm-stop
21599 Generate (or don't) a stop bit immediately before and after volatile asm
21600 statements.
21601
21602 @item -mregister-names
21603 @itemx -mno-register-names
21604 @opindex mregister-names
21605 @opindex mno-register-names
21606 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
21607 the stacked registers.  This may make assembler output more readable.
21608
21609 @item -mno-sdata
21610 @itemx -msdata
21611 @opindex mno-sdata
21612 @opindex msdata
21613 Disable (or enable) optimizations that use the small data section.  This may
21614 be useful for working around optimizer bugs.
21615
21616 @item -mconstant-gp
21617 @opindex mconstant-gp
21618 Generate code that uses a single constant global pointer value.  This is
21619 useful when compiling kernel code.
21620
21621 @item -mauto-pic
21622 @opindex mauto-pic
21623 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
21624 This is useful when compiling firmware code.
21625
21626 @item -minline-float-divide-min-latency
21627 @opindex minline-float-divide-min-latency
21628 Generate code for inline divides of floating-point values
21629 using the minimum latency algorithm.
21630
21631 @item -minline-float-divide-max-throughput
21632 @opindex minline-float-divide-max-throughput
21633 Generate code for inline divides of floating-point values
21634 using the maximum throughput algorithm.
21635
21636 @item -mno-inline-float-divide
21637 @opindex mno-inline-float-divide
21638 Do not generate inline code for divides of floating-point values.
21639
21640 @item -minline-int-divide-min-latency
21641 @opindex minline-int-divide-min-latency
21642 Generate code for inline divides of integer values
21643 using the minimum latency algorithm.
21644
21645 @item -minline-int-divide-max-throughput
21646 @opindex minline-int-divide-max-throughput
21647 Generate code for inline divides of integer values
21648 using the maximum throughput algorithm.
21649
21650 @item -mno-inline-int-divide
21651 @opindex mno-inline-int-divide
21652 @opindex minline-int-divide
21653 Do not generate inline code for divides of integer values.
21654
21655 @item -minline-sqrt-min-latency
21656 @opindex minline-sqrt-min-latency
21657 Generate code for inline square roots
21658 using the minimum latency algorithm.
21659
21660 @item -minline-sqrt-max-throughput
21661 @opindex minline-sqrt-max-throughput
21662 Generate code for inline square roots
21663 using the maximum throughput algorithm.
21664
21665 @item -mno-inline-sqrt
21666 @opindex mno-inline-sqrt
21667 Do not generate inline code for @code{sqrt}.
21668
21669 @item -mfused-madd
21670 @itemx -mno-fused-madd
21671 @opindex mfused-madd
21672 @opindex mno-fused-madd
21673 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
21674 instructions.  The default is to use these instructions.
21675
21676 @item -mno-dwarf2-asm
21677 @itemx -mdwarf2-asm
21678 @opindex mno-dwarf2-asm
21679 @opindex mdwarf2-asm
21680 Don't (or do) generate assembler code for the DWARF line number debugging
21681 info.  This may be useful when not using the GNU assembler.
21682
21683 @item -mearly-stop-bits
21684 @itemx -mno-early-stop-bits
21685 @opindex mearly-stop-bits
21686 @opindex mno-early-stop-bits
21687 Allow stop bits to be placed earlier than immediately preceding the
21688 instruction that triggered the stop bit.  This can improve instruction
21689 scheduling, but does not always do so.
21690
21691 @item -mfixed-range=@var{register-range}
21692 @opindex mfixed-range
21693 Generate code treating the given register range as fixed registers.
21694 A fixed register is one that the register allocator cannot use.  This is
21695 useful when compiling kernel code.  A register range is specified as
21696 two registers separated by a dash.  Multiple register ranges can be
21697 specified separated by a comma.
21698
21699 @item -mtls-size=@var{tls-size}
21700 @opindex mtls-size
21701 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
21702 64.
21703
21704 @item -mtune=@var{cpu-type}
21705 @opindex mtune
21706 Tune the instruction scheduling for a particular CPU, Valid values are
21707 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
21708 and @samp{mckinley}.
21709
21710 @item -milp32
21711 @itemx -mlp64
21712 @opindex milp32
21713 @opindex mlp64
21714 Generate code for a 32-bit or 64-bit environment.
21715 The 32-bit environment sets int, long and pointer to 32 bits.
21716 The 64-bit environment sets int to 32 bits and long and pointer
21717 to 64 bits.  These are HP-UX specific flags.
21718
21719 @item -mno-sched-br-data-spec
21720 @itemx -msched-br-data-spec
21721 @opindex mno-sched-br-data-spec
21722 @opindex msched-br-data-spec
21723 (Dis/En)able data speculative scheduling before reload.
21724 This results in generation of @code{ld.a} instructions and
21725 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
21726 The default setting is disabled.
21727
21728 @item -msched-ar-data-spec
21729 @itemx -mno-sched-ar-data-spec
21730 @opindex msched-ar-data-spec
21731 @opindex mno-sched-ar-data-spec
21732 (En/Dis)able data speculative scheduling after reload.
21733 This results in generation of @code{ld.a} instructions and
21734 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
21735 The default setting is enabled.
21736
21737 @item -mno-sched-control-spec
21738 @itemx -msched-control-spec
21739 @opindex mno-sched-control-spec
21740 @opindex msched-control-spec
21741 (Dis/En)able control speculative scheduling.  This feature is
21742 available only during region scheduling (i.e.@: before reload).
21743 This results in generation of the @code{ld.s} instructions and
21744 the corresponding check instructions @code{chk.s}.
21745 The default setting is disabled.
21746
21747 @item -msched-br-in-data-spec
21748 @itemx -mno-sched-br-in-data-spec
21749 @opindex msched-br-in-data-spec
21750 @opindex mno-sched-br-in-data-spec
21751 (En/Dis)able speculative scheduling of the instructions that
21752 are dependent on the data speculative loads before reload.
21753 This is effective only with @option{-msched-br-data-spec} enabled.
21754 The default setting is enabled.
21755
21756 @item -msched-ar-in-data-spec
21757 @itemx -mno-sched-ar-in-data-spec
21758 @opindex msched-ar-in-data-spec
21759 @opindex mno-sched-ar-in-data-spec
21760 (En/Dis)able speculative scheduling of the instructions that
21761 are dependent on the data speculative loads after reload.
21762 This is effective only with @option{-msched-ar-data-spec} enabled.
21763 The default setting is enabled.
21764
21765 @item -msched-in-control-spec
21766 @itemx -mno-sched-in-control-spec
21767 @opindex msched-in-control-spec
21768 @opindex mno-sched-in-control-spec
21769 (En/Dis)able speculative scheduling of the instructions that
21770 are dependent on the control speculative loads.
21771 This is effective only with @option{-msched-control-spec} enabled.
21772 The default setting is enabled.
21773
21774 @item -mno-sched-prefer-non-data-spec-insns
21775 @itemx -msched-prefer-non-data-spec-insns
21776 @opindex mno-sched-prefer-non-data-spec-insns
21777 @opindex msched-prefer-non-data-spec-insns
21778 If enabled, data-speculative instructions are chosen for schedule
21779 only if there are no other choices at the moment.  This makes
21780 the use of the data speculation much more conservative.
21781 The default setting is disabled.
21782
21783 @item -mno-sched-prefer-non-control-spec-insns
21784 @itemx -msched-prefer-non-control-spec-insns
21785 @opindex mno-sched-prefer-non-control-spec-insns
21786 @opindex msched-prefer-non-control-spec-insns
21787 If enabled, control-speculative instructions are chosen for schedule
21788 only if there are no other choices at the moment.  This makes
21789 the use of the control speculation much more conservative.
21790 The default setting is disabled.
21791
21792 @item -mno-sched-count-spec-in-critical-path
21793 @itemx -msched-count-spec-in-critical-path
21794 @opindex mno-sched-count-spec-in-critical-path
21795 @opindex msched-count-spec-in-critical-path
21796 If enabled, speculative dependencies are considered during
21797 computation of the instructions priorities.  This makes the use of the
21798 speculation a bit more conservative.
21799 The default setting is disabled.
21800
21801 @item -msched-spec-ldc
21802 @opindex msched-spec-ldc
21803 Use a simple data speculation check.  This option is on by default.
21804
21805 @item -msched-control-spec-ldc
21806 @opindex msched-spec-ldc
21807 Use a simple check for control speculation.  This option is on by default.
21808
21809 @item -msched-stop-bits-after-every-cycle
21810 @opindex msched-stop-bits-after-every-cycle
21811 Place a stop bit after every cycle when scheduling.  This option is on
21812 by default.
21813
21814 @item -msched-fp-mem-deps-zero-cost
21815 @opindex msched-fp-mem-deps-zero-cost
21816 Assume that floating-point stores and loads are not likely to cause a conflict
21817 when placed into the same instruction group.  This option is disabled by
21818 default.
21819
21820 @item -msel-sched-dont-check-control-spec
21821 @opindex msel-sched-dont-check-control-spec
21822 Generate checks for control speculation in selective scheduling.
21823 This flag is disabled by default.
21824
21825 @item -msched-max-memory-insns=@var{max-insns}
21826 @opindex msched-max-memory-insns
21827 Limit on the number of memory insns per instruction group, giving lower
21828 priority to subsequent memory insns attempting to schedule in the same
21829 instruction group. Frequently useful to prevent cache bank conflicts.
21830 The default value is 1.
21831
21832 @item -msched-max-memory-insns-hard-limit
21833 @opindex msched-max-memory-insns-hard-limit
21834 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
21835 disallowing more than that number in an instruction group.
21836 Otherwise, the limit is ``soft'', meaning that non-memory operations
21837 are preferred when the limit is reached, but memory operations may still
21838 be scheduled.
21839
21840 @end table
21841
21842 @node LM32 Options
21843 @subsection LM32 Options
21844 @cindex LM32 options
21845
21846 These @option{-m} options are defined for the LatticeMico32 architecture:
21847
21848 @table @gcctabopt
21849 @item -mbarrel-shift-enabled
21850 @opindex mbarrel-shift-enabled
21851 Enable barrel-shift instructions.
21852
21853 @item -mdivide-enabled
21854 @opindex mdivide-enabled
21855 Enable divide and modulus instructions.
21856
21857 @item -mmultiply-enabled
21858 @opindex multiply-enabled
21859 Enable multiply instructions.
21860
21861 @item -msign-extend-enabled
21862 @opindex msign-extend-enabled
21863 Enable sign extend instructions.
21864
21865 @item -muser-enabled
21866 @opindex muser-enabled
21867 Enable user-defined instructions.
21868
21869 @end table
21870
21871 @node M32C Options
21872 @subsection M32C Options
21873 @cindex M32C options
21874
21875 @table @gcctabopt
21876 @item -mcpu=@var{name}
21877 @opindex mcpu=
21878 Select the CPU for which code is generated.  @var{name} may be one of
21879 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
21880 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
21881 the M32C/80 series.
21882
21883 @item -msim
21884 @opindex msim
21885 Specifies that the program will be run on the simulator.  This causes
21886 an alternate runtime library to be linked in which supports, for
21887 example, file I/O@.  You must not use this option when generating
21888 programs that will run on real hardware; you must provide your own
21889 runtime library for whatever I/O functions are needed.
21890
21891 @item -memregs=@var{number}
21892 @opindex memregs=
21893 Specifies the number of memory-based pseudo-registers GCC uses
21894 during code generation.  These pseudo-registers are used like real
21895 registers, so there is a tradeoff between GCC's ability to fit the
21896 code into available registers, and the performance penalty of using
21897 memory instead of registers.  Note that all modules in a program must
21898 be compiled with the same value for this option.  Because of that, you
21899 must not use this option with GCC's default runtime libraries.
21900
21901 @end table
21902
21903 @node M32R/D Options
21904 @subsection M32R/D Options
21905 @cindex M32R/D options
21906
21907 These @option{-m} options are defined for Renesas M32R/D architectures:
21908
21909 @table @gcctabopt
21910 @item -m32r2
21911 @opindex m32r2
21912 Generate code for the M32R/2@.
21913
21914 @item -m32rx
21915 @opindex m32rx
21916 Generate code for the M32R/X@.
21917
21918 @item -m32r
21919 @opindex m32r
21920 Generate code for the M32R@.  This is the default.
21921
21922 @item -mmodel=small
21923 @opindex mmodel=small
21924 Assume all objects live in the lower 16MB of memory (so that their addresses
21925 can be loaded with the @code{ld24} instruction), and assume all subroutines
21926 are reachable with the @code{bl} instruction.
21927 This is the default.
21928
21929 The addressability of a particular object can be set with the
21930 @code{model} attribute.
21931
21932 @item -mmodel=medium
21933 @opindex mmodel=medium
21934 Assume objects may be anywhere in the 32-bit address space (the compiler
21935 generates @code{seth/add3} instructions to load their addresses), and
21936 assume all subroutines are reachable with the @code{bl} instruction.
21937
21938 @item -mmodel=large
21939 @opindex mmodel=large
21940 Assume objects may be anywhere in the 32-bit address space (the compiler
21941 generates @code{seth/add3} instructions to load their addresses), and
21942 assume subroutines may not be reachable with the @code{bl} instruction
21943 (the compiler generates the much slower @code{seth/add3/jl}
21944 instruction sequence).
21945
21946 @item -msdata=none
21947 @opindex msdata=none
21948 Disable use of the small data area.  Variables are put into
21949 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
21950 @code{section} attribute has been specified).
21951 This is the default.
21952
21953 The small data area consists of sections @code{.sdata} and @code{.sbss}.
21954 Objects may be explicitly put in the small data area with the
21955 @code{section} attribute using one of these sections.
21956
21957 @item -msdata=sdata
21958 @opindex msdata=sdata
21959 Put small global and static data in the small data area, but do not
21960 generate special code to reference them.
21961
21962 @item -msdata=use
21963 @opindex msdata=use
21964 Put small global and static data in the small data area, and generate
21965 special instructions to reference them.
21966
21967 @item -G @var{num}
21968 @opindex G
21969 @cindex smaller data references
21970 Put global and static objects less than or equal to @var{num} bytes
21971 into the small data or BSS sections instead of the normal data or BSS
21972 sections.  The default value of @var{num} is 8.
21973 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
21974 for this option to have any effect.
21975
21976 All modules should be compiled with the same @option{-G @var{num}} value.
21977 Compiling with different values of @var{num} may or may not work; if it
21978 doesn't the linker gives an error message---incorrect code is not
21979 generated.
21980
21981 @item -mdebug
21982 @opindex mdebug
21983 Makes the M32R-specific code in the compiler display some statistics
21984 that might help in debugging programs.
21985
21986 @item -malign-loops
21987 @opindex malign-loops
21988 Align all loops to a 32-byte boundary.
21989
21990 @item -mno-align-loops
21991 @opindex mno-align-loops
21992 Do not enforce a 32-byte alignment for loops.  This is the default.
21993
21994 @item -missue-rate=@var{number}
21995 @opindex missue-rate=@var{number}
21996 Issue @var{number} instructions per cycle.  @var{number} can only be 1
21997 or 2.
21998
21999 @item -mbranch-cost=@var{number}
22000 @opindex mbranch-cost=@var{number}
22001 @var{number} can only be 1 or 2.  If it is 1 then branches are
22002 preferred over conditional code, if it is 2, then the opposite applies.
22003
22004 @item -mflush-trap=@var{number}
22005 @opindex mflush-trap=@var{number}
22006 Specifies the trap number to use to flush the cache.  The default is
22007 12.  Valid numbers are between 0 and 15 inclusive.
22008
22009 @item -mno-flush-trap
22010 @opindex mno-flush-trap
22011 Specifies that the cache cannot be flushed by using a trap.
22012
22013 @item -mflush-func=@var{name}
22014 @opindex mflush-func=@var{name}
22015 Specifies the name of the operating system function to call to flush
22016 the cache.  The default is @samp{_flush_cache}, but a function call
22017 is only used if a trap is not available.
22018
22019 @item -mno-flush-func
22020 @opindex mno-flush-func
22021 Indicates that there is no OS function for flushing the cache.
22022
22023 @end table
22024
22025 @node M680x0 Options
22026 @subsection M680x0 Options
22027 @cindex M680x0 options
22028
22029 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
22030 The default settings depend on which architecture was selected when
22031 the compiler was configured; the defaults for the most common choices
22032 are given below.
22033
22034 @table @gcctabopt
22035 @item -march=@var{arch}
22036 @opindex march
22037 Generate code for a specific M680x0 or ColdFire instruction set
22038 architecture.  Permissible values of @var{arch} for M680x0
22039 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
22040 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
22041 architectures are selected according to Freescale's ISA classification
22042 and the permissible values are: @samp{isaa}, @samp{isaaplus},
22043 @samp{isab} and @samp{isac}.
22044
22045 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
22046 code for a ColdFire target.  The @var{arch} in this macro is one of the
22047 @option{-march} arguments given above.
22048
22049 When used together, @option{-march} and @option{-mtune} select code
22050 that runs on a family of similar processors but that is optimized
22051 for a particular microarchitecture.
22052
22053 @item -mcpu=@var{cpu}
22054 @opindex mcpu
22055 Generate code for a specific M680x0 or ColdFire processor.
22056 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
22057 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
22058 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
22059 below, which also classifies the CPUs into families:
22060
22061 @multitable @columnfractions 0.20 0.80
22062 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
22063 @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}
22064 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
22065 @item @samp{5206e} @tab @samp{5206e}
22066 @item @samp{5208} @tab @samp{5207} @samp{5208}
22067 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
22068 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
22069 @item @samp{5216} @tab @samp{5214} @samp{5216}
22070 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
22071 @item @samp{5225} @tab @samp{5224} @samp{5225}
22072 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
22073 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
22074 @item @samp{5249} @tab @samp{5249}
22075 @item @samp{5250} @tab @samp{5250}
22076 @item @samp{5271} @tab @samp{5270} @samp{5271}
22077 @item @samp{5272} @tab @samp{5272}
22078 @item @samp{5275} @tab @samp{5274} @samp{5275}
22079 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
22080 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
22081 @item @samp{5307} @tab @samp{5307}
22082 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
22083 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
22084 @item @samp{5407} @tab @samp{5407}
22085 @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}
22086 @end multitable
22087
22088 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
22089 @var{arch} is compatible with @var{cpu}.  Other combinations of
22090 @option{-mcpu} and @option{-march} are rejected.
22091
22092 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
22093 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
22094 where the value of @var{family} is given by the table above.
22095
22096 @item -mtune=@var{tune}
22097 @opindex mtune
22098 Tune the code for a particular microarchitecture within the
22099 constraints set by @option{-march} and @option{-mcpu}.
22100 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
22101 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
22102 and @samp{cpu32}.  The ColdFire microarchitectures
22103 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
22104
22105 You can also use @option{-mtune=68020-40} for code that needs
22106 to run relatively well on 68020, 68030 and 68040 targets.
22107 @option{-mtune=68020-60} is similar but includes 68060 targets
22108 as well.  These two options select the same tuning decisions as
22109 @option{-m68020-40} and @option{-m68020-60} respectively.
22110
22111 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
22112 when tuning for 680x0 architecture @var{arch}.  It also defines
22113 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
22114 option is used.  If GCC is tuning for a range of architectures,
22115 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
22116 it defines the macros for every architecture in the range.
22117
22118 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
22119 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
22120 of the arguments given above.
22121
22122 @item -m68000
22123 @itemx -mc68000
22124 @opindex m68000
22125 @opindex mc68000
22126 Generate output for a 68000.  This is the default
22127 when the compiler is configured for 68000-based systems.
22128 It is equivalent to @option{-march=68000}.
22129
22130 Use this option for microcontrollers with a 68000 or EC000 core,
22131 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
22132
22133 @item -m68010
22134 @opindex m68010
22135 Generate output for a 68010.  This is the default
22136 when the compiler is configured for 68010-based systems.
22137 It is equivalent to @option{-march=68010}.
22138
22139 @item -m68020
22140 @itemx -mc68020
22141 @opindex m68020
22142 @opindex mc68020
22143 Generate output for a 68020.  This is the default
22144 when the compiler is configured for 68020-based systems.
22145 It is equivalent to @option{-march=68020}.
22146
22147 @item -m68030
22148 @opindex m68030
22149 Generate output for a 68030.  This is the default when the compiler is
22150 configured for 68030-based systems.  It is equivalent to
22151 @option{-march=68030}.
22152
22153 @item -m68040
22154 @opindex m68040
22155 Generate output for a 68040.  This is the default when the compiler is
22156 configured for 68040-based systems.  It is equivalent to
22157 @option{-march=68040}.
22158
22159 This option inhibits the use of 68881/68882 instructions that have to be
22160 emulated by software on the 68040.  Use this option if your 68040 does not
22161 have code to emulate those instructions.
22162
22163 @item -m68060
22164 @opindex m68060
22165 Generate output for a 68060.  This is the default when the compiler is
22166 configured for 68060-based systems.  It is equivalent to
22167 @option{-march=68060}.
22168
22169 This option inhibits the use of 68020 and 68881/68882 instructions that
22170 have to be emulated by software on the 68060.  Use this option if your 68060
22171 does not have code to emulate those instructions.
22172
22173 @item -mcpu32
22174 @opindex mcpu32
22175 Generate output for a CPU32.  This is the default
22176 when the compiler is configured for CPU32-based systems.
22177 It is equivalent to @option{-march=cpu32}.
22178
22179 Use this option for microcontrollers with a
22180 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
22181 68336, 68340, 68341, 68349 and 68360.
22182
22183 @item -m5200
22184 @opindex m5200
22185 Generate output for a 520X ColdFire CPU@.  This is the default
22186 when the compiler is configured for 520X-based systems.
22187 It is equivalent to @option{-mcpu=5206}, and is now deprecated
22188 in favor of that option.
22189
22190 Use this option for microcontroller with a 5200 core, including
22191 the MCF5202, MCF5203, MCF5204 and MCF5206.
22192
22193 @item -m5206e
22194 @opindex m5206e
22195 Generate output for a 5206e ColdFire CPU@.  The option is now
22196 deprecated in favor of the equivalent @option{-mcpu=5206e}.
22197
22198 @item -m528x
22199 @opindex m528x
22200 Generate output for a member of the ColdFire 528X family.
22201 The option is now deprecated in favor of the equivalent
22202 @option{-mcpu=528x}.
22203
22204 @item -m5307
22205 @opindex m5307
22206 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
22207 in favor of the equivalent @option{-mcpu=5307}.
22208
22209 @item -m5407
22210 @opindex m5407
22211 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
22212 in favor of the equivalent @option{-mcpu=5407}.
22213
22214 @item -mcfv4e
22215 @opindex mcfv4e
22216 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
22217 This includes use of hardware floating-point instructions.
22218 The option is equivalent to @option{-mcpu=547x}, and is now
22219 deprecated in favor of that option.
22220
22221 @item -m68020-40
22222 @opindex m68020-40
22223 Generate output for a 68040, without using any of the new instructions.
22224 This results in code that can run relatively efficiently on either a
22225 68020/68881 or a 68030 or a 68040.  The generated code does use the
22226 68881 instructions that are emulated on the 68040.
22227
22228 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
22229
22230 @item -m68020-60
22231 @opindex m68020-60
22232 Generate output for a 68060, without using any of the new instructions.
22233 This results in code that can run relatively efficiently on either a
22234 68020/68881 or a 68030 or a 68040.  The generated code does use the
22235 68881 instructions that are emulated on the 68060.
22236
22237 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
22238
22239 @item -mhard-float
22240 @itemx -m68881
22241 @opindex mhard-float
22242 @opindex m68881
22243 Generate floating-point instructions.  This is the default for 68020
22244 and above, and for ColdFire devices that have an FPU@.  It defines the
22245 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
22246 on ColdFire targets.
22247
22248 @item -msoft-float
22249 @opindex msoft-float
22250 Do not generate floating-point instructions; use library calls instead.
22251 This is the default for 68000, 68010, and 68832 targets.  It is also
22252 the default for ColdFire devices that have no FPU.
22253
22254 @item -mdiv
22255 @itemx -mno-div
22256 @opindex mdiv
22257 @opindex mno-div
22258 Generate (do not generate) ColdFire hardware divide and remainder
22259 instructions.  If @option{-march} is used without @option{-mcpu},
22260 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
22261 architectures.  Otherwise, the default is taken from the target CPU
22262 (either the default CPU, or the one specified by @option{-mcpu}).  For
22263 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
22264 @option{-mcpu=5206e}.
22265
22266 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
22267
22268 @item -mshort
22269 @opindex mshort
22270 Consider type @code{int} to be 16 bits wide, like @code{short int}.
22271 Additionally, parameters passed on the stack are also aligned to a
22272 16-bit boundary even on targets whose API mandates promotion to 32-bit.
22273
22274 @item -mno-short
22275 @opindex mno-short
22276 Do not consider type @code{int} to be 16 bits wide.  This is the default.
22277
22278 @item -mnobitfield
22279 @itemx -mno-bitfield
22280 @opindex mnobitfield
22281 @opindex mno-bitfield
22282 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
22283 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
22284
22285 @item -mbitfield
22286 @opindex mbitfield
22287 Do use the bit-field instructions.  The @option{-m68020} option implies
22288 @option{-mbitfield}.  This is the default if you use a configuration
22289 designed for a 68020.
22290
22291 @item -mrtd
22292 @opindex mrtd
22293 Use a different function-calling convention, in which functions
22294 that take a fixed number of arguments return with the @code{rtd}
22295 instruction, which pops their arguments while returning.  This
22296 saves one instruction in the caller since there is no need to pop
22297 the arguments there.
22298
22299 This calling convention is incompatible with the one normally
22300 used on Unix, so you cannot use it if you need to call libraries
22301 compiled with the Unix compiler.
22302
22303 Also, you must provide function prototypes for all functions that
22304 take variable numbers of arguments (including @code{printf});
22305 otherwise incorrect code is generated for calls to those
22306 functions.
22307
22308 In addition, seriously incorrect code results if you call a
22309 function with too many arguments.  (Normally, extra arguments are
22310 harmlessly ignored.)
22311
22312 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
22313 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
22314
22315 The default is @option{-mno-rtd}.
22316
22317 @item -malign-int
22318 @itemx -mno-align-int
22319 @opindex malign-int
22320 @opindex mno-align-int
22321 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
22322 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
22323 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
22324 Aligning variables on 32-bit boundaries produces code that runs somewhat
22325 faster on processors with 32-bit busses at the expense of more memory.
22326
22327 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
22328 aligns structures containing the above types differently than
22329 most published application binary interface specifications for the m68k.
22330
22331 @opindex mpcrel
22332 Use the pc-relative addressing mode of the 68000 directly, instead of
22333 using a global offset table.  At present, this option implies @option{-fpic},
22334 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
22335 not presently supported with @option{-mpcrel}, though this could be supported for
22336 68020 and higher processors.
22337
22338 @item -mno-strict-align
22339 @itemx -mstrict-align
22340 @opindex mno-strict-align
22341 @opindex mstrict-align
22342 Do not (do) assume that unaligned memory references are handled by
22343 the system.
22344
22345 @item -msep-data
22346 Generate code that allows the data segment to be located in a different
22347 area of memory from the text segment.  This allows for execute-in-place in
22348 an environment without virtual memory management.  This option implies
22349 @option{-fPIC}.
22350
22351 @item -mno-sep-data
22352 Generate code that assumes that the data segment follows the text segment.
22353 This is the default.
22354
22355 @item -mid-shared-library
22356 Generate code that supports shared libraries via the library ID method.
22357 This allows for execute-in-place and shared libraries in an environment
22358 without virtual memory management.  This option implies @option{-fPIC}.
22359
22360 @item -mno-id-shared-library
22361 Generate code that doesn't assume ID-based shared libraries are being used.
22362 This is the default.
22363
22364 @item -mshared-library-id=n
22365 Specifies the identification number of the ID-based shared library being
22366 compiled.  Specifying a value of 0 generates more compact code; specifying
22367 other values forces the allocation of that number to the current
22368 library, but is no more space- or time-efficient than omitting this option.
22369
22370 @item -mxgot
22371 @itemx -mno-xgot
22372 @opindex mxgot
22373 @opindex mno-xgot
22374 When generating position-independent code for ColdFire, generate code
22375 that works if the GOT has more than 8192 entries.  This code is
22376 larger and slower than code generated without this option.  On M680x0
22377 processors, this option is not needed; @option{-fPIC} suffices.
22378
22379 GCC normally uses a single instruction to load values from the GOT@.
22380 While this is relatively efficient, it only works if the GOT
22381 is smaller than about 64k.  Anything larger causes the linker
22382 to report an error such as:
22383
22384 @cindex relocation truncated to fit (ColdFire)
22385 @smallexample
22386 relocation truncated to fit: R_68K_GOT16O foobar
22387 @end smallexample
22388
22389 If this happens, you should recompile your code with @option{-mxgot}.
22390 It should then work with very large GOTs.  However, code generated with
22391 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
22392 the value of a global symbol.
22393
22394 Note that some linkers, including newer versions of the GNU linker,
22395 can create multiple GOTs and sort GOT entries.  If you have such a linker,
22396 you should only need to use @option{-mxgot} when compiling a single
22397 object file that accesses more than 8192 GOT entries.  Very few do.
22398
22399 These options have no effect unless GCC is generating
22400 position-independent code.
22401
22402 @item -mlong-jump-table-offsets
22403 @opindex mlong-jump-table-offsets
22404 Use 32-bit offsets in @code{switch} tables.  The default is to use
22405 16-bit offsets.
22406
22407 @end table
22408
22409 @node MCore Options
22410 @subsection MCore Options
22411 @cindex MCore options
22412
22413 These are the @samp{-m} options defined for the Motorola M*Core
22414 processors.
22415
22416 @table @gcctabopt
22417
22418 @item -mhardlit
22419 @itemx -mno-hardlit
22420 @opindex mhardlit
22421 @opindex mno-hardlit
22422 Inline constants into the code stream if it can be done in two
22423 instructions or less.
22424
22425 @item -mdiv
22426 @itemx -mno-div
22427 @opindex mdiv
22428 @opindex mno-div
22429 Use the divide instruction.  (Enabled by default).
22430
22431 @item -mrelax-immediate
22432 @itemx -mno-relax-immediate
22433 @opindex mrelax-immediate
22434 @opindex mno-relax-immediate
22435 Allow arbitrary-sized immediates in bit operations.
22436
22437 @item -mwide-bitfields
22438 @itemx -mno-wide-bitfields
22439 @opindex mwide-bitfields
22440 @opindex mno-wide-bitfields
22441 Always treat bit-fields as @code{int}-sized.
22442
22443 @item -m4byte-functions
22444 @itemx -mno-4byte-functions
22445 @opindex m4byte-functions
22446 @opindex mno-4byte-functions
22447 Force all functions to be aligned to a 4-byte boundary.
22448
22449 @item -mcallgraph-data
22450 @itemx -mno-callgraph-data
22451 @opindex mcallgraph-data
22452 @opindex mno-callgraph-data
22453 Emit callgraph information.
22454
22455 @item -mslow-bytes
22456 @itemx -mno-slow-bytes
22457 @opindex mslow-bytes
22458 @opindex mno-slow-bytes
22459 Prefer word access when reading byte quantities.
22460
22461 @item -mlittle-endian
22462 @itemx -mbig-endian
22463 @opindex mlittle-endian
22464 @opindex mbig-endian
22465 Generate code for a little-endian target.
22466
22467 @item -m210
22468 @itemx -m340
22469 @opindex m210
22470 @opindex m340
22471 Generate code for the 210 processor.
22472
22473 @item -mno-lsim
22474 @opindex mno-lsim
22475 Assume that runtime support has been provided and so omit the
22476 simulator library (@file{libsim.a)} from the linker command line.
22477
22478 @item -mstack-increment=@var{size}
22479 @opindex mstack-increment
22480 Set the maximum amount for a single stack increment operation.  Large
22481 values can increase the speed of programs that contain functions
22482 that need a large amount of stack space, but they can also trigger a
22483 segmentation fault if the stack is extended too much.  The default
22484 value is 0x1000.
22485
22486 @end table
22487
22488 @node MeP Options
22489 @subsection MeP Options
22490 @cindex MeP options
22491
22492 @table @gcctabopt
22493
22494 @item -mabsdiff
22495 @opindex mabsdiff
22496 Enables the @code{abs} instruction, which is the absolute difference
22497 between two registers.
22498
22499 @item -mall-opts
22500 @opindex mall-opts
22501 Enables all the optional instructions---average, multiply, divide, bit
22502 operations, leading zero, absolute difference, min/max, clip, and
22503 saturation.
22504
22505
22506 @item -maverage
22507 @opindex maverage
22508 Enables the @code{ave} instruction, which computes the average of two
22509 registers.
22510
22511 @item -mbased=@var{n}
22512 @opindex mbased=
22513 Variables of size @var{n} bytes or smaller are placed in the
22514 @code{.based} section by default.  Based variables use the @code{$tp}
22515 register as a base register, and there is a 128-byte limit to the
22516 @code{.based} section.
22517
22518 @item -mbitops
22519 @opindex mbitops
22520 Enables the bit operation instructions---bit test (@code{btstm}), set
22521 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
22522 test-and-set (@code{tas}).
22523
22524 @item -mc=@var{name}
22525 @opindex mc=
22526 Selects which section constant data is placed in.  @var{name} may
22527 be @samp{tiny}, @samp{near}, or @samp{far}.
22528
22529 @item -mclip
22530 @opindex mclip
22531 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
22532 useful unless you also provide @option{-mminmax}.
22533
22534 @item -mconfig=@var{name}
22535 @opindex mconfig=
22536 Selects one of the built-in core configurations.  Each MeP chip has
22537 one or more modules in it; each module has a core CPU and a variety of
22538 coprocessors, optional instructions, and peripherals.  The
22539 @code{MeP-Integrator} tool, not part of GCC, provides these
22540 configurations through this option; using this option is the same as
22541 using all the corresponding command-line options.  The default
22542 configuration is @samp{default}.
22543
22544 @item -mcop
22545 @opindex mcop
22546 Enables the coprocessor instructions.  By default, this is a 32-bit
22547 coprocessor.  Note that the coprocessor is normally enabled via the
22548 @option{-mconfig=} option.
22549
22550 @item -mcop32
22551 @opindex mcop32
22552 Enables the 32-bit coprocessor's instructions.
22553
22554 @item -mcop64
22555 @opindex mcop64
22556 Enables the 64-bit coprocessor's instructions.
22557
22558 @item -mivc2
22559 @opindex mivc2
22560 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
22561
22562 @item -mdc
22563 @opindex mdc
22564 Causes constant variables to be placed in the @code{.near} section.
22565
22566 @item -mdiv
22567 @opindex mdiv
22568 Enables the @code{div} and @code{divu} instructions.
22569
22570 @item -meb
22571 @opindex meb
22572 Generate big-endian code.
22573
22574 @item -mel
22575 @opindex mel
22576 Generate little-endian code.
22577
22578 @item -mio-volatile
22579 @opindex mio-volatile
22580 Tells the compiler that any variable marked with the @code{io}
22581 attribute is to be considered volatile.
22582
22583 @item -ml
22584 @opindex ml
22585 Causes variables to be assigned to the @code{.far} section by default.
22586
22587 @item -mleadz
22588 @opindex mleadz
22589 Enables the @code{leadz} (leading zero) instruction.
22590
22591 @item -mm
22592 @opindex mm
22593 Causes variables to be assigned to the @code{.near} section by default.
22594
22595 @item -mminmax
22596 @opindex mminmax
22597 Enables the @code{min} and @code{max} instructions.
22598
22599 @item -mmult
22600 @opindex mmult
22601 Enables the multiplication and multiply-accumulate instructions.
22602
22603 @item -mno-opts
22604 @opindex mno-opts
22605 Disables all the optional instructions enabled by @option{-mall-opts}.
22606
22607 @item -mrepeat
22608 @opindex mrepeat
22609 Enables the @code{repeat} and @code{erepeat} instructions, used for
22610 low-overhead looping.
22611
22612 @item -ms
22613 @opindex ms
22614 Causes all variables to default to the @code{.tiny} section.  Note
22615 that there is a 65536-byte limit to this section.  Accesses to these
22616 variables use the @code{%gp} base register.
22617
22618 @item -msatur
22619 @opindex msatur
22620 Enables the saturation instructions.  Note that the compiler does not
22621 currently generate these itself, but this option is included for
22622 compatibility with other tools, like @code{as}.
22623
22624 @item -msdram
22625 @opindex msdram
22626 Link the SDRAM-based runtime instead of the default ROM-based runtime.
22627
22628 @item -msim
22629 @opindex msim
22630 Link the simulator run-time libraries.
22631
22632 @item -msimnovec
22633 @opindex msimnovec
22634 Link the simulator runtime libraries, excluding built-in support
22635 for reset and exception vectors and tables.
22636
22637 @item -mtf
22638 @opindex mtf
22639 Causes all functions to default to the @code{.far} section.  Without
22640 this option, functions default to the @code{.near} section.
22641
22642 @item -mtiny=@var{n}
22643 @opindex mtiny=
22644 Variables that are @var{n} bytes or smaller are allocated to the
22645 @code{.tiny} section.  These variables use the @code{$gp} base
22646 register.  The default for this option is 4, but note that there's a
22647 65536-byte limit to the @code{.tiny} section.
22648
22649 @end table
22650
22651 @node MicroBlaze Options
22652 @subsection MicroBlaze Options
22653 @cindex MicroBlaze Options
22654
22655 @table @gcctabopt
22656
22657 @item -msoft-float
22658 @opindex msoft-float
22659 Use software emulation for floating point (default).
22660
22661 @item -mhard-float
22662 @opindex mhard-float
22663 Use hardware floating-point instructions.
22664
22665 @item -mmemcpy
22666 @opindex mmemcpy
22667 Do not optimize block moves, use @code{memcpy}.
22668
22669 @item -mno-clearbss
22670 @opindex mno-clearbss
22671 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
22672
22673 @item -mcpu=@var{cpu-type}
22674 @opindex mcpu=
22675 Use features of, and schedule code for, the given CPU.
22676 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
22677 where @var{X} is a major version, @var{YY} is the minor version, and
22678 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
22679 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v6.00.a}.
22680
22681 @item -mxl-soft-mul
22682 @opindex mxl-soft-mul
22683 Use software multiply emulation (default).
22684
22685 @item -mxl-soft-div
22686 @opindex mxl-soft-div
22687 Use software emulation for divides (default).
22688
22689 @item -mxl-barrel-shift
22690 @opindex mxl-barrel-shift
22691 Use the hardware barrel shifter.
22692
22693 @item -mxl-pattern-compare
22694 @opindex mxl-pattern-compare
22695 Use pattern compare instructions.
22696
22697 @item -msmall-divides
22698 @opindex msmall-divides
22699 Use table lookup optimization for small signed integer divisions.
22700
22701 @item -mxl-stack-check
22702 @opindex mxl-stack-check
22703 This option is deprecated.  Use @option{-fstack-check} instead.
22704
22705 @item -mxl-gp-opt
22706 @opindex mxl-gp-opt
22707 Use GP-relative @code{.sdata}/@code{.sbss} sections.
22708
22709 @item -mxl-multiply-high
22710 @opindex mxl-multiply-high
22711 Use multiply high instructions for high part of 32x32 multiply.
22712
22713 @item -mxl-float-convert
22714 @opindex mxl-float-convert
22715 Use hardware floating-point conversion instructions.
22716
22717 @item -mxl-float-sqrt
22718 @opindex mxl-float-sqrt
22719 Use hardware floating-point square root instruction.
22720
22721 @item -mbig-endian
22722 @opindex mbig-endian
22723 Generate code for a big-endian target.
22724
22725 @item -mlittle-endian
22726 @opindex mlittle-endian
22727 Generate code for a little-endian target.
22728
22729 @item -mxl-reorder
22730 @opindex mxl-reorder
22731 Use reorder instructions (swap and byte reversed load/store).
22732
22733 @item -mxl-mode-@var{app-model}
22734 Select application model @var{app-model}.  Valid models are
22735 @table @samp
22736 @item executable
22737 normal executable (default), uses startup code @file{crt0.o}.
22738
22739 @item -mpic-data-is-text-relative
22740 @opindex mpic-data-is-text-relative
22741 Assume that the displacement between the text and data segments is fixed
22742 at static link time.  This allows data to be referenced by offset from start of
22743 text address instead of GOT since PC-relative addressing is not supported.
22744
22745 @item xmdstub
22746 for use with Xilinx Microprocessor Debugger (XMD) based
22747 software intrusive debug agent called xmdstub. This uses startup file
22748 @file{crt1.o} and sets the start address of the program to 0x800.
22749
22750 @item bootstrap
22751 for applications that are loaded using a bootloader.
22752 This model uses startup file @file{crt2.o} which does not contain a processor
22753 reset vector handler. This is suitable for transferring control on a
22754 processor reset to the bootloader rather than the application.
22755
22756 @item novectors
22757 for applications that do not require any of the
22758 MicroBlaze vectors. This option may be useful for applications running
22759 within a monitoring application. This model uses @file{crt3.o} as a startup file.
22760 @end table
22761
22762 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
22763 @option{-mxl-mode-@var{app-model}}.
22764
22765 @end table
22766
22767 @node MIPS Options
22768 @subsection MIPS Options
22769 @cindex MIPS options
22770
22771 @table @gcctabopt
22772
22773 @item -EB
22774 @opindex EB
22775 Generate big-endian code.
22776
22777 @item -EL
22778 @opindex EL
22779 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
22780 configurations.
22781
22782 @item -march=@var{arch}
22783 @opindex march
22784 Generate code that runs on @var{arch}, which can be the name of a
22785 generic MIPS ISA, or the name of a particular processor.
22786 The ISA names are:
22787 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
22788 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
22789 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
22790 @samp{mips64r5} and @samp{mips64r6}.
22791 The processor names are:
22792 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
22793 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
22794 @samp{5kc}, @samp{5kf},
22795 @samp{20kc},
22796 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
22797 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
22798 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
22799 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
22800 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
22801 @samp{i6400}, @samp{i6500},
22802 @samp{interaptiv},
22803 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a}, @samp{gs464},
22804 @samp{gs464e}, @samp{gs264e},
22805 @samp{m4k},
22806 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
22807 @samp{m5100}, @samp{m5101},
22808 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
22809 @samp{orion},
22810 @samp{p5600}, @samp{p6600},
22811 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
22812 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r5900},
22813 @samp{r6000}, @samp{r8000},
22814 @samp{rm7000}, @samp{rm9000},
22815 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
22816 @samp{sb1},
22817 @samp{sr71000},
22818 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
22819 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
22820 @samp{xlr} and @samp{xlp}.
22821 The special value @samp{from-abi} selects the
22822 most compatible architecture for the selected ABI (that is,
22823 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
22824
22825 The native Linux/GNU toolchain also supports the value @samp{native},
22826 which selects the best architecture option for the host processor.
22827 @option{-march=native} has no effect if GCC does not recognize
22828 the processor.
22829
22830 In processor names, a final @samp{000} can be abbreviated as @samp{k}
22831 (for example, @option{-march=r2k}).  Prefixes are optional, and
22832 @samp{vr} may be written @samp{r}.
22833
22834 Names of the form @samp{@var{n}f2_1} refer to processors with
22835 FPUs clocked at half the rate of the core, names of the form
22836 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
22837 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
22838 processors with FPUs clocked a ratio of 3:2 with respect to the core.
22839 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
22840 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
22841 accepted as synonyms for @samp{@var{n}f1_1}.
22842
22843 GCC defines two macros based on the value of this option.  The first
22844 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
22845 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
22846 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
22847 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
22848 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
22849
22850 Note that the @code{_MIPS_ARCH} macro uses the processor names given
22851 above.  In other words, it has the full prefix and does not
22852 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
22853 the macro names the resolved architecture (either @code{"mips1"} or
22854 @code{"mips3"}).  It names the default architecture when no
22855 @option{-march} option is given.
22856
22857 @item -mtune=@var{arch}
22858 @opindex mtune
22859 Optimize for @var{arch}.  Among other things, this option controls
22860 the way instructions are scheduled, and the perceived cost of arithmetic
22861 operations.  The list of @var{arch} values is the same as for
22862 @option{-march}.
22863
22864 When this option is not used, GCC optimizes for the processor
22865 specified by @option{-march}.  By using @option{-march} and
22866 @option{-mtune} together, it is possible to generate code that
22867 runs on a family of processors, but optimize the code for one
22868 particular member of that family.
22869
22870 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
22871 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
22872 @option{-march} ones described above.
22873
22874 @item -mips1
22875 @opindex mips1
22876 Equivalent to @option{-march=mips1}.
22877
22878 @item -mips2
22879 @opindex mips2
22880 Equivalent to @option{-march=mips2}.
22881
22882 @item -mips3
22883 @opindex mips3
22884 Equivalent to @option{-march=mips3}.
22885
22886 @item -mips4
22887 @opindex mips4
22888 Equivalent to @option{-march=mips4}.
22889
22890 @item -mips32
22891 @opindex mips32
22892 Equivalent to @option{-march=mips32}.
22893
22894 @item -mips32r3
22895 @opindex mips32r3
22896 Equivalent to @option{-march=mips32r3}.
22897
22898 @item -mips32r5
22899 @opindex mips32r5
22900 Equivalent to @option{-march=mips32r5}.
22901
22902 @item -mips32r6
22903 @opindex mips32r6
22904 Equivalent to @option{-march=mips32r6}.
22905
22906 @item -mips64
22907 @opindex mips64
22908 Equivalent to @option{-march=mips64}.
22909
22910 @item -mips64r2
22911 @opindex mips64r2
22912 Equivalent to @option{-march=mips64r2}.
22913
22914 @item -mips64r3
22915 @opindex mips64r3
22916 Equivalent to @option{-march=mips64r3}.
22917
22918 @item -mips64r5
22919 @opindex mips64r5
22920 Equivalent to @option{-march=mips64r5}.
22921
22922 @item -mips64r6
22923 @opindex mips64r6
22924 Equivalent to @option{-march=mips64r6}.
22925
22926 @item -mips16
22927 @itemx -mno-mips16
22928 @opindex mips16
22929 @opindex mno-mips16
22930 Generate (do not generate) MIPS16 code.  If GCC is targeting a
22931 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
22932
22933 MIPS16 code generation can also be controlled on a per-function basis
22934 by means of @code{mips16} and @code{nomips16} attributes.
22935 @xref{Function Attributes}, for more information.
22936
22937 @item -mflip-mips16
22938 @opindex mflip-mips16
22939 Generate MIPS16 code on alternating functions.  This option is provided
22940 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
22941 not intended for ordinary use in compiling user code.
22942
22943 @item -minterlink-compressed
22944 @itemx -mno-interlink-compressed
22945 @opindex minterlink-compressed
22946 @opindex mno-interlink-compressed
22947 Require (do not require) that code using the standard (uncompressed) MIPS ISA
22948 be link-compatible with MIPS16 and microMIPS code, and vice versa.
22949
22950 For example, code using the standard ISA encoding cannot jump directly
22951 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
22952 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
22953 knows that the target of the jump is not compressed.
22954
22955 @item -minterlink-mips16
22956 @itemx -mno-interlink-mips16
22957 @opindex minterlink-mips16
22958 @opindex mno-interlink-mips16
22959 Aliases of @option{-minterlink-compressed} and
22960 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
22961 and are retained for backwards compatibility.
22962
22963 @item -mabi=32
22964 @itemx -mabi=o64
22965 @itemx -mabi=n32
22966 @itemx -mabi=64
22967 @itemx -mabi=eabi
22968 @opindex mabi=32
22969 @opindex mabi=o64
22970 @opindex mabi=n32
22971 @opindex mabi=64
22972 @opindex mabi=eabi
22973 Generate code for the given ABI@.
22974
22975 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
22976 generates 64-bit code when you select a 64-bit architecture, but you
22977 can use @option{-mgp32} to get 32-bit code instead.
22978
22979 For information about the O64 ABI, see
22980 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
22981
22982 GCC supports a variant of the o32 ABI in which floating-point registers
22983 are 64 rather than 32 bits wide.  You can select this combination with
22984 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
22985 and @code{mfhc1} instructions and is therefore only supported for
22986 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
22987
22988 The register assignments for arguments and return values remain the
22989 same, but each scalar value is passed in a single 64-bit register
22990 rather than a pair of 32-bit registers.  For example, scalar
22991 floating-point values are returned in @samp{$f0} only, not a
22992 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
22993 remains the same in that the even-numbered double-precision registers
22994 are saved.
22995
22996 Two additional variants of the o32 ABI are supported to enable
22997 a transition from 32-bit to 64-bit registers.  These are FPXX
22998 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
22999 The FPXX extension mandates that all code must execute correctly
23000 when run using 32-bit or 64-bit registers.  The code can be interlinked
23001 with either FP32 or FP64, but not both.
23002 The FP64A extension is similar to the FP64 extension but forbids the
23003 use of odd-numbered single-precision registers.  This can be used
23004 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
23005 processors and allows both FP32 and FP64A code to interlink and
23006 run in the same process without changing FPU modes.
23007
23008 @item -mabicalls
23009 @itemx -mno-abicalls
23010 @opindex mabicalls
23011 @opindex mno-abicalls
23012 Generate (do not generate) code that is suitable for SVR4-style
23013 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
23014 systems.
23015
23016 @item -mshared
23017 @itemx -mno-shared
23018 Generate (do not generate) code that is fully position-independent,
23019 and that can therefore be linked into shared libraries.  This option
23020 only affects @option{-mabicalls}.
23021
23022 All @option{-mabicalls} code has traditionally been position-independent,
23023 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
23024 as an extension, the GNU toolchain allows executables to use absolute
23025 accesses for locally-binding symbols.  It can also use shorter GP
23026 initialization sequences and generate direct calls to locally-defined
23027 functions.  This mode is selected by @option{-mno-shared}.
23028
23029 @option{-mno-shared} depends on binutils 2.16 or higher and generates
23030 objects that can only be linked by the GNU linker.  However, the option
23031 does not affect the ABI of the final executable; it only affects the ABI
23032 of relocatable objects.  Using @option{-mno-shared} generally makes
23033 executables both smaller and quicker.
23034
23035 @option{-mshared} is the default.
23036
23037 @item -mplt
23038 @itemx -mno-plt
23039 @opindex mplt
23040 @opindex mno-plt
23041 Assume (do not assume) that the static and dynamic linkers
23042 support PLTs and copy relocations.  This option only affects
23043 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
23044 has no effect without @option{-msym32}.
23045
23046 You can make @option{-mplt} the default by configuring
23047 GCC with @option{--with-mips-plt}.  The default is
23048 @option{-mno-plt} otherwise.
23049
23050 @item -mxgot
23051 @itemx -mno-xgot
23052 @opindex mxgot
23053 @opindex mno-xgot
23054 Lift (do not lift) the usual restrictions on the size of the global
23055 offset table.
23056
23057 GCC normally uses a single instruction to load values from the GOT@.
23058 While this is relatively efficient, it only works if the GOT
23059 is smaller than about 64k.  Anything larger causes the linker
23060 to report an error such as:
23061
23062 @cindex relocation truncated to fit (MIPS)
23063 @smallexample
23064 relocation truncated to fit: R_MIPS_GOT16 foobar
23065 @end smallexample
23066
23067 If this happens, you should recompile your code with @option{-mxgot}.
23068 This works with very large GOTs, although the code is also
23069 less efficient, since it takes three instructions to fetch the
23070 value of a global symbol.
23071
23072 Note that some linkers can create multiple GOTs.  If you have such a
23073 linker, you should only need to use @option{-mxgot} when a single object
23074 file accesses more than 64k's worth of GOT entries.  Very few do.
23075
23076 These options have no effect unless GCC is generating position
23077 independent code.
23078
23079 @item -mgp32
23080 @opindex mgp32
23081 Assume that general-purpose registers are 32 bits wide.
23082
23083 @item -mgp64
23084 @opindex mgp64
23085 Assume that general-purpose registers are 64 bits wide.
23086
23087 @item -mfp32
23088 @opindex mfp32
23089 Assume that floating-point registers are 32 bits wide.
23090
23091 @item -mfp64
23092 @opindex mfp64
23093 Assume that floating-point registers are 64 bits wide.
23094
23095 @item -mfpxx
23096 @opindex mfpxx
23097 Do not assume the width of floating-point registers.
23098
23099 @item -mhard-float
23100 @opindex mhard-float
23101 Use floating-point coprocessor instructions.
23102
23103 @item -msoft-float
23104 @opindex msoft-float
23105 Do not use floating-point coprocessor instructions.  Implement
23106 floating-point calculations using library calls instead.
23107
23108 @item -mno-float
23109 @opindex mno-float
23110 Equivalent to @option{-msoft-float}, but additionally asserts that the
23111 program being compiled does not perform any floating-point operations.
23112 This option is presently supported only by some bare-metal MIPS
23113 configurations, where it may select a special set of libraries
23114 that lack all floating-point support (including, for example, the
23115 floating-point @code{printf} formats).  
23116 If code compiled with @option{-mno-float} accidentally contains
23117 floating-point operations, it is likely to suffer a link-time
23118 or run-time failure.
23119
23120 @item -msingle-float
23121 @opindex msingle-float
23122 Assume that the floating-point coprocessor only supports single-precision
23123 operations.
23124
23125 @item -mdouble-float
23126 @opindex mdouble-float
23127 Assume that the floating-point coprocessor supports double-precision
23128 operations.  This is the default.
23129
23130 @item -modd-spreg
23131 @itemx -mno-odd-spreg
23132 @opindex modd-spreg
23133 @opindex mno-odd-spreg
23134 Enable the use of odd-numbered single-precision floating-point registers
23135 for the o32 ABI.  This is the default for processors that are known to
23136 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
23137 is set by default.
23138
23139 @item -mabs=2008
23140 @itemx -mabs=legacy
23141 @opindex mabs=2008
23142 @opindex mabs=legacy
23143 These options control the treatment of the special not-a-number (NaN)
23144 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
23145 @code{neg.@i{fmt}} machine instructions.
23146
23147 By default or when @option{-mabs=legacy} is used the legacy
23148 treatment is selected.  In this case these instructions are considered
23149 arithmetic and avoided where correct operation is required and the
23150 input operand might be a NaN.  A longer sequence of instructions that
23151 manipulate the sign bit of floating-point datum manually is used
23152 instead unless the @option{-ffinite-math-only} option has also been
23153 specified.
23154
23155 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
23156 this case these instructions are considered non-arithmetic and therefore
23157 operating correctly in all cases, including in particular where the
23158 input operand is a NaN.  These instructions are therefore always used
23159 for the respective operations.
23160
23161 @item -mnan=2008
23162 @itemx -mnan=legacy
23163 @opindex mnan=2008
23164 @opindex mnan=legacy
23165 These options control the encoding of the special not-a-number (NaN)
23166 IEEE 754 floating-point data.
23167
23168 The @option{-mnan=legacy} option selects the legacy encoding.  In this
23169 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
23170 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
23171 by the first bit of their trailing significand field being 1.
23172
23173 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
23174 this case qNaNs are denoted by the first bit of their trailing
23175 significand field being 1, whereas sNaNs are denoted by the first bit of
23176 their trailing significand field being 0.
23177
23178 The default is @option{-mnan=legacy} unless GCC has been configured with
23179 @option{--with-nan=2008}.
23180
23181 @item -mllsc
23182 @itemx -mno-llsc
23183 @opindex mllsc
23184 @opindex mno-llsc
23185 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
23186 implement atomic memory built-in functions.  When neither option is
23187 specified, GCC uses the instructions if the target architecture
23188 supports them.
23189
23190 @option{-mllsc} is useful if the runtime environment can emulate the
23191 instructions and @option{-mno-llsc} can be useful when compiling for
23192 nonstandard ISAs.  You can make either option the default by
23193 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
23194 respectively.  @option{--with-llsc} is the default for some
23195 configurations; see the installation documentation for details.
23196
23197 @item -mdsp
23198 @itemx -mno-dsp
23199 @opindex mdsp
23200 @opindex mno-dsp
23201 Use (do not use) revision 1 of the MIPS DSP ASE@.
23202 @xref{MIPS DSP Built-in Functions}.  This option defines the
23203 preprocessor macro @code{__mips_dsp}.  It also defines
23204 @code{__mips_dsp_rev} to 1.
23205
23206 @item -mdspr2
23207 @itemx -mno-dspr2
23208 @opindex mdspr2
23209 @opindex mno-dspr2
23210 Use (do not use) revision 2 of the MIPS DSP ASE@.
23211 @xref{MIPS DSP Built-in Functions}.  This option defines the
23212 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
23213 It also defines @code{__mips_dsp_rev} to 2.
23214
23215 @item -msmartmips
23216 @itemx -mno-smartmips
23217 @opindex msmartmips
23218 @opindex mno-smartmips
23219 Use (do not use) the MIPS SmartMIPS ASE.
23220
23221 @item -mpaired-single
23222 @itemx -mno-paired-single
23223 @opindex mpaired-single
23224 @opindex mno-paired-single
23225 Use (do not use) paired-single floating-point instructions.
23226 @xref{MIPS Paired-Single Support}.  This option requires
23227 hardware floating-point support to be enabled.
23228
23229 @item -mdmx
23230 @itemx -mno-mdmx
23231 @opindex mdmx
23232 @opindex mno-mdmx
23233 Use (do not use) MIPS Digital Media Extension instructions.
23234 This option can only be used when generating 64-bit code and requires
23235 hardware floating-point support to be enabled.
23236
23237 @item -mips3d
23238 @itemx -mno-mips3d
23239 @opindex mips3d
23240 @opindex mno-mips3d
23241 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
23242 The option @option{-mips3d} implies @option{-mpaired-single}.
23243
23244 @item -mmicromips
23245 @itemx -mno-micromips
23246 @opindex mmicromips
23247 @opindex mno-mmicromips
23248 Generate (do not generate) microMIPS code.
23249
23250 MicroMIPS code generation can also be controlled on a per-function basis
23251 by means of @code{micromips} and @code{nomicromips} attributes.
23252 @xref{Function Attributes}, for more information.
23253
23254 @item -mmt
23255 @itemx -mno-mt
23256 @opindex mmt
23257 @opindex mno-mt
23258 Use (do not use) MT Multithreading instructions.
23259
23260 @item -mmcu
23261 @itemx -mno-mcu
23262 @opindex mmcu
23263 @opindex mno-mcu
23264 Use (do not use) the MIPS MCU ASE instructions.
23265
23266 @item -meva
23267 @itemx -mno-eva
23268 @opindex meva
23269 @opindex mno-eva
23270 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
23271
23272 @item -mvirt
23273 @itemx -mno-virt
23274 @opindex mvirt
23275 @opindex mno-virt
23276 Use (do not use) the MIPS Virtualization (VZ) instructions.
23277
23278 @item -mxpa
23279 @itemx -mno-xpa
23280 @opindex mxpa
23281 @opindex mno-xpa
23282 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
23283
23284 @item -mcrc
23285 @itemx -mno-crc
23286 @opindex mcrc
23287 @opindex mno-crc
23288 Use (do not use) the MIPS Cyclic Redundancy Check (CRC) instructions.
23289
23290 @item -mginv
23291 @itemx -mno-ginv
23292 @opindex mginv
23293 @opindex mno-ginv
23294 Use (do not use) the MIPS Global INValidate (GINV) instructions.
23295
23296 @item -mloongson-mmi
23297 @itemx -mno-loongson-mmi
23298 @opindex mloongson-mmi
23299 @opindex mno-loongson-mmi
23300 Use (do not use) the MIPS Loongson MultiMedia extensions Instructions (MMI).
23301
23302 @item -mloongson-ext
23303 @itemx -mno-loongson-ext
23304 @opindex mloongson-ext
23305 @opindex mno-loongson-ext
23306 Use (do not use) the MIPS Loongson EXTensions (EXT) instructions.
23307
23308 @item -mloongson-ext2
23309 @itemx -mno-loongson-ext2
23310 @opindex mloongson-ext2
23311 @opindex mno-loongson-ext2
23312 Use (do not use) the MIPS Loongson EXTensions r2 (EXT2) instructions.
23313
23314 @item -mlong64
23315 @opindex mlong64
23316 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
23317 an explanation of the default and the way that the pointer size is
23318 determined.
23319
23320 @item -mlong32
23321 @opindex mlong32
23322 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
23323
23324 The default size of @code{int}s, @code{long}s and pointers depends on
23325 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
23326 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
23327 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
23328 or the same size as integer registers, whichever is smaller.
23329
23330 @item -msym32
23331 @itemx -mno-sym32
23332 @opindex msym32
23333 @opindex mno-sym32
23334 Assume (do not assume) that all symbols have 32-bit values, regardless
23335 of the selected ABI@.  This option is useful in combination with
23336 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
23337 to generate shorter and faster references to symbolic addresses.
23338
23339 @item -G @var{num}
23340 @opindex G
23341 Put definitions of externally-visible data in a small data section
23342 if that data is no bigger than @var{num} bytes.  GCC can then generate
23343 more efficient accesses to the data; see @option{-mgpopt} for details.
23344
23345 The default @option{-G} option depends on the configuration.
23346
23347 @item -mlocal-sdata
23348 @itemx -mno-local-sdata
23349 @opindex mlocal-sdata
23350 @opindex mno-local-sdata
23351 Extend (do not extend) the @option{-G} behavior to local data too,
23352 such as to static variables in C@.  @option{-mlocal-sdata} is the
23353 default for all configurations.
23354
23355 If the linker complains that an application is using too much small data,
23356 you might want to try rebuilding the less performance-critical parts with
23357 @option{-mno-local-sdata}.  You might also want to build large
23358 libraries with @option{-mno-local-sdata}, so that the libraries leave
23359 more room for the main program.
23360
23361 @item -mextern-sdata
23362 @itemx -mno-extern-sdata
23363 @opindex mextern-sdata
23364 @opindex mno-extern-sdata
23365 Assume (do not assume) that externally-defined data is in
23366 a small data section if the size of that data is within the @option{-G} limit.
23367 @option{-mextern-sdata} is the default for all configurations.
23368
23369 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
23370 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
23371 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
23372 is placed in a small data section.  If @var{Var} is defined by another
23373 module, you must either compile that module with a high-enough
23374 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
23375 definition.  If @var{Var} is common, you must link the application
23376 with a high-enough @option{-G} setting.
23377
23378 The easiest way of satisfying these restrictions is to compile
23379 and link every module with the same @option{-G} option.  However,
23380 you may wish to build a library that supports several different
23381 small data limits.  You can do this by compiling the library with
23382 the highest supported @option{-G} setting and additionally using
23383 @option{-mno-extern-sdata} to stop the library from making assumptions
23384 about externally-defined data.
23385
23386 @item -mgpopt
23387 @itemx -mno-gpopt
23388 @opindex mgpopt
23389 @opindex mno-gpopt
23390 Use (do not use) GP-relative accesses for symbols that are known to be
23391 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
23392 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
23393 configurations.
23394
23395 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
23396 might not hold the value of @code{_gp}.  For example, if the code is
23397 part of a library that might be used in a boot monitor, programs that
23398 call boot monitor routines pass an unknown value in @code{$gp}.
23399 (In such situations, the boot monitor itself is usually compiled
23400 with @option{-G0}.)
23401
23402 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
23403 @option{-mno-extern-sdata}.
23404
23405 @item -membedded-data
23406 @itemx -mno-embedded-data
23407 @opindex membedded-data
23408 @opindex mno-embedded-data
23409 Allocate variables to the read-only data section first if possible, then
23410 next in the small data section if possible, otherwise in data.  This gives
23411 slightly slower code than the default, but reduces the amount of RAM required
23412 when executing, and thus may be preferred for some embedded systems.
23413
23414 @item -muninit-const-in-rodata
23415 @itemx -mno-uninit-const-in-rodata
23416 @opindex muninit-const-in-rodata
23417 @opindex mno-uninit-const-in-rodata
23418 Put uninitialized @code{const} variables in the read-only data section.
23419 This option is only meaningful in conjunction with @option{-membedded-data}.
23420
23421 @item -mcode-readable=@var{setting}
23422 @opindex mcode-readable
23423 Specify whether GCC may generate code that reads from executable sections.
23424 There are three possible settings:
23425
23426 @table @gcctabopt
23427 @item -mcode-readable=yes
23428 Instructions may freely access executable sections.  This is the
23429 default setting.
23430
23431 @item -mcode-readable=pcrel
23432 MIPS16 PC-relative load instructions can access executable sections,
23433 but other instructions must not do so.  This option is useful on 4KSc
23434 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
23435 It is also useful on processors that can be configured to have a dual
23436 instruction/data SRAM interface and that, like the M4K, automatically
23437 redirect PC-relative loads to the instruction RAM.
23438
23439 @item -mcode-readable=no
23440 Instructions must not access executable sections.  This option can be
23441 useful on targets that are configured to have a dual instruction/data
23442 SRAM interface but that (unlike the M4K) do not automatically redirect
23443 PC-relative loads to the instruction RAM.
23444 @end table
23445
23446 @item -msplit-addresses
23447 @itemx -mno-split-addresses
23448 @opindex msplit-addresses
23449 @opindex mno-split-addresses
23450 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
23451 relocation operators.  This option has been superseded by
23452 @option{-mexplicit-relocs} but is retained for backwards compatibility.
23453
23454 @item -mexplicit-relocs
23455 @itemx -mno-explicit-relocs
23456 @opindex mexplicit-relocs
23457 @opindex mno-explicit-relocs
23458 Use (do not use) assembler relocation operators when dealing with symbolic
23459 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
23460 is to use assembler macros instead.
23461
23462 @option{-mexplicit-relocs} is the default if GCC was configured
23463 to use an assembler that supports relocation operators.
23464
23465 @item -mcheck-zero-division
23466 @itemx -mno-check-zero-division
23467 @opindex mcheck-zero-division
23468 @opindex mno-check-zero-division
23469 Trap (do not trap) on integer division by zero.
23470
23471 The default is @option{-mcheck-zero-division}.
23472
23473 @item -mdivide-traps
23474 @itemx -mdivide-breaks
23475 @opindex mdivide-traps
23476 @opindex mdivide-breaks
23477 MIPS systems check for division by zero by generating either a
23478 conditional trap or a break instruction.  Using traps results in
23479 smaller code, but is only supported on MIPS II and later.  Also, some
23480 versions of the Linux kernel have a bug that prevents trap from
23481 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
23482 allow conditional traps on architectures that support them and
23483 @option{-mdivide-breaks} to force the use of breaks.
23484
23485 The default is usually @option{-mdivide-traps}, but this can be
23486 overridden at configure time using @option{--with-divide=breaks}.
23487 Divide-by-zero checks can be completely disabled using
23488 @option{-mno-check-zero-division}.
23489
23490 @item -mload-store-pairs
23491 @itemx -mno-load-store-pairs
23492 @opindex mload-store-pairs
23493 @opindex mno-load-store-pairs
23494 Enable (disable) an optimization that pairs consecutive load or store
23495 instructions to enable load/store bonding.  This option is enabled by
23496 default but only takes effect when the selected architecture is known
23497 to support bonding.
23498
23499 @item -mmemcpy
23500 @itemx -mno-memcpy
23501 @opindex mmemcpy
23502 @opindex mno-memcpy
23503 Force (do not force) the use of @code{memcpy} for non-trivial block
23504 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
23505 most constant-sized copies.
23506
23507 @item -mlong-calls
23508 @itemx -mno-long-calls
23509 @opindex mlong-calls
23510 @opindex mno-long-calls
23511 Disable (do not disable) use of the @code{jal} instruction.  Calling
23512 functions using @code{jal} is more efficient but requires the caller
23513 and callee to be in the same 256 megabyte segment.
23514
23515 This option has no effect on abicalls code.  The default is
23516 @option{-mno-long-calls}.
23517
23518 @item -mmad
23519 @itemx -mno-mad
23520 @opindex mmad
23521 @opindex mno-mad
23522 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
23523 instructions, as provided by the R4650 ISA@.
23524
23525 @item -mimadd
23526 @itemx -mno-imadd
23527 @opindex mimadd
23528 @opindex mno-imadd
23529 Enable (disable) use of the @code{madd} and @code{msub} integer
23530 instructions.  The default is @option{-mimadd} on architectures
23531 that support @code{madd} and @code{msub} except for the 74k 
23532 architecture where it was found to generate slower code.
23533
23534 @item -mfused-madd
23535 @itemx -mno-fused-madd
23536 @opindex mfused-madd
23537 @opindex mno-fused-madd
23538 Enable (disable) use of the floating-point multiply-accumulate
23539 instructions, when they are available.  The default is
23540 @option{-mfused-madd}.
23541
23542 On the R8000 CPU when multiply-accumulate instructions are used,
23543 the intermediate product is calculated to infinite precision
23544 and is not subject to the FCSR Flush to Zero bit.  This may be
23545 undesirable in some circumstances.  On other processors the result
23546 is numerically identical to the equivalent computation using
23547 separate multiply, add, subtract and negate instructions.
23548
23549 @item -nocpp
23550 @opindex nocpp
23551 Tell the MIPS assembler to not run its preprocessor over user
23552 assembler files (with a @samp{.s} suffix) when assembling them.
23553
23554 @item -mfix-24k
23555 @itemx -mno-fix-24k
23556 @opindex mfix-24k
23557 @opindex mno-fix-24k
23558 Work around the 24K E48 (lost data on stores during refill) errata.
23559 The workarounds are implemented by the assembler rather than by GCC@.
23560
23561 @item -mfix-r4000
23562 @itemx -mno-fix-r4000
23563 @opindex mfix-r4000
23564 @opindex mno-fix-r4000
23565 Work around certain R4000 CPU errata:
23566 @itemize @minus
23567 @item
23568 A double-word or a variable shift may give an incorrect result if executed
23569 immediately after starting an integer division.
23570 @item
23571 A double-word or a variable shift may give an incorrect result if executed
23572 while an integer multiplication is in progress.
23573 @item
23574 An integer division may give an incorrect result if started in a delay slot
23575 of a taken branch or a jump.
23576 @end itemize
23577
23578 @item -mfix-r4400
23579 @itemx -mno-fix-r4400
23580 @opindex mfix-r4400
23581 @opindex mno-fix-r4400
23582 Work around certain R4400 CPU errata:
23583 @itemize @minus
23584 @item
23585 A double-word or a variable shift may give an incorrect result if executed
23586 immediately after starting an integer division.
23587 @end itemize
23588
23589 @item -mfix-r10000
23590 @itemx -mno-fix-r10000
23591 @opindex mfix-r10000
23592 @opindex mno-fix-r10000
23593 Work around certain R10000 errata:
23594 @itemize @minus
23595 @item
23596 @code{ll}/@code{sc} sequences may not behave atomically on revisions
23597 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
23598 @end itemize
23599
23600 This option can only be used if the target architecture supports
23601 branch-likely instructions.  @option{-mfix-r10000} is the default when
23602 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
23603 otherwise.
23604
23605 @item -mfix-r5900
23606 @itemx -mno-fix-r5900
23607 @opindex mfix-r5900
23608 Do not attempt to schedule the preceding instruction into the delay slot
23609 of a branch instruction placed at the end of a short loop of six
23610 instructions or fewer and always schedule a @code{nop} instruction there
23611 instead.  The short loop bug under certain conditions causes loops to
23612 execute only once or twice, due to a hardware bug in the R5900 chip.  The
23613 workaround is implemented by the assembler rather than by GCC@.
23614
23615 @item -mfix-rm7000
23616 @itemx -mno-fix-rm7000
23617 @opindex mfix-rm7000
23618 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
23619 workarounds are implemented by the assembler rather than by GCC@.
23620
23621 @item -mfix-vr4120
23622 @itemx -mno-fix-vr4120
23623 @opindex mfix-vr4120
23624 Work around certain VR4120 errata:
23625 @itemize @minus
23626 @item
23627 @code{dmultu} does not always produce the correct result.
23628 @item
23629 @code{div} and @code{ddiv} do not always produce the correct result if one
23630 of the operands is negative.
23631 @end itemize
23632 The workarounds for the division errata rely on special functions in
23633 @file{libgcc.a}.  At present, these functions are only provided by
23634 the @code{mips64vr*-elf} configurations.
23635
23636 Other VR4120 errata require a NOP to be inserted between certain pairs of
23637 instructions.  These errata are handled by the assembler, not by GCC itself.
23638
23639 @item -mfix-vr4130
23640 @opindex mfix-vr4130
23641 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
23642 workarounds are implemented by the assembler rather than by GCC,
23643 although GCC avoids using @code{mflo} and @code{mfhi} if the
23644 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
23645 instructions are available instead.
23646
23647 @item -mfix-sb1
23648 @itemx -mno-fix-sb1
23649 @opindex mfix-sb1
23650 Work around certain SB-1 CPU core errata.
23651 (This flag currently works around the SB-1 revision 2
23652 ``F1'' and ``F2'' floating-point errata.)
23653
23654 @item -mr10k-cache-barrier=@var{setting}
23655 @opindex mr10k-cache-barrier
23656 Specify whether GCC should insert cache barriers to avoid the
23657 side effects of speculation on R10K processors.
23658
23659 In common with many processors, the R10K tries to predict the outcome
23660 of a conditional branch and speculatively executes instructions from
23661 the ``taken'' branch.  It later aborts these instructions if the
23662 predicted outcome is wrong.  However, on the R10K, even aborted
23663 instructions can have side effects.
23664
23665 This problem only affects kernel stores and, depending on the system,
23666 kernel loads.  As an example, a speculatively-executed store may load
23667 the target memory into cache and mark the cache line as dirty, even if
23668 the store itself is later aborted.  If a DMA operation writes to the
23669 same area of memory before the ``dirty'' line is flushed, the cached
23670 data overwrites the DMA-ed data.  See the R10K processor manual
23671 for a full description, including other potential problems.
23672
23673 One workaround is to insert cache barrier instructions before every memory
23674 access that might be speculatively executed and that might have side
23675 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
23676 controls GCC's implementation of this workaround.  It assumes that
23677 aborted accesses to any byte in the following regions does not have
23678 side effects:
23679
23680 @enumerate
23681 @item
23682 the memory occupied by the current function's stack frame;
23683
23684 @item
23685 the memory occupied by an incoming stack argument;
23686
23687 @item
23688 the memory occupied by an object with a link-time-constant address.
23689 @end enumerate
23690
23691 It is the kernel's responsibility to ensure that speculative
23692 accesses to these regions are indeed safe.
23693
23694 If the input program contains a function declaration such as:
23695
23696 @smallexample
23697 void foo (void);
23698 @end smallexample
23699
23700 then the implementation of @code{foo} must allow @code{j foo} and
23701 @code{jal foo} to be executed speculatively.  GCC honors this
23702 restriction for functions it compiles itself.  It expects non-GCC
23703 functions (such as hand-written assembly code) to do the same.
23704
23705 The option has three forms:
23706
23707 @table @gcctabopt
23708 @item -mr10k-cache-barrier=load-store
23709 Insert a cache barrier before a load or store that might be
23710 speculatively executed and that might have side effects even
23711 if aborted.
23712
23713 @item -mr10k-cache-barrier=store
23714 Insert a cache barrier before a store that might be speculatively
23715 executed and that might have side effects even if aborted.
23716
23717 @item -mr10k-cache-barrier=none
23718 Disable the insertion of cache barriers.  This is the default setting.
23719 @end table
23720
23721 @item -mflush-func=@var{func}
23722 @itemx -mno-flush-func
23723 @opindex mflush-func
23724 Specifies the function to call to flush the I and D caches, or to not
23725 call any such function.  If called, the function must take the same
23726 arguments as the common @code{_flush_func}, that is, the address of the
23727 memory range for which the cache is being flushed, the size of the
23728 memory range, and the number 3 (to flush both caches).  The default
23729 depends on the target GCC was configured for, but commonly is either
23730 @code{_flush_func} or @code{__cpu_flush}.
23731
23732 @item mbranch-cost=@var{num}
23733 @opindex mbranch-cost
23734 Set the cost of branches to roughly @var{num} ``simple'' instructions.
23735 This cost is only a heuristic and is not guaranteed to produce
23736 consistent results across releases.  A zero cost redundantly selects
23737 the default, which is based on the @option{-mtune} setting.
23738
23739 @item -mbranch-likely
23740 @itemx -mno-branch-likely
23741 @opindex mbranch-likely
23742 @opindex mno-branch-likely
23743 Enable or disable use of Branch Likely instructions, regardless of the
23744 default for the selected architecture.  By default, Branch Likely
23745 instructions may be generated if they are supported by the selected
23746 architecture.  An exception is for the MIPS32 and MIPS64 architectures
23747 and processors that implement those architectures; for those, Branch
23748 Likely instructions are not be generated by default because the MIPS32
23749 and MIPS64 architectures specifically deprecate their use.
23750
23751 @item -mcompact-branches=never
23752 @itemx -mcompact-branches=optimal
23753 @itemx -mcompact-branches=always
23754 @opindex mcompact-branches=never
23755 @opindex mcompact-branches=optimal
23756 @opindex mcompact-branches=always
23757 These options control which form of branches will be generated.  The
23758 default is @option{-mcompact-branches=optimal}.
23759
23760 The @option{-mcompact-branches=never} option ensures that compact branch
23761 instructions will never be generated.
23762
23763 The @option{-mcompact-branches=always} option ensures that a compact
23764 branch instruction will be generated if available.  If a compact branch
23765 instruction is not available, a delay slot form of the branch will be
23766 used instead.
23767
23768 This option is supported from MIPS Release 6 onwards.
23769
23770 The @option{-mcompact-branches=optimal} option will cause a delay slot
23771 branch to be used if one is available in the current ISA and the delay
23772 slot is successfully filled.  If the delay slot is not filled, a compact
23773 branch will be chosen if one is available.
23774
23775 @item -mfp-exceptions
23776 @itemx -mno-fp-exceptions
23777 @opindex mfp-exceptions
23778 Specifies whether FP exceptions are enabled.  This affects how
23779 FP instructions are scheduled for some processors.
23780 The default is that FP exceptions are
23781 enabled.
23782
23783 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
23784 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
23785 FP pipe.
23786
23787 @item -mvr4130-align
23788 @itemx -mno-vr4130-align
23789 @opindex mvr4130-align
23790 The VR4130 pipeline is two-way superscalar, but can only issue two
23791 instructions together if the first one is 8-byte aligned.  When this
23792 option is enabled, GCC aligns pairs of instructions that it
23793 thinks should execute in parallel.
23794
23795 This option only has an effect when optimizing for the VR4130.
23796 It normally makes code faster, but at the expense of making it bigger.
23797 It is enabled by default at optimization level @option{-O3}.
23798
23799 @item -msynci
23800 @itemx -mno-synci
23801 @opindex msynci
23802 Enable (disable) generation of @code{synci} instructions on
23803 architectures that support it.  The @code{synci} instructions (if
23804 enabled) are generated when @code{__builtin___clear_cache} is
23805 compiled.
23806
23807 This option defaults to @option{-mno-synci}, but the default can be
23808 overridden by configuring GCC with @option{--with-synci}.
23809
23810 When compiling code for single processor systems, it is generally safe
23811 to use @code{synci}.  However, on many multi-core (SMP) systems, it
23812 does not invalidate the instruction caches on all cores and may lead
23813 to undefined behavior.
23814
23815 @item -mrelax-pic-calls
23816 @itemx -mno-relax-pic-calls
23817 @opindex mrelax-pic-calls
23818 Try to turn PIC calls that are normally dispatched via register
23819 @code{$25} into direct calls.  This is only possible if the linker can
23820 resolve the destination at link time and if the destination is within
23821 range for a direct call.
23822
23823 @option{-mrelax-pic-calls} is the default if GCC was configured to use
23824 an assembler and a linker that support the @code{.reloc} assembly
23825 directive and @option{-mexplicit-relocs} is in effect.  With
23826 @option{-mno-explicit-relocs}, this optimization can be performed by the
23827 assembler and the linker alone without help from the compiler.
23828
23829 @item -mmcount-ra-address
23830 @itemx -mno-mcount-ra-address
23831 @opindex mmcount-ra-address
23832 @opindex mno-mcount-ra-address
23833 Emit (do not emit) code that allows @code{_mcount} to modify the
23834 calling function's return address.  When enabled, this option extends
23835 the usual @code{_mcount} interface with a new @var{ra-address}
23836 parameter, which has type @code{intptr_t *} and is passed in register
23837 @code{$12}.  @code{_mcount} can then modify the return address by
23838 doing both of the following:
23839 @itemize
23840 @item
23841 Returning the new address in register @code{$31}.
23842 @item
23843 Storing the new address in @code{*@var{ra-address}},
23844 if @var{ra-address} is nonnull.
23845 @end itemize
23846
23847 The default is @option{-mno-mcount-ra-address}.
23848
23849 @item -mframe-header-opt
23850 @itemx -mno-frame-header-opt
23851 @opindex mframe-header-opt
23852 Enable (disable) frame header optimization in the o32 ABI.  When using the
23853 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
23854 function to write out register arguments.  When enabled, this optimization
23855 will suppress the allocation of the frame header if it can be determined that
23856 it is unused.
23857
23858 This optimization is off by default at all optimization levels.
23859
23860 @item -mlxc1-sxc1
23861 @itemx -mno-lxc1-sxc1
23862 @opindex mlxc1-sxc1
23863 When applicable, enable (disable) the generation of @code{lwxc1},
23864 @code{swxc1}, @code{ldxc1}, @code{sdxc1} instructions.  Enabled by default.
23865
23866 @item -mmadd4
23867 @itemx -mno-madd4
23868 @opindex mmadd4
23869 When applicable, enable (disable) the generation of 4-operand @code{madd.s},
23870 @code{madd.d} and related instructions.  Enabled by default.
23871
23872 @end table
23873
23874 @node MMIX Options
23875 @subsection MMIX Options
23876 @cindex MMIX Options
23877
23878 These options are defined for the MMIX:
23879
23880 @table @gcctabopt
23881 @item -mlibfuncs
23882 @itemx -mno-libfuncs
23883 @opindex mlibfuncs
23884 @opindex mno-libfuncs
23885 Specify that intrinsic library functions are being compiled, passing all
23886 values in registers, no matter the size.
23887
23888 @item -mepsilon
23889 @itemx -mno-epsilon
23890 @opindex mepsilon
23891 @opindex mno-epsilon
23892 Generate floating-point comparison instructions that compare with respect
23893 to the @code{rE} epsilon register.
23894
23895 @item -mabi=mmixware
23896 @itemx -mabi=gnu
23897 @opindex mabi=mmixware
23898 @opindex mabi=gnu
23899 Generate code that passes function parameters and return values that (in
23900 the called function) are seen as registers @code{$0} and up, as opposed to
23901 the GNU ABI which uses global registers @code{$231} and up.
23902
23903 @item -mzero-extend
23904 @itemx -mno-zero-extend
23905 @opindex mzero-extend
23906 @opindex mno-zero-extend
23907 When reading data from memory in sizes shorter than 64 bits, use (do not
23908 use) zero-extending load instructions by default, rather than
23909 sign-extending ones.
23910
23911 @item -mknuthdiv
23912 @itemx -mno-knuthdiv
23913 @opindex mknuthdiv
23914 @opindex mno-knuthdiv
23915 Make the result of a division yielding a remainder have the same sign as
23916 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
23917 remainder follows the sign of the dividend.  Both methods are
23918 arithmetically valid, the latter being almost exclusively used.
23919
23920 @item -mtoplevel-symbols
23921 @itemx -mno-toplevel-symbols
23922 @opindex mtoplevel-symbols
23923 @opindex mno-toplevel-symbols
23924 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
23925 code can be used with the @code{PREFIX} assembly directive.
23926
23927 @item -melf
23928 @opindex melf
23929 Generate an executable in the ELF format, rather than the default
23930 @samp{mmo} format used by the @command{mmix} simulator.
23931
23932 @item -mbranch-predict
23933 @itemx -mno-branch-predict
23934 @opindex mbranch-predict
23935 @opindex mno-branch-predict
23936 Use (do not use) the probable-branch instructions, when static branch
23937 prediction indicates a probable branch.
23938
23939 @item -mbase-addresses
23940 @itemx -mno-base-addresses
23941 @opindex mbase-addresses
23942 @opindex mno-base-addresses
23943 Generate (do not generate) code that uses @emph{base addresses}.  Using a
23944 base address automatically generates a request (handled by the assembler
23945 and the linker) for a constant to be set up in a global register.  The
23946 register is used for one or more base address requests within the range 0
23947 to 255 from the value held in the register.  The generally leads to short
23948 and fast code, but the number of different data items that can be
23949 addressed is limited.  This means that a program that uses lots of static
23950 data may require @option{-mno-base-addresses}.
23951
23952 @item -msingle-exit
23953 @itemx -mno-single-exit
23954 @opindex msingle-exit
23955 @opindex mno-single-exit
23956 Force (do not force) generated code to have a single exit point in each
23957 function.
23958 @end table
23959
23960 @node MN10300 Options
23961 @subsection MN10300 Options
23962 @cindex MN10300 options
23963
23964 These @option{-m} options are defined for Matsushita MN10300 architectures:
23965
23966 @table @gcctabopt
23967 @item -mmult-bug
23968 @opindex mmult-bug
23969 Generate code to avoid bugs in the multiply instructions for the MN10300
23970 processors.  This is the default.
23971
23972 @item -mno-mult-bug
23973 @opindex mno-mult-bug
23974 Do not generate code to avoid bugs in the multiply instructions for the
23975 MN10300 processors.
23976
23977 @item -mam33
23978 @opindex mam33
23979 Generate code using features specific to the AM33 processor.
23980
23981 @item -mno-am33
23982 @opindex mno-am33
23983 Do not generate code using features specific to the AM33 processor.  This
23984 is the default.
23985
23986 @item -mam33-2
23987 @opindex mam33-2
23988 Generate code using features specific to the AM33/2.0 processor.
23989
23990 @item -mam34
23991 @opindex mam34
23992 Generate code using features specific to the AM34 processor.
23993
23994 @item -mtune=@var{cpu-type}
23995 @opindex mtune
23996 Use the timing characteristics of the indicated CPU type when
23997 scheduling instructions.  This does not change the targeted processor
23998 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
23999 @samp{am33-2} or @samp{am34}.
24000
24001 @item -mreturn-pointer-on-d0
24002 @opindex mreturn-pointer-on-d0
24003 When generating a function that returns a pointer, return the pointer
24004 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
24005 only in @code{a0}, and attempts to call such functions without a prototype
24006 result in errors.  Note that this option is on by default; use
24007 @option{-mno-return-pointer-on-d0} to disable it.
24008
24009 @item -mno-crt0
24010 @opindex mno-crt0
24011 Do not link in the C run-time initialization object file.
24012
24013 @item -mrelax
24014 @opindex mrelax
24015 Indicate to the linker that it should perform a relaxation optimization pass
24016 to shorten branches, calls and absolute memory addresses.  This option only
24017 has an effect when used on the command line for the final link step.
24018
24019 This option makes symbolic debugging impossible.
24020
24021 @item -mliw
24022 @opindex mliw
24023 Allow the compiler to generate @emph{Long Instruction Word}
24024 instructions if the target is the @samp{AM33} or later.  This is the
24025 default.  This option defines the preprocessor macro @code{__LIW__}.
24026
24027 @item -mno-liw
24028 @opindex mno-liw
24029 Do not allow the compiler to generate @emph{Long Instruction Word}
24030 instructions.  This option defines the preprocessor macro
24031 @code{__NO_LIW__}.
24032
24033 @item -msetlb
24034 @opindex msetlb
24035 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
24036 instructions if the target is the @samp{AM33} or later.  This is the
24037 default.  This option defines the preprocessor macro @code{__SETLB__}.
24038
24039 @item -mno-setlb
24040 @opindex mno-setlb
24041 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
24042 instructions.  This option defines the preprocessor macro
24043 @code{__NO_SETLB__}.
24044
24045 @end table
24046
24047 @node Moxie Options
24048 @subsection Moxie Options
24049 @cindex Moxie Options
24050
24051 @table @gcctabopt
24052
24053 @item -meb
24054 @opindex meb
24055 Generate big-endian code.  This is the default for @samp{moxie-*-*}
24056 configurations.
24057
24058 @item -mel
24059 @opindex mel
24060 Generate little-endian code.
24061
24062 @item -mmul.x
24063 @opindex mmul.x
24064 Generate mul.x and umul.x instructions.  This is the default for
24065 @samp{moxiebox-*-*} configurations.
24066
24067 @item -mno-crt0
24068 @opindex mno-crt0
24069 Do not link in the C run-time initialization object file.
24070
24071 @end table
24072
24073 @node MSP430 Options
24074 @subsection MSP430 Options
24075 @cindex MSP430 Options
24076
24077 These options are defined for the MSP430:
24078
24079 @table @gcctabopt
24080
24081 @item -masm-hex
24082 @opindex masm-hex
24083 Force assembly output to always use hex constants.  Normally such
24084 constants are signed decimals, but this option is available for
24085 testsuite and/or aesthetic purposes.
24086
24087 @item -mmcu=
24088 @opindex mmcu=
24089 Select the MCU to target.  This is used to create a C preprocessor
24090 symbol based upon the MCU name, converted to upper case and pre- and
24091 post-fixed with @samp{__}.  This in turn is used by the
24092 @file{msp430.h} header file to select an MCU-specific supplementary
24093 header file.
24094
24095 The option also sets the ISA to use.  If the MCU name is one that is
24096 known to only support the 430 ISA then that is selected, otherwise the
24097 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
24098 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
24099 name selects the 430X ISA.
24100
24101 In addition an MCU-specific linker script is added to the linker
24102 command line.  The script's name is the name of the MCU with
24103 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
24104 command line defines the C preprocessor symbol @code{__XXX__} and
24105 cause the linker to search for a script called @file{xxx.ld}.
24106
24107 The ISA and hardware multiply supported for the different MCUs is hard-coded
24108 into GCC.  However, an external @samp{devices.csv} file can be used to
24109 extend device support beyond those that have been hard-coded.
24110
24111 GCC searches for the @samp{devices.csv} file using the following methods in the
24112 given precedence order, where the first method takes precendence over the
24113 second which takes precedence over the third.
24114
24115 @table @asis
24116 @item Include path specified with @code{-I} and @code{-L}
24117 @samp{devices.csv} will be searched for in each of the directories specified by
24118 include paths and linker library search paths.
24119 @item Path specified by the environment variable @samp{MSP430_GCC_INCLUDE_DIR}
24120 Define the value of the global environment variable
24121 @samp{MSP430_GCC_INCLUDE_DIR}
24122 to the full path to the directory containing devices.csv, and GCC will search
24123 this directory for devices.csv.  If devices.csv is found, this directory will
24124 also be registered as an include path, and linker library path.  Header files
24125 and linker scripts in this directory can therefore be used without manually
24126 specifying @code{-I} and @code{-L} on the command line.
24127 @item The @samp{msp430-elf@{,bare@}/include/devices} directory
24128 Finally, GCC will examine @samp{msp430-elf@{,bare@}/include/devices} from the
24129 toolchain root directory.  This directory does not exist in a default
24130 installation, but if the user has created it and copied @samp{devices.csv}
24131 there, then the MCU data will be read.  As above, this directory will
24132 also be registered as an include path, and linker library path.
24133
24134 @end table
24135 If none of the above search methods find @samp{devices.csv}, then the
24136 hard-coded MCU data is used.
24137
24138
24139 @item -mwarn-mcu
24140 @itemx -mno-warn-mcu
24141 @opindex mwarn-mcu
24142 @opindex mno-warn-mcu
24143 This option enables or disables warnings about conflicts between the
24144 MCU name specified by the @option{-mmcu} option and the ISA set by the
24145 @option{-mcpu} option and/or the hardware multiply support set by the
24146 @option{-mhwmult} option.  It also toggles warnings about unrecognized
24147 MCU names.  This option is on by default.
24148
24149 @item -mcpu=
24150 @opindex mcpu=
24151 Specifies the ISA to use.  Accepted values are @samp{msp430},
24152 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
24153 @option{-mmcu=} option should be used to select the ISA.
24154
24155 @item -msim
24156 @opindex msim
24157 Link to the simulator runtime libraries and linker script.  Overrides
24158 any scripts that would be selected by the @option{-mmcu=} option.
24159
24160 @item -mlarge
24161 @opindex mlarge
24162 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
24163
24164 @item -msmall
24165 @opindex msmall
24166 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
24167
24168 @item -mrelax
24169 @opindex mrelax
24170 This option is passed to the assembler and linker, and allows the
24171 linker to perform certain optimizations that cannot be done until
24172 the final link.
24173
24174 @item mhwmult=
24175 @opindex mhwmult=
24176 Describes the type of hardware multiply supported by the target.
24177 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
24178 for the original 16-bit-only multiply supported by early MCUs.
24179 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
24180 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
24181 A value of @samp{auto} can also be given.  This tells GCC to deduce
24182 the hardware multiply support based upon the MCU name provided by the
24183 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
24184 the MCU name is not recognized then no hardware multiply support is
24185 assumed.  @code{auto} is the default setting.
24186
24187 Hardware multiplies are normally performed by calling a library
24188 routine.  This saves space in the generated code.  When compiling at
24189 @option{-O3} or higher however the hardware multiplier is invoked
24190 inline.  This makes for bigger, but faster code.
24191
24192 The hardware multiply routines disable interrupts whilst running and
24193 restore the previous interrupt state when they finish.  This makes
24194 them safe to use inside interrupt handlers as well as in normal code.
24195
24196 @item -minrt
24197 @opindex minrt
24198 Enable the use of a minimum runtime environment - no static
24199 initializers or constructors.  This is intended for memory-constrained
24200 devices.  The compiler includes special symbols in some objects
24201 that tell the linker and runtime which code fragments are required.
24202
24203 @item -mtiny-printf
24204 @opindex mtiny-printf
24205 Enable reduced code size @code{printf} and @code{puts} library functions.
24206 The @samp{tiny} implementations of these functions are not reentrant, so
24207 must be used with caution in multi-threaded applications.
24208
24209 Support for streams has been removed and the string to be printed will
24210 always be sent to stdout via the @code{write} syscall.  The string is not
24211 buffered before it is sent to write.
24212
24213 This option requires Newlib Nano IO, so GCC must be configured with
24214 @samp{--enable-newlib-nano-formatted-io}.
24215
24216 @item -mcode-region=
24217 @itemx -mdata-region=
24218 @opindex mcode-region
24219 @opindex mdata-region
24220 These options tell the compiler where to place functions and data that
24221 do not have one of the @code{lower}, @code{upper}, @code{either} or
24222 @code{section} attributes.  Possible values are @code{lower},
24223 @code{upper}, @code{either} or @code{any}.  The first three behave
24224 like the corresponding attribute.  The fourth possible value -
24225 @code{any} - is the default.  It leaves placement entirely up to the
24226 linker script and how it assigns the standard sections
24227 (@code{.text}, @code{.data}, etc) to the memory regions.
24228
24229 @item -msilicon-errata=
24230 @opindex msilicon-errata
24231 This option passes on a request to assembler to enable the fixes for
24232 the named silicon errata.
24233
24234 @item -msilicon-errata-warn=
24235 @opindex msilicon-errata-warn
24236 This option passes on a request to the assembler to enable warning
24237 messages when a silicon errata might need to be applied.
24238
24239 @item -mwarn-devices-csv
24240 @itemx -mno-warn-devices-csv
24241 @opindex mwarn-devices-csv
24242 @opindex mno-warn-devices-csv
24243 Warn if @samp{devices.csv} is not found or there are problem parsing it
24244 (default: on).
24245
24246 @end table
24247
24248 @node NDS32 Options
24249 @subsection NDS32 Options
24250 @cindex NDS32 Options
24251
24252 These options are defined for NDS32 implementations:
24253
24254 @table @gcctabopt
24255
24256 @item -mbig-endian
24257 @opindex mbig-endian
24258 Generate code in big-endian mode.
24259
24260 @item -mlittle-endian
24261 @opindex mlittle-endian
24262 Generate code in little-endian mode.
24263
24264 @item -mreduced-regs
24265 @opindex mreduced-regs
24266 Use reduced-set registers for register allocation.
24267
24268 @item -mfull-regs
24269 @opindex mfull-regs
24270 Use full-set registers for register allocation.
24271
24272 @item -mcmov
24273 @opindex mcmov
24274 Generate conditional move instructions.
24275
24276 @item -mno-cmov
24277 @opindex mno-cmov
24278 Do not generate conditional move instructions.
24279
24280 @item -mext-perf
24281 @opindex mext-perf
24282 Generate performance extension instructions.
24283
24284 @item -mno-ext-perf
24285 @opindex mno-ext-perf
24286 Do not generate performance extension instructions.
24287
24288 @item -mext-perf2
24289 @opindex mext-perf2
24290 Generate performance extension 2 instructions.
24291
24292 @item -mno-ext-perf2
24293 @opindex mno-ext-perf2
24294 Do not generate performance extension 2 instructions.
24295
24296 @item -mext-string
24297 @opindex mext-string
24298 Generate string extension instructions.
24299
24300 @item -mno-ext-string
24301 @opindex mno-ext-string
24302 Do not generate string extension instructions.
24303
24304 @item -mv3push
24305 @opindex mv3push
24306 Generate v3 push25/pop25 instructions.
24307
24308 @item -mno-v3push
24309 @opindex mno-v3push
24310 Do not generate v3 push25/pop25 instructions.
24311
24312 @item -m16-bit
24313 @opindex m16-bit
24314 Generate 16-bit instructions.
24315
24316 @item -mno-16-bit
24317 @opindex mno-16-bit
24318 Do not generate 16-bit instructions.
24319
24320 @item -misr-vector-size=@var{num}
24321 @opindex misr-vector-size
24322 Specify the size of each interrupt vector, which must be 4 or 16.
24323
24324 @item -mcache-block-size=@var{num}
24325 @opindex mcache-block-size
24326 Specify the size of each cache block,
24327 which must be a power of 2 between 4 and 512.
24328
24329 @item -march=@var{arch}
24330 @opindex march
24331 Specify the name of the target architecture.
24332
24333 @item -mcmodel=@var{code-model}
24334 @opindex mcmodel
24335 Set the code model to one of
24336 @table @asis
24337 @item @samp{small}
24338 All the data and read-only data segments must be within 512KB addressing space.
24339 The text segment must be within 16MB addressing space.
24340 @item @samp{medium}
24341 The data segment must be within 512KB while the read-only data segment can be
24342 within 4GB addressing space.  The text segment should be still within 16MB
24343 addressing space.
24344 @item @samp{large}
24345 All the text and data segments can be within 4GB addressing space.
24346 @end table
24347
24348 @item -mctor-dtor
24349 @opindex mctor-dtor
24350 Enable constructor/destructor feature.
24351
24352 @item -mrelax
24353 @opindex mrelax
24354 Guide linker to relax instructions.
24355
24356 @end table
24357
24358 @node Nios II Options
24359 @subsection Nios II Options
24360 @cindex Nios II options
24361 @cindex Altera Nios II options
24362
24363 These are the options defined for the Altera Nios II processor.
24364
24365 @table @gcctabopt
24366
24367 @item -G @var{num}
24368 @opindex G
24369 @cindex smaller data references
24370 Put global and static objects less than or equal to @var{num} bytes
24371 into the small data or BSS sections instead of the normal data or BSS
24372 sections.  The default value of @var{num} is 8.
24373
24374 @item -mgpopt=@var{option}
24375 @itemx -mgpopt
24376 @itemx -mno-gpopt
24377 @opindex mgpopt
24378 @opindex mno-gpopt
24379 Generate (do not generate) GP-relative accesses.  The following 
24380 @var{option} names are recognized:
24381
24382 @table @samp
24383
24384 @item none
24385 Do not generate GP-relative accesses.
24386
24387 @item local
24388 Generate GP-relative accesses for small data objects that are not 
24389 external, weak, or uninitialized common symbols.  
24390 Also use GP-relative addressing for objects that
24391 have been explicitly placed in a small data section via a @code{section}
24392 attribute.
24393
24394 @item global
24395 As for @samp{local}, but also generate GP-relative accesses for
24396 small data objects that are external, weak, or common.  If you use this option,
24397 you must ensure that all parts of your program (including libraries) are
24398 compiled with the same @option{-G} setting.
24399
24400 @item data
24401 Generate GP-relative accesses for all data objects in the program.  If you
24402 use this option, the entire data and BSS segments
24403 of your program must fit in 64K of memory and you must use an appropriate
24404 linker script to allocate them within the addressable range of the
24405 global pointer.
24406
24407 @item all
24408 Generate GP-relative addresses for function pointers as well as data
24409 pointers.  If you use this option, the entire text, data, and BSS segments
24410 of your program must fit in 64K of memory and you must use an appropriate
24411 linker script to allocate them within the addressable range of the
24412 global pointer.
24413
24414 @end table
24415
24416 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
24417 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
24418
24419 The default is @option{-mgpopt} except when @option{-fpic} or
24420 @option{-fPIC} is specified to generate position-independent code.
24421 Note that the Nios II ABI does not permit GP-relative accesses from
24422 shared libraries.
24423
24424 You may need to specify @option{-mno-gpopt} explicitly when building
24425 programs that include large amounts of small data, including large
24426 GOT data sections.  In this case, the 16-bit offset for GP-relative
24427 addressing may not be large enough to allow access to the entire 
24428 small data section.
24429
24430 @item -mgprel-sec=@var{regexp}
24431 @opindex mgprel-sec
24432 This option specifies additional section names that can be accessed via
24433 GP-relative addressing.  It is most useful in conjunction with 
24434 @code{section} attributes on variable declarations 
24435 (@pxref{Common Variable Attributes}) and a custom linker script.  
24436 The @var{regexp} is a POSIX Extended Regular Expression.
24437
24438 This option does not affect the behavior of the @option{-G} option, and 
24439 the specified sections are in addition to the standard @code{.sdata}
24440 and @code{.sbss} small-data sections that are recognized by @option{-mgpopt}.
24441
24442 @item -mr0rel-sec=@var{regexp}
24443 @opindex mr0rel-sec
24444 This option specifies names of sections that can be accessed via a 
24445 16-bit offset from @code{r0}; that is, in the low 32K or high 32K 
24446 of the 32-bit address space.  It is most useful in conjunction with 
24447 @code{section} attributes on variable declarations 
24448 (@pxref{Common Variable Attributes}) and a custom linker script.  
24449 The @var{regexp} is a POSIX Extended Regular Expression.
24450
24451 In contrast to the use of GP-relative addressing for small data, 
24452 zero-based addressing is never generated by default and there are no 
24453 conventional section names used in standard linker scripts for sections
24454 in the low or high areas of memory.
24455
24456 @item -mel
24457 @itemx -meb
24458 @opindex mel
24459 @opindex meb
24460 Generate little-endian (default) or big-endian (experimental) code,
24461 respectively.
24462
24463 @item -march=@var{arch}
24464 @opindex march
24465 This specifies the name of the target Nios II architecture.  GCC uses this
24466 name to determine what kind of instructions it can emit when generating
24467 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
24468
24469 The preprocessor macro @code{__nios2_arch__} is available to programs,
24470 with value 1 or 2, indicating the targeted ISA level.
24471
24472 @item -mbypass-cache
24473 @itemx -mno-bypass-cache
24474 @opindex mno-bypass-cache
24475 @opindex mbypass-cache
24476 Force all load and store instructions to always bypass cache by 
24477 using I/O variants of the instructions. The default is not to
24478 bypass the cache.
24479
24480 @item -mno-cache-volatile 
24481 @itemx -mcache-volatile       
24482 @opindex mcache-volatile 
24483 @opindex mno-cache-volatile
24484 Volatile memory access bypass the cache using the I/O variants of 
24485 the load and store instructions. The default is not to bypass the cache.
24486
24487 @item -mno-fast-sw-div
24488 @itemx -mfast-sw-div
24489 @opindex mno-fast-sw-div
24490 @opindex mfast-sw-div
24491 Do not use table-based fast divide for small numbers. The default 
24492 is to use the fast divide at @option{-O3} and above.
24493
24494 @item -mno-hw-mul
24495 @itemx -mhw-mul
24496 @itemx -mno-hw-mulx
24497 @itemx -mhw-mulx
24498 @itemx -mno-hw-div
24499 @itemx -mhw-div
24500 @opindex mno-hw-mul
24501 @opindex mhw-mul
24502 @opindex mno-hw-mulx
24503 @opindex mhw-mulx
24504 @opindex mno-hw-div
24505 @opindex mhw-div
24506 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
24507 instructions by the compiler. The default is to emit @code{mul}
24508 and not emit @code{div} and @code{mulx}.
24509
24510 @item -mbmx
24511 @itemx -mno-bmx
24512 @itemx -mcdx
24513 @itemx -mno-cdx
24514 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
24515 CDX (code density) instructions.  Enabling these instructions also
24516 requires @option{-march=r2}.  Since these instructions are optional
24517 extensions to the R2 architecture, the default is not to emit them.
24518
24519 @item -mcustom-@var{insn}=@var{N}
24520 @itemx -mno-custom-@var{insn}
24521 @opindex mcustom-@var{insn}
24522 @opindex mno-custom-@var{insn}
24523 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
24524 custom instruction with encoding @var{N} when generating code that uses 
24525 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
24526 instruction 253 for single-precision floating-point add operations instead
24527 of the default behavior of using a library call.
24528
24529 The following values of @var{insn} are supported.  Except as otherwise
24530 noted, floating-point operations are expected to be implemented with
24531 normal IEEE 754 semantics and correspond directly to the C operators or the
24532 equivalent GCC built-in functions (@pxref{Other Builtins}).
24533
24534 Single-precision floating point:
24535 @table @asis
24536
24537 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
24538 Binary arithmetic operations.
24539
24540 @item @samp{fnegs}
24541 Unary negation.
24542
24543 @item @samp{fabss}
24544 Unary absolute value.
24545
24546 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
24547 Comparison operations.
24548
24549 @item @samp{fmins}, @samp{fmaxs}
24550 Floating-point minimum and maximum.  These instructions are only
24551 generated if @option{-ffinite-math-only} is specified.
24552
24553 @item @samp{fsqrts}
24554 Unary square root operation.
24555
24556 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
24557 Floating-point trigonometric and exponential functions.  These instructions
24558 are only generated if @option{-funsafe-math-optimizations} is also specified.
24559
24560 @end table
24561
24562 Double-precision floating point:
24563 @table @asis
24564
24565 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
24566 Binary arithmetic operations.
24567
24568 @item @samp{fnegd}
24569 Unary negation.
24570
24571 @item @samp{fabsd}
24572 Unary absolute value.
24573
24574 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
24575 Comparison operations.
24576
24577 @item @samp{fmind}, @samp{fmaxd}
24578 Double-precision minimum and maximum.  These instructions are only
24579 generated if @option{-ffinite-math-only} is specified.
24580
24581 @item @samp{fsqrtd}
24582 Unary square root operation.
24583
24584 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
24585 Double-precision trigonometric and exponential functions.  These instructions
24586 are only generated if @option{-funsafe-math-optimizations} is also specified.
24587
24588 @end table
24589
24590 Conversions:
24591 @table @asis
24592 @item @samp{fextsd}
24593 Conversion from single precision to double precision.
24594
24595 @item @samp{ftruncds}
24596 Conversion from double precision to single precision.
24597
24598 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
24599 Conversion from floating point to signed or unsigned integer types, with
24600 truncation towards zero.
24601
24602 @item @samp{round}
24603 Conversion from single-precision floating point to signed integer,
24604 rounding to the nearest integer and ties away from zero.
24605 This corresponds to the @code{__builtin_lroundf} function when
24606 @option{-fno-math-errno} is used.
24607
24608 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
24609 Conversion from signed or unsigned integer types to floating-point types.
24610
24611 @end table
24612
24613 In addition, all of the following transfer instructions for internal
24614 registers X and Y must be provided to use any of the double-precision
24615 floating-point instructions.  Custom instructions taking two
24616 double-precision source operands expect the first operand in the
24617 64-bit register X.  The other operand (or only operand of a unary
24618 operation) is given to the custom arithmetic instruction with the
24619 least significant half in source register @var{src1} and the most
24620 significant half in @var{src2}.  A custom instruction that returns a
24621 double-precision result returns the most significant 32 bits in the
24622 destination register and the other half in 32-bit register Y.  
24623 GCC automatically generates the necessary code sequences to write
24624 register X and/or read register Y when double-precision floating-point
24625 instructions are used.
24626
24627 @table @asis
24628
24629 @item @samp{fwrx}
24630 Write @var{src1} into the least significant half of X and @var{src2} into
24631 the most significant half of X.
24632
24633 @item @samp{fwry}
24634 Write @var{src1} into Y.
24635
24636 @item @samp{frdxhi}, @samp{frdxlo}
24637 Read the most or least (respectively) significant half of X and store it in
24638 @var{dest}.
24639
24640 @item @samp{frdy}
24641 Read the value of Y and store it into @var{dest}.
24642 @end table
24643
24644 Note that you can gain more local control over generation of Nios II custom
24645 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
24646 and @code{target("no-custom-@var{insn}")} function attributes
24647 (@pxref{Function Attributes})
24648 or pragmas (@pxref{Function Specific Option Pragmas}).
24649
24650 @item -mcustom-fpu-cfg=@var{name}
24651 @opindex mcustom-fpu-cfg
24652
24653 This option enables a predefined, named set of custom instruction encodings
24654 (see @option{-mcustom-@var{insn}} above).  
24655 Currently, the following sets are defined:
24656
24657 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
24658 @gccoptlist{-mcustom-fmuls=252 @gol
24659 -mcustom-fadds=253 @gol
24660 -mcustom-fsubs=254 @gol
24661 -fsingle-precision-constant}
24662
24663 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
24664 @gccoptlist{-mcustom-fmuls=252 @gol
24665 -mcustom-fadds=253 @gol
24666 -mcustom-fsubs=254 @gol
24667 -mcustom-fdivs=255 @gol
24668 -fsingle-precision-constant}
24669
24670 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
24671 @gccoptlist{-mcustom-floatus=243 @gol
24672 -mcustom-fixsi=244 @gol
24673 -mcustom-floatis=245 @gol
24674 -mcustom-fcmpgts=246 @gol
24675 -mcustom-fcmples=249 @gol
24676 -mcustom-fcmpeqs=250 @gol
24677 -mcustom-fcmpnes=251 @gol
24678 -mcustom-fmuls=252 @gol
24679 -mcustom-fadds=253 @gol
24680 -mcustom-fsubs=254 @gol
24681 -mcustom-fdivs=255 @gol
24682 -fsingle-precision-constant}
24683
24684 Custom instruction assignments given by individual
24685 @option{-mcustom-@var{insn}=} options override those given by
24686 @option{-mcustom-fpu-cfg=}, regardless of the
24687 order of the options on the command line.
24688
24689 Note that you can gain more local control over selection of a FPU
24690 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
24691 function attribute (@pxref{Function Attributes})
24692 or pragma (@pxref{Function Specific Option Pragmas}).
24693
24694 @end table
24695
24696 These additional @samp{-m} options are available for the Altera Nios II
24697 ELF (bare-metal) target:
24698
24699 @table @gcctabopt
24700
24701 @item -mhal
24702 @opindex mhal
24703 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
24704 startup and termination code, and is typically used in conjunction with
24705 @option{-msys-crt0=} to specify the location of the alternate startup code
24706 provided by the HAL BSP.
24707
24708 @item -msmallc
24709 @opindex msmallc
24710 Link with a limited version of the C library, @option{-lsmallc}, rather than
24711 Newlib.
24712
24713 @item -msys-crt0=@var{startfile}
24714 @opindex msys-crt0
24715 @var{startfile} is the file name of the startfile (crt0) to use 
24716 when linking.  This option is only useful in conjunction with @option{-mhal}.
24717
24718 @item -msys-lib=@var{systemlib}
24719 @opindex msys-lib
24720 @var{systemlib} is the library name of the library that provides
24721 low-level system calls required by the C library,
24722 e.g.@: @code{read} and @code{write}.
24723 This option is typically used to link with a library provided by a HAL BSP.
24724
24725 @end table
24726
24727 @node Nvidia PTX Options
24728 @subsection Nvidia PTX Options
24729 @cindex Nvidia PTX options
24730 @cindex nvptx options
24731
24732 These options are defined for Nvidia PTX:
24733
24734 @table @gcctabopt
24735
24736 @item -m32
24737 @itemx -m64
24738 @opindex m32
24739 @opindex m64
24740 Generate code for 32-bit or 64-bit ABI.
24741
24742 @item -misa=@var{ISA-string}
24743 @opindex march
24744 Generate code for given the specified PTX ISA (e.g.@: @samp{sm_35}).  ISA
24745 strings must be lower-case.  Valid ISA strings include @samp{sm_30} and
24746 @samp{sm_35}.  The default ISA is sm_30.
24747
24748 @item -mmainkernel
24749 @opindex mmainkernel
24750 Link in code for a __main kernel.  This is for stand-alone instead of
24751 offloading execution.
24752
24753 @item -moptimize
24754 @opindex moptimize
24755 Apply partitioned execution optimizations.  This is the default when any
24756 level of optimization is selected.
24757
24758 @item -msoft-stack
24759 @opindex msoft-stack
24760 Generate code that does not use @code{.local} memory
24761 directly for stack storage. Instead, a per-warp stack pointer is
24762 maintained explicitly. This enables variable-length stack allocation (with
24763 variable-length arrays or @code{alloca}), and when global memory is used for
24764 underlying storage, makes it possible to access automatic variables from other
24765 threads, or with atomic instructions. This code generation variant is used
24766 for OpenMP offloading, but the option is exposed on its own for the purpose
24767 of testing the compiler; to generate code suitable for linking into programs
24768 using OpenMP offloading, use option @option{-mgomp}.
24769
24770 @item -muniform-simt
24771 @opindex muniform-simt
24772 Switch to code generation variant that allows to execute all threads in each
24773 warp, while maintaining memory state and side effects as if only one thread
24774 in each warp was active outside of OpenMP SIMD regions.  All atomic operations
24775 and calls to runtime (malloc, free, vprintf) are conditionally executed (iff
24776 current lane index equals the master lane index), and the register being
24777 assigned is copied via a shuffle instruction from the master lane.  Outside of
24778 SIMD regions lane 0 is the master; inside, each thread sees itself as the
24779 master.  Shared memory array @code{int __nvptx_uni[]} stores all-zeros or
24780 all-ones bitmasks for each warp, indicating current mode (0 outside of SIMD
24781 regions).  Each thread can bitwise-and the bitmask at position @code{tid.y}
24782 with current lane index to compute the master lane index.
24783
24784 @item -mgomp
24785 @opindex mgomp
24786 Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and
24787 @option{-muniform-simt} options, and selects corresponding multilib variant.
24788
24789 @end table
24790
24791 @node OpenRISC Options
24792 @subsection OpenRISC Options
24793 @cindex OpenRISC Options
24794
24795 These options are defined for OpenRISC:
24796
24797 @table @gcctabopt
24798
24799 @item -mboard=@var{name}
24800 @opindex mboard
24801 Configure a board specific runtime.  This will be passed to the linker for
24802 newlib board library linking.  The default is @code{or1ksim}.
24803
24804 @item -mnewlib
24805 @opindex mnewlib
24806 This option is ignored; it is for compatibility purposes only.  This used to
24807 select linker and preprocessor options for use with newlib.
24808
24809 @item -msoft-div
24810 @itemx -mhard-div
24811 @opindex msoft-div
24812 @opindex mhard-div
24813 Select software or hardware divide (@code{l.div}, @code{l.divu}) instructions.
24814 This default is hardware divide.
24815
24816 @item -msoft-mul
24817 @itemx -mhard-mul
24818 @opindex msoft-mul
24819 @opindex mhard-mul
24820 Select software or hardware multiply (@code{l.mul}, @code{l.muli}) instructions.
24821 This default is hardware multiply.
24822
24823 @item -msoft-float
24824 @itemx -mhard-float
24825 @opindex msoft-float
24826 @opindex mhard-float
24827 Select software or hardware for floating point operations.
24828 The default is software.
24829
24830 @item -mdouble-float
24831 @opindex mdouble-float
24832 When @option{-mhard-float} is selected, enables generation of double-precision
24833 floating point instructions.  By default functions from @file{libgcc} are used
24834 to perform double-precision floating point operations.
24835
24836 @item -munordered-float
24837 @opindex munordered-float
24838 When @option{-mhard-float} is selected, enables generation of unordered
24839 floating point compare and set flag (@code{lf.sfun*}) instructions.  By default
24840 functions from @file{libgcc} are used to perform unordered floating point
24841 compare and set flag operations.
24842
24843 @item -mcmov
24844 @opindex mcmov
24845 Enable generation of conditional move (@code{l.cmov}) instructions.  By
24846 default the equivalent will be generated using using set and branch.
24847
24848 @item -mror
24849 @opindex mror
24850 Enable generation of rotate right (@code{l.ror}) instructions.  By default
24851 functions from @file{libgcc} are used to perform rotate right operations.
24852
24853 @item -mrori
24854 @opindex mrori
24855 Enable generation of rotate right with immediate (@code{l.rori}) instructions.
24856 By default functions from @file{libgcc} are used to perform rotate right with
24857 immediate operations.
24858
24859 @item -msext
24860 @opindex msext
24861 Enable generation of sign extension (@code{l.ext*}) instructions.  By default
24862 memory loads are used to perform sign extension.
24863
24864 @item -msfimm
24865 @opindex msfimm
24866 Enable generation of compare and set flag with immediate (@code{l.sf*i})
24867 instructions.  By default extra instructions will be generated to store the
24868 immediate to a register first.
24869
24870 @item -mshftimm
24871 @opindex mshftimm
24872 Enable generation of shift with immediate (@code{l.srai}, @code{l.srli},
24873 @code{l.slli}) instructions.  By default extra instructions will be generated
24874 to store the immediate to a register first.
24875
24876
24877 @end table
24878
24879 @node PDP-11 Options
24880 @subsection PDP-11 Options
24881 @cindex PDP-11 Options
24882
24883 These options are defined for the PDP-11:
24884
24885 @table @gcctabopt
24886 @item -mfpu
24887 @opindex mfpu
24888 Use hardware FPP floating point.  This is the default.  (FIS floating
24889 point on the PDP-11/40 is not supported.)  Implies -m45.
24890
24891 @item -msoft-float
24892 @opindex msoft-float
24893 Do not use hardware floating point.
24894
24895 @item -mac0
24896 @opindex mac0
24897 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
24898
24899 @item -mno-ac0
24900 @opindex mno-ac0
24901 Return floating-point results in memory.  This is the default.
24902
24903 @item -m40
24904 @opindex m40
24905 Generate code for a PDP-11/40.  Implies -msoft-float -mno-split.
24906
24907 @item -m45
24908 @opindex m45
24909 Generate code for a PDP-11/45.  This is the default.
24910
24911 @item -m10
24912 @opindex m10
24913 Generate code for a PDP-11/10.  Implies -msoft-float -mno-split.
24914
24915 @item -mint16
24916 @itemx -mno-int32
24917 @opindex mint16
24918 @opindex mno-int32
24919 Use 16-bit @code{int}.  This is the default.
24920
24921 @item -mint32
24922 @itemx -mno-int16
24923 @opindex mint32
24924 @opindex mno-int16
24925 Use 32-bit @code{int}.
24926
24927 @item -msplit
24928 @opindex msplit
24929 Target has split instruction and data space.  Implies -m45.
24930
24931 @item -munix-asm
24932 @opindex munix-asm
24933 Use Unix assembler syntax.
24934
24935 @item -mdec-asm
24936 @opindex mdec-asm
24937 Use DEC assembler syntax.
24938
24939 @item -mgnu-asm
24940 @opindex mgnu-asm
24941 Use GNU assembler syntax.  This is the default.
24942
24943 @item -mlra
24944 @opindex mlra
24945 Use the new LRA register allocator.  By default, the old ``reload''
24946 allocator is used.
24947 @end table
24948
24949 @node picoChip Options
24950 @subsection picoChip Options
24951 @cindex picoChip options
24952
24953 These @samp{-m} options are defined for picoChip implementations:
24954
24955 @table @gcctabopt
24956
24957 @item -mae=@var{ae_type}
24958 @opindex mcpu
24959 Set the instruction set, register set, and instruction scheduling
24960 parameters for array element type @var{ae_type}.  Supported values
24961 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
24962
24963 @option{-mae=ANY} selects a completely generic AE type.  Code
24964 generated with this option runs on any of the other AE types.  The
24965 code is not as efficient as it would be if compiled for a specific
24966 AE type, and some types of operation (e.g., multiplication) do not
24967 work properly on all types of AE.
24968
24969 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
24970 for compiled code, and is the default.
24971
24972 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
24973 option may suffer from poor performance of byte (char) manipulation,
24974 since the DSP AE does not provide hardware support for byte load/stores.
24975
24976 @item -msymbol-as-address
24977 Enable the compiler to directly use a symbol name as an address in a
24978 load/store instruction, without first loading it into a
24979 register.  Typically, the use of this option generates larger
24980 programs, which run faster than when the option isn't used.  However, the
24981 results vary from program to program, so it is left as a user option,
24982 rather than being permanently enabled.
24983
24984 @item -mno-inefficient-warnings
24985 Disables warnings about the generation of inefficient code.  These
24986 warnings can be generated, for example, when compiling code that
24987 performs byte-level memory operations on the MAC AE type.  The MAC AE has
24988 no hardware support for byte-level memory operations, so all byte
24989 load/stores must be synthesized from word load/store operations.  This is
24990 inefficient and a warning is generated to indicate
24991 that you should rewrite the code to avoid byte operations, or to target
24992 an AE type that has the necessary hardware support.  This option disables
24993 these warnings.
24994
24995 @end table
24996
24997 @node PowerPC Options
24998 @subsection PowerPC Options
24999 @cindex PowerPC options
25000
25001 These are listed under @xref{RS/6000 and PowerPC Options}.
25002
25003 @node PRU Options
25004 @subsection PRU Options
25005 @cindex PRU Options
25006
25007 These command-line options are defined for PRU target:
25008
25009 @table @gcctabopt
25010 @item -minrt
25011 @opindex minrt
25012 Link with a minimum runtime environment, with no support for static
25013 initializers and constructors.  Using this option can significantly reduce
25014 the size of the final ELF binary.  Beware that the compiler could still
25015 generate code with static initializers and constructors.  It is up to the
25016 programmer to ensure that the source program will not use those features.
25017
25018 @item -mmcu=@var{mcu}
25019 @opindex mmcu
25020 Specify the PRU MCU variant to use.  Check Newlib for the exact list of
25021 supported MCUs.
25022
25023 @item -mno-relax
25024 @opindex mno-relax
25025 Make GCC pass the @option{--no-relax} command-line option to the linker
25026 instead of the @option{--relax} option.
25027
25028 @item -mloop
25029 @opindex mloop
25030 Allow (or do not allow) GCC to use the LOOP instruction.
25031
25032 @item -mabi=@var{variant}
25033 @opindex mabi
25034 Specify the ABI variant to output code for.  @option{-mabi=ti} selects the
25035 unmodified TI ABI while @option{-mabi=gnu} selects a GNU variant that copes
25036 more naturally with certain GCC assumptions.  These are the differences:
25037
25038 @table @samp
25039 @item Function Pointer Size
25040 TI ABI specifies that function (code) pointers are 16-bit, whereas GNU
25041 supports only 32-bit data and code pointers.
25042
25043 @item Optional Return Value Pointer
25044 Function return values larger than 64 bits are passed by using a hidden
25045 pointer as the first argument of the function.  TI ABI, though, mandates that
25046 the pointer can be NULL in case the caller is not using the returned value.
25047 GNU always passes and expects a valid return value pointer.
25048
25049 @end table
25050
25051 The current @option{-mabi=ti} implementation simply raises a compile error
25052 when any of the above code constructs is detected.  As a consequence
25053 the standard C library cannot be built and it is omitted when linking with
25054 @option{-mabi=ti}.
25055
25056 Relaxation is a GNU feature and for safety reasons is disabled when using
25057 @option{-mabi=ti}.  The TI toolchain does not emit relocations for QBBx
25058 instructions, so the GNU linker cannot adjust them when shortening adjacent
25059 LDI32 pseudo instructions.
25060
25061 @end table
25062
25063 @node RISC-V Options
25064 @subsection RISC-V Options
25065 @cindex RISC-V Options
25066
25067 These command-line options are defined for RISC-V targets:
25068
25069 @table @gcctabopt
25070 @item -mbranch-cost=@var{n}
25071 @opindex mbranch-cost
25072 Set the cost of branches to roughly @var{n} instructions.
25073
25074 @item -mplt
25075 @itemx -mno-plt
25076 @opindex plt
25077 When generating PIC code, do or don't allow the use of PLTs. Ignored for
25078 non-PIC.  The default is @option{-mplt}.
25079
25080 @item -mabi=@var{ABI-string}
25081 @opindex mabi
25082 Specify integer and floating-point calling convention.  @var{ABI-string}
25083 contains two parts: the size of integer types and the registers used for
25084 floating-point types.  For example @samp{-march=rv64ifd -mabi=lp64d} means that
25085 @samp{long} and pointers are 64-bit (implicitly defining @samp{int} to be
25086 32-bit), and that floating-point values up to 64 bits wide are passed in F
25087 registers.  Contrast this with @samp{-march=rv64ifd -mabi=lp64f}, which still
25088 allows the compiler to generate code that uses the F and D extensions but only
25089 allows floating-point values up to 32 bits long to be passed in registers; or
25090 @samp{-march=rv64ifd -mabi=lp64}, in which no floating-point arguments will be
25091 passed in registers.
25092
25093 The default for this argument is system dependent, users who want a specific
25094 calling convention should specify one explicitly.  The valid calling
25095 conventions are: @samp{ilp32}, @samp{ilp32f}, @samp{ilp32d}, @samp{lp64},
25096 @samp{lp64f}, and @samp{lp64d}.  Some calling conventions are impossible to
25097 implement on some ISAs: for example, @samp{-march=rv32if -mabi=ilp32d} is
25098 invalid because the ABI requires 64-bit values be passed in F registers, but F
25099 registers are only 32 bits wide.  There is also the @samp{ilp32e} ABI that can
25100 only be used with the @samp{rv32e} architecture.  This ABI is not well
25101 specified at present, and is subject to change.
25102
25103 @item -mfdiv
25104 @itemx -mno-fdiv
25105 @opindex mfdiv
25106 Do or don't use hardware floating-point divide and square root instructions.
25107 This requires the F or D extensions for floating-point registers.  The default
25108 is to use them if the specified architecture has these instructions.
25109
25110 @item -mdiv
25111 @itemx -mno-div
25112 @opindex mdiv
25113 Do or don't use hardware instructions for integer division.  This requires the
25114 M extension.  The default is to use them if the specified architecture has
25115 these instructions.
25116
25117 @item -march=@var{ISA-string}
25118 @opindex march
25119 Generate code for given RISC-V ISA (e.g.@: @samp{rv64im}).  ISA strings must be
25120 lower-case.  Examples include @samp{rv64i}, @samp{rv32g}, @samp{rv32e}, and
25121 @samp{rv32imaf}.
25122
25123 @item -mtune=@var{processor-string}
25124 @opindex mtune
25125 Optimize the output for the given processor, specified by microarchitecture
25126 name.  Permissible values for this option are: @samp{rocket},
25127 @samp{sifive-3-series}, @samp{sifive-5-series}, @samp{sifive-7-series},
25128 and @samp{size}.
25129
25130 When @option{-mtune=} is not specified, the default is @samp{rocket}.
25131
25132 The @samp{size} choice is not intended for use by end-users.  This is used
25133 when @option{-Os} is specified.  It overrides the instruction cost info
25134 provided by @option{-mtune=}, but does not override the pipeline info.  This
25135 helps reduce code size while still giving good performance.
25136
25137 @item -mpreferred-stack-boundary=@var{num}
25138 @opindex mpreferred-stack-boundary
25139 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
25140 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
25141 the default is 4 (16 bytes or 128-bits).
25142
25143 @strong{Warning:} If you use this switch, then you must build all modules with
25144 the same value, including any libraries.  This includes the system libraries
25145 and startup modules.
25146
25147 @item -msmall-data-limit=@var{n}
25148 @opindex msmall-data-limit
25149 Put global and static data smaller than @var{n} bytes into a special section
25150 (on some targets).
25151
25152 @item -msave-restore
25153 @itemx -mno-save-restore
25154 @opindex msave-restore
25155 Do or don't use smaller but slower prologue and epilogue code that uses
25156 library function calls.  The default is to use fast inline prologues and
25157 epilogues.
25158
25159 @item -mstrict-align
25160 @itemx -mno-strict-align
25161 @opindex mstrict-align
25162 Do not or do generate unaligned memory accesses.  The default is set depending
25163 on whether the processor we are optimizing for supports fast unaligned access
25164 or not.
25165
25166 @item -mcmodel=medlow
25167 @opindex mcmodel=medlow
25168 Generate code for the medium-low code model. The program and its statically
25169 defined symbols must lie within a single 2 GiB address range and must lie
25170 between absolute addresses @minus{}2 GiB and +2 GiB. Programs can be
25171 statically or dynamically linked. This is the default code model.
25172
25173 @item -mcmodel=medany
25174 @opindex mcmodel=medany
25175 Generate code for the medium-any code model. The program and its statically
25176 defined symbols must be within any single 2 GiB address range. Programs can be
25177 statically or dynamically linked.
25178
25179 @item -mexplicit-relocs
25180 @itemx -mno-exlicit-relocs
25181 Use or do not use assembler relocation operators when dealing with symbolic
25182 addresses.  The alternative is to use assembler macros instead, which may
25183 limit optimization.
25184
25185 @item -mrelax
25186 @itemx -mno-relax
25187 Take advantage of linker relaxations to reduce the number of instructions
25188 required to materialize symbol addresses. The default is to take advantage of
25189 linker relaxations.
25190
25191 @item -memit-attribute
25192 @itemx -mno-emit-attribute
25193 Emit (do not emit) RISC-V attribute to record extra information into ELF
25194 objects.  This feature requires at least binutils 2.32.
25195
25196 @item -malign-data=@var{type}
25197 @opindex malign-data
25198 Control how GCC aligns variables and constants of array, structure, or union
25199 types.  Supported values for @var{type} are @samp{xlen} which uses x register
25200 width as the alignment value, and @samp{natural} which uses natural alignment.
25201 @samp{xlen} is the default.
25202 @end table
25203
25204 @node RL78 Options
25205 @subsection RL78 Options
25206 @cindex RL78 Options
25207
25208 @table @gcctabopt
25209
25210 @item -msim
25211 @opindex msim
25212 Links in additional target libraries to support operation within a
25213 simulator.
25214
25215 @item -mmul=none
25216 @itemx -mmul=g10
25217 @itemx -mmul=g13
25218 @itemx -mmul=g14
25219 @itemx -mmul=rl78
25220 @opindex mmul
25221 Specifies the type of hardware multiplication and division support to
25222 be used.  The simplest is @code{none}, which uses software for both
25223 multiplication and division.  This is the default.  The @code{g13}
25224 value is for the hardware multiply/divide peripheral found on the
25225 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
25226 the multiplication and division instructions supported by the RL78/G14
25227 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
25228 the value @code{mg10} is an alias for @code{none}.
25229
25230 In addition a C preprocessor macro is defined, based upon the setting
25231 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
25232 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
25233
25234 @item -mcpu=g10
25235 @itemx -mcpu=g13
25236 @itemx -mcpu=g14
25237 @itemx -mcpu=rl78
25238 @opindex mcpu
25239 Specifies the RL78 core to target.  The default is the G14 core, also
25240 known as an S3 core or just RL78.  The G13 or S2 core does not have
25241 multiply or divide instructions, instead it uses a hardware peripheral
25242 for these operations.  The G10 or S1 core does not have register
25243 banks, so it uses a different calling convention.
25244
25245 If this option is set it also selects the type of hardware multiply
25246 support to use, unless this is overridden by an explicit
25247 @option{-mmul=none} option on the command line.  Thus specifying
25248 @option{-mcpu=g13} enables the use of the G13 hardware multiply
25249 peripheral and specifying @option{-mcpu=g10} disables the use of
25250 hardware multiplications altogether.
25251
25252 Note, although the RL78/G14 core is the default target, specifying
25253 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
25254 change the behavior of the toolchain since it also enables G14
25255 hardware multiply support.  If these options are not specified on the
25256 command line then software multiplication routines will be used even
25257 though the code targets the RL78 core.  This is for backwards
25258 compatibility with older toolchains which did not have hardware
25259 multiply and divide support.
25260
25261 In addition a C preprocessor macro is defined, based upon the setting
25262 of this option.  Possible values are: @code{__RL78_G10__},
25263 @code{__RL78_G13__} or @code{__RL78_G14__}.
25264
25265 @item -mg10
25266 @itemx -mg13
25267 @itemx -mg14
25268 @itemx -mrl78
25269 @opindex mg10
25270 @opindex mg13
25271 @opindex mg14
25272 @opindex mrl78
25273 These are aliases for the corresponding @option{-mcpu=} option.  They
25274 are provided for backwards compatibility.
25275
25276 @item -mallregs
25277 @opindex mallregs
25278 Allow the compiler to use all of the available registers.  By default
25279 registers @code{r24..r31} are reserved for use in interrupt handlers.
25280 With this option enabled these registers can be used in ordinary
25281 functions as well.
25282
25283 @item -m64bit-doubles
25284 @itemx -m32bit-doubles
25285 @opindex m64bit-doubles
25286 @opindex m32bit-doubles
25287 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
25288 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
25289 @option{-m32bit-doubles}.
25290
25291 @item -msave-mduc-in-interrupts
25292 @itemx -mno-save-mduc-in-interrupts
25293 @opindex msave-mduc-in-interrupts
25294 @opindex mno-save-mduc-in-interrupts
25295 Specifies that interrupt handler functions should preserve the
25296 MDUC registers.  This is only necessary if normal code might use
25297 the MDUC registers, for example because it performs multiplication
25298 and division operations.  The default is to ignore the MDUC registers
25299 as this makes the interrupt handlers faster.  The target option -mg13
25300 needs to be passed for this to work as this feature is only available
25301 on the G13 target (S2 core).  The MDUC registers will only be saved
25302 if the interrupt handler performs a multiplication or division
25303 operation or it calls another function.
25304
25305 @end table
25306
25307 @node RS/6000 and PowerPC Options
25308 @subsection IBM RS/6000 and PowerPC Options
25309 @cindex RS/6000 and PowerPC Options
25310 @cindex IBM RS/6000 and PowerPC Options
25311
25312 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
25313 @table @gcctabopt
25314 @item -mpowerpc-gpopt
25315 @itemx -mno-powerpc-gpopt
25316 @itemx -mpowerpc-gfxopt
25317 @itemx -mno-powerpc-gfxopt
25318 @need 800
25319 @itemx -mpowerpc64
25320 @itemx -mno-powerpc64
25321 @itemx -mmfcrf
25322 @itemx -mno-mfcrf
25323 @itemx -mpopcntb
25324 @itemx -mno-popcntb
25325 @itemx -mpopcntd
25326 @itemx -mno-popcntd
25327 @itemx -mfprnd
25328 @itemx -mno-fprnd
25329 @need 800
25330 @itemx -mcmpb
25331 @itemx -mno-cmpb
25332 @itemx -mhard-dfp
25333 @itemx -mno-hard-dfp
25334 @opindex mpowerpc-gpopt
25335 @opindex mno-powerpc-gpopt
25336 @opindex mpowerpc-gfxopt
25337 @opindex mno-powerpc-gfxopt
25338 @opindex mpowerpc64
25339 @opindex mno-powerpc64
25340 @opindex mmfcrf
25341 @opindex mno-mfcrf
25342 @opindex mpopcntb
25343 @opindex mno-popcntb
25344 @opindex mpopcntd
25345 @opindex mno-popcntd
25346 @opindex mfprnd
25347 @opindex mno-fprnd
25348 @opindex mcmpb
25349 @opindex mno-cmpb
25350 @opindex mhard-dfp
25351 @opindex mno-hard-dfp
25352 You use these options to specify which instructions are available on the
25353 processor you are using.  The default value of these options is
25354 determined when configuring GCC@.  Specifying the
25355 @option{-mcpu=@var{cpu_type}} overrides the specification of these
25356 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
25357 rather than the options listed above.
25358
25359 Specifying @option{-mpowerpc-gpopt} allows
25360 GCC to use the optional PowerPC architecture instructions in the
25361 General Purpose group, including floating-point square root.  Specifying
25362 @option{-mpowerpc-gfxopt} allows GCC to
25363 use the optional PowerPC architecture instructions in the Graphics
25364 group, including floating-point select.
25365
25366 The @option{-mmfcrf} option allows GCC to generate the move from
25367 condition register field instruction implemented on the POWER4
25368 processor and other processors that support the PowerPC V2.01
25369 architecture.
25370 The @option{-mpopcntb} option allows GCC to generate the popcount and
25371 double-precision FP reciprocal estimate instruction implemented on the
25372 POWER5 processor and other processors that support the PowerPC V2.02
25373 architecture.
25374 The @option{-mpopcntd} option allows GCC to generate the popcount
25375 instruction implemented on the POWER7 processor and other processors
25376 that support the PowerPC V2.06 architecture.
25377 The @option{-mfprnd} option allows GCC to generate the FP round to
25378 integer instructions implemented on the POWER5+ processor and other
25379 processors that support the PowerPC V2.03 architecture.
25380 The @option{-mcmpb} option allows GCC to generate the compare bytes
25381 instruction implemented on the POWER6 processor and other processors
25382 that support the PowerPC V2.05 architecture.
25383 The @option{-mhard-dfp} option allows GCC to generate the decimal
25384 floating-point instructions implemented on some POWER processors.
25385
25386 The @option{-mpowerpc64} option allows GCC to generate the additional
25387 64-bit instructions that are found in the full PowerPC64 architecture
25388 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
25389 @option{-mno-powerpc64}.
25390
25391 @item -mcpu=@var{cpu_type}
25392 @opindex mcpu
25393 Set architecture type, register usage, and
25394 instruction scheduling parameters for machine type @var{cpu_type}.
25395 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
25396 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
25397 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
25398 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
25399 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
25400 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
25401 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
25402 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
25403 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
25404 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
25405 @samp{power9}, @samp{future}, @samp{powerpc}, @samp{powerpc64},
25406 @samp{powerpc64le}, @samp{rs64}, and @samp{native}.
25407
25408 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
25409 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
25410 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
25411 architecture machine types, with an appropriate, generic processor
25412 model assumed for scheduling purposes.
25413
25414 Specifying @samp{native} as cpu type detects and selects the
25415 architecture option that corresponds to the host processor of the
25416 system performing the compilation.
25417 @option{-mcpu=native} has no effect if GCC does not recognize the
25418 processor.
25419
25420 The other options specify a specific processor.  Code generated under
25421 those options runs best on that processor, and may not run at all on
25422 others.
25423
25424 The @option{-mcpu} options automatically enable or disable the
25425 following options:
25426
25427 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
25428 -mpopcntb  -mpopcntd  -mpowerpc64 @gol
25429 -mpowerpc-gpopt  -mpowerpc-gfxopt @gol
25430 -mmulhw  -mdlmzb  -mmfpgpr  -mvsx @gol
25431 -mcrypto  -mhtm  -mpower8-fusion  -mpower8-vector @gol
25432 -mquad-memory  -mquad-memory-atomic  -mfloat128  -mfloat128-hardware}
25433
25434 The particular options set for any particular CPU varies between
25435 compiler versions, depending on what setting seems to produce optimal
25436 code for that CPU; it doesn't necessarily reflect the actual hardware's
25437 capabilities.  If you wish to set an individual option to a particular
25438 value, you may specify it after the @option{-mcpu} option, like
25439 @option{-mcpu=970 -mno-altivec}.
25440
25441 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
25442 not enabled or disabled by the @option{-mcpu} option at present because
25443 AIX does not have full support for these options.  You may still
25444 enable or disable them individually if you're sure it'll work in your
25445 environment.
25446
25447 @item -mtune=@var{cpu_type}
25448 @opindex mtune
25449 Set the instruction scheduling parameters for machine type
25450 @var{cpu_type}, but do not set the architecture type or register usage,
25451 as @option{-mcpu=@var{cpu_type}} does.  The same
25452 values for @var{cpu_type} are used for @option{-mtune} as for
25453 @option{-mcpu}.  If both are specified, the code generated uses the
25454 architecture and registers set by @option{-mcpu}, but the
25455 scheduling parameters set by @option{-mtune}.
25456
25457 @item -mcmodel=small
25458 @opindex mcmodel=small
25459 Generate PowerPC64 code for the small model: The TOC is limited to
25460 64k.
25461
25462 @item -mcmodel=medium
25463 @opindex mcmodel=medium
25464 Generate PowerPC64 code for the medium model: The TOC and other static
25465 data may be up to a total of 4G in size.  This is the default for 64-bit
25466 Linux.
25467
25468 @item -mcmodel=large
25469 @opindex mcmodel=large
25470 Generate PowerPC64 code for the large model: The TOC may be up to 4G
25471 in size.  Other data and code is only limited by the 64-bit address
25472 space.
25473
25474 @item -maltivec
25475 @itemx -mno-altivec
25476 @opindex maltivec
25477 @opindex mno-altivec
25478 Generate code that uses (does not use) AltiVec instructions, and also
25479 enable the use of built-in functions that allow more direct access to
25480 the AltiVec instruction set.  You may also need to set
25481 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
25482 enhancements.
25483
25484 When @option{-maltivec} is used, the element order for AltiVec intrinsics
25485 such as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
25486 match array element order corresponding to the endianness of the
25487 target.  That is, element zero identifies the leftmost element in a
25488 vector register when targeting a big-endian platform, and identifies
25489 the rightmost element in a vector register when targeting a
25490 little-endian platform.
25491
25492 @item -mvrsave
25493 @itemx -mno-vrsave
25494 @opindex mvrsave
25495 @opindex mno-vrsave
25496 Generate VRSAVE instructions when generating AltiVec code.
25497
25498 @item -msecure-plt
25499 @opindex msecure-plt
25500 Generate code that allows @command{ld} and @command{ld.so}
25501 to build executables and shared
25502 libraries with non-executable @code{.plt} and @code{.got} sections.
25503 This is a PowerPC
25504 32-bit SYSV ABI option.
25505
25506 @item -mbss-plt
25507 @opindex mbss-plt
25508 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
25509 fills in, and
25510 requires @code{.plt} and @code{.got}
25511 sections that are both writable and executable.
25512 This is a PowerPC 32-bit SYSV ABI option.
25513
25514 @item -misel
25515 @itemx -mno-isel
25516 @opindex misel
25517 @opindex mno-isel
25518 This switch enables or disables the generation of ISEL instructions.
25519
25520 @item -mvsx
25521 @itemx -mno-vsx
25522 @opindex mvsx
25523 @opindex mno-vsx
25524 Generate code that uses (does not use) vector/scalar (VSX)
25525 instructions, and also enable the use of built-in functions that allow
25526 more direct access to the VSX instruction set.
25527
25528 @item -mcrypto
25529 @itemx -mno-crypto
25530 @opindex mcrypto
25531 @opindex mno-crypto
25532 Enable the use (disable) of the built-in functions that allow direct
25533 access to the cryptographic instructions that were added in version
25534 2.07 of the PowerPC ISA.
25535
25536 @item -mhtm
25537 @itemx -mno-htm
25538 @opindex mhtm
25539 @opindex mno-htm
25540 Enable (disable) the use of the built-in functions that allow direct
25541 access to the Hardware Transactional Memory (HTM) instructions that
25542 were added in version 2.07 of the PowerPC ISA.
25543
25544 @item -mpower8-fusion
25545 @itemx -mno-power8-fusion
25546 @opindex mpower8-fusion
25547 @opindex mno-power8-fusion
25548 Generate code that keeps (does not keeps) some integer operations
25549 adjacent so that the instructions can be fused together on power8 and
25550 later processors.
25551
25552 @item -mpower8-vector
25553 @itemx -mno-power8-vector
25554 @opindex mpower8-vector
25555 @opindex mno-power8-vector
25556 Generate code that uses (does not use) the vector and scalar
25557 instructions that were added in version 2.07 of the PowerPC ISA.  Also
25558 enable the use of built-in functions that allow more direct access to
25559 the vector instructions.
25560
25561 @item -mquad-memory
25562 @itemx -mno-quad-memory
25563 @opindex mquad-memory
25564 @opindex mno-quad-memory
25565 Generate code that uses (does not use) the non-atomic quad word memory
25566 instructions.  The @option{-mquad-memory} option requires use of
25567 64-bit mode.
25568
25569 @item -mquad-memory-atomic
25570 @itemx -mno-quad-memory-atomic
25571 @opindex mquad-memory-atomic
25572 @opindex mno-quad-memory-atomic
25573 Generate code that uses (does not use) the atomic quad word memory
25574 instructions.  The @option{-mquad-memory-atomic} option requires use of
25575 64-bit mode.
25576
25577 @item -mfloat128
25578 @itemx -mno-float128
25579 @opindex mfloat128
25580 @opindex mno-float128
25581 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
25582 and use either software emulation for IEEE 128-bit floating point or
25583 hardware instructions.
25584
25585 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7},
25586 @option{-mcpu=power8}), or @option{-mcpu=power9} must be enabled to
25587 use the IEEE 128-bit floating point support.  The IEEE 128-bit
25588 floating point support only works on PowerPC Linux systems.
25589
25590 The default for @option{-mfloat128} is enabled on PowerPC Linux
25591 systems using the VSX instruction set, and disabled on other systems.
25592
25593 If you use the ISA 3.0 instruction set (@option{-mpower9-vector} or
25594 @option{-mcpu=power9}) on a 64-bit system, the IEEE 128-bit floating
25595 point support will also enable the generation of ISA 3.0 IEEE 128-bit
25596 floating point instructions.  Otherwise, if you do not specify to
25597 generate ISA 3.0 instructions or you are targeting a 32-bit big endian
25598 system, IEEE 128-bit floating point will be done with software
25599 emulation.
25600
25601 @item -mfloat128-hardware
25602 @itemx -mno-float128-hardware
25603 @opindex mfloat128-hardware
25604 @opindex mno-float128-hardware
25605 Enable/disable using ISA 3.0 hardware instructions to support the
25606 @var{__float128} data type.
25607
25608 The default for @option{-mfloat128-hardware} is enabled on PowerPC
25609 Linux systems using the ISA 3.0 instruction set, and disabled on other
25610 systems.
25611
25612 @item -m32
25613 @itemx -m64
25614 @opindex m32
25615 @opindex m64
25616 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
25617 targets (including GNU/Linux).  The 32-bit environment sets int, long
25618 and pointer to 32 bits and generates code that runs on any PowerPC
25619 variant.  The 64-bit environment sets int to 32 bits and long and
25620 pointer to 64 bits, and generates code for PowerPC64, as for
25621 @option{-mpowerpc64}.
25622
25623 @item -mfull-toc
25624 @itemx -mno-fp-in-toc
25625 @itemx -mno-sum-in-toc
25626 @itemx -mminimal-toc
25627 @opindex mfull-toc
25628 @opindex mno-fp-in-toc
25629 @opindex mno-sum-in-toc
25630 @opindex mminimal-toc
25631 Modify generation of the TOC (Table Of Contents), which is created for
25632 every executable file.  The @option{-mfull-toc} option is selected by
25633 default.  In that case, GCC allocates at least one TOC entry for
25634 each unique non-automatic variable reference in your program.  GCC
25635 also places floating-point constants in the TOC@.  However, only
25636 16,384 entries are available in the TOC@.
25637
25638 If you receive a linker error message that saying you have overflowed
25639 the available TOC space, you can reduce the amount of TOC space used
25640 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
25641 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
25642 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
25643 generate code to calculate the sum of an address and a constant at
25644 run time instead of putting that sum into the TOC@.  You may specify one
25645 or both of these options.  Each causes GCC to produce very slightly
25646 slower and larger code at the expense of conserving TOC space.
25647
25648 If you still run out of space in the TOC even when you specify both of
25649 these options, specify @option{-mminimal-toc} instead.  This option causes
25650 GCC to make only one TOC entry for every file.  When you specify this
25651 option, GCC produces code that is slower and larger but which
25652 uses extremely little TOC space.  You may wish to use this option
25653 only on files that contain less frequently-executed code.
25654
25655 @item -maix64
25656 @itemx -maix32
25657 @opindex maix64
25658 @opindex maix32
25659 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
25660 @code{long} type, and the infrastructure needed to support them.
25661 Specifying @option{-maix64} implies @option{-mpowerpc64},
25662 while @option{-maix32} disables the 64-bit ABI and
25663 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
25664
25665 @item -mxl-compat
25666 @itemx -mno-xl-compat
25667 @opindex mxl-compat
25668 @opindex mno-xl-compat
25669 Produce code that conforms more closely to IBM XL compiler semantics
25670 when using AIX-compatible ABI@.  Pass floating-point arguments to
25671 prototyped functions beyond the register save area (RSA) on the stack
25672 in addition to argument FPRs.  Do not assume that most significant
25673 double in 128-bit long double value is properly rounded when comparing
25674 values and converting to double.  Use XL symbol names for long double
25675 support routines.
25676
25677 The AIX calling convention was extended but not initially documented to
25678 handle an obscure K&R C case of calling a function that takes the
25679 address of its arguments with fewer arguments than declared.  IBM XL
25680 compilers access floating-point arguments that do not fit in the
25681 RSA from the stack when a subroutine is compiled without
25682 optimization.  Because always storing floating-point arguments on the
25683 stack is inefficient and rarely needed, this option is not enabled by
25684 default and only is necessary when calling subroutines compiled by IBM
25685 XL compilers without optimization.
25686
25687 @item -mpe
25688 @opindex mpe
25689 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
25690 application written to use message passing with special startup code to
25691 enable the application to run.  The system must have PE installed in the
25692 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
25693 must be overridden with the @option{-specs=} option to specify the
25694 appropriate directory location.  The Parallel Environment does not
25695 support threads, so the @option{-mpe} option and the @option{-pthread}
25696 option are incompatible.
25697
25698 @item -malign-natural
25699 @itemx -malign-power
25700 @opindex malign-natural
25701 @opindex malign-power
25702 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
25703 @option{-malign-natural} overrides the ABI-defined alignment of larger
25704 types, such as floating-point doubles, on their natural size-based boundary.
25705 The option @option{-malign-power} instructs GCC to follow the ABI-specified
25706 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
25707
25708 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
25709 is not supported.
25710
25711 @item -msoft-float
25712 @itemx -mhard-float
25713 @opindex msoft-float
25714 @opindex mhard-float
25715 Generate code that does not use (uses) the floating-point register set.
25716 Software floating-point emulation is provided if you use the
25717 @option{-msoft-float} option, and pass the option to GCC when linking.
25718
25719 @item -mmultiple
25720 @itemx -mno-multiple
25721 @opindex mmultiple
25722 @opindex mno-multiple
25723 Generate code that uses (does not use) the load multiple word
25724 instructions and the store multiple word instructions.  These
25725 instructions are generated by default on POWER systems, and not
25726 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
25727 PowerPC systems, since those instructions do not work when the
25728 processor is in little-endian mode.  The exceptions are PPC740 and
25729 PPC750 which permit these instructions in little-endian mode.
25730
25731 @item -mupdate
25732 @itemx -mno-update
25733 @opindex mupdate
25734 @opindex mno-update
25735 Generate code that uses (does not use) the load or store instructions
25736 that update the base register to the address of the calculated memory
25737 location.  These instructions are generated by default.  If you use
25738 @option{-mno-update}, there is a small window between the time that the
25739 stack pointer is updated and the address of the previous frame is
25740 stored, which means code that walks the stack frame across interrupts or
25741 signals may get corrupted data.
25742
25743 @item -mavoid-indexed-addresses
25744 @itemx -mno-avoid-indexed-addresses
25745 @opindex mavoid-indexed-addresses
25746 @opindex mno-avoid-indexed-addresses
25747 Generate code that tries to avoid (not avoid) the use of indexed load
25748 or store instructions. These instructions can incur a performance
25749 penalty on Power6 processors in certain situations, such as when
25750 stepping through large arrays that cross a 16M boundary.  This option
25751 is enabled by default when targeting Power6 and disabled otherwise.
25752
25753 @item -mfused-madd
25754 @itemx -mno-fused-madd
25755 @opindex mfused-madd
25756 @opindex mno-fused-madd
25757 Generate code that uses (does not use) the floating-point multiply and
25758 accumulate instructions.  These instructions are generated by default
25759 if hardware floating point is used.  The machine-dependent
25760 @option{-mfused-madd} option is now mapped to the machine-independent
25761 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
25762 mapped to @option{-ffp-contract=off}.
25763
25764 @item -mmulhw
25765 @itemx -mno-mulhw
25766 @opindex mmulhw
25767 @opindex mno-mulhw
25768 Generate code that uses (does not use) the half-word multiply and
25769 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
25770 These instructions are generated by default when targeting those
25771 processors.
25772
25773 @item -mdlmzb
25774 @itemx -mno-dlmzb
25775 @opindex mdlmzb
25776 @opindex mno-dlmzb
25777 Generate code that uses (does not use) the string-search @samp{dlmzb}
25778 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
25779 generated by default when targeting those processors.
25780
25781 @item -mno-bit-align
25782 @itemx -mbit-align
25783 @opindex mno-bit-align
25784 @opindex mbit-align
25785 On System V.4 and embedded PowerPC systems do not (do) force structures
25786 and unions that contain bit-fields to be aligned to the base type of the
25787 bit-field.
25788
25789 For example, by default a structure containing nothing but 8
25790 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
25791 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
25792 the structure is aligned to a 1-byte boundary and is 1 byte in
25793 size.
25794
25795 @item -mno-strict-align
25796 @itemx -mstrict-align
25797 @opindex mno-strict-align
25798 @opindex mstrict-align
25799 On System V.4 and embedded PowerPC systems do not (do) assume that
25800 unaligned memory references are handled by the system.
25801
25802 @item -mrelocatable
25803 @itemx -mno-relocatable
25804 @opindex mrelocatable
25805 @opindex mno-relocatable
25806 Generate code that allows (does not allow) a static executable to be
25807 relocated to a different address at run time.  A simple embedded
25808 PowerPC system loader should relocate the entire contents of
25809 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
25810 a table of 32-bit addresses generated by this option.  For this to
25811 work, all objects linked together must be compiled with
25812 @option{-mrelocatable} or @option{-mrelocatable-lib}.
25813 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
25814
25815 @item -mrelocatable-lib
25816 @itemx -mno-relocatable-lib
25817 @opindex mrelocatable-lib
25818 @opindex mno-relocatable-lib
25819 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
25820 @code{.fixup} section to allow static executables to be relocated at
25821 run time, but @option{-mrelocatable-lib} does not use the smaller stack
25822 alignment of @option{-mrelocatable}.  Objects compiled with
25823 @option{-mrelocatable-lib} may be linked with objects compiled with
25824 any combination of the @option{-mrelocatable} options.
25825
25826 @item -mno-toc
25827 @itemx -mtoc
25828 @opindex mno-toc
25829 @opindex mtoc
25830 On System V.4 and embedded PowerPC systems do not (do) assume that
25831 register 2 contains a pointer to a global area pointing to the addresses
25832 used in the program.
25833
25834 @item -mlittle
25835 @itemx -mlittle-endian
25836 @opindex mlittle
25837 @opindex mlittle-endian
25838 On System V.4 and embedded PowerPC systems compile code for the
25839 processor in little-endian mode.  The @option{-mlittle-endian} option is
25840 the same as @option{-mlittle}.
25841
25842 @item -mbig
25843 @itemx -mbig-endian
25844 @opindex mbig
25845 @opindex mbig-endian
25846 On System V.4 and embedded PowerPC systems compile code for the
25847 processor in big-endian mode.  The @option{-mbig-endian} option is
25848 the same as @option{-mbig}.
25849
25850 @item -mdynamic-no-pic
25851 @opindex mdynamic-no-pic
25852 On Darwin and Mac OS X systems, compile code so that it is not
25853 relocatable, but that its external references are relocatable.  The
25854 resulting code is suitable for applications, but not shared
25855 libraries.
25856
25857 @item -msingle-pic-base
25858 @opindex msingle-pic-base
25859 Treat the register used for PIC addressing as read-only, rather than
25860 loading it in the prologue for each function.  The runtime system is
25861 responsible for initializing this register with an appropriate value
25862 before execution begins.
25863
25864 @item -mprioritize-restricted-insns=@var{priority}
25865 @opindex mprioritize-restricted-insns
25866 This option controls the priority that is assigned to
25867 dispatch-slot restricted instructions during the second scheduling
25868 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
25869 or @samp{2} to assign no, highest, or second-highest (respectively) 
25870 priority to dispatch-slot restricted
25871 instructions.
25872
25873 @item -msched-costly-dep=@var{dependence_type}
25874 @opindex msched-costly-dep
25875 This option controls which dependences are considered costly
25876 by the target during instruction scheduling.  The argument
25877 @var{dependence_type} takes one of the following values:
25878
25879 @table @asis
25880 @item @samp{no}
25881 No dependence is costly.
25882
25883 @item @samp{all}
25884 All dependences are costly.
25885
25886 @item @samp{true_store_to_load}
25887 A true dependence from store to load is costly.
25888
25889 @item @samp{store_to_load}
25890 Any dependence from store to load is costly.
25891
25892 @item @var{number}
25893 Any dependence for which the latency is greater than or equal to 
25894 @var{number} is costly.
25895 @end table
25896
25897 @item -minsert-sched-nops=@var{scheme}
25898 @opindex minsert-sched-nops
25899 This option controls which NOP insertion scheme is used during
25900 the second scheduling pass.  The argument @var{scheme} takes one of the
25901 following values:
25902
25903 @table @asis
25904 @item @samp{no}
25905 Don't insert NOPs.
25906
25907 @item @samp{pad}
25908 Pad with NOPs any dispatch group that has vacant issue slots,
25909 according to the scheduler's grouping.
25910
25911 @item @samp{regroup_exact}
25912 Insert NOPs to force costly dependent insns into
25913 separate groups.  Insert exactly as many NOPs as needed to force an insn
25914 to a new group, according to the estimated processor grouping.
25915
25916 @item @var{number}
25917 Insert NOPs to force costly dependent insns into
25918 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
25919 @end table
25920
25921 @item -mcall-sysv
25922 @opindex mcall-sysv
25923 On System V.4 and embedded PowerPC systems compile code using calling
25924 conventions that adhere to the March 1995 draft of the System V
25925 Application Binary Interface, PowerPC processor supplement.  This is the
25926 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
25927
25928 @item -mcall-sysv-eabi
25929 @itemx -mcall-eabi
25930 @opindex mcall-sysv-eabi
25931 @opindex mcall-eabi
25932 Specify both @option{-mcall-sysv} and @option{-meabi} options.
25933
25934 @item -mcall-sysv-noeabi
25935 @opindex mcall-sysv-noeabi
25936 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
25937
25938 @item -mcall-aixdesc
25939 @opindex m
25940 On System V.4 and embedded PowerPC systems compile code for the AIX
25941 operating system.
25942
25943 @item -mcall-linux
25944 @opindex mcall-linux
25945 On System V.4 and embedded PowerPC systems compile code for the
25946 Linux-based GNU system.
25947
25948 @item -mcall-freebsd
25949 @opindex mcall-freebsd
25950 On System V.4 and embedded PowerPC systems compile code for the
25951 FreeBSD operating system.
25952
25953 @item -mcall-netbsd
25954 @opindex mcall-netbsd
25955 On System V.4 and embedded PowerPC systems compile code for the
25956 NetBSD operating system.
25957
25958 @item -mcall-openbsd
25959 @opindex mcall-netbsd
25960 On System V.4 and embedded PowerPC systems compile code for the
25961 OpenBSD operating system.
25962
25963 @item -mtraceback=@var{traceback_type}
25964 @opindex mtraceback
25965 Select the type of traceback table. Valid values for @var{traceback_type}
25966 are @samp{full}, @samp{part}, and @samp{no}.
25967
25968 @item -maix-struct-return
25969 @opindex maix-struct-return
25970 Return all structures in memory (as specified by the AIX ABI)@.
25971
25972 @item -msvr4-struct-return
25973 @opindex msvr4-struct-return
25974 Return structures smaller than 8 bytes in registers (as specified by the
25975 SVR4 ABI)@.
25976
25977 @item -mabi=@var{abi-type}
25978 @opindex mabi
25979 Extend the current ABI with a particular extension, or remove such extension.
25980 Valid values are @samp{altivec}, @samp{no-altivec},
25981 @samp{ibmlongdouble}, @samp{ieeelongdouble},
25982 @samp{elfv1}, @samp{elfv2}@.
25983
25984 @item -mabi=ibmlongdouble
25985 @opindex mabi=ibmlongdouble
25986 Change the current ABI to use IBM extended-precision long double.
25987 This is not likely to work if your system defaults to using IEEE
25988 extended-precision long double.  If you change the long double type
25989 from IEEE extended-precision, the compiler will issue a warning unless
25990 you use the @option{-Wno-psabi} option.  Requires @option{-mlong-double-128}
25991 to be enabled.
25992
25993 @item -mabi=ieeelongdouble
25994 @opindex mabi=ieeelongdouble
25995 Change the current ABI to use IEEE extended-precision long double.
25996 This is not likely to work if your system defaults to using IBM
25997 extended-precision long double.  If you change the long double type
25998 from IBM extended-precision, the compiler will issue a warning unless
25999 you use the @option{-Wno-psabi} option.  Requires @option{-mlong-double-128}
26000 to be enabled.
26001
26002 @item -mabi=elfv1
26003 @opindex mabi=elfv1
26004 Change the current ABI to use the ELFv1 ABI.
26005 This is the default ABI for big-endian PowerPC 64-bit Linux.
26006 Overriding the default ABI requires special system support and is
26007 likely to fail in spectacular ways.
26008
26009 @item -mabi=elfv2
26010 @opindex mabi=elfv2
26011 Change the current ABI to use the ELFv2 ABI.
26012 This is the default ABI for little-endian PowerPC 64-bit Linux.
26013 Overriding the default ABI requires special system support and is
26014 likely to fail in spectacular ways.
26015
26016 @item -mgnu-attribute
26017 @itemx -mno-gnu-attribute
26018 @opindex mgnu-attribute
26019 @opindex mno-gnu-attribute
26020 Emit .gnu_attribute assembly directives to set tag/value pairs in a
26021 .gnu.attributes section that specify ABI variations in function
26022 parameters or return values.
26023
26024 @item -mprototype
26025 @itemx -mno-prototype
26026 @opindex mprototype
26027 @opindex mno-prototype
26028 On System V.4 and embedded PowerPC systems assume that all calls to
26029 variable argument functions are properly prototyped.  Otherwise, the
26030 compiler must insert an instruction before every non-prototyped call to
26031 set or clear bit 6 of the condition code register (@code{CR}) to
26032 indicate whether floating-point values are passed in the floating-point
26033 registers in case the function takes variable arguments.  With
26034 @option{-mprototype}, only calls to prototyped variable argument functions
26035 set or clear the bit.
26036
26037 @item -msim
26038 @opindex msim
26039 On embedded PowerPC systems, assume that the startup module is called
26040 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
26041 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
26042 configurations.
26043
26044 @item -mmvme
26045 @opindex mmvme
26046 On embedded PowerPC systems, assume that the startup module is called
26047 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
26048 @file{libc.a}.
26049
26050 @item -mads
26051 @opindex mads
26052 On embedded PowerPC systems, assume that the startup module is called
26053 @file{crt0.o} and the standard C libraries are @file{libads.a} and
26054 @file{libc.a}.
26055
26056 @item -myellowknife
26057 @opindex myellowknife
26058 On embedded PowerPC systems, assume that the startup module is called
26059 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
26060 @file{libc.a}.
26061
26062 @item -mvxworks
26063 @opindex mvxworks
26064 On System V.4 and embedded PowerPC systems, specify that you are
26065 compiling for a VxWorks system.
26066
26067 @item -memb
26068 @opindex memb
26069 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
26070 header to indicate that @samp{eabi} extended relocations are used.
26071
26072 @item -meabi
26073 @itemx -mno-eabi
26074 @opindex meabi
26075 @opindex mno-eabi
26076 On System V.4 and embedded PowerPC systems do (do not) adhere to the
26077 Embedded Applications Binary Interface (EABI), which is a set of
26078 modifications to the System V.4 specifications.  Selecting @option{-meabi}
26079 means that the stack is aligned to an 8-byte boundary, a function
26080 @code{__eabi} is called from @code{main} to set up the EABI
26081 environment, and the @option{-msdata} option can use both @code{r2} and
26082 @code{r13} to point to two separate small data areas.  Selecting
26083 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
26084 no EABI initialization function is called from @code{main}, and the
26085 @option{-msdata} option only uses @code{r13} to point to a single
26086 small data area.  The @option{-meabi} option is on by default if you
26087 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
26088
26089 @item -msdata=eabi
26090 @opindex msdata=eabi
26091 On System V.4 and embedded PowerPC systems, put small initialized
26092 @code{const} global and static data in the @code{.sdata2} section, which
26093 is pointed to by register @code{r2}.  Put small initialized
26094 non-@code{const} global and static data in the @code{.sdata} section,
26095 which is pointed to by register @code{r13}.  Put small uninitialized
26096 global and static data in the @code{.sbss} section, which is adjacent to
26097 the @code{.sdata} section.  The @option{-msdata=eabi} option is
26098 incompatible with the @option{-mrelocatable} option.  The
26099 @option{-msdata=eabi} option also sets the @option{-memb} option.
26100
26101 @item -msdata=sysv
26102 @opindex msdata=sysv
26103 On System V.4 and embedded PowerPC systems, put small global and static
26104 data in the @code{.sdata} section, which is pointed to by register
26105 @code{r13}.  Put small uninitialized global and static data in the
26106 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
26107 The @option{-msdata=sysv} option is incompatible with the
26108 @option{-mrelocatable} option.
26109
26110 @item -msdata=default
26111 @itemx -msdata
26112 @opindex msdata=default
26113 @opindex msdata
26114 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
26115 compile code the same as @option{-msdata=eabi}, otherwise compile code the
26116 same as @option{-msdata=sysv}.
26117
26118 @item -msdata=data
26119 @opindex msdata=data
26120 On System V.4 and embedded PowerPC systems, put small global
26121 data in the @code{.sdata} section.  Put small uninitialized global
26122 data in the @code{.sbss} section.  Do not use register @code{r13}
26123 to address small data however.  This is the default behavior unless
26124 other @option{-msdata} options are used.
26125
26126 @item -msdata=none
26127 @itemx -mno-sdata
26128 @opindex msdata=none
26129 @opindex mno-sdata
26130 On embedded PowerPC systems, put all initialized global and static data
26131 in the @code{.data} section, and all uninitialized data in the
26132 @code{.bss} section.
26133
26134 @item -mreadonly-in-sdata
26135 @opindex mreadonly-in-sdata
26136 @opindex mno-readonly-in-sdata
26137 Put read-only objects in the @code{.sdata} section as well.  This is the
26138 default.
26139
26140 @item -mblock-move-inline-limit=@var{num}
26141 @opindex mblock-move-inline-limit
26142 Inline all block moves (such as calls to @code{memcpy} or structure
26143 copies) less than or equal to @var{num} bytes.  The minimum value for
26144 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
26145 targets.  The default value is target-specific.
26146
26147 @item -mblock-compare-inline-limit=@var{num}
26148 @opindex mblock-compare-inline-limit
26149 Generate non-looping inline code for all block compares (such as calls
26150 to @code{memcmp} or structure compares) less than or equal to @var{num}
26151 bytes. If @var{num} is 0, all inline expansion (non-loop and loop) of
26152 block compare is disabled. The default value is target-specific.
26153
26154 @item -mblock-compare-inline-loop-limit=@var{num}
26155 @opindex mblock-compare-inline-loop-limit
26156 Generate an inline expansion using loop code for all block compares that
26157 are less than or equal to @var{num} bytes, but greater than the limit
26158 for non-loop inline block compare expansion. If the block length is not
26159 constant, at most @var{num} bytes will be compared before @code{memcmp}
26160 is called to compare the remainder of the block. The default value is
26161 target-specific.
26162
26163 @item -mstring-compare-inline-limit=@var{num}
26164 @opindex mstring-compare-inline-limit
26165 Compare at most @var{num} string bytes with inline code.
26166 If the difference or end of string is not found at the
26167 end of the inline compare a call to @code{strcmp} or @code{strncmp} will
26168 take care of the rest of the comparison. The default is 64 bytes.
26169
26170 @item -G @var{num}
26171 @opindex G
26172 @cindex smaller data references (PowerPC)
26173 @cindex .sdata/.sdata2 references (PowerPC)
26174 On embedded PowerPC systems, put global and static items less than or
26175 equal to @var{num} bytes into the small data or BSS sections instead of
26176 the normal data or BSS section.  By default, @var{num} is 8.  The
26177 @option{-G @var{num}} switch is also passed to the linker.
26178 All modules should be compiled with the same @option{-G @var{num}} value.
26179
26180 @item -mregnames
26181 @itemx -mno-regnames
26182 @opindex mregnames
26183 @opindex mno-regnames
26184 On System V.4 and embedded PowerPC systems do (do not) emit register
26185 names in the assembly language output using symbolic forms.
26186
26187 @item -mlongcall
26188 @itemx -mno-longcall
26189 @opindex mlongcall
26190 @opindex mno-longcall
26191 By default assume that all calls are far away so that a longer and more
26192 expensive calling sequence is required.  This is required for calls
26193 farther than 32 megabytes (33,554,432 bytes) from the current location.
26194 A short call is generated if the compiler knows
26195 the call cannot be that far away.  This setting can be overridden by
26196 the @code{shortcall} function attribute, or by @code{#pragma
26197 longcall(0)}.
26198
26199 Some linkers are capable of detecting out-of-range calls and generating
26200 glue code on the fly.  On these systems, long calls are unnecessary and
26201 generate slower code.  As of this writing, the AIX linker can do this,
26202 as can the GNU linker for PowerPC/64.  It is planned to add this feature
26203 to the GNU linker for 32-bit PowerPC systems as well.
26204
26205 On PowerPC64 ELFv2 and 32-bit PowerPC systems with newer GNU linkers,
26206 GCC can generate long calls using an inline PLT call sequence (see
26207 @option{-mpltseq}).  PowerPC with @option{-mbss-plt} and PowerPC64
26208 ELFv1 (big-endian) do not support inline PLT calls.
26209
26210 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
26211 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
26212 addresses represent the callee and the branch island.  The
26213 Darwin/PPC linker prefers the first address and generates a @code{bl
26214 callee} if the PPC @code{bl} instruction reaches the callee directly;
26215 otherwise, the linker generates @code{bl L42} to call the branch
26216 island.  The branch island is appended to the body of the
26217 calling function; it computes the full 32-bit address of the callee
26218 and jumps to it.
26219
26220 On Mach-O (Darwin) systems, this option directs the compiler emit to
26221 the glue for every direct call, and the Darwin linker decides whether
26222 to use or discard it.
26223
26224 In the future, GCC may ignore all longcall specifications
26225 when the linker is known to generate glue.
26226
26227 @item -mpltseq
26228 @itemx -mno-pltseq
26229 @opindex mpltseq
26230 @opindex mno-pltseq
26231 Implement (do not implement) -fno-plt and long calls using an inline
26232 PLT call sequence that supports lazy linking and long calls to
26233 functions in dlopen'd shared libraries.  Inline PLT calls are only
26234 supported on PowerPC64 ELFv2 and 32-bit PowerPC systems with newer GNU
26235 linkers, and are enabled by default if the support is detected when
26236 configuring GCC, and, in the case of 32-bit PowerPC, if GCC is
26237 configured with @option{--enable-secureplt}.  @option{-mpltseq} code
26238 and @option{-mbss-plt} 32-bit PowerPC relocatable objects may not be
26239 linked together.
26240
26241 @item -mtls-markers
26242 @itemx -mno-tls-markers
26243 @opindex mtls-markers
26244 @opindex mno-tls-markers
26245 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
26246 specifying the function argument.  The relocation allows the linker to
26247 reliably associate function call with argument setup instructions for
26248 TLS optimization, which in turn allows GCC to better schedule the
26249 sequence.
26250
26251 @item -mrecip
26252 @itemx -mno-recip
26253 @opindex mrecip
26254 This option enables use of the reciprocal estimate and
26255 reciprocal square root estimate instructions with additional
26256 Newton-Raphson steps to increase precision instead of doing a divide or
26257 square root and divide for floating-point arguments.  You should use
26258 the @option{-ffast-math} option when using @option{-mrecip} (or at
26259 least @option{-funsafe-math-optimizations},
26260 @option{-ffinite-math-only}, @option{-freciprocal-math} and
26261 @option{-fno-trapping-math}).  Note that while the throughput of the
26262 sequence is generally higher than the throughput of the non-reciprocal
26263 instruction, the precision of the sequence can be decreased by up to 2
26264 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
26265 roots.
26266
26267 @item -mrecip=@var{opt}
26268 @opindex mrecip=opt
26269 This option controls which reciprocal estimate instructions
26270 may be used.  @var{opt} is a comma-separated list of options, which may
26271 be preceded by a @code{!} to invert the option:
26272
26273 @table @samp
26274
26275 @item all
26276 Enable all estimate instructions.
26277
26278 @item default 
26279 Enable the default instructions, equivalent to @option{-mrecip}.
26280
26281 @item none 
26282 Disable all estimate instructions, equivalent to @option{-mno-recip}.
26283
26284 @item div 
26285 Enable the reciprocal approximation instructions for both 
26286 single and double precision.
26287
26288 @item divf 
26289 Enable the single-precision reciprocal approximation instructions.
26290
26291 @item divd 
26292 Enable the double-precision reciprocal approximation instructions.
26293
26294 @item rsqrt 
26295 Enable the reciprocal square root approximation instructions for both
26296 single and double precision.
26297
26298 @item rsqrtf 
26299 Enable the single-precision reciprocal square root approximation instructions.
26300
26301 @item rsqrtd 
26302 Enable the double-precision reciprocal square root approximation instructions.
26303
26304 @end table
26305
26306 So, for example, @option{-mrecip=all,!rsqrtd} enables
26307 all of the reciprocal estimate instructions, except for the
26308 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
26309 which handle the double-precision reciprocal square root calculations.
26310
26311 @item -mrecip-precision
26312 @itemx -mno-recip-precision
26313 @opindex mrecip-precision
26314 Assume (do not assume) that the reciprocal estimate instructions
26315 provide higher-precision estimates than is mandated by the PowerPC
26316 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
26317 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
26318 The double-precision square root estimate instructions are not generated by
26319 default on low-precision machines, since they do not provide an
26320 estimate that converges after three steps.
26321
26322 @item -mveclibabi=@var{type}
26323 @opindex mveclibabi
26324 Specifies the ABI type to use for vectorizing intrinsics using an
26325 external library.  The only type supported at present is @samp{mass},
26326 which specifies to use IBM's Mathematical Acceleration Subsystem
26327 (MASS) libraries for vectorizing intrinsics using external libraries.
26328 GCC currently emits calls to @code{acosd2}, @code{acosf4},
26329 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
26330 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
26331 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
26332 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
26333 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
26334 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
26335 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
26336 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
26337 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
26338 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
26339 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
26340 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
26341 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
26342 for power7.  Both @option{-ftree-vectorize} and
26343 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
26344 libraries must be specified at link time.
26345
26346 @item -mfriz
26347 @itemx -mno-friz
26348 @opindex mfriz
26349 Generate (do not generate) the @code{friz} instruction when the
26350 @option{-funsafe-math-optimizations} option is used to optimize
26351 rounding of floating-point values to 64-bit integer and back to floating
26352 point.  The @code{friz} instruction does not return the same value if
26353 the floating-point number is too large to fit in an integer.
26354
26355 @item -mpointers-to-nested-functions
26356 @itemx -mno-pointers-to-nested-functions
26357 @opindex mpointers-to-nested-functions
26358 Generate (do not generate) code to load up the static chain register
26359 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
26360 systems where a function pointer points to a 3-word descriptor giving
26361 the function address, TOC value to be loaded in register @code{r2}, and
26362 static chain value to be loaded in register @code{r11}.  The
26363 @option{-mpointers-to-nested-functions} is on by default.  You cannot
26364 call through pointers to nested functions or pointers
26365 to functions compiled in other languages that use the static chain if
26366 you use @option{-mno-pointers-to-nested-functions}.
26367
26368 @item -msave-toc-indirect
26369 @itemx -mno-save-toc-indirect
26370 @opindex msave-toc-indirect
26371 Generate (do not generate) code to save the TOC value in the reserved
26372 stack location in the function prologue if the function calls through
26373 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
26374 saved in the prologue, it is saved just before the call through the
26375 pointer.  The @option{-mno-save-toc-indirect} option is the default.
26376
26377 @item -mcompat-align-parm
26378 @itemx -mno-compat-align-parm
26379 @opindex mcompat-align-parm
26380 Generate (do not generate) code to pass structure parameters with a
26381 maximum alignment of 64 bits, for compatibility with older versions
26382 of GCC.
26383
26384 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
26385 structure parameter on a 128-bit boundary when that structure contained
26386 a member requiring 128-bit alignment.  This is corrected in more
26387 recent versions of GCC.  This option may be used to generate code
26388 that is compatible with functions compiled with older versions of
26389 GCC.
26390
26391 The @option{-mno-compat-align-parm} option is the default.
26392
26393 @item -mstack-protector-guard=@var{guard}
26394 @itemx -mstack-protector-guard-reg=@var{reg}
26395 @itemx -mstack-protector-guard-offset=@var{offset}
26396 @itemx -mstack-protector-guard-symbol=@var{symbol}
26397 @opindex mstack-protector-guard
26398 @opindex mstack-protector-guard-reg
26399 @opindex mstack-protector-guard-offset
26400 @opindex mstack-protector-guard-symbol
26401 Generate stack protection code using canary at @var{guard}.  Supported
26402 locations are @samp{global} for global canary or @samp{tls} for per-thread
26403 canary in the TLS block (the default with GNU libc version 2.4 or later).
26404
26405 With the latter choice the options
26406 @option{-mstack-protector-guard-reg=@var{reg}} and
26407 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
26408 which register to use as base register for reading the canary, and from what
26409 offset from that base register. The default for those is as specified in the
26410 relevant ABI.  @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
26411 the offset with a symbol reference to a canary in the TLS block.
26412
26413 @item -mpcrel
26414 @itemx -mno-pcrel
26415 @opindex mpcrel
26416 @opindex mno-pcrel
26417 Generate (do not generate) pc-relative addressing when the option
26418 @option{-mcpu=future} is used.  The @option{-mpcrel} option requires
26419 that the medium code model (@option{-mcmodel=medium}) and prefixed
26420 addressing (@option{-mprefixed}) options are enabled.
26421
26422 @item -mprefixed
26423 @itemx -mno-prefixed
26424 @opindex mprefixed
26425 @opindex mno-prefixed
26426 Generate (do not generate) addressing modes using prefixed load and
26427 store instructions when the option @option{-mcpu=future} is used.
26428 @end table
26429
26430 @node RX Options
26431 @subsection RX Options
26432 @cindex RX Options
26433
26434 These command-line options are defined for RX targets:
26435
26436 @table @gcctabopt
26437 @item -m64bit-doubles
26438 @itemx -m32bit-doubles
26439 @opindex m64bit-doubles
26440 @opindex m32bit-doubles
26441 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
26442 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
26443 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
26444 works on 32-bit values, which is why the default is
26445 @option{-m32bit-doubles}.
26446
26447 @item -fpu
26448 @itemx -nofpu
26449 @opindex fpu
26450 @opindex nofpu
26451 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
26452 floating-point hardware.  The default is enabled for the RX600
26453 series and disabled for the RX200 series.
26454
26455 Floating-point instructions are only generated for 32-bit floating-point 
26456 values, however, so the FPU hardware is not used for doubles if the
26457 @option{-m64bit-doubles} option is used.
26458
26459 @emph{Note} If the @option{-fpu} option is enabled then
26460 @option{-funsafe-math-optimizations} is also enabled automatically.
26461 This is because the RX FPU instructions are themselves unsafe.
26462
26463 @item -mcpu=@var{name}
26464 @opindex mcpu
26465 Selects the type of RX CPU to be targeted.  Currently three types are
26466 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
26467 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
26468
26469 The only difference between @samp{RX600} and @samp{RX610} is that the
26470 @samp{RX610} does not support the @code{MVTIPL} instruction.
26471
26472 The @samp{RX200} series does not have a hardware floating-point unit
26473 and so @option{-nofpu} is enabled by default when this type is
26474 selected.
26475
26476 @item -mbig-endian-data
26477 @itemx -mlittle-endian-data
26478 @opindex mbig-endian-data
26479 @opindex mlittle-endian-data
26480 Store data (but not code) in the big-endian format.  The default is
26481 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
26482 format.
26483
26484 @item -msmall-data-limit=@var{N}
26485 @opindex msmall-data-limit
26486 Specifies the maximum size in bytes of global and static variables
26487 which can be placed into the small data area.  Using the small data
26488 area can lead to smaller and faster code, but the size of area is
26489 limited and it is up to the programmer to ensure that the area does
26490 not overflow.  Also when the small data area is used one of the RX's
26491 registers (usually @code{r13}) is reserved for use pointing to this
26492 area, so it is no longer available for use by the compiler.  This
26493 could result in slower and/or larger code if variables are pushed onto
26494 the stack instead of being held in this register.
26495
26496 Note, common variables (variables that have not been initialized) and
26497 constants are not placed into the small data area as they are assigned
26498 to other sections in the output executable.
26499
26500 The default value is zero, which disables this feature.  Note, this
26501 feature is not enabled by default with higher optimization levels
26502 (@option{-O2} etc) because of the potentially detrimental effects of
26503 reserving a register.  It is up to the programmer to experiment and
26504 discover whether this feature is of benefit to their program.  See the
26505 description of the @option{-mpid} option for a description of how the
26506 actual register to hold the small data area pointer is chosen.
26507
26508 @item -msim
26509 @itemx -mno-sim
26510 @opindex msim
26511 @opindex mno-sim
26512 Use the simulator runtime.  The default is to use the libgloss
26513 board-specific runtime.
26514
26515 @item -mas100-syntax
26516 @itemx -mno-as100-syntax
26517 @opindex mas100-syntax
26518 @opindex mno-as100-syntax
26519 When generating assembler output use a syntax that is compatible with
26520 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
26521 assembler, but it has some restrictions so it is not generated by default.
26522
26523 @item -mmax-constant-size=@var{N}
26524 @opindex mmax-constant-size
26525 Specifies the maximum size, in bytes, of a constant that can be used as
26526 an operand in a RX instruction.  Although the RX instruction set does
26527 allow constants of up to 4 bytes in length to be used in instructions,
26528 a longer value equates to a longer instruction.  Thus in some
26529 circumstances it can be beneficial to restrict the size of constants
26530 that are used in instructions.  Constants that are too big are instead
26531 placed into a constant pool and referenced via register indirection.
26532
26533 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
26534 or 4 means that constants of any size are allowed.
26535
26536 @item -mrelax
26537 @opindex mrelax
26538 Enable linker relaxation.  Linker relaxation is a process whereby the
26539 linker attempts to reduce the size of a program by finding shorter
26540 versions of various instructions.  Disabled by default.
26541
26542 @item -mint-register=@var{N}
26543 @opindex mint-register
26544 Specify the number of registers to reserve for fast interrupt handler
26545 functions.  The value @var{N} can be between 0 and 4.  A value of 1
26546 means that register @code{r13} is reserved for the exclusive use
26547 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
26548 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
26549 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
26550 A value of 0, the default, does not reserve any registers.
26551
26552 @item -msave-acc-in-interrupts
26553 @opindex msave-acc-in-interrupts
26554 Specifies that interrupt handler functions should preserve the
26555 accumulator register.  This is only necessary if normal code might use
26556 the accumulator register, for example because it performs 64-bit
26557 multiplications.  The default is to ignore the accumulator as this
26558 makes the interrupt handlers faster.
26559
26560 @item -mpid
26561 @itemx -mno-pid
26562 @opindex mpid
26563 @opindex mno-pid
26564 Enables the generation of position independent data.  When enabled any
26565 access to constant data is done via an offset from a base address
26566 held in a register.  This allows the location of constant data to be
26567 determined at run time without requiring the executable to be
26568 relocated, which is a benefit to embedded applications with tight
26569 memory constraints.  Data that can be modified is not affected by this
26570 option.
26571
26572 Note, using this feature reserves a register, usually @code{r13}, for
26573 the constant data base address.  This can result in slower and/or
26574 larger code, especially in complicated functions.
26575
26576 The actual register chosen to hold the constant data base address
26577 depends upon whether the @option{-msmall-data-limit} and/or the
26578 @option{-mint-register} command-line options are enabled.  Starting
26579 with register @code{r13} and proceeding downwards, registers are
26580 allocated first to satisfy the requirements of @option{-mint-register},
26581 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
26582 is possible for the small data area register to be @code{r8} if both
26583 @option{-mint-register=4} and @option{-mpid} are specified on the
26584 command line.
26585
26586 By default this feature is not enabled.  The default can be restored
26587 via the @option{-mno-pid} command-line option.
26588
26589 @item -mno-warn-multiple-fast-interrupts
26590 @itemx -mwarn-multiple-fast-interrupts
26591 @opindex mno-warn-multiple-fast-interrupts
26592 @opindex mwarn-multiple-fast-interrupts
26593 Prevents GCC from issuing a warning message if it finds more than one
26594 fast interrupt handler when it is compiling a file.  The default is to
26595 issue a warning for each extra fast interrupt handler found, as the RX
26596 only supports one such interrupt.
26597
26598 @item -mallow-string-insns
26599 @itemx -mno-allow-string-insns
26600 @opindex mallow-string-insns
26601 @opindex mno-allow-string-insns
26602 Enables or disables the use of the string manipulation instructions
26603 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
26604 @code{SWHILE} and also the @code{RMPA} instruction.  These
26605 instructions may prefetch data, which is not safe to do if accessing
26606 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
26607 for more information).
26608
26609 The default is to allow these instructions, but it is not possible for
26610 GCC to reliably detect all circumstances where a string instruction
26611 might be used to access an I/O register, so their use cannot be
26612 disabled automatically.  Instead it is reliant upon the programmer to
26613 use the @option{-mno-allow-string-insns} option if their program
26614 accesses I/O space.
26615
26616 When the instructions are enabled GCC defines the C preprocessor
26617 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
26618 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
26619
26620 @item -mjsr
26621 @itemx -mno-jsr
26622 @opindex mjsr
26623 @opindex mno-jsr
26624 Use only (or not only) @code{JSR} instructions to access functions.
26625 This option can be used when code size exceeds the range of @code{BSR}
26626 instructions.  Note that @option{-mno-jsr} does not mean to not use
26627 @code{JSR} but instead means that any type of branch may be used.
26628 @end table
26629
26630 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
26631 has special significance to the RX port when used with the
26632 @code{interrupt} function attribute.  This attribute indicates a
26633 function intended to process fast interrupts.  GCC ensures
26634 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
26635 and/or @code{r13} and only provided that the normal use of the
26636 corresponding registers have been restricted via the
26637 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
26638 options.
26639
26640 @node S/390 and zSeries Options
26641 @subsection S/390 and zSeries Options
26642 @cindex S/390 and zSeries Options
26643
26644 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
26645
26646 @table @gcctabopt
26647 @item -mhard-float
26648 @itemx -msoft-float
26649 @opindex mhard-float
26650 @opindex msoft-float
26651 Use (do not use) the hardware floating-point instructions and registers
26652 for floating-point operations.  When @option{-msoft-float} is specified,
26653 functions in @file{libgcc.a} are used to perform floating-point
26654 operations.  When @option{-mhard-float} is specified, the compiler
26655 generates IEEE floating-point instructions.  This is the default.
26656
26657 @item -mhard-dfp
26658 @itemx -mno-hard-dfp
26659 @opindex mhard-dfp
26660 @opindex mno-hard-dfp
26661 Use (do not use) the hardware decimal-floating-point instructions for
26662 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
26663 specified, functions in @file{libgcc.a} are used to perform
26664 decimal-floating-point operations.  When @option{-mhard-dfp} is
26665 specified, the compiler generates decimal-floating-point hardware
26666 instructions.  This is the default for @option{-march=z9-ec} or higher.
26667
26668 @item -mlong-double-64
26669 @itemx -mlong-double-128
26670 @opindex mlong-double-64
26671 @opindex mlong-double-128
26672 These switches control the size of @code{long double} type. A size
26673 of 64 bits makes the @code{long double} type equivalent to the @code{double}
26674 type. This is the default.
26675
26676 @item -mbackchain
26677 @itemx -mno-backchain
26678 @opindex mbackchain
26679 @opindex mno-backchain
26680 Store (do not store) the address of the caller's frame as backchain pointer
26681 into the callee's stack frame.
26682 A backchain may be needed to allow debugging using tools that do not understand
26683 DWARF call frame information.
26684 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
26685 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
26686 the backchain is placed into the topmost word of the 96/160 byte register
26687 save area.
26688
26689 In general, code compiled with @option{-mbackchain} is call-compatible with
26690 code compiled with @option{-mmo-backchain}; however, use of the backchain
26691 for debugging purposes usually requires that the whole binary is built with
26692 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
26693 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
26694 to build a linux kernel use @option{-msoft-float}.
26695
26696 The default is to not maintain the backchain.
26697
26698 @item -mpacked-stack
26699 @itemx -mno-packed-stack
26700 @opindex mpacked-stack
26701 @opindex mno-packed-stack
26702 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
26703 specified, the compiler uses the all fields of the 96/160 byte register save
26704 area only for their default purpose; unused fields still take up stack space.
26705 When @option{-mpacked-stack} is specified, register save slots are densely
26706 packed at the top of the register save area; unused space is reused for other
26707 purposes, allowing for more efficient use of the available stack space.
26708 However, when @option{-mbackchain} is also in effect, the topmost word of
26709 the save area is always used to store the backchain, and the return address
26710 register is always saved two words below the backchain.
26711
26712 As long as the stack frame backchain is not used, code generated with
26713 @option{-mpacked-stack} is call-compatible with code generated with
26714 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
26715 S/390 or zSeries generated code that uses the stack frame backchain at run
26716 time, not just for debugging purposes.  Such code is not call-compatible
26717 with code compiled with @option{-mpacked-stack}.  Also, note that the
26718 combination of @option{-mbackchain},
26719 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
26720 to build a linux kernel use @option{-msoft-float}.
26721
26722 The default is to not use the packed stack layout.
26723
26724 @item -msmall-exec
26725 @itemx -mno-small-exec
26726 @opindex msmall-exec
26727 @opindex mno-small-exec
26728 Generate (or do not generate) code using the @code{bras} instruction
26729 to do subroutine calls.
26730 This only works reliably if the total executable size does not
26731 exceed 64k.  The default is to use the @code{basr} instruction instead,
26732 which does not have this limitation.
26733
26734 @item -m64
26735 @itemx -m31
26736 @opindex m64
26737 @opindex m31
26738 When @option{-m31} is specified, generate code compliant to the
26739 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
26740 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
26741 particular to generate 64-bit instructions.  For the @samp{s390}
26742 targets, the default is @option{-m31}, while the @samp{s390x}
26743 targets default to @option{-m64}.
26744
26745 @item -mzarch
26746 @itemx -mesa
26747 @opindex mzarch
26748 @opindex mesa
26749 When @option{-mzarch} is specified, generate code using the
26750 instructions available on z/Architecture.
26751 When @option{-mesa} is specified, generate code using the
26752 instructions available on ESA/390.  Note that @option{-mesa} is
26753 not possible with @option{-m64}.
26754 When generating code compliant to the GNU/Linux for S/390 ABI,
26755 the default is @option{-mesa}.  When generating code compliant
26756 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
26757
26758 @item -mhtm
26759 @itemx -mno-htm
26760 @opindex mhtm
26761 @opindex mno-htm
26762 The @option{-mhtm} option enables a set of builtins making use of
26763 instructions available with the transactional execution facility
26764 introduced with the IBM zEnterprise EC12 machine generation
26765 @ref{S/390 System z Built-in Functions}.
26766 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
26767
26768 @item -mvx
26769 @itemx -mno-vx
26770 @opindex mvx
26771 @opindex mno-vx
26772 When @option{-mvx} is specified, generate code using the instructions
26773 available with the vector extension facility introduced with the IBM
26774 z13 machine generation.
26775 This option changes the ABI for some vector type values with regard to
26776 alignment and calling conventions.  In case vector type values are
26777 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
26778 command will be added to mark the resulting binary with the ABI used.
26779 @option{-mvx} is enabled by default when using @option{-march=z13}.
26780
26781 @item -mzvector
26782 @itemx -mno-zvector
26783 @opindex mzvector
26784 @opindex mno-zvector
26785 The @option{-mzvector} option enables vector language extensions and
26786 builtins using instructions available with the vector extension
26787 facility introduced with the IBM z13 machine generation.
26788 This option adds support for @samp{vector} to be used as a keyword to
26789 define vector type variables and arguments.  @samp{vector} is only
26790 available when GNU extensions are enabled.  It will not be expanded
26791 when requesting strict standard compliance e.g.@: with @option{-std=c99}.
26792 In addition to the GCC low-level builtins @option{-mzvector} enables
26793 a set of builtins added for compatibility with AltiVec-style
26794 implementations like Power and Cell.  In order to make use of these
26795 builtins the header file @file{vecintrin.h} needs to be included.
26796 @option{-mzvector} is disabled by default.
26797
26798 @item -mmvcle
26799 @itemx -mno-mvcle
26800 @opindex mmvcle
26801 @opindex mno-mvcle
26802 Generate (or do not generate) code using the @code{mvcle} instruction
26803 to perform block moves.  When @option{-mno-mvcle} is specified,
26804 use a @code{mvc} loop instead.  This is the default unless optimizing for
26805 size.
26806
26807 @item -mdebug
26808 @itemx -mno-debug
26809 @opindex mdebug
26810 @opindex mno-debug
26811 Print (or do not print) additional debug information when compiling.
26812 The default is to not print debug information.
26813
26814 @item -march=@var{cpu-type}
26815 @opindex march
26816 Generate code that runs on @var{cpu-type}, which is the name of a
26817 system representing a certain processor type.  Possible values for
26818 @var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
26819 @samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
26820 @samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11},
26821 @samp{z14}/@samp{arch12}, and @samp{native}.
26822
26823 The default is @option{-march=z900}.
26824
26825 Specifying @samp{native} as cpu type can be used to select the best
26826 architecture option for the host processor.
26827 @option{-march=native} has no effect if GCC does not recognize the
26828 processor.
26829
26830 @item -mtune=@var{cpu-type}
26831 @opindex mtune
26832 Tune to @var{cpu-type} everything applicable about the generated code,
26833 except for the ABI and the set of available instructions.
26834 The list of @var{cpu-type} values is the same as for @option{-march}.
26835 The default is the value used for @option{-march}.
26836
26837 @item -mtpf-trace
26838 @itemx -mno-tpf-trace
26839 @opindex mtpf-trace
26840 @opindex mno-tpf-trace
26841 Generate code that adds (does not add) in TPF OS specific branches to trace
26842 routines in the operating system.  This option is off by default, even
26843 when compiling for the TPF OS@.
26844
26845 @item -mfused-madd
26846 @itemx -mno-fused-madd
26847 @opindex mfused-madd
26848 @opindex mno-fused-madd
26849 Generate code that uses (does not use) the floating-point multiply and
26850 accumulate instructions.  These instructions are generated by default if
26851 hardware floating point is used.
26852
26853 @item -mwarn-framesize=@var{framesize}
26854 @opindex mwarn-framesize
26855 Emit a warning if the current function exceeds the given frame size.  Because
26856 this is a compile-time check it doesn't need to be a real problem when the program
26857 runs.  It is intended to identify functions that most probably cause
26858 a stack overflow.  It is useful to be used in an environment with limited stack
26859 size e.g.@: the linux kernel.
26860
26861 @item -mwarn-dynamicstack
26862 @opindex mwarn-dynamicstack
26863 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
26864 arrays.  This is generally a bad idea with a limited stack size.
26865
26866 @item -mstack-guard=@var{stack-guard}
26867 @itemx -mstack-size=@var{stack-size}
26868 @opindex mstack-guard
26869 @opindex mstack-size
26870 If these options are provided the S/390 back end emits additional instructions in
26871 the function prologue that trigger a trap if the stack size is @var{stack-guard}
26872 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
26873 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
26874 the frame size of the compiled function is chosen.
26875 These options are intended to be used to help debugging stack overflow problems.
26876 The additionally emitted code causes only little overhead and hence can also be
26877 used in production-like systems without greater performance degradation.  The given
26878 values have to be exact powers of 2 and @var{stack-size} has to be greater than
26879 @var{stack-guard} without exceeding 64k.
26880 In order to be efficient the extra code makes the assumption that the stack starts
26881 at an address aligned to the value given by @var{stack-size}.
26882 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
26883
26884 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
26885 @opindex mhotpatch
26886 If the hotpatch option is enabled, a ``hot-patching'' function
26887 prologue is generated for all functions in the compilation unit.
26888 The funtion label is prepended with the given number of two-byte
26889 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
26890 the label, 2 * @var{post-halfwords} bytes are appended, using the
26891 largest NOP like instructions the architecture allows (maximum
26892 1000000).
26893
26894 If both arguments are zero, hotpatching is disabled.
26895
26896 This option can be overridden for individual functions with the
26897 @code{hotpatch} attribute.
26898 @end table
26899
26900 @node Score Options
26901 @subsection Score Options
26902 @cindex Score Options
26903
26904 These options are defined for Score implementations:
26905
26906 @table @gcctabopt
26907 @item -meb
26908 @opindex meb
26909 Compile code for big-endian mode.  This is the default.
26910
26911 @item -mel
26912 @opindex mel
26913 Compile code for little-endian mode.
26914
26915 @item -mnhwloop
26916 @opindex mnhwloop
26917 Disable generation of @code{bcnz} instructions.
26918
26919 @item -muls
26920 @opindex muls
26921 Enable generation of unaligned load and store instructions.
26922
26923 @item -mmac
26924 @opindex mmac
26925 Enable the use of multiply-accumulate instructions. Disabled by default.
26926
26927 @item -mscore5
26928 @opindex mscore5
26929 Specify the SCORE5 as the target architecture.
26930
26931 @item -mscore5u
26932 @opindex mscore5u
26933 Specify the SCORE5U of the target architecture.
26934
26935 @item -mscore7
26936 @opindex mscore7
26937 Specify the SCORE7 as the target architecture. This is the default.
26938
26939 @item -mscore7d
26940 @opindex mscore7d
26941 Specify the SCORE7D as the target architecture.
26942 @end table
26943
26944 @node SH Options
26945 @subsection SH Options
26946
26947 These @samp{-m} options are defined for the SH implementations:
26948
26949 @table @gcctabopt
26950 @item -m1
26951 @opindex m1
26952 Generate code for the SH1.
26953
26954 @item -m2
26955 @opindex m2
26956 Generate code for the SH2.
26957
26958 @item -m2e
26959 Generate code for the SH2e.
26960
26961 @item -m2a-nofpu
26962 @opindex m2a-nofpu
26963 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
26964 that the floating-point unit is not used.
26965
26966 @item -m2a-single-only
26967 @opindex m2a-single-only
26968 Generate code for the SH2a-FPU, in such a way that no double-precision
26969 floating-point operations are used.
26970
26971 @item -m2a-single
26972 @opindex m2a-single
26973 Generate code for the SH2a-FPU assuming the floating-point unit is in
26974 single-precision mode by default.
26975
26976 @item -m2a
26977 @opindex m2a
26978 Generate code for the SH2a-FPU assuming the floating-point unit is in
26979 double-precision mode by default.
26980
26981 @item -m3
26982 @opindex m3
26983 Generate code for the SH3.
26984
26985 @item -m3e
26986 @opindex m3e
26987 Generate code for the SH3e.
26988
26989 @item -m4-nofpu
26990 @opindex m4-nofpu
26991 Generate code for the SH4 without a floating-point unit.
26992
26993 @item -m4-single-only
26994 @opindex m4-single-only
26995 Generate code for the SH4 with a floating-point unit that only
26996 supports single-precision arithmetic.
26997
26998 @item -m4-single
26999 @opindex m4-single
27000 Generate code for the SH4 assuming the floating-point unit is in
27001 single-precision mode by default.
27002
27003 @item -m4
27004 @opindex m4
27005 Generate code for the SH4.
27006
27007 @item -m4-100
27008 @opindex m4-100
27009 Generate code for SH4-100.
27010
27011 @item -m4-100-nofpu
27012 @opindex m4-100-nofpu
27013 Generate code for SH4-100 in such a way that the
27014 floating-point unit is not used.
27015
27016 @item -m4-100-single
27017 @opindex m4-100-single
27018 Generate code for SH4-100 assuming the floating-point unit is in
27019 single-precision mode by default.
27020
27021 @item -m4-100-single-only
27022 @opindex m4-100-single-only
27023 Generate code for SH4-100 in such a way that no double-precision
27024 floating-point operations are used.
27025
27026 @item -m4-200
27027 @opindex m4-200
27028 Generate code for SH4-200.
27029
27030 @item -m4-200-nofpu
27031 @opindex m4-200-nofpu
27032 Generate code for SH4-200 without in such a way that the
27033 floating-point unit is not used.
27034
27035 @item -m4-200-single
27036 @opindex m4-200-single
27037 Generate code for SH4-200 assuming the floating-point unit is in
27038 single-precision mode by default.
27039
27040 @item -m4-200-single-only
27041 @opindex m4-200-single-only
27042 Generate code for SH4-200 in such a way that no double-precision
27043 floating-point operations are used.
27044
27045 @item -m4-300
27046 @opindex m4-300
27047 Generate code for SH4-300.
27048
27049 @item -m4-300-nofpu
27050 @opindex m4-300-nofpu
27051 Generate code for SH4-300 without in such a way that the
27052 floating-point unit is not used.
27053
27054 @item -m4-300-single
27055 @opindex m4-300-single
27056 Generate code for SH4-300 in such a way that no double-precision
27057 floating-point operations are used.
27058
27059 @item -m4-300-single-only
27060 @opindex m4-300-single-only
27061 Generate code for SH4-300 in such a way that no double-precision
27062 floating-point operations are used.
27063
27064 @item -m4-340
27065 @opindex m4-340
27066 Generate code for SH4-340 (no MMU, no FPU).
27067
27068 @item -m4-500
27069 @opindex m4-500
27070 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
27071 assembler.
27072
27073 @item -m4a-nofpu
27074 @opindex m4a-nofpu
27075 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
27076 floating-point unit is not used.
27077
27078 @item -m4a-single-only
27079 @opindex m4a-single-only
27080 Generate code for the SH4a, in such a way that no double-precision
27081 floating-point operations are used.
27082
27083 @item -m4a-single
27084 @opindex m4a-single
27085 Generate code for the SH4a assuming the floating-point unit is in
27086 single-precision mode by default.
27087
27088 @item -m4a
27089 @opindex m4a
27090 Generate code for the SH4a.
27091
27092 @item -m4al
27093 @opindex m4al
27094 Same as @option{-m4a-nofpu}, except that it implicitly passes
27095 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
27096 instructions at the moment.
27097
27098 @item -mb
27099 @opindex mb
27100 Compile code for the processor in big-endian mode.
27101
27102 @item -ml
27103 @opindex ml
27104 Compile code for the processor in little-endian mode.
27105
27106 @item -mdalign
27107 @opindex mdalign
27108 Align doubles at 64-bit boundaries.  Note that this changes the calling
27109 conventions, and thus some functions from the standard C library do
27110 not work unless you recompile it first with @option{-mdalign}.
27111
27112 @item -mrelax
27113 @opindex mrelax
27114 Shorten some address references at link time, when possible; uses the
27115 linker option @option{-relax}.
27116
27117 @item -mbigtable
27118 @opindex mbigtable
27119 Use 32-bit offsets in @code{switch} tables.  The default is to use
27120 16-bit offsets.
27121
27122 @item -mbitops
27123 @opindex mbitops
27124 Enable the use of bit manipulation instructions on SH2A.
27125
27126 @item -mfmovd
27127 @opindex mfmovd
27128 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
27129 alignment constraints.
27130
27131 @item -mrenesas
27132 @opindex mrenesas
27133 Comply with the calling conventions defined by Renesas.
27134
27135 @item -mno-renesas
27136 @opindex mno-renesas
27137 Comply with the calling conventions defined for GCC before the Renesas
27138 conventions were available.  This option is the default for all
27139 targets of the SH toolchain.
27140
27141 @item -mnomacsave
27142 @opindex mnomacsave
27143 Mark the @code{MAC} register as call-clobbered, even if
27144 @option{-mrenesas} is given.
27145
27146 @item -mieee
27147 @itemx -mno-ieee
27148 @opindex mieee
27149 @opindex mno-ieee
27150 Control the IEEE compliance of floating-point comparisons, which affects the
27151 handling of cases where the result of a comparison is unordered.  By default
27152 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
27153 enabled @option{-mno-ieee} is implicitly set, which results in faster
27154 floating-point greater-equal and less-equal comparisons.  The implicit settings
27155 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
27156
27157 @item -minline-ic_invalidate
27158 @opindex minline-ic_invalidate
27159 Inline code to invalidate instruction cache entries after setting up
27160 nested function trampolines.
27161 This option has no effect if @option{-musermode} is in effect and the selected
27162 code generation option (e.g.@: @option{-m4}) does not allow the use of the @code{icbi}
27163 instruction.
27164 If the selected code generation option does not allow the use of the @code{icbi}
27165 instruction, and @option{-musermode} is not in effect, the inlined code
27166 manipulates the instruction cache address array directly with an associative
27167 write.  This not only requires privileged mode at run time, but it also
27168 fails if the cache line had been mapped via the TLB and has become unmapped.
27169
27170 @item -misize
27171 @opindex misize
27172 Dump instruction size and location in the assembly code.
27173
27174 @item -mpadstruct
27175 @opindex mpadstruct
27176 This option is deprecated.  It pads structures to multiple of 4 bytes,
27177 which is incompatible with the SH ABI@.
27178
27179 @item -matomic-model=@var{model}
27180 @opindex matomic-model=@var{model}
27181 Sets the model of atomic operations and additional parameters as a comma
27182 separated list.  For details on the atomic built-in functions see
27183 @ref{__atomic Builtins}.  The following models and parameters are supported:
27184
27185 @table @samp
27186
27187 @item none
27188 Disable compiler generated atomic sequences and emit library calls for atomic
27189 operations.  This is the default if the target is not @code{sh*-*-linux*}.
27190
27191 @item soft-gusa
27192 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
27193 built-in functions.  The generated atomic sequences require additional support
27194 from the interrupt/exception handling code of the system and are only suitable
27195 for SH3* and SH4* single-core systems.  This option is enabled by default when
27196 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
27197 this option also partially utilizes the hardware atomic instructions
27198 @code{movli.l} and @code{movco.l} to create more efficient code, unless
27199 @samp{strict} is specified.  
27200
27201 @item soft-tcb
27202 Generate software atomic sequences that use a variable in the thread control
27203 block.  This is a variation of the gUSA sequences which can also be used on
27204 SH1* and SH2* targets.  The generated atomic sequences require additional
27205 support from the interrupt/exception handling code of the system and are only
27206 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
27207 parameter has to be specified as well.
27208
27209 @item soft-imask
27210 Generate software atomic sequences that temporarily disable interrupts by
27211 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
27212 in privileged mode and is only suitable for single-core systems.  Additional
27213 support from the interrupt/exception handling code of the system is not
27214 required.  This model is enabled by default when the target is
27215 @code{sh*-*-linux*} and SH1* or SH2*.
27216
27217 @item hard-llcs
27218 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
27219 instructions only.  This is only available on SH4A and is suitable for
27220 multi-core systems.  Since the hardware instructions support only 32 bit atomic
27221 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
27222 Code compiled with this option is also compatible with other software
27223 atomic model interrupt/exception handling systems if executed on an SH4A
27224 system.  Additional support from the interrupt/exception handling code of the
27225 system is not required for this model.
27226
27227 @item gbr-offset=
27228 This parameter specifies the offset in bytes of the variable in the thread
27229 control block structure that should be used by the generated atomic sequences
27230 when the @samp{soft-tcb} model has been selected.  For other models this
27231 parameter is ignored.  The specified value must be an integer multiple of four
27232 and in the range 0-1020.
27233
27234 @item strict
27235 This parameter prevents mixed usage of multiple atomic models, even if they
27236 are compatible, and makes the compiler generate atomic sequences of the
27237 specified model only.
27238
27239 @end table
27240
27241 @item -mtas
27242 @opindex mtas
27243 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
27244 Notice that depending on the particular hardware and software configuration
27245 this can degrade overall performance due to the operand cache line flushes
27246 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
27247 processors the @code{tas.b} instruction must be used with caution since it
27248 can result in data corruption for certain cache configurations.
27249
27250 @item -mprefergot
27251 @opindex mprefergot
27252 When generating position-independent code, emit function calls using
27253 the Global Offset Table instead of the Procedure Linkage Table.
27254
27255 @item -musermode
27256 @itemx -mno-usermode
27257 @opindex musermode
27258 @opindex mno-usermode
27259 Don't allow (allow) the compiler generating privileged mode code.  Specifying
27260 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
27261 inlined code would not work in user mode.  @option{-musermode} is the default
27262 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
27263 @option{-musermode} has no effect, since there is no user mode.
27264
27265 @item -multcost=@var{number}
27266 @opindex multcost=@var{number}
27267 Set the cost to assume for a multiply insn.
27268
27269 @item -mdiv=@var{strategy}
27270 @opindex mdiv=@var{strategy}
27271 Set the division strategy to be used for integer division operations.
27272 @var{strategy} can be one of: 
27273
27274 @table @samp
27275
27276 @item call-div1
27277 Calls a library function that uses the single-step division instruction
27278 @code{div1} to perform the operation.  Division by zero calculates an
27279 unspecified result and does not trap.  This is the default except for SH4,
27280 SH2A and SHcompact.
27281
27282 @item call-fp
27283 Calls a library function that performs the operation in double precision
27284 floating point.  Division by zero causes a floating-point exception.  This is
27285 the default for SHcompact with FPU.  Specifying this for targets that do not
27286 have a double precision FPU defaults to @code{call-div1}.
27287
27288 @item call-table
27289 Calls a library function that uses a lookup table for small divisors and
27290 the @code{div1} instruction with case distinction for larger divisors.  Division
27291 by zero calculates an unspecified result and does not trap.  This is the default
27292 for SH4.  Specifying this for targets that do not have dynamic shift
27293 instructions defaults to @code{call-div1}.
27294
27295 @end table
27296
27297 When a division strategy has not been specified the default strategy is
27298 selected based on the current target.  For SH2A the default strategy is to
27299 use the @code{divs} and @code{divu} instructions instead of library function
27300 calls.
27301
27302 @item -maccumulate-outgoing-args
27303 @opindex maccumulate-outgoing-args
27304 Reserve space once for outgoing arguments in the function prologue rather
27305 than around each call.  Generally beneficial for performance and size.  Also
27306 needed for unwinding to avoid changing the stack frame around conditional code.
27307
27308 @item -mdivsi3_libfunc=@var{name}
27309 @opindex mdivsi3_libfunc=@var{name}
27310 Set the name of the library function used for 32-bit signed division to
27311 @var{name}.
27312 This only affects the name used in the @samp{call} division strategies, and
27313 the compiler still expects the same sets of input/output/clobbered registers as
27314 if this option were not present.
27315
27316 @item -mfixed-range=@var{register-range}
27317 @opindex mfixed-range
27318 Generate code treating the given register range as fixed registers.
27319 A fixed register is one that the register allocator cannot use.  This is
27320 useful when compiling kernel code.  A register range is specified as
27321 two registers separated by a dash.  Multiple register ranges can be
27322 specified separated by a comma.
27323
27324 @item -mbranch-cost=@var{num}
27325 @opindex mbranch-cost=@var{num}
27326 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
27327 make the compiler try to generate more branch-free code if possible.  
27328 If not specified the value is selected depending on the processor type that
27329 is being compiled for.
27330
27331 @item -mzdcbranch
27332 @itemx -mno-zdcbranch
27333 @opindex mzdcbranch
27334 @opindex mno-zdcbranch
27335 Assume (do not assume) that zero displacement conditional branch instructions
27336 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
27337 compiler prefers zero displacement branch code sequences.  This is
27338 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
27339 disabled by specifying @option{-mno-zdcbranch}.
27340
27341 @item -mcbranch-force-delay-slot
27342 @opindex mcbranch-force-delay-slot
27343 Force the usage of delay slots for conditional branches, which stuffs the delay
27344 slot with a @code{nop} if a suitable instruction cannot be found.  By default
27345 this option is disabled.  It can be enabled to work around hardware bugs as
27346 found in the original SH7055.
27347
27348 @item -mfused-madd
27349 @itemx -mno-fused-madd
27350 @opindex mfused-madd
27351 @opindex mno-fused-madd
27352 Generate code that uses (does not use) the floating-point multiply and
27353 accumulate instructions.  These instructions are generated by default
27354 if hardware floating point is used.  The machine-dependent
27355 @option{-mfused-madd} option is now mapped to the machine-independent
27356 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
27357 mapped to @option{-ffp-contract=off}.
27358
27359 @item -mfsca
27360 @itemx -mno-fsca
27361 @opindex mfsca
27362 @opindex mno-fsca
27363 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
27364 and cosine approximations.  The option @option{-mfsca} must be used in
27365 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
27366 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
27367 approximations even if @option{-funsafe-math-optimizations} is in effect.
27368
27369 @item -mfsrra
27370 @itemx -mno-fsrra
27371 @opindex mfsrra
27372 @opindex mno-fsrra
27373 Allow or disallow the compiler to emit the @code{fsrra} instruction for
27374 reciprocal square root approximations.  The option @option{-mfsrra} must be used
27375 in combination with @option{-funsafe-math-optimizations} and
27376 @option{-ffinite-math-only}.  It is enabled by default when generating code for
27377 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
27378 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
27379 in effect.
27380
27381 @item -mpretend-cmove
27382 @opindex mpretend-cmove
27383 Prefer zero-displacement conditional branches for conditional move instruction
27384 patterns.  This can result in faster code on the SH4 processor.
27385
27386 @item -mfdpic
27387 @opindex fdpic
27388 Generate code using the FDPIC ABI.
27389
27390 @end table
27391
27392 @node Solaris 2 Options
27393 @subsection Solaris 2 Options
27394 @cindex Solaris 2 options
27395
27396 These @samp{-m} options are supported on Solaris 2:
27397
27398 @table @gcctabopt
27399 @item -mclear-hwcap
27400 @opindex mclear-hwcap
27401 @option{-mclear-hwcap} tells the compiler to remove the hardware
27402 capabilities generated by the Solaris assembler.  This is only necessary
27403 when object files use ISA extensions not supported by the current
27404 machine, but check at runtime whether or not to use them.
27405
27406 @item -mimpure-text
27407 @opindex mimpure-text
27408 @option{-mimpure-text}, used in addition to @option{-shared}, tells
27409 the compiler to not pass @option{-z text} to the linker when linking a
27410 shared object.  Using this option, you can link position-dependent
27411 code into a shared object.
27412
27413 @option{-mimpure-text} suppresses the ``relocations remain against
27414 allocatable but non-writable sections'' linker error message.
27415 However, the necessary relocations trigger copy-on-write, and the
27416 shared object is not actually shared across processes.  Instead of
27417 using @option{-mimpure-text}, you should compile all source code with
27418 @option{-fpic} or @option{-fPIC}.
27419
27420 @end table
27421
27422 These switches are supported in addition to the above on Solaris 2:
27423
27424 @table @gcctabopt
27425 @item -pthreads
27426 @opindex pthreads
27427 This is a synonym for @option{-pthread}.
27428 @end table
27429
27430 @node SPARC Options
27431 @subsection SPARC Options
27432 @cindex SPARC options
27433
27434 These @samp{-m} options are supported on the SPARC:
27435
27436 @table @gcctabopt
27437 @item -mno-app-regs
27438 @itemx -mapp-regs
27439 @opindex mno-app-regs
27440 @opindex mapp-regs
27441 Specify @option{-mapp-regs} to generate output using the global registers
27442 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
27443 global register 1, each global register 2 through 4 is then treated as an
27444 allocable register that is clobbered by function calls.  This is the default.
27445
27446 To be fully SVR4 ABI-compliant at the cost of some performance loss,
27447 specify @option{-mno-app-regs}.  You should compile libraries and system
27448 software with this option.
27449
27450 @item -mflat
27451 @itemx -mno-flat
27452 @opindex mflat
27453 @opindex mno-flat
27454 With @option{-mflat}, the compiler does not generate save/restore instructions
27455 and uses a ``flat'' or single register window model.  This model is compatible
27456 with the regular register window model.  The local registers and the input
27457 registers (0--5) are still treated as ``call-saved'' registers and are
27458 saved on the stack as needed.
27459
27460 With @option{-mno-flat} (the default), the compiler generates save/restore
27461 instructions (except for leaf functions).  This is the normal operating mode.
27462
27463 @item -mfpu
27464 @itemx -mhard-float
27465 @opindex mfpu
27466 @opindex mhard-float
27467 Generate output containing floating-point instructions.  This is the
27468 default.
27469
27470 @item -mno-fpu
27471 @itemx -msoft-float
27472 @opindex mno-fpu
27473 @opindex msoft-float
27474 Generate output containing library calls for floating point.
27475 @strong{Warning:} the requisite libraries are not available for all SPARC
27476 targets.  Normally the facilities of the machine's usual C compiler are
27477 used, but this cannot be done directly in cross-compilation.  You must make
27478 your own arrangements to provide suitable library functions for
27479 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
27480 @samp{sparclite-*-*} do provide software floating-point support.
27481
27482 @option{-msoft-float} changes the calling convention in the output file;
27483 therefore, it is only useful if you compile @emph{all} of a program with
27484 this option.  In particular, you need to compile @file{libgcc.a}, the
27485 library that comes with GCC, with @option{-msoft-float} in order for
27486 this to work.
27487
27488 @item -mhard-quad-float
27489 @opindex mhard-quad-float
27490 Generate output containing quad-word (long double) floating-point
27491 instructions.
27492
27493 @item -msoft-quad-float
27494 @opindex msoft-quad-float
27495 Generate output containing library calls for quad-word (long double)
27496 floating-point instructions.  The functions called are those specified
27497 in the SPARC ABI@.  This is the default.
27498
27499 As of this writing, there are no SPARC implementations that have hardware
27500 support for the quad-word floating-point instructions.  They all invoke
27501 a trap handler for one of these instructions, and then the trap handler
27502 emulates the effect of the instruction.  Because of the trap handler overhead,
27503 this is much slower than calling the ABI library routines.  Thus the
27504 @option{-msoft-quad-float} option is the default.
27505
27506 @item -mno-unaligned-doubles
27507 @itemx -munaligned-doubles
27508 @opindex mno-unaligned-doubles
27509 @opindex munaligned-doubles
27510 Assume that doubles have 8-byte alignment.  This is the default.
27511
27512 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
27513 alignment only if they are contained in another type, or if they have an
27514 absolute address.  Otherwise, it assumes they have 4-byte alignment.
27515 Specifying this option avoids some rare compatibility problems with code
27516 generated by other compilers.  It is not the default because it results
27517 in a performance loss, especially for floating-point code.
27518
27519 @item -muser-mode
27520 @itemx -mno-user-mode
27521 @opindex muser-mode
27522 @opindex mno-user-mode
27523 Do not generate code that can only run in supervisor mode.  This is relevant
27524 only for the @code{casa} instruction emitted for the LEON3 processor.  This
27525 is the default.
27526
27527 @item -mfaster-structs
27528 @itemx -mno-faster-structs
27529 @opindex mfaster-structs
27530 @opindex mno-faster-structs
27531 With @option{-mfaster-structs}, the compiler assumes that structures
27532 should have 8-byte alignment.  This enables the use of pairs of
27533 @code{ldd} and @code{std} instructions for copies in structure
27534 assignment, in place of twice as many @code{ld} and @code{st} pairs.
27535 However, the use of this changed alignment directly violates the SPARC
27536 ABI@.  Thus, it's intended only for use on targets where the developer
27537 acknowledges that their resulting code is not directly in line with
27538 the rules of the ABI@.
27539
27540 @item -mstd-struct-return
27541 @itemx -mno-std-struct-return
27542 @opindex mstd-struct-return
27543 @opindex mno-std-struct-return
27544 With @option{-mstd-struct-return}, the compiler generates checking code
27545 in functions returning structures or unions to detect size mismatches
27546 between the two sides of function calls, as per the 32-bit ABI@.
27547
27548 The default is @option{-mno-std-struct-return}.  This option has no effect
27549 in 64-bit mode.
27550
27551 @item -mlra
27552 @itemx -mno-lra
27553 @opindex mlra
27554 @opindex mno-lra
27555 Enable Local Register Allocation.  This is the default for SPARC since GCC 7
27556 so @option{-mno-lra} needs to be passed to get old Reload.
27557
27558 @item -mcpu=@var{cpu_type}
27559 @opindex mcpu
27560 Set the instruction set, register set, and instruction scheduling parameters
27561 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
27562 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
27563 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
27564 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
27565 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
27566 @samp{niagara3}, @samp{niagara4}, @samp{niagara7} and @samp{m8}.
27567
27568 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
27569 which selects the best architecture option for the host processor.
27570 @option{-mcpu=native} has no effect if GCC does not recognize
27571 the processor.
27572
27573 Default instruction scheduling parameters are used for values that select
27574 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
27575 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
27576
27577 Here is a list of each supported architecture and their supported
27578 implementations.
27579
27580 @table @asis
27581 @item v7
27582 cypress, leon3v7
27583
27584 @item v8
27585 supersparc, hypersparc, leon, leon3
27586
27587 @item sparclite
27588 f930, f934, sparclite86x
27589
27590 @item sparclet
27591 tsc701
27592
27593 @item v9
27594 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
27595 niagara7, m8
27596 @end table
27597
27598 By default (unless configured otherwise), GCC generates code for the V7
27599 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
27600 additionally optimizes it for the Cypress CY7C602 chip, as used in the
27601 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
27602 SPARCStation 1, 2, IPX etc.
27603
27604 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
27605 architecture.  The only difference from V7 code is that the compiler emits
27606 the integer multiply and integer divide instructions which exist in SPARC-V8
27607 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
27608 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
27609 2000 series.
27610
27611 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
27612 the SPARC architecture.  This adds the integer multiply, integer divide step
27613 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
27614 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
27615 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
27616 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
27617 MB86934 chip, which is the more recent SPARClite with FPU@.
27618
27619 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
27620 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
27621 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
27622 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
27623 optimizes it for the TEMIC SPARClet chip.
27624
27625 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
27626 architecture.  This adds 64-bit integer and floating-point move instructions,
27627 3 additional floating-point condition code registers and conditional move
27628 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
27629 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
27630 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
27631 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
27632 @option{-mcpu=niagara}, the compiler additionally optimizes it for
27633 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
27634 additionally optimizes it for Sun UltraSPARC T2 chips. With
27635 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
27636 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
27637 additionally optimizes it for Sun UltraSPARC T4 chips.  With
27638 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
27639 Oracle SPARC M7 chips.  With @option{-mcpu=m8}, the compiler
27640 additionally optimizes it for Oracle M8 chips.
27641
27642 @item -mtune=@var{cpu_type}
27643 @opindex mtune
27644 Set the instruction scheduling parameters for machine type
27645 @var{cpu_type}, but do not set the instruction set or register set that the
27646 option @option{-mcpu=@var{cpu_type}} does.
27647
27648 The same values for @option{-mcpu=@var{cpu_type}} can be used for
27649 @option{-mtune=@var{cpu_type}}, but the only useful values are those
27650 that select a particular CPU implementation.  Those are
27651 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
27652 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
27653 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
27654 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
27655 @samp{niagara4}, @samp{niagara7} and @samp{m8}.  With native Solaris
27656 and GNU/Linux toolchains, @samp{native} can also be used.
27657
27658 @item -mv8plus
27659 @itemx -mno-v8plus
27660 @opindex mv8plus
27661 @opindex mno-v8plus
27662 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
27663 difference from the V8 ABI is that the global and out registers are
27664 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
27665 mode for all SPARC-V9 processors.
27666
27667 @item -mvis
27668 @itemx -mno-vis
27669 @opindex mvis
27670 @opindex mno-vis
27671 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
27672 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
27673
27674 @item -mvis2
27675 @itemx -mno-vis2
27676 @opindex mvis2
27677 @opindex mno-vis2
27678 With @option{-mvis2}, GCC generates code that takes advantage of
27679 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
27680 default is @option{-mvis2} when targeting a cpu that supports such
27681 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
27682 also sets @option{-mvis}.
27683
27684 @item -mvis3
27685 @itemx -mno-vis3
27686 @opindex mvis3
27687 @opindex mno-vis3
27688 With @option{-mvis3}, GCC generates code that takes advantage of
27689 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
27690 default is @option{-mvis3} when targeting a cpu that supports such
27691 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
27692 also sets @option{-mvis2} and @option{-mvis}.
27693
27694 @item -mvis4
27695 @itemx -mno-vis4
27696 @opindex mvis4
27697 @opindex mno-vis4
27698 With @option{-mvis4}, GCC generates code that takes advantage of
27699 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
27700 default is @option{-mvis4} when targeting a cpu that supports such
27701 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
27702 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
27703
27704 @item -mvis4b
27705 @itemx -mno-vis4b
27706 @opindex mvis4b
27707 @opindex mno-vis4b
27708 With @option{-mvis4b}, GCC generates code that takes advantage of
27709 version 4.0 of the UltraSPARC Visual Instruction Set extensions, plus
27710 the additional VIS instructions introduced in the Oracle SPARC
27711 Architecture 2017.  The default is @option{-mvis4b} when targeting a
27712 cpu that supports such instructions, such as m8 and later.  Setting
27713 @option{-mvis4b} also sets @option{-mvis4}, @option{-mvis3},
27714 @option{-mvis2} and @option{-mvis}.
27715
27716 @item -mcbcond
27717 @itemx -mno-cbcond
27718 @opindex mcbcond
27719 @opindex mno-cbcond
27720 With @option{-mcbcond}, GCC generates code that takes advantage of the UltraSPARC
27721 Compare-and-Branch-on-Condition instructions.  The default is @option{-mcbcond}
27722 when targeting a CPU that supports such instructions, such as Niagara-4 and
27723 later.
27724
27725 @item -mfmaf
27726 @itemx -mno-fmaf
27727 @opindex mfmaf
27728 @opindex mno-fmaf
27729 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
27730 Fused Multiply-Add Floating-point instructions.  The default is @option{-mfmaf}
27731 when targeting a CPU that supports such instructions, such as Niagara-3 and
27732 later.
27733
27734 @item -mfsmuld
27735 @itemx -mno-fsmuld
27736 @opindex mfsmuld
27737 @opindex mno-fsmuld
27738 With @option{-mfsmuld}, GCC generates code that takes advantage of the
27739 Floating-point Multiply Single to Double (FsMULd) instruction.  The default is
27740 @option{-mfsmuld} when targeting a CPU supporting the architecture versions V8
27741 or V9 with FPU except @option{-mcpu=leon}.
27742
27743 @item -mpopc
27744 @itemx -mno-popc
27745 @opindex mpopc
27746 @opindex mno-popc
27747 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
27748 Population Count instruction.  The default is @option{-mpopc}
27749 when targeting a CPU that supports such an instruction, such as Niagara-2 and
27750 later.
27751
27752 @item -msubxc
27753 @itemx -mno-subxc
27754 @opindex msubxc
27755 @opindex mno-subxc
27756 With @option{-msubxc}, GCC generates code that takes advantage of the UltraSPARC
27757 Subtract-Extended-with-Carry instruction.  The default is @option{-msubxc}
27758 when targeting a CPU that supports such an instruction, such as Niagara-7 and
27759 later.
27760
27761 @item -mfix-at697f
27762 @opindex mfix-at697f
27763 Enable the documented workaround for the single erratum of the Atmel AT697F
27764 processor (which corresponds to erratum #13 of the AT697E processor).
27765
27766 @item -mfix-ut699
27767 @opindex mfix-ut699
27768 Enable the documented workarounds for the floating-point errata and the data
27769 cache nullify errata of the UT699 processor.
27770
27771 @item -mfix-ut700
27772 @opindex mfix-ut700
27773 Enable the documented workaround for the back-to-back store errata of
27774 the UT699E/UT700 processor.
27775
27776 @item -mfix-gr712rc
27777 @opindex mfix-gr712rc
27778 Enable the documented workaround for the back-to-back store errata of
27779 the GR712RC processor.
27780 @end table
27781
27782 These @samp{-m} options are supported in addition to the above
27783 on SPARC-V9 processors in 64-bit environments:
27784
27785 @table @gcctabopt
27786 @item -m32
27787 @itemx -m64
27788 @opindex m32
27789 @opindex m64
27790 Generate code for a 32-bit or 64-bit environment.
27791 The 32-bit environment sets int, long and pointer to 32 bits.
27792 The 64-bit environment sets int to 32 bits and long and pointer
27793 to 64 bits.
27794
27795 @item -mcmodel=@var{which}
27796 @opindex mcmodel
27797 Set the code model to one of
27798
27799 @table @samp
27800 @item medlow
27801 The Medium/Low code model: 64-bit addresses, programs
27802 must be linked in the low 32 bits of memory.  Programs can be statically
27803 or dynamically linked.
27804
27805 @item medmid
27806 The Medium/Middle code model: 64-bit addresses, programs
27807 must be linked in the low 44 bits of memory, the text and data segments must
27808 be less than 2GB in size and the data segment must be located within 2GB of
27809 the text segment.
27810
27811 @item medany
27812 The Medium/Anywhere code model: 64-bit addresses, programs
27813 may be linked anywhere in memory, the text and data segments must be less
27814 than 2GB in size and the data segment must be located within 2GB of the
27815 text segment.
27816
27817 @item embmedany
27818 The Medium/Anywhere code model for embedded systems:
27819 64-bit addresses, the text and data segments must be less than 2GB in
27820 size, both starting anywhere in memory (determined at link time).  The
27821 global register %g4 points to the base of the data segment.  Programs
27822 are statically linked and PIC is not supported.
27823 @end table
27824
27825 @item -mmemory-model=@var{mem-model}
27826 @opindex mmemory-model
27827 Set the memory model in force on the processor to one of
27828
27829 @table @samp
27830 @item default
27831 The default memory model for the processor and operating system.
27832
27833 @item rmo
27834 Relaxed Memory Order
27835
27836 @item pso
27837 Partial Store Order
27838
27839 @item tso
27840 Total Store Order
27841
27842 @item sc
27843 Sequential Consistency
27844 @end table
27845
27846 These memory models are formally defined in Appendix D of the SPARC-V9
27847 architecture manual, as set in the processor's @code{PSTATE.MM} field.
27848
27849 @item -mstack-bias
27850 @itemx -mno-stack-bias
27851 @opindex mstack-bias
27852 @opindex mno-stack-bias
27853 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
27854 frame pointer if present, are offset by @minus{}2047 which must be added back
27855 when making stack frame references.  This is the default in 64-bit mode.
27856 Otherwise, assume no such offset is present.
27857 @end table
27858
27859 @node System V Options
27860 @subsection Options for System V
27861
27862 These additional options are available on System V Release 4 for
27863 compatibility with other compilers on those systems:
27864
27865 @table @gcctabopt
27866 @item -G
27867 @opindex G
27868 Create a shared object.
27869 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
27870
27871 @item -Qy
27872 @opindex Qy
27873 Identify the versions of each tool used by the compiler, in a
27874 @code{.ident} assembler directive in the output.
27875
27876 @item -Qn
27877 @opindex Qn
27878 Refrain from adding @code{.ident} directives to the output file (this is
27879 the default).
27880
27881 @item -YP,@var{dirs}
27882 @opindex YP
27883 Search the directories @var{dirs}, and no others, for libraries
27884 specified with @option{-l}.
27885
27886 @item -Ym,@var{dir}
27887 @opindex Ym
27888 Look in the directory @var{dir} to find the M4 preprocessor.
27889 The assembler uses this option.
27890 @c This is supposed to go with a -Yd for predefined M4 macro files, but
27891 @c the generic assembler that comes with Solaris takes just -Ym.
27892 @end table
27893
27894 @node TILE-Gx Options
27895 @subsection TILE-Gx Options
27896 @cindex TILE-Gx options
27897
27898 These @samp{-m} options are supported on the TILE-Gx:
27899
27900 @table @gcctabopt
27901 @item -mcmodel=small
27902 @opindex mcmodel=small
27903 Generate code for the small model.  The distance for direct calls is
27904 limited to 500M in either direction.  PC-relative addresses are 32
27905 bits.  Absolute addresses support the full address range.
27906
27907 @item -mcmodel=large
27908 @opindex mcmodel=large
27909 Generate code for the large model.  There is no limitation on call
27910 distance, pc-relative addresses, or absolute addresses.
27911
27912 @item -mcpu=@var{name}
27913 @opindex mcpu
27914 Selects the type of CPU to be targeted.  Currently the only supported
27915 type is @samp{tilegx}.
27916
27917 @item -m32
27918 @itemx -m64
27919 @opindex m32
27920 @opindex m64
27921 Generate code for a 32-bit or 64-bit environment.  The 32-bit
27922 environment sets int, long, and pointer to 32 bits.  The 64-bit
27923 environment sets int to 32 bits and long and pointer to 64 bits.
27924
27925 @item -mbig-endian
27926 @itemx -mlittle-endian
27927 @opindex mbig-endian
27928 @opindex mlittle-endian
27929 Generate code in big/little endian mode, respectively.
27930 @end table
27931
27932 @node TILEPro Options
27933 @subsection TILEPro Options
27934 @cindex TILEPro options
27935
27936 These @samp{-m} options are supported on the TILEPro:
27937
27938 @table @gcctabopt
27939 @item -mcpu=@var{name}
27940 @opindex mcpu
27941 Selects the type of CPU to be targeted.  Currently the only supported
27942 type is @samp{tilepro}.
27943
27944 @item -m32
27945 @opindex m32
27946 Generate code for a 32-bit environment, which sets int, long, and
27947 pointer to 32 bits.  This is the only supported behavior so the flag
27948 is essentially ignored.
27949 @end table
27950
27951 @node V850 Options
27952 @subsection V850 Options
27953 @cindex V850 Options
27954
27955 These @samp{-m} options are defined for V850 implementations:
27956
27957 @table @gcctabopt
27958 @item -mlong-calls
27959 @itemx -mno-long-calls
27960 @opindex mlong-calls
27961 @opindex mno-long-calls
27962 Treat all calls as being far away (near).  If calls are assumed to be
27963 far away, the compiler always loads the function's address into a
27964 register, and calls indirect through the pointer.
27965
27966 @item -mno-ep
27967 @itemx -mep
27968 @opindex mno-ep
27969 @opindex mep
27970 Do not optimize (do optimize) basic blocks that use the same index
27971 pointer 4 or more times to copy pointer into the @code{ep} register, and
27972 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
27973 option is on by default if you optimize.
27974
27975 @item -mno-prolog-function
27976 @itemx -mprolog-function
27977 @opindex mno-prolog-function
27978 @opindex mprolog-function
27979 Do not use (do use) external functions to save and restore registers
27980 at the prologue and epilogue of a function.  The external functions
27981 are slower, but use less code space if more than one function saves
27982 the same number of registers.  The @option{-mprolog-function} option
27983 is on by default if you optimize.
27984
27985 @item -mspace
27986 @opindex mspace
27987 Try to make the code as small as possible.  At present, this just turns
27988 on the @option{-mep} and @option{-mprolog-function} options.
27989
27990 @item -mtda=@var{n}
27991 @opindex mtda
27992 Put static or global variables whose size is @var{n} bytes or less into
27993 the tiny data area that register @code{ep} points to.  The tiny data
27994 area can hold up to 256 bytes in total (128 bytes for byte references).
27995
27996 @item -msda=@var{n}
27997 @opindex msda
27998 Put static or global variables whose size is @var{n} bytes or less into
27999 the small data area that register @code{gp} points to.  The small data
28000 area can hold up to 64 kilobytes.
28001
28002 @item -mzda=@var{n}
28003 @opindex mzda
28004 Put static or global variables whose size is @var{n} bytes or less into
28005 the first 32 kilobytes of memory.
28006
28007 @item -mv850
28008 @opindex mv850
28009 Specify that the target processor is the V850.
28010
28011 @item -mv850e3v5
28012 @opindex mv850e3v5
28013 Specify that the target processor is the V850E3V5.  The preprocessor
28014 constant @code{__v850e3v5__} is defined if this option is used.
28015
28016 @item -mv850e2v4
28017 @opindex mv850e2v4
28018 Specify that the target processor is the V850E3V5.  This is an alias for
28019 the @option{-mv850e3v5} option.
28020
28021 @item -mv850e2v3
28022 @opindex mv850e2v3
28023 Specify that the target processor is the V850E2V3.  The preprocessor
28024 constant @code{__v850e2v3__} is defined if this option is used.
28025
28026 @item -mv850e2
28027 @opindex mv850e2
28028 Specify that the target processor is the V850E2.  The preprocessor
28029 constant @code{__v850e2__} is defined if this option is used.
28030
28031 @item -mv850e1
28032 @opindex mv850e1
28033 Specify that the target processor is the V850E1.  The preprocessor
28034 constants @code{__v850e1__} and @code{__v850e__} are defined if
28035 this option is used.
28036
28037 @item -mv850es
28038 @opindex mv850es
28039 Specify that the target processor is the V850ES.  This is an alias for
28040 the @option{-mv850e1} option.
28041
28042 @item -mv850e
28043 @opindex mv850e
28044 Specify that the target processor is the V850E@.  The preprocessor
28045 constant @code{__v850e__} is defined if this option is used.
28046
28047 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
28048 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
28049 are defined then a default target processor is chosen and the
28050 relevant @samp{__v850*__} preprocessor constant is defined.
28051
28052 The preprocessor constants @code{__v850} and @code{__v851__} are always
28053 defined, regardless of which processor variant is the target.
28054
28055 @item -mdisable-callt
28056 @itemx -mno-disable-callt
28057 @opindex mdisable-callt
28058 @opindex mno-disable-callt
28059 This option suppresses generation of the @code{CALLT} instruction for the
28060 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
28061 architecture.
28062
28063 This option is enabled by default when the RH850 ABI is
28064 in use (see @option{-mrh850-abi}), and disabled by default when the
28065 GCC ABI is in use.  If @code{CALLT} instructions are being generated
28066 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
28067
28068 @item -mrelax
28069 @itemx -mno-relax
28070 @opindex mrelax
28071 @opindex mno-relax
28072 Pass on (or do not pass on) the @option{-mrelax} command-line option
28073 to the assembler.
28074
28075 @item -mlong-jumps
28076 @itemx -mno-long-jumps
28077 @opindex mlong-jumps
28078 @opindex mno-long-jumps
28079 Disable (or re-enable) the generation of PC-relative jump instructions.
28080
28081 @item -msoft-float
28082 @itemx -mhard-float
28083 @opindex msoft-float
28084 @opindex mhard-float
28085 Disable (or re-enable) the generation of hardware floating point
28086 instructions.  This option is only significant when the target
28087 architecture is @samp{V850E2V3} or higher.  If hardware floating point
28088 instructions are being generated then the C preprocessor symbol
28089 @code{__FPU_OK__} is defined, otherwise the symbol
28090 @code{__NO_FPU__} is defined.
28091
28092 @item -mloop
28093 @opindex mloop
28094 Enables the use of the e3v5 LOOP instruction.  The use of this
28095 instruction is not enabled by default when the e3v5 architecture is
28096 selected because its use is still experimental.
28097
28098 @item -mrh850-abi
28099 @itemx -mghs
28100 @opindex mrh850-abi
28101 @opindex mghs
28102 Enables support for the RH850 version of the V850 ABI.  This is the
28103 default.  With this version of the ABI the following rules apply:
28104
28105 @itemize
28106 @item
28107 Integer sized structures and unions are returned via a memory pointer
28108 rather than a register.
28109
28110 @item
28111 Large structures and unions (more than 8 bytes in size) are passed by
28112 value.
28113
28114 @item
28115 Functions are aligned to 16-bit boundaries.
28116
28117 @item
28118 The @option{-m8byte-align} command-line option is supported.
28119
28120 @item
28121 The @option{-mdisable-callt} command-line option is enabled by
28122 default.  The @option{-mno-disable-callt} command-line option is not
28123 supported.
28124 @end itemize
28125
28126 When this version of the ABI is enabled the C preprocessor symbol
28127 @code{__V850_RH850_ABI__} is defined.
28128
28129 @item -mgcc-abi
28130 @opindex mgcc-abi
28131 Enables support for the old GCC version of the V850 ABI.  With this
28132 version of the ABI the following rules apply:
28133
28134 @itemize
28135 @item
28136 Integer sized structures and unions are returned in register @code{r10}.
28137
28138 @item
28139 Large structures and unions (more than 8 bytes in size) are passed by
28140 reference.
28141
28142 @item
28143 Functions are aligned to 32-bit boundaries, unless optimizing for
28144 size.
28145
28146 @item
28147 The @option{-m8byte-align} command-line option is not supported.
28148
28149 @item
28150 The @option{-mdisable-callt} command-line option is supported but not
28151 enabled by default.
28152 @end itemize
28153
28154 When this version of the ABI is enabled the C preprocessor symbol
28155 @code{__V850_GCC_ABI__} is defined.
28156
28157 @item -m8byte-align
28158 @itemx -mno-8byte-align
28159 @opindex m8byte-align
28160 @opindex mno-8byte-align
28161 Enables support for @code{double} and @code{long long} types to be
28162 aligned on 8-byte boundaries.  The default is to restrict the
28163 alignment of all objects to at most 4-bytes.  When
28164 @option{-m8byte-align} is in effect the C preprocessor symbol
28165 @code{__V850_8BYTE_ALIGN__} is defined.
28166
28167 @item -mbig-switch
28168 @opindex mbig-switch
28169 Generate code suitable for big switch tables.  Use this option only if
28170 the assembler/linker complain about out of range branches within a switch
28171 table.
28172
28173 @item -mapp-regs
28174 @opindex mapp-regs
28175 This option causes r2 and r5 to be used in the code generated by
28176 the compiler.  This setting is the default.
28177
28178 @item -mno-app-regs
28179 @opindex mno-app-regs
28180 This option causes r2 and r5 to be treated as fixed registers.
28181
28182 @end table
28183
28184 @node VAX Options
28185 @subsection VAX Options
28186 @cindex VAX options
28187
28188 These @samp{-m} options are defined for the VAX:
28189
28190 @table @gcctabopt
28191 @item -munix
28192 @opindex munix
28193 Do not output certain jump instructions (@code{aobleq} and so on)
28194 that the Unix assembler for the VAX cannot handle across long
28195 ranges.
28196
28197 @item -mgnu
28198 @opindex mgnu
28199 Do output those jump instructions, on the assumption that the
28200 GNU assembler is being used.
28201
28202 @item -mg
28203 @opindex mg
28204 Output code for G-format floating-point numbers instead of D-format.
28205 @end table
28206
28207 @node Visium Options
28208 @subsection Visium Options
28209 @cindex Visium options
28210
28211 @table @gcctabopt
28212
28213 @item -mdebug
28214 @opindex mdebug
28215 A program which performs file I/O and is destined to run on an MCM target
28216 should be linked with this option.  It causes the libraries libc.a and
28217 libdebug.a to be linked.  The program should be run on the target under
28218 the control of the GDB remote debugging stub.
28219
28220 @item -msim
28221 @opindex msim
28222 A program which performs file I/O and is destined to run on the simulator
28223 should be linked with option.  This causes libraries libc.a and libsim.a to
28224 be linked.
28225
28226 @item -mfpu
28227 @itemx -mhard-float
28228 @opindex mfpu
28229 @opindex mhard-float
28230 Generate code containing floating-point instructions.  This is the
28231 default.
28232
28233 @item -mno-fpu
28234 @itemx -msoft-float
28235 @opindex mno-fpu
28236 @opindex msoft-float
28237 Generate code containing library calls for floating-point.
28238
28239 @option{-msoft-float} changes the calling convention in the output file;
28240 therefore, it is only useful if you compile @emph{all} of a program with
28241 this option.  In particular, you need to compile @file{libgcc.a}, the
28242 library that comes with GCC, with @option{-msoft-float} in order for
28243 this to work.
28244
28245 @item -mcpu=@var{cpu_type}
28246 @opindex mcpu
28247 Set the instruction set, register set, and instruction scheduling parameters
28248 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
28249 @samp{mcm}, @samp{gr5} and @samp{gr6}.
28250
28251 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
28252
28253 By default (unless configured otherwise), GCC generates code for the GR5
28254 variant of the Visium architecture.  
28255
28256 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
28257 architecture.  The only difference from GR5 code is that the compiler will
28258 generate block move instructions.
28259
28260 @item -mtune=@var{cpu_type}
28261 @opindex mtune
28262 Set the instruction scheduling parameters for machine type @var{cpu_type},
28263 but do not set the instruction set or register set that the option
28264 @option{-mcpu=@var{cpu_type}} would.
28265
28266 @item -msv-mode
28267 @opindex msv-mode
28268 Generate code for the supervisor mode, where there are no restrictions on
28269 the access to general registers.  This is the default.
28270
28271 @item -muser-mode
28272 @opindex muser-mode
28273 Generate code for the user mode, where the access to some general registers
28274 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
28275 mode; on the GR6, only registers r29 to r31 are affected.
28276 @end table
28277
28278 @node VMS Options
28279 @subsection VMS Options
28280
28281 These @samp{-m} options are defined for the VMS implementations:
28282
28283 @table @gcctabopt
28284 @item -mvms-return-codes
28285 @opindex mvms-return-codes
28286 Return VMS condition codes from @code{main}. The default is to return POSIX-style
28287 condition (e.g.@: error) codes.
28288
28289 @item -mdebug-main=@var{prefix}
28290 @opindex mdebug-main=@var{prefix}
28291 Flag the first routine whose name starts with @var{prefix} as the main
28292 routine for the debugger.
28293
28294 @item -mmalloc64
28295 @opindex mmalloc64
28296 Default to 64-bit memory allocation routines.
28297
28298 @item -mpointer-size=@var{size}
28299 @opindex mpointer-size=@var{size}
28300 Set the default size of pointers. Possible options for @var{size} are
28301 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
28302 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
28303 The later option disables @code{pragma pointer_size}.
28304 @end table
28305
28306 @node VxWorks Options
28307 @subsection VxWorks Options
28308 @cindex VxWorks Options
28309
28310 The options in this section are defined for all VxWorks targets.
28311 Options specific to the target hardware are listed with the other
28312 options for that target.
28313
28314 @table @gcctabopt
28315 @item -mrtp
28316 @opindex mrtp
28317 GCC can generate code for both VxWorks kernels and real time processes
28318 (RTPs).  This option switches from the former to the latter.  It also
28319 defines the preprocessor macro @code{__RTP__}.
28320
28321 @item -non-static
28322 @opindex non-static
28323 Link an RTP executable against shared libraries rather than static
28324 libraries.  The options @option{-static} and @option{-shared} can
28325 also be used for RTPs (@pxref{Link Options}); @option{-static}
28326 is the default.
28327
28328 @item -Bstatic
28329 @itemx -Bdynamic
28330 @opindex Bstatic
28331 @opindex Bdynamic
28332 These options are passed down to the linker.  They are defined for
28333 compatibility with Diab.
28334
28335 @item -Xbind-lazy
28336 @opindex Xbind-lazy
28337 Enable lazy binding of function calls.  This option is equivalent to
28338 @option{-Wl,-z,now} and is defined for compatibility with Diab.
28339
28340 @item -Xbind-now
28341 @opindex Xbind-now
28342 Disable lazy binding of function calls.  This option is the default and
28343 is defined for compatibility with Diab.
28344 @end table
28345
28346 @node x86 Options
28347 @subsection x86 Options
28348 @cindex x86 Options
28349
28350 These @samp{-m} options are defined for the x86 family of computers.
28351
28352 @table @gcctabopt
28353
28354 @item -march=@var{cpu-type}
28355 @opindex march
28356 Generate instructions for the machine type @var{cpu-type}.  In contrast to
28357 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
28358 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
28359 to generate code that may not run at all on processors other than the one
28360 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
28361 @option{-mtune=@var{cpu-type}}.
28362
28363 The choices for @var{cpu-type} are:
28364
28365 @table @samp
28366 @item native
28367 This selects the CPU to generate code for at compilation time by determining
28368 the processor type of the compiling machine.  Using @option{-march=native}
28369 enables all instruction subsets supported by the local machine (hence
28370 the result might not run on different machines).  Using @option{-mtune=native}
28371 produces code optimized for the local machine under the constraints
28372 of the selected instruction set.  
28373
28374 @item x86-64
28375 A generic CPU with 64-bit extensions.
28376
28377 @item i386
28378 Original Intel i386 CPU@.
28379
28380 @item i486
28381 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
28382
28383 @item i586
28384 @itemx pentium
28385 Intel Pentium CPU with no MMX support.
28386
28387 @item lakemont
28388 Intel Lakemont MCU, based on Intel Pentium CPU.
28389
28390 @item pentium-mmx
28391 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
28392
28393 @item pentiumpro
28394 Intel Pentium Pro CPU@.
28395
28396 @item i686
28397 When used with @option{-march}, the Pentium Pro
28398 instruction set is used, so the code runs on all i686 family chips.
28399 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
28400
28401 @item pentium2
28402 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
28403 support.
28404
28405 @item pentium3
28406 @itemx pentium3m
28407 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
28408 set support.
28409
28410 @item pentium-m
28411 Intel Pentium M; low-power version of Intel Pentium III CPU
28412 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
28413
28414 @item pentium4
28415 @itemx pentium4m
28416 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
28417
28418 @item prescott
28419 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
28420 set support.
28421
28422 @item nocona
28423 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
28424 SSE2 and SSE3 instruction set support.
28425
28426 @item core2
28427 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
28428 instruction set support.
28429
28430 @item nehalem
28431 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
28432 SSE4.1, SSE4.2 and POPCNT instruction set support.
28433
28434 @item westmere
28435 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
28436 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
28437
28438 @item sandybridge
28439 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
28440 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
28441
28442 @item ivybridge
28443 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
28444 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
28445 instruction set support.
28446
28447 @item haswell
28448 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
28449 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
28450 BMI, BMI2 and F16C instruction set support.
28451
28452 @item broadwell
28453 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
28454 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
28455 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
28456
28457 @item skylake
28458 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
28459 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
28460 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
28461 XSAVES instruction set support.
28462
28463 @item bonnell
28464 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
28465 instruction set support.
28466
28467 @item silvermont
28468 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
28469 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
28470
28471 @item goldmont
28472 Intel Goldmont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
28473 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT and FSGSBASE
28474 instruction set support.
28475
28476 @item goldmont-plus
28477 Intel Goldmont Plus CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
28478 SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE,
28479 PTWRITE, RDPID, SGX and UMIP instruction set support.
28480
28481 @item tremont
28482 Intel Tremont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
28483 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE, PTWRITE,
28484 RDPID, SGX, UMIP, GFNI-SSE, CLWB and ENCLV instruction set support.
28485
28486 @item knl
28487 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
28488 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
28489 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
28490 AVX512CD instruction set support.
28491
28492 @item knm
28493 Intel Knights Mill CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
28494 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
28495 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER, AVX512CD,
28496 AVX5124VNNIW, AVX5124FMAPS and AVX512VPOPCNTDQ instruction set support.
28497
28498 @item skylake-avx512
28499 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
28500 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
28501 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
28502 CLWB, AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
28503
28504 @item cannonlake
28505 Intel Cannonlake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
28506 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
28507 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
28508 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
28509 AVX512IFMA, SHA and UMIP instruction set support.
28510
28511 @item icelake-client
28512 Intel Icelake Client CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
28513 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
28514 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
28515 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
28516 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
28517 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES instruction set support.
28518
28519 @item icelake-server
28520 Intel Icelake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
28521 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
28522 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
28523 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
28524 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
28525 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES, PCONFIG and WBNOINVD instruction
28526 set support.
28527
28528 @item cascadelake
28529 Intel Cascadelake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
28530 SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI,
28531 BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, CLWB,
28532 AVX512VL, AVX512BW, AVX512DQ, AVX512CD and AVX512VNNI instruction set support.
28533
28534 @item cooperlake
28535 Intel cooperlake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
28536 SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI,
28537 BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, CLWB,
28538 AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VNNI and AVX512BF16 instruction
28539 set support.
28540
28541 @item tigerlake
28542 Intel Tigerlake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
28543 SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI,
28544 BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
28545 AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, AVX512IFMA, SHA, CLWB, UMIP,
28546 RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ, AVX512BITALG, AVX512VNNI, VPCLMULQDQ,
28547 VAES, PCONFIG, WBNOINVD, MOVDIRI, MOVDIR64B and  AVX512VP2INTERSECT instruction
28548 set support.
28549
28550 @item k6
28551 AMD K6 CPU with MMX instruction set support.
28552
28553 @item k6-2
28554 @itemx k6-3
28555 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
28556
28557 @item athlon
28558 @itemx athlon-tbird
28559 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
28560 support.
28561
28562 @item athlon-4
28563 @itemx athlon-xp
28564 @itemx athlon-mp
28565 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
28566 instruction set support.
28567
28568 @item k8
28569 @itemx opteron
28570 @itemx athlon64
28571 @itemx athlon-fx
28572 Processors based on the AMD K8 core with x86-64 instruction set support,
28573 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
28574 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
28575 instruction set extensions.)
28576
28577 @item k8-sse3
28578 @itemx opteron-sse3
28579 @itemx athlon64-sse3
28580 Improved versions of AMD K8 cores with SSE3 instruction set support.
28581
28582 @item amdfam10
28583 @itemx barcelona
28584 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
28585 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
28586 instruction set extensions.)
28587
28588 @item bdver1
28589 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
28590 supersets FMA4, AVX, XOP, LWP, AES, PCLMUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
28591 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
28592
28593 @item bdver2
28594 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
28595 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCLMUL, CX16, MMX,
28596 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
28597 extensions.)
28598
28599 @item bdver3
28600 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
28601 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
28602 PCLMUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and
28603 64-bit instruction set extensions.)
28604
28605 @item bdver4
28606 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
28607 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
28608 AES, PCLMUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1,
28609 SSE4.2, ABM and 64-bit instruction set extensions.)
28610
28611 @item znver1
28612 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
28613 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
28614 SHA, CLZERO, AES, PCLMUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
28615 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
28616 instruction set extensions.)
28617
28618 @item znver2
28619 AMD Family 17h core based CPUs with x86-64 instruction set support. (This
28620 supersets BMI, BMI2, CLWB, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED,
28621 MWAITX, SHA, CLZERO, AES, PCLMUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A,
28622 SSSE3, SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, RDPID,
28623 WBNOINVD, and 64-bit instruction set extensions.)
28624
28625 @item btver1
28626 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
28627 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
28628 instruction set extensions.)
28629
28630 @item btver2
28631 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
28632 includes MOVBE, F16C, BMI, AVX, PCLMUL, AES, SSE4.2, SSE4.1, CX16, ABM,
28633 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
28634
28635 @item winchip-c6
28636 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
28637 set support.
28638
28639 @item winchip2
28640 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
28641 instruction set support.
28642
28643 @item c3
28644 VIA C3 CPU with MMX and 3DNow!@: instruction set support.
28645 (No scheduling is implemented for this chip.)
28646
28647 @item c3-2
28648 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
28649 (No scheduling is implemented for this chip.)
28650
28651 @item c7
28652 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
28653 (No scheduling is implemented for this chip.)
28654
28655 @item samuel-2
28656 VIA Eden Samuel 2 CPU with MMX and 3DNow!@: instruction set support.
28657 (No scheduling is implemented for this chip.)
28658
28659 @item nehemiah
28660 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
28661 (No scheduling is implemented for this chip.)
28662
28663 @item esther
28664 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
28665 (No scheduling is implemented for this chip.)
28666
28667 @item eden-x2
28668 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3 instruction set support.
28669 (No scheduling is implemented for this chip.)
28670
28671 @item eden-x4
28672 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
28673 AVX and AVX2 instruction set support.
28674 (No scheduling is implemented for this chip.)
28675
28676 @item nano
28677 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
28678 instruction set support.
28679 (No scheduling is implemented for this chip.)
28680
28681 @item nano-1000
28682 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
28683 instruction set support.
28684 (No scheduling is implemented for this chip.)
28685
28686 @item nano-2000
28687 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
28688 instruction set support.
28689 (No scheduling is implemented for this chip.)
28690
28691 @item nano-3000
28692 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
28693 instruction set support.
28694 (No scheduling is implemented for this chip.)
28695
28696 @item nano-x2
28697 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
28698 instruction set support.
28699 (No scheduling is implemented for this chip.)
28700
28701 @item nano-x4
28702 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
28703 instruction set support.
28704 (No scheduling is implemented for this chip.)
28705
28706 @item geode
28707 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
28708 @end table
28709
28710 @item -mtune=@var{cpu-type}
28711 @opindex mtune
28712 Tune to @var{cpu-type} everything applicable about the generated code, except
28713 for the ABI and the set of available instructions.  
28714 While picking a specific @var{cpu-type} schedules things appropriately
28715 for that particular chip, the compiler does not generate any code that
28716 cannot run on the default machine type unless you use a
28717 @option{-march=@var{cpu-type}} option.
28718 For example, if GCC is configured for i686-pc-linux-gnu
28719 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
28720 but still runs on i686 machines.
28721
28722 The choices for @var{cpu-type} are the same as for @option{-march}.
28723 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
28724
28725 @table @samp
28726 @item generic
28727 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
28728 If you know the CPU on which your code will run, then you should use
28729 the corresponding @option{-mtune} or @option{-march} option instead of
28730 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
28731 of your application will have, then you should use this option.
28732
28733 As new processors are deployed in the marketplace, the behavior of this
28734 option will change.  Therefore, if you upgrade to a newer version of
28735 GCC, code generation controlled by this option will change to reflect
28736 the processors
28737 that are most common at the time that version of GCC is released.
28738
28739 There is no @option{-march=generic} option because @option{-march}
28740 indicates the instruction set the compiler can use, and there is no
28741 generic instruction set applicable to all processors.  In contrast,
28742 @option{-mtune} indicates the processor (or, in this case, collection of
28743 processors) for which the code is optimized.
28744
28745 @item intel
28746 Produce code optimized for the most current Intel processors, which are
28747 Haswell and Silvermont for this version of GCC.  If you know the CPU
28748 on which your code will run, then you should use the corresponding
28749 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
28750 But, if you want your application performs better on both Haswell and
28751 Silvermont, then you should use this option.
28752
28753 As new Intel processors are deployed in the marketplace, the behavior of
28754 this option will change.  Therefore, if you upgrade to a newer version of
28755 GCC, code generation controlled by this option will change to reflect
28756 the most current Intel processors at the time that version of GCC is
28757 released.
28758
28759 There is no @option{-march=intel} option because @option{-march} indicates
28760 the instruction set the compiler can use, and there is no common
28761 instruction set applicable to all processors.  In contrast,
28762 @option{-mtune} indicates the processor (or, in this case, collection of
28763 processors) for which the code is optimized.
28764 @end table
28765
28766 @item -mcpu=@var{cpu-type}
28767 @opindex mcpu
28768 A deprecated synonym for @option{-mtune}.
28769
28770 @item -mfpmath=@var{unit}
28771 @opindex mfpmath
28772 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
28773 for @var{unit} are:
28774
28775 @table @samp
28776 @item 387
28777 Use the standard 387 floating-point coprocessor present on the majority of chips and
28778 emulated otherwise.  Code compiled with this option runs almost everywhere.
28779 The temporary results are computed in 80-bit precision instead of the precision
28780 specified by the type, resulting in slightly different results compared to most
28781 of other chips.  See @option{-ffloat-store} for more detailed description.
28782
28783 This is the default choice for non-Darwin x86-32 targets.
28784
28785 @item sse
28786 Use scalar floating-point instructions present in the SSE instruction set.
28787 This instruction set is supported by Pentium III and newer chips,
28788 and in the AMD line
28789 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
28790 instruction set supports only single-precision arithmetic, thus the double and
28791 extended-precision arithmetic are still done using 387.  A later version, present
28792 only in Pentium 4 and AMD x86-64 chips, supports double-precision
28793 arithmetic too.
28794
28795 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
28796 or @option{-msse2} switches to enable SSE extensions and make this option
28797 effective.  For the x86-64 compiler, these extensions are enabled by default.
28798
28799 The resulting code should be considerably faster in the majority of cases and avoid
28800 the numerical instability problems of 387 code, but may break some existing
28801 code that expects temporaries to be 80 bits.
28802
28803 This is the default choice for the x86-64 compiler, Darwin x86-32 targets,
28804 and the default choice for x86-32 targets with the SSE2 instruction set
28805 when @option{-ffast-math} is enabled.
28806
28807 @item sse,387
28808 @itemx sse+387
28809 @itemx both
28810 Attempt to utilize both instruction sets at once.  This effectively doubles the
28811 amount of available registers, and on chips with separate execution units for
28812 387 and SSE the execution resources too.  Use this option with care, as it is
28813 still experimental, because the GCC register allocator does not model separate
28814 functional units well, resulting in unstable performance.
28815 @end table
28816
28817 @item -masm=@var{dialect}
28818 @opindex masm=@var{dialect}
28819 Output assembly instructions using selected @var{dialect}.  Also affects
28820 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
28821 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
28822 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
28823 not support @samp{intel}.
28824
28825 @item -mieee-fp
28826 @itemx -mno-ieee-fp
28827 @opindex mieee-fp
28828 @opindex mno-ieee-fp
28829 Control whether or not the compiler uses IEEE floating-point
28830 comparisons.  These correctly handle the case where the result of a
28831 comparison is unordered.
28832
28833 @item -m80387
28834 @itemx -mhard-float
28835 @opindex 80387
28836 @opindex mhard-float
28837 Generate output containing 80387 instructions for floating point.
28838
28839 @item -mno-80387
28840 @itemx -msoft-float
28841 @opindex no-80387
28842 @opindex msoft-float
28843 Generate output containing library calls for floating point.
28844
28845 @strong{Warning:} the requisite libraries are not part of GCC@.
28846 Normally the facilities of the machine's usual C compiler are used, but
28847 this cannot be done directly in cross-compilation.  You must make your
28848 own arrangements to provide suitable library functions for
28849 cross-compilation.
28850
28851 On machines where a function returns floating-point results in the 80387
28852 register stack, some floating-point opcodes may be emitted even if
28853 @option{-msoft-float} is used.
28854
28855 @item -mno-fp-ret-in-387
28856 @opindex mno-fp-ret-in-387
28857 @opindex mfp-ret-in-387
28858 Do not use the FPU registers for return values of functions.
28859
28860 The usual calling convention has functions return values of types
28861 @code{float} and @code{double} in an FPU register, even if there
28862 is no FPU@.  The idea is that the operating system should emulate
28863 an FPU@.
28864
28865 The option @option{-mno-fp-ret-in-387} causes such values to be returned
28866 in ordinary CPU registers instead.
28867
28868 @item -mno-fancy-math-387
28869 @opindex mno-fancy-math-387
28870 @opindex mfancy-math-387
28871 Some 387 emulators do not support the @code{sin}, @code{cos} and
28872 @code{sqrt} instructions for the 387.  Specify this option to avoid
28873 generating those instructions.
28874 This option is overridden when @option{-march}
28875 indicates that the target CPU always has an FPU and so the
28876 instruction does not need emulation.  These
28877 instructions are not generated unless you also use the
28878 @option{-funsafe-math-optimizations} switch.
28879
28880 @item -malign-double
28881 @itemx -mno-align-double
28882 @opindex malign-double
28883 @opindex mno-align-double
28884 Control whether GCC aligns @code{double}, @code{long double}, and
28885 @code{long long} variables on a two-word boundary or a one-word
28886 boundary.  Aligning @code{double} variables on a two-word boundary
28887 produces code that runs somewhat faster on a Pentium at the
28888 expense of more memory.
28889
28890 On x86-64, @option{-malign-double} is enabled by default.
28891
28892 @strong{Warning:} if you use the @option{-malign-double} switch,
28893 structures containing the above types are aligned differently than
28894 the published application binary interface specifications for the x86-32
28895 and are not binary compatible with structures in code compiled
28896 without that switch.
28897
28898 @item -m96bit-long-double
28899 @itemx -m128bit-long-double
28900 @opindex m96bit-long-double
28901 @opindex m128bit-long-double
28902 These switches control the size of @code{long double} type.  The x86-32
28903 application binary interface specifies the size to be 96 bits,
28904 so @option{-m96bit-long-double} is the default in 32-bit mode.
28905
28906 Modern architectures (Pentium and newer) prefer @code{long double}
28907 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
28908 conforming to the ABI, this is not possible.  So specifying
28909 @option{-m128bit-long-double} aligns @code{long double}
28910 to a 16-byte boundary by padding the @code{long double} with an additional
28911 32-bit zero.
28912
28913 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
28914 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
28915
28916 Notice that neither of these options enable any extra precision over the x87
28917 standard of 80 bits for a @code{long double}.
28918
28919 @strong{Warning:} if you override the default value for your target ABI, this
28920 changes the size of 
28921 structures and arrays containing @code{long double} variables,
28922 as well as modifying the function calling convention for functions taking
28923 @code{long double}.  Hence they are not binary-compatible
28924 with code compiled without that switch.
28925
28926 @item -mlong-double-64
28927 @itemx -mlong-double-80
28928 @itemx -mlong-double-128
28929 @opindex mlong-double-64
28930 @opindex mlong-double-80
28931 @opindex mlong-double-128
28932 These switches control the size of @code{long double} type. A size
28933 of 64 bits makes the @code{long double} type equivalent to the @code{double}
28934 type. This is the default for 32-bit Bionic C library.  A size
28935 of 128 bits makes the @code{long double} type equivalent to the
28936 @code{__float128} type. This is the default for 64-bit Bionic C library.
28937
28938 @strong{Warning:} if you override the default value for your target ABI, this
28939 changes the size of
28940 structures and arrays containing @code{long double} variables,
28941 as well as modifying the function calling convention for functions taking
28942 @code{long double}.  Hence they are not binary-compatible
28943 with code compiled without that switch.
28944
28945 @item -malign-data=@var{type}
28946 @opindex malign-data
28947 Control how GCC aligns variables.  Supported values for @var{type} are
28948 @samp{compat} uses increased alignment value compatible uses GCC 4.8
28949 and earlier, @samp{abi} uses alignment value as specified by the
28950 psABI, and @samp{cacheline} uses increased alignment value to match
28951 the cache line size.  @samp{compat} is the default.
28952
28953 @item -mlarge-data-threshold=@var{threshold}
28954 @opindex mlarge-data-threshold
28955 When @option{-mcmodel=medium} is specified, data objects larger than
28956 @var{threshold} are placed in the large data section.  This value must be the
28957 same across all objects linked into the binary, and defaults to 65535.
28958
28959 @item -mrtd
28960 @opindex mrtd
28961 Use a different function-calling convention, in which functions that
28962 take a fixed number of arguments return with the @code{ret @var{num}}
28963 instruction, which pops their arguments while returning.  This saves one
28964 instruction in the caller since there is no need to pop the arguments
28965 there.
28966
28967 You can specify that an individual function is called with this calling
28968 sequence with the function attribute @code{stdcall}.  You can also
28969 override the @option{-mrtd} option by using the function attribute
28970 @code{cdecl}.  @xref{Function Attributes}.
28971
28972 @strong{Warning:} this calling convention is incompatible with the one
28973 normally used on Unix, so you cannot use it if you need to call
28974 libraries compiled with the Unix compiler.
28975
28976 Also, you must provide function prototypes for all functions that
28977 take variable numbers of arguments (including @code{printf});
28978 otherwise incorrect code is generated for calls to those
28979 functions.
28980
28981 In addition, seriously incorrect code results if you call a
28982 function with too many arguments.  (Normally, extra arguments are
28983 harmlessly ignored.)
28984
28985 @item -mregparm=@var{num}
28986 @opindex mregparm
28987 Control how many registers are used to pass integer arguments.  By
28988 default, no registers are used to pass arguments, and at most 3
28989 registers can be used.  You can control this behavior for a specific
28990 function by using the function attribute @code{regparm}.
28991 @xref{Function Attributes}.
28992
28993 @strong{Warning:} if you use this switch, and
28994 @var{num} is nonzero, then you must build all modules with the same
28995 value, including any libraries.  This includes the system libraries and
28996 startup modules.
28997
28998 @item -msseregparm
28999 @opindex msseregparm
29000 Use SSE register passing conventions for float and double arguments
29001 and return values.  You can control this behavior for a specific
29002 function by using the function attribute @code{sseregparm}.
29003 @xref{Function Attributes}.
29004
29005 @strong{Warning:} if you use this switch then you must build all
29006 modules with the same value, including any libraries.  This includes
29007 the system libraries and startup modules.
29008
29009 @item -mvect8-ret-in-mem
29010 @opindex mvect8-ret-in-mem
29011 Return 8-byte vectors in memory instead of MMX registers.  This is the
29012 default on VxWorks to match the ABI of the Sun Studio compilers until
29013 version 12.  @emph{Only} use this option if you need to remain
29014 compatible with existing code produced by those previous compiler
29015 versions or older versions of GCC@.
29016
29017 @item -mpc32
29018 @itemx -mpc64
29019 @itemx -mpc80
29020 @opindex mpc32
29021 @opindex mpc64
29022 @opindex mpc80
29023
29024 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
29025 is specified, the significands of results of floating-point operations are
29026 rounded to 24 bits (single precision); @option{-mpc64} rounds the
29027 significands of results of floating-point operations to 53 bits (double
29028 precision) and @option{-mpc80} rounds the significands of results of
29029 floating-point operations to 64 bits (extended double precision), which is
29030 the default.  When this option is used, floating-point operations in higher
29031 precisions are not available to the programmer without setting the FPU
29032 control word explicitly.
29033
29034 Setting the rounding of floating-point operations to less than the default
29035 80 bits can speed some programs by 2% or more.  Note that some mathematical
29036 libraries assume that extended-precision (80-bit) floating-point operations
29037 are enabled by default; routines in such libraries could suffer significant
29038 loss of accuracy, typically through so-called ``catastrophic cancellation'',
29039 when this option is used to set the precision to less than extended precision.
29040
29041 @item -mstackrealign
29042 @opindex mstackrealign
29043 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
29044 option generates an alternate prologue and epilogue that realigns the
29045 run-time stack if necessary.  This supports mixing legacy codes that keep
29046 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
29047 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
29048 applicable to individual functions.
29049
29050 @item -mpreferred-stack-boundary=@var{num}
29051 @opindex mpreferred-stack-boundary
29052 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
29053 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
29054 the default is 4 (16 bytes or 128 bits).
29055
29056 @strong{Warning:} When generating code for the x86-64 architecture with
29057 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
29058 used to keep the stack boundary aligned to 8 byte boundary.  Since
29059 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
29060 intended to be used in controlled environment where stack space is
29061 important limitation.  This option leads to wrong code when functions
29062 compiled with 16 byte stack alignment (such as functions from a standard
29063 library) are called with misaligned stack.  In this case, SSE
29064 instructions may lead to misaligned memory access traps.  In addition,
29065 variable arguments are handled incorrectly for 16 byte aligned
29066 objects (including x87 long double and __int128), leading to wrong
29067 results.  You must build all modules with
29068 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
29069 includes the system libraries and startup modules.
29070
29071 @item -mincoming-stack-boundary=@var{num}
29072 @opindex mincoming-stack-boundary
29073 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
29074 boundary.  If @option{-mincoming-stack-boundary} is not specified,
29075 the one specified by @option{-mpreferred-stack-boundary} is used.
29076
29077 On Pentium and Pentium Pro, @code{double} and @code{long double} values
29078 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
29079 suffer significant run time performance penalties.  On Pentium III, the
29080 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
29081 properly if it is not 16-byte aligned.
29082
29083 To ensure proper alignment of this values on the stack, the stack boundary
29084 must be as aligned as that required by any value stored on the stack.
29085 Further, every function must be generated such that it keeps the stack
29086 aligned.  Thus calling a function compiled with a higher preferred
29087 stack boundary from a function compiled with a lower preferred stack
29088 boundary most likely misaligns the stack.  It is recommended that
29089 libraries that use callbacks always use the default setting.
29090
29091 This extra alignment does consume extra stack space, and generally
29092 increases code size.  Code that is sensitive to stack space usage, such
29093 as embedded systems and operating system kernels, may want to reduce the
29094 preferred alignment to @option{-mpreferred-stack-boundary=2}.
29095
29096 @need 200
29097 @item -mmmx
29098 @opindex mmmx
29099 @need 200
29100 @itemx -msse
29101 @opindex msse
29102 @need 200
29103 @itemx -msse2
29104 @opindex msse2
29105 @need 200
29106 @itemx -msse3
29107 @opindex msse3
29108 @need 200
29109 @itemx -mssse3
29110 @opindex mssse3
29111 @need 200
29112 @itemx -msse4
29113 @opindex msse4
29114 @need 200
29115 @itemx -msse4a
29116 @opindex msse4a
29117 @need 200
29118 @itemx -msse4.1
29119 @opindex msse4.1
29120 @need 200
29121 @itemx -msse4.2
29122 @opindex msse4.2
29123 @need 200
29124 @itemx -mavx
29125 @opindex mavx
29126 @need 200
29127 @itemx -mavx2
29128 @opindex mavx2
29129 @need 200
29130 @itemx -mavx512f
29131 @opindex mavx512f
29132 @need 200
29133 @itemx -mavx512pf
29134 @opindex mavx512pf
29135 @need 200
29136 @itemx -mavx512er
29137 @opindex mavx512er
29138 @need 200
29139 @itemx -mavx512cd
29140 @opindex mavx512cd
29141 @need 200
29142 @itemx -mavx512vl
29143 @opindex mavx512vl
29144 @need 200
29145 @itemx -mavx512bw
29146 @opindex mavx512bw
29147 @need 200
29148 @itemx -mavx512dq
29149 @opindex mavx512dq
29150 @need 200
29151 @itemx -mavx512ifma
29152 @opindex mavx512ifma
29153 @need 200
29154 @itemx -mavx512vbmi
29155 @opindex mavx512vbmi
29156 @need 200
29157 @itemx -msha
29158 @opindex msha
29159 @need 200
29160 @itemx -maes
29161 @opindex maes
29162 @need 200
29163 @itemx -mpclmul
29164 @opindex mpclmul
29165 @need 200
29166 @itemx -mclflushopt
29167 @opindex mclflushopt
29168 @need 200
29169 @itemx -mclwb
29170 @opindex mclwb
29171 @need 200
29172 @itemx -mfsgsbase
29173 @opindex mfsgsbase
29174 @need 200
29175 @itemx -mptwrite
29176 @opindex mptwrite
29177 @need 200
29178 @itemx -mrdrnd
29179 @opindex mrdrnd
29180 @need 200
29181 @itemx -mf16c
29182 @opindex mf16c
29183 @need 200
29184 @itemx -mfma
29185 @opindex mfma
29186 @need 200
29187 @itemx -mpconfig
29188 @opindex mpconfig
29189 @need 200
29190 @itemx -mwbnoinvd
29191 @opindex mwbnoinvd
29192 @need 200
29193 @itemx -mfma4
29194 @opindex mfma4
29195 @need 200
29196 @itemx -mprfchw
29197 @opindex mprfchw
29198 @need 200
29199 @itemx -mrdpid
29200 @opindex mrdpid
29201 @need 200
29202 @itemx -mprefetchwt1
29203 @opindex mprefetchwt1
29204 @need 200
29205 @itemx -mrdseed
29206 @opindex mrdseed
29207 @need 200
29208 @itemx -msgx
29209 @opindex msgx
29210 @need 200
29211 @itemx -mxop
29212 @opindex mxop
29213 @need 200
29214 @itemx -mlwp
29215 @opindex mlwp
29216 @need 200
29217 @itemx -m3dnow
29218 @opindex m3dnow
29219 @need 200
29220 @itemx -m3dnowa
29221 @opindex m3dnowa
29222 @need 200
29223 @itemx -mpopcnt
29224 @opindex mpopcnt
29225 @need 200
29226 @itemx -mabm
29227 @opindex mabm
29228 @need 200
29229 @itemx -madx
29230 @opindex madx
29231 @need 200
29232 @itemx -mbmi
29233 @opindex mbmi
29234 @need 200
29235 @itemx -mbmi2
29236 @opindex mbmi2
29237 @need 200
29238 @itemx -mlzcnt
29239 @opindex mlzcnt
29240 @need 200
29241 @itemx -mfxsr
29242 @opindex mfxsr
29243 @need 200
29244 @itemx -mxsave
29245 @opindex mxsave
29246 @need 200
29247 @itemx -mxsaveopt
29248 @opindex mxsaveopt
29249 @need 200
29250 @itemx -mxsavec
29251 @opindex mxsavec
29252 @need 200
29253 @itemx -mxsaves
29254 @opindex mxsaves
29255 @need 200
29256 @itemx -mrtm
29257 @opindex mrtm
29258 @need 200
29259 @itemx -mhle
29260 @opindex mhle
29261 @need 200
29262 @itemx -mtbm
29263 @opindex mtbm
29264 @need 200
29265 @itemx -mmwaitx
29266 @opindex mmwaitx
29267 @need 200
29268 @itemx -mclzero
29269 @opindex mclzero
29270 @need 200
29271 @itemx -mpku
29272 @opindex mpku
29273 @need 200
29274 @itemx -mavx512vbmi2
29275 @opindex mavx512vbmi2
29276 @need 200
29277 @itemx -mavx512bf16
29278 @opindex mavx512bf16
29279 @need 200
29280 @itemx -mgfni
29281 @opindex mgfni
29282 @need 200
29283 @itemx -mvaes
29284 @opindex mvaes
29285 @need 200
29286 @itemx -mwaitpkg
29287 @opindex mwaitpkg
29288 @need 200
29289 @itemx -mvpclmulqdq
29290 @opindex mvpclmulqdq
29291 @need 200
29292 @itemx -mavx512bitalg
29293 @opindex mavx512bitalg
29294 @need 200
29295 @itemx -mmovdiri
29296 @opindex mmovdiri
29297 @need 200
29298 @itemx -mmovdir64b
29299 @opindex mmovdir64b
29300 @need 200
29301 @itemx -menqcmd
29302 @opindex menqcmd
29303 @need 200
29304 @itemx -mavx512vpopcntdq
29305 @opindex mavx512vpopcntdq
29306 @need 200
29307 @itemx -mavx512vp2intersect
29308 @opindex mavx512vp2intersect
29309 @need 200
29310 @itemx -mavx5124fmaps
29311 @opindex mavx5124fmaps
29312 @need 200
29313 @itemx -mavx512vnni
29314 @opindex mavx512vnni
29315 @need 200
29316 @itemx -mavx5124vnniw
29317 @opindex mavx5124vnniw
29318 @need 200
29319 @itemx -mcldemote
29320 @opindex mcldemote
29321 These switches enable the use of instructions in the MMX, SSE,
29322 SSE2, SSE3, SSSE3, SSE4, SSE4A, SSE4.1, SSE4.2, AVX, AVX2, AVX512F, AVX512PF,
29323 AVX512ER, AVX512CD, AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA, AVX512VBMI, SHA,
29324 AES, PCLMUL, CLFLUSHOPT, CLWB, FSGSBASE, PTWRITE, RDRND, F16C, FMA, PCONFIG,
29325 WBNOINVD, FMA4, PREFETCHW, RDPID, PREFETCHWT1, RDSEED, SGX, XOP, LWP,
29326 3DNow!@:, enhanced 3DNow!@:, POPCNT, ABM, ADX, BMI, BMI2, LZCNT, FXSR, XSAVE,
29327 XSAVEOPT, XSAVEC, XSAVES, RTM, HLE, TBM, MWAITX, CLZERO, PKU, AVX512VBMI2,
29328 GFNI, VAES, WAITPKG, VPCLMULQDQ, AVX512BITALG, MOVDIRI, MOVDIR64B, AVX512BF16,
29329 ENQCMD, AVX512VPOPCNTDQ, AVX5124FMAPS, AVX512VNNI, AVX5124VNNIW, or CLDEMOTE
29330 extended instruction sets.  Each has a corresponding @option{-mno-} option to
29331 disable use of these instructions.
29332
29333 These extensions are also available as built-in functions: see
29334 @ref{x86 Built-in Functions}, for details of the functions enabled and
29335 disabled by these switches.
29336
29337 To generate SSE/SSE2 instructions automatically from floating-point
29338 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
29339
29340 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
29341 generates new AVX instructions or AVX equivalence for all SSEx instructions
29342 when needed.
29343
29344 These options enable GCC to use these extended instructions in
29345 generated code, even without @option{-mfpmath=sse}.  Applications that
29346 perform run-time CPU detection must compile separate files for each
29347 supported architecture, using the appropriate flags.  In particular,
29348 the file containing the CPU detection code should be compiled without
29349 these options.
29350
29351 @item -mdump-tune-features
29352 @opindex mdump-tune-features
29353 This option instructs GCC to dump the names of the x86 performance 
29354 tuning features and default settings. The names can be used in 
29355 @option{-mtune-ctrl=@var{feature-list}}.
29356
29357 @item -mtune-ctrl=@var{feature-list}
29358 @opindex mtune-ctrl=@var{feature-list}
29359 This option is used to do fine grain control of x86 code generation features.
29360 @var{feature-list} is a comma separated list of @var{feature} names. See also
29361 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
29362 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
29363 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
29364 developers. Using it may lead to code paths not covered by testing and can
29365 potentially result in compiler ICEs or runtime errors.
29366
29367 @item -mno-default
29368 @opindex mno-default
29369 This option instructs GCC to turn off all tunable features. See also 
29370 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
29371
29372 @item -mcld
29373 @opindex mcld
29374 This option instructs GCC to emit a @code{cld} instruction in the prologue
29375 of functions that use string instructions.  String instructions depend on
29376 the DF flag to select between autoincrement or autodecrement mode.  While the
29377 ABI specifies the DF flag to be cleared on function entry, some operating
29378 systems violate this specification by not clearing the DF flag in their
29379 exception dispatchers.  The exception handler can be invoked with the DF flag
29380 set, which leads to wrong direction mode when string instructions are used.
29381 This option can be enabled by default on 32-bit x86 targets by configuring
29382 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
29383 instructions can be suppressed with the @option{-mno-cld} compiler option
29384 in this case.
29385
29386 @item -mvzeroupper
29387 @opindex mvzeroupper
29388 This option instructs GCC to emit a @code{vzeroupper} instruction
29389 before a transfer of control flow out of the function to minimize
29390 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
29391 intrinsics.
29392
29393 @item -mprefer-avx128
29394 @opindex mprefer-avx128
29395 This option instructs GCC to use 128-bit AVX instructions instead of
29396 256-bit AVX instructions in the auto-vectorizer.
29397
29398 @item -mprefer-vector-width=@var{opt}
29399 @opindex mprefer-vector-width
29400 This option instructs GCC to use @var{opt}-bit vector width in instructions
29401 instead of default on the selected platform.
29402
29403 @table @samp
29404 @item none
29405 No extra limitations applied to GCC other than defined by the selected platform.
29406
29407 @item 128
29408 Prefer 128-bit vector width for instructions.
29409
29410 @item 256
29411 Prefer 256-bit vector width for instructions.
29412
29413 @item 512
29414 Prefer 512-bit vector width for instructions.
29415 @end table
29416
29417 @item -mcx16
29418 @opindex mcx16
29419 This option enables GCC to generate @code{CMPXCHG16B} instructions in 64-bit
29420 code to implement compare-and-exchange operations on 16-byte aligned 128-bit
29421 objects.  This is useful for atomic updates of data structures exceeding one
29422 machine word in size.  The compiler uses this instruction to implement
29423 @ref{__sync Builtins}.  However, for @ref{__atomic Builtins} operating on
29424 128-bit integers, a library call is always used.
29425
29426 @item -msahf
29427 @opindex msahf
29428 This option enables generation of @code{SAHF} instructions in 64-bit code.
29429 Early Intel Pentium 4 CPUs with Intel 64 support,
29430 prior to the introduction of Pentium 4 G1 step in December 2005,
29431 lacked the @code{LAHF} and @code{SAHF} instructions
29432 which are supported by AMD64.
29433 These are load and store instructions, respectively, for certain status flags.
29434 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
29435 @code{drem}, and @code{remainder} built-in functions;
29436 see @ref{Other Builtins} for details.
29437
29438 @item -mmovbe
29439 @opindex mmovbe
29440 This option enables use of the @code{movbe} instruction to implement
29441 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
29442
29443 @item -mshstk
29444 @opindex mshstk
29445 The @option{-mshstk} option enables shadow stack built-in functions
29446 from x86 Control-flow Enforcement Technology (CET).
29447
29448 @item -mcrc32
29449 @opindex mcrc32
29450 This option enables built-in functions @code{__builtin_ia32_crc32qi},
29451 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
29452 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
29453
29454 @item -mrecip
29455 @opindex mrecip
29456 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
29457 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
29458 with an additional Newton-Raphson step
29459 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
29460 (and their vectorized
29461 variants) for single-precision floating-point arguments.  These instructions
29462 are generated only when @option{-funsafe-math-optimizations} is enabled
29463 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
29464 Note that while the throughput of the sequence is higher than the throughput
29465 of the non-reciprocal instruction, the precision of the sequence can be
29466 decreased by up to 2 ulp (i.e.@: the inverse of 1.0 equals 0.99999994).
29467
29468 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
29469 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
29470 combination), and doesn't need @option{-mrecip}.
29471
29472 Also note that GCC emits the above sequence with additional Newton-Raphson step
29473 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
29474 already with @option{-ffast-math} (or the above option combination), and
29475 doesn't need @option{-mrecip}.
29476
29477 @item -mrecip=@var{opt}
29478 @opindex mrecip=opt
29479 This option controls which reciprocal estimate instructions
29480 may be used.  @var{opt} is a comma-separated list of options, which may
29481 be preceded by a @samp{!} to invert the option:
29482
29483 @table @samp
29484 @item all
29485 Enable all estimate instructions.
29486
29487 @item default
29488 Enable the default instructions, equivalent to @option{-mrecip}.
29489
29490 @item none
29491 Disable all estimate instructions, equivalent to @option{-mno-recip}.
29492
29493 @item div
29494 Enable the approximation for scalar division.
29495
29496 @item vec-div
29497 Enable the approximation for vectorized division.
29498
29499 @item sqrt
29500 Enable the approximation for scalar square root.
29501
29502 @item vec-sqrt
29503 Enable the approximation for vectorized square root.
29504 @end table
29505
29506 So, for example, @option{-mrecip=all,!sqrt} enables
29507 all of the reciprocal approximations, except for square root.
29508
29509 @item -mveclibabi=@var{type}
29510 @opindex mveclibabi
29511 Specifies the ABI type to use for vectorizing intrinsics using an
29512 external library.  Supported values for @var{type} are @samp{svml} 
29513 for the Intel short
29514 vector math library and @samp{acml} for the AMD math core library.
29515 To use this option, both @option{-ftree-vectorize} and
29516 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
29517 ABI-compatible library must be specified at link time.
29518
29519 GCC currently emits calls to @code{vmldExp2},
29520 @code{vmldLn2}, @code{vmldLog102}, @code{vmldPow2},
29521 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
29522 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
29523 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
29524 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4},
29525 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
29526 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
29527 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
29528 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
29529 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
29530 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
29531 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
29532 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
29533 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
29534 when @option{-mveclibabi=acml} is used.  
29535
29536 @item -mabi=@var{name}
29537 @opindex mabi
29538 Generate code for the specified calling convention.  Permissible values
29539 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
29540 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
29541 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
29542 You can control this behavior for specific functions by
29543 using the function attributes @code{ms_abi} and @code{sysv_abi}.
29544 @xref{Function Attributes}.
29545
29546 @item -mforce-indirect-call
29547 @opindex mforce-indirect-call
29548 Force all calls to functions to be indirect. This is useful
29549 when using Intel Processor Trace where it generates more precise timing
29550 information for function calls.
29551
29552 @item -mmanual-endbr
29553 @opindex mmanual-endbr
29554 Insert ENDBR instruction at function entry only via the @code{cf_check}
29555 function attribute. This is useful when used with the option
29556 @option{-fcf-protection=branch} to control ENDBR insertion at the
29557 function entry.
29558
29559 @item -mcall-ms2sysv-xlogues
29560 @opindex mcall-ms2sysv-xlogues
29561 @opindex mno-call-ms2sysv-xlogues
29562 Due to differences in 64-bit ABIs, any Microsoft ABI function that calls a
29563 System V ABI function must consider RSI, RDI and XMM6-15 as clobbered.  By
29564 default, the code for saving and restoring these registers is emitted inline,
29565 resulting in fairly lengthy prologues and epilogues.  Using
29566 @option{-mcall-ms2sysv-xlogues} emits prologues and epilogues that
29567 use stubs in the static portion of libgcc to perform these saves and restores,
29568 thus reducing function size at the cost of a few extra instructions.
29569
29570 @item -mtls-dialect=@var{type}
29571 @opindex mtls-dialect
29572 Generate code to access thread-local storage using the @samp{gnu} or
29573 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
29574 @samp{gnu2} is more efficient, but it may add compile- and run-time
29575 requirements that cannot be satisfied on all systems.
29576
29577 @item -mpush-args
29578 @itemx -mno-push-args
29579 @opindex mpush-args
29580 @opindex mno-push-args
29581 Use PUSH operations to store outgoing parameters.  This method is shorter
29582 and usually equally fast as method using SUB/MOV operations and is enabled
29583 by default.  In some cases disabling it may improve performance because of
29584 improved scheduling and reduced dependencies.
29585
29586 @item -maccumulate-outgoing-args
29587 @opindex maccumulate-outgoing-args
29588 If enabled, the maximum amount of space required for outgoing arguments is
29589 computed in the function prologue.  This is faster on most modern CPUs
29590 because of reduced dependencies, improved scheduling and reduced stack usage
29591 when the preferred stack boundary is not equal to 2.  The drawback is a notable
29592 increase in code size.  This switch implies @option{-mno-push-args}.
29593
29594 @item -mthreads
29595 @opindex mthreads
29596 Support thread-safe exception handling on MinGW.  Programs that rely
29597 on thread-safe exception handling must compile and link all code with the
29598 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
29599 @option{-D_MT}; when linking, it links in a special thread helper library
29600 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
29601
29602 @item -mms-bitfields
29603 @itemx -mno-ms-bitfields
29604 @opindex mms-bitfields
29605 @opindex mno-ms-bitfields
29606
29607 Enable/disable bit-field layout compatible with the native Microsoft
29608 Windows compiler.  
29609
29610 If @code{packed} is used on a structure, or if bit-fields are used,
29611 it may be that the Microsoft ABI lays out the structure differently
29612 than the way GCC normally does.  Particularly when moving packed
29613 data between functions compiled with GCC and the native Microsoft compiler
29614 (either via function call or as data in a file), it may be necessary to access
29615 either format.
29616
29617 This option is enabled by default for Microsoft Windows
29618 targets.  This behavior can also be controlled locally by use of variable
29619 or type attributes.  For more information, see @ref{x86 Variable Attributes}
29620 and @ref{x86 Type Attributes}.
29621
29622 The Microsoft structure layout algorithm is fairly simple with the exception
29623 of the bit-field packing.  
29624 The padding and alignment of members of structures and whether a bit-field 
29625 can straddle a storage-unit boundary are determine by these rules:
29626
29627 @enumerate
29628 @item Structure members are stored sequentially in the order in which they are
29629 declared: the first member has the lowest memory address and the last member
29630 the highest.
29631
29632 @item Every data object has an alignment requirement.  The alignment requirement
29633 for all data except structures, unions, and arrays is either the size of the
29634 object or the current packing size (specified with either the
29635 @code{aligned} attribute or the @code{pack} pragma),
29636 whichever is less.  For structures, unions, and arrays,
29637 the alignment requirement is the largest alignment requirement of its members.
29638 Every object is allocated an offset so that:
29639
29640 @smallexample
29641 offset % alignment_requirement == 0
29642 @end smallexample
29643
29644 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
29645 unit if the integral types are the same size and if the next bit-field fits
29646 into the current allocation unit without crossing the boundary imposed by the
29647 common alignment requirements of the bit-fields.
29648 @end enumerate
29649
29650 MSVC interprets zero-length bit-fields in the following ways:
29651
29652 @enumerate
29653 @item If a zero-length bit-field is inserted between two bit-fields that
29654 are normally coalesced, the bit-fields are not coalesced.
29655
29656 For example:
29657
29658 @smallexample
29659 struct
29660  @{
29661    unsigned long bf_1 : 12;
29662    unsigned long : 0;
29663    unsigned long bf_2 : 12;
29664  @} t1;
29665 @end smallexample
29666
29667 @noindent
29668 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
29669 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
29670
29671 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
29672 alignment of the zero-length bit-field is greater than the member that follows it,
29673 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
29674
29675 For example:
29676
29677 @smallexample
29678 struct
29679  @{
29680    char foo : 4;
29681    short : 0;
29682    char bar;
29683  @} t2;
29684
29685 struct
29686  @{
29687    char foo : 4;
29688    short : 0;
29689    double bar;
29690  @} t3;
29691 @end smallexample
29692
29693 @noindent
29694 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
29695 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
29696 bit-field does not affect the alignment of @code{bar} or, as a result, the size
29697 of the structure.
29698
29699 Taking this into account, it is important to note the following:
29700
29701 @enumerate
29702 @item If a zero-length bit-field follows a normal bit-field, the type of the
29703 zero-length bit-field may affect the alignment of the structure as whole. For
29704 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
29705 normal bit-field, and is of type short.
29706
29707 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
29708 still affect the alignment of the structure:
29709
29710 @smallexample
29711 struct
29712  @{
29713    char foo : 6;
29714    long : 0;
29715  @} t4;
29716 @end smallexample
29717
29718 @noindent
29719 Here, @code{t4} takes up 4 bytes.
29720 @end enumerate
29721
29722 @item Zero-length bit-fields following non-bit-field members are ignored:
29723
29724 @smallexample
29725 struct
29726  @{
29727    char foo;
29728    long : 0;
29729    char bar;
29730  @} t5;
29731 @end smallexample
29732
29733 @noindent
29734 Here, @code{t5} takes up 2 bytes.
29735 @end enumerate
29736
29737
29738 @item -mno-align-stringops
29739 @opindex mno-align-stringops
29740 @opindex malign-stringops
29741 Do not align the destination of inlined string operations.  This switch reduces
29742 code size and improves performance in case the destination is already aligned,
29743 but GCC doesn't know about it.
29744
29745 @item -minline-all-stringops
29746 @opindex minline-all-stringops
29747 By default GCC inlines string operations only when the destination is 
29748 known to be aligned to least a 4-byte boundary.  
29749 This enables more inlining and increases code
29750 size, but may improve performance of code that depends on fast
29751 @code{memcpy} and @code{memset} for short lengths.
29752 The option enables inline expansion of @code{strlen} for all
29753 pointer alignments.
29754
29755 @item -minline-stringops-dynamically
29756 @opindex minline-stringops-dynamically
29757 For string operations of unknown size, use run-time checks with
29758 inline code for small blocks and a library call for large blocks.
29759
29760 @item -mstringop-strategy=@var{alg}
29761 @opindex mstringop-strategy=@var{alg}
29762 Override the internal decision heuristic for the particular algorithm to use
29763 for inlining string operations.  The allowed values for @var{alg} are:
29764
29765 @table @samp
29766 @item rep_byte
29767 @itemx rep_4byte
29768 @itemx rep_8byte
29769 Expand using i386 @code{rep} prefix of the specified size.
29770
29771 @item byte_loop
29772 @itemx loop
29773 @itemx unrolled_loop
29774 Expand into an inline loop.
29775
29776 @item libcall
29777 Always use a library call.
29778 @end table
29779
29780 @item -mmemcpy-strategy=@var{strategy}
29781 @opindex mmemcpy-strategy=@var{strategy}
29782 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
29783 should be inlined and what inline algorithm to use when the expected size
29784 of the copy operation is known. @var{strategy} 
29785 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
29786 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
29787 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
29788 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
29789 in the list must be specified in increasing order.  The minimal byte size for 
29790 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
29791 preceding range.
29792
29793 @item -mmemset-strategy=@var{strategy}
29794 @opindex mmemset-strategy=@var{strategy}
29795 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
29796 @code{__builtin_memset} expansion.
29797
29798 @item -momit-leaf-frame-pointer
29799 @opindex momit-leaf-frame-pointer
29800 Don't keep the frame pointer in a register for leaf functions.  This
29801 avoids the instructions to save, set up, and restore frame pointers and
29802 makes an extra register available in leaf functions.  The option
29803 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
29804 which might make debugging harder.
29805
29806 @item -mtls-direct-seg-refs
29807 @itemx -mno-tls-direct-seg-refs
29808 @opindex mtls-direct-seg-refs
29809 Controls whether TLS variables may be accessed with offsets from the
29810 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
29811 or whether the thread base pointer must be added.  Whether or not this
29812 is valid depends on the operating system, and whether it maps the
29813 segment to cover the entire TLS area.
29814
29815 For systems that use the GNU C Library, the default is on.
29816
29817 @item -msse2avx
29818 @itemx -mno-sse2avx
29819 @opindex msse2avx
29820 Specify that the assembler should encode SSE instructions with VEX
29821 prefix.  The option @option{-mavx} turns this on by default.
29822
29823 @item -mfentry
29824 @itemx -mno-fentry
29825 @opindex mfentry
29826 If profiling is active (@option{-pg}), put the profiling
29827 counter call before the prologue.
29828 Note: On x86 architectures the attribute @code{ms_hook_prologue}
29829 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
29830
29831 @item -mrecord-mcount
29832 @itemx -mno-record-mcount
29833 @opindex mrecord-mcount
29834 If profiling is active (@option{-pg}), generate a __mcount_loc section
29835 that contains pointers to each profiling call. This is useful for
29836 automatically patching and out calls.
29837
29838 @item -mnop-mcount
29839 @itemx -mno-nop-mcount
29840 @opindex mnop-mcount
29841 If profiling is active (@option{-pg}), generate the calls to
29842 the profiling functions as NOPs. This is useful when they
29843 should be patched in later dynamically. This is likely only
29844 useful together with @option{-mrecord-mcount}.
29845
29846 @item -minstrument-return=@var{type}
29847 @opindex minstrument-return
29848 Instrument function exit in -pg -mfentry instrumented functions with
29849 call to specified function. This only instruments true returns ending
29850 with ret, but not sibling calls ending with jump. Valid types
29851 are @var{none} to not instrument, @var{call} to generate a call to __return__,
29852 or @var{nop5} to generate a 5 byte nop.
29853
29854 @item -mrecord-return
29855 @itemx -mno-record-return
29856 @opindex mrecord-return
29857 Generate a __return_loc section pointing to all return instrumentation code.
29858
29859 @item -mfentry-name=@var{name}
29860 @opindex mfentry-name
29861 Set name of __fentry__ symbol called at function entry for -pg -mfentry functions.
29862
29863 @item -mfentry-section=@var{name}
29864 @opindex mfentry-section
29865 Set name of section to record -mrecord-mcount calls (default __mcount_loc).
29866
29867 @item -mskip-rax-setup
29868 @itemx -mno-skip-rax-setup
29869 @opindex mskip-rax-setup
29870 When generating code for the x86-64 architecture with SSE extensions
29871 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
29872 register when there are no variable arguments passed in vector registers.
29873
29874 @strong{Warning:} Since RAX register is used to avoid unnecessarily
29875 saving vector registers on stack when passing variable arguments, the
29876 impacts of this option are callees may waste some stack space,
29877 misbehave or jump to a random location.  GCC 4.4 or newer don't have
29878 those issues, regardless the RAX register value.
29879
29880 @item -m8bit-idiv
29881 @itemx -mno-8bit-idiv
29882 @opindex m8bit-idiv
29883 On some processors, like Intel Atom, 8-bit unsigned integer divide is
29884 much faster than 32-bit/64-bit integer divide.  This option generates a
29885 run-time check.  If both dividend and divisor are within range of 0
29886 to 255, 8-bit unsigned integer divide is used instead of
29887 32-bit/64-bit integer divide.
29888
29889 @item -mavx256-split-unaligned-load
29890 @itemx -mavx256-split-unaligned-store
29891 @opindex mavx256-split-unaligned-load
29892 @opindex mavx256-split-unaligned-store
29893 Split 32-byte AVX unaligned load and store.
29894
29895 @item -mstack-protector-guard=@var{guard}
29896 @itemx -mstack-protector-guard-reg=@var{reg}
29897 @itemx -mstack-protector-guard-offset=@var{offset}
29898 @opindex mstack-protector-guard
29899 @opindex mstack-protector-guard-reg
29900 @opindex mstack-protector-guard-offset
29901 Generate stack protection code using canary at @var{guard}.  Supported
29902 locations are @samp{global} for global canary or @samp{tls} for per-thread
29903 canary in the TLS block (the default).  This option has effect only when
29904 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
29905
29906 With the latter choice the options
29907 @option{-mstack-protector-guard-reg=@var{reg}} and
29908 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
29909 which segment register (@code{%fs} or @code{%gs}) to use as base register
29910 for reading the canary, and from what offset from that base register.
29911 The default for those is as specified in the relevant ABI.
29912
29913 @item -mgeneral-regs-only
29914 @opindex mgeneral-regs-only
29915 Generate code that uses only the general-purpose registers.  This
29916 prevents the compiler from using floating-point, vector, mask and bound
29917 registers.
29918
29919 @item -mindirect-branch=@var{choice}
29920 @opindex mindirect-branch
29921 Convert indirect call and jump with @var{choice}.  The default is
29922 @samp{keep}, which keeps indirect call and jump unmodified.
29923 @samp{thunk} converts indirect call and jump to call and return thunk.
29924 @samp{thunk-inline} converts indirect call and jump to inlined call
29925 and return thunk.  @samp{thunk-extern} converts indirect call and jump
29926 to external call and return thunk provided in a separate object file.
29927 You can control this behavior for a specific function by using the
29928 function attribute @code{indirect_branch}.  @xref{Function Attributes}.
29929
29930 Note that @option{-mcmodel=large} is incompatible with
29931 @option{-mindirect-branch=thunk} and
29932 @option{-mindirect-branch=thunk-extern} since the thunk function may
29933 not be reachable in the large code model.
29934
29935 Note that @option{-mindirect-branch=thunk-extern} is incompatible with
29936 @option{-fcf-protection=branch} since the external thunk cannot be modified
29937 to disable control-flow check.
29938
29939 @item -mfunction-return=@var{choice}
29940 @opindex mfunction-return
29941 Convert function return with @var{choice}.  The default is @samp{keep},
29942 which keeps function return unmodified.  @samp{thunk} converts function
29943 return to call and return thunk.  @samp{thunk-inline} converts function
29944 return to inlined call and return thunk.  @samp{thunk-extern} converts
29945 function return to external call and return thunk provided in a separate
29946 object file.  You can control this behavior for a specific function by
29947 using the function attribute @code{function_return}.
29948 @xref{Function Attributes}.
29949
29950 Note that @option{-mcmodel=large} is incompatible with
29951 @option{-mfunction-return=thunk} and
29952 @option{-mfunction-return=thunk-extern} since the thunk function may
29953 not be reachable in the large code model.
29954
29955
29956 @item -mindirect-branch-register
29957 @opindex mindirect-branch-register
29958 Force indirect call and jump via register.
29959
29960 @end table
29961
29962 These @samp{-m} switches are supported in addition to the above
29963 on x86-64 processors in 64-bit environments.
29964
29965 @table @gcctabopt
29966 @item -m32
29967 @itemx -m64
29968 @itemx -mx32
29969 @itemx -m16
29970 @itemx -miamcu
29971 @opindex m32
29972 @opindex m64
29973 @opindex mx32
29974 @opindex m16
29975 @opindex miamcu
29976 Generate code for a 16-bit, 32-bit or 64-bit environment.
29977 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
29978 to 32 bits, and
29979 generates code that runs on any i386 system.
29980
29981 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
29982 types to 64 bits, and generates code for the x86-64 architecture.
29983 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
29984 and @option{-mdynamic-no-pic} options.
29985
29986 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
29987 to 32 bits, and
29988 generates code for the x86-64 architecture.
29989
29990 The @option{-m16} option is the same as @option{-m32}, except for that
29991 it outputs the @code{.code16gcc} assembly directive at the beginning of
29992 the assembly output so that the binary can run in 16-bit mode.
29993
29994 The @option{-miamcu} option generates code which conforms to Intel MCU
29995 psABI.  It requires the @option{-m32} option to be turned on.
29996
29997 @item -mno-red-zone
29998 @opindex mno-red-zone
29999 @opindex mred-zone
30000 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
30001 by the x86-64 ABI; it is a 128-byte area beyond the location of the
30002 stack pointer that is not modified by signal or interrupt handlers
30003 and therefore can be used for temporary data without adjusting the stack
30004 pointer.  The flag @option{-mno-red-zone} disables this red zone.
30005
30006 @item -mcmodel=small
30007 @opindex mcmodel=small
30008 Generate code for the small code model: the program and its symbols must
30009 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
30010 Programs can be statically or dynamically linked.  This is the default
30011 code model.
30012
30013 @item -mcmodel=kernel
30014 @opindex mcmodel=kernel
30015 Generate code for the kernel code model.  The kernel runs in the
30016 negative 2 GB of the address space.
30017 This model has to be used for Linux kernel code.
30018
30019 @item -mcmodel=medium
30020 @opindex mcmodel=medium
30021 Generate code for the medium model: the program is linked in the lower 2
30022 GB of the address space.  Small symbols are also placed there.  Symbols
30023 with sizes larger than @option{-mlarge-data-threshold} are put into
30024 large data or BSS sections and can be located above 2GB.  Programs can
30025 be statically or dynamically linked.
30026
30027 @item -mcmodel=large
30028 @opindex mcmodel=large
30029 Generate code for the large model.  This model makes no assumptions
30030 about addresses and sizes of sections.
30031
30032 @item -maddress-mode=long
30033 @opindex maddress-mode=long
30034 Generate code for long address mode.  This is only supported for 64-bit
30035 and x32 environments.  It is the default address mode for 64-bit
30036 environments.
30037
30038 @item -maddress-mode=short
30039 @opindex maddress-mode=short
30040 Generate code for short address mode.  This is only supported for 32-bit
30041 and x32 environments.  It is the default address mode for 32-bit and
30042 x32 environments.
30043 @end table
30044
30045 @node x86 Windows Options
30046 @subsection x86 Windows Options
30047 @cindex x86 Windows Options
30048 @cindex Windows Options for x86
30049
30050 These additional options are available for Microsoft Windows targets:
30051
30052 @table @gcctabopt
30053 @item -mconsole
30054 @opindex mconsole
30055 This option
30056 specifies that a console application is to be generated, by
30057 instructing the linker to set the PE header subsystem type
30058 required for console applications.
30059 This option is available for Cygwin and MinGW targets and is
30060 enabled by default on those targets.
30061
30062 @item -mdll
30063 @opindex mdll
30064 This option is available for Cygwin and MinGW targets.  It
30065 specifies that a DLL---a dynamic link library---is to be
30066 generated, enabling the selection of the required runtime
30067 startup object and entry point.
30068
30069 @item -mnop-fun-dllimport
30070 @opindex mnop-fun-dllimport
30071 This option is available for Cygwin and MinGW targets.  It
30072 specifies that the @code{dllimport} attribute should be ignored.
30073
30074 @item -mthread
30075 @opindex mthread
30076 This option is available for MinGW targets. It specifies
30077 that MinGW-specific thread support is to be used.
30078
30079 @item -municode
30080 @opindex municode
30081 This option is available for MinGW-w64 targets.  It causes
30082 the @code{UNICODE} preprocessor macro to be predefined, and
30083 chooses Unicode-capable runtime startup code.
30084
30085 @item -mwin32
30086 @opindex mwin32
30087 This option is available for Cygwin and MinGW targets.  It
30088 specifies that the typical Microsoft Windows predefined macros are to
30089 be set in the pre-processor, but does not influence the choice
30090 of runtime library/startup code.
30091
30092 @item -mwindows
30093 @opindex mwindows
30094 This option is available for Cygwin and MinGW targets.  It
30095 specifies that a GUI application is to be generated by
30096 instructing the linker to set the PE header subsystem type
30097 appropriately.
30098
30099 @item -fno-set-stack-executable
30100 @opindex fno-set-stack-executable
30101 @opindex fset-stack-executable
30102 This option is available for MinGW targets. It specifies that
30103 the executable flag for the stack used by nested functions isn't
30104 set. This is necessary for binaries running in kernel mode of
30105 Microsoft Windows, as there the User32 API, which is used to set executable
30106 privileges, isn't available.
30107
30108 @item -fwritable-relocated-rdata
30109 @opindex fno-writable-relocated-rdata
30110 @opindex fwritable-relocated-rdata
30111 This option is available for MinGW and Cygwin targets.  It specifies
30112 that relocated-data in read-only section is put into the @code{.data}
30113 section.  This is a necessary for older runtimes not supporting
30114 modification of @code{.rdata} sections for pseudo-relocation.
30115
30116 @item -mpe-aligned-commons
30117 @opindex mpe-aligned-commons
30118 This option is available for Cygwin and MinGW targets.  It
30119 specifies that the GNU extension to the PE file format that
30120 permits the correct alignment of COMMON variables should be
30121 used when generating code.  It is enabled by default if
30122 GCC detects that the target assembler found during configuration
30123 supports the feature.
30124 @end table
30125
30126 See also under @ref{x86 Options} for standard options.
30127
30128 @node Xstormy16 Options
30129 @subsection Xstormy16 Options
30130 @cindex Xstormy16 Options
30131
30132 These options are defined for Xstormy16:
30133
30134 @table @gcctabopt
30135 @item -msim
30136 @opindex msim
30137 Choose startup files and linker script suitable for the simulator.
30138 @end table
30139
30140 @node Xtensa Options
30141 @subsection Xtensa Options
30142 @cindex Xtensa Options
30143
30144 These options are supported for Xtensa targets:
30145
30146 @table @gcctabopt
30147 @item -mconst16
30148 @itemx -mno-const16
30149 @opindex mconst16
30150 @opindex mno-const16
30151 Enable or disable use of @code{CONST16} instructions for loading
30152 constant values.  The @code{CONST16} instruction is currently not a
30153 standard option from Tensilica.  When enabled, @code{CONST16}
30154 instructions are always used in place of the standard @code{L32R}
30155 instructions.  The use of @code{CONST16} is enabled by default only if
30156 the @code{L32R} instruction is not available.
30157
30158 @item -mfused-madd
30159 @itemx -mno-fused-madd
30160 @opindex mfused-madd
30161 @opindex mno-fused-madd
30162 Enable or disable use of fused multiply/add and multiply/subtract
30163 instructions in the floating-point option.  This has no effect if the
30164 floating-point option is not also enabled.  Disabling fused multiply/add
30165 and multiply/subtract instructions forces the compiler to use separate
30166 instructions for the multiply and add/subtract operations.  This may be
30167 desirable in some cases where strict IEEE 754-compliant results are
30168 required: the fused multiply add/subtract instructions do not round the
30169 intermediate result, thereby producing results with @emph{more} bits of
30170 precision than specified by the IEEE standard.  Disabling fused multiply
30171 add/subtract instructions also ensures that the program output is not
30172 sensitive to the compiler's ability to combine multiply and add/subtract
30173 operations.
30174
30175 @item -mserialize-volatile
30176 @itemx -mno-serialize-volatile
30177 @opindex mserialize-volatile
30178 @opindex mno-serialize-volatile
30179 When this option is enabled, GCC inserts @code{MEMW} instructions before
30180 @code{volatile} memory references to guarantee sequential consistency.
30181 The default is @option{-mserialize-volatile}.  Use
30182 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
30183
30184 @item -mforce-no-pic
30185 @opindex mforce-no-pic
30186 For targets, like GNU/Linux, where all user-mode Xtensa code must be
30187 position-independent code (PIC), this option disables PIC for compiling
30188 kernel code.
30189
30190 @item -mtext-section-literals
30191 @itemx -mno-text-section-literals
30192 @opindex mtext-section-literals
30193 @opindex mno-text-section-literals
30194 These options control the treatment of literal pools.  The default is
30195 @option{-mno-text-section-literals}, which places literals in a separate
30196 section in the output file.  This allows the literal pool to be placed
30197 in a data RAM/ROM, and it also allows the linker to combine literal
30198 pools from separate object files to remove redundant literals and
30199 improve code size.  With @option{-mtext-section-literals}, the literals
30200 are interspersed in the text section in order to keep them as close as
30201 possible to their references.  This may be necessary for large assembly
30202 files.  Literals for each function are placed right before that function.
30203
30204 @item -mauto-litpools
30205 @itemx -mno-auto-litpools
30206 @opindex mauto-litpools
30207 @opindex mno-auto-litpools
30208 These options control the treatment of literal pools.  The default is
30209 @option{-mno-auto-litpools}, which places literals in a separate
30210 section in the output file unless @option{-mtext-section-literals} is
30211 used.  With @option{-mauto-litpools} the literals are interspersed in
30212 the text section by the assembler.  Compiler does not produce explicit
30213 @code{.literal} directives and loads literals into registers with
30214 @code{MOVI} instructions instead of @code{L32R} to let the assembler
30215 do relaxation and place literals as necessary.  This option allows
30216 assembler to create several literal pools per function and assemble
30217 very big functions, which may not be possible with
30218 @option{-mtext-section-literals}.
30219
30220 @item -mtarget-align
30221 @itemx -mno-target-align
30222 @opindex mtarget-align
30223 @opindex mno-target-align
30224 When this option is enabled, GCC instructs the assembler to
30225 automatically align instructions to reduce branch penalties at the
30226 expense of some code density.  The assembler attempts to widen density
30227 instructions to align branch targets and the instructions following call
30228 instructions.  If there are not enough preceding safe density
30229 instructions to align a target, no widening is performed.  The
30230 default is @option{-mtarget-align}.  These options do not affect the
30231 treatment of auto-aligned instructions like @code{LOOP}, which the
30232 assembler always aligns, either by widening density instructions or
30233 by inserting NOP instructions.
30234
30235 @item -mlongcalls
30236 @itemx -mno-longcalls
30237 @opindex mlongcalls
30238 @opindex mno-longcalls
30239 When this option is enabled, GCC instructs the assembler to translate
30240 direct calls to indirect calls unless it can determine that the target
30241 of a direct call is in the range allowed by the call instruction.  This
30242 translation typically occurs for calls to functions in other source
30243 files.  Specifically, the assembler translates a direct @code{CALL}
30244 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
30245 The default is @option{-mno-longcalls}.  This option should be used in
30246 programs where the call target can potentially be out of range.  This
30247 option is implemented in the assembler, not the compiler, so the
30248 assembly code generated by GCC still shows direct call
30249 instructions---look at the disassembled object code to see the actual
30250 instructions.  Note that the assembler uses an indirect call for
30251 every cross-file call, not just those that really are out of range.
30252 @end table
30253
30254 @node zSeries Options
30255 @subsection zSeries Options
30256 @cindex zSeries options
30257
30258 These are listed under @xref{S/390 and zSeries Options}.
30259
30260
30261 @c man end
30262
30263 @node Spec Files
30264 @section Specifying Subprocesses and the Switches to Pass to Them
30265 @cindex Spec Files
30266
30267 @command{gcc} is a driver program.  It performs its job by invoking a
30268 sequence of other programs to do the work of compiling, assembling and
30269 linking.  GCC interprets its command-line parameters and uses these to
30270 deduce which programs it should invoke, and which command-line options
30271 it ought to place on their command lines.  This behavior is controlled
30272 by @dfn{spec strings}.  In most cases there is one spec string for each
30273 program that GCC can invoke, but a few programs have multiple spec
30274 strings to control their behavior.  The spec strings built into GCC can
30275 be overridden by using the @option{-specs=} command-line switch to specify
30276 a spec file.
30277
30278 @dfn{Spec files} are plain-text files that are used to construct spec
30279 strings.  They consist of a sequence of directives separated by blank
30280 lines.  The type of directive is determined by the first non-whitespace
30281 character on the line, which can be one of the following:
30282
30283 @table @code
30284 @item %@var{command}
30285 Issues a @var{command} to the spec file processor.  The commands that can
30286 appear here are:
30287
30288 @table @code
30289 @item %include <@var{file}>
30290 @cindex @code{%include}
30291 Search for @var{file} and insert its text at the current point in the
30292 specs file.
30293
30294 @item %include_noerr <@var{file}>
30295 @cindex @code{%include_noerr}
30296 Just like @samp{%include}, but do not generate an error message if the include
30297 file cannot be found.
30298
30299 @item %rename @var{old_name} @var{new_name}
30300 @cindex @code{%rename}
30301 Rename the spec string @var{old_name} to @var{new_name}.
30302
30303 @end table
30304
30305 @item *[@var{spec_name}]:
30306 This tells the compiler to create, override or delete the named spec
30307 string.  All lines after this directive up to the next directive or
30308 blank line are considered to be the text for the spec string.  If this
30309 results in an empty string then the spec is deleted.  (Or, if the
30310 spec did not exist, then nothing happens.)  Otherwise, if the spec
30311 does not currently exist a new spec is created.  If the spec does
30312 exist then its contents are overridden by the text of this
30313 directive, unless the first character of that text is the @samp{+}
30314 character, in which case the text is appended to the spec.
30315
30316 @item [@var{suffix}]:
30317 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
30318 and up to the next directive or blank line are considered to make up the
30319 spec string for the indicated suffix.  When the compiler encounters an
30320 input file with the named suffix, it processes the spec string in
30321 order to work out how to compile that file.  For example:
30322
30323 @smallexample
30324 .ZZ:
30325 z-compile -input %i
30326 @end smallexample
30327
30328 This says that any input file whose name ends in @samp{.ZZ} should be
30329 passed to the program @samp{z-compile}, which should be invoked with the
30330 command-line switch @option{-input} and with the result of performing the
30331 @samp{%i} substitution.  (See below.)
30332
30333 As an alternative to providing a spec string, the text following a
30334 suffix directive can be one of the following:
30335
30336 @table @code
30337 @item @@@var{language}
30338 This says that the suffix is an alias for a known @var{language}.  This is
30339 similar to using the @option{-x} command-line switch to GCC to specify a
30340 language explicitly.  For example:
30341
30342 @smallexample
30343 .ZZ:
30344 @@c++
30345 @end smallexample
30346
30347 Says that .ZZ files are, in fact, C++ source files.
30348
30349 @item #@var{name}
30350 This causes an error messages saying:
30351
30352 @smallexample
30353 @var{name} compiler not installed on this system.
30354 @end smallexample
30355 @end table
30356
30357 GCC already has an extensive list of suffixes built into it.
30358 This directive adds an entry to the end of the list of suffixes, but
30359 since the list is searched from the end backwards, it is effectively
30360 possible to override earlier entries using this technique.
30361
30362 @end table
30363
30364 GCC has the following spec strings built into it.  Spec files can
30365 override these strings or create their own.  Note that individual
30366 targets can also add their own spec strings to this list.
30367
30368 @smallexample
30369 asm          Options to pass to the assembler
30370 asm_final    Options to pass to the assembler post-processor
30371 cpp          Options to pass to the C preprocessor
30372 cc1          Options to pass to the C compiler
30373 cc1plus      Options to pass to the C++ compiler
30374 endfile      Object files to include at the end of the link
30375 link         Options to pass to the linker
30376 lib          Libraries to include on the command line to the linker
30377 libgcc       Decides which GCC support library to pass to the linker
30378 linker       Sets the name of the linker
30379 predefines   Defines to be passed to the C preprocessor
30380 signed_char  Defines to pass to CPP to say whether @code{char} is signed
30381              by default
30382 startfile    Object files to include at the start of the link
30383 @end smallexample
30384
30385 Here is a small example of a spec file:
30386
30387 @smallexample
30388 %rename lib                 old_lib
30389
30390 *lib:
30391 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
30392 @end smallexample
30393
30394 This example renames the spec called @samp{lib} to @samp{old_lib} and
30395 then overrides the previous definition of @samp{lib} with a new one.
30396 The new definition adds in some extra command-line options before
30397 including the text of the old definition.
30398
30399 @dfn{Spec strings} are a list of command-line options to be passed to their
30400 corresponding program.  In addition, the spec strings can contain
30401 @samp{%}-prefixed sequences to substitute variable text or to
30402 conditionally insert text into the command line.  Using these constructs
30403 it is possible to generate quite complex command lines.
30404
30405 Here is a table of all defined @samp{%}-sequences for spec
30406 strings.  Note that spaces are not generated automatically around the
30407 results of expanding these sequences.  Therefore you can concatenate them
30408 together or combine them with constant text in a single argument.
30409
30410 @table @code
30411 @item %%
30412 Substitute one @samp{%} into the program name or argument.
30413
30414 @item %i
30415 Substitute the name of the input file being processed.
30416
30417 @item %b
30418 Substitute the basename of the input file being processed.
30419 This is the substring up to (and not including) the last period
30420 and not including the directory.
30421
30422 @item %B
30423 This is the same as @samp{%b}, but include the file suffix (text after
30424 the last period).
30425
30426 @item %d
30427 Marks the argument containing or following the @samp{%d} as a
30428 temporary file name, so that that file is deleted if GCC exits
30429 successfully.  Unlike @samp{%g}, this contributes no text to the
30430 argument.
30431
30432 @item %g@var{suffix}
30433 Substitute a file name that has suffix @var{suffix} and is chosen
30434 once per compilation, and mark the argument in the same way as
30435 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
30436 name is now chosen in a way that is hard to predict even when previously
30437 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
30438 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
30439 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
30440 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
30441 was simply substituted with a file name chosen once per compilation,
30442 without regard to any appended suffix (which was therefore treated
30443 just like ordinary text), making such attacks more likely to succeed.
30444
30445 @item %u@var{suffix}
30446 Like @samp{%g}, but generates a new temporary file name
30447 each time it appears instead of once per compilation.
30448
30449 @item %U@var{suffix}
30450 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
30451 new one if there is no such last file name.  In the absence of any
30452 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
30453 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
30454 involves the generation of two distinct file names, one
30455 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
30456 simply substituted with a file name chosen for the previous @samp{%u},
30457 without regard to any appended suffix.
30458
30459 @item %j@var{suffix}
30460 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
30461 writable, and if @option{-save-temps} is not used; 
30462 otherwise, substitute the name
30463 of a temporary file, just like @samp{%u}.  This temporary file is not
30464 meant for communication between processes, but rather as a junk
30465 disposal mechanism.
30466
30467 @item %|@var{suffix}
30468 @itemx %m@var{suffix}
30469 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
30470 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
30471 all.  These are the two most common ways to instruct a program that it
30472 should read from standard input or write to standard output.  If you
30473 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
30474 construct: see for example @file{gcc/fortran/lang-specs.h}.
30475
30476 @item %.@var{SUFFIX}
30477 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
30478 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
30479 terminated by the next space or %.
30480
30481 @item %w
30482 Marks the argument containing or following the @samp{%w} as the
30483 designated output file of this compilation.  This puts the argument
30484 into the sequence of arguments that @samp{%o} substitutes.
30485
30486 @item %o
30487 Substitutes the names of all the output files, with spaces
30488 automatically placed around them.  You should write spaces
30489 around the @samp{%o} as well or the results are undefined.
30490 @samp{%o} is for use in the specs for running the linker.
30491 Input files whose names have no recognized suffix are not compiled
30492 at all, but they are included among the output files, so they are
30493 linked.
30494
30495 @item %O
30496 Substitutes the suffix for object files.  Note that this is
30497 handled specially when it immediately follows @samp{%g, %u, or %U},
30498 because of the need for those to form complete file names.  The
30499 handling is such that @samp{%O} is treated exactly as if it had already
30500 been substituted, except that @samp{%g, %u, and %U} do not currently
30501 support additional @var{suffix} characters following @samp{%O} as they do
30502 following, for example, @samp{.o}.
30503
30504 @item %p
30505 Substitutes the standard macro predefinitions for the
30506 current target machine.  Use this when running @command{cpp}.
30507
30508 @item %P
30509 Like @samp{%p}, but puts @samp{__} before and after the name of each
30510 predefined macro, except for macros that start with @samp{__} or with
30511 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
30512 C@.
30513
30514 @item %I
30515 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
30516 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
30517 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
30518 and @option{-imultilib} as necessary.
30519
30520 @item %s
30521 Current argument is the name of a library or startup file of some sort.
30522 Search for that file in a standard list of directories and substitute
30523 the full name found.  The current working directory is included in the
30524 list of directories scanned.
30525
30526 @item %T
30527 Current argument is the name of a linker script.  Search for that file
30528 in the current list of directories to scan for libraries. If the file
30529 is located insert a @option{--script} option into the command line
30530 followed by the full path name found.  If the file is not found then
30531 generate an error message.  Note: the current working directory is not
30532 searched.
30533
30534 @item %e@var{str}
30535 Print @var{str} as an error message.  @var{str} is terminated by a newline.
30536 Use this when inconsistent options are detected.
30537
30538 @item %(@var{name})
30539 Substitute the contents of spec string @var{name} at this point.
30540
30541 @item %x@{@var{option}@}
30542 Accumulate an option for @samp{%X}.
30543
30544 @item %X
30545 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
30546 spec string.
30547
30548 @item %Y
30549 Output the accumulated assembler options specified by @option{-Wa}.
30550
30551 @item %Z
30552 Output the accumulated preprocessor options specified by @option{-Wp}.
30553
30554 @item %a
30555 Process the @code{asm} spec.  This is used to compute the
30556 switches to be passed to the assembler.
30557
30558 @item %A
30559 Process the @code{asm_final} spec.  This is a spec string for
30560 passing switches to an assembler post-processor, if such a program is
30561 needed.
30562
30563 @item %l
30564 Process the @code{link} spec.  This is the spec for computing the
30565 command line passed to the linker.  Typically it makes use of the
30566 @samp{%L %G %S %D and %E} sequences.
30567
30568 @item %D
30569 Dump out a @option{-L} option for each directory that GCC believes might
30570 contain startup files.  If the target supports multilibs then the
30571 current multilib directory is prepended to each of these paths.
30572
30573 @item %L
30574 Process the @code{lib} spec.  This is a spec string for deciding which
30575 libraries are included on the command line to the linker.
30576
30577 @item %G
30578 Process the @code{libgcc} spec.  This is a spec string for deciding
30579 which GCC support library is included on the command line to the linker.
30580
30581 @item %S
30582 Process the @code{startfile} spec.  This is a spec for deciding which
30583 object files are the first ones passed to the linker.  Typically
30584 this might be a file named @file{crt0.o}.
30585
30586 @item %E
30587 Process the @code{endfile} spec.  This is a spec string that specifies
30588 the last object files that are passed to the linker.
30589
30590 @item %C
30591 Process the @code{cpp} spec.  This is used to construct the arguments
30592 to be passed to the C preprocessor.
30593
30594 @item %1
30595 Process the @code{cc1} spec.  This is used to construct the options to be
30596 passed to the actual C compiler (@command{cc1}).
30597
30598 @item %2
30599 Process the @code{cc1plus} spec.  This is used to construct the options to be
30600 passed to the actual C++ compiler (@command{cc1plus}).
30601
30602 @item %*
30603 Substitute the variable part of a matched option.  See below.
30604 Note that each comma in the substituted string is replaced by
30605 a single space.
30606
30607 @item %<S
30608 Remove all occurrences of @code{-S} from the command line.  Note---this
30609 command is position dependent.  @samp{%} commands in the spec string
30610 before this one see @code{-S}, @samp{%} commands in the spec string
30611 after this one do not.
30612
30613 @item %:@var{function}(@var{args})
30614 Call the named function @var{function}, passing it @var{args}.
30615 @var{args} is first processed as a nested spec string, then split
30616 into an argument vector in the usual fashion.  The function returns
30617 a string which is processed as if it had appeared literally as part
30618 of the current spec.
30619
30620 The following built-in spec functions are provided:
30621
30622 @table @code
30623 @item @code{getenv}
30624 The @code{getenv} spec function takes two arguments: an environment
30625 variable name and a string.  If the environment variable is not
30626 defined, a fatal error is issued.  Otherwise, the return value is the
30627 value of the environment variable concatenated with the string.  For
30628 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
30629
30630 @smallexample
30631 %:getenv(TOPDIR /include)
30632 @end smallexample
30633
30634 expands to @file{/path/to/top/include}.
30635
30636 @item @code{if-exists}
30637 The @code{if-exists} spec function takes one argument, an absolute
30638 pathname to a file.  If the file exists, @code{if-exists} returns the
30639 pathname.  Here is a small example of its usage:
30640
30641 @smallexample
30642 *startfile:
30643 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
30644 @end smallexample
30645
30646 @item @code{if-exists-else}
30647 The @code{if-exists-else} spec function is similar to the @code{if-exists}
30648 spec function, except that it takes two arguments.  The first argument is
30649 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
30650 returns the pathname.  If it does not exist, it returns the second argument.
30651 This way, @code{if-exists-else} can be used to select one file or another,
30652 based on the existence of the first.  Here is a small example of its usage:
30653
30654 @smallexample
30655 *startfile:
30656 crt0%O%s %:if-exists(crti%O%s) \
30657 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
30658 @end smallexample
30659
30660 @item @code{replace-outfile}
30661 The @code{replace-outfile} spec function takes two arguments.  It looks for the
30662 first argument in the outfiles array and replaces it with the second argument.  Here
30663 is a small example of its usage:
30664
30665 @smallexample
30666 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
30667 @end smallexample
30668
30669 @item @code{remove-outfile}
30670 The @code{remove-outfile} spec function takes one argument.  It looks for the
30671 first argument in the outfiles array and removes it.  Here is a small example
30672 its usage:
30673
30674 @smallexample
30675 %:remove-outfile(-lm)
30676 @end smallexample
30677
30678 @item @code{pass-through-libs}
30679 The @code{pass-through-libs} spec function takes any number of arguments.  It
30680 finds any @option{-l} options and any non-options ending in @file{.a} (which it
30681 assumes are the names of linker input library archive files) and returns a
30682 result containing all the found arguments each prepended by
30683 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
30684 intended to be passed to the LTO linker plugin.
30685
30686 @smallexample
30687 %:pass-through-libs(%G %L %G)
30688 @end smallexample
30689
30690 @item @code{print-asm-header}
30691 The @code{print-asm-header} function takes no arguments and simply
30692 prints a banner like:
30693
30694 @smallexample
30695 Assembler options
30696 =================
30697
30698 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
30699 @end smallexample
30700
30701 It is used to separate compiler options from assembler options
30702 in the @option{--target-help} output.
30703 @end table
30704
30705 @item %@{S@}
30706 Substitutes the @code{-S} switch, if that switch is given to GCC@.
30707 If that switch is not specified, this substitutes nothing.  Note that
30708 the leading dash is omitted when specifying this option, and it is
30709 automatically inserted if the substitution is performed.  Thus the spec
30710 string @samp{%@{foo@}} matches the command-line option @option{-foo}
30711 and outputs the command-line option @option{-foo}.
30712
30713 @item %W@{S@}
30714 Like %@{@code{S}@} but mark last argument supplied within as a file to be
30715 deleted on failure.
30716
30717 @item %@{S*@}
30718 Substitutes all the switches specified to GCC whose names start
30719 with @code{-S}, but which also take an argument.  This is used for
30720 switches like @option{-o}, @option{-D}, @option{-I}, etc.
30721 GCC considers @option{-o foo} as being
30722 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
30723 text, including the space.  Thus two arguments are generated.
30724
30725 @item %@{S*&T*@}
30726 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
30727 (the order of @code{S} and @code{T} in the spec is not significant).
30728 There can be any number of ampersand-separated variables; for each the
30729 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
30730
30731 @item %@{S:X@}
30732 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
30733
30734 @item %@{!S:X@}
30735 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
30736
30737 @item %@{S*:X@}
30738 Substitutes @code{X} if one or more switches whose names start with
30739 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
30740 once, no matter how many such switches appeared.  However, if @code{%*}
30741 appears somewhere in @code{X}, then @code{X} is substituted once
30742 for each matching switch, with the @code{%*} replaced by the part of
30743 that switch matching the @code{*}.
30744
30745 If @code{%*} appears as the last part of a spec sequence then a space
30746 is added after the end of the last substitution.  If there is more
30747 text in the sequence, however, then a space is not generated.  This
30748 allows the @code{%*} substitution to be used as part of a larger
30749 string.  For example, a spec string like this:
30750
30751 @smallexample
30752 %@{mcu=*:--script=%*/memory.ld@}
30753 @end smallexample
30754
30755 @noindent
30756 when matching an option like @option{-mcu=newchip} produces:
30757
30758 @smallexample
30759 --script=newchip/memory.ld
30760 @end smallexample
30761
30762 @item %@{.S:X@}
30763 Substitutes @code{X}, if processing a file with suffix @code{S}.
30764
30765 @item %@{!.S:X@}
30766 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
30767
30768 @item %@{,S:X@}
30769 Substitutes @code{X}, if processing a file for language @code{S}.
30770
30771 @item %@{!,S:X@}
30772 Substitutes @code{X}, if not processing a file for language @code{S}.
30773
30774 @item %@{S|P:X@}
30775 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
30776 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
30777 @code{*} sequences as well, although they have a stronger binding than
30778 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
30779 alternatives must be starred, and only the first matching alternative
30780 is substituted.
30781
30782 For example, a spec string like this:
30783
30784 @smallexample
30785 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
30786 @end smallexample
30787
30788 @noindent
30789 outputs the following command-line options from the following input
30790 command-line options:
30791
30792 @smallexample
30793 fred.c        -foo -baz
30794 jim.d         -bar -boggle
30795 -d fred.c     -foo -baz -boggle
30796 -d jim.d      -bar -baz -boggle
30797 @end smallexample
30798
30799 @item %@{S:X; T:Y; :D@}
30800
30801 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
30802 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
30803 be as many clauses as you need.  This may be combined with @code{.},
30804 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
30805
30806
30807 @end table
30808
30809 The switch matching text @code{S} in a @samp{%@{S@}}, @samp{%@{S:X@}}
30810 or similar construct can use a backslash to ignore the special meaning
30811 of the character following it, thus allowing literal matching of a
30812 character that is otherwise specially treated.  For example,
30813 @samp{%@{std=iso9899\:1999:X@}} substitutes @code{X} if the
30814 @option{-std=iso9899:1999} option is given.
30815
30816 The conditional text @code{X} in a @samp{%@{S:X@}} or similar
30817 construct may contain other nested @samp{%} constructs or spaces, or
30818 even newlines.  They are processed as usual, as described above.
30819 Trailing white space in @code{X} is ignored.  White space may also
30820 appear anywhere on the left side of the colon in these constructs,
30821 except between @code{.} or @code{*} and the corresponding word.
30822
30823 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
30824 handled specifically in these constructs.  If another value of
30825 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
30826 @option{-W} switch is found later in the command line, the earlier
30827 switch value is ignored, except with @{@code{S}*@} where @code{S} is
30828 just one letter, which passes all matching options.
30829
30830 The character @samp{|} at the beginning of the predicate text is used to
30831 indicate that a command should be piped to the following command, but
30832 only if @option{-pipe} is specified.
30833
30834 It is built into GCC which switches take arguments and which do not.
30835 (You might think it would be useful to generalize this to allow each
30836 compiler's spec to say which switches take arguments.  But this cannot
30837 be done in a consistent fashion.  GCC cannot even decide which input
30838 files have been specified without knowing which switches take arguments,
30839 and it must know which input files to compile in order to tell which
30840 compilers to run).
30841
30842 GCC also knows implicitly that arguments starting in @option{-l} are to be
30843 treated as compiler output files, and passed to the linker in their
30844 proper position among the other output files.
30845
30846 @node Environment Variables
30847 @section Environment Variables Affecting GCC
30848 @cindex environment variables
30849
30850 @c man begin ENVIRONMENT
30851 This section describes several environment variables that affect how GCC
30852 operates.  Some of them work by specifying directories or prefixes to use
30853 when searching for various kinds of files.  Some are used to specify other
30854 aspects of the compilation environment.
30855
30856 Note that you can also specify places to search using options such as
30857 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
30858 take precedence over places specified using environment variables, which
30859 in turn take precedence over those specified by the configuration of GCC@.
30860 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
30861 GNU Compiler Collection (GCC) Internals}.
30862
30863 @table @env
30864 @item LANG
30865 @itemx LC_CTYPE
30866 @c @itemx LC_COLLATE
30867 @itemx LC_MESSAGES
30868 @c @itemx LC_MONETARY
30869 @c @itemx LC_NUMERIC
30870 @c @itemx LC_TIME
30871 @itemx LC_ALL
30872 @findex LANG
30873 @findex LC_CTYPE
30874 @c @findex LC_COLLATE
30875 @findex LC_MESSAGES
30876 @c @findex LC_MONETARY
30877 @c @findex LC_NUMERIC
30878 @c @findex LC_TIME
30879 @findex LC_ALL
30880 @cindex locale
30881 These environment variables control the way that GCC uses
30882 localization information which allows GCC to work with different
30883 national conventions.  GCC inspects the locale categories
30884 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
30885 so.  These locale categories can be set to any value supported by your
30886 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
30887 Kingdom encoded in UTF-8.
30888
30889 The @env{LC_CTYPE} environment variable specifies character
30890 classification.  GCC uses it to determine the character boundaries in
30891 a string; this is needed for some multibyte encodings that contain quote
30892 and escape characters that are otherwise interpreted as a string
30893 end or escape.
30894
30895 The @env{LC_MESSAGES} environment variable specifies the language to
30896 use in diagnostic messages.
30897
30898 If the @env{LC_ALL} environment variable is set, it overrides the value
30899 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
30900 and @env{LC_MESSAGES} default to the value of the @env{LANG}
30901 environment variable.  If none of these variables are set, GCC
30902 defaults to traditional C English behavior.
30903
30904 @item TMPDIR
30905 @findex TMPDIR
30906 If @env{TMPDIR} is set, it specifies the directory to use for temporary
30907 files.  GCC uses temporary files to hold the output of one stage of
30908 compilation which is to be used as input to the next stage: for example,
30909 the output of the preprocessor, which is the input to the compiler
30910 proper.
30911
30912 @item GCC_COMPARE_DEBUG
30913 @findex GCC_COMPARE_DEBUG
30914 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
30915 @option{-fcompare-debug} to the compiler driver.  See the documentation
30916 of this option for more details.
30917
30918 @item GCC_EXEC_PREFIX
30919 @findex GCC_EXEC_PREFIX
30920 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
30921 names of the subprograms executed by the compiler.  No slash is added
30922 when this prefix is combined with the name of a subprogram, but you can
30923 specify a prefix that ends with a slash if you wish.
30924
30925 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
30926 an appropriate prefix to use based on the pathname it is invoked with.
30927
30928 If GCC cannot find the subprogram using the specified prefix, it
30929 tries looking in the usual places for the subprogram.
30930
30931 The default value of @env{GCC_EXEC_PREFIX} is
30932 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
30933 the installed compiler. In many cases @var{prefix} is the value
30934 of @code{prefix} when you ran the @file{configure} script.
30935
30936 Other prefixes specified with @option{-B} take precedence over this prefix.
30937
30938 This prefix is also used for finding files such as @file{crt0.o} that are
30939 used for linking.
30940
30941 In addition, the prefix is used in an unusual way in finding the
30942 directories to search for header files.  For each of the standard
30943 directories whose name normally begins with @samp{/usr/local/lib/gcc}
30944 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
30945 replacing that beginning with the specified prefix to produce an
30946 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
30947 @file{foo/bar} just before it searches the standard directory 
30948 @file{/usr/local/lib/bar}.
30949 If a standard directory begins with the configured
30950 @var{prefix} then the value of @var{prefix} is replaced by
30951 @env{GCC_EXEC_PREFIX} when looking for header files.
30952
30953 @item COMPILER_PATH
30954 @findex COMPILER_PATH
30955 The value of @env{COMPILER_PATH} is a colon-separated list of
30956 directories, much like @env{PATH}.  GCC tries the directories thus
30957 specified when searching for subprograms, if it cannot find the
30958 subprograms using @env{GCC_EXEC_PREFIX}.
30959
30960 @item LIBRARY_PATH
30961 @findex LIBRARY_PATH
30962 The value of @env{LIBRARY_PATH} is a colon-separated list of
30963 directories, much like @env{PATH}.  When configured as a native compiler,
30964 GCC tries the directories thus specified when searching for special
30965 linker files, if it cannot find them using @env{GCC_EXEC_PREFIX}.  Linking
30966 using GCC also uses these directories when searching for ordinary
30967 libraries for the @option{-l} option (but directories specified with
30968 @option{-L} come first).
30969
30970 @item LANG
30971 @findex LANG
30972 @cindex locale definition
30973 This variable is used to pass locale information to the compiler.  One way in
30974 which this information is used is to determine the character set to be used
30975 when character literals, string literals and comments are parsed in C and C++.
30976 When the compiler is configured to allow multibyte characters,
30977 the following values for @env{LANG} are recognized:
30978
30979 @table @samp
30980 @item C-JIS
30981 Recognize JIS characters.
30982 @item C-SJIS
30983 Recognize SJIS characters.
30984 @item C-EUCJP
30985 Recognize EUCJP characters.
30986 @end table
30987
30988 If @env{LANG} is not defined, or if it has some other value, then the
30989 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
30990 recognize and translate multibyte characters.
30991 @end table
30992
30993 @noindent
30994 Some additional environment variables affect the behavior of the
30995 preprocessor.
30996
30997 @include cppenv.texi
30998
30999 @c man end
31000
31001 @node Precompiled Headers
31002 @section Using Precompiled Headers
31003 @cindex precompiled headers
31004 @cindex speed of compilation
31005
31006 Often large projects have many header files that are included in every
31007 source file.  The time the compiler takes to process these header files
31008 over and over again can account for nearly all of the time required to
31009 build the project.  To make builds faster, GCC allows you to
31010 @dfn{precompile} a header file.
31011
31012 To create a precompiled header file, simply compile it as you would any
31013 other file, if necessary using the @option{-x} option to make the driver
31014 treat it as a C or C++ header file.  You may want to use a
31015 tool like @command{make} to keep the precompiled header up-to-date when
31016 the headers it contains change.
31017
31018 A precompiled header file is searched for when @code{#include} is
31019 seen in the compilation.  As it searches for the included file
31020 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
31021 compiler looks for a precompiled header in each directory just before it
31022 looks for the include file in that directory.  The name searched for is
31023 the name specified in the @code{#include} with @samp{.gch} appended.  If
31024 the precompiled header file cannot be used, it is ignored.
31025
31026 For instance, if you have @code{#include "all.h"}, and you have
31027 @file{all.h.gch} in the same directory as @file{all.h}, then the
31028 precompiled header file is used if possible, and the original
31029 header is used otherwise.
31030
31031 Alternatively, you might decide to put the precompiled header file in a
31032 directory and use @option{-I} to ensure that directory is searched
31033 before (or instead of) the directory containing the original header.
31034 Then, if you want to check that the precompiled header file is always
31035 used, you can put a file of the same name as the original header in this
31036 directory containing an @code{#error} command.
31037
31038 This also works with @option{-include}.  So yet another way to use
31039 precompiled headers, good for projects not designed with precompiled
31040 header files in mind, is to simply take most of the header files used by
31041 a project, include them from another header file, precompile that header
31042 file, and @option{-include} the precompiled header.  If the header files
31043 have guards against multiple inclusion, they are skipped because
31044 they've already been included (in the precompiled header).
31045
31046 If you need to precompile the same header file for different
31047 languages, targets, or compiler options, you can instead make a
31048 @emph{directory} named like @file{all.h.gch}, and put each precompiled
31049 header in the directory, perhaps using @option{-o}.  It doesn't matter
31050 what you call the files in the directory; every precompiled header in
31051 the directory is considered.  The first precompiled header
31052 encountered in the directory that is valid for this compilation is
31053 used; they're searched in no particular order.
31054
31055 There are many other possibilities, limited only by your imagination,
31056 good sense, and the constraints of your build system.
31057
31058 A precompiled header file can be used only when these conditions apply:
31059
31060 @itemize
31061 @item
31062 Only one precompiled header can be used in a particular compilation.
31063
31064 @item
31065 A precompiled header cannot be used once the first C token is seen.  You
31066 can have preprocessor directives before a precompiled header; you cannot
31067 include a precompiled header from inside another header.
31068
31069 @item
31070 The precompiled header file must be produced for the same language as
31071 the current compilation.  You cannot use a C precompiled header for a C++
31072 compilation.
31073
31074 @item
31075 The precompiled header file must have been produced by the same compiler
31076 binary as the current compilation is using.
31077
31078 @item
31079 Any macros defined before the precompiled header is included must
31080 either be defined in the same way as when the precompiled header was
31081 generated, or must not affect the precompiled header, which usually
31082 means that they don't appear in the precompiled header at all.
31083
31084 The @option{-D} option is one way to define a macro before a
31085 precompiled header is included; using a @code{#define} can also do it.
31086 There are also some options that define macros implicitly, like
31087 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
31088 defined this way.
31089
31090 @item If debugging information is output when using the precompiled
31091 header, using @option{-g} or similar, the same kind of debugging information
31092 must have been output when building the precompiled header.  However,
31093 a precompiled header built using @option{-g} can be used in a compilation
31094 when no debugging information is being output.
31095
31096 @item The same @option{-m} options must generally be used when building
31097 and using the precompiled header.  @xref{Submodel Options},
31098 for any cases where this rule is relaxed.
31099
31100 @item Each of the following options must be the same when building and using
31101 the precompiled header:
31102
31103 @gccoptlist{-fexceptions}
31104
31105 @item
31106 Some other command-line options starting with @option{-f},
31107 @option{-p}, or @option{-O} must be defined in the same way as when
31108 the precompiled header was generated.  At present, it's not clear
31109 which options are safe to change and which are not; the safest choice
31110 is to use exactly the same options when generating and using the
31111 precompiled header.  The following are known to be safe:
31112
31113 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
31114 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
31115 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
31116 -pedantic-errors}
31117
31118 @item Address space layout randomization (ASLR) can lead to not binary identical
31119 PCH files.  If you rely on stable PCH file contents disable ASLR when generating
31120 PCH files.
31121
31122 @end itemize
31123
31124 For all of these except the last, the compiler automatically
31125 ignores the precompiled header if the conditions aren't met.  If you
31126 find an option combination that doesn't work and doesn't cause the
31127 precompiled header to be ignored, please consider filing a bug report,
31128 see @ref{Bugs}.
31129
31130 If you do use differing options when generating and using the
31131 precompiled header, the actual behavior is a mixture of the
31132 behavior for the options.  For instance, if you use @option{-g} to
31133 generate the precompiled header but not when using it, you may or may
31134 not get debugging information for routines in the precompiled header.