[nvptx] Basic -misa support for nvptx
[official-gcc.git] / gcc / doc / invoke.texi
blob8ac29fd48e144fcc07399d850b5e2f62b15149ba
1 @c Copyright (C) 1988-2018 Free Software Foundation, Inc.
2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file gcc.texi.
5 @ignore
6 @c man begin INCLUDE
7 @include gcc-vers.texi
8 @c man end
10 @c man begin COPYRIGHT
11 Copyright @copyright{} 1988-2018 Free Software Foundation, Inc.
13 Permission is granted to copy, distribute and/or modify this document
14 under the terms of the GNU Free Documentation License, Version 1.3 or
15 any later version published by the Free Software Foundation; with the
16 Invariant Sections being ``GNU General Public License'' and ``Funding
17 Free Software'', the Front-Cover texts being (a) (see below), and with
18 the Back-Cover Texts being (b) (see below).  A copy of the license is
19 included in the gfdl(7) man page.
21 (a) The FSF's Front-Cover Text is:
23      A GNU Manual
25 (b) The FSF's Back-Cover Text is:
27      You have freedom to copy and modify this GNU Manual, like GNU
28      software.  Copies published by the Free Software Foundation raise
29      funds for GNU development.
30 @c man end
31 @c Set file name and title for the man page.
32 @setfilename gcc
33 @settitle GNU project C and C++ compiler
34 @c man begin SYNOPSIS
35 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
36     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
37     [@option{-W}@var{warn}@dots{}] [@option{-Wpedantic}]
38     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
39     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
40     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
41     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
43 Only the most useful options are listed here; see below for the
44 remainder.  @command{g++} accepts mostly the same options as @command{gcc}.
45 @c man end
46 @c man begin SEEALSO
47 gpl(7), gfdl(7), fsf-funding(7),
48 cpp(1), gcov(1), as(1), ld(1), gdb(1), dbx(1)
49 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
50 @file{ld}, @file{binutils} and @file{gdb}.
51 @c man end
52 @c man begin BUGS
53 For instructions on reporting bugs, see
54 @w{@value{BUGURL}}.
55 @c man end
56 @c man begin AUTHOR
57 See the Info entry for @command{gcc}, or
58 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
59 for contributors to GCC@.
60 @c man end
61 @end ignore
63 @node Invoking GCC
64 @chapter GCC Command Options
65 @cindex GCC command options
66 @cindex command options
67 @cindex options, GCC command
69 @c man begin DESCRIPTION
70 When you invoke GCC, it normally does preprocessing, compilation,
71 assembly and linking.  The ``overall options'' allow you to stop this
72 process at an intermediate stage.  For example, the @option{-c} option
73 says not to run the linker.  Then the output consists of object files
74 output by the assembler.
75 @xref{Overall Options,,Options Controlling the Kind of Output}.
77 Other options are passed on to one or more stages of processing.  Some options
78 control the preprocessor and others the compiler itself.  Yet other
79 options control the assembler and linker; most of these are not
80 documented here, since you rarely need to use any of them.
82 @cindex C compilation options
83 Most of the command-line options that you can use with GCC are useful
84 for C programs; when an option is only useful with another language
85 (usually C++), the explanation says so explicitly.  If the description
86 for a particular option does not mention a source language, you can use
87 that option with all supported languages.
89 @cindex cross compiling
90 @cindex specifying machine version
91 @cindex specifying compiler version and target machine
92 @cindex compiler version, specifying
93 @cindex target machine, specifying
94 The usual way to run GCC is to run the executable called @command{gcc}, or
95 @command{@var{machine}-gcc} when cross-compiling, or
96 @command{@var{machine}-gcc-@var{version}} to run a specific version of GCC.
97 When you compile C++ programs, you should invoke GCC as @command{g++} 
98 instead.  @xref{Invoking G++,,Compiling C++ Programs}, 
99 for information about the differences in behavior between @command{gcc} 
100 and @code{g++} when compiling C++ programs.
102 @cindex grouping options
103 @cindex options, grouping
104 The @command{gcc} program accepts options and file names as operands.  Many
105 options have multi-letter names; therefore multiple single-letter options
106 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
107 -v}}.
109 @cindex order of options
110 @cindex options, order
111 You can mix options and other arguments.  For the most part, the order
112 you use doesn't matter.  Order does matter when you use several
113 options of the same kind; for example, if you specify @option{-L} more
114 than once, the directories are searched in the order specified.  Also,
115 the placement of the @option{-l} option is significant.
117 Many options have long names starting with @samp{-f} or with
118 @samp{-W}---for example,
119 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
120 these have both positive and negative forms; the negative form of
121 @option{-ffoo} is @option{-fno-foo}.  This manual documents
122 only one of these two forms, whichever one is not the default.
124 Some options take one or more arguments typically separated either
125 by a space or by the equals sign (@samp{=}) from the option name.
126 Unless documented otherwise, an argument can be either numeric or
127 a string.  Numeric arguments must typically be small unsigned decimal
128 or hexadecimal integers.  Hexadecimal arguments must begin with
129 the @samp{0x} prefix.  Arguments to options that specify a size
130 threshold of some sort may be arbitrarily large decimal or hexadecimal
131 integers followed by a byte size suffix designating a multiple of bytes
132 such as @code{kB} and @code{KiB} for kilobyte and kibibyte, respectively,
133 @code{MB} and @code{MiB} for megabyte and mebibyte, @code{GB} and
134 @code{GiB} for gigabyte and gigibyte, and so on.  Such arguments are
135 designated by @var{byte-size} in the following text.  Refer to the NIST,
136 IEC, and other relevant national and international standards for the full
137 listing and explanation of the binary and decimal byte size prefixes.
139 @c man end
141 @xref{Option Index}, for an index to GCC's options.
143 @menu
144 * Option Summary::      Brief list of all options, without explanations.
145 * Overall Options::     Controlling the kind of output:
146                         an executable, object files, assembler files,
147                         or preprocessed source.
148 * Invoking G++::        Compiling C++ programs.
149 * C Dialect Options::   Controlling the variant of C language compiled.
150 * C++ Dialect Options:: Variations on C++.
151 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
152                         and Objective-C++.
153 * Diagnostic Message Formatting Options:: Controlling how diagnostics should
154                         be formatted.
155 * Warning Options::     How picky should the compiler be?
156 * Debugging Options::   Producing debuggable code.
157 * Optimize Options::    How much optimization?
158 * Instrumentation Options:: Enabling profiling and extra run-time error checking.
159 * Preprocessor Options:: Controlling header files and macro definitions.
160                          Also, getting dependency information for Make.
161 * Assembler Options::   Passing options to the assembler.
162 * Link Options::        Specifying libraries and so on.
163 * Directory Options::   Where to find header files and libraries.
164                         Where to find the compiler executable files.
165 * Code Gen Options::    Specifying conventions for function calls, data layout
166                         and register usage.
167 * Developer Options::   Printing GCC configuration info, statistics, and
168                         debugging dumps.
169 * Submodel Options::    Target-specific options, such as compiling for a
170                         specific processor variant.
171 * Spec Files::          How to pass switches to sub-processes.
172 * Environment Variables:: Env vars that affect GCC.
173 * Precompiled Headers:: Compiling a header once, and using it many times.
174 @end menu
176 @c man begin OPTIONS
178 @node Option Summary
179 @section Option Summary
181 Here is a summary of all the options, grouped by type.  Explanations are
182 in the following sections.
184 @table @emph
185 @item Overall Options
186 @xref{Overall Options,,Options Controlling the Kind of Output}.
187 @gccoptlist{-c  -S  -E  -o @var{file}  -x @var{language}  @gol
188 -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  --version @gol
189 -pass-exit-codes  -pipe  -specs=@var{file}  -wrapper  @gol
190 @@@var{file}  -ffile-prefix-map=@var{old}=@var{new}  @gol
191 -fplugin=@var{file}  -fplugin-arg-@var{name}=@var{arg}  @gol
192 -fdump-ada-spec@r{[}-slim@r{]}  -fada-spec-parent=@var{unit}  -fdump-go-spec=@var{file}}
194 @item C Language Options
195 @xref{C Dialect Options,,Options Controlling C Dialect}.
196 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
197 -fpermitted-flt-eval-methods=@var{standard} @gol
198 -aux-info @var{filename}  -fallow-parameterless-variadic-functions @gol
199 -fno-asm  -fno-builtin  -fno-builtin-@var{function}  -fgimple@gol
200 -fhosted  -ffreestanding  -fopenacc  -fopenmp  -fopenmp-simd @gol
201 -fms-extensions  -fplan9-extensions  -fsso-struct=@var{endianness} @gol
202 -fallow-single-precision  -fcond-mismatch  -flax-vector-conversions @gol
203 -fsigned-bitfields  -fsigned-char @gol
204 -funsigned-bitfields  -funsigned-char}
206 @item C++ Language Options
207 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
208 @gccoptlist{-fabi-version=@var{n}  -fno-access-control @gol
209 -faligned-new=@var{n}  -fargs-in-order=@var{n}  -fcheck-new @gol
210 -fconstexpr-depth=@var{n}  -fconstexpr-loop-limit=@var{n} @gol
211 -fno-elide-constructors @gol
212 -fno-enforce-eh-specs @gol
213 -fno-gnu-keywords @gol
214 -fno-implicit-templates @gol
215 -fno-implicit-inline-templates @gol
216 -fno-implement-inlines  -fms-extensions @gol
217 -fnew-inheriting-ctors @gol
218 -fnew-ttp-matching @gol
219 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
220 -fno-optional-diags  -fpermissive @gol
221 -fno-pretty-templates @gol
222 -frepo  -fno-rtti  -fsized-deallocation @gol
223 -ftemplate-backtrace-limit=@var{n} @gol
224 -ftemplate-depth=@var{n} @gol
225 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
226 -fno-weak  -nostdinc++ @gol
227 -fvisibility-inlines-hidden @gol
228 -fvisibility-ms-compat @gol
229 -fext-numeric-literals @gol
230 -Wabi=@var{n}  -Wabi-tag  -Wconversion-null  -Wctor-dtor-privacy @gol
231 -Wdelete-non-virtual-dtor -Wdeprecated-copy  -Wliteral-suffix @gol
232 -Wmultiple-inheritance @gol
233 -Wnamespaces  -Wnarrowing @gol
234 -Wpessimizing-move  -Wredundant-move @gol
235 -Wnoexcept  -Wnoexcept-type  -Wclass-memaccess @gol
236 -Wnon-virtual-dtor  -Wreorder  -Wregister @gol
237 -Weffc++  -Wstrict-null-sentinel  -Wtemplates @gol
238 -Wno-non-template-friend  -Wold-style-cast @gol
239 -Woverloaded-virtual  -Wno-pmf-conversions @gol
240 -Wsign-promo  -Wvirtual-inheritance}
242 @item Objective-C and Objective-C++ Language Options
243 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
244 Objective-C and Objective-C++ Dialects}.
245 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
246 -fgnu-runtime  -fnext-runtime @gol
247 -fno-nil-receivers @gol
248 -fobjc-abi-version=@var{n} @gol
249 -fobjc-call-cxx-cdtors @gol
250 -fobjc-direct-dispatch @gol
251 -fobjc-exceptions @gol
252 -fobjc-gc @gol
253 -fobjc-nilcheck @gol
254 -fobjc-std=objc1 @gol
255 -fno-local-ivars @gol
256 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
257 -freplace-objc-classes @gol
258 -fzero-link @gol
259 -gen-decls @gol
260 -Wassign-intercept @gol
261 -Wno-protocol  -Wselector @gol
262 -Wstrict-selector-match @gol
263 -Wundeclared-selector}
265 @item Diagnostic Message Formatting Options
266 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
267 @gccoptlist{-fmessage-length=@var{n}  @gol
268 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
269 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
270 -fno-diagnostics-show-option  -fno-diagnostics-show-caret @gol
271 -fno-diagnostics-show-labels -fno-diagnostics-show-line-numbers @gol
272 -fdiagnostics-parseable-fixits  -fdiagnostics-generate-patch @gol
273 -fdiagnostics-show-template-tree -fno-elide-type @gol
274 -fno-show-column}
276 @item Warning Options
277 @xref{Warning Options,,Options to Request or Suppress Warnings}.
278 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
279 -pedantic-errors @gol
280 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Waligned-new @gol
281 -Walloc-zero  -Walloc-size-larger-than=@var{byte-size}
282 -Walloca  -Walloca-larger-than=@var{byte-size} @gol
283 -Wno-aggressive-loop-optimizations  -Warray-bounds  -Warray-bounds=@var{n} @gol
284 -Wno-attributes  -Wbool-compare  -Wbool-operation @gol
285 -Wno-builtin-declaration-mismatch @gol
286 -Wno-builtin-macro-redefined  -Wc90-c99-compat  -Wc99-c11-compat @gol
287 -Wc++-compat  -Wc++11-compat  -Wc++14-compat  -Wc++17-compat  @gol
288 -Wcast-align  -Wcast-align=strict  -Wcast-function-type  -Wcast-qual  @gol
289 -Wchar-subscripts  -Wcatch-value  -Wcatch-value=@var{n} @gol
290 -Wclobbered  -Wcomment  -Wconditionally-supported @gol
291 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wdangling-else  -Wdate-time @gol
292 -Wdelete-incomplete @gol
293 -Wno-deprecated  -Wno-deprecated-declarations  -Wno-designated-init @gol
294 -Wdisabled-optimization @gol
295 -Wno-discarded-qualifiers  -Wno-discarded-array-qualifiers @gol
296 -Wno-div-by-zero  -Wdouble-promotion @gol
297 -Wduplicated-branches  -Wduplicated-cond @gol
298 -Wempty-body  -Wenum-compare  -Wno-endif-labels  -Wexpansion-to-defined @gol
299 -Werror  -Werror=*  -Wextra-semi  -Wfatal-errors @gol
300 -Wfloat-equal  -Wformat  -Wformat=2 @gol
301 -Wno-format-contains-nul  -Wno-format-extra-args  @gol
302 -Wformat-nonliteral -Wformat-overflow=@var{n} @gol
303 -Wformat-security  -Wformat-signedness  -Wformat-truncation=@var{n} @gol
304 -Wformat-y2k  -Wframe-address @gol
305 -Wframe-larger-than=@var{byte-size}  -Wno-free-nonheap-object @gol
306 -Wjump-misses-init @gol
307 -Wif-not-aligned @gol
308 -Wignored-qualifiers  -Wignored-attributes  -Wincompatible-pointer-types @gol
309 -Wimplicit  -Wimplicit-fallthrough  -Wimplicit-fallthrough=@var{n} @gol
310 -Wimplicit-function-declaration  -Wimplicit-int @gol
311 -Winit-self  -Winline  -Wno-int-conversion  -Wint-in-bool-context @gol
312 -Wno-int-to-pointer-cast  -Winvalid-memory-model  -Wno-invalid-offsetof @gol
313 -Winvalid-pch  -Wlarger-than=@var{byte-size} @gol
314 -Wlogical-op  -Wlogical-not-parentheses  -Wlong-long @gol
315 -Wmain  -Wmaybe-uninitialized  -Wmemset-elt-size  -Wmemset-transposed-args @gol
316 -Wmisleading-indentation  -Wmissing-attributes -Wmissing-braces @gol
317 -Wmissing-field-initializers  -Wmissing-include-dirs @gol
318 -Wno-multichar  -Wmultistatement-macros  -Wnonnull  -Wnonnull-compare @gol
319 -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
320 -Wnull-dereference  -Wodr  -Wno-overflow  -Wopenmp-simd  @gol
321 -Woverride-init-side-effects  -Woverlength-strings @gol
322 -Wpacked  -Wpacked-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
323 -Wparentheses  -Wno-pedantic-ms-format @gol
324 -Wplacement-new  -Wplacement-new=@var{n} @gol
325 -Wpointer-arith  -Wpointer-compare  -Wno-pointer-to-int-cast @gol
326 -Wno-pragmas  -Wredundant-decls  -Wrestrict  -Wno-return-local-addr @gol
327 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
328 -Wshadow=global,  -Wshadow=local,  -Wshadow=compatible-local @gol
329 -Wshift-overflow  -Wshift-overflow=@var{n} @gol
330 -Wshift-count-negative  -Wshift-count-overflow  -Wshift-negative-value @gol
331 -Wsign-compare  -Wsign-conversion  -Wfloat-conversion @gol
332 -Wno-scalar-storage-order  -Wsizeof-pointer-div @gol
333 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
334 -Wstack-protector  -Wstack-usage=@var{byte-size}  -Wstrict-aliasing @gol
335 -Wstrict-aliasing=n  -Wstrict-overflow  -Wstrict-overflow=@var{n} @gol
336 -Wstringop-overflow=@var{n} -Wstringop-truncation @gol
337 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}malloc@r{]} @gol
338 -Wsuggest-final-types @gol  -Wsuggest-final-methods  -Wsuggest-override @gol
339 -Wmissing-format-attribute  -Wsubobject-linkage @gol
340 -Wswitch  -Wswitch-bool  -Wswitch-default  -Wswitch-enum @gol
341 -Wswitch-unreachable  -Wsync-nand @gol
342 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
343 -Wtype-limits  -Wundef @gol
344 -Wuninitialized  -Wunknown-pragmas @gol
345 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
346 -Wunused-label  -Wunused-local-typedefs  -Wunused-macros @gol
347 -Wunused-parameter  -Wno-unused-result @gol
348 -Wunused-value  -Wunused-variable @gol
349 -Wunused-const-variable  -Wunused-const-variable=@var{n} @gol
350 -Wunused-but-set-parameter  -Wunused-but-set-variable @gol
351 -Wuseless-cast  -Wvariadic-macros  -Wvector-operation-performance @gol
352 -Wvla  -Wvla-larger-than=@var{byte-size}  -Wvolatile-register-var @gol
353 -Wwrite-strings @gol
354 -Wzero-as-null-pointer-constant  -Whsa}
356 @item C and Objective-C-only Warning Options
357 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
358 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
359 -Wold-style-declaration  -Wold-style-definition @gol
360 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
361 -Wdeclaration-after-statement  -Wpointer-sign}
363 @item Debugging Options
364 @xref{Debugging Options,,Options for Debugging Your Program}.
365 @gccoptlist{-g  -g@var{level}  -gdwarf  -gdwarf-@var{version} @gol
366 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
367 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
368 -gas-loc-support  -gno-as-loc-support @gol
369 -gas-locview-support  -gno-as-locview-support @gol
370 -gcolumn-info  -gno-column-info @gol
371 -gstatement-frontiers  -gno-statement-frontiers @gol
372 -gvariable-location-views  -gno-variable-location-views @gol
373 -ginternal-reset-location-views  -gno-internal-reset-location-views @gol
374 -ginline-points  -gno-inline-points @gol
375 -gvms  -gxcoff  -gxcoff+  -gz@r{[}=@var{type}@r{]} @gol
376 -gsplit-dwarf @gol
377 -fdebug-prefix-map=@var{old}=@var{new}  -fdebug-types-section @gol
378 -fno-eliminate-unused-debug-types @gol
379 -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
380 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
381 -feliminate-unused-debug-symbols  -femit-class-debug-always @gol
382 -fno-merge-debug-strings  -fno-dwarf2-cfi-asm @gol
383 -fvar-tracking  -fvar-tracking-assignments}
385 @item Optimization Options
386 @xref{Optimize Options,,Options that Control Optimization}.
387 @gccoptlist{-faggressive-loop-optimizations @gol
388 -falign-functions[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
389 -falign-jumps[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
390 -falign-labels[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
391 -falign-loops[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
392 -fassociative-math  -fauto-profile  -fauto-profile[=@var{path}] @gol
393 -fauto-inc-dec  -fbranch-probabilities @gol
394 -fbranch-target-load-optimize  -fbranch-target-load-optimize2 @gol
395 -fbtr-bb-exclusive  -fcaller-saves @gol
396 -fcombine-stack-adjustments  -fconserve-stack @gol
397 -fcompare-elim  -fcprop-registers  -fcrossjumping @gol
398 -fcse-follow-jumps  -fcse-skip-blocks  -fcx-fortran-rules @gol
399 -fcx-limited-range @gol
400 -fdata-sections  -fdce  -fdelayed-branch @gol
401 -fdelete-null-pointer-checks  -fdevirtualize  -fdevirtualize-speculatively @gol
402 -fdevirtualize-at-ltrans  -fdse @gol
403 -fearly-inlining  -fipa-sra  -fexpensive-optimizations  -ffat-lto-objects @gol
404 -ffast-math  -ffinite-math-only  -ffloat-store  -fexcess-precision=@var{style} @gol
405 -fforward-propagate  -ffp-contract=@var{style}  -ffunction-sections @gol
406 -fgcse  -fgcse-after-reload  -fgcse-las  -fgcse-lm  -fgraphite-identity @gol
407 -fgcse-sm  -fhoist-adjacent-loads  -fif-conversion @gol
408 -fif-conversion2  -findirect-inlining @gol
409 -finline-functions  -finline-functions-called-once  -finline-limit=@var{n} @gol
410 -finline-small-functions  -fipa-cp  -fipa-cp-clone @gol
411 -fipa-bit-cp -fipa-vrp @gol
412 -fipa-pta  -fipa-profile  -fipa-pure-const  -fipa-reference  -fipa-icf @gol
413 -fira-algorithm=@var{algorithm} @gol
414 -fira-region=@var{region}  -fira-hoist-pressure @gol
415 -fira-loop-pressure  -fno-ira-share-save-slots @gol
416 -fno-ira-share-spill-slots @gol
417 -fisolate-erroneous-paths-dereference  -fisolate-erroneous-paths-attribute @gol
418 -fivopts  -fkeep-inline-functions  -fkeep-static-functions @gol
419 -fkeep-static-consts  -flimit-function-alignment  -flive-range-shrinkage @gol
420 -floop-block  -floop-interchange  -floop-strip-mine @gol
421 -floop-unroll-and-jam  -floop-nest-optimize @gol
422 -floop-parallelize-all  -flra-remat  -flto  -flto-compression-level @gol
423 -flto-partition=@var{alg}  -fmerge-all-constants @gol
424 -fmerge-constants  -fmodulo-sched  -fmodulo-sched-allow-regmoves @gol
425 -fmove-loop-invariants  -fno-branch-count-reg @gol
426 -fno-defer-pop  -fno-fp-int-builtin-inexact  -fno-function-cse @gol
427 -fno-guess-branch-probability  -fno-inline  -fno-math-errno  -fno-peephole @gol
428 -fno-peephole2  -fno-printf-return-value  -fno-sched-interblock @gol
429 -fno-sched-spec  -fno-signed-zeros @gol
430 -fno-toplevel-reorder  -fno-trapping-math  -fno-zero-initialized-in-bss @gol
431 -fomit-frame-pointer  -foptimize-sibling-calls @gol
432 -fpartial-inlining  -fpeel-loops  -fpredictive-commoning @gol
433 -fprefetch-loop-arrays @gol
434 -fprofile-correction @gol
435 -fprofile-use  -fprofile-use=@var{path}  -fprofile-values @gol
436 -fprofile-reorder-functions @gol
437 -freciprocal-math  -free  -frename-registers  -freorder-blocks @gol
438 -freorder-blocks-algorithm=@var{algorithm} @gol
439 -freorder-blocks-and-partition  -freorder-functions @gol
440 -frerun-cse-after-loop  -freschedule-modulo-scheduled-loops @gol
441 -frounding-math  -fsave-optimization-record @gol
442 -fsched2-use-superblocks  -fsched-pressure @gol
443 -fsched-spec-load  -fsched-spec-load-dangerous @gol
444 -fsched-stalled-insns-dep[=@var{n}]  -fsched-stalled-insns[=@var{n}] @gol
445 -fsched-group-heuristic  -fsched-critical-path-heuristic @gol
446 -fsched-spec-insn-heuristic  -fsched-rank-heuristic @gol
447 -fsched-last-insn-heuristic  -fsched-dep-count-heuristic @gol
448 -fschedule-fusion @gol
449 -fschedule-insns  -fschedule-insns2  -fsection-anchors @gol
450 -fselective-scheduling  -fselective-scheduling2 @gol
451 -fsel-sched-pipelining  -fsel-sched-pipelining-outer-loops @gol
452 -fsemantic-interposition  -fshrink-wrap  -fshrink-wrap-separate @gol
453 -fsignaling-nans @gol
454 -fsingle-precision-constant  -fsplit-ivs-in-unroller  -fsplit-loops@gol
455 -fsplit-paths @gol
456 -fsplit-wide-types  -fssa-backprop  -fssa-phiopt @gol
457 -fstdarg-opt  -fstore-merging  -fstrict-aliasing @gol
458 -fthread-jumps  -ftracer  -ftree-bit-ccp @gol
459 -ftree-builtin-call-dce  -ftree-ccp  -ftree-ch @gol
460 -ftree-coalesce-vars  -ftree-copy-prop  -ftree-dce  -ftree-dominator-opts @gol
461 -ftree-dse  -ftree-forwprop  -ftree-fre  -fcode-hoisting @gol
462 -ftree-loop-if-convert  -ftree-loop-im @gol
463 -ftree-phiprop  -ftree-loop-distribution  -ftree-loop-distribute-patterns @gol
464 -ftree-loop-ivcanon  -ftree-loop-linear  -ftree-loop-optimize @gol
465 -ftree-loop-vectorize @gol
466 -ftree-parallelize-loops=@var{n}  -ftree-pre  -ftree-partial-pre  -ftree-pta @gol
467 -ftree-reassoc  -ftree-scev-cprop  -ftree-sink  -ftree-slsr  -ftree-sra @gol
468 -ftree-switch-conversion  -ftree-tail-merge @gol
469 -ftree-ter  -ftree-vectorize  -ftree-vrp  -funconstrained-commons @gol
470 -funit-at-a-time  -funroll-all-loops  -funroll-loops @gol
471 -funsafe-math-optimizations  -funswitch-loops @gol
472 -fipa-ra  -fvariable-expansion-in-unroller  -fvect-cost-model  -fvpt @gol
473 -fweb  -fwhole-program  -fwpa  -fuse-linker-plugin @gol
474 --param @var{name}=@var{value}
475 -O  -O0  -O1  -O2  -O3  -Os  -Ofast  -Og}
477 @item Program Instrumentation Options
478 @xref{Instrumentation Options,,Program Instrumentation Options}.
479 @gccoptlist{-p  -pg  -fprofile-arcs  --coverage  -ftest-coverage @gol
480 -fprofile-abs-path @gol
481 -fprofile-dir=@var{path}  -fprofile-generate  -fprofile-generate=@var{path} @gol
482 -fsanitize=@var{style}  -fsanitize-recover  -fsanitize-recover=@var{style} @gol
483 -fasan-shadow-offset=@var{number}  -fsanitize-sections=@var{s1},@var{s2},... @gol
484 -fsanitize-undefined-trap-on-error  -fbounds-check @gol
485 -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]} @gol
486 -fstack-protector  -fstack-protector-all  -fstack-protector-strong @gol
487 -fstack-protector-explicit  -fstack-check @gol
488 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
489 -fno-stack-limit  -fsplit-stack @gol
490 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
491 -fvtv-counts  -fvtv-debug @gol
492 -finstrument-functions @gol
493 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
494 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}}
496 @item Preprocessor Options
497 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
498 @gccoptlist{-A@var{question}=@var{answer} @gol
499 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
500 -C  -CC  -D@var{macro}@r{[}=@var{defn}@r{]} @gol
501 -dD  -dI  -dM  -dN  -dU @gol
502 -fdebug-cpp  -fdirectives-only  -fdollars-in-identifiers  @gol
503 -fexec-charset=@var{charset}  -fextended-identifiers  @gol
504 -finput-charset=@var{charset} -fmacro-prefix-map=@var{old}=@var{new}  @gol
505 -fno-canonical-system-headers @gol -fpch-deps  -fpch-preprocess  @gol
506 -fpreprocessed -ftabstop=@var{width}  -ftrack-macro-expansion  @gol
507 -fwide-exec-charset=@var{charset}  -fworking-directory @gol
508 -H  -imacros @var{file}  -include @var{file} @gol
509 -M  -MD  -MF  -MG  -MM  -MMD  -MP  -MQ  -MT @gol
510 -no-integrated-cpp  -P  -pthread  -remap @gol
511 -traditional  -traditional-cpp  -trigraphs @gol
512 -U@var{macro}  -undef  @gol
513 -Wp,@var{option}  -Xpreprocessor @var{option}}
515 @item Assembler Options
516 @xref{Assembler Options,,Passing Options to the Assembler}.
517 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
519 @item Linker Options
520 @xref{Link Options,,Options for Linking}.
521 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker}  -l@var{library} @gol
522 -nostartfiles  -nodefaultlibs  -nolibc  -nostdlib @gol
523 -pie  -pthread  -rdynamic @gol
524 -s  -static -static-pie -static-libgcc  -static-libstdc++ @gol
525 -static-libasan  -static-libtsan  -static-liblsan  -static-libubsan @gol
526 -shared  -shared-libgcc  -symbolic @gol
527 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
528 -u @var{symbol}  -z @var{keyword}}
530 @item Directory Options
531 @xref{Directory Options,,Options for Directory Search}.
532 @gccoptlist{-B@var{prefix}  -I@var{dir}  -I- @gol
533 -idirafter @var{dir} @gol
534 -imacros @var{file}  -imultilib @var{dir} @gol
535 -iplugindir=@var{dir}  -iprefix @var{file} @gol
536 -iquote @var{dir}  -isysroot @var{dir}  -isystem @var{dir} @gol
537 -iwithprefix @var{dir}  -iwithprefixbefore @var{dir}  @gol
538 -L@var{dir}  -no-canonical-prefixes  --no-sysroot-suffix @gol
539 -nostdinc  -nostdinc++  --sysroot=@var{dir}}
541 @item Code Generation Options
542 @xref{Code Gen Options,,Options for Code Generation Conventions}.
543 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
544 -ffixed-@var{reg}  -fexceptions @gol
545 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
546 -fasynchronous-unwind-tables @gol
547 -fno-gnu-unique @gol
548 -finhibit-size-directive  -fno-common  -fno-ident @gol
549 -fpcc-struct-return  -fpic  -fPIC  -fpie  -fPIE  -fno-plt @gol
550 -fno-jump-tables @gol
551 -frecord-gcc-switches @gol
552 -freg-struct-return  -fshort-enums  -fshort-wchar @gol
553 -fverbose-asm  -fpack-struct[=@var{n}]  @gol
554 -fleading-underscore  -ftls-model=@var{model} @gol
555 -fstack-reuse=@var{reuse_level} @gol
556 -ftrampolines  -ftrapv  -fwrapv @gol
557 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
558 -fstrict-volatile-bitfields  -fsync-libcalls}
560 @item Developer Options
561 @xref{Developer Options,,GCC Developer Options}.
562 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
563 -dumpfullversion  -fchecking  -fchecking=@var{n}  -fdbg-cnt-list @gol
564 -fdbg-cnt=@var{counter-value-list} @gol
565 -fdisable-ipa-@var{pass_name} @gol
566 -fdisable-rtl-@var{pass_name} @gol
567 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
568 -fdisable-tree-@var{pass_name} @gol
569 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
570 -fdump-debug -fdump-earlydebug @gol
571 -fdump-noaddr  -fdump-unnumbered  -fdump-unnumbered-links @gol
572 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
573 -fdump-final-insns@r{[}=@var{file}@r{]} @gol
574 -fdump-ipa-all  -fdump-ipa-cgraph  -fdump-ipa-inline @gol
575 -fdump-lang-all @gol
576 -fdump-lang-@var{switch} @gol
577 -fdump-lang-@var{switch}-@var{options} @gol
578 -fdump-lang-@var{switch}-@var{options}=@var{filename} @gol
579 -fdump-passes @gol
580 -fdump-rtl-@var{pass}  -fdump-rtl-@var{pass}=@var{filename} @gol
581 -fdump-statistics @gol
582 -fdump-tree-all @gol
583 -fdump-tree-@var{switch} @gol
584 -fdump-tree-@var{switch}-@var{options} @gol
585 -fdump-tree-@var{switch}-@var{options}=@var{filename} @gol
586 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
587 -fenable-@var{kind}-@var{pass} @gol
588 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
589 -fira-verbose=@var{n} @gol
590 -flto-report  -flto-report-wpa  -fmem-report-wpa @gol
591 -fmem-report  -fpre-ipa-mem-report  -fpost-ipa-mem-report @gol
592 -fopt-info  -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
593 -fprofile-report @gol
594 -frandom-seed=@var{string}  -fsched-verbose=@var{n} @gol
595 -fsel-sched-verbose  -fsel-sched-dump-cfg  -fsel-sched-pipelining-verbose @gol
596 -fstats  -fstack-usage  -ftime-report  -ftime-report-details @gol
597 -fvar-tracking-assignments-toggle  -gtoggle @gol
598 -print-file-name=@var{library}  -print-libgcc-file-name @gol
599 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
600 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
601 -print-sysroot  -print-sysroot-headers-suffix @gol
602 -save-temps  -save-temps=cwd  -save-temps=obj  -time@r{[}=@var{file}@r{]}}
604 @item Machine-Dependent Options
605 @xref{Submodel Options,,Machine-Dependent Options}.
606 @c This list is ordered alphanumerically by subsection name.
607 @c Try and put the significant identifier (CPU or system) first,
608 @c so users have a clue at guessing where the ones they want will be.
610 @emph{AArch64 Options}
611 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
612 -mgeneral-regs-only @gol
613 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
614 -mstrict-align -mno-strict-align @gol
615 -momit-leaf-frame-pointer @gol
616 -mtls-dialect=desc  -mtls-dialect=traditional @gol
617 -mtls-size=@var{size} @gol
618 -mfix-cortex-a53-835769  -mfix-cortex-a53-843419 @gol
619 -mlow-precision-recip-sqrt  -mlow-precision-sqrt  -mlow-precision-div @gol
620 -mpc-relative-literal-loads @gol
621 -msign-return-address=@var{scope} @gol
622 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}  @gol
623 -moverride=@var{string}  -mverbose-cost-dump -mtrack-speculation} 
625 @emph{Adapteva Epiphany Options}
626 @gccoptlist{-mhalf-reg-file  -mprefer-short-insn-regs @gol
627 -mbranch-cost=@var{num}  -mcmove  -mnops=@var{num}  -msoft-cmpsf @gol
628 -msplit-lohi  -mpost-inc  -mpost-modify  -mstack-offset=@var{num} @gol
629 -mround-nearest  -mlong-calls  -mshort-calls  -msmall16 @gol
630 -mfp-mode=@var{mode}  -mvect-double  -max-vect-align=@var{num} @gol
631 -msplit-vecmove-early  -m1reg-@var{reg}}
633 @emph{ARC Options}
634 @gccoptlist{-mbarrel-shifter -mjli-always @gol
635 -mcpu=@var{cpu}  -mA6  -mARC600  -mA7  -mARC700 @gol
636 -mdpfp  -mdpfp-compact  -mdpfp-fast  -mno-dpfp-lrsr @gol
637 -mea  -mno-mpy  -mmul32x16  -mmul64  -matomic @gol
638 -mnorm  -mspfp  -mspfp-compact  -mspfp-fast  -msimd  -msoft-float  -mswap @gol
639 -mcrc  -mdsp-packa  -mdvbf  -mlock  -mmac-d16  -mmac-24  -mrtsc  -mswape @gol
640 -mtelephony  -mxy  -misize  -mannotate-align  -marclinux  -marclinux_prof @gol
641 -mlong-calls  -mmedium-calls  -msdata -mirq-ctrl-saved @gol
642 -mrgf-banked-regs -mlpc-width=@var{width} -G @var{num} @gol
643 -mvolatile-cache  -mtp-regno=@var{regno} @gol
644 -malign-call  -mauto-modify-reg  -mbbit-peephole  -mno-brcc @gol
645 -mcase-vector-pcrel  -mcompact-casesi  -mno-cond-exec  -mearly-cbranchsi @gol
646 -mexpand-adddi  -mindexed-loads  -mlra  -mlra-priority-none @gol
647 -mlra-priority-compact mlra-priority-noncompact  -mno-millicode @gol
648 -mmixed-code  -mq-class  -mRcq  -mRcw  -msize-level=@var{level} @gol
649 -mtune=@var{cpu}  -mmultcost=@var{num} @gol
650 -munalign-prob-threshold=@var{probability}  -mmpy-option=@var{multo} @gol
651 -mdiv-rem  -mcode-density  -mll64  -mfpu=@var{fpu} -mrf16}
653 @emph{ARM Options}
654 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
655 -mabi=@var{name} @gol
656 -mapcs-stack-check  -mno-apcs-stack-check @gol
657 -mapcs-reentrant  -mno-apcs-reentrant @gol
658 -msched-prolog  -mno-sched-prolog @gol
659 -mlittle-endian  -mbig-endian @gol
660 -mbe8 -mbe32 @gol
661 -mfloat-abi=@var{name} @gol
662 -mfp16-format=@var{name}
663 -mthumb-interwork  -mno-thumb-interwork @gol
664 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
665 -mtune=@var{name}  -mprint-tune-info @gol
666 -mstructure-size-boundary=@var{n} @gol
667 -mabort-on-noreturn @gol
668 -mlong-calls  -mno-long-calls @gol
669 -msingle-pic-base  -mno-single-pic-base @gol
670 -mpic-register=@var{reg} @gol
671 -mnop-fun-dllimport @gol
672 -mpoke-function-name @gol
673 -mthumb  -marm  -mflip-thumb @gol
674 -mtpcs-frame  -mtpcs-leaf-frame @gol
675 -mcaller-super-interworking  -mcallee-super-interworking @gol
676 -mtp=@var{name}  -mtls-dialect=@var{dialect} @gol
677 -mword-relocations @gol
678 -mfix-cortex-m3-ldrd @gol
679 -munaligned-access @gol
680 -mneon-for-64bits @gol
681 -mslow-flash-data @gol
682 -masm-syntax-unified @gol
683 -mrestrict-it @gol
684 -mverbose-cost-dump @gol
685 -mpure-code @gol
686 -mcmse}
688 @emph{AVR Options}
689 @gccoptlist{-mmcu=@var{mcu}  -mabsdata  -maccumulate-args @gol
690 -mbranch-cost=@var{cost} @gol
691 -mcall-prologues  -mgas-isr-prologues  -mint8 @gol
692 -mn_flash=@var{size}  -mno-interrupts @gol
693 -mmain-is-OS_task -mrelax  -mrmw  -mstrict-X  -mtiny-stack @gol
694 -mfract-convert-truncate @gol
695 -mshort-calls  -nodevicelib @gol
696 -Waddr-space-convert  -Wmisspelled-isr}
698 @emph{Blackfin Options}
699 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
700 -msim  -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
701 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
702 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
703 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
704 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
705 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
706 -mfast-fp  -minline-plt  -mmulticore  -mcorea  -mcoreb  -msdram @gol
707 -micplb}
709 @emph{C6X Options}
710 @gccoptlist{-mbig-endian  -mlittle-endian  -march=@var{cpu} @gol
711 -msim  -msdata=@var{sdata-type}}
713 @emph{CRIS Options}
714 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
715 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
716 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
717 -mstack-align  -mdata-align  -mconst-align @gol
718 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
719 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
720 -mmul-bug-workaround  -mno-mul-bug-workaround}
722 @emph{CR16 Options}
723 @gccoptlist{-mmac @gol
724 -mcr16cplus  -mcr16c @gol
725 -msim  -mint32  -mbit-ops
726 -mdata-model=@var{model}}
728 @emph{C-SKY Options}
729 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu} @gol
730 -mbig-endian  -EB  -mlittle-endian  -EL @gol
731 -mhard-float  -msoft-float  -mfpu=@var{fpu}  -mdouble-float  -mfdivdu @gol
732 -melrw  -mistack  -mmp  -mcp  -mcache  -msecurity  -mtrust @gol
733 -mdsp  -medsp  -mvdsp @gol
734 -mdiv  -msmart  -mhigh-registers  -manchor @gol
735 -mpushpop  -mmultiple-stld  -mconstpool  -mstack-size  -mccrt @gol
736 -mbranch-cost=@var{n}  -mcse-cc  -msched-prolog}
738 @emph{Darwin Options}
739 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
740 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
741 -client_name  -compatibility_version  -current_version @gol
742 -dead_strip @gol
743 -dependency-file  -dylib_file  -dylinker_install_name @gol
744 -dynamic  -dynamiclib  -exported_symbols_list @gol
745 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
746 -force_flat_namespace  -headerpad_max_install_names @gol
747 -iframework @gol
748 -image_base  -init  -install_name  -keep_private_externs @gol
749 -multi_module  -multiply_defined  -multiply_defined_unused @gol
750 -noall_load   -no_dead_strip_inits_and_terms @gol
751 -nofixprebinding  -nomultidefs  -noprebind  -noseglinkedit @gol
752 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
753 -private_bundle  -read_only_relocs  -sectalign @gol
754 -sectobjectsymbols  -whyload  -seg1addr @gol
755 -sectcreate  -sectobjectsymbols  -sectorder @gol
756 -segaddr  -segs_read_only_addr  -segs_read_write_addr @gol
757 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
758 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
759 -single_module  -static  -sub_library  -sub_umbrella @gol
760 -twolevel_namespace  -umbrella  -undefined @gol
761 -unexported_symbols_list  -weak_reference_mismatches @gol
762 -whatsloaded  -F  -gused  -gfull  -mmacosx-version-min=@var{version} @gol
763 -mkernel  -mone-byte-bool}
765 @emph{DEC Alpha Options}
766 @gccoptlist{-mno-fp-regs  -msoft-float @gol
767 -mieee  -mieee-with-inexact  -mieee-conformant @gol
768 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
769 -mtrap-precision=@var{mode}  -mbuild-constants @gol
770 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
771 -mbwx  -mmax  -mfix  -mcix @gol
772 -mfloat-vax  -mfloat-ieee @gol
773 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
774 -msmall-text  -mlarge-text @gol
775 -mmemory-latency=@var{time}}
777 @emph{FR30 Options}
778 @gccoptlist{-msmall-model  -mno-lsim}
780 @emph{FT32 Options}
781 @gccoptlist{-msim  -mlra  -mnodiv  -mft32b  -mcompress  -mnopm}
783 @emph{FRV Options}
784 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
785 -mhard-float  -msoft-float @gol
786 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
787 -mdouble  -mno-double @gol
788 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
789 -mfdpic  -minline-plt  -mgprel-ro  -multilib-library-pic @gol
790 -mlinked-fp  -mlong-calls  -malign-labels @gol
791 -mlibrary-pic  -macc-4  -macc-8 @gol
792 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
793 -moptimize-membar  -mno-optimize-membar @gol
794 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
795 -mvliw-branch  -mno-vliw-branch @gol
796 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
797 -mno-nested-cond-exec  -mtomcat-stats @gol
798 -mTLS  -mtls @gol
799 -mcpu=@var{cpu}}
801 @emph{GNU/Linux Options}
802 @gccoptlist{-mglibc  -muclibc  -mmusl  -mbionic  -mandroid @gol
803 -tno-android-cc  -tno-android-ld}
805 @emph{H8/300 Options}
806 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr  -mno-exr  -mint32  -malign-300}
808 @emph{HPPA Options}
809 @gccoptlist{-march=@var{architecture-type} @gol
810 -mcaller-copies  -mdisable-fpregs  -mdisable-indexing @gol
811 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
812 -mfixed-range=@var{register-range} @gol
813 -mjump-in-delay  -mlinker-opt  -mlong-calls @gol
814 -mlong-load-store  -mno-disable-fpregs @gol
815 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
816 -mno-jump-in-delay  -mno-long-load-store @gol
817 -mno-portable-runtime  -mno-soft-float @gol
818 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
819 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
820 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
821 -munix=@var{unix-std}  -nolibdld  -static  -threads}
823 @emph{IA-64 Options}
824 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
825 -mvolatile-asm-stop  -mregister-names  -msdata  -mno-sdata @gol
826 -mconstant-gp  -mauto-pic  -mfused-madd @gol
827 -minline-float-divide-min-latency @gol
828 -minline-float-divide-max-throughput @gol
829 -mno-inline-float-divide @gol
830 -minline-int-divide-min-latency @gol
831 -minline-int-divide-max-throughput  @gol
832 -mno-inline-int-divide @gol
833 -minline-sqrt-min-latency  -minline-sqrt-max-throughput @gol
834 -mno-inline-sqrt @gol
835 -mdwarf2-asm  -mearly-stop-bits @gol
836 -mfixed-range=@var{register-range}  -mtls-size=@var{tls-size} @gol
837 -mtune=@var{cpu-type}  -milp32  -mlp64 @gol
838 -msched-br-data-spec  -msched-ar-data-spec  -msched-control-spec @gol
839 -msched-br-in-data-spec  -msched-ar-in-data-spec  -msched-in-control-spec @gol
840 -msched-spec-ldc  -msched-spec-control-ldc @gol
841 -msched-prefer-non-data-spec-insns  -msched-prefer-non-control-spec-insns @gol
842 -msched-stop-bits-after-every-cycle  -msched-count-spec-in-critical-path @gol
843 -msel-sched-dont-check-control-spec  -msched-fp-mem-deps-zero-cost @gol
844 -msched-max-memory-insns-hard-limit  -msched-max-memory-insns=@var{max-insns}}
846 @emph{LM32 Options}
847 @gccoptlist{-mbarrel-shift-enabled  -mdivide-enabled  -mmultiply-enabled @gol
848 -msign-extend-enabled  -muser-enabled}
850 @emph{M32R/D Options}
851 @gccoptlist{-m32r2  -m32rx  -m32r @gol
852 -mdebug @gol
853 -malign-loops  -mno-align-loops @gol
854 -missue-rate=@var{number} @gol
855 -mbranch-cost=@var{number} @gol
856 -mmodel=@var{code-size-model-type} @gol
857 -msdata=@var{sdata-type} @gol
858 -mno-flush-func  -mflush-func=@var{name} @gol
859 -mno-flush-trap  -mflush-trap=@var{number} @gol
860 -G @var{num}}
862 @emph{M32C Options}
863 @gccoptlist{-mcpu=@var{cpu}  -msim  -memregs=@var{number}}
865 @emph{M680x0 Options}
866 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
867 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
868 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
869 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
870 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
871 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
872 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
873 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
874 -mxgot  -mno-xgot  -mlong-jump-table-offsets}
876 @emph{MCore Options}
877 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
878 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
879 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
880 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
881 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
883 @emph{MeP Options}
884 @gccoptlist{-mabsdiff  -mall-opts  -maverage  -mbased=@var{n}  -mbitops @gol
885 -mc=@var{n}  -mclip  -mconfig=@var{name}  -mcop  -mcop32  -mcop64  -mivc2 @gol
886 -mdc  -mdiv  -meb  -mel  -mio-volatile  -ml  -mleadz  -mm  -mminmax @gol
887 -mmult  -mno-opts  -mrepeat  -ms  -msatur  -msdram  -msim  -msimnovec  -mtf @gol
888 -mtiny=@var{n}}
890 @emph{MicroBlaze Options}
891 @gccoptlist{-msoft-float  -mhard-float  -msmall-divides  -mcpu=@var{cpu} @gol
892 -mmemcpy  -mxl-soft-mul  -mxl-soft-div  -mxl-barrel-shift @gol
893 -mxl-pattern-compare  -mxl-stack-check  -mxl-gp-opt  -mno-clearbss @gol
894 -mxl-multiply-high  -mxl-float-convert  -mxl-float-sqrt @gol
895 -mbig-endian  -mlittle-endian  -mxl-reorder  -mxl-mode-@var{app-model}
896 -mpic-data-is-text-relative}
898 @emph{MIPS Options}
899 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
900 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
901 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
902 -mips16  -mno-mips16  -mflip-mips16 @gol
903 -minterlink-compressed  -mno-interlink-compressed @gol
904 -minterlink-mips16  -mno-interlink-mips16 @gol
905 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
906 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
907 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
908 -mno-float  -msingle-float  -mdouble-float @gol
909 -modd-spreg  -mno-odd-spreg @gol
910 -mabs=@var{mode}  -mnan=@var{encoding} @gol
911 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
912 -mmcu  -mmno-mcu @gol
913 -meva  -mno-eva @gol
914 -mvirt  -mno-virt @gol
915 -mxpa  -mno-xpa @gol
916 -mcrc -mno-crc @gol
917 -mginv -mno-ginv @gol
918 -mmicromips  -mno-micromips @gol
919 -mmsa  -mno-msa @gol
920 -mfpu=@var{fpu-type} @gol
921 -msmartmips  -mno-smartmips @gol
922 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
923 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
924 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
925 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
926 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
927 -membedded-data  -mno-embedded-data @gol
928 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
929 -mcode-readable=@var{setting} @gol
930 -msplit-addresses  -mno-split-addresses @gol
931 -mexplicit-relocs  -mno-explicit-relocs @gol
932 -mcheck-zero-division  -mno-check-zero-division @gol
933 -mdivide-traps  -mdivide-breaks @gol
934 -mload-store-pairs  -mno-load-store-pairs @gol
935 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
936 -mmad  -mno-mad  -mimadd  -mno-imadd  -mfused-madd  -mno-fused-madd  -nocpp @gol
937 -mfix-24k  -mno-fix-24k @gol
938 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
939 -mfix-r10000  -mno-fix-r10000  -mfix-rm7000  -mno-fix-rm7000 @gol
940 -mfix-vr4120  -mno-fix-vr4120 @gol
941 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
942 -mflush-func=@var{func}  -mno-flush-func @gol
943 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
944 -mcompact-branches=@var{policy} @gol
945 -mfp-exceptions  -mno-fp-exceptions @gol
946 -mvr4130-align  -mno-vr4130-align  -msynci  -mno-synci @gol
947 -mlxc1-sxc1 -mno-lxc1-sxc1 -mmadd4 -mno-madd4 @gol
948 -mrelax-pic-calls  -mno-relax-pic-calls  -mmcount-ra-address @gol
949 -mframe-header-opt  -mno-frame-header-opt}
951 @emph{MMIX Options}
952 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
953 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
954 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
955 -mno-base-addresses  -msingle-exit  -mno-single-exit}
957 @emph{MN10300 Options}
958 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
959 -mno-am33  -mam33  -mam33-2  -mam34 @gol
960 -mtune=@var{cpu-type} @gol
961 -mreturn-pointer-on-d0 @gol
962 -mno-crt0  -mrelax  -mliw  -msetlb}
964 @emph{Moxie Options}
965 @gccoptlist{-meb  -mel  -mmul.x  -mno-crt0}
967 @emph{MSP430 Options}
968 @gccoptlist{-msim  -masm-hex  -mmcu=  -mcpu=  -mlarge  -msmall  -mrelax @gol
969 -mwarn-mcu @gol
970 -mcode-region=  -mdata-region= @gol
971 -msilicon-errata=  -msilicon-errata-warn= @gol
972 -mhwmult=  -minrt}
974 @emph{NDS32 Options}
975 @gccoptlist{-mbig-endian  -mlittle-endian @gol
976 -mreduced-regs  -mfull-regs @gol
977 -mcmov  -mno-cmov @gol
978 -mext-perf  -mno-ext-perf @gol
979 -mext-perf2  -mno-ext-perf2 @gol
980 -mext-string  -mno-ext-string @gol
981 -mv3push  -mno-v3push @gol
982 -m16bit  -mno-16bit @gol
983 -misr-vector-size=@var{num} @gol
984 -mcache-block-size=@var{num} @gol
985 -march=@var{arch} @gol
986 -mcmodel=@var{code-model} @gol
987 -mctor-dtor  -mrelax}
989 @emph{Nios II Options}
990 @gccoptlist{-G @var{num}  -mgpopt=@var{option}  -mgpopt  -mno-gpopt @gol
991 -mgprel-sec=@var{regexp} -mr0rel-sec=@var{regexp} @gol
992 -mel  -meb @gol
993 -mno-bypass-cache  -mbypass-cache @gol
994 -mno-cache-volatile  -mcache-volatile @gol
995 -mno-fast-sw-div  -mfast-sw-div @gol
996 -mhw-mul  -mno-hw-mul  -mhw-mulx  -mno-hw-mulx  -mno-hw-div  -mhw-div @gol
997 -mcustom-@var{insn}=@var{N}  -mno-custom-@var{insn} @gol
998 -mcustom-fpu-cfg=@var{name} @gol
999 -mhal  -msmallc  -msys-crt0=@var{name}  -msys-lib=@var{name} @gol
1000 -march=@var{arch}  -mbmx  -mno-bmx  -mcdx  -mno-cdx}
1002 @emph{Nvidia PTX Options}
1003 @gccoptlist{-m32  -m64  -mmainkernel  -moptimize}
1005 @emph{PDP-11 Options}
1006 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
1007 -mint32  -mno-int16 -mint16  -mno-int32 @gol
1008 -mfloat32  -mno-float64 -mfloat64  -mno-float32 @gol
1009 -msplit -munix-asm  -mdec-asm -mgnu-asm}
1011 @emph{picoChip Options}
1012 @gccoptlist{-mae=@var{ae_type}  -mvliw-lookahead=@var{N} @gol
1013 -msymbol-as-address  -mno-inefficient-warnings}
1015 @emph{PowerPC Options}
1016 See RS/6000 and PowerPC Options.
1018 @emph{PowerPC SPE Options}
1019 @gccoptlist{-mcpu=@var{cpu-type} @gol
1020 -mtune=@var{cpu-type} @gol
1021 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb @gol
1022 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
1023 -m32  -mxl-compat  -mno-xl-compat @gol
1024 -malign-power  -malign-natural @gol
1025 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
1026 -msingle-float  -mdouble-float @gol
1027 -mupdate  -mno-update @gol
1028 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
1029 -mstrict-align  -mno-strict-align  -mrelocatable @gol
1030 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
1031 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
1032 -msingle-pic-base @gol
1033 -mprioritize-restricted-insns=@var{priority} @gol
1034 -msched-costly-dep=@var{dependence_type} @gol
1035 -minsert-sched-nops=@var{scheme} @gol
1036 -mcall-sysv  -mcall-netbsd @gol
1037 -maix-struct-return  -msvr4-struct-return @gol
1038 -mabi=@var{abi-type}  -msecure-plt  -mbss-plt @gol
1039 -mblock-move-inline-limit=@var{num} @gol
1040 -misel  -mno-isel @gol
1041 -misel=yes  -misel=no @gol
1042 -mspe  -mno-spe @gol
1043 -mspe=yes  -mspe=no @gol
1044 -mfloat-gprs=yes  -mfloat-gprs=no  -mfloat-gprs=single  -mfloat-gprs=double @gol
1045 -mprototype  -mno-prototype @gol
1046 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
1047 -msdata=@var{opt}  -mvxworks  -G @var{num} @gol
1048 -mrecip  -mrecip=@var{opt}  -mno-recip  -mrecip-precision @gol
1049 -mno-recip-precision @gol
1050 -mpointers-to-nested-functions  -mno-pointers-to-nested-functions @gol
1051 -msave-toc-indirect  -mno-save-toc-indirect @gol
1052 -mcompat-align-parm  -mno-compat-align-parm @gol
1053 -mfloat128  -mno-float128 @gol
1054 -mgnu-attribute  -mno-gnu-attribute @gol
1055 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
1056 -mstack-protector-guard-offset=@var{offset}}
1058 @emph{RISC-V Options}
1059 @gccoptlist{-mbranch-cost=@var{N-instruction} @gol
1060 -mplt  -mno-plt @gol
1061 -mabi=@var{ABI-string} @gol
1062 -mfdiv  -mno-fdiv @gol
1063 -mdiv  -mno-div @gol
1064 -march=@var{ISA-string} @gol
1065 -mtune=@var{processor-string} @gol
1066 -mpreferred-stack-boundary=@var{num} @gol
1067 -msmall-data-limit=@var{N-bytes} @gol
1068 -msave-restore  -mno-save-restore @gol
1069 -mstrict-align -mno-strict-align @gol
1070 -mcmodel=medlow -mcmodel=medany @gol
1071 -mexplicit-relocs  -mno-explicit-relocs @gol
1072 -mrelax -mno-relax @gol}
1074 @emph{RL78 Options}
1075 @gccoptlist{-msim  -mmul=none  -mmul=g13  -mmul=g14  -mallregs @gol
1076 -mcpu=g10  -mcpu=g13  -mcpu=g14  -mg10  -mg13  -mg14 @gol
1077 -m64bit-doubles  -m32bit-doubles  -msave-mduc-in-interrupts}
1079 @emph{RS/6000 and PowerPC Options}
1080 @gccoptlist{-mcpu=@var{cpu-type} @gol
1081 -mtune=@var{cpu-type} @gol
1082 -mcmodel=@var{code-model} @gol
1083 -mpowerpc64 @gol
1084 -maltivec  -mno-altivec @gol
1085 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
1086 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
1087 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mpopcntd  -mno-popcntd @gol
1088 -mfprnd  -mno-fprnd @gol
1089 -mcmpb  -mno-cmpb  -mmfpgpr  -mno-mfpgpr  -mhard-dfp  -mno-hard-dfp @gol
1090 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
1091 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
1092 -malign-power  -malign-natural @gol
1093 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
1094 -mupdate  -mno-update @gol
1095 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
1096 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
1097 -mstrict-align  -mno-strict-align  -mrelocatable @gol
1098 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
1099 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
1100 -mdynamic-no-pic  -maltivec  -mswdiv  -msingle-pic-base @gol
1101 -mprioritize-restricted-insns=@var{priority} @gol
1102 -msched-costly-dep=@var{dependence_type} @gol
1103 -minsert-sched-nops=@var{scheme} @gol
1104 -mcall-aixdesc  -mcall-eabi  -mcall-freebsd  @gol
1105 -mcall-linux  -mcall-netbsd  -mcall-openbsd  @gol
1106 -mcall-sysv  -mcall-sysv-eabi  -mcall-sysv-noeabi @gol
1107 -mtraceback=@var{traceback_type} @gol
1108 -maix-struct-return  -msvr4-struct-return @gol
1109 -mabi=@var{abi-type}  -msecure-plt  -mbss-plt @gol
1110 -mblock-move-inline-limit=@var{num} @gol
1111 -mblock-compare-inline-limit=@var{num} @gol
1112 -mblock-compare-inline-loop-limit=@var{num} @gol
1113 -mstring-compare-inline-limit=@var{num} @gol
1114 -misel  -mno-isel @gol
1115 -misel=yes  -misel=no @gol
1116 -mvrsave  -mno-vrsave @gol
1117 -mmulhw  -mno-mulhw @gol
1118 -mdlmzb  -mno-dlmzb @gol
1119 -mprototype  -mno-prototype @gol
1120 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
1121 -msdata=@var{opt}  -mreadonly-in-sdata  -mvxworks  -G @var{num} @gol
1122 -mrecip  -mrecip=@var{opt}  -mno-recip  -mrecip-precision @gol
1123 -mno-recip-precision @gol
1124 -mveclibabi=@var{type}  -mfriz  -mno-friz @gol
1125 -mpointers-to-nested-functions  -mno-pointers-to-nested-functions @gol
1126 -msave-toc-indirect  -mno-save-toc-indirect @gol
1127 -mpower8-fusion  -mno-mpower8-fusion  -mpower8-vector  -mno-power8-vector @gol
1128 -mcrypto  -mno-crypto  -mhtm  -mno-htm @gol
1129 -mquad-memory  -mno-quad-memory @gol
1130 -mquad-memory-atomic  -mno-quad-memory-atomic @gol
1131 -mcompat-align-parm  -mno-compat-align-parm @gol
1132 -mfloat128  -mno-float128  -mfloat128-hardware  -mno-float128-hardware @gol
1133 -mgnu-attribute  -mno-gnu-attribute @gol
1134 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
1135 -mstack-protector-guard-offset=@var{offset}}
1137 @emph{RX Options}
1138 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
1139 -mcpu=@gol
1140 -mbig-endian-data  -mlittle-endian-data @gol
1141 -msmall-data @gol
1142 -msim  -mno-sim@gol
1143 -mas100-syntax  -mno-as100-syntax@gol
1144 -mrelax@gol
1145 -mmax-constant-size=@gol
1146 -mint-register=@gol
1147 -mpid@gol
1148 -mallow-string-insns  -mno-allow-string-insns@gol
1149 -mjsr@gol
1150 -mno-warn-multiple-fast-interrupts@gol
1151 -msave-acc-in-interrupts}
1153 @emph{S/390 and zSeries Options}
1154 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1155 -mhard-float  -msoft-float  -mhard-dfp  -mno-hard-dfp @gol
1156 -mlong-double-64  -mlong-double-128 @gol
1157 -mbackchain  -mno-backchain  -mpacked-stack  -mno-packed-stack @gol
1158 -msmall-exec  -mno-small-exec  -mmvcle  -mno-mvcle @gol
1159 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
1160 -mhtm  -mvx  -mzvector @gol
1161 -mtpf-trace  -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
1162 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size  -mstack-guard @gol
1163 -mhotpatch=@var{halfwords},@var{halfwords}}
1165 @emph{Score Options}
1166 @gccoptlist{-meb  -mel @gol
1167 -mnhwloop @gol
1168 -muls @gol
1169 -mmac @gol
1170 -mscore5  -mscore5u  -mscore7  -mscore7d}
1172 @emph{SH Options}
1173 @gccoptlist{-m1  -m2  -m2e @gol
1174 -m2a-nofpu  -m2a-single-only  -m2a-single  -m2a @gol
1175 -m3  -m3e @gol
1176 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
1177 -m4a-nofpu  -m4a-single-only  -m4a-single  -m4a  -m4al @gol
1178 -mb  -ml  -mdalign  -mrelax @gol
1179 -mbigtable  -mfmovd  -mrenesas  -mno-renesas  -mnomacsave @gol
1180 -mieee  -mno-ieee  -mbitops  -misize  -minline-ic_invalidate  -mpadstruct @gol
1181 -mprefergot  -musermode  -multcost=@var{number}  -mdiv=@var{strategy} @gol
1182 -mdivsi3_libfunc=@var{name}  -mfixed-range=@var{register-range} @gol
1183 -maccumulate-outgoing-args @gol
1184 -matomic-model=@var{atomic-model} @gol
1185 -mbranch-cost=@var{num}  -mzdcbranch  -mno-zdcbranch @gol
1186 -mcbranch-force-delay-slot @gol
1187 -mfused-madd  -mno-fused-madd  -mfsca  -mno-fsca  -mfsrra  -mno-fsrra @gol
1188 -mpretend-cmove  -mtas}
1190 @emph{Solaris 2 Options}
1191 @gccoptlist{-mclear-hwcap  -mno-clear-hwcap  -mimpure-text  -mno-impure-text @gol
1192 -pthreads}
1194 @emph{SPARC Options}
1195 @gccoptlist{-mcpu=@var{cpu-type} @gol
1196 -mtune=@var{cpu-type} @gol
1197 -mcmodel=@var{code-model} @gol
1198 -mmemory-model=@var{mem-model} @gol
1199 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1200 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1201 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1202 -mhard-quad-float  -msoft-quad-float @gol
1203 -mstack-bias  -mno-stack-bias @gol
1204 -mstd-struct-return  -mno-std-struct-return @gol
1205 -munaligned-doubles  -mno-unaligned-doubles @gol
1206 -muser-mode  -mno-user-mode @gol
1207 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1208 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1209 -mvis4 -mno-vis4 -mvis4b -mno-vis4b @gol
1210 -mcbcond  -mno-cbcond  -mfmaf  -mno-fmaf  -mfsmuld  -mno-fsmuld  @gol
1211 -mpopc  -mno-popc  -msubxc  -mno-subxc @gol
1212 -mfix-at697f  -mfix-ut699  -mfix-ut700  -mfix-gr712rc @gol
1213 -mlra  -mno-lra}
1215 @emph{SPU Options}
1216 @gccoptlist{-mwarn-reloc  -merror-reloc @gol
1217 -msafe-dma  -munsafe-dma @gol
1218 -mbranch-hints @gol
1219 -msmall-mem  -mlarge-mem  -mstdmain @gol
1220 -mfixed-range=@var{register-range} @gol
1221 -mea32  -mea64 @gol
1222 -maddress-space-conversion  -mno-address-space-conversion @gol
1223 -mcache-size=@var{cache-size} @gol
1224 -matomic-updates  -mno-atomic-updates}
1226 @emph{System V Options}
1227 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1229 @emph{TILE-Gx Options}
1230 @gccoptlist{-mcpu=CPU  -m32  -m64  -mbig-endian  -mlittle-endian @gol
1231 -mcmodel=@var{code-model}}
1233 @emph{TILEPro Options}
1234 @gccoptlist{-mcpu=@var{cpu}  -m32}
1236 @emph{V850 Options}
1237 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1238 -mprolog-function  -mno-prolog-function  -mspace @gol
1239 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1240 -mapp-regs  -mno-app-regs @gol
1241 -mdisable-callt  -mno-disable-callt @gol
1242 -mv850e2v3  -mv850e2  -mv850e1  -mv850es @gol
1243 -mv850e  -mv850  -mv850e3v5 @gol
1244 -mloop @gol
1245 -mrelax @gol
1246 -mlong-jumps @gol
1247 -msoft-float @gol
1248 -mhard-float @gol
1249 -mgcc-abi @gol
1250 -mrh850-abi @gol
1251 -mbig-switch}
1253 @emph{VAX Options}
1254 @gccoptlist{-mg  -mgnu  -munix}
1256 @emph{Visium Options}
1257 @gccoptlist{-mdebug  -msim  -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1258 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type}  -msv-mode  -muser-mode}
1260 @emph{VMS Options}
1261 @gccoptlist{-mvms-return-codes  -mdebug-main=@var{prefix}  -mmalloc64 @gol
1262 -mpointer-size=@var{size}}
1264 @emph{VxWorks Options}
1265 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1266 -Xbind-lazy  -Xbind-now}
1268 @emph{x86 Options}
1269 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1270 -mtune-ctrl=@var{feature-list}  -mdump-tune-features  -mno-default @gol
1271 -mfpmath=@var{unit} @gol
1272 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1273 -mno-fp-ret-in-387  -m80387  -mhard-float  -msoft-float @gol
1274 -mno-wide-multiply  -mrtd  -malign-double @gol
1275 -mpreferred-stack-boundary=@var{num} @gol
1276 -mincoming-stack-boundary=@var{num} @gol
1277 -mcld  -mcx16  -msahf  -mmovbe  -mcrc32 @gol
1278 -mrecip  -mrecip=@var{opt} @gol
1279 -mvzeroupper  -mprefer-avx128 -mprefer-vector-width=@var{opt} @gol
1280 -mmmx  -msse  -msse2  -msse3  -mssse3  -msse4.1  -msse4.2  -msse4  -mavx @gol
1281 -mavx2  -mavx512f  -mavx512pf  -mavx512er  -mavx512cd  -mavx512vl @gol
1282 -mavx512bw  -mavx512dq  -mavx512ifma  -mavx512vbmi  -msha  -maes @gol
1283 -mpclmul  -mfsgsbase  -mrdrnd  -mf16c  -mfma -mpconfig -mwbnoinvd @gol
1284 -mprefetchwt1  -mclflushopt  -mxsavec  -mxsaves @gol
1285 -msse4a  -m3dnow  -m3dnowa  -mpopcnt  -mabm  -mbmi  -mtbm  -mfma4  -mxop @gol
1286 -mlzcnt  -mbmi2  -mfxsr  -mxsave  -mxsaveopt  -mrtm  -mlwp @gol
1287 -mmwaitx  -mclzero  -mpku  -mthreads -mgfni  -mvaes  -mwaitpkg @gol
1288 -mshstk -mforce-indirect-call -mavx512vbmi2 @gol
1289 -mvpclmulqdq -mavx512bitalg -mmovdiri -mmovdir64b -mavx512vpopcntdq
1290 -mcldemote @gol
1291 -mms-bitfields  -mno-align-stringops  -minline-all-stringops @gol
1292 -minline-stringops-dynamically  -mstringop-strategy=@var{alg} @gol
1293 -mmemcpy-strategy=@var{strategy}  -mmemset-strategy=@var{strategy} @gol
1294 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1295 -m96bit-long-double  -mlong-double-64  -mlong-double-80  -mlong-double-128 @gol
1296 -mregparm=@var{num}  -msseregparm @gol
1297 -mveclibabi=@var{type}  -mvect8-ret-in-mem @gol
1298 -mpc32  -mpc64  -mpc80  -mstackrealign @gol
1299 -momit-leaf-frame-pointer  -mno-red-zone  -mno-tls-direct-seg-refs @gol
1300 -mcmodel=@var{code-model}  -mabi=@var{name}  -maddress-mode=@var{mode} @gol
1301 -m32  -m64  -mx32  -m16  -miamcu  -mlarge-data-threshold=@var{num} @gol
1302 -msse2avx  -mfentry  -mrecord-mcount  -mnop-mcount  -m8bit-idiv @gol
1303 -mavx256-split-unaligned-load  -mavx256-split-unaligned-store @gol
1304 -malign-data=@var{type}  -mstack-protector-guard=@var{guard} @gol
1305 -mstack-protector-guard-reg=@var{reg} @gol
1306 -mstack-protector-guard-offset=@var{offset} @gol
1307 -mstack-protector-guard-symbol=@var{symbol} @gol
1308 -mgeneral-regs-only -mcall-ms2sysv-xlogues @gol
1309 -mindirect-branch=@var{choice} -mfunction-return=@var{choice} @gol
1310 -mindirect-branch-register}
1312 @emph{x86 Windows Options}
1313 @gccoptlist{-mconsole  -mcygwin  -mno-cygwin  -mdll @gol
1314 -mnop-fun-dllimport  -mthread @gol
1315 -municode  -mwin32  -mwindows  -fno-set-stack-executable}
1317 @emph{Xstormy16 Options}
1318 @gccoptlist{-msim}
1320 @emph{Xtensa Options}
1321 @gccoptlist{-mconst16  -mno-const16 @gol
1322 -mfused-madd  -mno-fused-madd @gol
1323 -mforce-no-pic @gol
1324 -mserialize-volatile  -mno-serialize-volatile @gol
1325 -mtext-section-literals  -mno-text-section-literals @gol
1326 -mauto-litpools  -mno-auto-litpools @gol
1327 -mtarget-align  -mno-target-align @gol
1328 -mlongcalls  -mno-longcalls}
1330 @emph{zSeries Options}
1331 See S/390 and zSeries Options.
1332 @end table
1335 @node Overall Options
1336 @section Options Controlling the Kind of Output
1338 Compilation can involve up to four stages: preprocessing, compilation
1339 proper, assembly and linking, always in that order.  GCC is capable of
1340 preprocessing and compiling several files either into several
1341 assembler input files, or into one assembler input file; then each
1342 assembler input file produces an object file, and linking combines all
1343 the object files (those newly compiled, and those specified as input)
1344 into an executable file.
1346 @cindex file name suffix
1347 For any given input file, the file name suffix determines what kind of
1348 compilation is done:
1350 @table @gcctabopt
1351 @item @var{file}.c
1352 C source code that must be preprocessed.
1354 @item @var{file}.i
1355 C source code that should not be preprocessed.
1357 @item @var{file}.ii
1358 C++ source code that should not be preprocessed.
1360 @item @var{file}.m
1361 Objective-C source code.  Note that you must link with the @file{libobjc}
1362 library to make an Objective-C program work.
1364 @item @var{file}.mi
1365 Objective-C source code that should not be preprocessed.
1367 @item @var{file}.mm
1368 @itemx @var{file}.M
1369 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1370 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1371 to a literal capital M@.
1373 @item @var{file}.mii
1374 Objective-C++ source code that should not be preprocessed.
1376 @item @var{file}.h
1377 C, C++, Objective-C or Objective-C++ header file to be turned into a
1378 precompiled header (default), or C, C++ header file to be turned into an
1379 Ada spec (via the @option{-fdump-ada-spec} switch).
1381 @item @var{file}.cc
1382 @itemx @var{file}.cp
1383 @itemx @var{file}.cxx
1384 @itemx @var{file}.cpp
1385 @itemx @var{file}.CPP
1386 @itemx @var{file}.c++
1387 @itemx @var{file}.C
1388 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1389 the last two letters must both be literally @samp{x}.  Likewise,
1390 @samp{.C} refers to a literal capital C@.
1392 @item @var{file}.mm
1393 @itemx @var{file}.M
1394 Objective-C++ source code that must be preprocessed.
1396 @item @var{file}.mii
1397 Objective-C++ source code that should not be preprocessed.
1399 @item @var{file}.hh
1400 @itemx @var{file}.H
1401 @itemx @var{file}.hp
1402 @itemx @var{file}.hxx
1403 @itemx @var{file}.hpp
1404 @itemx @var{file}.HPP
1405 @itemx @var{file}.h++
1406 @itemx @var{file}.tcc
1407 C++ header file to be turned into a precompiled header or Ada spec.
1409 @item @var{file}.f
1410 @itemx @var{file}.for
1411 @itemx @var{file}.ftn
1412 Fixed form Fortran source code that should not be preprocessed.
1414 @item @var{file}.F
1415 @itemx @var{file}.FOR
1416 @itemx @var{file}.fpp
1417 @itemx @var{file}.FPP
1418 @itemx @var{file}.FTN
1419 Fixed form Fortran source code that must be preprocessed (with the traditional
1420 preprocessor).
1422 @item @var{file}.f90
1423 @itemx @var{file}.f95
1424 @itemx @var{file}.f03
1425 @itemx @var{file}.f08
1426 Free form Fortran source code that should not be preprocessed.
1428 @item @var{file}.F90
1429 @itemx @var{file}.F95
1430 @itemx @var{file}.F03
1431 @itemx @var{file}.F08
1432 Free form Fortran source code that must be preprocessed (with the
1433 traditional preprocessor).
1435 @item @var{file}.go
1436 Go source code.
1438 @item @var{file}.brig
1439 BRIG files (binary representation of HSAIL).
1441 @item @var{file}.ads
1442 Ada source code file that contains a library unit declaration (a
1443 declaration of a package, subprogram, or generic, or a generic
1444 instantiation), or a library unit renaming declaration (a package,
1445 generic, or subprogram renaming declaration).  Such files are also
1446 called @dfn{specs}.
1448 @item @var{file}.adb
1449 Ada source code file containing a library unit body (a subprogram or
1450 package body).  Such files are also called @dfn{bodies}.
1452 @c GCC also knows about some suffixes for languages not yet included:
1453 @c Pascal:
1454 @c @var{file}.p
1455 @c @var{file}.pas
1456 @c Ratfor:
1457 @c @var{file}.r
1459 @item @var{file}.s
1460 Assembler code.
1462 @item @var{file}.S
1463 @itemx @var{file}.sx
1464 Assembler code that must be preprocessed.
1466 @item @var{other}
1467 An object file to be fed straight into linking.
1468 Any file name with no recognized suffix is treated this way.
1469 @end table
1471 @opindex x
1472 You can specify the input language explicitly with the @option{-x} option:
1474 @table @gcctabopt
1475 @item -x @var{language}
1476 Specify explicitly the @var{language} for the following input files
1477 (rather than letting the compiler choose a default based on the file
1478 name suffix).  This option applies to all following input files until
1479 the next @option{-x} option.  Possible values for @var{language} are:
1480 @smallexample
1481 c  c-header  cpp-output
1482 c++  c++-header  c++-cpp-output
1483 objective-c  objective-c-header  objective-c-cpp-output
1484 objective-c++ objective-c++-header objective-c++-cpp-output
1485 assembler  assembler-with-cpp
1487 f77  f77-cpp-input f95  f95-cpp-input
1489 brig
1490 @end smallexample
1492 @item -x none
1493 Turn off any specification of a language, so that subsequent files are
1494 handled according to their file name suffixes (as they are if @option{-x}
1495 has not been used at all).
1496 @end table
1498 If you only want some of the stages of compilation, you can use
1499 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1500 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1501 @command{gcc} is to stop.  Note that some combinations (for example,
1502 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1504 @table @gcctabopt
1505 @item -c
1506 @opindex c
1507 Compile or assemble the source files, but do not link.  The linking
1508 stage simply is not done.  The ultimate output is in the form of an
1509 object file for each source file.
1511 By default, the object file name for a source file is made by replacing
1512 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1514 Unrecognized input files, not requiring compilation or assembly, are
1515 ignored.
1517 @item -S
1518 @opindex S
1519 Stop after the stage of compilation proper; do not assemble.  The output
1520 is in the form of an assembler code file for each non-assembler input
1521 file specified.
1523 By default, the assembler file name for a source file is made by
1524 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1526 Input files that don't require compilation are ignored.
1528 @item -E
1529 @opindex E
1530 Stop after the preprocessing stage; do not run the compiler proper.  The
1531 output is in the form of preprocessed source code, which is sent to the
1532 standard output.
1534 Input files that don't require preprocessing are ignored.
1536 @cindex output file option
1537 @item -o @var{file}
1538 @opindex o
1539 Place output in file @var{file}.  This applies to whatever
1540 sort of output is being produced, whether it be an executable file,
1541 an object file, an assembler file or preprocessed C code.
1543 If @option{-o} is not specified, the default is to put an executable
1544 file in @file{a.out}, the object file for
1545 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1546 assembler file in @file{@var{source}.s}, a precompiled header file in
1547 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1548 standard output.
1550 @item -v
1551 @opindex v
1552 Print (on standard error output) the commands executed to run the stages
1553 of compilation.  Also print the version number of the compiler driver
1554 program and of the preprocessor and the compiler proper.
1556 @item -###
1557 @opindex ###
1558 Like @option{-v} except the commands are not executed and arguments
1559 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1560 This is useful for shell scripts to capture the driver-generated command lines.
1562 @item --help
1563 @opindex help
1564 Print (on the standard output) a description of the command-line options
1565 understood by @command{gcc}.  If the @option{-v} option is also specified
1566 then @option{--help} is also passed on to the various processes
1567 invoked by @command{gcc}, so that they can display the command-line options
1568 they accept.  If the @option{-Wextra} option has also been specified
1569 (prior to the @option{--help} option), then command-line options that
1570 have no documentation associated with them are also displayed.
1572 @item --target-help
1573 @opindex target-help
1574 Print (on the standard output) a description of target-specific command-line
1575 options for each tool.  For some targets extra target-specific
1576 information may also be printed.
1578 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1579 Print (on the standard output) a description of the command-line
1580 options understood by the compiler that fit into all specified classes
1581 and qualifiers.  These are the supported classes:
1583 @table @asis
1584 @item @samp{optimizers}
1585 Display all of the optimization options supported by the
1586 compiler.
1588 @item @samp{warnings}
1589 Display all of the options controlling warning messages
1590 produced by the compiler.
1592 @item @samp{target}
1593 Display target-specific options.  Unlike the
1594 @option{--target-help} option however, target-specific options of the
1595 linker and assembler are not displayed.  This is because those
1596 tools do not currently support the extended @option{--help=} syntax.
1598 @item @samp{params}
1599 Display the values recognized by the @option{--param}
1600 option.
1602 @item @var{language}
1603 Display the options supported for @var{language}, where
1604 @var{language} is the name of one of the languages supported in this
1605 version of GCC@.
1607 @item @samp{common}
1608 Display the options that are common to all languages.
1609 @end table
1611 These are the supported qualifiers:
1613 @table @asis
1614 @item @samp{undocumented}
1615 Display only those options that are undocumented.
1617 @item @samp{joined}
1618 Display options taking an argument that appears after an equal
1619 sign in the same continuous piece of text, such as:
1620 @samp{--help=target}.
1622 @item @samp{separate}
1623 Display options taking an argument that appears as a separate word
1624 following the original option, such as: @samp{-o output-file}.
1625 @end table
1627 Thus for example to display all the undocumented target-specific
1628 switches supported by the compiler, use:
1630 @smallexample
1631 --help=target,undocumented
1632 @end smallexample
1634 The sense of a qualifier can be inverted by prefixing it with the
1635 @samp{^} character, so for example to display all binary warning
1636 options (i.e., ones that are either on or off and that do not take an
1637 argument) that have a description, use:
1639 @smallexample
1640 --help=warnings,^joined,^undocumented
1641 @end smallexample
1643 The argument to @option{--help=} should not consist solely of inverted
1644 qualifiers.
1646 Combining several classes is possible, although this usually
1647 restricts the output so much that there is nothing to display.  One
1648 case where it does work, however, is when one of the classes is
1649 @var{target}.  For example, to display all the target-specific
1650 optimization options, use:
1652 @smallexample
1653 --help=target,optimizers
1654 @end smallexample
1656 The @option{--help=} option can be repeated on the command line.  Each
1657 successive use displays its requested class of options, skipping
1658 those that have already been displayed.
1660 If the @option{-Q} option appears on the command line before the
1661 @option{--help=} option, then the descriptive text displayed by
1662 @option{--help=} is changed.  Instead of describing the displayed
1663 options, an indication is given as to whether the option is enabled,
1664 disabled or set to a specific value (assuming that the compiler
1665 knows this at the point where the @option{--help=} option is used).
1667 Here is a truncated example from the ARM port of @command{gcc}:
1669 @smallexample
1670   % gcc -Q -mabi=2 --help=target -c
1671   The following options are target specific:
1672   -mabi=                                2
1673   -mabort-on-noreturn                   [disabled]
1674   -mapcs                                [disabled]
1675 @end smallexample
1677 The output is sensitive to the effects of previous command-line
1678 options, so for example it is possible to find out which optimizations
1679 are enabled at @option{-O2} by using:
1681 @smallexample
1682 -Q -O2 --help=optimizers
1683 @end smallexample
1685 Alternatively you can discover which binary optimizations are enabled
1686 by @option{-O3} by using:
1688 @smallexample
1689 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1690 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1691 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1692 @end smallexample
1694 @item --version
1695 @opindex version
1696 Display the version number and copyrights of the invoked GCC@.
1698 @item -pass-exit-codes
1699 @opindex pass-exit-codes
1700 Normally the @command{gcc} program exits with the code of 1 if any
1701 phase of the compiler returns a non-success return code.  If you specify
1702 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1703 the numerically highest error produced by any phase returning an error
1704 indication.  The C, C++, and Fortran front ends return 4 if an internal
1705 compiler error is encountered.
1707 @item -pipe
1708 @opindex pipe
1709 Use pipes rather than temporary files for communication between the
1710 various stages of compilation.  This fails to work on some systems where
1711 the assembler is unable to read from a pipe; but the GNU assembler has
1712 no trouble.
1714 @item -specs=@var{file}
1715 @opindex specs
1716 Process @var{file} after the compiler reads in the standard @file{specs}
1717 file, in order to override the defaults which the @command{gcc} driver
1718 program uses when determining what switches to pass to @command{cc1},
1719 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
1720 @option{-specs=@var{file}} can be specified on the command line, and they
1721 are processed in order, from left to right.  @xref{Spec Files}, for
1722 information about the format of the @var{file}.
1724 @item -wrapper
1725 @opindex wrapper
1726 Invoke all subcommands under a wrapper program.  The name of the
1727 wrapper program and its parameters are passed as a comma separated
1728 list.
1730 @smallexample
1731 gcc -c t.c -wrapper gdb,--args
1732 @end smallexample
1734 @noindent
1735 This invokes all subprograms of @command{gcc} under
1736 @samp{gdb --args}, thus the invocation of @command{cc1} is
1737 @samp{gdb --args cc1 @dots{}}.
1739 @item -ffile-prefix-map=@var{old}=@var{new}
1740 @opindex ffile-prefix-map
1741 When compiling files residing in directory @file{@var{old}}, record
1742 any references to them in the result of the compilation as if the
1743 files resided in directory @file{@var{new}} instead.  Specifying this
1744 option is equivalent to specifying all the individual
1745 @option{-f*-prefix-map} options.  This can be used to make reproducible
1746 builds that are location independent.  See also
1747 @option{-fmacro-prefix-map} and @option{-fdebug-prefix-map}.
1749 @item -fplugin=@var{name}.so
1750 @opindex fplugin
1751 Load the plugin code in file @var{name}.so, assumed to be a
1752 shared object to be dlopen'd by the compiler.  The base name of
1753 the shared object file is used to identify the plugin for the
1754 purposes of argument parsing (See
1755 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1756 Each plugin should define the callback functions specified in the
1757 Plugins API.
1759 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1760 @opindex fplugin-arg
1761 Define an argument called @var{key} with a value of @var{value}
1762 for the plugin called @var{name}.
1764 @item -fdump-ada-spec@r{[}-slim@r{]}
1765 @opindex fdump-ada-spec
1766 For C and C++ source and include files, generate corresponding Ada specs.
1767 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1768 GNAT User's Guide}, which provides detailed documentation on this feature.
1770 @item -fada-spec-parent=@var{unit}
1771 @opindex fada-spec-parent
1772 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1773 Ada specs as child units of parent @var{unit}.
1775 @item -fdump-go-spec=@var{file}
1776 @opindex fdump-go-spec
1777 For input files in any language, generate corresponding Go
1778 declarations in @var{file}.  This generates Go @code{const},
1779 @code{type}, @code{var}, and @code{func} declarations which may be a
1780 useful way to start writing a Go interface to code written in some
1781 other language.
1783 @include @value{srcdir}/../libiberty/at-file.texi
1784 @end table
1786 @node Invoking G++
1787 @section Compiling C++ Programs
1789 @cindex suffixes for C++ source
1790 @cindex C++ source file suffixes
1791 C++ source files conventionally use one of the suffixes @samp{.C},
1792 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1793 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1794 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1795 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1796 files with these names and compiles them as C++ programs even if you
1797 call the compiler the same way as for compiling C programs (usually
1798 with the name @command{gcc}).
1800 @findex g++
1801 @findex c++
1802 However, the use of @command{gcc} does not add the C++ library.
1803 @command{g++} is a program that calls GCC and automatically specifies linking
1804 against the C++ library.  It treats @samp{.c},
1805 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1806 files unless @option{-x} is used.  This program is also useful when
1807 precompiling a C header file with a @samp{.h} extension for use in C++
1808 compilations.  On many systems, @command{g++} is also installed with
1809 the name @command{c++}.
1811 @cindex invoking @command{g++}
1812 When you compile C++ programs, you may specify many of the same
1813 command-line options that you use for compiling programs in any
1814 language; or command-line options meaningful for C and related
1815 languages; or options that are meaningful only for C++ programs.
1816 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1817 explanations of options for languages related to C@.
1818 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1819 explanations of options that are meaningful only for C++ programs.
1821 @node C Dialect Options
1822 @section Options Controlling C Dialect
1823 @cindex dialect options
1824 @cindex language dialect options
1825 @cindex options, dialect
1827 The following options control the dialect of C (or languages derived
1828 from C, such as C++, Objective-C and Objective-C++) that the compiler
1829 accepts:
1831 @table @gcctabopt
1832 @cindex ANSI support
1833 @cindex ISO support
1834 @item -ansi
1835 @opindex ansi
1836 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1837 equivalent to @option{-std=c++98}.
1839 This turns off certain features of GCC that are incompatible with ISO
1840 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1841 such as the @code{asm} and @code{typeof} keywords, and
1842 predefined macros such as @code{unix} and @code{vax} that identify the
1843 type of system you are using.  It also enables the undesirable and
1844 rarely used ISO trigraph feature.  For the C compiler,
1845 it disables recognition of C++ style @samp{//} comments as well as
1846 the @code{inline} keyword.
1848 The alternate keywords @code{__asm__}, @code{__extension__},
1849 @code{__inline__} and @code{__typeof__} continue to work despite
1850 @option{-ansi}.  You would not want to use them in an ISO C program, of
1851 course, but it is useful to put them in header files that might be included
1852 in compilations done with @option{-ansi}.  Alternate predefined macros
1853 such as @code{__unix__} and @code{__vax__} are also available, with or
1854 without @option{-ansi}.
1856 The @option{-ansi} option does not cause non-ISO programs to be
1857 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1858 addition to @option{-ansi}.  @xref{Warning Options}.
1860 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1861 option is used.  Some header files may notice this macro and refrain
1862 from declaring certain functions or defining certain macros that the
1863 ISO standard doesn't call for; this is to avoid interfering with any
1864 programs that might use these names for other things.
1866 Functions that are normally built in but do not have semantics
1867 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1868 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1869 built-in functions provided by GCC}, for details of the functions
1870 affected.
1872 @item -std=
1873 @opindex std
1874 Determine the language standard. @xref{Standards,,Language Standards
1875 Supported by GCC}, for details of these standard versions.  This option
1876 is currently only supported when compiling C or C++.
1878 The compiler can accept several base standards, such as @samp{c90} or
1879 @samp{c++98}, and GNU dialects of those standards, such as
1880 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1881 compiler accepts all programs following that standard plus those
1882 using GNU extensions that do not contradict it.  For example,
1883 @option{-std=c90} turns off certain features of GCC that are
1884 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1885 keywords, but not other GNU extensions that do not have a meaning in
1886 ISO C90, such as omitting the middle term of a @code{?:}
1887 expression. On the other hand, when a GNU dialect of a standard is
1888 specified, all features supported by the compiler are enabled, even when
1889 those features change the meaning of the base standard.  As a result, some
1890 strict-conforming programs may be rejected.  The particular standard
1891 is used by @option{-Wpedantic} to identify which features are GNU
1892 extensions given that version of the standard. For example
1893 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1894 comments, while @option{-std=gnu99 -Wpedantic} does not.
1896 A value for this option must be provided; possible values are
1898 @table @samp
1899 @item c90
1900 @itemx c89
1901 @itemx iso9899:1990
1902 Support all ISO C90 programs (certain GNU extensions that conflict
1903 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1905 @item iso9899:199409
1906 ISO C90 as modified in amendment 1.
1908 @item c99
1909 @itemx c9x
1910 @itemx iso9899:1999
1911 @itemx iso9899:199x
1912 ISO C99.  This standard is substantially completely supported, modulo
1913 bugs and floating-point issues
1914 (mainly but not entirely relating to optional C99 features from
1915 Annexes F and G).  See
1916 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1917 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1919 @item c11
1920 @itemx c1x
1921 @itemx iso9899:2011
1922 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1923 substantially completely supported, modulo bugs, floating-point issues
1924 (mainly but not entirely relating to optional C11 features from
1925 Annexes F and G) and the optional Annexes K (Bounds-checking
1926 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1928 @item c17
1929 @itemx c18
1930 @itemx iso9899:2017
1931 @itemx iso9899:2018
1932 ISO C17, the 2017 revision of the ISO C standard (expected to be
1933 published in 2018).  This standard is
1934 same as C11 except for corrections of defects (all of which are also
1935 applied with @option{-std=c11}) and a new value of
1936 @code{__STDC_VERSION__}, and so is supported to the same extent as C11.
1938 @item gnu90
1939 @itemx gnu89
1940 GNU dialect of ISO C90 (including some C99 features).
1942 @item gnu99
1943 @itemx gnu9x
1944 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1946 @item gnu11
1947 @itemx gnu1x
1948 GNU dialect of ISO C11.
1949 The name @samp{gnu1x} is deprecated.
1951 @item gnu17
1952 @itemx gnu18
1953 GNU dialect of ISO C17.  This is the default for C code.
1955 @item c++98
1956 @itemx c++03
1957 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1958 additional defect reports. Same as @option{-ansi} for C++ code.
1960 @item gnu++98
1961 @itemx gnu++03
1962 GNU dialect of @option{-std=c++98}.
1964 @item c++11
1965 @itemx c++0x
1966 The 2011 ISO C++ standard plus amendments.
1967 The name @samp{c++0x} is deprecated.
1969 @item gnu++11
1970 @itemx gnu++0x
1971 GNU dialect of @option{-std=c++11}.
1972 The name @samp{gnu++0x} is deprecated.
1974 @item c++14
1975 @itemx c++1y
1976 The 2014 ISO C++ standard plus amendments.
1977 The name @samp{c++1y} is deprecated.
1979 @item gnu++14
1980 @itemx gnu++1y
1981 GNU dialect of @option{-std=c++14}.
1982 This is the default for C++ code.
1983 The name @samp{gnu++1y} is deprecated.
1985 @item c++17
1986 @itemx c++1z
1987 The 2017 ISO C++ standard plus amendments.
1988 The name @samp{c++1z} is deprecated.
1990 @item gnu++17
1991 @itemx gnu++1z
1992 GNU dialect of @option{-std=c++17}.
1993 The name @samp{gnu++1z} is deprecated.
1995 @item c++2a
1996 The next revision of the ISO C++ standard, tentatively planned for
1997 2020.  Support is highly experimental, and will almost certainly
1998 change in incompatible ways in future releases.
2000 @item gnu++2a
2001 GNU dialect of @option{-std=c++2a}.  Support is highly experimental,
2002 and will almost certainly change in incompatible ways in future
2003 releases.
2004 @end table
2006 @item -fgnu89-inline
2007 @opindex fgnu89-inline
2008 The option @option{-fgnu89-inline} tells GCC to use the traditional
2009 GNU semantics for @code{inline} functions when in C99 mode.
2010 @xref{Inline,,An Inline Function is As Fast As a Macro}.
2011 Using this option is roughly equivalent to adding the
2012 @code{gnu_inline} function attribute to all inline functions
2013 (@pxref{Function Attributes}).
2015 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
2016 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
2017 specifies the default behavior).
2018 This option is not supported in @option{-std=c90} or
2019 @option{-std=gnu90} mode.
2021 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
2022 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
2023 in effect for @code{inline} functions.  @xref{Common Predefined
2024 Macros,,,cpp,The C Preprocessor}.
2026 @item -fpermitted-flt-eval-methods=@var{style}
2027 @opindex fpermitted-flt-eval-methods
2028 @opindex fpermitted-flt-eval-methods=c11
2029 @opindex fpermitted-flt-eval-methods=ts-18661-3
2030 ISO/IEC TS 18661-3 defines new permissible values for
2031 @code{FLT_EVAL_METHOD} that indicate that operations and constants with
2032 a semantic type that is an interchange or extended format should be
2033 evaluated to the precision and range of that type.  These new values are
2034 a superset of those permitted under C99/C11, which does not specify the
2035 meaning of other positive values of @code{FLT_EVAL_METHOD}.  As such, code
2036 conforming to C11 may not have been written expecting the possibility of
2037 the new values.
2039 @option{-fpermitted-flt-eval-methods} specifies whether the compiler
2040 should allow only the values of @code{FLT_EVAL_METHOD} specified in C99/C11,
2041 or the extended set of values specified in ISO/IEC TS 18661-3.
2043 @var{style} is either @code{c11} or @code{ts-18661-3} as appropriate.
2045 The default when in a standards compliant mode (@option{-std=c11} or similar)
2046 is @option{-fpermitted-flt-eval-methods=c11}.  The default when in a GNU
2047 dialect (@option{-std=gnu11} or similar) is
2048 @option{-fpermitted-flt-eval-methods=ts-18661-3}.
2050 @item -aux-info @var{filename}
2051 @opindex aux-info
2052 Output to the given filename prototyped declarations for all functions
2053 declared and/or defined in a translation unit, including those in header
2054 files.  This option is silently ignored in any language other than C@.
2056 Besides declarations, the file indicates, in comments, the origin of
2057 each declaration (source file and line), whether the declaration was
2058 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
2059 @samp{O} for old, respectively, in the first character after the line
2060 number and the colon), and whether it came from a declaration or a
2061 definition (@samp{C} or @samp{F}, respectively, in the following
2062 character).  In the case of function definitions, a K&R-style list of
2063 arguments followed by their declarations is also provided, inside
2064 comments, after the declaration.
2066 @item -fallow-parameterless-variadic-functions
2067 @opindex fallow-parameterless-variadic-functions
2068 Accept variadic functions without named parameters.
2070 Although it is possible to define such a function, this is not very
2071 useful as it is not possible to read the arguments.  This is only
2072 supported for C as this construct is allowed by C++.
2074 @item -fno-asm
2075 @opindex fno-asm
2076 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
2077 keyword, so that code can use these words as identifiers.  You can use
2078 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
2079 instead.  @option{-ansi} implies @option{-fno-asm}.
2081 In C++, this switch only affects the @code{typeof} keyword, since
2082 @code{asm} and @code{inline} are standard keywords.  You may want to
2083 use the @option{-fno-gnu-keywords} flag instead, which has the same
2084 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
2085 switch only affects the @code{asm} and @code{typeof} keywords, since
2086 @code{inline} is a standard keyword in ISO C99.
2088 @item -fno-builtin
2089 @itemx -fno-builtin-@var{function}
2090 @opindex fno-builtin
2091 @cindex built-in functions
2092 Don't recognize built-in functions that do not begin with
2093 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
2094 functions provided by GCC}, for details of the functions affected,
2095 including those which are not built-in functions when @option{-ansi} or
2096 @option{-std} options for strict ISO C conformance are used because they
2097 do not have an ISO standard meaning.
2099 GCC normally generates special code to handle certain built-in functions
2100 more efficiently; for instance, calls to @code{alloca} may become single
2101 instructions which adjust the stack directly, and calls to @code{memcpy}
2102 may become inline copy loops.  The resulting code is often both smaller
2103 and faster, but since the function calls no longer appear as such, you
2104 cannot set a breakpoint on those calls, nor can you change the behavior
2105 of the functions by linking with a different library.  In addition,
2106 when a function is recognized as a built-in function, GCC may use
2107 information about that function to warn about problems with calls to
2108 that function, or to generate more efficient code, even if the
2109 resulting code still contains calls to that function.  For example,
2110 warnings are given with @option{-Wformat} for bad calls to
2111 @code{printf} when @code{printf} is built in and @code{strlen} is
2112 known not to modify global memory.
2114 With the @option{-fno-builtin-@var{function}} option
2115 only the built-in function @var{function} is
2116 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
2117 function is named that is not built-in in this version of GCC, this
2118 option is ignored.  There is no corresponding
2119 @option{-fbuiltin-@var{function}} option; if you wish to enable
2120 built-in functions selectively when using @option{-fno-builtin} or
2121 @option{-ffreestanding}, you may define macros such as:
2123 @smallexample
2124 #define abs(n)          __builtin_abs ((n))
2125 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
2126 @end smallexample
2128 @item -fgimple
2129 @opindex fgimple
2131 Enable parsing of function definitions marked with @code{__GIMPLE}.
2132 This is an experimental feature that allows unit testing of GIMPLE
2133 passes.
2135 @item -fhosted
2136 @opindex fhosted
2137 @cindex hosted environment
2139 Assert that compilation targets a hosted environment.  This implies
2140 @option{-fbuiltin}.  A hosted environment is one in which the
2141 entire standard library is available, and in which @code{main} has a return
2142 type of @code{int}.  Examples are nearly everything except a kernel.
2143 This is equivalent to @option{-fno-freestanding}.
2145 @item -ffreestanding
2146 @opindex ffreestanding
2147 @cindex hosted environment
2149 Assert that compilation targets a freestanding environment.  This
2150 implies @option{-fno-builtin}.  A freestanding environment
2151 is one in which the standard library may not exist, and program startup may
2152 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
2153 This is equivalent to @option{-fno-hosted}.
2155 @xref{Standards,,Language Standards Supported by GCC}, for details of
2156 freestanding and hosted environments.
2158 @item -fopenacc
2159 @opindex fopenacc
2160 @cindex OpenACC accelerator programming
2161 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
2162 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
2163 compiler generates accelerated code according to the OpenACC Application
2164 Programming Interface v2.0 @w{@uref{https://www.openacc.org}}.  This option
2165 implies @option{-pthread}, and thus is only supported on targets that
2166 have support for @option{-pthread}.
2168 @item -fopenacc-dim=@var{geom}
2169 @opindex fopenacc-dim
2170 @cindex OpenACC accelerator programming
2171 Specify default compute dimensions for parallel offload regions that do
2172 not explicitly specify.  The @var{geom} value is a triple of
2173 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'.  A size
2174 can be omitted, to use a target-specific default value.
2176 @item -fopenmp
2177 @opindex fopenmp
2178 @cindex OpenMP parallel
2179 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
2180 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
2181 compiler generates parallel code according to the OpenMP Application
2182 Program Interface v4.5 @w{@uref{https://www.openmp.org}}.  This option
2183 implies @option{-pthread}, and thus is only supported on targets that
2184 have support for @option{-pthread}. @option{-fopenmp} implies
2185 @option{-fopenmp-simd}.
2187 @item -fopenmp-simd
2188 @opindex fopenmp-simd
2189 @cindex OpenMP SIMD
2190 @cindex SIMD
2191 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
2192 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
2193 are ignored.
2195 @item -fgnu-tm
2196 @opindex fgnu-tm
2197 When the option @option{-fgnu-tm} is specified, the compiler
2198 generates code for the Linux variant of Intel's current Transactional
2199 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
2200 an experimental feature whose interface may change in future versions
2201 of GCC, as the official specification changes.  Please note that not
2202 all architectures are supported for this feature.
2204 For more information on GCC's support for transactional memory,
2205 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
2206 Transactional Memory Library}.
2208 Note that the transactional memory feature is not supported with
2209 non-call exceptions (@option{-fnon-call-exceptions}).
2211 @item -fms-extensions
2212 @opindex fms-extensions
2213 Accept some non-standard constructs used in Microsoft header files.
2215 In C++ code, this allows member names in structures to be similar
2216 to previous types declarations.
2218 @smallexample
2219 typedef int UOW;
2220 struct ABC @{
2221   UOW UOW;
2223 @end smallexample
2225 Some cases of unnamed fields in structures and unions are only
2226 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
2227 fields within structs/unions}, for details.
2229 Note that this option is off for all targets but x86 
2230 targets using ms-abi.
2232 @item -fplan9-extensions
2233 @opindex fplan9-extensions
2234 Accept some non-standard constructs used in Plan 9 code.
2236 This enables @option{-fms-extensions}, permits passing pointers to
2237 structures with anonymous fields to functions that expect pointers to
2238 elements of the type of the field, and permits referring to anonymous
2239 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2240 struct/union fields within structs/unions}, for details.  This is only
2241 supported for C, not C++.
2243 @item -fcond-mismatch
2244 @opindex fcond-mismatch
2245 Allow conditional expressions with mismatched types in the second and
2246 third arguments.  The value of such an expression is void.  This option
2247 is not supported for C++.
2249 @item -flax-vector-conversions
2250 @opindex flax-vector-conversions
2251 Allow implicit conversions between vectors with differing numbers of
2252 elements and/or incompatible element types.  This option should not be
2253 used for new code.
2255 @item -funsigned-char
2256 @opindex funsigned-char
2257 Let the type @code{char} be unsigned, like @code{unsigned char}.
2259 Each kind of machine has a default for what @code{char} should
2260 be.  It is either like @code{unsigned char} by default or like
2261 @code{signed char} by default.
2263 Ideally, a portable program should always use @code{signed char} or
2264 @code{unsigned char} when it depends on the signedness of an object.
2265 But many programs have been written to use plain @code{char} and
2266 expect it to be signed, or expect it to be unsigned, depending on the
2267 machines they were written for.  This option, and its inverse, let you
2268 make such a program work with the opposite default.
2270 The type @code{char} is always a distinct type from each of
2271 @code{signed char} or @code{unsigned char}, even though its behavior
2272 is always just like one of those two.
2274 @item -fsigned-char
2275 @opindex fsigned-char
2276 Let the type @code{char} be signed, like @code{signed char}.
2278 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2279 the negative form of @option{-funsigned-char}.  Likewise, the option
2280 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2282 @item -fsigned-bitfields
2283 @itemx -funsigned-bitfields
2284 @itemx -fno-signed-bitfields
2285 @itemx -fno-unsigned-bitfields
2286 @opindex fsigned-bitfields
2287 @opindex funsigned-bitfields
2288 @opindex fno-signed-bitfields
2289 @opindex fno-unsigned-bitfields
2290 These options control whether a bit-field is signed or unsigned, when the
2291 declaration does not use either @code{signed} or @code{unsigned}.  By
2292 default, such a bit-field is signed, because this is consistent: the
2293 basic integer types such as @code{int} are signed types.
2295 @item -fsso-struct=@var{endianness}
2296 @opindex fsso-struct
2297 Set the default scalar storage order of structures and unions to the
2298 specified endianness.  The accepted values are @samp{big-endian},
2299 @samp{little-endian} and @samp{native} for the native endianness of
2300 the target (the default).  This option is not supported for C++.
2302 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2303 code that is not binary compatible with code generated without it if the
2304 specified endianness is not the native endianness of the target.
2305 @end table
2307 @node C++ Dialect Options
2308 @section Options Controlling C++ Dialect
2310 @cindex compiler options, C++
2311 @cindex C++ options, command-line
2312 @cindex options, C++
2313 This section describes the command-line options that are only meaningful
2314 for C++ programs.  You can also use most of the GNU compiler options
2315 regardless of what language your program is in.  For example, you
2316 might compile a file @file{firstClass.C} like this:
2318 @smallexample
2319 g++ -g -fstrict-enums -O -c firstClass.C
2320 @end smallexample
2322 @noindent
2323 In this example, only @option{-fstrict-enums} is an option meant
2324 only for C++ programs; you can use the other options with any
2325 language supported by GCC@.
2327 Some options for compiling C programs, such as @option{-std}, are also
2328 relevant for C++ programs.
2329 @xref{C Dialect Options,,Options Controlling C Dialect}.
2331 Here is a list of options that are @emph{only} for compiling C++ programs:
2333 @table @gcctabopt
2335 @item -fabi-version=@var{n}
2336 @opindex fabi-version
2337 Use version @var{n} of the C++ ABI@.  The default is version 0.
2339 Version 0 refers to the version conforming most closely to
2340 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2341 will change in different versions of G++ as ABI bugs are fixed.
2343 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2345 Version 2 is the version of the C++ ABI that first appeared in G++
2346 3.4, and was the default through G++ 4.9.
2348 Version 3 corrects an error in mangling a constant address as a
2349 template argument.
2351 Version 4, which first appeared in G++ 4.5, implements a standard
2352 mangling for vector types.
2354 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2355 attribute const/volatile on function pointer types, decltype of a
2356 plain decl, and use of a function parameter in the declaration of
2357 another parameter.
2359 Version 6, which first appeared in G++ 4.7, corrects the promotion
2360 behavior of C++11 scoped enums and the mangling of template argument
2361 packs, const/static_cast, prefix ++ and --, and a class scope function
2362 used as a template argument.
2364 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2365 builtin type and corrects the mangling of lambdas in default argument
2366 scope.
2368 Version 8, which first appeared in G++ 4.9, corrects the substitution
2369 behavior of function types with function-cv-qualifiers.
2371 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2372 @code{nullptr_t}.
2374 Version 10, which first appeared in G++ 6.1, adds mangling of
2375 attributes that affect type identity, such as ia32 calling convention
2376 attributes (e.g. @samp{stdcall}).
2378 Version 11, which first appeared in G++ 7, corrects the mangling of
2379 sizeof... expressions and operator names.  For multiple entities with
2380 the same name within a function, that are declared in different scopes,
2381 the mangling now changes starting with the twelfth occurrence.  It also
2382 implies @option{-fnew-inheriting-ctors}.
2384 Version 12, which first appeared in G++ 8, corrects the calling
2385 conventions for empty classes on the x86_64 target and for classes
2386 with only deleted copy/move constructors.  It accidentally changes the
2387 calling convention for classes with a deleted copy constructor and a
2388 trivial move constructor.
2390 Version 13, which first appeared in G++ 8.2, fixes the accidental
2391 change in version 12.
2393 See also @option{-Wabi}.
2395 @item -fabi-compat-version=@var{n}
2396 @opindex fabi-compat-version
2397 On targets that support strong aliases, G++
2398 works around mangling changes by creating an alias with the correct
2399 mangled name when defining a symbol with an incorrect mangled name.
2400 This switch specifies which ABI version to use for the alias.
2402 With @option{-fabi-version=0} (the default), this defaults to 11 (GCC 7
2403 compatibility).  If another ABI version is explicitly selected, this
2404 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2405 use @option{-fabi-compat-version=2}.
2407 If this option is not provided but @option{-Wabi=@var{n}} is, that
2408 version is used for compatibility aliases.  If this option is provided
2409 along with @option{-Wabi} (without the version), the version from this
2410 option is used for the warning.
2412 @item -fno-access-control
2413 @opindex fno-access-control
2414 Turn off all access checking.  This switch is mainly useful for working
2415 around bugs in the access control code.
2417 @item -faligned-new
2418 @opindex faligned-new
2419 Enable support for C++17 @code{new} of types that require more
2420 alignment than @code{void* ::operator new(std::size_t)} provides.  A
2421 numeric argument such as @code{-faligned-new=32} can be used to
2422 specify how much alignment (in bytes) is provided by that function,
2423 but few users will need to override the default of
2424 @code{alignof(std::max_align_t)}.
2426 This flag is enabled by default for @option{-std=c++17}.
2428 @item -fcheck-new
2429 @opindex fcheck-new
2430 Check that the pointer returned by @code{operator new} is non-null
2431 before attempting to modify the storage allocated.  This check is
2432 normally unnecessary because the C++ standard specifies that
2433 @code{operator new} only returns @code{0} if it is declared
2434 @code{throw()}, in which case the compiler always checks the
2435 return value even without this option.  In all other cases, when
2436 @code{operator new} has a non-empty exception specification, memory
2437 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2438 @samp{new (nothrow)}.
2440 @item -fconcepts
2441 @opindex fconcepts
2442 Enable support for the C++ Extensions for Concepts Technical
2443 Specification, ISO 19217 (2015), which allows code like
2445 @smallexample
2446 template <class T> concept bool Addable = requires (T t) @{ t + t; @};
2447 template <Addable T> T add (T a, T b) @{ return a + b; @}
2448 @end smallexample
2450 @item -fconstexpr-depth=@var{n}
2451 @opindex fconstexpr-depth
2452 Set the maximum nested evaluation depth for C++11 constexpr functions
2453 to @var{n}.  A limit is needed to detect endless recursion during
2454 constant expression evaluation.  The minimum specified by the standard
2455 is 512.
2457 @item -fconstexpr-loop-limit=@var{n}
2458 @opindex fconstexpr-loop-limit
2459 Set the maximum number of iterations for a loop in C++14 constexpr functions
2460 to @var{n}.  A limit is needed to detect infinite loops during
2461 constant expression evaluation.  The default is 262144 (1<<18).
2463 @item -fdeduce-init-list
2464 @opindex fdeduce-init-list
2465 Enable deduction of a template type parameter as
2466 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2468 @smallexample
2469 template <class T> auto forward(T t) -> decltype (realfn (t))
2471   return realfn (t);
2474 void f()
2476   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2478 @end smallexample
2480 This deduction was implemented as a possible extension to the
2481 originally proposed semantics for the C++11 standard, but was not part
2482 of the final standard, so it is disabled by default.  This option is
2483 deprecated, and may be removed in a future version of G++.
2485 @item -fno-elide-constructors
2486 @opindex fno-elide-constructors
2487 The C++ standard allows an implementation to omit creating a temporary
2488 that is only used to initialize another object of the same type.
2489 Specifying this option disables that optimization, and forces G++ to
2490 call the copy constructor in all cases.  This option also causes G++
2491 to call trivial member functions which otherwise would be expanded inline.
2493 In C++17, the compiler is required to omit these temporaries, but this
2494 option still affects trivial member functions.
2496 @item -fno-enforce-eh-specs
2497 @opindex fno-enforce-eh-specs
2498 Don't generate code to check for violation of exception specifications
2499 at run time.  This option violates the C++ standard, but may be useful
2500 for reducing code size in production builds, much like defining
2501 @code{NDEBUG}.  This does not give user code permission to throw
2502 exceptions in violation of the exception specifications; the compiler
2503 still optimizes based on the specifications, so throwing an
2504 unexpected exception results in undefined behavior at run time.
2506 @item -fextern-tls-init
2507 @itemx -fno-extern-tls-init
2508 @opindex fextern-tls-init
2509 @opindex fno-extern-tls-init
2510 The C++11 and OpenMP standards allow @code{thread_local} and
2511 @code{threadprivate} variables to have dynamic (runtime)
2512 initialization.  To support this, any use of such a variable goes
2513 through a wrapper function that performs any necessary initialization.
2514 When the use and definition of the variable are in the same
2515 translation unit, this overhead can be optimized away, but when the
2516 use is in a different translation unit there is significant overhead
2517 even if the variable doesn't actually need dynamic initialization.  If
2518 the programmer can be sure that no use of the variable in a
2519 non-defining TU needs to trigger dynamic initialization (either
2520 because the variable is statically initialized, or a use of the
2521 variable in the defining TU will be executed before any uses in
2522 another TU), they can avoid this overhead with the
2523 @option{-fno-extern-tls-init} option.
2525 On targets that support symbol aliases, the default is
2526 @option{-fextern-tls-init}.  On targets that do not support symbol
2527 aliases, the default is @option{-fno-extern-tls-init}.
2529 @item -fno-gnu-keywords
2530 @opindex fno-gnu-keywords
2531 Do not recognize @code{typeof} as a keyword, so that code can use this
2532 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2533 This option is implied by the strict ISO C++ dialects: @option{-ansi},
2534 @option{-std=c++98}, @option{-std=c++11}, etc.
2536 @item -fno-implicit-templates
2537 @opindex fno-implicit-templates
2538 Never emit code for non-inline templates that are instantiated
2539 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2540 @xref{Template Instantiation}, for more information.
2542 @item -fno-implicit-inline-templates
2543 @opindex fno-implicit-inline-templates
2544 Don't emit code for implicit instantiations of inline templates, either.
2545 The default is to handle inlines differently so that compiles with and
2546 without optimization need the same set of explicit instantiations.
2548 @item -fno-implement-inlines
2549 @opindex fno-implement-inlines
2550 To save space, do not emit out-of-line copies of inline functions
2551 controlled by @code{#pragma implementation}.  This causes linker
2552 errors if these functions are not inlined everywhere they are called.
2554 @item -fms-extensions
2555 @opindex fms-extensions
2556 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2557 int and getting a pointer to member function via non-standard syntax.
2559 @item -fnew-inheriting-ctors
2560 @opindex fnew-inheriting-ctors
2561 Enable the P0136 adjustment to the semantics of C++11 constructor
2562 inheritance.  This is part of C++17 but also considered to be a Defect
2563 Report against C++11 and C++14.  This flag is enabled by default
2564 unless @option{-fabi-version=10} or lower is specified.
2566 @item -fnew-ttp-matching
2567 @opindex fnew-ttp-matching
2568 Enable the P0522 resolution to Core issue 150, template template
2569 parameters and default arguments: this allows a template with default
2570 template arguments as an argument for a template template parameter
2571 with fewer template parameters.  This flag is enabled by default for
2572 @option{-std=c++17}.
2574 @item -fno-nonansi-builtins
2575 @opindex fno-nonansi-builtins
2576 Disable built-in declarations of functions that are not mandated by
2577 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2578 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2580 @item -fnothrow-opt
2581 @opindex fnothrow-opt
2582 Treat a @code{throw()} exception specification as if it were a
2583 @code{noexcept} specification to reduce or eliminate the text size
2584 overhead relative to a function with no exception specification.  If
2585 the function has local variables of types with non-trivial
2586 destructors, the exception specification actually makes the
2587 function smaller because the EH cleanups for those variables can be
2588 optimized away.  The semantic effect is that an exception thrown out of
2589 a function with such an exception specification results in a call
2590 to @code{terminate} rather than @code{unexpected}.
2592 @item -fno-operator-names
2593 @opindex fno-operator-names
2594 Do not treat the operator name keywords @code{and}, @code{bitand},
2595 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2596 synonyms as keywords.
2598 @item -fno-optional-diags
2599 @opindex fno-optional-diags
2600 Disable diagnostics that the standard says a compiler does not need to
2601 issue.  Currently, the only such diagnostic issued by G++ is the one for
2602 a name having multiple meanings within a class.
2604 @item -fpermissive
2605 @opindex fpermissive
2606 Downgrade some diagnostics about nonconformant code from errors to
2607 warnings.  Thus, using @option{-fpermissive} allows some
2608 nonconforming code to compile.
2610 @item -fno-pretty-templates
2611 @opindex fno-pretty-templates
2612 When an error message refers to a specialization of a function
2613 template, the compiler normally prints the signature of the
2614 template followed by the template arguments and any typedefs or
2615 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2616 rather than @code{void f(int)}) so that it's clear which template is
2617 involved.  When an error message refers to a specialization of a class
2618 template, the compiler omits any template arguments that match
2619 the default template arguments for that template.  If either of these
2620 behaviors make it harder to understand the error message rather than
2621 easier, you can use @option{-fno-pretty-templates} to disable them.
2623 @item -frepo
2624 @opindex frepo
2625 Enable automatic template instantiation at link time.  This option also
2626 implies @option{-fno-implicit-templates}.  @xref{Template
2627 Instantiation}, for more information.
2629 @item -fno-rtti
2630 @opindex fno-rtti
2631 Disable generation of information about every class with virtual
2632 functions for use by the C++ run-time type identification features
2633 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2634 of the language, you can save some space by using this flag.  Note that
2635 exception handling uses the same information, but G++ generates it as
2636 needed. The @code{dynamic_cast} operator can still be used for casts that
2637 do not require run-time type information, i.e.@: casts to @code{void *} or to
2638 unambiguous base classes.
2640 @item -fsized-deallocation
2641 @opindex fsized-deallocation
2642 Enable the built-in global declarations
2643 @smallexample
2644 void operator delete (void *, std::size_t) noexcept;
2645 void operator delete[] (void *, std::size_t) noexcept;
2646 @end smallexample
2647 as introduced in C++14.  This is useful for user-defined replacement
2648 deallocation functions that, for example, use the size of the object
2649 to make deallocation faster.  Enabled by default under
2650 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2651 warns about places that might want to add a definition.
2653 @item -fstrict-enums
2654 @opindex fstrict-enums
2655 Allow the compiler to optimize using the assumption that a value of
2656 enumerated type can only be one of the values of the enumeration (as
2657 defined in the C++ standard; basically, a value that can be
2658 represented in the minimum number of bits needed to represent all the
2659 enumerators).  This assumption may not be valid if the program uses a
2660 cast to convert an arbitrary integer value to the enumerated type.
2662 @item -fstrong-eval-order
2663 @opindex fstrong-eval-order
2664 Evaluate member access, array subscripting, and shift expressions in
2665 left-to-right order, and evaluate assignment in right-to-left order,
2666 as adopted for C++17.  Enabled by default with @option{-std=c++17}.
2667 @option{-fstrong-eval-order=some} enables just the ordering of member
2668 access and shift expressions, and is the default without
2669 @option{-std=c++17}.
2671 @item -ftemplate-backtrace-limit=@var{n}
2672 @opindex ftemplate-backtrace-limit
2673 Set the maximum number of template instantiation notes for a single
2674 warning or error to @var{n}.  The default value is 10.
2676 @item -ftemplate-depth=@var{n}
2677 @opindex ftemplate-depth
2678 Set the maximum instantiation depth for template classes to @var{n}.
2679 A limit on the template instantiation depth is needed to detect
2680 endless recursions during template class instantiation.  ANSI/ISO C++
2681 conforming programs must not rely on a maximum depth greater than 17
2682 (changed to 1024 in C++11).  The default value is 900, as the compiler
2683 can run out of stack space before hitting 1024 in some situations.
2685 @item -fno-threadsafe-statics
2686 @opindex fno-threadsafe-statics
2687 Do not emit the extra code to use the routines specified in the C++
2688 ABI for thread-safe initialization of local statics.  You can use this
2689 option to reduce code size slightly in code that doesn't need to be
2690 thread-safe.
2692 @item -fuse-cxa-atexit
2693 @opindex fuse-cxa-atexit
2694 Register destructors for objects with static storage duration with the
2695 @code{__cxa_atexit} function rather than the @code{atexit} function.
2696 This option is required for fully standards-compliant handling of static
2697 destructors, but only works if your C library supports
2698 @code{__cxa_atexit}.
2700 @item -fno-use-cxa-get-exception-ptr
2701 @opindex fno-use-cxa-get-exception-ptr
2702 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2703 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2704 if the runtime routine is not available.
2706 @item -fvisibility-inlines-hidden
2707 @opindex fvisibility-inlines-hidden
2708 This switch declares that the user does not attempt to compare
2709 pointers to inline functions or methods where the addresses of the two functions
2710 are taken in different shared objects.
2712 The effect of this is that GCC may, effectively, mark inline methods with
2713 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2714 appear in the export table of a DSO and do not require a PLT indirection
2715 when used within the DSO@.  Enabling this option can have a dramatic effect
2716 on load and link times of a DSO as it massively reduces the size of the
2717 dynamic export table when the library makes heavy use of templates.
2719 The behavior of this switch is not quite the same as marking the
2720 methods as hidden directly, because it does not affect static variables
2721 local to the function or cause the compiler to deduce that
2722 the function is defined in only one shared object.
2724 You may mark a method as having a visibility explicitly to negate the
2725 effect of the switch for that method.  For example, if you do want to
2726 compare pointers to a particular inline method, you might mark it as
2727 having default visibility.  Marking the enclosing class with explicit
2728 visibility has no effect.
2730 Explicitly instantiated inline methods are unaffected by this option
2731 as their linkage might otherwise cross a shared library boundary.
2732 @xref{Template Instantiation}.
2734 @item -fvisibility-ms-compat
2735 @opindex fvisibility-ms-compat
2736 This flag attempts to use visibility settings to make GCC's C++
2737 linkage model compatible with that of Microsoft Visual Studio.
2739 The flag makes these changes to GCC's linkage model:
2741 @enumerate
2742 @item
2743 It sets the default visibility to @code{hidden}, like
2744 @option{-fvisibility=hidden}.
2746 @item
2747 Types, but not their members, are not hidden by default.
2749 @item
2750 The One Definition Rule is relaxed for types without explicit
2751 visibility specifications that are defined in more than one
2752 shared object: those declarations are permitted if they are
2753 permitted when this option is not used.
2754 @end enumerate
2756 In new code it is better to use @option{-fvisibility=hidden} and
2757 export those classes that are intended to be externally visible.
2758 Unfortunately it is possible for code to rely, perhaps accidentally,
2759 on the Visual Studio behavior.
2761 Among the consequences of these changes are that static data members
2762 of the same type with the same name but defined in different shared
2763 objects are different, so changing one does not change the other;
2764 and that pointers to function members defined in different shared
2765 objects may not compare equal.  When this flag is given, it is a
2766 violation of the ODR to define types with the same name differently.
2768 @item -fno-weak
2769 @opindex fno-weak
2770 Do not use weak symbol support, even if it is provided by the linker.
2771 By default, G++ uses weak symbols if they are available.  This
2772 option exists only for testing, and should not be used by end-users;
2773 it results in inferior code and has no benefits.  This option may
2774 be removed in a future release of G++.
2776 @item -nostdinc++
2777 @opindex nostdinc++
2778 Do not search for header files in the standard directories specific to
2779 C++, but do still search the other standard directories.  (This option
2780 is used when building the C++ library.)
2781 @end table
2783 In addition, these optimization, warning, and code generation options
2784 have meanings only for C++ programs:
2786 @table @gcctabopt
2787 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2788 @opindex Wabi
2789 @opindex Wno-abi
2790 Warn when G++ it generates code that is probably not compatible with
2791 the vendor-neutral C++ ABI@.  Since G++ now defaults to updating the
2792 ABI with each major release, normally @option{-Wabi} will warn only if
2793 there is a check added later in a release series for an ABI issue
2794 discovered since the initial release.  @option{-Wabi} will warn about
2795 more things if an older ABI version is selected (with
2796 @option{-fabi-version=@var{n}}).
2798 @option{-Wabi} can also be used with an explicit version number to
2799 warn about compatibility with a particular @option{-fabi-version}
2800 level, e.g. @option{-Wabi=2} to warn about changes relative to
2801 @option{-fabi-version=2}.
2803 If an explicit version number is provided and
2804 @option{-fabi-compat-version} is not specified, the version number
2805 from this option is used for compatibility aliases.  If no explicit
2806 version number is provided with this option, but
2807 @option{-fabi-compat-version} is specified, that version number is
2808 used for ABI warnings.
2810 Although an effort has been made to warn about
2811 all such cases, there are probably some cases that are not warned about,
2812 even though G++ is generating incompatible code.  There may also be
2813 cases where warnings are emitted even though the code that is generated
2814 is compatible.
2816 You should rewrite your code to avoid these warnings if you are
2817 concerned about the fact that code generated by G++ may not be binary
2818 compatible with code generated by other compilers.
2820 Known incompatibilities in @option{-fabi-version=2} (which was the
2821 default from GCC 3.4 to 4.9) include:
2823 @itemize @bullet
2825 @item
2826 A template with a non-type template parameter of reference type was
2827 mangled incorrectly:
2828 @smallexample
2829 extern int N;
2830 template <int &> struct S @{@};
2831 void n (S<N>) @{2@}
2832 @end smallexample
2834 This was fixed in @option{-fabi-version=3}.
2836 @item
2837 SIMD vector types declared using @code{__attribute ((vector_size))} were
2838 mangled in a non-standard way that does not allow for overloading of
2839 functions taking vectors of different sizes.
2841 The mangling was changed in @option{-fabi-version=4}.
2843 @item
2844 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2845 qualifiers, and @code{decltype} of a plain declaration was folded away.
2847 These mangling issues were fixed in @option{-fabi-version=5}.
2849 @item
2850 Scoped enumerators passed as arguments to a variadic function are
2851 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2852 On most targets this does not actually affect the parameter passing
2853 ABI, as there is no way to pass an argument smaller than @code{int}.
2855 Also, the ABI changed the mangling of template argument packs,
2856 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2857 a class scope function used as a template argument.
2859 These issues were corrected in @option{-fabi-version=6}.
2861 @item
2862 Lambdas in default argument scope were mangled incorrectly, and the
2863 ABI changed the mangling of @code{nullptr_t}.
2865 These issues were corrected in @option{-fabi-version=7}.
2867 @item
2868 When mangling a function type with function-cv-qualifiers, the
2869 un-qualified function type was incorrectly treated as a substitution
2870 candidate.
2872 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
2874 @item
2875 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
2876 unaligned accesses.  Note that this did not affect the ABI of a
2877 function with a @code{nullptr_t} parameter, as parameters have a
2878 minimum alignment.
2880 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
2882 @item
2883 Target-specific attributes that affect the identity of a type, such as
2884 ia32 calling conventions on a function type (stdcall, regparm, etc.),
2885 did not affect the mangled name, leading to name collisions when
2886 function pointers were used as template arguments.
2888 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
2890 @end itemize
2892 It also warns about psABI-related changes.  The known psABI changes at this
2893 point include:
2895 @itemize @bullet
2897 @item
2898 For SysV/x86-64, unions with @code{long double} members are 
2899 passed in memory as specified in psABI.  For example:
2901 @smallexample
2902 union U @{
2903   long double ld;
2904   int i;
2906 @end smallexample
2908 @noindent
2909 @code{union U} is always passed in memory.
2911 @end itemize
2913 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
2914 @opindex Wabi-tag
2915 @opindex -Wabi-tag
2916 Warn when a type with an ABI tag is used in a context that does not
2917 have that ABI tag.  See @ref{C++ Attributes} for more information
2918 about ABI tags.
2920 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2921 @opindex Wctor-dtor-privacy
2922 @opindex Wno-ctor-dtor-privacy
2923 Warn when a class seems unusable because all the constructors or
2924 destructors in that class are private, and it has neither friends nor
2925 public static member functions.  Also warn if there are no non-private
2926 methods, and there's at least one private member function that isn't
2927 a constructor or destructor.
2929 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2930 @opindex Wdelete-non-virtual-dtor
2931 @opindex Wno-delete-non-virtual-dtor
2932 Warn when @code{delete} is used to destroy an instance of a class that
2933 has virtual functions and non-virtual destructor. It is unsafe to delete
2934 an instance of a derived class through a pointer to a base class if the
2935 base class does not have a virtual destructor.  This warning is enabled
2936 by @option{-Wall}.
2938 @item -Wdeprecated-copy @r{(C++ and Objective-C++ only)}
2939 @opindex Wdeprecated-copy
2940 @opindex Wno-deprecated-copy
2941 Warn that the implicit declaration of a copy constructor or copy
2942 assignment operator is deprecated if the class has a user-provided
2943 copy constructor, copy assignment operator, or destructor, in C++11
2944 and up.  This warning is enabled by @option{-Wall}.
2946 @item -Wno-init-list-lifetime @r{(C++ and Objective-C++ only)}
2947 @opindex Winit-list-lifetime
2948 @opindex Wno-init-list-lifetime
2949 Do not warn about uses of @code{std::initializer_list} that are likely
2950 to result in dangling pointers.  Since the underlying array for an
2951 @code{initializer_list} is handled like a normal C++ temporary object,
2952 it is easy to inadvertently keep a pointer to the array past the end
2953 of the array's lifetime.  For example:
2955 @itemize @bullet
2956 @item
2957 If a function returns a temporary @code{initializer_list}, or a local
2958 @code{initializer_list} variable, the array's lifetime ends at the end
2959 of the return statement, so the value returned has a dangling pointer.
2961 @item
2962 If a new-expression creates an @code{initializer_list}, the array only
2963 lives until the end of the enclosing full-expression, so the
2964 @code{initializer_list} in the heap has a dangling pointer.
2966 @item
2967 When an @code{initializer_list} variable is assigned from a
2968 brace-enclosed initializer list, the temporary array created for the
2969 right side of the assignment only lives until the end of the
2970 full-expression, so at the next statement the @code{initializer_list}
2971 variable has a dangling pointer.
2973 @smallexample
2974 // li's initial underlying array lives as long as li
2975 std::initializer_list<int> li = @{ 1,2,3 @};
2976 // assignment changes li to point to a temporary array
2977 li = @{ 4, 5 @};
2978 // now the temporary is gone and li has a dangling pointer
2979 int i = li.begin()[0] // undefined behavior
2980 @end smallexample
2982 @item
2983 When a list constructor stores the @code{begin} pointer from the
2984 @code{initializer_list} argument, this doesn't extend the lifetime of
2985 the array, so if a class variable is constructed from a temporary
2986 @code{initializer_list}, the pointer is left dangling by the end of
2987 the variable declaration statement.
2989 @end itemize
2991 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2992 @opindex Wliteral-suffix
2993 @opindex Wno-literal-suffix
2994 Warn when a string or character literal is followed by a ud-suffix which does
2995 not begin with an underscore.  As a conforming extension, GCC treats such
2996 suffixes as separate preprocessing tokens in order to maintain backwards
2997 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2998 For example:
3000 @smallexample
3001 #define __STDC_FORMAT_MACROS
3002 #include <inttypes.h>
3003 #include <stdio.h>
3005 int main() @{
3006   int64_t i64 = 123;
3007   printf("My int64: %" PRId64"\n", i64);
3009 @end smallexample
3011 In this case, @code{PRId64} is treated as a separate preprocessing token.
3013 Additionally, warn when a user-defined literal operator is declared with
3014 a literal suffix identifier that doesn't begin with an underscore. Literal
3015 suffix identifiers that don't begin with an underscore are reserved for
3016 future standardization.
3018 This warning is enabled by default.
3020 @item -Wlto-type-mismatch
3021 @opindex Wlto-type-mismatch
3022 @opindex Wno-lto-type-mismatch
3024 During the link-time optimization warn about type mismatches in
3025 global declarations from different compilation units.
3026 Requires @option{-flto} to be enabled.  Enabled by default.
3028 @item -Wno-narrowing @r{(C++ and Objective-C++ only)}
3029 @opindex Wnarrowing
3030 @opindex Wno-narrowing
3031 For C++11 and later standards, narrowing conversions are diagnosed by default,
3032 as required by the standard.  A narrowing conversion from a constant produces
3033 an error, and a narrowing conversion from a non-constant produces a warning,
3034 but @option{-Wno-narrowing} suppresses the diagnostic.
3035 Note that this does not affect the meaning of well-formed code;
3036 narrowing conversions are still considered ill-formed in SFINAE contexts.
3038 With @option{-Wnarrowing} in C++98, warn when a narrowing
3039 conversion prohibited by C++11 occurs within
3040 @samp{@{ @}}, e.g.
3042 @smallexample
3043 int i = @{ 2.2 @}; // error: narrowing from double to int
3044 @end smallexample
3046 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
3048 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
3049 @opindex Wnoexcept
3050 @opindex Wno-noexcept
3051 Warn when a noexcept-expression evaluates to false because of a call
3052 to a function that does not have a non-throwing exception
3053 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
3054 the compiler to never throw an exception.
3056 @item -Wnoexcept-type @r{(C++ and Objective-C++ only)}
3057 @opindex Wnoexcept-type
3058 @opindex Wno-noexcept-type
3059 Warn if the C++17 feature making @code{noexcept} part of a function
3060 type changes the mangled name of a symbol relative to C++14.  Enabled
3061 by @option{-Wabi} and @option{-Wc++17-compat}.
3063 As an example:
3065 @smallexample
3066 template <class T> void f(T t) @{ t(); @};
3067 void g() noexcept;
3068 void h() @{ f(g); @} 
3069 @end smallexample
3071 @noindent
3072 In C++14, @code{f} calls @code{f<void(*)()>}, but in
3073 C++17 it calls @code{f<void(*)()noexcept>}.
3075 @item -Wclass-memaccess @r{(C++ and Objective-C++ only)}
3076 @opindex Wclass-memaccess
3077 @opindex Wno-class-memaccess
3078 Warn when the destination of a call to a raw memory function such as
3079 @code{memset} or @code{memcpy} is an object of class type, and when writing
3080 into such an object might bypass the class non-trivial or deleted constructor
3081 or copy assignment, violate const-correctness or encapsulation, or corrupt
3082 virtual table pointers.  Modifying the representation of such objects may
3083 violate invariants maintained by member functions of the class.  For example,
3084 the call to @code{memset} below is undefined because it modifies a non-trivial
3085 class object and is, therefore, diagnosed.  The safe way to either initialize
3086 or clear the storage of objects of such types is by using the appropriate
3087 constructor or assignment operator, if one is available.
3088 @smallexample
3089 std::string str = "abc";
3090 memset (&str, 0, sizeof str);
3091 @end smallexample
3092 The @option{-Wclass-memaccess} option is enabled by @option{-Wall}.
3093 Explicitly casting the pointer to the class object to @code{void *} or
3094 to a type that can be safely accessed by the raw memory function suppresses
3095 the warning.
3097 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
3098 @opindex Wnon-virtual-dtor
3099 @opindex Wno-non-virtual-dtor
3100 Warn when a class has virtual functions and an accessible non-virtual
3101 destructor itself or in an accessible polymorphic base class, in which
3102 case it is possible but unsafe to delete an instance of a derived
3103 class through a pointer to the class itself or base class.  This
3104 warning is automatically enabled if @option{-Weffc++} is specified.
3106 @item -Wregister @r{(C++ and Objective-C++ only)}
3107 @opindex Wregister
3108 @opindex Wno-register
3109 Warn on uses of the @code{register} storage class specifier, except
3110 when it is part of the GNU @ref{Explicit Register Variables} extension.
3111 The use of the @code{register} keyword as storage class specifier has
3112 been deprecated in C++11 and removed in C++17.
3113 Enabled by default with @option{-std=c++17}.
3115 @item -Wreorder @r{(C++ and Objective-C++ only)}
3116 @opindex Wreorder
3117 @opindex Wno-reorder
3118 @cindex reordering, warning
3119 @cindex warning for reordering of member initializers
3120 Warn when the order of member initializers given in the code does not
3121 match the order in which they must be executed.  For instance:
3123 @smallexample
3124 struct A @{
3125   int i;
3126   int j;
3127   A(): j (0), i (1) @{ @}
3129 @end smallexample
3131 @noindent
3132 The compiler rearranges the member initializers for @code{i}
3133 and @code{j} to match the declaration order of the members, emitting
3134 a warning to that effect.  This warning is enabled by @option{-Wall}.
3136 @item -Wno-pessimizing-move @r{(C++ and Objective-C++ only)}
3137 @opindex Wpessimizing-move
3138 @opindex Wno-pessimizing-move
3139 This warning warns when a call to @code{std::move} prevents copy
3140 elision.  A typical scenario when copy elision can occur is when returning in
3141 a function with a class return type, when the expression being returned is the
3142 name of a non-volatile automatic object, and is not a function parameter, and
3143 has the same type as the function return type.
3145 @smallexample
3146 struct T @{
3147 @dots{}
3149 T fn()
3151   T t;
3152   @dots{}
3153   return std::move (t);
3155 @end smallexample
3157 But in this example, the @code{std::move} call prevents copy elision.
3159 This warning is enabled by @option{-Wall}.
3161 @item -Wno-redundant-move @r{(C++ and Objective-C++ only)}
3162 @opindex Wredundant-move
3163 @opindex Wno-redundant-move
3164 This warning warns about redundant calls to @code{std::move}; that is, when
3165 a move operation would have been performed even without the @code{std::move}
3166 call.  This happens because the compiler is forced to treat the object as if
3167 it were an rvalue in certain situations such as returning a local variable,
3168 where copy elision isn't applicable.  Consider:
3170 @smallexample
3171 struct T @{
3172 @dots{}
3174 T fn(T t)
3176   @dots{}
3177   return std::move (t);
3179 @end smallexample
3181 Here, the @code{std::move} call is redundant.  Because G++ implements Core
3182 Issue 1579, another example is:
3184 @smallexample
3185 struct T @{ // convertible to U
3186 @dots{}
3188 struct U @{
3189 @dots{}
3191 U fn()
3193   T t;
3194   @dots{}
3195   return std::move (t);
3197 @end smallexample
3198 In this example, copy elision isn't applicable because the type of the
3199 expression being returned and the function return type differ, yet G++
3200 treats the return value as if it were designated by an rvalue.
3202 This warning is enabled by @option{-Wextra}.
3204 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
3205 @opindex fext-numeric-literals
3206 @opindex fno-ext-numeric-literals
3207 Accept imaginary, fixed-point, or machine-defined
3208 literal number suffixes as GNU extensions.
3209 When this option is turned off these suffixes are treated
3210 as C++11 user-defined literal numeric suffixes.
3211 This is on by default for all pre-C++11 dialects and all GNU dialects:
3212 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
3213 @option{-std=gnu++14}.
3214 This option is off by default
3215 for ISO C++11 onwards (@option{-std=c++11}, ...).
3216 @end table
3218 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
3220 @table @gcctabopt
3221 @item -Weffc++ @r{(C++ and Objective-C++ only)}
3222 @opindex Weffc++
3223 @opindex Wno-effc++
3224 Warn about violations of the following style guidelines from Scott Meyers'
3225 @cite{Effective C++} series of books:
3227 @itemize @bullet
3228 @item
3229 Define a copy constructor and an assignment operator for classes
3230 with dynamically-allocated memory.
3232 @item
3233 Prefer initialization to assignment in constructors.
3235 @item
3236 Have @code{operator=} return a reference to @code{*this}.
3238 @item
3239 Don't try to return a reference when you must return an object.
3241 @item
3242 Distinguish between prefix and postfix forms of increment and
3243 decrement operators.
3245 @item
3246 Never overload @code{&&}, @code{||}, or @code{,}.
3248 @end itemize
3250 This option also enables @option{-Wnon-virtual-dtor}, which is also
3251 one of the effective C++ recommendations.  However, the check is
3252 extended to warn about the lack of virtual destructor in accessible
3253 non-polymorphic bases classes too.
3255 When selecting this option, be aware that the standard library
3256 headers do not obey all of these guidelines; use @samp{grep -v}
3257 to filter out those warnings.
3259 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
3260 @opindex Wstrict-null-sentinel
3261 @opindex Wno-strict-null-sentinel
3262 Warn about the use of an uncasted @code{NULL} as sentinel.  When
3263 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
3264 to @code{__null}.  Although it is a null pointer constant rather than a
3265 null pointer, it is guaranteed to be of the same size as a pointer.
3266 But this use is not portable across different compilers.
3268 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
3269 @opindex Wno-non-template-friend
3270 @opindex Wnon-template-friend
3271 Disable warnings when non-template friend functions are declared
3272 within a template.  In very old versions of GCC that predate implementation
3273 of the ISO standard, declarations such as 
3274 @samp{friend int foo(int)}, where the name of the friend is an unqualified-id,
3275 could be interpreted as a particular specialization of a template
3276 function; the warning exists to diagnose compatibility problems, 
3277 and is enabled by default.
3279 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
3280 @opindex Wold-style-cast
3281 @opindex Wno-old-style-cast
3282 Warn if an old-style (C-style) cast to a non-void type is used within
3283 a C++ program.  The new-style casts (@code{dynamic_cast},
3284 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
3285 less vulnerable to unintended effects and much easier to search for.
3287 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
3288 @opindex Woverloaded-virtual
3289 @opindex Wno-overloaded-virtual
3290 @cindex overloaded virtual function, warning
3291 @cindex warning for overloaded virtual function
3292 Warn when a function declaration hides virtual functions from a
3293 base class.  For example, in:
3295 @smallexample
3296 struct A @{
3297   virtual void f();
3300 struct B: public A @{
3301   void f(int);
3303 @end smallexample
3305 the @code{A} class version of @code{f} is hidden in @code{B}, and code
3306 like:
3308 @smallexample
3309 B* b;
3310 b->f();
3311 @end smallexample
3313 @noindent
3314 fails to compile.
3316 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
3317 @opindex Wno-pmf-conversions
3318 @opindex Wpmf-conversions
3319 Disable the diagnostic for converting a bound pointer to member function
3320 to a plain pointer.
3322 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
3323 @opindex Wsign-promo
3324 @opindex Wno-sign-promo
3325 Warn when overload resolution chooses a promotion from unsigned or
3326 enumerated type to a signed type, over a conversion to an unsigned type of
3327 the same size.  Previous versions of G++ tried to preserve
3328 unsignedness, but the standard mandates the current behavior.
3330 @item -Wtemplates @r{(C++ and Objective-C++ only)}
3331 @opindex Wtemplates
3332 @opindex Wno-templates
3333 Warn when a primary template declaration is encountered.  Some coding
3334 rules disallow templates, and this may be used to enforce that rule.
3335 The warning is inactive inside a system header file, such as the STL, so
3336 one can still use the STL.  One may also instantiate or specialize
3337 templates.
3339 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
3340 @opindex Wmultiple-inheritance
3341 @opindex Wno-multiple-inheritance
3342 Warn when a class is defined with multiple direct base classes.  Some
3343 coding rules disallow multiple inheritance, and this may be used to
3344 enforce that rule.  The warning is inactive inside a system header file,
3345 such as the STL, so one can still use the STL.  One may also define
3346 classes that indirectly use multiple inheritance.
3348 @item -Wvirtual-inheritance
3349 @opindex Wvirtual-inheritance
3350 @opindex Wno-virtual-inheritance
3351 Warn when a class is defined with a virtual direct base class.  Some
3352 coding rules disallow multiple inheritance, and this may be used to
3353 enforce that rule.  The warning is inactive inside a system header file,
3354 such as the STL, so one can still use the STL.  One may also define
3355 classes that indirectly use virtual inheritance.
3357 @item -Wnamespaces
3358 @opindex Wnamespaces
3359 @opindex Wno-namespaces
3360 Warn when a namespace definition is opened.  Some coding rules disallow
3361 namespaces, and this may be used to enforce that rule.  The warning is
3362 inactive inside a system header file, such as the STL, so one can still
3363 use the STL.  One may also use using directives and qualified names.
3365 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
3366 @opindex Wterminate
3367 @opindex Wno-terminate
3368 Disable the warning about a throw-expression that will immediately
3369 result in a call to @code{terminate}.
3370 @end table
3372 @node Objective-C and Objective-C++ Dialect Options
3373 @section Options Controlling Objective-C and Objective-C++ Dialects
3375 @cindex compiler options, Objective-C and Objective-C++
3376 @cindex Objective-C and Objective-C++ options, command-line
3377 @cindex options, Objective-C and Objective-C++
3378 (NOTE: This manual does not describe the Objective-C and Objective-C++
3379 languages themselves.  @xref{Standards,,Language Standards
3380 Supported by GCC}, for references.)
3382 This section describes the command-line options that are only meaningful
3383 for Objective-C and Objective-C++ programs.  You can also use most of
3384 the language-independent GNU compiler options.
3385 For example, you might compile a file @file{some_class.m} like this:
3387 @smallexample
3388 gcc -g -fgnu-runtime -O -c some_class.m
3389 @end smallexample
3391 @noindent
3392 In this example, @option{-fgnu-runtime} is an option meant only for
3393 Objective-C and Objective-C++ programs; you can use the other options with
3394 any language supported by GCC@.
3396 Note that since Objective-C is an extension of the C language, Objective-C
3397 compilations may also use options specific to the C front-end (e.g.,
3398 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
3399 C++-specific options (e.g., @option{-Wabi}).
3401 Here is a list of options that are @emph{only} for compiling Objective-C
3402 and Objective-C++ programs:
3404 @table @gcctabopt
3405 @item -fconstant-string-class=@var{class-name}
3406 @opindex fconstant-string-class
3407 Use @var{class-name} as the name of the class to instantiate for each
3408 literal string specified with the syntax @code{@@"@dots{}"}.  The default
3409 class name is @code{NXConstantString} if the GNU runtime is being used, and
3410 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
3411 @option{-fconstant-cfstrings} option, if also present, overrides the
3412 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
3413 to be laid out as constant CoreFoundation strings.
3415 @item -fgnu-runtime
3416 @opindex fgnu-runtime
3417 Generate object code compatible with the standard GNU Objective-C
3418 runtime.  This is the default for most types of systems.
3420 @item -fnext-runtime
3421 @opindex fnext-runtime
3422 Generate output compatible with the NeXT runtime.  This is the default
3423 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
3424 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
3425 used.
3427 @item -fno-nil-receivers
3428 @opindex fno-nil-receivers
3429 Assume that all Objective-C message dispatches (@code{[receiver
3430 message:arg]}) in this translation unit ensure that the receiver is
3431 not @code{nil}.  This allows for more efficient entry points in the
3432 runtime to be used.  This option is only available in conjunction with
3433 the NeXT runtime and ABI version 0 or 1.
3435 @item -fobjc-abi-version=@var{n}
3436 @opindex fobjc-abi-version
3437 Use version @var{n} of the Objective-C ABI for the selected runtime.
3438 This option is currently supported only for the NeXT runtime.  In that
3439 case, Version 0 is the traditional (32-bit) ABI without support for
3440 properties and other Objective-C 2.0 additions.  Version 1 is the
3441 traditional (32-bit) ABI with support for properties and other
3442 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
3443 nothing is specified, the default is Version 0 on 32-bit target
3444 machines, and Version 2 on 64-bit target machines.
3446 @item -fobjc-call-cxx-cdtors
3447 @opindex fobjc-call-cxx-cdtors
3448 For each Objective-C class, check if any of its instance variables is a
3449 C++ object with a non-trivial default constructor.  If so, synthesize a
3450 special @code{- (id) .cxx_construct} instance method which runs
3451 non-trivial default constructors on any such instance variables, in order,
3452 and then return @code{self}.  Similarly, check if any instance variable
3453 is a C++ object with a non-trivial destructor, and if so, synthesize a
3454 special @code{- (void) .cxx_destruct} method which runs
3455 all such default destructors, in reverse order.
3457 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
3458 methods thusly generated only operate on instance variables
3459 declared in the current Objective-C class, and not those inherited
3460 from superclasses.  It is the responsibility of the Objective-C
3461 runtime to invoke all such methods in an object's inheritance
3462 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
3463 by the runtime immediately after a new object instance is allocated;
3464 the @code{- (void) .cxx_destruct} methods are invoked immediately
3465 before the runtime deallocates an object instance.
3467 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3468 support for invoking the @code{- (id) .cxx_construct} and
3469 @code{- (void) .cxx_destruct} methods.
3471 @item -fobjc-direct-dispatch
3472 @opindex fobjc-direct-dispatch
3473 Allow fast jumps to the message dispatcher.  On Darwin this is
3474 accomplished via the comm page.
3476 @item -fobjc-exceptions
3477 @opindex fobjc-exceptions
3478 Enable syntactic support for structured exception handling in
3479 Objective-C, similar to what is offered by C++.  This option
3480 is required to use the Objective-C keywords @code{@@try},
3481 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3482 @code{@@synchronized}.  This option is available with both the GNU
3483 runtime and the NeXT runtime (but not available in conjunction with
3484 the NeXT runtime on Mac OS X 10.2 and earlier).
3486 @item -fobjc-gc
3487 @opindex fobjc-gc
3488 Enable garbage collection (GC) in Objective-C and Objective-C++
3489 programs.  This option is only available with the NeXT runtime; the
3490 GNU runtime has a different garbage collection implementation that
3491 does not require special compiler flags.
3493 @item -fobjc-nilcheck
3494 @opindex fobjc-nilcheck
3495 For the NeXT runtime with version 2 of the ABI, check for a nil
3496 receiver in method invocations before doing the actual method call.
3497 This is the default and can be disabled using
3498 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3499 checked for nil in this way no matter what this flag is set to.
3500 Currently this flag does nothing when the GNU runtime, or an older
3501 version of the NeXT runtime ABI, is used.
3503 @item -fobjc-std=objc1
3504 @opindex fobjc-std
3505 Conform to the language syntax of Objective-C 1.0, the language
3506 recognized by GCC 4.0.  This only affects the Objective-C additions to
3507 the C/C++ language; it does not affect conformance to C/C++ standards,
3508 which is controlled by the separate C/C++ dialect option flags.  When
3509 this option is used with the Objective-C or Objective-C++ compiler,
3510 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3511 This is useful if you need to make sure that your Objective-C code can
3512 be compiled with older versions of GCC@.
3514 @item -freplace-objc-classes
3515 @opindex freplace-objc-classes
3516 Emit a special marker instructing @command{ld(1)} not to statically link in
3517 the resulting object file, and allow @command{dyld(1)} to load it in at
3518 run time instead.  This is used in conjunction with the Fix-and-Continue
3519 debugging mode, where the object file in question may be recompiled and
3520 dynamically reloaded in the course of program execution, without the need
3521 to restart the program itself.  Currently, Fix-and-Continue functionality
3522 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3523 and later.
3525 @item -fzero-link
3526 @opindex fzero-link
3527 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3528 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3529 compile time) with static class references that get initialized at load time,
3530 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3531 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3532 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3533 for individual class implementations to be modified during program execution.
3534 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3535 regardless of command-line options.
3537 @item -fno-local-ivars
3538 @opindex fno-local-ivars
3539 @opindex flocal-ivars
3540 By default instance variables in Objective-C can be accessed as if
3541 they were local variables from within the methods of the class they're
3542 declared in.  This can lead to shadowing between instance variables
3543 and other variables declared either locally inside a class method or
3544 globally with the same name.  Specifying the @option{-fno-local-ivars}
3545 flag disables this behavior thus avoiding variable shadowing issues.
3547 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3548 @opindex fivar-visibility
3549 Set the default instance variable visibility to the specified option
3550 so that instance variables declared outside the scope of any access
3551 modifier directives default to the specified visibility.
3553 @item -gen-decls
3554 @opindex gen-decls
3555 Dump interface declarations for all classes seen in the source file to a
3556 file named @file{@var{sourcename}.decl}.
3558 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3559 @opindex Wassign-intercept
3560 @opindex Wno-assign-intercept
3561 Warn whenever an Objective-C assignment is being intercepted by the
3562 garbage collector.
3564 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3565 @opindex Wno-protocol
3566 @opindex Wprotocol
3567 If a class is declared to implement a protocol, a warning is issued for
3568 every method in the protocol that is not implemented by the class.  The
3569 default behavior is to issue a warning for every method not explicitly
3570 implemented in the class, even if a method implementation is inherited
3571 from the superclass.  If you use the @option{-Wno-protocol} option, then
3572 methods inherited from the superclass are considered to be implemented,
3573 and no warning is issued for them.
3575 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3576 @opindex Wselector
3577 @opindex Wno-selector
3578 Warn if multiple methods of different types for the same selector are
3579 found during compilation.  The check is performed on the list of methods
3580 in the final stage of compilation.  Additionally, a check is performed
3581 for each selector appearing in a @code{@@selector(@dots{})}
3582 expression, and a corresponding method for that selector has been found
3583 during compilation.  Because these checks scan the method table only at
3584 the end of compilation, these warnings are not produced if the final
3585 stage of compilation is not reached, for example because an error is
3586 found during compilation, or because the @option{-fsyntax-only} option is
3587 being used.
3589 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3590 @opindex Wstrict-selector-match
3591 @opindex Wno-strict-selector-match
3592 Warn if multiple methods with differing argument and/or return types are
3593 found for a given selector when attempting to send a message using this
3594 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3595 is off (which is the default behavior), the compiler omits such warnings
3596 if any differences found are confined to types that share the same size
3597 and alignment.
3599 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3600 @opindex Wundeclared-selector
3601 @opindex Wno-undeclared-selector
3602 Warn if a @code{@@selector(@dots{})} expression referring to an
3603 undeclared selector is found.  A selector is considered undeclared if no
3604 method with that name has been declared before the
3605 @code{@@selector(@dots{})} expression, either explicitly in an
3606 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3607 an @code{@@implementation} section.  This option always performs its
3608 checks as soon as a @code{@@selector(@dots{})} expression is found,
3609 while @option{-Wselector} only performs its checks in the final stage of
3610 compilation.  This also enforces the coding style convention
3611 that methods and selectors must be declared before being used.
3613 @item -print-objc-runtime-info
3614 @opindex print-objc-runtime-info
3615 Generate C header describing the largest structure that is passed by
3616 value, if any.
3618 @end table
3620 @node Diagnostic Message Formatting Options
3621 @section Options to Control Diagnostic Messages Formatting
3622 @cindex options to control diagnostics formatting
3623 @cindex diagnostic messages
3624 @cindex message formatting
3626 Traditionally, diagnostic messages have been formatted irrespective of
3627 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3628 options described below
3629 to control the formatting algorithm for diagnostic messages, 
3630 e.g.@: how many characters per line, how often source location
3631 information should be reported.  Note that some language front ends may not
3632 honor these options.
3634 @table @gcctabopt
3635 @item -fmessage-length=@var{n}
3636 @opindex fmessage-length
3637 Try to format error messages so that they fit on lines of about
3638 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3639 done; each error message appears on a single line.  This is the
3640 default for all front ends.
3642 Note - this option also affects the display of the @samp{#error} and
3643 @samp{#warning} pre-processor directives, and the @samp{deprecated}
3644 function/type/variable attribute.  It does not however affect the
3645 @samp{pragma GCC warning} and @samp{pragma GCC error} pragmas.
3647 @item -fdiagnostics-show-location=once
3648 @opindex fdiagnostics-show-location
3649 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3650 reporter to emit source location information @emph{once}; that is, in
3651 case the message is too long to fit on a single physical line and has to
3652 be wrapped, the source location won't be emitted (as prefix) again,
3653 over and over, in subsequent continuation lines.  This is the default
3654 behavior.
3656 @item -fdiagnostics-show-location=every-line
3657 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3658 messages reporter to emit the same source location information (as
3659 prefix) for physical lines that result from the process of breaking
3660 a message which is too long to fit on a single line.
3662 @item -fdiagnostics-color[=@var{WHEN}]
3663 @itemx -fno-diagnostics-color
3664 @opindex fdiagnostics-color
3665 @cindex highlight, color
3666 @vindex GCC_COLORS @r{environment variable}
3667 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3668 or @samp{auto}.  The default depends on how the compiler has been configured,
3669 it can be any of the above @var{WHEN} options or also @samp{never}
3670 if @env{GCC_COLORS} environment variable isn't present in the environment,
3671 and @samp{auto} otherwise.
3672 @samp{auto} means to use color only when the standard error is a terminal.
3673 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3674 aliases for @option{-fdiagnostics-color=always} and
3675 @option{-fdiagnostics-color=never}, respectively.
3677 The colors are defined by the environment variable @env{GCC_COLORS}.
3678 Its value is a colon-separated list of capabilities and Select Graphic
3679 Rendition (SGR) substrings. SGR commands are interpreted by the
3680 terminal or terminal emulator.  (See the section in the documentation
3681 of your text terminal for permitted values and their meanings as
3682 character attributes.)  These substring values are integers in decimal
3683 representation and can be concatenated with semicolons.
3684 Common values to concatenate include
3685 @samp{1} for bold,
3686 @samp{4} for underline,
3687 @samp{5} for blink,
3688 @samp{7} for inverse,
3689 @samp{39} for default foreground color,
3690 @samp{30} to @samp{37} for foreground colors,
3691 @samp{90} to @samp{97} for 16-color mode foreground colors,
3692 @samp{38;5;0} to @samp{38;5;255}
3693 for 88-color and 256-color modes foreground colors,
3694 @samp{49} for default background color,
3695 @samp{40} to @samp{47} for background colors,
3696 @samp{100} to @samp{107} for 16-color mode background colors,
3697 and @samp{48;5;0} to @samp{48;5;255}
3698 for 88-color and 256-color modes background colors.
3700 The default @env{GCC_COLORS} is
3701 @smallexample
3702 error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\
3703 quote=01:fixit-insert=32:fixit-delete=31:\
3704 diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32:\
3705 type-diff=01;32
3706 @end smallexample
3707 @noindent
3708 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3709 @samp{01;36} is bold cyan, @samp{32} is green, @samp{34} is blue,
3710 @samp{01} is bold, and @samp{31} is red.
3711 Setting @env{GCC_COLORS} to the empty string disables colors.
3712 Supported capabilities are as follows.
3714 @table @code
3715 @item error=
3716 @vindex error GCC_COLORS @r{capability}
3717 SGR substring for error: markers.
3719 @item warning=
3720 @vindex warning GCC_COLORS @r{capability}
3721 SGR substring for warning: markers.
3723 @item note=
3724 @vindex note GCC_COLORS @r{capability}
3725 SGR substring for note: markers.
3727 @item range1=
3728 @vindex range1 GCC_COLORS @r{capability}
3729 SGR substring for first additional range.
3731 @item range2=
3732 @vindex range2 GCC_COLORS @r{capability}
3733 SGR substring for second additional range.
3735 @item locus=
3736 @vindex locus GCC_COLORS @r{capability}
3737 SGR substring for location information, @samp{file:line} or
3738 @samp{file:line:column} etc.
3740 @item quote=
3741 @vindex quote GCC_COLORS @r{capability}
3742 SGR substring for information printed within quotes.
3744 @item fixit-insert=
3745 @vindex fixit-insert GCC_COLORS @r{capability}
3746 SGR substring for fix-it hints suggesting text to
3747 be inserted or replaced.
3749 @item fixit-delete=
3750 @vindex fixit-delete GCC_COLORS @r{capability}
3751 SGR substring for fix-it hints suggesting text to
3752 be deleted.
3754 @item diff-filename=
3755 @vindex diff-filename GCC_COLORS @r{capability}
3756 SGR substring for filename headers within generated patches.
3758 @item diff-hunk=
3759 @vindex diff-hunk GCC_COLORS @r{capability}
3760 SGR substring for the starts of hunks within generated patches.
3762 @item diff-delete=
3763 @vindex diff-delete GCC_COLORS @r{capability}
3764 SGR substring for deleted lines within generated patches.
3766 @item diff-insert=
3767 @vindex diff-insert GCC_COLORS @r{capability}
3768 SGR substring for inserted lines within generated patches.
3770 @item type-diff=
3771 @vindex type-diff GCC_COLORS @r{capability}
3772 SGR substring for highlighting mismatching types within template
3773 arguments in the C++ frontend.
3774 @end table
3776 @item -fno-diagnostics-show-option
3777 @opindex fno-diagnostics-show-option
3778 @opindex fdiagnostics-show-option
3779 By default, each diagnostic emitted includes text indicating the
3780 command-line option that directly controls the diagnostic (if such an
3781 option is known to the diagnostic machinery).  Specifying the
3782 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3784 @item -fno-diagnostics-show-caret
3785 @opindex fno-diagnostics-show-caret
3786 @opindex fdiagnostics-show-caret
3787 By default, each diagnostic emitted includes the original source line
3788 and a caret @samp{^} indicating the column.  This option suppresses this
3789 information.  The source line is truncated to @var{n} characters, if
3790 the @option{-fmessage-length=n} option is given.  When the output is done
3791 to the terminal, the width is limited to the width given by the
3792 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3794 @item -fno-diagnostics-show-labels
3795 @opindex fno-diagnostics-show-labels
3796 @opindex fdiagnostics-show-labels
3797 By default, when printing source code (via @option{-fdiagnostics-show-caret}),
3798 diagnostics can label ranges of source code with pertinent information, such
3799 as the types of expressions:
3801 @smallexample
3802     printf ("foo %s bar", long_i + long_j);
3803                  ~^       ~~~~~~~~~~~~~~~
3804                   |              |
3805                   char *         long int
3806 @end smallexample
3808 This option suppresses the printing of these labels (in the example above,
3809 the vertical bars and the ``char *'' and ``long int'' text).
3811 @item -fno-diagnostics-show-line-numbers
3812 @opindex fno-diagnostics-show-line-numbers
3813 @opindex fdiagnostics-show-line-numbers
3814 By default, when printing source code (via @option{-fdiagnostics-show-caret}),
3815 a left margin is printed, showing line numbers.  This option suppresses this
3816 left margin.
3818 @item -fdiagnostics-parseable-fixits
3819 @opindex fdiagnostics-parseable-fixits
3820 Emit fix-it hints in a machine-parseable format, suitable for consumption
3821 by IDEs.  For each fix-it, a line will be printed after the relevant
3822 diagnostic, starting with the string ``fix-it:''.  For example:
3824 @smallexample
3825 fix-it:"test.c":@{45:3-45:21@}:"gtk_widget_show_all"
3826 @end smallexample
3828 The location is expressed as a half-open range, expressed as a count of
3829 bytes, starting at byte 1 for the initial column.  In the above example,
3830 bytes 3 through 20 of line 45 of ``test.c'' are to be replaced with the
3831 given string:
3833 @smallexample
3834 00000000011111111112222222222
3835 12345678901234567890123456789
3836   gtk_widget_showall (dlg);
3837   ^^^^^^^^^^^^^^^^^^
3838   gtk_widget_show_all
3839 @end smallexample
3841 The filename and replacement string escape backslash as ``\\", tab as ``\t'',
3842 newline as ``\n'', double quotes as ``\"'', non-printable characters as octal
3843 (e.g. vertical tab as ``\013'').
3845 An empty replacement string indicates that the given range is to be removed.
3846 An empty range (e.g. ``45:3-45:3'') indicates that the string is to
3847 be inserted at the given position.
3849 @item -fdiagnostics-generate-patch
3850 @opindex fdiagnostics-generate-patch
3851 Print fix-it hints to stderr in unified diff format, after any diagnostics
3852 are printed.  For example:
3854 @smallexample
3855 --- test.c
3856 +++ test.c
3857 @@ -42,5 +42,5 @@
3859  void show_cb(GtkDialog *dlg)
3860  @{
3861 -  gtk_widget_showall(dlg);
3862 +  gtk_widget_show_all(dlg);
3863  @}
3865 @end smallexample
3867 The diff may or may not be colorized, following the same rules
3868 as for diagnostics (see @option{-fdiagnostics-color}).
3870 @item -fdiagnostics-show-template-tree
3871 @opindex fdiagnostics-show-template-tree
3873 In the C++ frontend, when printing diagnostics showing mismatching
3874 template types, such as:
3876 @smallexample
3877   could not convert 'std::map<int, std::vector<double> >()'
3878     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
3879 @end smallexample
3881 the @option{-fdiagnostics-show-template-tree} flag enables printing a
3882 tree-like structure showing the common and differing parts of the types,
3883 such as:
3885 @smallexample
3886   map<
3887     [...],
3888     vector<
3889       [double != float]>>
3890 @end smallexample
3892 The parts that differ are highlighted with color (``double'' and
3893 ``float'' in this case).
3895 @item -fno-elide-type
3896 @opindex fno-elide-type
3897 @opindex felide-type
3898 By default when the C++ frontend prints diagnostics showing mismatching
3899 template types, common parts of the types are printed as ``[...]'' to
3900 simplify the error message.  For example:
3902 @smallexample
3903   could not convert 'std::map<int, std::vector<double> >()'
3904     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
3905 @end smallexample
3907 Specifying the @option{-fno-elide-type} flag suppresses that behavior.
3908 This flag also affects the output of the
3909 @option{-fdiagnostics-show-template-tree} flag.
3911 @item -fno-show-column
3912 @opindex fno-show-column
3913 Do not print column numbers in diagnostics.  This may be necessary if
3914 diagnostics are being scanned by a program that does not understand the
3915 column numbers, such as @command{dejagnu}.
3917 @end table
3919 @node Warning Options
3920 @section Options to Request or Suppress Warnings
3921 @cindex options to control warnings
3922 @cindex warning messages
3923 @cindex messages, warning
3924 @cindex suppressing warnings
3926 Warnings are diagnostic messages that report constructions that
3927 are not inherently erroneous but that are risky or suggest there
3928 may have been an error.
3930 The following language-independent options do not enable specific
3931 warnings but control the kinds of diagnostics produced by GCC@.
3933 @table @gcctabopt
3934 @cindex syntax checking
3935 @item -fsyntax-only
3936 @opindex fsyntax-only
3937 Check the code for syntax errors, but don't do anything beyond that.
3939 @item -fmax-errors=@var{n}
3940 @opindex fmax-errors
3941 Limits the maximum number of error messages to @var{n}, at which point
3942 GCC bails out rather than attempting to continue processing the source
3943 code.  If @var{n} is 0 (the default), there is no limit on the number
3944 of error messages produced.  If @option{-Wfatal-errors} is also
3945 specified, then @option{-Wfatal-errors} takes precedence over this
3946 option.
3948 @item -w
3949 @opindex w
3950 Inhibit all warning messages.
3952 @item -Werror
3953 @opindex Werror
3954 @opindex Wno-error
3955 Make all warnings into errors.
3957 @item -Werror=
3958 @opindex Werror=
3959 @opindex Wno-error=
3960 Make the specified warning into an error.  The specifier for a warning
3961 is appended; for example @option{-Werror=switch} turns the warnings
3962 controlled by @option{-Wswitch} into errors.  This switch takes a
3963 negative form, to be used to negate @option{-Werror} for specific
3964 warnings; for example @option{-Wno-error=switch} makes
3965 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3966 is in effect.
3968 The warning message for each controllable warning includes the
3969 option that controls the warning.  That option can then be used with
3970 @option{-Werror=} and @option{-Wno-error=} as described above.
3971 (Printing of the option in the warning message can be disabled using the
3972 @option{-fno-diagnostics-show-option} flag.)
3974 Note that specifying @option{-Werror=}@var{foo} automatically implies
3975 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3976 imply anything.
3978 @item -Wfatal-errors
3979 @opindex Wfatal-errors
3980 @opindex Wno-fatal-errors
3981 This option causes the compiler to abort compilation on the first error
3982 occurred rather than trying to keep going and printing further error
3983 messages.
3985 @end table
3987 You can request many specific warnings with options beginning with
3988 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3989 implicit declarations.  Each of these specific warning options also
3990 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3991 example, @option{-Wno-implicit}.  This manual lists only one of the
3992 two forms, whichever is not the default.  For further
3993 language-specific options also refer to @ref{C++ Dialect Options} and
3994 @ref{Objective-C and Objective-C++ Dialect Options}.
3996 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3997 options, such as @option{-Wunused}, which may turn on further options,
3998 such as @option{-Wunused-value}. The combined effect of positive and
3999 negative forms is that more specific options have priority over less
4000 specific ones, independently of their position in the command-line. For
4001 options of the same specificity, the last one takes effect. Options
4002 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
4003 as if they appeared at the end of the command-line.
4005 When an unrecognized warning option is requested (e.g.,
4006 @option{-Wunknown-warning}), GCC emits a diagnostic stating
4007 that the option is not recognized.  However, if the @option{-Wno-} form
4008 is used, the behavior is slightly different: no diagnostic is
4009 produced for @option{-Wno-unknown-warning} unless other diagnostics
4010 are being produced.  This allows the use of new @option{-Wno-} options
4011 with old compilers, but if something goes wrong, the compiler
4012 warns that an unrecognized option is present.
4014 @table @gcctabopt
4015 @item -Wpedantic
4016 @itemx -pedantic
4017 @opindex pedantic
4018 @opindex Wpedantic
4019 @opindex Wno-pedantic
4020 Issue all the warnings demanded by strict ISO C and ISO C++;
4021 reject all programs that use forbidden extensions, and some other
4022 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
4023 version of the ISO C standard specified by any @option{-std} option used.
4025 Valid ISO C and ISO C++ programs should compile properly with or without
4026 this option (though a rare few require @option{-ansi} or a
4027 @option{-std} option specifying the required version of ISO C)@.  However,
4028 without this option, certain GNU extensions and traditional C and C++
4029 features are supported as well.  With this option, they are rejected.
4031 @option{-Wpedantic} does not cause warning messages for use of the
4032 alternate keywords whose names begin and end with @samp{__}.  Pedantic
4033 warnings are also disabled in the expression that follows
4034 @code{__extension__}.  However, only system header files should use
4035 these escape routes; application programs should avoid them.
4036 @xref{Alternate Keywords}.
4038 Some users try to use @option{-Wpedantic} to check programs for strict ISO
4039 C conformance.  They soon find that it does not do quite what they want:
4040 it finds some non-ISO practices, but not all---only those for which
4041 ISO C @emph{requires} a diagnostic, and some others for which
4042 diagnostics have been added.
4044 A feature to report any failure to conform to ISO C might be useful in
4045 some instances, but would require considerable additional work and would
4046 be quite different from @option{-Wpedantic}.  We don't have plans to
4047 support such a feature in the near future.
4049 Where the standard specified with @option{-std} represents a GNU
4050 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
4051 corresponding @dfn{base standard}, the version of ISO C on which the GNU
4052 extended dialect is based.  Warnings from @option{-Wpedantic} are given
4053 where they are required by the base standard.  (It does not make sense
4054 for such warnings to be given only for features not in the specified GNU
4055 C dialect, since by definition the GNU dialects of C include all
4056 features the compiler supports with the given option, and there would be
4057 nothing to warn about.)
4059 @item -pedantic-errors
4060 @opindex pedantic-errors
4061 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
4062 requires a diagnostic, in some cases where there is undefined behavior
4063 at compile-time and in some other cases that do not prevent compilation
4064 of programs that are valid according to the standard. This is not
4065 equivalent to @option{-Werror=pedantic}, since there are errors enabled
4066 by this option and not enabled by the latter and vice versa.
4068 @item -Wall
4069 @opindex Wall
4070 @opindex Wno-all
4071 This enables all the warnings about constructions that some users
4072 consider questionable, and that are easy to avoid (or modify to
4073 prevent the warning), even in conjunction with macros.  This also
4074 enables some language-specific warnings described in @ref{C++ Dialect
4075 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
4077 @option{-Wall} turns on the following warning flags:
4079 @gccoptlist{-Waddress   @gol
4080 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
4081 -Wbool-compare  @gol
4082 -Wbool-operation  @gol
4083 -Wc++11-compat  -Wc++14-compat  @gol
4084 -Wcatch-value @r{(C++ and Objective-C++ only)}  @gol
4085 -Wchar-subscripts  @gol
4086 -Wcomment  @gol
4087 -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
4088 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
4089 -Wformat   @gol
4090 -Wint-in-bool-context  @gol
4091 -Wimplicit @r{(C and Objective-C only)} @gol
4092 -Wimplicit-int @r{(C and Objective-C only)} @gol
4093 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
4094 -Winit-self @r{(only for C++)} @gol
4095 -Wlogical-not-parentheses @gol
4096 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
4097 -Wmaybe-uninitialized @gol
4098 -Wmemset-elt-size @gol
4099 -Wmemset-transposed-args @gol
4100 -Wmisleading-indentation @r{(only for C/C++)} @gol
4101 -Wmissing-attributes @gol
4102 -Wmissing-braces @r{(only for C/ObjC)} @gol
4103 -Wmultistatement-macros  @gol
4104 -Wnarrowing @r{(only for C++)}  @gol
4105 -Wnonnull  @gol
4106 -Wnonnull-compare  @gol
4107 -Wopenmp-simd @gol
4108 -Wparentheses  @gol
4109 -Wpessimizing-move @r{(only for C++)}  @gol
4110 -Wpointer-sign  @gol
4111 -Wreorder   @gol
4112 -Wrestrict   @gol
4113 -Wreturn-type  @gol
4114 -Wsequence-point  @gol
4115 -Wsign-compare @r{(only in C++)}  @gol
4116 -Wsizeof-pointer-div @gol
4117 -Wsizeof-pointer-memaccess @gol
4118 -Wstrict-aliasing  @gol
4119 -Wstrict-overflow=1  @gol
4120 -Wswitch  @gol
4121 -Wtautological-compare  @gol
4122 -Wtrigraphs  @gol
4123 -Wuninitialized  @gol
4124 -Wunknown-pragmas  @gol
4125 -Wunused-function  @gol
4126 -Wunused-label     @gol
4127 -Wunused-value     @gol
4128 -Wunused-variable  @gol
4129 -Wvolatile-register-var @gol
4132 Note that some warning flags are not implied by @option{-Wall}.  Some of
4133 them warn about constructions that users generally do not consider
4134 questionable, but which occasionally you might wish to check for;
4135 others warn about constructions that are necessary or hard to avoid in
4136 some cases, and there is no simple way to modify the code to suppress
4137 the warning. Some of them are enabled by @option{-Wextra} but many of
4138 them must be enabled individually.
4140 @item -Wextra
4141 @opindex W
4142 @opindex Wextra
4143 @opindex Wno-extra
4144 This enables some extra warning flags that are not enabled by
4145 @option{-Wall}. (This option used to be called @option{-W}.  The older
4146 name is still supported, but the newer name is more descriptive.)
4148 @gccoptlist{-Wclobbered  @gol
4149 -Wcast-function-type  @gol
4150 -Wempty-body  @gol
4151 -Wignored-qualifiers @gol
4152 -Wimplicit-fallthrough=3 @gol
4153 -Wmissing-field-initializers  @gol
4154 -Wmissing-parameter-type @r{(C only)}  @gol
4155 -Wold-style-declaration @r{(C only)}  @gol
4156 -Woverride-init  @gol
4157 -Wsign-compare @r{(C only)} @gol
4158 -Wredundant-move @r{(only for C++)}  @gol
4159 -Wtype-limits  @gol
4160 -Wuninitialized  @gol
4161 -Wshift-negative-value @r{(in C++03 and in C99 and newer)}  @gol
4162 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
4163 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
4166 The option @option{-Wextra} also prints warning messages for the
4167 following cases:
4169 @itemize @bullet
4171 @item
4172 A pointer is compared against integer zero with @code{<}, @code{<=},
4173 @code{>}, or @code{>=}.
4175 @item
4176 (C++ only) An enumerator and a non-enumerator both appear in a
4177 conditional expression.
4179 @item
4180 (C++ only) Ambiguous virtual bases.
4182 @item
4183 (C++ only) Subscripting an array that has been declared @code{register}.
4185 @item
4186 (C++ only) Taking the address of a variable that has been declared
4187 @code{register}.
4189 @item
4190 (C++ only) A base class is not initialized in the copy constructor
4191 of a derived class.
4193 @end itemize
4195 @item -Wchar-subscripts
4196 @opindex Wchar-subscripts
4197 @opindex Wno-char-subscripts
4198 Warn if an array subscript has type @code{char}.  This is a common cause
4199 of error, as programmers often forget that this type is signed on some
4200 machines.
4201 This warning is enabled by @option{-Wall}.
4203 @item -Wchkp
4204 @opindex Wchkp
4205 @opindex Wno-chkp
4206 Warn about an invalid memory access that is found by Pointer Bounds Checker
4207 (@option{-fcheck-pointer-bounds}).
4209 @item -Wno-coverage-mismatch
4210 @opindex Wno-coverage-mismatch
4211 @opindex Wcoverage-mismatch
4212 Warn if feedback profiles do not match when using the
4213 @option{-fprofile-use} option.
4214 If a source file is changed between compiling with @option{-fprofile-gen} and
4215 with @option{-fprofile-use}, the files with the profile feedback can fail
4216 to match the source file and GCC cannot use the profile feedback
4217 information.  By default, this warning is enabled and is treated as an
4218 error.  @option{-Wno-coverage-mismatch} can be used to disable the
4219 warning or @option{-Wno-error=coverage-mismatch} can be used to
4220 disable the error.  Disabling the error for this warning can result in
4221 poorly optimized code and is useful only in the
4222 case of very minor changes such as bug fixes to an existing code-base.
4223 Completely disabling the warning is not recommended.
4225 @item -Wno-cpp
4226 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
4228 Suppress warning messages emitted by @code{#warning} directives.
4230 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
4231 @opindex Wdouble-promotion
4232 @opindex Wno-double-promotion
4233 Give a warning when a value of type @code{float} is implicitly
4234 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
4235 floating-point unit implement @code{float} in hardware, but emulate
4236 @code{double} in software.  On such a machine, doing computations
4237 using @code{double} values is much more expensive because of the
4238 overhead required for software emulation.
4240 It is easy to accidentally do computations with @code{double} because
4241 floating-point literals are implicitly of type @code{double}.  For
4242 example, in:
4243 @smallexample
4244 @group
4245 float area(float radius)
4247    return 3.14159 * radius * radius;
4249 @end group
4250 @end smallexample
4251 the compiler performs the entire computation with @code{double}
4252 because the floating-point literal is a @code{double}.
4254 @item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
4255 @opindex Wduplicate-decl-specifier
4256 @opindex Wno-duplicate-decl-specifier
4257 Warn if a declaration has duplicate @code{const}, @code{volatile},
4258 @code{restrict} or @code{_Atomic} specifier.  This warning is enabled by
4259 @option{-Wall}.
4261 @item -Wformat
4262 @itemx -Wformat=@var{n}
4263 @opindex Wformat
4264 @opindex Wno-format
4265 @opindex ffreestanding
4266 @opindex fno-builtin
4267 @opindex Wformat=
4268 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
4269 the arguments supplied have types appropriate to the format string
4270 specified, and that the conversions specified in the format string make
4271 sense.  This includes standard functions, and others specified by format
4272 attributes (@pxref{Function Attributes}), in the @code{printf},
4273 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
4274 not in the C standard) families (or other target-specific families).
4275 Which functions are checked without format attributes having been
4276 specified depends on the standard version selected, and such checks of
4277 functions without the attribute specified are disabled by
4278 @option{-ffreestanding} or @option{-fno-builtin}.
4280 The formats are checked against the format features supported by GNU
4281 libc version 2.2.  These include all ISO C90 and C99 features, as well
4282 as features from the Single Unix Specification and some BSD and GNU
4283 extensions.  Other library implementations may not support all these
4284 features; GCC does not support warning about features that go beyond a
4285 particular library's limitations.  However, if @option{-Wpedantic} is used
4286 with @option{-Wformat}, warnings are given about format features not
4287 in the selected standard version (but not for @code{strfmon} formats,
4288 since those are not in any version of the C standard).  @xref{C Dialect
4289 Options,,Options Controlling C Dialect}.
4291 @table @gcctabopt
4292 @item -Wformat=1
4293 @itemx -Wformat
4294 @opindex Wformat
4295 @opindex Wformat=1
4296 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
4297 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
4298 @option{-Wformat} also checks for null format arguments for several
4299 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
4300 aspects of this level of format checking can be disabled by the
4301 options: @option{-Wno-format-contains-nul},
4302 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
4303 @option{-Wformat} is enabled by @option{-Wall}.
4305 @item -Wno-format-contains-nul
4306 @opindex Wno-format-contains-nul
4307 @opindex Wformat-contains-nul
4308 If @option{-Wformat} is specified, do not warn about format strings that
4309 contain NUL bytes.
4311 @item -Wno-format-extra-args
4312 @opindex Wno-format-extra-args
4313 @opindex Wformat-extra-args
4314 If @option{-Wformat} is specified, do not warn about excess arguments to a
4315 @code{printf} or @code{scanf} format function.  The C standard specifies
4316 that such arguments are ignored.
4318 Where the unused arguments lie between used arguments that are
4319 specified with @samp{$} operand number specifications, normally
4320 warnings are still given, since the implementation could not know what
4321 type to pass to @code{va_arg} to skip the unused arguments.  However,
4322 in the case of @code{scanf} formats, this option suppresses the
4323 warning if the unused arguments are all pointers, since the Single
4324 Unix Specification says that such unused arguments are allowed.
4326 @item -Wformat-overflow
4327 @itemx -Wformat-overflow=@var{level}
4328 @opindex Wformat-overflow
4329 @opindex Wno-format-overflow
4330 Warn about calls to formatted input/output functions such as @code{sprintf}
4331 and @code{vsprintf} that might overflow the destination buffer.  When the
4332 exact number of bytes written by a format directive cannot be determined
4333 at compile-time it is estimated based on heuristics that depend on the
4334 @var{level} argument and on optimization.  While enabling optimization
4335 will in most cases improve the accuracy of the warning, it may also
4336 result in false positives.
4338 @table @gcctabopt
4339 @item -Wformat-overflow
4340 @itemx -Wformat-overflow=1
4341 @opindex Wformat-overflow
4342 @opindex Wno-format-overflow
4343 Level @var{1} of @option{-Wformat-overflow} enabled by @option{-Wformat}
4344 employs a conservative approach that warns only about calls that most
4345 likely overflow the buffer.  At this level, numeric arguments to format
4346 directives with unknown values are assumed to have the value of one, and
4347 strings of unknown length to be empty.  Numeric arguments that are known
4348 to be bounded to a subrange of their type, or string arguments whose output
4349 is bounded either by their directive's precision or by a finite set of
4350 string literals, are assumed to take on the value within the range that
4351 results in the most bytes on output.  For example, the call to @code{sprintf}
4352 below is diagnosed because even with both @var{a} and @var{b} equal to zero,
4353 the terminating NUL character (@code{'\0'}) appended by the function
4354 to the destination buffer will be written past its end.  Increasing
4355 the size of the buffer by a single byte is sufficient to avoid the
4356 warning, though it may not be sufficient to avoid the overflow.
4358 @smallexample
4359 void f (int a, int b)
4361   char buf [13];
4362   sprintf (buf, "a = %i, b = %i\n", a, b);
4364 @end smallexample
4366 @item -Wformat-overflow=2
4367 Level @var{2} warns also about calls that might overflow the destination
4368 buffer given an argument of sufficient length or magnitude.  At level
4369 @var{2}, unknown numeric arguments are assumed to have the minimum
4370 representable value for signed types with a precision greater than 1, and
4371 the maximum representable value otherwise.  Unknown string arguments whose
4372 length cannot be assumed to be bounded either by the directive's precision,
4373 or by a finite set of string literals they may evaluate to, or the character
4374 array they may point to, are assumed to be 1 character long.
4376 At level @var{2}, the call in the example above is again diagnosed, but
4377 this time because with @var{a} equal to a 32-bit @code{INT_MIN} the first
4378 @code{%i} directive will write some of its digits beyond the end of
4379 the destination buffer.  To make the call safe regardless of the values
4380 of the two variables, the size of the destination buffer must be increased
4381 to at least 34 bytes.  GCC includes the minimum size of the buffer in
4382 an informational note following the warning.
4384 An alternative to increasing the size of the destination buffer is to
4385 constrain the range of formatted values.  The maximum length of string
4386 arguments can be bounded by specifying the precision in the format
4387 directive.  When numeric arguments of format directives can be assumed
4388 to be bounded by less than the precision of their type, choosing
4389 an appropriate length modifier to the format specifier will reduce
4390 the required buffer size.  For example, if @var{a} and @var{b} in the
4391 example above can be assumed to be within the precision of
4392 the @code{short int} type then using either the @code{%hi} format
4393 directive or casting the argument to @code{short} reduces the maximum
4394 required size of the buffer to 24 bytes.
4396 @smallexample
4397 void f (int a, int b)
4399   char buf [23];
4400   sprintf (buf, "a = %hi, b = %i\n", a, (short)b);
4402 @end smallexample
4403 @end table
4405 @item -Wno-format-zero-length
4406 @opindex Wno-format-zero-length
4407 @opindex Wformat-zero-length
4408 If @option{-Wformat} is specified, do not warn about zero-length formats.
4409 The C standard specifies that zero-length formats are allowed.
4412 @item -Wformat=2
4413 @opindex Wformat=2
4414 Enable @option{-Wformat} plus additional format checks.  Currently
4415 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
4416 -Wformat-y2k}.
4418 @item -Wformat-nonliteral
4419 @opindex Wformat-nonliteral
4420 @opindex Wno-format-nonliteral
4421 If @option{-Wformat} is specified, also warn if the format string is not a
4422 string literal and so cannot be checked, unless the format function
4423 takes its format arguments as a @code{va_list}.
4425 @item -Wformat-security
4426 @opindex Wformat-security
4427 @opindex Wno-format-security
4428 If @option{-Wformat} is specified, also warn about uses of format
4429 functions that represent possible security problems.  At present, this
4430 warns about calls to @code{printf} and @code{scanf} functions where the
4431 format string is not a string literal and there are no format arguments,
4432 as in @code{printf (foo);}.  This may be a security hole if the format
4433 string came from untrusted input and contains @samp{%n}.  (This is
4434 currently a subset of what @option{-Wformat-nonliteral} warns about, but
4435 in future warnings may be added to @option{-Wformat-security} that are not
4436 included in @option{-Wformat-nonliteral}.)
4438 @item -Wformat-signedness
4439 @opindex Wformat-signedness
4440 @opindex Wno-format-signedness
4441 If @option{-Wformat} is specified, also warn if the format string
4442 requires an unsigned argument and the argument is signed and vice versa.
4444 @item -Wformat-truncation
4445 @itemx -Wformat-truncation=@var{level}
4446 @opindex Wformat-truncation
4447 @opindex Wno-format-truncation
4448 Warn about calls to formatted input/output functions such as @code{snprintf}
4449 and @code{vsnprintf} that might result in output truncation.  When the exact
4450 number of bytes written by a format directive cannot be determined at
4451 compile-time it is estimated based on heuristics that depend on
4452 the @var{level} argument and on optimization.  While enabling optimization
4453 will in most cases improve the accuracy of the warning, it may also result
4454 in false positives.  Except as noted otherwise, the option uses the same
4455 logic @option{-Wformat-overflow}.
4457 @table @gcctabopt
4458 @item -Wformat-truncation
4459 @itemx -Wformat-truncation=1
4460 @opindex Wformat-truncation
4461 @opindex Wno-format-truncation
4462 Level @var{1} of @option{-Wformat-truncation} enabled by @option{-Wformat}
4463 employs a conservative approach that warns only about calls to bounded
4464 functions whose return value is unused and that will most likely result
4465 in output truncation.
4467 @item -Wformat-truncation=2
4468 Level @var{2} warns also about calls to bounded functions whose return
4469 value is used and that might result in truncation given an argument of
4470 sufficient length or magnitude.
4471 @end table
4473 @item -Wformat-y2k
4474 @opindex Wformat-y2k
4475 @opindex Wno-format-y2k
4476 If @option{-Wformat} is specified, also warn about @code{strftime}
4477 formats that may yield only a two-digit year.
4478 @end table
4480 @item -Wnonnull
4481 @opindex Wnonnull
4482 @opindex Wno-nonnull
4483 Warn about passing a null pointer for arguments marked as
4484 requiring a non-null value by the @code{nonnull} function attribute.
4486 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
4487 can be disabled with the @option{-Wno-nonnull} option.
4489 @item -Wnonnull-compare
4490 @opindex Wnonnull-compare
4491 @opindex Wno-nonnull-compare
4492 Warn when comparing an argument marked with the @code{nonnull}
4493 function attribute against null inside the function.
4495 @option{-Wnonnull-compare} is included in @option{-Wall}.  It
4496 can be disabled with the @option{-Wno-nonnull-compare} option.
4498 @item -Wnull-dereference
4499 @opindex Wnull-dereference
4500 @opindex Wno-null-dereference
4501 Warn if the compiler detects paths that trigger erroneous or
4502 undefined behavior due to dereferencing a null pointer.  This option
4503 is only active when @option{-fdelete-null-pointer-checks} is active,
4504 which is enabled by optimizations in most targets.  The precision of
4505 the warnings depends on the optimization options used.
4507 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
4508 @opindex Winit-self
4509 @opindex Wno-init-self
4510 Warn about uninitialized variables that are initialized with themselves.
4511 Note this option can only be used with the @option{-Wuninitialized} option.
4513 For example, GCC warns about @code{i} being uninitialized in the
4514 following snippet only when @option{-Winit-self} has been specified:
4515 @smallexample
4516 @group
4517 int f()
4519   int i = i;
4520   return i;
4522 @end group
4523 @end smallexample
4525 This warning is enabled by @option{-Wall} in C++.
4527 @item -Wimplicit-int @r{(C and Objective-C only)}
4528 @opindex Wimplicit-int
4529 @opindex Wno-implicit-int
4530 Warn when a declaration does not specify a type.
4531 This warning is enabled by @option{-Wall}.
4533 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
4534 @opindex Wimplicit-function-declaration
4535 @opindex Wno-implicit-function-declaration
4536 Give a warning whenever a function is used before being declared. In
4537 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
4538 enabled by default and it is made into an error by
4539 @option{-pedantic-errors}. This warning is also enabled by
4540 @option{-Wall}.
4542 @item -Wimplicit @r{(C and Objective-C only)}
4543 @opindex Wimplicit
4544 @opindex Wno-implicit
4545 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
4546 This warning is enabled by @option{-Wall}.
4548 @item -Wimplicit-fallthrough
4549 @opindex Wimplicit-fallthrough
4550 @opindex Wno-implicit-fallthrough
4551 @option{-Wimplicit-fallthrough} is the same as @option{-Wimplicit-fallthrough=3}
4552 and @option{-Wno-implicit-fallthrough} is the same as
4553 @option{-Wimplicit-fallthrough=0}.
4555 @item -Wimplicit-fallthrough=@var{n}
4556 @opindex Wimplicit-fallthrough=
4557 Warn when a switch case falls through.  For example:
4559 @smallexample
4560 @group
4561 switch (cond)
4562   @{
4563   case 1:
4564     a = 1;
4565     break;
4566   case 2:
4567     a = 2;
4568   case 3:
4569     a = 3;
4570     break;
4571   @}
4572 @end group
4573 @end smallexample
4575 This warning does not warn when the last statement of a case cannot
4576 fall through, e.g. when there is a return statement or a call to function
4577 declared with the noreturn attribute.  @option{-Wimplicit-fallthrough=}
4578 also takes into account control flow statements, such as ifs, and only
4579 warns when appropriate.  E.g.@:
4581 @smallexample
4582 @group
4583 switch (cond)
4584   @{
4585   case 1:
4586     if (i > 3) @{
4587       bar (5);
4588       break;
4589     @} else if (i < 1) @{
4590       bar (0);
4591     @} else
4592       return;
4593   default:
4594     @dots{}
4595   @}
4596 @end group
4597 @end smallexample
4599 Since there are occasions where a switch case fall through is desirable,
4600 GCC provides an attribute, @code{__attribute__ ((fallthrough))}, that is
4601 to be used along with a null statement to suppress this warning that
4602 would normally occur:
4604 @smallexample
4605 @group
4606 switch (cond)
4607   @{
4608   case 1:
4609     bar (0);
4610     __attribute__ ((fallthrough));
4611   default:
4612     @dots{}
4613   @}
4614 @end group
4615 @end smallexample
4617 C++17 provides a standard way to suppress the @option{-Wimplicit-fallthrough}
4618 warning using @code{[[fallthrough]];} instead of the GNU attribute.  In C++11
4619 or C++14 users can use @code{[[gnu::fallthrough]];}, which is a GNU extension.
4620 Instead of these attributes, it is also possible to add a fallthrough comment
4621 to silence the warning.  The whole body of the C or C++ style comment should
4622 match the given regular expressions listed below.  The option argument @var{n}
4623 specifies what kind of comments are accepted:
4625 @itemize @bullet
4627 @item @option{-Wimplicit-fallthrough=0} disables the warning altogether.
4629 @item @option{-Wimplicit-fallthrough=1} matches @code{.*} regular
4630 expression, any comment is used as fallthrough comment.
4632 @item @option{-Wimplicit-fallthrough=2} case insensitively matches
4633 @code{.*falls?[ \t-]*thr(ough|u).*} regular expression.
4635 @item @option{-Wimplicit-fallthrough=3} case sensitively matches one of the
4636 following regular expressions:
4638 @itemize @bullet
4640 @item @code{-fallthrough}
4642 @item @code{@@fallthrough@@}
4644 @item @code{lint -fallthrough[ \t]*}
4646 @item @code{[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?@*FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?}
4648 @item @code{[ \t.!]*(Else,? |Intentional(ly)? )?@*Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4650 @item @code{[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?@*fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4652 @end itemize
4654 @item @option{-Wimplicit-fallthrough=4} case sensitively matches one of the
4655 following regular expressions:
4657 @itemize @bullet
4659 @item @code{-fallthrough}
4661 @item @code{@@fallthrough@@}
4663 @item @code{lint -fallthrough[ \t]*}
4665 @item @code{[ \t]*FALLTHR(OUGH|U)[ \t]*}
4667 @end itemize
4669 @item @option{-Wimplicit-fallthrough=5} doesn't recognize any comments as
4670 fallthrough comments, only attributes disable the warning.
4672 @end itemize
4674 The comment needs to be followed after optional whitespace and other comments
4675 by @code{case} or @code{default} keywords or by a user label that precedes some
4676 @code{case} or @code{default} label.
4678 @smallexample
4679 @group
4680 switch (cond)
4681   @{
4682   case 1:
4683     bar (0);
4684     /* FALLTHRU */
4685   default:
4686     @dots{}
4687   @}
4688 @end group
4689 @end smallexample
4691 The @option{-Wimplicit-fallthrough=3} warning is enabled by @option{-Wextra}.
4693 @item -Wif-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
4694 @opindex Wif-not-aligned
4695 @opindex Wno-if-not-aligned
4696 Control if warning triggered by the @code{warn_if_not_aligned} attribute
4697 should be issued.  This is enabled by default.
4698 Use @option{-Wno-if-not-aligned} to disable it.
4700 @item -Wignored-qualifiers @r{(C and C++ only)}
4701 @opindex Wignored-qualifiers
4702 @opindex Wno-ignored-qualifiers
4703 Warn if the return type of a function has a type qualifier
4704 such as @code{const}.  For ISO C such a type qualifier has no effect,
4705 since the value returned by a function is not an lvalue.
4706 For C++, the warning is only emitted for scalar types or @code{void}.
4707 ISO C prohibits qualified @code{void} return types on function
4708 definitions, so such return types always receive a warning
4709 even without this option.
4711 This warning is also enabled by @option{-Wextra}.
4713 @item -Wignored-attributes @r{(C and C++ only)}
4714 @opindex Wignored-attributes
4715 @opindex Wno-ignored-attributes
4716 Warn when an attribute is ignored.  This is different from the
4717 @option{-Wattributes} option in that it warns whenever the compiler decides
4718 to drop an attribute, not that the attribute is either unknown, used in a
4719 wrong place, etc.  This warning is enabled by default.
4721 @item -Wmain
4722 @opindex Wmain
4723 @opindex Wno-main
4724 Warn if the type of @code{main} is suspicious.  @code{main} should be
4725 a function with external linkage, returning int, taking either zero
4726 arguments, two, or three arguments of appropriate types.  This warning
4727 is enabled by default in C++ and is enabled by either @option{-Wall}
4728 or @option{-Wpedantic}.
4730 @item -Wmisleading-indentation @r{(C and C++ only)}
4731 @opindex Wmisleading-indentation
4732 @opindex Wno-misleading-indentation
4733 Warn when the indentation of the code does not reflect the block structure.
4734 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
4735 @code{for} clauses with a guarded statement that does not use braces,
4736 followed by an unguarded statement with the same indentation.
4738 In the following example, the call to ``bar'' is misleadingly indented as
4739 if it were guarded by the ``if'' conditional.
4741 @smallexample
4742   if (some_condition ())
4743     foo ();
4744     bar ();  /* Gotcha: this is not guarded by the "if".  */
4745 @end smallexample
4747 In the case of mixed tabs and spaces, the warning uses the
4748 @option{-ftabstop=} option to determine if the statements line up
4749 (defaulting to 8).
4751 The warning is not issued for code involving multiline preprocessor logic
4752 such as the following example.
4754 @smallexample
4755   if (flagA)
4756     foo (0);
4757 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
4758   if (flagB)
4759 #endif
4760     foo (1);
4761 @end smallexample
4763 The warning is not issued after a @code{#line} directive, since this
4764 typically indicates autogenerated code, and no assumptions can be made
4765 about the layout of the file that the directive references.
4767 This warning is enabled by @option{-Wall} in C and C++.
4769 @item -Wmissing-attributes
4770 @opindex Wmissing-attributes
4771 @opindex Wno-missing-attributes
4772 Warn when a declaration of a function is missing one or more attributes
4773 that a related function is declared with and whose absence may adversely
4774 affect the correctness or efficiency of generated code.  For example, in
4775 C++, the warning is issued when an explicit specialization of a primary
4776 template declared with attribute @code{alloc_align}, @code{alloc_size},
4777 @code{assume_aligned}, @code{format}, @code{format_arg}, @code{malloc},
4778 or @code{nonnull} is declared without it.  Attributes @code{deprecated},
4779 @code{error}, and @code{warning} suppress the warning.
4780 (@pxref{Function Attributes}).
4782 @option{-Wmissing-attributes} is enabled by @option{-Wall}.
4784 For example, since the declaration of the primary function template
4785 below makes use of both attribute @code{malloc} and @code{alloc_size}
4786 the declaration of the explicit specialization of the template is
4787 diagnosed because it is missing one of the attributes.
4789 @smallexample
4790 template <class T>
4791 T* __attribute__ ((malloc, alloc_size (1)))
4792 allocate (size_t);
4794 template <>
4795 void* __attribute__ ((malloc))   // missing alloc_size
4796 allocate<void> (size_t);
4797 @end smallexample
4799 @item -Wmissing-braces
4800 @opindex Wmissing-braces
4801 @opindex Wno-missing-braces
4802 Warn if an aggregate or union initializer is not fully bracketed.  In
4803 the following example, the initializer for @code{a} is not fully
4804 bracketed, but that for @code{b} is fully bracketed.  This warning is
4805 enabled by @option{-Wall} in C.
4807 @smallexample
4808 int a[2][2] = @{ 0, 1, 2, 3 @};
4809 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
4810 @end smallexample
4812 This warning is enabled by @option{-Wall}.
4814 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
4815 @opindex Wmissing-include-dirs
4816 @opindex Wno-missing-include-dirs
4817 Warn if a user-supplied include directory does not exist.
4819 @item -Wmultistatement-macros
4820 @opindex Wmultistatement-macros
4821 @opindex Wno-multistatement-macros
4822 Warn about unsafe multiple statement macros that appear to be guarded
4823 by a clause such as @code{if}, @code{else}, @code{for}, @code{switch}, or
4824 @code{while}, in which only the first statement is actually guarded after
4825 the macro is expanded.
4827 For example:
4829 @smallexample
4830 #define DOIT x++; y++
4831 if (c)
4832   DOIT;
4833 @end smallexample
4835 will increment @code{y} unconditionally, not just when @code{c} holds.
4836 The can usually be fixed by wrapping the macro in a do-while loop:
4837 @smallexample
4838 #define DOIT do @{ x++; y++; @} while (0)
4839 if (c)
4840   DOIT;
4841 @end smallexample
4843 This warning is enabled by @option{-Wall} in C and C++.
4845 @item -Wparentheses
4846 @opindex Wparentheses
4847 @opindex Wno-parentheses
4848 Warn if parentheses are omitted in certain contexts, such
4849 as when there is an assignment in a context where a truth value
4850 is expected, or when operators are nested whose precedence people
4851 often get confused about.
4853 Also warn if a comparison like @code{x<=y<=z} appears; this is
4854 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
4855 interpretation from that of ordinary mathematical notation.
4857 Also warn for dangerous uses of the GNU extension to
4858 @code{?:} with omitted middle operand. When the condition
4859 in the @code{?}: operator is a boolean expression, the omitted value is
4860 always 1.  Often programmers expect it to be a value computed
4861 inside the conditional expression instead.
4863 For C++ this also warns for some cases of unnecessary parentheses in
4864 declarations, which can indicate an attempt at a function call instead
4865 of a declaration:
4866 @smallexample
4868   // Declares a local variable called mymutex.
4869   std::unique_lock<std::mutex> (mymutex);
4870   // User meant std::unique_lock<std::mutex> lock (mymutex);
4872 @end smallexample
4874 This warning is enabled by @option{-Wall}.
4876 @item -Wsequence-point
4877 @opindex Wsequence-point
4878 @opindex Wno-sequence-point
4879 Warn about code that may have undefined semantics because of violations
4880 of sequence point rules in the C and C++ standards.
4882 The C and C++ standards define the order in which expressions in a C/C++
4883 program are evaluated in terms of @dfn{sequence points}, which represent
4884 a partial ordering between the execution of parts of the program: those
4885 executed before the sequence point, and those executed after it.  These
4886 occur after the evaluation of a full expression (one which is not part
4887 of a larger expression), after the evaluation of the first operand of a
4888 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
4889 function is called (but after the evaluation of its arguments and the
4890 expression denoting the called function), and in certain other places.
4891 Other than as expressed by the sequence point rules, the order of
4892 evaluation of subexpressions of an expression is not specified.  All
4893 these rules describe only a partial order rather than a total order,
4894 since, for example, if two functions are called within one expression
4895 with no sequence point between them, the order in which the functions
4896 are called is not specified.  However, the standards committee have
4897 ruled that function calls do not overlap.
4899 It is not specified when between sequence points modifications to the
4900 values of objects take effect.  Programs whose behavior depends on this
4901 have undefined behavior; the C and C++ standards specify that ``Between
4902 the previous and next sequence point an object shall have its stored
4903 value modified at most once by the evaluation of an expression.
4904 Furthermore, the prior value shall be read only to determine the value
4905 to be stored.''.  If a program breaks these rules, the results on any
4906 particular implementation are entirely unpredictable.
4908 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
4909 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
4910 diagnosed by this option, and it may give an occasional false positive
4911 result, but in general it has been found fairly effective at detecting
4912 this sort of problem in programs.
4914 The C++17 standard will define the order of evaluation of operands in
4915 more cases: in particular it requires that the right-hand side of an
4916 assignment be evaluated before the left-hand side, so the above
4917 examples are no longer undefined.  But this warning will still warn
4918 about them, to help people avoid writing code that is undefined in C
4919 and earlier revisions of C++.
4921 The standard is worded confusingly, therefore there is some debate
4922 over the precise meaning of the sequence point rules in subtle cases.
4923 Links to discussions of the problem, including proposed formal
4924 definitions, may be found on the GCC readings page, at
4925 @uref{http://gcc.gnu.org/@/readings.html}.
4927 This warning is enabled by @option{-Wall} for C and C++.
4929 @item -Wno-return-local-addr
4930 @opindex Wno-return-local-addr
4931 @opindex Wreturn-local-addr
4932 Do not warn about returning a pointer (or in C++, a reference) to a
4933 variable that goes out of scope after the function returns.
4935 @item -Wreturn-type
4936 @opindex Wreturn-type
4937 @opindex Wno-return-type
4938 Warn whenever a function is defined with a return type that defaults
4939 to @code{int}.  Also warn about any @code{return} statement with no
4940 return value in a function whose return type is not @code{void}
4941 (falling off the end of the function body is considered returning
4942 without a value).
4944 For C only, warn about a @code{return} statement with an expression in a
4945 function whose return type is @code{void}, unless the expression type is
4946 also @code{void}.  As a GNU extension, the latter case is accepted
4947 without a warning unless @option{-Wpedantic} is used.
4949 For C++, a function without return type always produces a diagnostic
4950 message, even when @option{-Wno-return-type} is specified.  The only
4951 exceptions are @code{main} and functions defined in system headers.
4953 This warning is enabled by default for C++ and is enabled by @option{-Wall}.
4955 @item -Wshift-count-negative
4956 @opindex Wshift-count-negative
4957 @opindex Wno-shift-count-negative
4958 Warn if shift count is negative. This warning is enabled by default.
4960 @item -Wshift-count-overflow
4961 @opindex Wshift-count-overflow
4962 @opindex Wno-shift-count-overflow
4963 Warn if shift count >= width of type. This warning is enabled by default.
4965 @item -Wshift-negative-value
4966 @opindex Wshift-negative-value
4967 @opindex Wno-shift-negative-value
4968 Warn if left shifting a negative value.  This warning is enabled by
4969 @option{-Wextra} in C99 and C++11 modes (and newer).
4971 @item -Wshift-overflow
4972 @itemx -Wshift-overflow=@var{n}
4973 @opindex Wshift-overflow
4974 @opindex Wno-shift-overflow
4975 Warn about left shift overflows.  This warning is enabled by
4976 default in C99 and C++11 modes (and newer).
4978 @table @gcctabopt
4979 @item -Wshift-overflow=1
4980 This is the warning level of @option{-Wshift-overflow} and is enabled
4981 by default in C99 and C++11 modes (and newer).  This warning level does
4982 not warn about left-shifting 1 into the sign bit.  (However, in C, such
4983 an overflow is still rejected in contexts where an integer constant expression
4984 is required.)
4986 @item -Wshift-overflow=2
4987 This warning level also warns about left-shifting 1 into the sign bit,
4988 unless C++14 mode is active.
4989 @end table
4991 @item -Wswitch
4992 @opindex Wswitch
4993 @opindex Wno-switch
4994 Warn whenever a @code{switch} statement has an index of enumerated type
4995 and lacks a @code{case} for one or more of the named codes of that
4996 enumeration.  (The presence of a @code{default} label prevents this
4997 warning.)  @code{case} labels outside the enumeration range also
4998 provoke warnings when this option is used (even if there is a
4999 @code{default} label).
5000 This warning is enabled by @option{-Wall}.
5002 @item -Wswitch-default
5003 @opindex Wswitch-default
5004 @opindex Wno-switch-default
5005 Warn whenever a @code{switch} statement does not have a @code{default}
5006 case.
5008 @item -Wswitch-enum
5009 @opindex Wswitch-enum
5010 @opindex Wno-switch-enum
5011 Warn whenever a @code{switch} statement has an index of enumerated type
5012 and lacks a @code{case} for one or more of the named codes of that
5013 enumeration.  @code{case} labels outside the enumeration range also
5014 provoke warnings when this option is used.  The only difference
5015 between @option{-Wswitch} and this option is that this option gives a
5016 warning about an omitted enumeration code even if there is a
5017 @code{default} label.
5019 @item -Wswitch-bool
5020 @opindex Wswitch-bool
5021 @opindex Wno-switch-bool
5022 Warn whenever a @code{switch} statement has an index of boolean type
5023 and the case values are outside the range of a boolean type.
5024 It is possible to suppress this warning by casting the controlling
5025 expression to a type other than @code{bool}.  For example:
5026 @smallexample
5027 @group
5028 switch ((int) (a == 4))
5029   @{
5030   @dots{}
5031   @}
5032 @end group
5033 @end smallexample
5034 This warning is enabled by default for C and C++ programs.
5036 @item -Wswitch-unreachable
5037 @opindex Wswitch-unreachable
5038 @opindex Wno-switch-unreachable
5039 Warn whenever a @code{switch} statement contains statements between the
5040 controlling expression and the first case label, which will never be
5041 executed.  For example:
5042 @smallexample
5043 @group
5044 switch (cond)
5045   @{
5046    i = 15;
5047   @dots{}
5048    case 5:
5049   @dots{}
5050   @}
5051 @end group
5052 @end smallexample
5053 @option{-Wswitch-unreachable} does not warn if the statement between the
5054 controlling expression and the first case label is just a declaration:
5055 @smallexample
5056 @group
5057 switch (cond)
5058   @{
5059    int i;
5060   @dots{}
5061    case 5:
5062    i = 5;
5063   @dots{}
5064   @}
5065 @end group
5066 @end smallexample
5067 This warning is enabled by default for C and C++ programs.
5069 @item -Wsync-nand @r{(C and C++ only)}
5070 @opindex Wsync-nand
5071 @opindex Wno-sync-nand
5072 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
5073 built-in functions are used.  These functions changed semantics in GCC 4.4.
5075 @item -Wunused-but-set-parameter
5076 @opindex Wunused-but-set-parameter
5077 @opindex Wno-unused-but-set-parameter
5078 Warn whenever a function parameter is assigned to, but otherwise unused
5079 (aside from its declaration).
5081 To suppress this warning use the @code{unused} attribute
5082 (@pxref{Variable Attributes}).
5084 This warning is also enabled by @option{-Wunused} together with
5085 @option{-Wextra}.
5087 @item -Wunused-but-set-variable
5088 @opindex Wunused-but-set-variable
5089 @opindex Wno-unused-but-set-variable
5090 Warn whenever a local variable is assigned to, but otherwise unused
5091 (aside from its declaration).
5092 This warning is enabled by @option{-Wall}.
5094 To suppress this warning use the @code{unused} attribute
5095 (@pxref{Variable Attributes}).
5097 This warning is also enabled by @option{-Wunused}, which is enabled
5098 by @option{-Wall}.
5100 @item -Wunused-function
5101 @opindex Wunused-function
5102 @opindex Wno-unused-function
5103 Warn whenever a static function is declared but not defined or a
5104 non-inline static function is unused.
5105 This warning is enabled by @option{-Wall}.
5107 @item -Wunused-label
5108 @opindex Wunused-label
5109 @opindex Wno-unused-label
5110 Warn whenever a label is declared but not used.
5111 This warning is enabled by @option{-Wall}.
5113 To suppress this warning use the @code{unused} attribute
5114 (@pxref{Variable Attributes}).
5116 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
5117 @opindex Wunused-local-typedefs
5118 @opindex Wno-unused-local-typedefs
5119 Warn when a typedef locally defined in a function is not used.
5120 This warning is enabled by @option{-Wall}.
5122 @item -Wunused-parameter
5123 @opindex Wunused-parameter
5124 @opindex Wno-unused-parameter
5125 Warn whenever a function parameter is unused aside from its declaration.
5127 To suppress this warning use the @code{unused} attribute
5128 (@pxref{Variable Attributes}).
5130 @item -Wno-unused-result
5131 @opindex Wunused-result
5132 @opindex Wno-unused-result
5133 Do not warn if a caller of a function marked with attribute
5134 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
5135 its return value. The default is @option{-Wunused-result}.
5137 @item -Wunused-variable
5138 @opindex Wunused-variable
5139 @opindex Wno-unused-variable
5140 Warn whenever a local or static variable is unused aside from its
5141 declaration. This option implies @option{-Wunused-const-variable=1} for C,
5142 but not for C++. This warning is enabled by @option{-Wall}.
5144 To suppress this warning use the @code{unused} attribute
5145 (@pxref{Variable Attributes}).
5147 @item -Wunused-const-variable
5148 @itemx -Wunused-const-variable=@var{n}
5149 @opindex Wunused-const-variable
5150 @opindex Wno-unused-const-variable
5151 Warn whenever a constant static variable is unused aside from its declaration.
5152 @option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
5153 for C, but not for C++. In C this declares variable storage, but in C++ this
5154 is not an error since const variables take the place of @code{#define}s.
5156 To suppress this warning use the @code{unused} attribute
5157 (@pxref{Variable Attributes}).
5159 @table @gcctabopt
5160 @item -Wunused-const-variable=1
5161 This is the warning level that is enabled by @option{-Wunused-variable} for
5162 C.  It warns only about unused static const variables defined in the main
5163 compilation unit, but not about static const variables declared in any
5164 header included.
5166 @item -Wunused-const-variable=2
5167 This warning level also warns for unused constant static variables in
5168 headers (excluding system headers).  This is the warning level of
5169 @option{-Wunused-const-variable} and must be explicitly requested since
5170 in C++ this isn't an error and in C it might be harder to clean up all
5171 headers included.
5172 @end table
5174 @item -Wunused-value
5175 @opindex Wunused-value
5176 @opindex Wno-unused-value
5177 Warn whenever a statement computes a result that is explicitly not
5178 used. To suppress this warning cast the unused expression to
5179 @code{void}. This includes an expression-statement or the left-hand
5180 side of a comma expression that contains no side effects. For example,
5181 an expression such as @code{x[i,j]} causes a warning, while
5182 @code{x[(void)i,j]} does not.
5184 This warning is enabled by @option{-Wall}.
5186 @item -Wunused
5187 @opindex Wunused
5188 @opindex Wno-unused
5189 All the above @option{-Wunused} options combined.
5191 In order to get a warning about an unused function parameter, you must
5192 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
5193 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
5195 @item -Wuninitialized
5196 @opindex Wuninitialized
5197 @opindex Wno-uninitialized
5198 Warn if an automatic variable is used without first being initialized
5199 or if a variable may be clobbered by a @code{setjmp} call. In C++,
5200 warn if a non-static reference or non-static @code{const} member
5201 appears in a class without constructors.
5203 If you want to warn about code that uses the uninitialized value of the
5204 variable in its own initializer, use the @option{-Winit-self} option.
5206 These warnings occur for individual uninitialized or clobbered
5207 elements of structure, union or array variables as well as for
5208 variables that are uninitialized or clobbered as a whole.  They do
5209 not occur for variables or elements declared @code{volatile}.  Because
5210 these warnings depend on optimization, the exact variables or elements
5211 for which there are warnings depends on the precise optimization
5212 options and version of GCC used.
5214 Note that there may be no warning about a variable that is used only
5215 to compute a value that itself is never used, because such
5216 computations may be deleted by data flow analysis before the warnings
5217 are printed.
5219 @item -Winvalid-memory-model
5220 @opindex Winvalid-memory-model
5221 @opindex Wno-invalid-memory-model
5222 Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
5223 and the C11 atomic generic functions with a memory consistency argument
5224 that is either invalid for the operation or outside the range of values
5225 of the @code{memory_order} enumeration.  For example, since the
5226 @code{__atomic_store} and @code{__atomic_store_n} built-ins are only
5227 defined for the relaxed, release, and sequentially consistent memory
5228 orders the following code is diagnosed:
5230 @smallexample
5231 void store (int *i)
5233   __atomic_store_n (i, 0, memory_order_consume);
5235 @end smallexample
5237 @option{-Winvalid-memory-model} is enabled by default.
5239 @item -Wmaybe-uninitialized
5240 @opindex Wmaybe-uninitialized
5241 @opindex Wno-maybe-uninitialized
5242 For an automatic (i.e.@ local) variable, if there exists a path from the
5243 function entry to a use of the variable that is initialized, but there exist
5244 some other paths for which the variable is not initialized, the compiler
5245 emits a warning if it cannot prove the uninitialized paths are not
5246 executed at run time.
5248 These warnings are only possible in optimizing compilation, because otherwise
5249 GCC does not keep track of the state of variables.
5251 These warnings are made optional because GCC may not be able to determine when
5252 the code is correct in spite of appearing to have an error.  Here is one
5253 example of how this can happen:
5255 @smallexample
5256 @group
5258   int x;
5259   switch (y)
5260     @{
5261     case 1: x = 1;
5262       break;
5263     case 2: x = 4;
5264       break;
5265     case 3: x = 5;
5266     @}
5267   foo (x);
5269 @end group
5270 @end smallexample
5272 @noindent
5273 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
5274 always initialized, but GCC doesn't know this. To suppress the
5275 warning, you need to provide a default case with assert(0) or
5276 similar code.
5278 @cindex @code{longjmp} warnings
5279 This option also warns when a non-volatile automatic variable might be
5280 changed by a call to @code{longjmp}.
5281 The compiler sees only the calls to @code{setjmp}.  It cannot know
5282 where @code{longjmp} will be called; in fact, a signal handler could
5283 call it at any point in the code.  As a result, you may get a warning
5284 even when there is in fact no problem because @code{longjmp} cannot
5285 in fact be called at the place that would cause a problem.
5287 Some spurious warnings can be avoided if you declare all the functions
5288 you use that never return as @code{noreturn}.  @xref{Function
5289 Attributes}.
5291 This warning is enabled by @option{-Wall} or @option{-Wextra}.
5293 @item -Wunknown-pragmas
5294 @opindex Wunknown-pragmas
5295 @opindex Wno-unknown-pragmas
5296 @cindex warning for unknown pragmas
5297 @cindex unknown pragmas, warning
5298 @cindex pragmas, warning of unknown
5299 Warn when a @code{#pragma} directive is encountered that is not understood by 
5300 GCC@.  If this command-line option is used, warnings are even issued
5301 for unknown pragmas in system header files.  This is not the case if
5302 the warnings are only enabled by the @option{-Wall} command-line option.
5304 @item -Wno-pragmas
5305 @opindex Wno-pragmas
5306 @opindex Wpragmas
5307 Do not warn about misuses of pragmas, such as incorrect parameters,
5308 invalid syntax, or conflicts between pragmas.  See also
5309 @option{-Wunknown-pragmas}.
5311 @item -Wstrict-aliasing
5312 @opindex Wstrict-aliasing
5313 @opindex Wno-strict-aliasing
5314 This option is only active when @option{-fstrict-aliasing} is active.
5315 It warns about code that might break the strict aliasing rules that the
5316 compiler is using for optimization.  The warning does not catch all
5317 cases, but does attempt to catch the more common pitfalls.  It is
5318 included in @option{-Wall}.
5319 It is equivalent to @option{-Wstrict-aliasing=3}
5321 @item -Wstrict-aliasing=n
5322 @opindex Wstrict-aliasing=n
5323 This option is only active when @option{-fstrict-aliasing} is active.
5324 It warns about code that might break the strict aliasing rules that the
5325 compiler is using for optimization.
5326 Higher levels correspond to higher accuracy (fewer false positives).
5327 Higher levels also correspond to more effort, similar to the way @option{-O} 
5328 works.
5329 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
5331 Level 1: Most aggressive, quick, least accurate.
5332 Possibly useful when higher levels
5333 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
5334 false negatives.  However, it has many false positives.
5335 Warns for all pointer conversions between possibly incompatible types,
5336 even if never dereferenced.  Runs in the front end only.
5338 Level 2: Aggressive, quick, not too precise.
5339 May still have many false positives (not as many as level 1 though),
5340 and few false negatives (but possibly more than level 1).
5341 Unlike level 1, it only warns when an address is taken.  Warns about
5342 incomplete types.  Runs in the front end only.
5344 Level 3 (default for @option{-Wstrict-aliasing}):
5345 Should have very few false positives and few false
5346 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
5347 Takes care of the common pun+dereference pattern in the front end:
5348 @code{*(int*)&some_float}.
5349 If optimization is enabled, it also runs in the back end, where it deals
5350 with multiple statement cases using flow-sensitive points-to information.
5351 Only warns when the converted pointer is dereferenced.
5352 Does not warn about incomplete types.
5354 @item -Wstrict-overflow
5355 @itemx -Wstrict-overflow=@var{n}
5356 @opindex Wstrict-overflow
5357 @opindex Wno-strict-overflow
5358 This option is only active when signed overflow is undefined.
5359 It warns about cases where the compiler optimizes based on the
5360 assumption that signed overflow does not occur.  Note that it does not
5361 warn about all cases where the code might overflow: it only warns
5362 about cases where the compiler implements some optimization.  Thus
5363 this warning depends on the optimization level.
5365 An optimization that assumes that signed overflow does not occur is
5366 perfectly safe if the values of the variables involved are such that
5367 overflow never does, in fact, occur.  Therefore this warning can
5368 easily give a false positive: a warning about code that is not
5369 actually a problem.  To help focus on important issues, several
5370 warning levels are defined.  No warnings are issued for the use of
5371 undefined signed overflow when estimating how many iterations a loop
5372 requires, in particular when determining whether a loop will be
5373 executed at all.
5375 @table @gcctabopt
5376 @item -Wstrict-overflow=1
5377 Warn about cases that are both questionable and easy to avoid.  For
5378 example the compiler simplifies
5379 @code{x + 1 > x} to @code{1}.  This level of
5380 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
5381 are not, and must be explicitly requested.
5383 @item -Wstrict-overflow=2
5384 Also warn about other cases where a comparison is simplified to a
5385 constant.  For example: @code{abs (x) >= 0}.  This can only be
5386 simplified when signed integer overflow is undefined, because
5387 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
5388 zero.  @option{-Wstrict-overflow} (with no level) is the same as
5389 @option{-Wstrict-overflow=2}.
5391 @item -Wstrict-overflow=3
5392 Also warn about other cases where a comparison is simplified.  For
5393 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
5395 @item -Wstrict-overflow=4
5396 Also warn about other simplifications not covered by the above cases.
5397 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
5399 @item -Wstrict-overflow=5
5400 Also warn about cases where the compiler reduces the magnitude of a
5401 constant involved in a comparison.  For example: @code{x + 2 > y} is
5402 simplified to @code{x + 1 >= y}.  This is reported only at the
5403 highest warning level because this simplification applies to many
5404 comparisons, so this warning level gives a very large number of
5405 false positives.
5406 @end table
5408 @item -Wstringop-overflow
5409 @itemx -Wstringop-overflow=@var{type}
5410 @opindex Wstringop-overflow
5411 @opindex Wno-stringop-overflow
5412 Warn for calls to string manipulation functions such as @code{memcpy} and
5413 @code{strcpy} that are determined to overflow the destination buffer.  The
5414 optional argument is one greater than the type of Object Size Checking to
5415 perform to determine the size of the destination.  @xref{Object Size Checking}.
5416 The argument is meaningful only for functions that operate on character arrays
5417 but not for raw memory functions like @code{memcpy} which always make use
5418 of Object Size type-0.  The option also warns for calls that specify a size
5419 in excess of the largest possible object or at most @code{SIZE_MAX / 2} bytes.
5420 The option produces the best results with optimization enabled but can detect
5421 a small subset of simple buffer overflows even without optimization in
5422 calls to the GCC built-in functions like @code{__builtin_memcpy} that
5423 correspond to the standard functions.  In any case, the option warns about
5424 just a subset of buffer overflows detected by the corresponding overflow
5425 checking built-ins.  For example, the option will issue a warning for
5426 the @code{strcpy} call below because it copies at least 5 characters
5427 (the string @code{"blue"} including the terminating NUL) into the buffer
5428 of size 4.
5430 @smallexample
5431 enum Color @{ blue, purple, yellow @};
5432 const char* f (enum Color clr)
5434   static char buf [4];
5435   const char *str;
5436   switch (clr)
5437     @{
5438       case blue: str = "blue"; break;
5439       case purple: str = "purple"; break;
5440       case yellow: str = "yellow"; break;
5441     @}
5443   return strcpy (buf, str);   // warning here
5445 @end smallexample
5447 Option @option{-Wstringop-overflow=2} is enabled by default.
5449 @table @gcctabopt
5450 @item -Wstringop-overflow
5451 @itemx -Wstringop-overflow=1
5452 @opindex Wstringop-overflow
5453 @opindex Wno-stringop-overflow
5454 The @option{-Wstringop-overflow=1} option uses type-zero Object Size Checking
5455 to determine the sizes of destination objects.  This is the default setting
5456 of the option.  At this setting the option will not warn for writes past
5457 the end of subobjects of larger objects accessed by pointers unless the
5458 size of the largest surrounding object is known.  When the destination may
5459 be one of several objects it is assumed to be the largest one of them.  On
5460 Linux systems, when optimization is enabled at this setting the option warns
5461 for the same code as when the @code{_FORTIFY_SOURCE} macro is defined to
5462 a non-zero value.
5464 @item -Wstringop-overflow=2
5465 The @option{-Wstringop-overflow=2} option uses type-one Object Size Checking
5466 to determine the sizes of destination objects.  At this setting the option
5467 will warn about overflows when writing to members of the largest complete
5468 objects whose exact size is known.  It will, however, not warn for excessive
5469 writes to the same members of unknown objects referenced by pointers since
5470 they may point to arrays containing unknown numbers of elements.
5472 @item -Wstringop-overflow=3
5473 The @option{-Wstringop-overflow=3} option uses type-two Object Size Checking
5474 to determine the sizes of destination objects.  At this setting the option
5475 warns about overflowing the smallest object or data member.  This is the
5476 most restrictive setting of the option that may result in warnings for safe
5477 code.
5479 @item -Wstringop-overflow=4
5480 The @option{-Wstringop-overflow=4} option uses type-three Object Size Checking
5481 to determine the sizes of destination objects.  At this setting the option
5482 will warn about overflowing any data members, and when the destination is
5483 one of several objects it uses the size of the largest of them to decide
5484 whether to issue a warning.  Similarly to @option{-Wstringop-overflow=3} this
5485 setting of the option may result in warnings for benign code.
5486 @end table
5488 @item -Wstringop-truncation
5489 @opindex Wstringop-truncation
5490 @opindex Wno-stringop-truncation
5491 Warn for calls to bounded string manipulation functions such as @code{strncat},
5492 @code{strncpy}, and @code{stpncpy} that may either truncate the copied string
5493 or leave the destination unchanged.
5495 In the following example, the call to @code{strncat} specifies a bound that
5496 is less than the length of the source string.  As a result, the copy of
5497 the source will be truncated and so the call is diagnosed.  To avoid the
5498 warning use @code{bufsize - strlen (buf) - 1)} as the bound.
5500 @smallexample
5501 void append (char *buf, size_t bufsize)
5503   strncat (buf, ".txt", 3);
5505 @end smallexample
5507 As another example, the following call to @code{strncpy} results in copying
5508 to @code{d} just the characters preceding the terminating NUL, without
5509 appending the NUL to the end.  Assuming the result of @code{strncpy} is
5510 necessarily a NUL-terminated string is a common mistake, and so the call
5511 is diagnosed.  To avoid the warning when the result is not expected to be
5512 NUL-terminated, call @code{memcpy} instead.
5514 @smallexample
5515 void copy (char *d, const char *s)
5517   strncpy (d, s, strlen (s));
5519 @end smallexample
5521 In the following example, the call to @code{strncpy} specifies the size
5522 of the destination buffer as the bound.  If the length of the source
5523 string is equal to or greater than this size the result of the copy will
5524 not be NUL-terminated.  Therefore, the call is also diagnosed.  To avoid
5525 the warning, specify @code{sizeof buf - 1} as the bound and set the last
5526 element of the buffer to @code{NUL}.
5528 @smallexample
5529 void copy (const char *s)
5531   char buf[80];
5532   strncpy (buf, s, sizeof buf);
5533   @dots{}
5535 @end smallexample
5537 In situations where a character array is intended to store a sequence
5538 of bytes with no terminating @code{NUL} such an array may be annotated
5539 with attribute @code{nonstring} to avoid this warning.  Such arrays,
5540 however, are not suitable arguments to functions that expect
5541 @code{NUL}-terminated strings.  To help detect accidental misuses of
5542 such arrays GCC issues warnings unless it can prove that the use is
5543 safe.  @xref{Common Variable Attributes}.
5545 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}cold@r{|}malloc@r{]}
5546 @opindex Wsuggest-attribute=
5547 @opindex Wno-suggest-attribute=
5548 Warn for cases where adding an attribute may be beneficial. The
5549 attributes currently supported are listed below.
5551 @table @gcctabopt
5552 @item -Wsuggest-attribute=pure
5553 @itemx -Wsuggest-attribute=const
5554 @itemx -Wsuggest-attribute=noreturn
5555 @itemx -Wsuggest-attribute=malloc
5556 @opindex Wsuggest-attribute=pure
5557 @opindex Wno-suggest-attribute=pure
5558 @opindex Wsuggest-attribute=const
5559 @opindex Wno-suggest-attribute=const
5560 @opindex Wsuggest-attribute=noreturn
5561 @opindex Wno-suggest-attribute=noreturn
5562 @opindex Wsuggest-attribute=malloc
5563 @opindex Wno-suggest-attribute=malloc
5565 Warn about functions that might be candidates for attributes
5566 @code{pure}, @code{const} or @code{noreturn} or @code{malloc}. The compiler
5567 only warns for functions visible in other compilation units or (in the case of
5568 @code{pure} and @code{const}) if it cannot prove that the function returns
5569 normally. A function returns normally if it doesn't contain an infinite loop or
5570 return abnormally by throwing, calling @code{abort} or trapping.  This analysis
5571 requires option @option{-fipa-pure-const}, which is enabled by default at
5572 @option{-O} and higher.  Higher optimization levels improve the accuracy
5573 of the analysis.
5575 @item -Wsuggest-attribute=format
5576 @itemx -Wmissing-format-attribute
5577 @opindex Wsuggest-attribute=format
5578 @opindex Wmissing-format-attribute
5579 @opindex Wno-suggest-attribute=format
5580 @opindex Wno-missing-format-attribute
5581 @opindex Wformat
5582 @opindex Wno-format
5584 Warn about function pointers that might be candidates for @code{format}
5585 attributes.  Note these are only possible candidates, not absolute ones.
5586 GCC guesses that function pointers with @code{format} attributes that
5587 are used in assignment, initialization, parameter passing or return
5588 statements should have a corresponding @code{format} attribute in the
5589 resulting type.  I.e.@: the left-hand side of the assignment or
5590 initialization, the type of the parameter variable, or the return type
5591 of the containing function respectively should also have a @code{format}
5592 attribute to avoid the warning.
5594 GCC also warns about function definitions that might be
5595 candidates for @code{format} attributes.  Again, these are only
5596 possible candidates.  GCC guesses that @code{format} attributes
5597 might be appropriate for any function that calls a function like
5598 @code{vprintf} or @code{vscanf}, but this might not always be the
5599 case, and some functions for which @code{format} attributes are
5600 appropriate may not be detected.
5602 @item -Wsuggest-attribute=cold
5603 @opindex Wsuggest-attribute=cold
5604 @opindex Wno-suggest-attribute=cold
5606 Warn about functions that might be candidates for @code{cold} attribute.  This
5607 is based on static detection and generally will only warn about functions which
5608 always leads to a call to another @code{cold} function such as wrappers of
5609 C++ @code{throw} or fatal error reporting functions leading to @code{abort}.
5610 @end table
5612 @item -Wsuggest-final-types
5613 @opindex Wno-suggest-final-types
5614 @opindex Wsuggest-final-types
5615 Warn about types with virtual methods where code quality would be improved
5616 if the type were declared with the C++11 @code{final} specifier, 
5617 or, if possible,
5618 declared in an anonymous namespace. This allows GCC to more aggressively
5619 devirtualize the polymorphic calls. This warning is more effective with link
5620 time optimization, where the information about the class hierarchy graph is
5621 more complete.
5623 @item -Wsuggest-final-methods
5624 @opindex Wno-suggest-final-methods
5625 @opindex Wsuggest-final-methods
5626 Warn about virtual methods where code quality would be improved if the method
5627 were declared with the C++11 @code{final} specifier, 
5628 or, if possible, its type were
5629 declared in an anonymous namespace or with the @code{final} specifier.
5630 This warning is
5631 more effective with link-time optimization, where the information about the
5632 class hierarchy graph is more complete. It is recommended to first consider
5633 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
5634 annotations.
5636 @item -Wsuggest-override
5637 Warn about overriding virtual functions that are not marked with the override
5638 keyword.
5640 @item -Walloc-zero
5641 @opindex Wno-alloc-zero
5642 @opindex Walloc-zero
5643 Warn about calls to allocation functions decorated with attribute
5644 @code{alloc_size} that specify zero bytes, including those to the built-in
5645 forms of the functions @code{aligned_alloc}, @code{alloca}, @code{calloc},
5646 @code{malloc}, and @code{realloc}.  Because the behavior of these functions
5647 when called with a zero size differs among implementations (and in the case
5648 of @code{realloc} has been deprecated) relying on it may result in subtle
5649 portability bugs and should be avoided.
5651 @item -Walloc-size-larger-than=@var{byte-size}
5652 @opindex Walloc-size-larger-than=
5653 @opindex Wno-alloc-size-larger-than
5654 Warn about calls to functions decorated with attribute @code{alloc_size}
5655 that attempt to allocate objects larger than the specified number of bytes,
5656 or where the result of the size computation in an integer type with infinite
5657 precision would exceed the value of @samp{PTRDIFF_MAX} on the target.
5658 @option{-Walloc-size-larger-than=}@samp{PTRDIFF_MAX} is enabled by default.
5659 Warnings controlled by the option can be disabled either by specifying
5660 @var{byte-size} of @samp{SIZE_MAX} or more or by
5661 @option{-Wno-alloc-size-larger-than}.
5662 @xref{Function Attributes}.
5664 @item -Wno-alloc-size-larger-than
5665 @opindex Wno-alloc-size-larger-than
5666 Disable @option{-Walloc-size-larger-than=} warnings.  The option is
5667 equivalent to @option{-Walloc-size-larger-than=}@samp{SIZE_MAX} or
5668 larger.
5670 @item -Walloca
5671 @opindex Wno-alloca
5672 @opindex Walloca
5673 This option warns on all uses of @code{alloca} in the source.
5675 @item -Walloca-larger-than=@var{byte-size}
5676 @opindex -Walloca-larger-than=
5677 @opindex -Wno-alloca-larger-than
5678 This option warns on calls to @code{alloca} with an integer argument whose
5679 value is either zero, or that is not bounded by a controlling predicate
5680 that limits its value to at most @var{byte-size}.  It also warns for calls
5681 to @code{alloca} where the bound value is unknown.  Arguments of non-integer
5682 types are considered unbounded even if they appear to be constrained to
5683 the expected range.
5685 For example, a bounded case of @code{alloca} could be:
5687 @smallexample
5688 void func (size_t n)
5690   void *p;
5691   if (n <= 1000)
5692     p = alloca (n);
5693   else
5694     p = malloc (n);
5695   f (p);
5697 @end smallexample
5699 In the above example, passing @code{-Walloca-larger-than=1000} would not
5700 issue a warning because the call to @code{alloca} is known to be at most
5701 1000 bytes.  However, if @code{-Walloca-larger-than=500} were passed,
5702 the compiler would emit a warning.
5704 Unbounded uses, on the other hand, are uses of @code{alloca} with no
5705 controlling predicate constraining its integer argument.  For example:
5707 @smallexample
5708 void func ()
5710   void *p = alloca (n);
5711   f (p);
5713 @end smallexample
5715 If @code{-Walloca-larger-than=500} were passed, the above would trigger
5716 a warning, but this time because of the lack of bounds checking.
5718 Note, that even seemingly correct code involving signed integers could
5719 cause a warning:
5721 @smallexample
5722 void func (signed int n)
5724   if (n < 500)
5725     @{
5726       p = alloca (n);
5727       f (p);
5728     @}
5730 @end smallexample
5732 In the above example, @var{n} could be negative, causing a larger than
5733 expected argument to be implicitly cast into the @code{alloca} call.
5735 This option also warns when @code{alloca} is used in a loop.
5737 @option{-Walloca-larger-than=}@samp{PTRDIFF_MAX} is enabled by default
5738 but is usually only effective  when @option{-ftree-vrp} is active (default
5739 for @option{-O2} and above).
5741 See also @option{-Wvla-larger-than=}@samp{byte-size}.
5743 @item -Wno-alloca-larger-than
5744 @opindex Wno-alloca-larger-than
5745 Disable @option{-Walloca-larger-than=} warnings.  The option is
5746 equivalent to @option{-Walloca-larger-than=}@samp{SIZE_MAX} or larger.
5748 @item -Warray-bounds
5749 @itemx -Warray-bounds=@var{n}
5750 @opindex Wno-array-bounds
5751 @opindex Warray-bounds
5752 This option is only active when @option{-ftree-vrp} is active
5753 (default for @option{-O2} and above). It warns about subscripts to arrays
5754 that are always out of bounds. This warning is enabled by @option{-Wall}.
5756 @table @gcctabopt
5757 @item -Warray-bounds=1
5758 This is the warning level of @option{-Warray-bounds} and is enabled
5759 by @option{-Wall}; higher levels are not, and must be explicitly requested.
5761 @item -Warray-bounds=2
5762 This warning level also warns about out of bounds access for
5763 arrays at the end of a struct and for arrays accessed through
5764 pointers. This warning level may give a larger number of
5765 false positives and is deactivated by default.
5766 @end table
5768 @item -Wattribute-alias
5769 Warn about declarations using the @code{alias} and similar attributes whose
5770 target is incompatible with the type of the alias.  @xref{Function Attributes,
5771 ,Declaring Attributes of Functions}.
5773 @item -Wbool-compare
5774 @opindex Wno-bool-compare
5775 @opindex Wbool-compare
5776 Warn about boolean expression compared with an integer value different from
5777 @code{true}/@code{false}.  For instance, the following comparison is
5778 always false:
5779 @smallexample
5780 int n = 5;
5781 @dots{}
5782 if ((n > 1) == 2) @{ @dots{} @}
5783 @end smallexample
5784 This warning is enabled by @option{-Wall}.
5786 @item -Wbool-operation
5787 @opindex Wno-bool-operation
5788 @opindex Wbool-operation
5789 Warn about suspicious operations on expressions of a boolean type.  For
5790 instance, bitwise negation of a boolean is very likely a bug in the program.
5791 For C, this warning also warns about incrementing or decrementing a boolean,
5792 which rarely makes sense.  (In C++, decrementing a boolean is always invalid.
5793 Incrementing a boolean is invalid in C++17, and deprecated otherwise.)
5795 This warning is enabled by @option{-Wall}.
5797 @item -Wduplicated-branches
5798 @opindex Wno-duplicated-branches
5799 @opindex Wduplicated-branches
5800 Warn when an if-else has identical branches.  This warning detects cases like
5801 @smallexample
5802 if (p != NULL)
5803   return 0;
5804 else
5805   return 0;
5806 @end smallexample
5807 It doesn't warn when both branches contain just a null statement.  This warning
5808 also warn for conditional operators:
5809 @smallexample
5810   int i = x ? *p : *p;
5811 @end smallexample
5813 @item -Wduplicated-cond
5814 @opindex Wno-duplicated-cond
5815 @opindex Wduplicated-cond
5816 Warn about duplicated conditions in an if-else-if chain.  For instance,
5817 warn for the following code:
5818 @smallexample
5819 if (p->q != NULL) @{ @dots{} @}
5820 else if (p->q != NULL) @{ @dots{} @}
5821 @end smallexample
5823 @item -Wframe-address
5824 @opindex Wno-frame-address
5825 @opindex Wframe-address
5826 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
5827 is called with an argument greater than 0.  Such calls may return indeterminate
5828 values or crash the program.  The warning is included in @option{-Wall}.
5830 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
5831 @opindex Wno-discarded-qualifiers
5832 @opindex Wdiscarded-qualifiers
5833 Do not warn if type qualifiers on pointers are being discarded.
5834 Typically, the compiler warns if a @code{const char *} variable is
5835 passed to a function that takes a @code{char *} parameter.  This option
5836 can be used to suppress such a warning.
5838 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
5839 @opindex Wno-discarded-array-qualifiers
5840 @opindex Wdiscarded-array-qualifiers
5841 Do not warn if type qualifiers on arrays which are pointer targets
5842 are being discarded. Typically, the compiler warns if a
5843 @code{const int (*)[]} variable is passed to a function that
5844 takes a @code{int (*)[]} parameter.  This option can be used to
5845 suppress such a warning.
5847 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
5848 @opindex Wno-incompatible-pointer-types
5849 @opindex Wincompatible-pointer-types
5850 Do not warn when there is a conversion between pointers that have incompatible
5851 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
5852 which warns for pointer argument passing or assignment with different
5853 signedness.
5855 @item -Wno-int-conversion @r{(C and Objective-C only)}
5856 @opindex Wno-int-conversion
5857 @opindex Wint-conversion
5858 Do not warn about incompatible integer to pointer and pointer to integer
5859 conversions.  This warning is about implicit conversions; for explicit
5860 conversions the warnings @option{-Wno-int-to-pointer-cast} and
5861 @option{-Wno-pointer-to-int-cast} may be used.
5863 @item -Wno-div-by-zero
5864 @opindex Wno-div-by-zero
5865 @opindex Wdiv-by-zero
5866 Do not warn about compile-time integer division by zero.  Floating-point
5867 division by zero is not warned about, as it can be a legitimate way of
5868 obtaining infinities and NaNs.
5870 @item -Wsystem-headers
5871 @opindex Wsystem-headers
5872 @opindex Wno-system-headers
5873 @cindex warnings from system headers
5874 @cindex system headers, warnings from
5875 Print warning messages for constructs found in system header files.
5876 Warnings from system headers are normally suppressed, on the assumption
5877 that they usually do not indicate real problems and would only make the
5878 compiler output harder to read.  Using this command-line option tells
5879 GCC to emit warnings from system headers as if they occurred in user
5880 code.  However, note that using @option{-Wall} in conjunction with this
5881 option does @emph{not} warn about unknown pragmas in system
5882 headers---for that, @option{-Wunknown-pragmas} must also be used.
5884 @item -Wtautological-compare
5885 @opindex Wtautological-compare
5886 @opindex Wno-tautological-compare
5887 Warn if a self-comparison always evaluates to true or false.  This
5888 warning detects various mistakes such as:
5889 @smallexample
5890 int i = 1;
5891 @dots{}
5892 if (i > i) @{ @dots{} @}
5893 @end smallexample
5895 This warning also warns about bitwise comparisons that always evaluate
5896 to true or false, for instance:
5897 @smallexample
5898 if ((a & 16) == 10) @{ @dots{} @}
5899 @end smallexample
5900 will always be false.
5902 This warning is enabled by @option{-Wall}.
5904 @item -Wtrampolines
5905 @opindex Wtrampolines
5906 @opindex Wno-trampolines
5907 Warn about trampolines generated for pointers to nested functions.
5908 A trampoline is a small piece of data or code that is created at run
5909 time on the stack when the address of a nested function is taken, and is
5910 used to call the nested function indirectly.  For some targets, it is
5911 made up of data only and thus requires no special treatment.  But, for
5912 most targets, it is made up of code and thus requires the stack to be
5913 made executable in order for the program to work properly.
5915 @item -Wfloat-equal
5916 @opindex Wfloat-equal
5917 @opindex Wno-float-equal
5918 Warn if floating-point values are used in equality comparisons.
5920 The idea behind this is that sometimes it is convenient (for the
5921 programmer) to consider floating-point values as approximations to
5922 infinitely precise real numbers.  If you are doing this, then you need
5923 to compute (by analyzing the code, or in some other way) the maximum or
5924 likely maximum error that the computation introduces, and allow for it
5925 when performing comparisons (and when producing output, but that's a
5926 different problem).  In particular, instead of testing for equality, you
5927 should check to see whether the two values have ranges that overlap; and
5928 this is done with the relational operators, so equality comparisons are
5929 probably mistaken.
5931 @item -Wtraditional @r{(C and Objective-C only)}
5932 @opindex Wtraditional
5933 @opindex Wno-traditional
5934 Warn about certain constructs that behave differently in traditional and
5935 ISO C@.  Also warn about ISO C constructs that have no traditional C
5936 equivalent, and/or problematic constructs that should be avoided.
5938 @itemize @bullet
5939 @item
5940 Macro parameters that appear within string literals in the macro body.
5941 In traditional C macro replacement takes place within string literals,
5942 but in ISO C it does not.
5944 @item
5945 In traditional C, some preprocessor directives did not exist.
5946 Traditional preprocessors only considered a line to be a directive
5947 if the @samp{#} appeared in column 1 on the line.  Therefore
5948 @option{-Wtraditional} warns about directives that traditional C
5949 understands but ignores because the @samp{#} does not appear as the
5950 first character on the line.  It also suggests you hide directives like
5951 @code{#pragma} not understood by traditional C by indenting them.  Some
5952 traditional implementations do not recognize @code{#elif}, so this option
5953 suggests avoiding it altogether.
5955 @item
5956 A function-like macro that appears without arguments.
5958 @item
5959 The unary plus operator.
5961 @item
5962 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
5963 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
5964 constants.)  Note, these suffixes appear in macros defined in the system
5965 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
5966 Use of these macros in user code might normally lead to spurious
5967 warnings, however GCC's integrated preprocessor has enough context to
5968 avoid warning in these cases.
5970 @item
5971 A function declared external in one block and then used after the end of
5972 the block.
5974 @item
5975 A @code{switch} statement has an operand of type @code{long}.
5977 @item
5978 A non-@code{static} function declaration follows a @code{static} one.
5979 This construct is not accepted by some traditional C compilers.
5981 @item
5982 The ISO type of an integer constant has a different width or
5983 signedness from its traditional type.  This warning is only issued if
5984 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
5985 typically represent bit patterns, are not warned about.
5987 @item
5988 Usage of ISO string concatenation is detected.
5990 @item
5991 Initialization of automatic aggregates.
5993 @item
5994 Identifier conflicts with labels.  Traditional C lacks a separate
5995 namespace for labels.
5997 @item
5998 Initialization of unions.  If the initializer is zero, the warning is
5999 omitted.  This is done under the assumption that the zero initializer in
6000 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
6001 initializer warnings and relies on default initialization to zero in the
6002 traditional C case.
6004 @item
6005 Conversions by prototypes between fixed/floating-point values and vice
6006 versa.  The absence of these prototypes when compiling with traditional
6007 C causes serious problems.  This is a subset of the possible
6008 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
6010 @item
6011 Use of ISO C style function definitions.  This warning intentionally is
6012 @emph{not} issued for prototype declarations or variadic functions
6013 because these ISO C features appear in your code when using
6014 libiberty's traditional C compatibility macros, @code{PARAMS} and
6015 @code{VPARAMS}.  This warning is also bypassed for nested functions
6016 because that feature is already a GCC extension and thus not relevant to
6017 traditional C compatibility.
6018 @end itemize
6020 @item -Wtraditional-conversion @r{(C and Objective-C only)}
6021 @opindex Wtraditional-conversion
6022 @opindex Wno-traditional-conversion
6023 Warn if a prototype causes a type conversion that is different from what
6024 would happen to the same argument in the absence of a prototype.  This
6025 includes conversions of fixed point to floating and vice versa, and
6026 conversions changing the width or signedness of a fixed-point argument
6027 except when the same as the default promotion.
6029 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
6030 @opindex Wdeclaration-after-statement
6031 @opindex Wno-declaration-after-statement
6032 Warn when a declaration is found after a statement in a block.  This
6033 construct, known from C++, was introduced with ISO C99 and is by default
6034 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
6036 @item -Wshadow
6037 @opindex Wshadow
6038 @opindex Wno-shadow
6039 Warn whenever a local variable or type declaration shadows another
6040 variable, parameter, type, class member (in C++), or instance variable
6041 (in Objective-C) or whenever a built-in function is shadowed. Note
6042 that in C++, the compiler warns if a local variable shadows an
6043 explicit typedef, but not if it shadows a struct/class/enum.
6044 Same as @option{-Wshadow=global}.
6046 @item -Wno-shadow-ivar @r{(Objective-C only)}
6047 @opindex Wno-shadow-ivar
6048 @opindex Wshadow-ivar
6049 Do not warn whenever a local variable shadows an instance variable in an
6050 Objective-C method.
6052 @item -Wshadow=global
6053 @opindex Wshadow=local
6054 The default for @option{-Wshadow}. Warns for any (global) shadowing.
6056 @item -Wshadow=local
6057 @opindex Wshadow=local
6058 Warn when a local variable shadows another local variable or parameter.
6059 This warning is enabled by @option{-Wshadow=global}.
6061 @item -Wshadow=compatible-local
6062 @opindex Wshadow=compatible-local
6063 Warn when a local variable shadows another local variable or parameter
6064 whose type is compatible with that of the shadowing variable. In C++,
6065 type compatibility here means the type of the shadowing variable can be
6066 converted to that of the shadowed variable. The creation of this flag
6067 (in addition to @option{-Wshadow=local}) is based on the idea that when
6068 a local variable shadows another one of incompatible type, it is most
6069 likely intentional, not a bug or typo, as shown in the following example:
6071 @smallexample
6072 @group
6073 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
6075   for (int i = 0; i < N; ++i)
6076   @{
6077     ...
6078   @}
6079   ...
6081 @end group
6082 @end smallexample
6084 Since the two variable @code{i} in the example above have incompatible types,
6085 enabling only @option{-Wshadow=compatible-local} will not emit a warning.
6086 Because their types are incompatible, if a programmer accidentally uses one
6087 in place of the other, type checking will catch that and emit an error or
6088 warning. So not warning (about shadowing) in this case will not lead to
6089 undetected bugs. Use of this flag instead of @option{-Wshadow=local} can
6090 possibly reduce the number of warnings triggered by intentional shadowing.
6092 This warning is enabled by @option{-Wshadow=local}.
6094 @item -Wlarger-than=@var{byte-size}
6095 @opindex Wlarger-than=
6096 @opindex Wlarger-than-@var{byte-size}
6097 Warn whenever an object is defined whose size exceeds @var{byte-size}.
6098 @option{-Wlarger-than=}@samp{PTRDIFF_MAX} is enabled by default.
6099 Warnings controlled by the option can be disabled either by specifying
6100 @var{byte-size} of @samp{SIZE_MAX} or more or by
6101 @option{-Wno-larger-than}.
6103 @item -Wno-larger-than
6104 @opindex Wno-larger-than
6105 Disable @option{-Wlarger-than=} warnings.  The option is equivalent
6106 to @option{-Wlarger-than=}@samp{SIZE_MAX} or larger.
6108 @item -Wframe-larger-than=@var{byte-size}
6109 @opindex Wframe-larger-than=
6110 @opindex Wno-frame-larger-than
6111 Warn if the size of a function frame exceeds @var{byte-size}.
6112 The computation done to determine the stack frame size is approximate
6113 and not conservative.
6114 The actual requirements may be somewhat greater than @var{byte-size}
6115 even if you do not get a warning.  In addition, any space allocated
6116 via @code{alloca}, variable-length arrays, or related constructs
6117 is not included by the compiler when determining
6118 whether or not to issue a warning.
6119 @option{-Wframe-larger-than=}@samp{PTRDIFF_MAX} is enabled by default.
6120 Warnings controlled by the option can be disabled either by specifying
6121 @var{byte-size} of @samp{SIZE_MAX} or more or by
6122 @option{-Wno-frame-larger-than}.
6124 @item -Wno-frame-larger-than
6125 @opindex Wno-frame-larger-than
6126 Disable @option{-Wframe-larger-than=} warnings.  The option is equivalent
6127 to @option{-Wframe-larger-than=}@samp{SIZE_MAX} or larger.
6129 @item -Wno-free-nonheap-object
6130 @opindex Wno-free-nonheap-object
6131 @opindex Wfree-nonheap-object
6132 Do not warn when attempting to free an object that was not allocated
6133 on the heap.
6135 @item -Wstack-usage=@var{byte-size}
6136 @opindex Wstack-usage
6137 @opindex Wno-stack-usage
6138 Warn if the stack usage of a function might exceed @var{byte-size}.
6139 The computation done to determine the stack usage is conservative.
6140 Any space allocated via @code{alloca}, variable-length arrays, or related
6141 constructs is included by the compiler when determining whether or not to
6142 issue a warning.
6144 The message is in keeping with the output of @option{-fstack-usage}.
6146 @itemize
6147 @item
6148 If the stack usage is fully static but exceeds the specified amount, it's:
6150 @smallexample
6151   warning: stack usage is 1120 bytes
6152 @end smallexample
6153 @item
6154 If the stack usage is (partly) dynamic but bounded, it's:
6156 @smallexample
6157   warning: stack usage might be 1648 bytes
6158 @end smallexample
6159 @item
6160 If the stack usage is (partly) dynamic and not bounded, it's:
6162 @smallexample
6163   warning: stack usage might be unbounded
6164 @end smallexample
6165 @end itemize
6167 @option{-Wstack-usage=}@samp{PTRDIFF_MAX} is enabled by default.
6168 Warnings controlled by the option can be disabled either by specifying
6169 @var{byte-size} of @samp{SIZE_MAX} or more or by
6170 @option{-Wno-stack-usage}.
6172 @item -Wno-stack-usage
6173 @opindex Wno-stack-usage
6174 Disable @option{-Wstack-usage=} warnings.  The option is equivalent
6175 to @option{-Wstack-usage=}@samp{SIZE_MAX} or larger.
6177 @item -Wunsafe-loop-optimizations
6178 @opindex Wunsafe-loop-optimizations
6179 @opindex Wno-unsafe-loop-optimizations
6180 Warn if the loop cannot be optimized because the compiler cannot
6181 assume anything on the bounds of the loop indices.  With
6182 @option{-funsafe-loop-optimizations} warn if the compiler makes
6183 such assumptions.
6185 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
6186 @opindex Wno-pedantic-ms-format
6187 @opindex Wpedantic-ms-format
6188 When used in combination with @option{-Wformat}
6189 and @option{-pedantic} without GNU extensions, this option
6190 disables the warnings about non-ISO @code{printf} / @code{scanf} format
6191 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
6192 which depend on the MS runtime.
6194 @item -Waligned-new
6195 @opindex Waligned-new
6196 @opindex Wno-aligned-new
6197 Warn about a new-expression of a type that requires greater alignment
6198 than the @code{alignof(std::max_align_t)} but uses an allocation
6199 function without an explicit alignment parameter. This option is
6200 enabled by @option{-Wall}.
6202 Normally this only warns about global allocation functions, but
6203 @option{-Waligned-new=all} also warns about class member allocation
6204 functions.
6206 @item -Wplacement-new
6207 @itemx -Wplacement-new=@var{n}
6208 @opindex Wplacement-new
6209 @opindex Wno-placement-new
6210 Warn about placement new expressions with undefined behavior, such as
6211 constructing an object in a buffer that is smaller than the type of
6212 the object.  For example, the placement new expression below is diagnosed
6213 because it attempts to construct an array of 64 integers in a buffer only
6214 64 bytes large.
6215 @smallexample
6216 char buf [64];
6217 new (buf) int[64];
6218 @end smallexample
6219 This warning is enabled by default.
6221 @table @gcctabopt
6222 @item -Wplacement-new=1
6223 This is the default warning level of @option{-Wplacement-new}.  At this
6224 level the warning is not issued for some strictly undefined constructs that
6225 GCC allows as extensions for compatibility with legacy code.  For example,
6226 the following @code{new} expression is not diagnosed at this level even
6227 though it has undefined behavior according to the C++ standard because
6228 it writes past the end of the one-element array.
6229 @smallexample
6230 struct S @{ int n, a[1]; @};
6231 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
6232 new (s->a)int [32]();
6233 @end smallexample
6235 @item -Wplacement-new=2
6236 At this level, in addition to diagnosing all the same constructs as at level
6237 1, a diagnostic is also issued for placement new expressions that construct
6238 an object in the last member of structure whose type is an array of a single
6239 element and whose size is less than the size of the object being constructed.
6240 While the previous example would be diagnosed, the following construct makes
6241 use of the flexible member array extension to avoid the warning at level 2.
6242 @smallexample
6243 struct S @{ int n, a[]; @};
6244 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
6245 new (s->a)int [32]();
6246 @end smallexample
6248 @end table
6250 @item -Wpointer-arith
6251 @opindex Wpointer-arith
6252 @opindex Wno-pointer-arith
6253 Warn about anything that depends on the ``size of'' a function type or
6254 of @code{void}.  GNU C assigns these types a size of 1, for
6255 convenience in calculations with @code{void *} pointers and pointers
6256 to functions.  In C++, warn also when an arithmetic operation involves
6257 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
6259 @item -Wpointer-compare
6260 @opindex Wpointer-compare
6261 @opindex Wno-pointer-compare
6262 Warn if a pointer is compared with a zero character constant.  This usually
6263 means that the pointer was meant to be dereferenced.  For example:
6265 @smallexample
6266 const char *p = foo ();
6267 if (p == '\0')
6268   return 42;
6269 @end smallexample
6271 Note that the code above is invalid in C++11.
6273 This warning is enabled by default.
6275 @item -Wtype-limits
6276 @opindex Wtype-limits
6277 @opindex Wno-type-limits
6278 Warn if a comparison is always true or always false due to the limited
6279 range of the data type, but do not warn for constant expressions.  For
6280 example, warn if an unsigned variable is compared against zero with
6281 @code{<} or @code{>=}.  This warning is also enabled by
6282 @option{-Wextra}.
6284 @include cppwarnopts.texi
6286 @item -Wbad-function-cast @r{(C and Objective-C only)}
6287 @opindex Wbad-function-cast
6288 @opindex Wno-bad-function-cast
6289 Warn when a function call is cast to a non-matching type.
6290 For example, warn if a call to a function returning an integer type 
6291 is cast to a pointer type.
6293 @item -Wc90-c99-compat @r{(C and Objective-C only)}
6294 @opindex Wc90-c99-compat
6295 @opindex Wno-c90-c99-compat
6296 Warn about features not present in ISO C90, but present in ISO C99.
6297 For instance, warn about use of variable length arrays, @code{long long}
6298 type, @code{bool} type, compound literals, designated initializers, and so
6299 on.  This option is independent of the standards mode.  Warnings are disabled
6300 in the expression that follows @code{__extension__}.
6302 @item -Wc99-c11-compat @r{(C and Objective-C only)}
6303 @opindex Wc99-c11-compat
6304 @opindex Wno-c99-c11-compat
6305 Warn about features not present in ISO C99, but present in ISO C11.
6306 For instance, warn about use of anonymous structures and unions,
6307 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
6308 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
6309 and so on.  This option is independent of the standards mode.  Warnings are
6310 disabled in the expression that follows @code{__extension__}.
6312 @item -Wc++-compat @r{(C and Objective-C only)}
6313 @opindex Wc++-compat
6314 @opindex Wno-c++-compat
6315 Warn about ISO C constructs that are outside of the common subset of
6316 ISO C and ISO C++, e.g.@: request for implicit conversion from
6317 @code{void *} to a pointer to non-@code{void} type.
6319 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
6320 @opindex Wc++11-compat
6321 @opindex Wno-c++11-compat
6322 Warn about C++ constructs whose meaning differs between ISO C++ 1998
6323 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
6324 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
6325 enabled by @option{-Wall}.
6327 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
6328 @opindex Wc++14-compat
6329 @opindex Wno-c++14-compat
6330 Warn about C++ constructs whose meaning differs between ISO C++ 2011
6331 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
6333 @item -Wc++17-compat @r{(C++ and Objective-C++ only)}
6334 @opindex Wc++17-compat
6335 @opindex Wno-c++17-compat
6336 Warn about C++ constructs whose meaning differs between ISO C++ 2014
6337 and ISO C++ 2017.  This warning is enabled by @option{-Wall}.
6339 @item -Wcast-qual
6340 @opindex Wcast-qual
6341 @opindex Wno-cast-qual
6342 Warn whenever a pointer is cast so as to remove a type qualifier from
6343 the target type.  For example, warn if a @code{const char *} is cast
6344 to an ordinary @code{char *}.
6346 Also warn when making a cast that introduces a type qualifier in an
6347 unsafe way.  For example, casting @code{char **} to @code{const char **}
6348 is unsafe, as in this example:
6350 @smallexample
6351   /* p is char ** value.  */
6352   const char **q = (const char **) p;
6353   /* Assignment of readonly string to const char * is OK.  */
6354   *q = "string";
6355   /* Now char** pointer points to read-only memory.  */
6356   **p = 'b';
6357 @end smallexample
6359 @item -Wcast-align
6360 @opindex Wcast-align
6361 @opindex Wno-cast-align
6362 Warn whenever a pointer is cast such that the required alignment of the
6363 target is increased.  For example, warn if a @code{char *} is cast to
6364 an @code{int *} on machines where integers can only be accessed at
6365 two- or four-byte boundaries.
6367 @item -Wcast-align=strict
6368 @opindex Wcast-align=strict
6369 Warn whenever a pointer is cast such that the required alignment of the
6370 target is increased.  For example, warn if a @code{char *} is cast to
6371 an @code{int *} regardless of the target machine.
6373 @item -Wcast-function-type
6374 @opindex Wcast-function-type
6375 @opindex Wno-cast-function-type
6376 Warn when a function pointer is cast to an incompatible function pointer.
6377 In a cast involving function types with a variable argument list only
6378 the types of initial arguments that are provided are considered.
6379 Any parameter of pointer-type matches any other pointer-type.  Any benign
6380 differences in integral types are ignored, like @code{int} vs. @code{long}
6381 on ILP32 targets.  Likewise type qualifiers are ignored.  The function
6382 type @code{void (*) (void)} is special and matches everything, which can
6383 be used to suppress this warning.
6384 In a cast involving pointer to member types this warning warns whenever
6385 the type cast is changing the pointer to member type.
6386 This warning is enabled by @option{-Wextra}.
6388 @item -Wwrite-strings
6389 @opindex Wwrite-strings
6390 @opindex Wno-write-strings
6391 When compiling C, give string constants the type @code{const
6392 char[@var{length}]} so that copying the address of one into a
6393 non-@code{const} @code{char *} pointer produces a warning.  These
6394 warnings help you find at compile time code that can try to write
6395 into a string constant, but only if you have been very careful about
6396 using @code{const} in declarations and prototypes.  Otherwise, it is
6397 just a nuisance. This is why we did not make @option{-Wall} request
6398 these warnings.
6400 When compiling C++, warn about the deprecated conversion from string
6401 literals to @code{char *}.  This warning is enabled by default for C++
6402 programs.
6404 @item -Wcatch-value
6405 @itemx -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)}
6406 @opindex Wcatch-value
6407 @opindex Wno-catch-value
6408 Warn about catch handlers that do not catch via reference.
6409 With @option{-Wcatch-value=1} (or @option{-Wcatch-value} for short)
6410 warn about polymorphic class types that are caught by value.
6411 With @option{-Wcatch-value=2} warn about all class types that are caught
6412 by value. With @option{-Wcatch-value=3} warn about all types that are
6413 not caught by reference. @option{-Wcatch-value} is enabled by @option{-Wall}.
6415 @item -Wclobbered
6416 @opindex Wclobbered
6417 @opindex Wno-clobbered
6418 Warn for variables that might be changed by @code{longjmp} or
6419 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
6421 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
6422 @opindex Wconditionally-supported
6423 @opindex Wno-conditionally-supported
6424 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
6426 @item -Wconversion
6427 @opindex Wconversion
6428 @opindex Wno-conversion
6429 Warn for implicit conversions that may alter a value. This includes
6430 conversions between real and integer, like @code{abs (x)} when
6431 @code{x} is @code{double}; conversions between signed and unsigned,
6432 like @code{unsigned ui = -1}; and conversions to smaller types, like
6433 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
6434 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
6435 changed by the conversion like in @code{abs (2.0)}.  Warnings about
6436 conversions between signed and unsigned integers can be disabled by
6437 using @option{-Wno-sign-conversion}.
6439 For C++, also warn for confusing overload resolution for user-defined
6440 conversions; and conversions that never use a type conversion
6441 operator: conversions to @code{void}, the same type, a base class or a
6442 reference to them. Warnings about conversions between signed and
6443 unsigned integers are disabled by default in C++ unless
6444 @option{-Wsign-conversion} is explicitly enabled.
6446 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
6447 @opindex Wconversion-null
6448 @opindex Wno-conversion-null
6449 Do not warn for conversions between @code{NULL} and non-pointer
6450 types. @option{-Wconversion-null} is enabled by default.
6452 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
6453 @opindex Wzero-as-null-pointer-constant
6454 @opindex Wno-zero-as-null-pointer-constant
6455 Warn when a literal @samp{0} is used as null pointer constant.  This can
6456 be useful to facilitate the conversion to @code{nullptr} in C++11.
6458 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
6459 @opindex Wsubobject-linkage
6460 @opindex Wno-subobject-linkage
6461 Warn if a class type has a base or a field whose type uses the anonymous
6462 namespace or depends on a type with no linkage.  If a type A depends on
6463 a type B with no or internal linkage, defining it in multiple
6464 translation units would be an ODR violation because the meaning of B
6465 is different in each translation unit.  If A only appears in a single
6466 translation unit, the best way to silence the warning is to give it
6467 internal linkage by putting it in an anonymous namespace as well.  The
6468 compiler doesn't give this warning for types defined in the main .C
6469 file, as those are unlikely to have multiple definitions.
6470 @option{-Wsubobject-linkage} is enabled by default.
6472 @item -Wdangling-else
6473 @opindex Wdangling-else
6474 @opindex Wno-dangling-else
6475 Warn about constructions where there may be confusion to which
6476 @code{if} statement an @code{else} branch belongs.  Here is an example of
6477 such a case:
6479 @smallexample
6480 @group
6482   if (a)
6483     if (b)
6484       foo ();
6485   else
6486     bar ();
6488 @end group
6489 @end smallexample
6491 In C/C++, every @code{else} branch belongs to the innermost possible
6492 @code{if} statement, which in this example is @code{if (b)}.  This is
6493 often not what the programmer expected, as illustrated in the above
6494 example by indentation the programmer chose.  When there is the
6495 potential for this confusion, GCC issues a warning when this flag
6496 is specified.  To eliminate the warning, add explicit braces around
6497 the innermost @code{if} statement so there is no way the @code{else}
6498 can belong to the enclosing @code{if}.  The resulting code
6499 looks like this:
6501 @smallexample
6502 @group
6504   if (a)
6505     @{
6506       if (b)
6507         foo ();
6508       else
6509         bar ();
6510     @}
6512 @end group
6513 @end smallexample
6515 This warning is enabled by @option{-Wparentheses}.
6517 @item -Wdate-time
6518 @opindex Wdate-time
6519 @opindex Wno-date-time
6520 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
6521 are encountered as they might prevent bit-wise-identical reproducible
6522 compilations.
6524 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
6525 @opindex Wdelete-incomplete
6526 @opindex Wno-delete-incomplete
6527 Warn when deleting a pointer to incomplete type, which may cause
6528 undefined behavior at runtime.  This warning is enabled by default.
6530 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
6531 @opindex Wuseless-cast
6532 @opindex Wno-useless-cast
6533 Warn when an expression is casted to its own type.
6535 @item -Wempty-body
6536 @opindex Wempty-body
6537 @opindex Wno-empty-body
6538 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
6539 while} statement.  This warning is also enabled by @option{-Wextra}.
6541 @item -Wenum-compare
6542 @opindex Wenum-compare
6543 @opindex Wno-enum-compare
6544 Warn about a comparison between values of different enumerated types.
6545 In C++ enumerated type mismatches in conditional expressions are also
6546 diagnosed and the warning is enabled by default.  In C this warning is 
6547 enabled by @option{-Wall}.
6549 @item -Wextra-semi @r{(C++, Objective-C++ only)}
6550 @opindex Wextra-semi
6551 @opindex Wno-extra-semi
6552 Warn about redundant semicolon after in-class function definition.
6554 @item -Wjump-misses-init @r{(C, Objective-C only)}
6555 @opindex Wjump-misses-init
6556 @opindex Wno-jump-misses-init
6557 Warn if a @code{goto} statement or a @code{switch} statement jumps
6558 forward across the initialization of a variable, or jumps backward to a
6559 label after the variable has been initialized.  This only warns about
6560 variables that are initialized when they are declared.  This warning is
6561 only supported for C and Objective-C; in C++ this sort of branch is an
6562 error in any case.
6564 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
6565 can be disabled with the @option{-Wno-jump-misses-init} option.
6567 @item -Wsign-compare
6568 @opindex Wsign-compare
6569 @opindex Wno-sign-compare
6570 @cindex warning for comparison of signed and unsigned values
6571 @cindex comparison of signed and unsigned values, warning
6572 @cindex signed and unsigned values, comparison warning
6573 Warn when a comparison between signed and unsigned values could produce
6574 an incorrect result when the signed value is converted to unsigned.
6575 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
6576 also enabled by @option{-Wextra}.
6578 @item -Wsign-conversion
6579 @opindex Wsign-conversion
6580 @opindex Wno-sign-conversion
6581 Warn for implicit conversions that may change the sign of an integer
6582 value, like assigning a signed integer expression to an unsigned
6583 integer variable. An explicit cast silences the warning. In C, this
6584 option is enabled also by @option{-Wconversion}.
6586 @item -Wfloat-conversion
6587 @opindex Wfloat-conversion
6588 @opindex Wno-float-conversion
6589 Warn for implicit conversions that reduce the precision of a real value.
6590 This includes conversions from real to integer, and from higher precision
6591 real to lower precision real values.  This option is also enabled by
6592 @option{-Wconversion}.
6594 @item -Wno-scalar-storage-order
6595 @opindex -Wno-scalar-storage-order
6596 @opindex -Wscalar-storage-order
6597 Do not warn on suspicious constructs involving reverse scalar storage order.
6599 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
6600 @opindex Wsized-deallocation
6601 @opindex Wno-sized-deallocation
6602 Warn about a definition of an unsized deallocation function
6603 @smallexample
6604 void operator delete (void *) noexcept;
6605 void operator delete[] (void *) noexcept;
6606 @end smallexample
6607 without a definition of the corresponding sized deallocation function
6608 @smallexample
6609 void operator delete (void *, std::size_t) noexcept;
6610 void operator delete[] (void *, std::size_t) noexcept;
6611 @end smallexample
6612 or vice versa.  Enabled by @option{-Wextra} along with
6613 @option{-fsized-deallocation}.
6615 @item -Wsizeof-pointer-div
6616 @opindex Wsizeof-pointer-div
6617 @opindex Wno-sizeof-pointer-div
6618 Warn for suspicious divisions of two sizeof expressions that divide
6619 the pointer size by the element size, which is the usual way to compute
6620 the array size but won't work out correctly with pointers.  This warning
6621 warns e.g.@: about @code{sizeof (ptr) / sizeof (ptr[0])} if @code{ptr} is
6622 not an array, but a pointer.  This warning is enabled by @option{-Wall}.
6624 @item -Wsizeof-pointer-memaccess
6625 @opindex Wsizeof-pointer-memaccess
6626 @opindex Wno-sizeof-pointer-memaccess
6627 Warn for suspicious length parameters to certain string and memory built-in
6628 functions if the argument uses @code{sizeof}.  This warning triggers for
6629 example for @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not
6630 an array, but a pointer, and suggests a possible fix, or about
6631 @code{memcpy (&foo, ptr, sizeof (&foo));}.  @option{-Wsizeof-pointer-memaccess}
6632 also warns about calls to bounded string copy functions like @code{strncat}
6633 or @code{strncpy} that specify as the bound a @code{sizeof} expression of
6634 the source array.  For example, in the following function the call to
6635 @code{strncat} specifies the size of the source string as the bound.  That
6636 is almost certainly a mistake and so the call is diagnosed.
6637 @smallexample
6638 void make_file (const char *name)
6640   char path[PATH_MAX];
6641   strncpy (path, name, sizeof path - 1);
6642   strncat (path, ".text", sizeof ".text");
6643   @dots{}
6645 @end smallexample
6647 The @option{-Wsizeof-pointer-memaccess} option is enabled by @option{-Wall}.
6649 @item -Wsizeof-array-argument
6650 @opindex Wsizeof-array-argument
6651 @opindex Wno-sizeof-array-argument
6652 Warn when the @code{sizeof} operator is applied to a parameter that is
6653 declared as an array in a function definition.  This warning is enabled by
6654 default for C and C++ programs.
6656 @item -Wmemset-elt-size
6657 @opindex Wmemset-elt-size
6658 @opindex Wno-memset-elt-size
6659 Warn for suspicious calls to the @code{memset} built-in function, if the
6660 first argument references an array, and the third argument is a number
6661 equal to the number of elements, but not equal to the size of the array
6662 in memory.  This indicates that the user has omitted a multiplication by
6663 the element size.  This warning is enabled by @option{-Wall}.
6665 @item -Wmemset-transposed-args
6666 @opindex Wmemset-transposed-args
6667 @opindex Wno-memset-transposed-args
6668 Warn for suspicious calls to the @code{memset} built-in function, if the
6669 second argument is not zero and the third argument is zero.  This warns e.g.@
6670 about @code{memset (buf, sizeof buf, 0)} where most probably
6671 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
6672 is only emitted if the third argument is literal zero.  If it is some
6673 expression that is folded to zero, a cast of zero to some type, etc., 
6674 it is far less likely that the user has mistakenly exchanged the arguments 
6675 and no warning is emitted.  This warning is enabled by @option{-Wall}.
6677 @item -Waddress
6678 @opindex Waddress
6679 @opindex Wno-address
6680 Warn about suspicious uses of memory addresses. These include using
6681 the address of a function in a conditional expression, such as
6682 @code{void func(void); if (func)}, and comparisons against the memory
6683 address of a string literal, such as @code{if (x == "abc")}.  Such
6684 uses typically indicate a programmer error: the address of a function
6685 always evaluates to true, so their use in a conditional usually
6686 indicate that the programmer forgot the parentheses in a function
6687 call; and comparisons against string literals result in unspecified
6688 behavior and are not portable in C, so they usually indicate that the
6689 programmer intended to use @code{strcmp}.  This warning is enabled by
6690 @option{-Wall}.
6692 @item -Wlogical-op
6693 @opindex Wlogical-op
6694 @opindex Wno-logical-op
6695 Warn about suspicious uses of logical operators in expressions.
6696 This includes using logical operators in contexts where a
6697 bit-wise operator is likely to be expected.  Also warns when
6698 the operands of a logical operator are the same:
6699 @smallexample
6700 extern int a;
6701 if (a < 0 && a < 0) @{ @dots{} @}
6702 @end smallexample
6704 @item -Wlogical-not-parentheses
6705 @opindex Wlogical-not-parentheses
6706 @opindex Wno-logical-not-parentheses
6707 Warn about logical not used on the left hand side operand of a comparison.
6708 This option does not warn if the right operand is considered to be a boolean
6709 expression.  Its purpose is to detect suspicious code like the following:
6710 @smallexample
6711 int a;
6712 @dots{}
6713 if (!a > 1) @{ @dots{} @}
6714 @end smallexample
6716 It is possible to suppress the warning by wrapping the LHS into
6717 parentheses:
6718 @smallexample
6719 if ((!a) > 1) @{ @dots{} @}
6720 @end smallexample
6722 This warning is enabled by @option{-Wall}.
6724 @item -Waggregate-return
6725 @opindex Waggregate-return
6726 @opindex Wno-aggregate-return
6727 Warn if any functions that return structures or unions are defined or
6728 called.  (In languages where you can return an array, this also elicits
6729 a warning.)
6731 @item -Wno-aggressive-loop-optimizations
6732 @opindex Wno-aggressive-loop-optimizations
6733 @opindex Waggressive-loop-optimizations
6734 Warn if in a loop with constant number of iterations the compiler detects
6735 undefined behavior in some statement during one or more of the iterations.
6737 @item -Wno-attributes
6738 @opindex Wno-attributes
6739 @opindex Wattributes
6740 Do not warn if an unexpected @code{__attribute__} is used, such as
6741 unrecognized attributes, function attributes applied to variables,
6742 etc.  This does not stop errors for incorrect use of supported
6743 attributes.
6745 @item -Wno-builtin-declaration-mismatch
6746 @opindex Wno-builtin-declaration-mismatch
6747 @opindex Wbuiltin-declaration-mismatch
6748 Warn if a built-in function is declared with the wrong signature or 
6749 as non-function.
6750 This warning is enabled by default.
6752 @item -Wno-builtin-macro-redefined
6753 @opindex Wno-builtin-macro-redefined
6754 @opindex Wbuiltin-macro-redefined
6755 Do not warn if certain built-in macros are redefined.  This suppresses
6756 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
6757 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
6759 @item -Wstrict-prototypes @r{(C and Objective-C only)}
6760 @opindex Wstrict-prototypes
6761 @opindex Wno-strict-prototypes
6762 Warn if a function is declared or defined without specifying the
6763 argument types.  (An old-style function definition is permitted without
6764 a warning if preceded by a declaration that specifies the argument
6765 types.)
6767 @item -Wold-style-declaration @r{(C and Objective-C only)}
6768 @opindex Wold-style-declaration
6769 @opindex Wno-old-style-declaration
6770 Warn for obsolescent usages, according to the C Standard, in a
6771 declaration. For example, warn if storage-class specifiers like
6772 @code{static} are not the first things in a declaration.  This warning
6773 is also enabled by @option{-Wextra}.
6775 @item -Wold-style-definition @r{(C and Objective-C only)}
6776 @opindex Wold-style-definition
6777 @opindex Wno-old-style-definition
6778 Warn if an old-style function definition is used.  A warning is given
6779 even if there is a previous prototype.
6781 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
6782 @opindex Wmissing-parameter-type
6783 @opindex Wno-missing-parameter-type
6784 A function parameter is declared without a type specifier in K&R-style
6785 functions:
6787 @smallexample
6788 void foo(bar) @{ @}
6789 @end smallexample
6791 This warning is also enabled by @option{-Wextra}.
6793 @item -Wmissing-prototypes @r{(C and Objective-C only)}
6794 @opindex Wmissing-prototypes
6795 @opindex Wno-missing-prototypes
6796 Warn if a global function is defined without a previous prototype
6797 declaration.  This warning is issued even if the definition itself
6798 provides a prototype.  Use this option to detect global functions
6799 that do not have a matching prototype declaration in a header file.
6800 This option is not valid for C++ because all function declarations
6801 provide prototypes and a non-matching declaration declares an
6802 overload rather than conflict with an earlier declaration.
6803 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
6805 @item -Wmissing-declarations
6806 @opindex Wmissing-declarations
6807 @opindex Wno-missing-declarations
6808 Warn if a global function is defined without a previous declaration.
6809 Do so even if the definition itself provides a prototype.
6810 Use this option to detect global functions that are not declared in
6811 header files.  In C, no warnings are issued for functions with previous
6812 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
6813 missing prototypes.  In C++, no warnings are issued for function templates,
6814 or for inline functions, or for functions in anonymous namespaces.
6816 @item -Wmissing-field-initializers
6817 @opindex Wmissing-field-initializers
6818 @opindex Wno-missing-field-initializers
6819 @opindex W
6820 @opindex Wextra
6821 @opindex Wno-extra
6822 Warn if a structure's initializer has some fields missing.  For
6823 example, the following code causes such a warning, because
6824 @code{x.h} is implicitly zero:
6826 @smallexample
6827 struct s @{ int f, g, h; @};
6828 struct s x = @{ 3, 4 @};
6829 @end smallexample
6831 This option does not warn about designated initializers, so the following
6832 modification does not trigger a warning:
6834 @smallexample
6835 struct s @{ int f, g, h; @};
6836 struct s x = @{ .f = 3, .g = 4 @};
6837 @end smallexample
6839 In C this option does not warn about the universal zero initializer
6840 @samp{@{ 0 @}}:
6842 @smallexample
6843 struct s @{ int f, g, h; @};
6844 struct s x = @{ 0 @};
6845 @end smallexample
6847 Likewise, in C++ this option does not warn about the empty @{ @}
6848 initializer, for example:
6850 @smallexample
6851 struct s @{ int f, g, h; @};
6852 s x = @{ @};
6853 @end smallexample
6855 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
6856 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
6858 @item -Wno-multichar
6859 @opindex Wno-multichar
6860 @opindex Wmultichar
6861 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
6862 Usually they indicate a typo in the user's code, as they have
6863 implementation-defined values, and should not be used in portable code.
6865 @item -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]}
6866 @opindex Wnormalized=
6867 @opindex Wnormalized
6868 @opindex Wno-normalized
6869 @cindex NFC
6870 @cindex NFKC
6871 @cindex character set, input normalization
6872 In ISO C and ISO C++, two identifiers are different if they are
6873 different sequences of characters.  However, sometimes when characters
6874 outside the basic ASCII character set are used, you can have two
6875 different character sequences that look the same.  To avoid confusion,
6876 the ISO 10646 standard sets out some @dfn{normalization rules} which
6877 when applied ensure that two sequences that look the same are turned into
6878 the same sequence.  GCC can warn you if you are using identifiers that
6879 have not been normalized; this option controls that warning.
6881 There are four levels of warning supported by GCC@.  The default is
6882 @option{-Wnormalized=nfc}, which warns about any identifier that is
6883 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
6884 recommended form for most uses.  It is equivalent to
6885 @option{-Wnormalized}.
6887 Unfortunately, there are some characters allowed in identifiers by
6888 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
6889 identifiers.  That is, there's no way to use these symbols in portable
6890 ISO C or C++ and have all your identifiers in NFC@.
6891 @option{-Wnormalized=id} suppresses the warning for these characters.
6892 It is hoped that future versions of the standards involved will correct
6893 this, which is why this option is not the default.
6895 You can switch the warning off for all characters by writing
6896 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
6897 only do this if you are using some other normalization scheme (like
6898 ``D''), because otherwise you can easily create bugs that are
6899 literally impossible to see.
6901 Some characters in ISO 10646 have distinct meanings but look identical
6902 in some fonts or display methodologies, especially once formatting has
6903 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
6904 LETTER N'', displays just like a regular @code{n} that has been
6905 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
6906 normalization scheme to convert all these into a standard form as
6907 well, and GCC warns if your code is not in NFKC if you use
6908 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
6909 about every identifier that contains the letter O because it might be
6910 confused with the digit 0, and so is not the default, but may be
6911 useful as a local coding convention if the programming environment 
6912 cannot be fixed to display these characters distinctly.
6914 @item -Wno-deprecated
6915 @opindex Wno-deprecated
6916 @opindex Wdeprecated
6917 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
6919 @item -Wno-deprecated-declarations
6920 @opindex Wno-deprecated-declarations
6921 @opindex Wdeprecated-declarations
6922 Do not warn about uses of functions (@pxref{Function Attributes}),
6923 variables (@pxref{Variable Attributes}), and types (@pxref{Type
6924 Attributes}) marked as deprecated by using the @code{deprecated}
6925 attribute.
6927 @item -Wno-overflow
6928 @opindex Wno-overflow
6929 @opindex Woverflow
6930 Do not warn about compile-time overflow in constant expressions.
6932 @item -Wno-odr
6933 @opindex Wno-odr
6934 @opindex Wodr
6935 Warn about One Definition Rule violations during link-time optimization.
6936 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
6938 @item -Wopenmp-simd
6939 @opindex Wopenmp-simd
6940 @opindex Wno-openmp-simd
6941 Warn if the vectorizer cost model overrides the OpenMP
6942 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
6943 option can be used to relax the cost model.
6945 @item -Woverride-init @r{(C and Objective-C only)}
6946 @opindex Woverride-init
6947 @opindex Wno-override-init
6948 @opindex W
6949 @opindex Wextra
6950 @opindex Wno-extra
6951 Warn if an initialized field without side effects is overridden when
6952 using designated initializers (@pxref{Designated Inits, , Designated
6953 Initializers}).
6955 This warning is included in @option{-Wextra}.  To get other
6956 @option{-Wextra} warnings without this one, use @option{-Wextra
6957 -Wno-override-init}.
6959 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
6960 @opindex Woverride-init-side-effects
6961 @opindex Wno-override-init-side-effects
6962 Warn if an initialized field with side effects is overridden when
6963 using designated initializers (@pxref{Designated Inits, , Designated
6964 Initializers}).  This warning is enabled by default.
6966 @item -Wpacked
6967 @opindex Wpacked
6968 @opindex Wno-packed
6969 Warn if a structure is given the packed attribute, but the packed
6970 attribute has no effect on the layout or size of the structure.
6971 Such structures may be mis-aligned for little benefit.  For
6972 instance, in this code, the variable @code{f.x} in @code{struct bar}
6973 is misaligned even though @code{struct bar} does not itself
6974 have the packed attribute:
6976 @smallexample
6977 @group
6978 struct foo @{
6979   int x;
6980   char a, b, c, d;
6981 @} __attribute__((packed));
6982 struct bar @{
6983   char z;
6984   struct foo f;
6986 @end group
6987 @end smallexample
6989 @item -Wpacked-bitfield-compat
6990 @opindex Wpacked-bitfield-compat
6991 @opindex Wno-packed-bitfield-compat
6992 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
6993 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
6994 the change can lead to differences in the structure layout.  GCC
6995 informs you when the offset of such a field has changed in GCC 4.4.
6996 For example there is no longer a 4-bit padding between field @code{a}
6997 and @code{b} in this structure:
6999 @smallexample
7000 struct foo
7002   char a:4;
7003   char b:8;
7004 @} __attribute__ ((packed));
7005 @end smallexample
7007 This warning is enabled by default.  Use
7008 @option{-Wno-packed-bitfield-compat} to disable this warning.
7010 @item -Wpacked-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
7011 @opindex Wpacked-not-aligned
7012 @opindex Wno-packed-not-aligned
7013 Warn if a structure field with explicitly specified alignment in a
7014 packed struct or union is misaligned.  For example, a warning will
7015 be issued on @code{struct S}, like, @code{warning: alignment 1 of
7016 'struct S' is less than 8}, in this code:
7018 @smallexample
7019 @group
7020 struct __attribute__ ((aligned (8))) S8 @{ char a[8]; @};
7021 struct __attribute__ ((packed)) S @{
7022   struct S8 s8;
7024 @end group
7025 @end smallexample
7027 This warning is enabled by @option{-Wall}.
7029 @item -Wpadded
7030 @opindex Wpadded
7031 @opindex Wno-padded
7032 Warn if padding is included in a structure, either to align an element
7033 of the structure or to align the whole structure.  Sometimes when this
7034 happens it is possible to rearrange the fields of the structure to
7035 reduce the padding and so make the structure smaller.
7037 @item -Wredundant-decls
7038 @opindex Wredundant-decls
7039 @opindex Wno-redundant-decls
7040 Warn if anything is declared more than once in the same scope, even in
7041 cases where multiple declaration is valid and changes nothing.
7043 @item -Wno-restrict
7044 @opindex Wrestrict
7045 @opindex Wno-restrict
7046 Warn when an object referenced by a @code{restrict}-qualified parameter
7047 (or, in C++, a @code{__restrict}-qualified parameter) is aliased by another
7048 argument, or when copies between such objects overlap.  For example,
7049 the call to the @code{strcpy} function below attempts to truncate the string
7050 by replacing its initial characters with the last four.  However, because
7051 the call writes the terminating NUL into @code{a[4]}, the copies overlap and
7052 the call is diagnosed.
7054 @smallexample
7055 void foo (void)
7057   char a[] = "abcd1234";
7058   strcpy (a, a + 4);
7059   @dots{}
7061 @end smallexample
7062 The @option{-Wrestrict} option detects some instances of simple overlap
7063 even without optimization but works best at @option{-O2} and above.  It
7064 is included in @option{-Wall}.
7066 @item -Wnested-externs @r{(C and Objective-C only)}
7067 @opindex Wnested-externs
7068 @opindex Wno-nested-externs
7069 Warn if an @code{extern} declaration is encountered within a function.
7071 @item -Wno-inherited-variadic-ctor
7072 @opindex Winherited-variadic-ctor
7073 @opindex Wno-inherited-variadic-ctor
7074 Suppress warnings about use of C++11 inheriting constructors when the
7075 base class inherited from has a C variadic constructor; the warning is
7076 on by default because the ellipsis is not inherited.
7078 @item -Winline
7079 @opindex Winline
7080 @opindex Wno-inline
7081 Warn if a function that is declared as inline cannot be inlined.
7082 Even with this option, the compiler does not warn about failures to
7083 inline functions declared in system headers.
7085 The compiler uses a variety of heuristics to determine whether or not
7086 to inline a function.  For example, the compiler takes into account
7087 the size of the function being inlined and the amount of inlining
7088 that has already been done in the current function.  Therefore,
7089 seemingly insignificant changes in the source program can cause the
7090 warnings produced by @option{-Winline} to appear or disappear.
7092 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
7093 @opindex Wno-invalid-offsetof
7094 @opindex Winvalid-offsetof
7095 Suppress warnings from applying the @code{offsetof} macro to a non-POD
7096 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
7097 to a non-standard-layout type is undefined.  In existing C++ implementations,
7098 however, @code{offsetof} typically gives meaningful results.
7099 This flag is for users who are aware that they are
7100 writing nonportable code and who have deliberately chosen to ignore the
7101 warning about it.
7103 The restrictions on @code{offsetof} may be relaxed in a future version
7104 of the C++ standard.
7106 @item -Wint-in-bool-context
7107 @opindex Wint-in-bool-context
7108 @opindex Wno-int-in-bool-context
7109 Warn for suspicious use of integer values where boolean values are expected,
7110 such as conditional expressions (?:) using non-boolean integer constants in
7111 boolean context, like @code{if (a <= b ? 2 : 3)}.  Or left shifting of signed
7112 integers in boolean context, like @code{for (a = 0; 1 << a; a++);}.  Likewise
7113 for all kinds of multiplications regardless of the data type.
7114 This warning is enabled by @option{-Wall}.
7116 @item -Wno-int-to-pointer-cast
7117 @opindex Wno-int-to-pointer-cast
7118 @opindex Wint-to-pointer-cast
7119 Suppress warnings from casts to pointer type of an integer of a
7120 different size. In C++, casting to a pointer type of smaller size is
7121 an error. @option{Wint-to-pointer-cast} is enabled by default.
7124 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
7125 @opindex Wno-pointer-to-int-cast
7126 @opindex Wpointer-to-int-cast
7127 Suppress warnings from casts from a pointer to an integer type of a
7128 different size.
7130 @item -Winvalid-pch
7131 @opindex Winvalid-pch
7132 @opindex Wno-invalid-pch
7133 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
7134 the search path but cannot be used.
7136 @item -Wlong-long
7137 @opindex Wlong-long
7138 @opindex Wno-long-long
7139 Warn if @code{long long} type is used.  This is enabled by either
7140 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
7141 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
7143 @item -Wvariadic-macros
7144 @opindex Wvariadic-macros
7145 @opindex Wno-variadic-macros
7146 Warn if variadic macros are used in ISO C90 mode, or if the GNU
7147 alternate syntax is used in ISO C99 mode.  This is enabled by either
7148 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
7149 messages, use @option{-Wno-variadic-macros}.
7151 @item -Wvarargs
7152 @opindex Wvarargs
7153 @opindex Wno-varargs
7154 Warn upon questionable usage of the macros used to handle variable
7155 arguments like @code{va_start}.  This is default.  To inhibit the
7156 warning messages, use @option{-Wno-varargs}.
7158 @item -Wvector-operation-performance
7159 @opindex Wvector-operation-performance
7160 @opindex Wno-vector-operation-performance
7161 Warn if vector operation is not implemented via SIMD capabilities of the
7162 architecture.  Mainly useful for the performance tuning.
7163 Vector operation can be implemented @code{piecewise}, which means that the
7164 scalar operation is performed on every vector element; 
7165 @code{in parallel}, which means that the vector operation is implemented
7166 using scalars of wider type, which normally is more performance efficient;
7167 and @code{as a single scalar}, which means that vector fits into a
7168 scalar type.
7170 @item -Wno-virtual-move-assign
7171 @opindex Wvirtual-move-assign
7172 @opindex Wno-virtual-move-assign
7173 Suppress warnings about inheriting from a virtual base with a
7174 non-trivial C++11 move assignment operator.  This is dangerous because
7175 if the virtual base is reachable along more than one path, it is
7176 moved multiple times, which can mean both objects end up in the
7177 moved-from state.  If the move assignment operator is written to avoid
7178 moving from a moved-from object, this warning can be disabled.
7180 @item -Wvla
7181 @opindex Wvla
7182 @opindex Wno-vla
7183 Warn if a variable-length array is used in the code.
7184 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
7185 the variable-length array.
7187 @item -Wvla-larger-than=@var{byte-size}
7188 @opindex -Wvla-larger-than=
7189 @opindex -Wno-vla-larger-than
7190 If this option is used, the compiler will warn for declarations of
7191 variable-length arrays whose size is either unbounded, or bounded
7192 by an argument that allows the array size to exceed @var{byte-size}
7193 bytes.  This is similar to how @option{-Walloca-larger-than=}@var{byte-size}
7194 works, but with variable-length arrays.
7196 Note that GCC may optimize small variable-length arrays of a known
7197 value into plain arrays, so this warning may not get triggered for
7198 such arrays.
7200 @option{-Wvla-larger-than=}@samp{PTRDIFF_MAX} is enabled by default but
7201 is typically only effective when @option{-ftree-vrp} is active (default
7202 for @option{-O2} and above).
7204 See also @option{-Walloca-larger-than=@var{byte-size}}.
7206 @item -Wno-vla-larger-than
7207 @opindex Wno-vla-larger-than
7208 Disable @option{-Wvla-larger-than=} warnings.  The option is equivalent
7209 to @option{-Wvla-larger-than=}@samp{SIZE_MAX} or larger.
7211 @item -Wvolatile-register-var
7212 @opindex Wvolatile-register-var
7213 @opindex Wno-volatile-register-var
7214 Warn if a register variable is declared volatile.  The volatile
7215 modifier does not inhibit all optimizations that may eliminate reads
7216 and/or writes to register variables.  This warning is enabled by
7217 @option{-Wall}.
7219 @item -Wdisabled-optimization
7220 @opindex Wdisabled-optimization
7221 @opindex Wno-disabled-optimization
7222 Warn if a requested optimization pass is disabled.  This warning does
7223 not generally indicate that there is anything wrong with your code; it
7224 merely indicates that GCC's optimizers are unable to handle the code
7225 effectively.  Often, the problem is that your code is too big or too
7226 complex; GCC refuses to optimize programs when the optimization
7227 itself is likely to take inordinate amounts of time.
7229 @item -Wpointer-sign @r{(C and Objective-C only)}
7230 @opindex Wpointer-sign
7231 @opindex Wno-pointer-sign
7232 Warn for pointer argument passing or assignment with different signedness.
7233 This option is only supported for C and Objective-C@.  It is implied by
7234 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
7235 @option{-Wno-pointer-sign}.
7237 @item -Wstack-protector
7238 @opindex Wstack-protector
7239 @opindex Wno-stack-protector
7240 This option is only active when @option{-fstack-protector} is active.  It
7241 warns about functions that are not protected against stack smashing.
7243 @item -Woverlength-strings
7244 @opindex Woverlength-strings
7245 @opindex Wno-overlength-strings
7246 Warn about string constants that are longer than the ``minimum
7247 maximum'' length specified in the C standard.  Modern compilers
7248 generally allow string constants that are much longer than the
7249 standard's minimum limit, but very portable programs should avoid
7250 using longer strings.
7252 The limit applies @emph{after} string constant concatenation, and does
7253 not count the trailing NUL@.  In C90, the limit was 509 characters; in
7254 C99, it was raised to 4095.  C++98 does not specify a normative
7255 minimum maximum, so we do not diagnose overlength strings in C++@.
7257 This option is implied by @option{-Wpedantic}, and can be disabled with
7258 @option{-Wno-overlength-strings}.
7260 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
7261 @opindex Wunsuffixed-float-constants
7262 @opindex Wno-unsuffixed-float-constants
7264 Issue a warning for any floating constant that does not have
7265 a suffix.  When used together with @option{-Wsystem-headers} it
7266 warns about such constants in system header files.  This can be useful
7267 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
7268 from the decimal floating-point extension to C99.
7270 @item -Wno-designated-init @r{(C and Objective-C only)}
7271 Suppress warnings when a positional initializer is used to initialize
7272 a structure that has been marked with the @code{designated_init}
7273 attribute.
7275 @item -Whsa
7276 Issue a warning when HSAIL cannot be emitted for the compiled function or
7277 OpenMP construct.
7279 @end table
7281 @node Debugging Options
7282 @section Options for Debugging Your Program
7283 @cindex options, debugging
7284 @cindex debugging information options
7286 To tell GCC to emit extra information for use by a debugger, in almost 
7287 all cases you need only to add @option{-g} to your other options.
7289 GCC allows you to use @option{-g} with
7290 @option{-O}.  The shortcuts taken by optimized code may occasionally
7291 be surprising: some variables you declared may not exist
7292 at all; flow of control may briefly move where you did not expect it;
7293 some statements may not be executed because they compute constant
7294 results or their values are already at hand; some statements may
7295 execute in different places because they have been moved out of loops.
7296 Nevertheless it is possible to debug optimized output.  This makes
7297 it reasonable to use the optimizer for programs that might have bugs.
7299 If you are not using some other optimization option, consider
7300 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
7301 With no @option{-O} option at all, some compiler passes that collect
7302 information useful for debugging do not run at all, so that
7303 @option{-Og} may result in a better debugging experience.
7305 @table @gcctabopt
7306 @item -g
7307 @opindex g
7308 Produce debugging information in the operating system's native format
7309 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
7310 information.
7312 On most systems that use stabs format, @option{-g} enables use of extra
7313 debugging information that only GDB can use; this extra information
7314 makes debugging work better in GDB but probably makes other debuggers
7315 crash or
7316 refuse to read the program.  If you want to control for certain whether
7317 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
7318 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
7320 @item -ggdb
7321 @opindex ggdb
7322 Produce debugging information for use by GDB@.  This means to use the
7323 most expressive format available (DWARF, stabs, or the native format
7324 if neither of those are supported), including GDB extensions if at all
7325 possible.
7327 @item -gdwarf
7328 @itemx -gdwarf-@var{version}
7329 @opindex gdwarf
7330 Produce debugging information in DWARF format (if that is supported).
7331 The value of @var{version} may be either 2, 3, 4 or 5; the default version
7332 for most targets is 4.  DWARF Version 5 is only experimental.
7334 Note that with DWARF Version 2, some ports require and always
7335 use some non-conflicting DWARF 3 extensions in the unwind tables.
7337 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
7338 for maximum benefit.
7340 GCC no longer supports DWARF Version 1, which is substantially
7341 different than Version 2 and later.  For historical reasons, some
7342 other DWARF-related options such as
7343 @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
7344 in their names, but apply to all currently-supported versions of DWARF.
7346 @item -gstabs
7347 @opindex gstabs
7348 Produce debugging information in stabs format (if that is supported),
7349 without GDB extensions.  This is the format used by DBX on most BSD
7350 systems.  On MIPS, Alpha and System V Release 4 systems this option
7351 produces stabs debugging output that is not understood by DBX@.
7352 On System V Release 4 systems this option requires the GNU assembler.
7354 @item -gstabs+
7355 @opindex gstabs+
7356 Produce debugging information in stabs format (if that is supported),
7357 using GNU extensions understood only by the GNU debugger (GDB)@.  The
7358 use of these extensions is likely to make other debuggers crash or
7359 refuse to read the program.
7361 @item -gxcoff
7362 @opindex gxcoff
7363 Produce debugging information in XCOFF format (if that is supported).
7364 This is the format used by the DBX debugger on IBM RS/6000 systems.
7366 @item -gxcoff+
7367 @opindex gxcoff+
7368 Produce debugging information in XCOFF format (if that is supported),
7369 using GNU extensions understood only by the GNU debugger (GDB)@.  The
7370 use of these extensions is likely to make other debuggers crash or
7371 refuse to read the program, and may cause assemblers other than the GNU
7372 assembler (GAS) to fail with an error.
7374 @item -gvms
7375 @opindex gvms
7376 Produce debugging information in Alpha/VMS debug format (if that is
7377 supported).  This is the format used by DEBUG on Alpha/VMS systems.
7379 @item -g@var{level}
7380 @itemx -ggdb@var{level}
7381 @itemx -gstabs@var{level}
7382 @itemx -gxcoff@var{level}
7383 @itemx -gvms@var{level}
7384 Request debugging information and also use @var{level} to specify how
7385 much information.  The default level is 2.
7387 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
7388 @option{-g}.
7390 Level 1 produces minimal information, enough for making backtraces in
7391 parts of the program that you don't plan to debug.  This includes
7392 descriptions of functions and external variables, and line number
7393 tables, but no information about local variables.
7395 Level 3 includes extra information, such as all the macro definitions
7396 present in the program.  Some debuggers support macro expansion when
7397 you use @option{-g3}.
7399 @option{-gdwarf} does not accept a concatenated debug level, to avoid
7400 confusion with @option{-gdwarf-@var{level}}.
7401 Instead use an additional @option{-g@var{level}} option to change the
7402 debug level for DWARF.
7404 @item -feliminate-unused-debug-symbols
7405 @opindex feliminate-unused-debug-symbols
7406 Produce debugging information in stabs format (if that is supported),
7407 for only symbols that are actually used.
7409 @item -femit-class-debug-always
7410 @opindex femit-class-debug-always
7411 Instead of emitting debugging information for a C++ class in only one
7412 object file, emit it in all object files using the class.  This option
7413 should be used only with debuggers that are unable to handle the way GCC
7414 normally emits debugging information for classes because using this
7415 option increases the size of debugging information by as much as a
7416 factor of two.
7418 @item -fno-merge-debug-strings
7419 @opindex fmerge-debug-strings
7420 @opindex fno-merge-debug-strings
7421 Direct the linker to not merge together strings in the debugging
7422 information that are identical in different object files.  Merging is
7423 not supported by all assemblers or linkers.  Merging decreases the size
7424 of the debug information in the output file at the cost of increasing
7425 link processing time.  Merging is enabled by default.
7427 @item -fdebug-prefix-map=@var{old}=@var{new}
7428 @opindex fdebug-prefix-map
7429 When compiling files residing in directory @file{@var{old}}, record
7430 debugging information describing them as if the files resided in
7431 directory @file{@var{new}} instead.  This can be used to replace a
7432 build-time path with an install-time path in the debug info.  It can
7433 also be used to change an absolute path to a relative path by using
7434 @file{.} for @var{new}.  This can give more reproducible builds, which
7435 are location independent, but may require an extra command to tell GDB
7436 where to find the source files. See also @option{-ffile-prefix-map}.
7438 @item -fvar-tracking
7439 @opindex fvar-tracking
7440 Run variable tracking pass.  It computes where variables are stored at each
7441 position in code.  Better debugging information is then generated
7442 (if the debugging information format supports this information).
7444 It is enabled by default when compiling with optimization (@option{-Os},
7445 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
7446 the debug info format supports it.
7448 @item -fvar-tracking-assignments
7449 @opindex fvar-tracking-assignments
7450 @opindex fno-var-tracking-assignments
7451 Annotate assignments to user variables early in the compilation and
7452 attempt to carry the annotations over throughout the compilation all the
7453 way to the end, in an attempt to improve debug information while
7454 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
7456 It can be enabled even if var-tracking is disabled, in which case
7457 annotations are created and maintained, but discarded at the end.
7458 By default, this flag is enabled together with @option{-fvar-tracking},
7459 except when selective scheduling is enabled.
7461 @item -gsplit-dwarf
7462 @opindex gsplit-dwarf
7463 Separate as much DWARF debugging information as possible into a
7464 separate output file with the extension @file{.dwo}.  This option allows
7465 the build system to avoid linking files with debug information.  To
7466 be useful, this option requires a debugger capable of reading @file{.dwo}
7467 files.
7469 @item -gpubnames
7470 @opindex gpubnames
7471 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
7473 @item -ggnu-pubnames
7474 @opindex ggnu-pubnames
7475 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
7476 suitable for conversion into a GDB@ index.  This option is only useful
7477 with a linker that can produce GDB@ index version 7.
7479 @item -fdebug-types-section
7480 @opindex fdebug-types-section
7481 @opindex fno-debug-types-section
7482 When using DWARF Version 4 or higher, type DIEs can be put into
7483 their own @code{.debug_types} section instead of making them part of the
7484 @code{.debug_info} section.  It is more efficient to put them in a separate
7485 comdat section since the linker can then remove duplicates.
7486 But not all DWARF consumers support @code{.debug_types} sections yet
7487 and on some objects @code{.debug_types} produces larger instead of smaller
7488 debugging information.
7490 @item -grecord-gcc-switches
7491 @itemx -gno-record-gcc-switches
7492 @opindex grecord-gcc-switches
7493 @opindex gno-record-gcc-switches
7494 This switch causes the command-line options used to invoke the
7495 compiler that may affect code generation to be appended to the
7496 DW_AT_producer attribute in DWARF debugging information.  The options
7497 are concatenated with spaces separating them from each other and from
7498 the compiler version.  
7499 It is enabled by default.
7500 See also @option{-frecord-gcc-switches} for another
7501 way of storing compiler options into the object file.  
7503 @item -gstrict-dwarf
7504 @opindex gstrict-dwarf
7505 Disallow using extensions of later DWARF standard version than selected
7506 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
7507 DWARF extensions from later standard versions is allowed.
7509 @item -gno-strict-dwarf
7510 @opindex gno-strict-dwarf
7511 Allow using extensions of later DWARF standard version than selected with
7512 @option{-gdwarf-@var{version}}.
7514 @item -gas-loc-support
7515 @opindex gas-loc-support
7516 Inform the compiler that the assembler supports @code{.loc} directives.
7517 It may then use them for the assembler to generate DWARF2+ line number
7518 tables.
7520 This is generally desirable, because assembler-generated line-number
7521 tables are a lot more compact than those the compiler can generate
7522 itself.
7524 This option will be enabled by default if, at GCC configure time, the
7525 assembler was found to support such directives.
7527 @item -gno-as-loc-support
7528 @opindex gno-as-loc-support
7529 Force GCC to generate DWARF2+ line number tables internally, if DWARF2+
7530 line number tables are to be generated.
7532 @item gas-locview-support
7533 @opindex gas-locview-support
7534 Inform the compiler that the assembler supports @code{view} assignment
7535 and reset assertion checking in @code{.loc} directives.
7537 This option will be enabled by default if, at GCC configure time, the
7538 assembler was found to support them.
7540 @item gno-as-locview-support
7541 Force GCC to assign view numbers internally, if
7542 @option{-gvariable-location-views} are explicitly requested.
7544 @item -gcolumn-info
7545 @itemx -gno-column-info
7546 @opindex gcolumn-info
7547 @opindex gno-column-info
7548 Emit location column information into DWARF debugging information, rather
7549 than just file and line.
7550 This option is enabled by default.
7552 @item -gstatement-frontiers
7553 @itemx -gno-statement-frontiers
7554 @opindex gstatement-frontiers
7555 @opindex gno-statement-frontiers
7556 This option causes GCC to create markers in the internal representation
7557 at the beginning of statements, and to keep them roughly in place
7558 throughout compilation, using them to guide the output of @code{is_stmt}
7559 markers in the line number table.  This is enabled by default when
7560 compiling with optimization (@option{-Os}, @option{-O}, @option{-O2},
7561 @dots{}), and outputting DWARF 2 debug information at the normal level.
7563 @item -gvariable-location-views
7564 @itemx -gvariable-location-views=incompat5
7565 @itemx -gno-variable-location-views
7566 @opindex gvariable-location-views
7567 @opindex gvariable-location-views=incompat5
7568 @opindex gno-variable-location-views
7569 Augment variable location lists with progressive view numbers implied
7570 from the line number table.  This enables debug information consumers to
7571 inspect state at certain points of the program, even if no instructions
7572 associated with the corresponding source locations are present at that
7573 point.  If the assembler lacks support for view numbers in line number
7574 tables, this will cause the compiler to emit the line number table,
7575 which generally makes them somewhat less compact.  The augmented line
7576 number tables and location lists are fully backward-compatible, so they
7577 can be consumed by debug information consumers that are not aware of
7578 these augmentations, but they won't derive any benefit from them either.
7580 This is enabled by default when outputting DWARF 2 debug information at
7581 the normal level, as long as there is assembler support,
7582 @option{-fvar-tracking-assignments} is enabled and
7583 @option{-gstrict-dwarf} is not.  When assembler support is not
7584 available, this may still be enabled, but it will force GCC to output
7585 internal line number tables, and if
7586 @option{-ginternal-reset-location-views} is not enabled, that will most
7587 certainly lead to silently mismatching location views.
7589 There is a proposed representation for view numbers that is not backward
7590 compatible with the location list format introduced in DWARF 5, that can
7591 be enabled with @option{-gvariable-location-views=incompat5}.  This
7592 option may be removed in the future, is only provided as a reference
7593 implementation of the proposed representation.  Debug information
7594 consumers are not expected to support this extended format, and they
7595 would be rendered unable to decode location lists using it.
7597 @item -ginternal-reset-location-views
7598 @itemx -gnointernal-reset-location-views
7599 @opindex ginternal-reset-location-views
7600 @opindex gno-internal-reset-location-views
7601 Attempt to determine location views that can be omitted from location
7602 view lists.  This requires the compiler to have very accurate insn
7603 length estimates, which isn't always the case, and it may cause
7604 incorrect view lists to be generated silently when using an assembler
7605 that does not support location view lists.  The GNU assembler will flag
7606 any such error as a @code{view number mismatch}.  This is only enabled
7607 on ports that define a reliable estimation function.
7609 @item -ginline-points
7610 @itemx -gno-inline-points
7611 @opindex ginline-points
7612 @opindex gno-inline-points
7613 Generate extended debug information for inlined functions.  Location
7614 view tracking markers are inserted at inlined entry points, so that
7615 address and view numbers can be computed and output in debug
7616 information.  This can be enabled independently of location views, in
7617 which case the view numbers won't be output, but it can only be enabled
7618 along with statement frontiers, and it is only enabled by default if
7619 location views are enabled.
7621 @item -gz@r{[}=@var{type}@r{]}
7622 @opindex gz
7623 Produce compressed debug sections in DWARF format, if that is supported.
7624 If @var{type} is not given, the default type depends on the capabilities
7625 of the assembler and linker used.  @var{type} may be one of
7626 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
7627 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
7628 compression in traditional GNU format).  If the linker doesn't support
7629 writing compressed debug sections, the option is rejected.  Otherwise,
7630 if the assembler does not support them, @option{-gz} is silently ignored
7631 when producing object files.
7633 @item -femit-struct-debug-baseonly
7634 @opindex femit-struct-debug-baseonly
7635 Emit debug information for struct-like types
7636 only when the base name of the compilation source file
7637 matches the base name of file in which the struct is defined.
7639 This option substantially reduces the size of debugging information,
7640 but at significant potential loss in type information to the debugger.
7641 See @option{-femit-struct-debug-reduced} for a less aggressive option.
7642 See @option{-femit-struct-debug-detailed} for more detailed control.
7644 This option works only with DWARF debug output.
7646 @item -femit-struct-debug-reduced
7647 @opindex femit-struct-debug-reduced
7648 Emit debug information for struct-like types
7649 only when the base name of the compilation source file
7650 matches the base name of file in which the type is defined,
7651 unless the struct is a template or defined in a system header.
7653 This option significantly reduces the size of debugging information,
7654 with some potential loss in type information to the debugger.
7655 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
7656 See @option{-femit-struct-debug-detailed} for more detailed control.
7658 This option works only with DWARF debug output.
7660 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
7661 @opindex femit-struct-debug-detailed
7662 Specify the struct-like types
7663 for which the compiler generates debug information.
7664 The intent is to reduce duplicate struct debug information
7665 between different object files within the same program.
7667 This option is a detailed version of
7668 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
7669 which serves for most needs.
7671 A specification has the syntax@*
7672 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
7674 The optional first word limits the specification to
7675 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
7676 A struct type is used directly when it is the type of a variable, member.
7677 Indirect uses arise through pointers to structs.
7678 That is, when use of an incomplete struct is valid, the use is indirect.
7679 An example is
7680 @samp{struct one direct; struct two * indirect;}.
7682 The optional second word limits the specification to
7683 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
7684 Generic structs are a bit complicated to explain.
7685 For C++, these are non-explicit specializations of template classes,
7686 or non-template classes within the above.
7687 Other programming languages have generics,
7688 but @option{-femit-struct-debug-detailed} does not yet implement them.
7690 The third word specifies the source files for those
7691 structs for which the compiler should emit debug information.
7692 The values @samp{none} and @samp{any} have the normal meaning.
7693 The value @samp{base} means that
7694 the base of name of the file in which the type declaration appears
7695 must match the base of the name of the main compilation file.
7696 In practice, this means that when compiling @file{foo.c}, debug information
7697 is generated for types declared in that file and @file{foo.h},
7698 but not other header files.
7699 The value @samp{sys} means those types satisfying @samp{base}
7700 or declared in system or compiler headers.
7702 You may need to experiment to determine the best settings for your application.
7704 The default is @option{-femit-struct-debug-detailed=all}.
7706 This option works only with DWARF debug output.
7708 @item -fno-dwarf2-cfi-asm
7709 @opindex fdwarf2-cfi-asm
7710 @opindex fno-dwarf2-cfi-asm
7711 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
7712 instead of using GAS @code{.cfi_*} directives.
7714 @item -fno-eliminate-unused-debug-types
7715 @opindex feliminate-unused-debug-types
7716 @opindex fno-eliminate-unused-debug-types
7717 Normally, when producing DWARF output, GCC avoids producing debug symbol 
7718 output for types that are nowhere used in the source file being compiled.
7719 Sometimes it is useful to have GCC emit debugging
7720 information for all types declared in a compilation
7721 unit, regardless of whether or not they are actually used
7722 in that compilation unit, for example 
7723 if, in the debugger, you want to cast a value to a type that is
7724 not actually used in your program (but is declared).  More often,
7725 however, this results in a significant amount of wasted space.
7726 @end table
7728 @node Optimize Options
7729 @section Options That Control Optimization
7730 @cindex optimize options
7731 @cindex options, optimization
7733 These options control various sorts of optimizations.
7735 Without any optimization option, the compiler's goal is to reduce the
7736 cost of compilation and to make debugging produce the expected
7737 results.  Statements are independent: if you stop the program with a
7738 breakpoint between statements, you can then assign a new value to any
7739 variable or change the program counter to any other statement in the
7740 function and get exactly the results you expect from the source
7741 code.
7743 Turning on optimization flags makes the compiler attempt to improve
7744 the performance and/or code size at the expense of compilation time
7745 and possibly the ability to debug the program.
7747 The compiler performs optimization based on the knowledge it has of the
7748 program.  Compiling multiple files at once to a single output file mode allows
7749 the compiler to use information gained from all of the files when compiling
7750 each of them.
7752 Not all optimizations are controlled directly by a flag.  Only
7753 optimizations that have a flag are listed in this section.
7755 Most optimizations are only enabled if an @option{-O} level is set on
7756 the command line.  Otherwise they are disabled, even if individual
7757 optimization flags are specified.
7759 Depending on the target and how GCC was configured, a slightly different
7760 set of optimizations may be enabled at each @option{-O} level than
7761 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7762 to find out the exact set of optimizations that are enabled at each level.
7763 @xref{Overall Options}, for examples.
7765 @table @gcctabopt
7766 @item -O
7767 @itemx -O1
7768 @opindex O
7769 @opindex O1
7770 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7771 more memory for a large function.
7773 With @option{-O}, the compiler tries to reduce code size and execution
7774 time, without performing any optimizations that take a great deal of
7775 compilation time.
7777 @option{-O} turns on the following optimization flags:
7778 @gccoptlist{
7779 -fauto-inc-dec @gol
7780 -fbranch-count-reg @gol
7781 -fcombine-stack-adjustments @gol
7782 -fcompare-elim @gol
7783 -fcprop-registers @gol
7784 -fdce @gol
7785 -fdefer-pop @gol
7786 -fdelayed-branch @gol
7787 -fdse @gol
7788 -fforward-propagate @gol
7789 -fguess-branch-probability @gol
7790 -fif-conversion2 @gol
7791 -fif-conversion @gol
7792 -finline-functions-called-once @gol
7793 -fipa-pure-const @gol
7794 -fipa-profile @gol
7795 -fipa-reference @gol
7796 -fmerge-constants @gol
7797 -fmove-loop-invariants @gol
7798 -fomit-frame-pointer @gol
7799 -freorder-blocks @gol
7800 -fshrink-wrap @gol
7801 -fshrink-wrap-separate @gol
7802 -fsplit-wide-types @gol
7803 -fssa-backprop @gol
7804 -fssa-phiopt @gol
7805 -ftree-bit-ccp @gol
7806 -ftree-ccp @gol
7807 -ftree-ch @gol
7808 -ftree-coalesce-vars @gol
7809 -ftree-copy-prop @gol
7810 -ftree-dce @gol
7811 -ftree-dominator-opts @gol
7812 -ftree-dse @gol
7813 -ftree-forwprop @gol
7814 -ftree-fre @gol
7815 -ftree-phiprop @gol
7816 -ftree-scev-cprop @gol
7817 -ftree-sink @gol
7818 -ftree-slsr @gol
7819 -ftree-sra @gol
7820 -ftree-pta @gol
7821 -ftree-ter @gol
7822 -funit-at-a-time}
7824 @item -O2
7825 @opindex O2
7826 Optimize even more.  GCC performs nearly all supported optimizations
7827 that do not involve a space-speed tradeoff.
7828 As compared to @option{-O}, this option increases both compilation time
7829 and the performance of the generated code.
7831 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7832 also turns on the following optimization flags:
7833 @gccoptlist{-fthread-jumps @gol
7834 -falign-functions  -falign-jumps @gol
7835 -falign-loops  -falign-labels @gol
7836 -fcaller-saves @gol
7837 -fcrossjumping @gol
7838 -fcse-follow-jumps  -fcse-skip-blocks @gol
7839 -fdelete-null-pointer-checks @gol
7840 -fdevirtualize -fdevirtualize-speculatively @gol
7841 -fexpensive-optimizations @gol
7842 -fgcse  -fgcse-lm  @gol
7843 -fhoist-adjacent-loads @gol
7844 -finline-small-functions @gol
7845 -findirect-inlining @gol
7846 -fipa-cp @gol
7847 -fipa-bit-cp @gol
7848 -fipa-vrp @gol
7849 -fipa-sra @gol
7850 -fipa-icf @gol
7851 -fisolate-erroneous-paths-dereference @gol
7852 -flra-remat @gol
7853 -foptimize-sibling-calls @gol
7854 -foptimize-strlen @gol
7855 -fpartial-inlining @gol
7856 -fpeephole2 @gol
7857 -freorder-blocks-algorithm=stc @gol
7858 -freorder-blocks-and-partition -freorder-functions @gol
7859 -frerun-cse-after-loop  @gol
7860 -fsched-interblock  -fsched-spec @gol
7861 -fschedule-insns  -fschedule-insns2 @gol
7862 -fstore-merging @gol
7863 -fstrict-aliasing @gol
7864 -ftree-builtin-call-dce @gol
7865 -ftree-switch-conversion -ftree-tail-merge @gol
7866 -fcode-hoisting @gol
7867 -ftree-pre @gol
7868 -ftree-vrp @gol
7869 -fipa-ra}
7871 Please note the warning under @option{-fgcse} about
7872 invoking @option{-O2} on programs that use computed gotos.
7874 @item -O3
7875 @opindex O3
7876 Optimize yet more.  @option{-O3} turns on all optimizations specified
7877 by @option{-O2} and also turns on the following optimization flags:
7878 @gccoptlist{-finline-functions @gol
7879 -funswitch-loops @gol
7880 -fpredictive-commoning @gol
7881 -fgcse-after-reload @gol
7882 -ftree-loop-vectorize @gol
7883 -ftree-loop-distribution @gol
7884 -ftree-loop-distribute-patterns @gol
7885 -floop-interchange @gol
7886 -floop-unroll-and-jam @gol
7887 -fsplit-paths @gol
7888 -ftree-slp-vectorize @gol
7889 -fvect-cost-model @gol
7890 -ftree-partial-pre @gol
7891 -fpeel-loops @gol
7892 -fipa-cp-clone}
7894 @item -O0
7895 @opindex O0
7896 Reduce compilation time and make debugging produce the expected
7897 results.  This is the default.
7899 @item -Os
7900 @opindex Os
7901 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7902 do not typically increase code size.  It also performs further
7903 optimizations designed to reduce code size.
7905 @option{-Os} disables the following optimization flags:
7906 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7907 -falign-labels  -freorder-blocks  -freorder-blocks-algorithm=stc @gol
7908 -freorder-blocks-and-partition  -fprefetch-loop-arrays}
7910 @item -Ofast
7911 @opindex Ofast
7912 Disregard strict standards compliance.  @option{-Ofast} enables all
7913 @option{-O3} optimizations.  It also enables optimizations that are not
7914 valid for all standard-compliant programs.
7915 It turns on @option{-ffast-math} and the Fortran-specific
7916 @option{-fstack-arrays}, unless @option{-fmax-stack-var-size} is
7917 specified, and @option{-fno-protect-parens}.
7919 @item -Og
7920 @opindex Og
7921 Optimize debugging experience.  @option{-Og} enables optimizations
7922 that do not interfere with debugging. It should be the optimization
7923 level of choice for the standard edit-compile-debug cycle, offering
7924 a reasonable level of optimization while maintaining fast compilation
7925 and a good debugging experience.
7926 @end table
7928 If you use multiple @option{-O} options, with or without level numbers,
7929 the last such option is the one that is effective.
7931 Options of the form @option{-f@var{flag}} specify machine-independent
7932 flags.  Most flags have both positive and negative forms; the negative
7933 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7934 below, only one of the forms is listed---the one you typically 
7935 use.  You can figure out the other form by either removing @samp{no-}
7936 or adding it.
7938 The following options control specific optimizations.  They are either
7939 activated by @option{-O} options or are related to ones that are.  You
7940 can use the following flags in the rare cases when ``fine-tuning'' of
7941 optimizations to be performed is desired.
7943 @table @gcctabopt
7944 @item -fno-defer-pop
7945 @opindex fno-defer-pop
7946 Always pop the arguments to each function call as soon as that function
7947 returns.  For machines that must pop arguments after a function call,
7948 the compiler normally lets arguments accumulate on the stack for several
7949 function calls and pops them all at once.
7951 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7953 @item -fforward-propagate
7954 @opindex fforward-propagate
7955 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7956 instructions and checks if the result can be simplified.  If loop unrolling
7957 is active, two passes are performed and the second is scheduled after
7958 loop unrolling.
7960 This option is enabled by default at optimization levels @option{-O},
7961 @option{-O2}, @option{-O3}, @option{-Os}.
7963 @item -ffp-contract=@var{style}
7964 @opindex ffp-contract
7965 @option{-ffp-contract=off} disables floating-point expression contraction.
7966 @option{-ffp-contract=fast} enables floating-point expression contraction
7967 such as forming of fused multiply-add operations if the target has
7968 native support for them.
7969 @option{-ffp-contract=on} enables floating-point expression contraction
7970 if allowed by the language standard.  This is currently not implemented
7971 and treated equal to @option{-ffp-contract=off}.
7973 The default is @option{-ffp-contract=fast}.
7975 @item -fomit-frame-pointer
7976 @opindex fomit-frame-pointer
7977 Omit the frame pointer in functions that don't need one.  This avoids the
7978 instructions to save, set up and restore the frame pointer; on many targets
7979 it also makes an extra register available.
7981 On some targets this flag has no effect because the standard calling sequence
7982 always uses a frame pointer, so it cannot be omitted.
7984 Note that @option{-fno-omit-frame-pointer} doesn't guarantee the frame pointer
7985 is used in all functions.  Several targets always omit the frame pointer in
7986 leaf functions.
7988 Enabled by default at @option{-O} and higher.
7990 @item -foptimize-sibling-calls
7991 @opindex foptimize-sibling-calls
7992 Optimize sibling and tail recursive calls.
7994 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7996 @item -foptimize-strlen
7997 @opindex foptimize-strlen
7998 Optimize various standard C string functions (e.g. @code{strlen},
7999 @code{strchr} or @code{strcpy}) and
8000 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
8002 Enabled at levels @option{-O2}, @option{-O3}.
8004 @item -fno-inline
8005 @opindex fno-inline
8006 Do not expand any functions inline apart from those marked with
8007 the @code{always_inline} attribute.  This is the default when not
8008 optimizing.
8010 Single functions can be exempted from inlining by marking them
8011 with the @code{noinline} attribute.
8013 @item -finline-small-functions
8014 @opindex finline-small-functions
8015 Integrate functions into their callers when their body is smaller than expected
8016 function call code (so overall size of program gets smaller).  The compiler
8017 heuristically decides which functions are simple enough to be worth integrating
8018 in this way.  This inlining applies to all functions, even those not declared
8019 inline.
8021 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8023 @item -findirect-inlining
8024 @opindex findirect-inlining
8025 Inline also indirect calls that are discovered to be known at compile
8026 time thanks to previous inlining.  This option has any effect only
8027 when inlining itself is turned on by the @option{-finline-functions}
8028 or @option{-finline-small-functions} options.
8030 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8032 @item -finline-functions
8033 @opindex finline-functions
8034 Consider all functions for inlining, even if they are not declared inline.
8035 The compiler heuristically decides which functions are worth integrating
8036 in this way.
8038 If all calls to a given function are integrated, and the function is
8039 declared @code{static}, then the function is normally not output as
8040 assembler code in its own right.
8042 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8044 @item -finline-functions-called-once
8045 @opindex finline-functions-called-once
8046 Consider all @code{static} functions called once for inlining into their
8047 caller even if they are not marked @code{inline}.  If a call to a given
8048 function is integrated, then the function is not output as assembler code
8049 in its own right.
8051 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
8053 @item -fearly-inlining
8054 @opindex fearly-inlining
8055 Inline functions marked by @code{always_inline} and functions whose body seems
8056 smaller than the function call overhead early before doing
8057 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
8058 makes profiling significantly cheaper and usually inlining faster on programs
8059 having large chains of nested wrapper functions.
8061 Enabled by default.
8063 @item -fipa-sra
8064 @opindex fipa-sra
8065 Perform interprocedural scalar replacement of aggregates, removal of
8066 unused parameters and replacement of parameters passed by reference
8067 by parameters passed by value.
8069 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
8071 @item -finline-limit=@var{n}
8072 @opindex finline-limit
8073 By default, GCC limits the size of functions that can be inlined.  This flag
8074 allows coarse control of this limit.  @var{n} is the size of functions that
8075 can be inlined in number of pseudo instructions.
8077 Inlining is actually controlled by a number of parameters, which may be
8078 specified individually by using @option{--param @var{name}=@var{value}}.
8079 The @option{-finline-limit=@var{n}} option sets some of these parameters
8080 as follows:
8082 @table @gcctabopt
8083 @item max-inline-insns-single
8084 is set to @var{n}/2.
8085 @item max-inline-insns-auto
8086 is set to @var{n}/2.
8087 @end table
8089 See below for a documentation of the individual
8090 parameters controlling inlining and for the defaults of these parameters.
8092 @emph{Note:} there may be no value to @option{-finline-limit} that results
8093 in default behavior.
8095 @emph{Note:} pseudo instruction represents, in this particular context, an
8096 abstract measurement of function's size.  In no way does it represent a count
8097 of assembly instructions and as such its exact meaning might change from one
8098 release to an another.
8100 @item -fno-keep-inline-dllexport
8101 @opindex fno-keep-inline-dllexport
8102 This is a more fine-grained version of @option{-fkeep-inline-functions},
8103 which applies only to functions that are declared using the @code{dllexport}
8104 attribute or declspec.  @xref{Function Attributes,,Declaring Attributes of
8105 Functions}.
8107 @item -fkeep-inline-functions
8108 @opindex fkeep-inline-functions
8109 In C, emit @code{static} functions that are declared @code{inline}
8110 into the object file, even if the function has been inlined into all
8111 of its callers.  This switch does not affect functions using the
8112 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
8113 inline functions into the object file.
8115 @item -fkeep-static-functions
8116 @opindex fkeep-static-functions
8117 Emit @code{static} functions into the object file, even if the function
8118 is never used.
8120 @item -fkeep-static-consts
8121 @opindex fkeep-static-consts
8122 Emit variables declared @code{static const} when optimization isn't turned
8123 on, even if the variables aren't referenced.
8125 GCC enables this option by default.  If you want to force the compiler to
8126 check if a variable is referenced, regardless of whether or not
8127 optimization is turned on, use the @option{-fno-keep-static-consts} option.
8129 @item -fmerge-constants
8130 @opindex fmerge-constants
8131 Attempt to merge identical constants (string constants and floating-point
8132 constants) across compilation units.
8134 This option is the default for optimized compilation if the assembler and
8135 linker support it.  Use @option{-fno-merge-constants} to inhibit this
8136 behavior.
8138 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8140 @item -fmerge-all-constants
8141 @opindex fmerge-all-constants
8142 Attempt to merge identical constants and identical variables.
8144 This option implies @option{-fmerge-constants}.  In addition to
8145 @option{-fmerge-constants} this considers e.g.@: even constant initialized
8146 arrays or initialized constant variables with integral or floating-point
8147 types.  Languages like C or C++ require each variable, including multiple
8148 instances of the same variable in recursive calls, to have distinct locations,
8149 so using this option results in non-conforming
8150 behavior.
8152 @item -fmodulo-sched
8153 @opindex fmodulo-sched
8154 Perform swing modulo scheduling immediately before the first scheduling
8155 pass.  This pass looks at innermost loops and reorders their
8156 instructions by overlapping different iterations.
8158 @item -fmodulo-sched-allow-regmoves
8159 @opindex fmodulo-sched-allow-regmoves
8160 Perform more aggressive SMS-based modulo scheduling with register moves
8161 allowed.  By setting this flag certain anti-dependences edges are
8162 deleted, which triggers the generation of reg-moves based on the
8163 life-range analysis.  This option is effective only with
8164 @option{-fmodulo-sched} enabled.
8166 @item -fno-branch-count-reg
8167 @opindex fno-branch-count-reg
8168 Avoid running a pass scanning for opportunities to use ``decrement and
8169 branch'' instructions on a count register instead of generating sequences
8170 of instructions that decrement a register, compare it against zero, and
8171 then branch based upon the result.  This option is only meaningful on
8172 architectures that support such instructions, which include x86, PowerPC,
8173 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
8174 doesn't remove the decrement and branch instructions from the generated
8175 instruction stream introduced by other optimization passes.
8177 Enabled by default at @option{-O1} and higher.
8179 The default is @option{-fbranch-count-reg}.
8181 @item -fno-function-cse
8182 @opindex fno-function-cse
8183 Do not put function addresses in registers; make each instruction that
8184 calls a constant function contain the function's address explicitly.
8186 This option results in less efficient code, but some strange hacks
8187 that alter the assembler output may be confused by the optimizations
8188 performed when this option is not used.
8190 The default is @option{-ffunction-cse}
8192 @item -fno-zero-initialized-in-bss
8193 @opindex fno-zero-initialized-in-bss
8194 If the target supports a BSS section, GCC by default puts variables that
8195 are initialized to zero into BSS@.  This can save space in the resulting
8196 code.
8198 This option turns off this behavior because some programs explicitly
8199 rely on variables going to the data section---e.g., so that the
8200 resulting executable can find the beginning of that section and/or make
8201 assumptions based on that.
8203 The default is @option{-fzero-initialized-in-bss}.
8205 @item -fthread-jumps
8206 @opindex fthread-jumps
8207 Perform optimizations that check to see if a jump branches to a
8208 location where another comparison subsumed by the first is found.  If
8209 so, the first branch is redirected to either the destination of the
8210 second branch or a point immediately following it, depending on whether
8211 the condition is known to be true or false.
8213 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8215 @item -fsplit-wide-types
8216 @opindex fsplit-wide-types
8217 When using a type that occupies multiple registers, such as @code{long
8218 long} on a 32-bit system, split the registers apart and allocate them
8219 independently.  This normally generates better code for those types,
8220 but may make debugging more difficult.
8222 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
8223 @option{-Os}.
8225 @item -fcse-follow-jumps
8226 @opindex fcse-follow-jumps
8227 In common subexpression elimination (CSE), scan through jump instructions
8228 when the target of the jump is not reached by any other path.  For
8229 example, when CSE encounters an @code{if} statement with an
8230 @code{else} clause, CSE follows the jump when the condition
8231 tested is false.
8233 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8235 @item -fcse-skip-blocks
8236 @opindex fcse-skip-blocks
8237 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
8238 follow jumps that conditionally skip over blocks.  When CSE
8239 encounters a simple @code{if} statement with no else clause,
8240 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
8241 body of the @code{if}.
8243 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8245 @item -frerun-cse-after-loop
8246 @opindex frerun-cse-after-loop
8247 Re-run common subexpression elimination after loop optimizations are
8248 performed.
8250 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8252 @item -fgcse
8253 @opindex fgcse
8254 Perform a global common subexpression elimination pass.
8255 This pass also performs global constant and copy propagation.
8257 @emph{Note:} When compiling a program using computed gotos, a GCC
8258 extension, you may get better run-time performance if you disable
8259 the global common subexpression elimination pass by adding
8260 @option{-fno-gcse} to the command line.
8262 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8264 @item -fgcse-lm
8265 @opindex fgcse-lm
8266 When @option{-fgcse-lm} is enabled, global common subexpression elimination
8267 attempts to move loads that are only killed by stores into themselves.  This
8268 allows a loop containing a load/store sequence to be changed to a load outside
8269 the loop, and a copy/store within the loop.
8271 Enabled by default when @option{-fgcse} is enabled.
8273 @item -fgcse-sm
8274 @opindex fgcse-sm
8275 When @option{-fgcse-sm} is enabled, a store motion pass is run after
8276 global common subexpression elimination.  This pass attempts to move
8277 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
8278 loops containing a load/store sequence can be changed to a load before
8279 the loop and a store after the loop.
8281 Not enabled at any optimization level.
8283 @item -fgcse-las
8284 @opindex fgcse-las
8285 When @option{-fgcse-las} is enabled, the global common subexpression
8286 elimination pass eliminates redundant loads that come after stores to the
8287 same memory location (both partial and full redundancies).
8289 Not enabled at any optimization level.
8291 @item -fgcse-after-reload
8292 @opindex fgcse-after-reload
8293 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
8294 pass is performed after reload.  The purpose of this pass is to clean up
8295 redundant spilling.
8297 @item -faggressive-loop-optimizations
8298 @opindex faggressive-loop-optimizations
8299 This option tells the loop optimizer to use language constraints to
8300 derive bounds for the number of iterations of a loop.  This assumes that
8301 loop code does not invoke undefined behavior by for example causing signed
8302 integer overflows or out-of-bound array accesses.  The bounds for the
8303 number of iterations of a loop are used to guide loop unrolling and peeling
8304 and loop exit test optimizations.
8305 This option is enabled by default.
8307 @item -funconstrained-commons
8308 @opindex funconstrained-commons
8309 This option tells the compiler that variables declared in common blocks
8310 (e.g. Fortran) may later be overridden with longer trailing arrays. This
8311 prevents certain optimizations that depend on knowing the array bounds.
8313 @item -fcrossjumping
8314 @opindex fcrossjumping
8315 Perform cross-jumping transformation.
8316 This transformation unifies equivalent code and saves code size.  The
8317 resulting code may or may not perform better than without cross-jumping.
8319 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8321 @item -fauto-inc-dec
8322 @opindex fauto-inc-dec
8323 Combine increments or decrements of addresses with memory accesses.
8324 This pass is always skipped on architectures that do not have
8325 instructions to support this.  Enabled by default at @option{-O} and
8326 higher on architectures that support this.
8328 @item -fdce
8329 @opindex fdce
8330 Perform dead code elimination (DCE) on RTL@.
8331 Enabled by default at @option{-O} and higher.
8333 @item -fdse
8334 @opindex fdse
8335 Perform dead store elimination (DSE) on RTL@.
8336 Enabled by default at @option{-O} and higher.
8338 @item -fif-conversion
8339 @opindex fif-conversion
8340 Attempt to transform conditional jumps into branch-less equivalents.  This
8341 includes use of conditional moves, min, max, set flags and abs instructions, and
8342 some tricks doable by standard arithmetics.  The use of conditional execution
8343 on chips where it is available is controlled by @option{-fif-conversion2}.
8345 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8347 @item -fif-conversion2
8348 @opindex fif-conversion2
8349 Use conditional execution (where available) to transform conditional jumps into
8350 branch-less equivalents.
8352 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8354 @item -fdeclone-ctor-dtor
8355 @opindex fdeclone-ctor-dtor
8356 The C++ ABI requires multiple entry points for constructors and
8357 destructors: one for a base subobject, one for a complete object, and
8358 one for a virtual destructor that calls operator delete afterwards.
8359 For a hierarchy with virtual bases, the base and complete variants are
8360 clones, which means two copies of the function.  With this option, the
8361 base and complete variants are changed to be thunks that call a common
8362 implementation.
8364 Enabled by @option{-Os}.
8366 @item -fdelete-null-pointer-checks
8367 @opindex fdelete-null-pointer-checks
8368 Assume that programs cannot safely dereference null pointers, and that
8369 no code or data element resides at address zero.
8370 This option enables simple constant
8371 folding optimizations at all optimization levels.  In addition, other
8372 optimization passes in GCC use this flag to control global dataflow
8373 analyses that eliminate useless checks for null pointers; these assume
8374 that a memory access to address zero always results in a trap, so
8375 that if a pointer is checked after it has already been dereferenced,
8376 it cannot be null.
8378 Note however that in some environments this assumption is not true.
8379 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
8380 for programs that depend on that behavior.
8382 This option is enabled by default on most targets.  On Nios II ELF, it
8383 defaults to off.  On AVR, CR16, and MSP430, this option is completely disabled.
8385 Passes that use the dataflow information
8386 are enabled independently at different optimization levels.
8388 @item -fdevirtualize
8389 @opindex fdevirtualize
8390 Attempt to convert calls to virtual functions to direct calls.  This
8391 is done both within a procedure and interprocedurally as part of
8392 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
8393 propagation (@option{-fipa-cp}).
8394 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8396 @item -fdevirtualize-speculatively
8397 @opindex fdevirtualize-speculatively
8398 Attempt to convert calls to virtual functions to speculative direct calls.
8399 Based on the analysis of the type inheritance graph, determine for a given call
8400 the set of likely targets. If the set is small, preferably of size 1, change
8401 the call into a conditional deciding between direct and indirect calls.  The
8402 speculative calls enable more optimizations, such as inlining.  When they seem
8403 useless after further optimization, they are converted back into original form.
8405 @item -fdevirtualize-at-ltrans
8406 @opindex fdevirtualize-at-ltrans
8407 Stream extra information needed for aggressive devirtualization when running
8408 the link-time optimizer in local transformation mode.  
8409 This option enables more devirtualization but
8410 significantly increases the size of streamed data. For this reason it is
8411 disabled by default.
8413 @item -fexpensive-optimizations
8414 @opindex fexpensive-optimizations
8415 Perform a number of minor optimizations that are relatively expensive.
8417 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8419 @item -free
8420 @opindex free
8421 Attempt to remove redundant extension instructions.  This is especially
8422 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
8423 registers after writing to their lower 32-bit half.
8425 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
8426 @option{-O3}, @option{-Os}.
8428 @item -fno-lifetime-dse
8429 @opindex fno-lifetime-dse
8430 In C++ the value of an object is only affected by changes within its
8431 lifetime: when the constructor begins, the object has an indeterminate
8432 value, and any changes during the lifetime of the object are dead when
8433 the object is destroyed.  Normally dead store elimination will take
8434 advantage of this; if your code relies on the value of the object
8435 storage persisting beyond the lifetime of the object, you can use this
8436 flag to disable this optimization.  To preserve stores before the
8437 constructor starts (e.g. because your operator new clears the object
8438 storage) but still treat the object as dead after the destructor you,
8439 can use @option{-flifetime-dse=1}.  The default behavior can be
8440 explicitly selected with @option{-flifetime-dse=2}.
8441 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
8443 @item -flive-range-shrinkage
8444 @opindex flive-range-shrinkage
8445 Attempt to decrease register pressure through register live range
8446 shrinkage.  This is helpful for fast processors with small or moderate
8447 size register sets.
8449 @item -fira-algorithm=@var{algorithm}
8450 @opindex fira-algorithm
8451 Use the specified coloring algorithm for the integrated register
8452 allocator.  The @var{algorithm} argument can be @samp{priority}, which
8453 specifies Chow's priority coloring, or @samp{CB}, which specifies
8454 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
8455 for all architectures, but for those targets that do support it, it is
8456 the default because it generates better code.
8458 @item -fira-region=@var{region}
8459 @opindex fira-region
8460 Use specified regions for the integrated register allocator.  The
8461 @var{region} argument should be one of the following:
8463 @table @samp
8465 @item all
8466 Use all loops as register allocation regions.
8467 This can give the best results for machines with a small and/or
8468 irregular register set.
8470 @item mixed
8471 Use all loops except for loops with small register pressure 
8472 as the regions.  This value usually gives
8473 the best results in most cases and for most architectures,
8474 and is enabled by default when compiling with optimization for speed
8475 (@option{-O}, @option{-O2}, @dots{}).
8477 @item one
8478 Use all functions as a single region.  
8479 This typically results in the smallest code size, and is enabled by default for
8480 @option{-Os} or @option{-O0}.
8482 @end table
8484 @item -fira-hoist-pressure
8485 @opindex fira-hoist-pressure
8486 Use IRA to evaluate register pressure in the code hoisting pass for
8487 decisions to hoist expressions.  This option usually results in smaller
8488 code, but it can slow the compiler down.
8490 This option is enabled at level @option{-Os} for all targets.
8492 @item -fira-loop-pressure
8493 @opindex fira-loop-pressure
8494 Use IRA to evaluate register pressure in loops for decisions to move
8495 loop invariants.  This option usually results in generation
8496 of faster and smaller code on machines with large register files (>= 32
8497 registers), but it can slow the compiler down.
8499 This option is enabled at level @option{-O3} for some targets.
8501 @item -fno-ira-share-save-slots
8502 @opindex fno-ira-share-save-slots
8503 Disable sharing of stack slots used for saving call-used hard
8504 registers living through a call.  Each hard register gets a
8505 separate stack slot, and as a result function stack frames are
8506 larger.
8508 @item -fno-ira-share-spill-slots
8509 @opindex fno-ira-share-spill-slots
8510 Disable sharing of stack slots allocated for pseudo-registers.  Each
8511 pseudo-register that does not get a hard register gets a separate
8512 stack slot, and as a result function stack frames are larger.
8514 @item -flra-remat
8515 @opindex flra-remat
8516 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
8517 values of spilled pseudos, LRA tries to rematerialize (recalculate)
8518 values if it is profitable.
8520 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8522 @item -fdelayed-branch
8523 @opindex fdelayed-branch
8524 If supported for the target machine, attempt to reorder instructions
8525 to exploit instruction slots available after delayed branch
8526 instructions.
8528 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8530 @item -fschedule-insns
8531 @opindex fschedule-insns
8532 If supported for the target machine, attempt to reorder instructions to
8533 eliminate execution stalls due to required data being unavailable.  This
8534 helps machines that have slow floating point or memory load instructions
8535 by allowing other instructions to be issued until the result of the load
8536 or floating-point instruction is required.
8538 Enabled at levels @option{-O2}, @option{-O3}.
8540 @item -fschedule-insns2
8541 @opindex fschedule-insns2
8542 Similar to @option{-fschedule-insns}, but requests an additional pass of
8543 instruction scheduling after register allocation has been done.  This is
8544 especially useful on machines with a relatively small number of
8545 registers and where memory load instructions take more than one cycle.
8547 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8549 @item -fno-sched-interblock
8550 @opindex fno-sched-interblock
8551 Don't schedule instructions across basic blocks.  This is normally
8552 enabled by default when scheduling before register allocation, i.e.@:
8553 with @option{-fschedule-insns} or at @option{-O2} or higher.
8555 @item -fno-sched-spec
8556 @opindex fno-sched-spec
8557 Don't allow speculative motion of non-load instructions.  This is normally
8558 enabled by default when scheduling before register allocation, i.e.@:
8559 with @option{-fschedule-insns} or at @option{-O2} or higher.
8561 @item -fsched-pressure
8562 @opindex fsched-pressure
8563 Enable register pressure sensitive insn scheduling before register
8564 allocation.  This only makes sense when scheduling before register
8565 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
8566 @option{-O2} or higher.  Usage of this option can improve the
8567 generated code and decrease its size by preventing register pressure
8568 increase above the number of available hard registers and subsequent
8569 spills in register allocation.
8571 @item -fsched-spec-load
8572 @opindex fsched-spec-load
8573 Allow speculative motion of some load instructions.  This only makes
8574 sense when scheduling before register allocation, i.e.@: with
8575 @option{-fschedule-insns} or at @option{-O2} or higher.
8577 @item -fsched-spec-load-dangerous
8578 @opindex fsched-spec-load-dangerous
8579 Allow speculative motion of more load instructions.  This only makes
8580 sense when scheduling before register allocation, i.e.@: with
8581 @option{-fschedule-insns} or at @option{-O2} or higher.
8583 @item -fsched-stalled-insns
8584 @itemx -fsched-stalled-insns=@var{n}
8585 @opindex fsched-stalled-insns
8586 Define how many insns (if any) can be moved prematurely from the queue
8587 of stalled insns into the ready list during the second scheduling pass.
8588 @option{-fno-sched-stalled-insns} means that no insns are moved
8589 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
8590 on how many queued insns can be moved prematurely.
8591 @option{-fsched-stalled-insns} without a value is equivalent to
8592 @option{-fsched-stalled-insns=1}.
8594 @item -fsched-stalled-insns-dep
8595 @itemx -fsched-stalled-insns-dep=@var{n}
8596 @opindex fsched-stalled-insns-dep
8597 Define how many insn groups (cycles) are examined for a dependency
8598 on a stalled insn that is a candidate for premature removal from the queue
8599 of stalled insns.  This has an effect only during the second scheduling pass,
8600 and only if @option{-fsched-stalled-insns} is used.
8601 @option{-fno-sched-stalled-insns-dep} is equivalent to
8602 @option{-fsched-stalled-insns-dep=0}.
8603 @option{-fsched-stalled-insns-dep} without a value is equivalent to
8604 @option{-fsched-stalled-insns-dep=1}.
8606 @item -fsched2-use-superblocks
8607 @opindex fsched2-use-superblocks
8608 When scheduling after register allocation, use superblock scheduling.
8609 This allows motion across basic block boundaries,
8610 resulting in faster schedules.  This option is experimental, as not all machine
8611 descriptions used by GCC model the CPU closely enough to avoid unreliable
8612 results from the algorithm.
8614 This only makes sense when scheduling after register allocation, i.e.@: with
8615 @option{-fschedule-insns2} or at @option{-O2} or higher.
8617 @item -fsched-group-heuristic
8618 @opindex fsched-group-heuristic
8619 Enable the group heuristic in the scheduler.  This heuristic favors
8620 the instruction that belongs to a schedule group.  This is enabled
8621 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8622 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8624 @item -fsched-critical-path-heuristic
8625 @opindex fsched-critical-path-heuristic
8626 Enable the critical-path heuristic in the scheduler.  This heuristic favors
8627 instructions on the critical path.  This is enabled by default when
8628 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8629 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8631 @item -fsched-spec-insn-heuristic
8632 @opindex fsched-spec-insn-heuristic
8633 Enable the speculative instruction heuristic in the scheduler.  This
8634 heuristic favors speculative instructions with greater dependency weakness.
8635 This is enabled by default when scheduling is enabled, i.e.@:
8636 with @option{-fschedule-insns} or @option{-fschedule-insns2}
8637 or at @option{-O2} or higher.
8639 @item -fsched-rank-heuristic
8640 @opindex fsched-rank-heuristic
8641 Enable the rank heuristic in the scheduler.  This heuristic favors
8642 the instruction belonging to a basic block with greater size or frequency.
8643 This is enabled by default when scheduling is enabled, i.e.@:
8644 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8645 at @option{-O2} or higher.
8647 @item -fsched-last-insn-heuristic
8648 @opindex fsched-last-insn-heuristic
8649 Enable the last-instruction heuristic in the scheduler.  This heuristic
8650 favors the instruction that is less dependent on the last instruction
8651 scheduled.  This is enabled by default when scheduling is enabled,
8652 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8653 at @option{-O2} or higher.
8655 @item -fsched-dep-count-heuristic
8656 @opindex fsched-dep-count-heuristic
8657 Enable the dependent-count heuristic in the scheduler.  This heuristic
8658 favors the instruction that has more instructions depending on it.
8659 This is enabled by default when scheduling is enabled, i.e.@:
8660 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8661 at @option{-O2} or higher.
8663 @item -freschedule-modulo-scheduled-loops
8664 @opindex freschedule-modulo-scheduled-loops
8665 Modulo scheduling is performed before traditional scheduling.  If a loop
8666 is modulo scheduled, later scheduling passes may change its schedule.  
8667 Use this option to control that behavior.
8669 @item -fselective-scheduling
8670 @opindex fselective-scheduling
8671 Schedule instructions using selective scheduling algorithm.  Selective
8672 scheduling runs instead of the first scheduler pass.
8674 @item -fselective-scheduling2
8675 @opindex fselective-scheduling2
8676 Schedule instructions using selective scheduling algorithm.  Selective
8677 scheduling runs instead of the second scheduler pass.
8679 @item -fsel-sched-pipelining
8680 @opindex fsel-sched-pipelining
8681 Enable software pipelining of innermost loops during selective scheduling.
8682 This option has no effect unless one of @option{-fselective-scheduling} or
8683 @option{-fselective-scheduling2} is turned on.
8685 @item -fsel-sched-pipelining-outer-loops
8686 @opindex fsel-sched-pipelining-outer-loops
8687 When pipelining loops during selective scheduling, also pipeline outer loops.
8688 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
8690 @item -fsemantic-interposition
8691 @opindex fsemantic-interposition
8692 Some object formats, like ELF, allow interposing of symbols by the 
8693 dynamic linker.
8694 This means that for symbols exported from the DSO, the compiler cannot perform
8695 interprocedural propagation, inlining and other optimizations in anticipation
8696 that the function or variable in question may change. While this feature is
8697 useful, for example, to rewrite memory allocation functions by a debugging
8698 implementation, it is expensive in the terms of code quality.
8699 With @option{-fno-semantic-interposition} the compiler assumes that 
8700 if interposition happens for functions the overwriting function will have 
8701 precisely the same semantics (and side effects). 
8702 Similarly if interposition happens
8703 for variables, the constructor of the variable will be the same. The flag
8704 has no effect for functions explicitly declared inline 
8705 (where it is never allowed for interposition to change semantics) 
8706 and for symbols explicitly declared weak.
8708 @item -fshrink-wrap
8709 @opindex fshrink-wrap
8710 Emit function prologues only before parts of the function that need it,
8711 rather than at the top of the function.  This flag is enabled by default at
8712 @option{-O} and higher.
8714 @item -fshrink-wrap-separate
8715 @opindex fshrink-wrap-separate
8716 Shrink-wrap separate parts of the prologue and epilogue separately, so that
8717 those parts are only executed when needed.
8718 This option is on by default, but has no effect unless @option{-fshrink-wrap}
8719 is also turned on and the target supports this.
8721 @item -fcaller-saves
8722 @opindex fcaller-saves
8723 Enable allocation of values to registers that are clobbered by
8724 function calls, by emitting extra instructions to save and restore the
8725 registers around such calls.  Such allocation is done only when it
8726 seems to result in better code.
8728 This option is always enabled by default on certain machines, usually
8729 those which have no call-preserved registers to use instead.
8731 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8733 @item -fcombine-stack-adjustments
8734 @opindex fcombine-stack-adjustments
8735 Tracks stack adjustments (pushes and pops) and stack memory references
8736 and then tries to find ways to combine them.
8738 Enabled by default at @option{-O1} and higher.
8740 @item -fipa-ra
8741 @opindex fipa-ra
8742 Use caller save registers for allocation if those registers are not used by
8743 any called function.  In that case it is not necessary to save and restore
8744 them around calls.  This is only possible if called functions are part of
8745 same compilation unit as current function and they are compiled before it.
8747 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}, however the option
8748 is disabled if generated code will be instrumented for profiling
8749 (@option{-p}, or @option{-pg}) or if callee's register usage cannot be known
8750 exactly (this happens on targets that do not expose prologues
8751 and epilogues in RTL).
8753 @item -fconserve-stack
8754 @opindex fconserve-stack
8755 Attempt to minimize stack usage.  The compiler attempts to use less
8756 stack space, even if that makes the program slower.  This option
8757 implies setting the @option{large-stack-frame} parameter to 100
8758 and the @option{large-stack-frame-growth} parameter to 400.
8760 @item -ftree-reassoc
8761 @opindex ftree-reassoc
8762 Perform reassociation on trees.  This flag is enabled by default
8763 at @option{-O} and higher.
8765 @item -fcode-hoisting
8766 @opindex fcode-hoisting
8767 Perform code hoisting.  Code hoisting tries to move the
8768 evaluation of expressions executed on all paths to the function exit
8769 as early as possible.  This is especially useful as a code size
8770 optimization, but it often helps for code speed as well.
8771 This flag is enabled by default at @option{-O2} and higher.
8773 @item -ftree-pre
8774 @opindex ftree-pre
8775 Perform partial redundancy elimination (PRE) on trees.  This flag is
8776 enabled by default at @option{-O2} and @option{-O3}.
8778 @item -ftree-partial-pre
8779 @opindex ftree-partial-pre
8780 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8781 enabled by default at @option{-O3}.
8783 @item -ftree-forwprop
8784 @opindex ftree-forwprop
8785 Perform forward propagation on trees.  This flag is enabled by default
8786 at @option{-O} and higher.
8788 @item -ftree-fre
8789 @opindex ftree-fre
8790 Perform full redundancy elimination (FRE) on trees.  The difference
8791 between FRE and PRE is that FRE only considers expressions
8792 that are computed on all paths leading to the redundant computation.
8793 This analysis is faster than PRE, though it exposes fewer redundancies.
8794 This flag is enabled by default at @option{-O} and higher.
8796 @item -ftree-phiprop
8797 @opindex ftree-phiprop
8798 Perform hoisting of loads from conditional pointers on trees.  This
8799 pass is enabled by default at @option{-O} and higher.
8801 @item -fhoist-adjacent-loads
8802 @opindex fhoist-adjacent-loads
8803 Speculatively hoist loads from both branches of an if-then-else if the
8804 loads are from adjacent locations in the same structure and the target
8805 architecture has a conditional move instruction.  This flag is enabled
8806 by default at @option{-O2} and higher.
8808 @item -ftree-copy-prop
8809 @opindex ftree-copy-prop
8810 Perform copy propagation on trees.  This pass eliminates unnecessary
8811 copy operations.  This flag is enabled by default at @option{-O} and
8812 higher.
8814 @item -fipa-pure-const
8815 @opindex fipa-pure-const
8816 Discover which functions are pure or constant.
8817 Enabled by default at @option{-O} and higher.
8819 @item -fipa-reference
8820 @opindex fipa-reference
8821 Discover which static variables do not escape the
8822 compilation unit.
8823 Enabled by default at @option{-O} and higher.
8825 @item -fipa-pta
8826 @opindex fipa-pta
8827 Perform interprocedural pointer analysis and interprocedural modification
8828 and reference analysis.  This option can cause excessive memory and
8829 compile-time usage on large compilation units.  It is not enabled by
8830 default at any optimization level.
8832 @item -fipa-profile
8833 @opindex fipa-profile
8834 Perform interprocedural profile propagation.  The functions called only from
8835 cold functions are marked as cold. Also functions executed once (such as
8836 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
8837 functions and loop less parts of functions executed once are then optimized for
8838 size.
8839 Enabled by default at @option{-O} and higher.
8841 @item -fipa-cp
8842 @opindex fipa-cp
8843 Perform interprocedural constant propagation.
8844 This optimization analyzes the program to determine when values passed
8845 to functions are constants and then optimizes accordingly.
8846 This optimization can substantially increase performance
8847 if the application has constants passed to functions.
8848 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
8850 @item -fipa-cp-clone
8851 @opindex fipa-cp-clone
8852 Perform function cloning to make interprocedural constant propagation stronger.
8853 When enabled, interprocedural constant propagation performs function cloning
8854 when externally visible function can be called with constant arguments.
8855 Because this optimization can create multiple copies of functions,
8856 it may significantly increase code size
8857 (see @option{--param ipcp-unit-growth=@var{value}}).
8858 This flag is enabled by default at @option{-O3}.
8860 @item -fipa-bit-cp
8861 @opindex -fipa-bit-cp
8862 When enabled, perform interprocedural bitwise constant
8863 propagation. This flag is enabled by default at @option{-O2}. It
8864 requires that @option{-fipa-cp} is enabled.
8866 @item -fipa-vrp
8867 @opindex -fipa-vrp
8868 When enabled, perform interprocedural propagation of value
8869 ranges. This flag is enabled by default at @option{-O2}. It requires
8870 that @option{-fipa-cp} is enabled.
8872 @item -fipa-icf
8873 @opindex fipa-icf
8874 Perform Identical Code Folding for functions and read-only variables.
8875 The optimization reduces code size and may disturb unwind stacks by replacing
8876 a function by equivalent one with a different name. The optimization works
8877 more effectively with link-time optimization enabled.
8879 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
8880 works on different levels and thus the optimizations are not same - there are
8881 equivalences that are found only by GCC and equivalences found only by Gold.
8883 This flag is enabled by default at @option{-O2} and @option{-Os}.
8885 @item -fisolate-erroneous-paths-dereference
8886 @opindex fisolate-erroneous-paths-dereference
8887 Detect paths that trigger erroneous or undefined behavior due to
8888 dereferencing a null pointer.  Isolate those paths from the main control
8889 flow and turn the statement with erroneous or undefined behavior into a trap.
8890 This flag is enabled by default at @option{-O2} and higher and depends on
8891 @option{-fdelete-null-pointer-checks} also being enabled.
8893 @item -fisolate-erroneous-paths-attribute
8894 @opindex fisolate-erroneous-paths-attribute
8895 Detect paths that trigger erroneous or undefined behavior due to a null value
8896 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
8897 attribute.  Isolate those paths from the main control flow and turn the
8898 statement with erroneous or undefined behavior into a trap.  This is not
8899 currently enabled, but may be enabled by @option{-O2} in the future.
8901 @item -ftree-sink
8902 @opindex ftree-sink
8903 Perform forward store motion on trees.  This flag is
8904 enabled by default at @option{-O} and higher.
8906 @item -ftree-bit-ccp
8907 @opindex ftree-bit-ccp
8908 Perform sparse conditional bit constant propagation on trees and propagate
8909 pointer alignment information.
8910 This pass only operates on local scalar variables and is enabled by default
8911 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
8913 @item -ftree-ccp
8914 @opindex ftree-ccp
8915 Perform sparse conditional constant propagation (CCP) on trees.  This
8916 pass only operates on local scalar variables and is enabled by default
8917 at @option{-O} and higher.
8919 @item -fssa-backprop
8920 @opindex fssa-backprop
8921 Propagate information about uses of a value up the definition chain
8922 in order to simplify the definitions.  For example, this pass strips
8923 sign operations if the sign of a value never matters.  The flag is
8924 enabled by default at @option{-O} and higher.
8926 @item -fssa-phiopt
8927 @opindex fssa-phiopt
8928 Perform pattern matching on SSA PHI nodes to optimize conditional
8929 code.  This pass is enabled by default at @option{-O} and higher.
8931 @item -ftree-switch-conversion
8932 @opindex ftree-switch-conversion
8933 Perform conversion of simple initializations in a switch to
8934 initializations from a scalar array.  This flag is enabled by default
8935 at @option{-O2} and higher.
8937 @item -ftree-tail-merge
8938 @opindex ftree-tail-merge
8939 Look for identical code sequences.  When found, replace one with a jump to the
8940 other.  This optimization is known as tail merging or cross jumping.  This flag
8941 is enabled by default at @option{-O2} and higher.  The compilation time
8942 in this pass can
8943 be limited using @option{max-tail-merge-comparisons} parameter and
8944 @option{max-tail-merge-iterations} parameter.
8946 @item -ftree-dce
8947 @opindex ftree-dce
8948 Perform dead code elimination (DCE) on trees.  This flag is enabled by
8949 default at @option{-O} and higher.
8951 @item -ftree-builtin-call-dce
8952 @opindex ftree-builtin-call-dce
8953 Perform conditional dead code elimination (DCE) for calls to built-in functions
8954 that may set @code{errno} but are otherwise free of side effects.  This flag is
8955 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8956 specified.
8958 @item -ftree-dominator-opts
8959 @opindex ftree-dominator-opts
8960 Perform a variety of simple scalar cleanups (constant/copy
8961 propagation, redundancy elimination, range propagation and expression
8962 simplification) based on a dominator tree traversal.  This also
8963 performs jump threading (to reduce jumps to jumps). This flag is
8964 enabled by default at @option{-O} and higher.
8966 @item -ftree-dse
8967 @opindex ftree-dse
8968 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8969 a memory location that is later overwritten by another store without
8970 any intervening loads.  In this case the earlier store can be deleted.  This
8971 flag is enabled by default at @option{-O} and higher.
8973 @item -ftree-ch
8974 @opindex ftree-ch
8975 Perform loop header copying on trees.  This is beneficial since it increases
8976 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8977 is enabled by default at @option{-O} and higher.  It is not enabled
8978 for @option{-Os}, since it usually increases code size.
8980 @item -ftree-loop-optimize
8981 @opindex ftree-loop-optimize
8982 Perform loop optimizations on trees.  This flag is enabled by default
8983 at @option{-O} and higher.
8985 @item -ftree-loop-linear
8986 @itemx -floop-strip-mine
8987 @itemx -floop-block
8988 @opindex ftree-loop-linear
8989 @opindex floop-strip-mine
8990 @opindex floop-block
8991 Perform loop nest optimizations.  Same as
8992 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
8993 to be configured with @option{--with-isl} to enable the Graphite loop
8994 transformation infrastructure.
8996 @item -fgraphite-identity
8997 @opindex fgraphite-identity
8998 Enable the identity transformation for graphite.  For every SCoP we generate
8999 the polyhedral representation and transform it back to gimple.  Using
9000 @option{-fgraphite-identity} we can check the costs or benefits of the
9001 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
9002 are also performed by the code generator isl, like index splitting and
9003 dead code elimination in loops.
9005 @item -floop-nest-optimize
9006 @opindex floop-nest-optimize
9007 Enable the isl based loop nest optimizer.  This is a generic loop nest
9008 optimizer based on the Pluto optimization algorithms.  It calculates a loop
9009 structure optimized for data-locality and parallelism.  This option
9010 is experimental.
9012 @item -floop-parallelize-all
9013 @opindex floop-parallelize-all
9014 Use the Graphite data dependence analysis to identify loops that can
9015 be parallelized.  Parallelize all the loops that can be analyzed to
9016 not contain loop carried dependences without checking that it is
9017 profitable to parallelize the loops.
9019 @item -ftree-coalesce-vars
9020 @opindex ftree-coalesce-vars
9021 While transforming the program out of the SSA representation, attempt to
9022 reduce copying by coalescing versions of different user-defined
9023 variables, instead of just compiler temporaries.  This may severely
9024 limit the ability to debug an optimized program compiled with
9025 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
9026 prevents SSA coalescing of user variables.  This option is enabled by
9027 default if optimization is enabled, and it does very little otherwise.
9029 @item -ftree-loop-if-convert
9030 @opindex ftree-loop-if-convert
9031 Attempt to transform conditional jumps in the innermost loops to
9032 branch-less equivalents.  The intent is to remove control-flow from
9033 the innermost loops in order to improve the ability of the
9034 vectorization pass to handle these loops.  This is enabled by default
9035 if vectorization is enabled.
9037 @item -ftree-loop-distribution
9038 @opindex ftree-loop-distribution
9039 Perform loop distribution.  This flag can improve cache performance on
9040 big loop bodies and allow further loop optimizations, like
9041 parallelization or vectorization, to take place.  For example, the loop
9042 @smallexample
9043 DO I = 1, N
9044   A(I) = B(I) + C
9045   D(I) = E(I) * F
9046 ENDDO
9047 @end smallexample
9048 is transformed to
9049 @smallexample
9050 DO I = 1, N
9051    A(I) = B(I) + C
9052 ENDDO
9053 DO I = 1, N
9054    D(I) = E(I) * F
9055 ENDDO
9056 @end smallexample
9058 @item -ftree-loop-distribute-patterns
9059 @opindex ftree-loop-distribute-patterns
9060 Perform loop distribution of patterns that can be code generated with
9061 calls to a library.  This flag is enabled by default at @option{-O3}.
9063 This pass distributes the initialization loops and generates a call to
9064 memset zero.  For example, the loop
9065 @smallexample
9066 DO I = 1, N
9067   A(I) = 0
9068   B(I) = A(I) + I
9069 ENDDO
9070 @end smallexample
9071 is transformed to
9072 @smallexample
9073 DO I = 1, N
9074    A(I) = 0
9075 ENDDO
9076 DO I = 1, N
9077    B(I) = A(I) + I
9078 ENDDO
9079 @end smallexample
9080 and the initialization loop is transformed into a call to memset zero.
9082 @item -floop-interchange
9083 @opindex floop-interchange
9084 Perform loop interchange outside of graphite.  This flag can improve cache
9085 performance on loop nest and allow further loop optimizations, like
9086 vectorization, to take place.  For example, the loop
9087 @smallexample
9088 for (int i = 0; i < N; i++)
9089   for (int j = 0; j < N; j++)
9090     for (int k = 0; k < N; k++)
9091       c[i][j] = c[i][j] + a[i][k]*b[k][j];
9092 @end smallexample
9093 is transformed to
9094 @smallexample
9095 for (int i = 0; i < N; i++)
9096   for (int k = 0; k < N; k++)
9097     for (int j = 0; j < N; j++)
9098       c[i][j] = c[i][j] + a[i][k]*b[k][j];
9099 @end smallexample
9100 This flag is enabled by default at @option{-O3}.
9102 @item -floop-unroll-and-jam
9103 @opindex floop-unroll-and-jam
9104 Apply unroll and jam transformations on feasible loops.  In a loop
9105 nest this unrolls the outer loop by some factor and fuses the resulting
9106 multiple inner loops.  This flag is enabled by default at @option{-O3}.
9108 @item -ftree-loop-im
9109 @opindex ftree-loop-im
9110 Perform loop invariant motion on trees.  This pass moves only invariants that
9111 are hard to handle at RTL level (function calls, operations that expand to
9112 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
9113 operands of conditions that are invariant out of the loop, so that we can use
9114 just trivial invariantness analysis in loop unswitching.  The pass also includes
9115 store motion.
9117 @item -ftree-loop-ivcanon
9118 @opindex ftree-loop-ivcanon
9119 Create a canonical counter for number of iterations in loops for which
9120 determining number of iterations requires complicated analysis.  Later
9121 optimizations then may determine the number easily.  Useful especially
9122 in connection with unrolling.
9124 @item -ftree-scev-cprop
9125 @opindex ftree-scev-cprop
9126 Perform final value replacement.  If a variable is modified in a loop
9127 in such a way that its value when exiting the loop can be determined using
9128 only its initial value and the number of loop iterations, replace uses of
9129 the final value by such a computation, provided it is sufficiently cheap.
9130 This reduces data dependencies and may allow further simplifications.
9131 Enabled by default at @option{-O} and higher.
9133 @item -fivopts
9134 @opindex fivopts
9135 Perform induction variable optimizations (strength reduction, induction
9136 variable merging and induction variable elimination) on trees.
9138 @item -ftree-parallelize-loops=n
9139 @opindex ftree-parallelize-loops
9140 Parallelize loops, i.e., split their iteration space to run in n threads.
9141 This is only possible for loops whose iterations are independent
9142 and can be arbitrarily reordered.  The optimization is only
9143 profitable on multiprocessor machines, for loops that are CPU-intensive,
9144 rather than constrained e.g.@: by memory bandwidth.  This option
9145 implies @option{-pthread}, and thus is only supported on targets
9146 that have support for @option{-pthread}.
9148 @item -ftree-pta
9149 @opindex ftree-pta
9150 Perform function-local points-to analysis on trees.  This flag is
9151 enabled by default at @option{-O} and higher.
9153 @item -ftree-sra
9154 @opindex ftree-sra
9155 Perform scalar replacement of aggregates.  This pass replaces structure
9156 references with scalars to prevent committing structures to memory too
9157 early.  This flag is enabled by default at @option{-O} and higher.
9159 @item -fstore-merging
9160 @opindex fstore-merging
9161 Perform merging of narrow stores to consecutive memory addresses.  This pass
9162 merges contiguous stores of immediate values narrower than a word into fewer
9163 wider stores to reduce the number of instructions.  This is enabled by default
9164 at @option{-O2} and higher as well as @option{-Os}.
9166 @item -ftree-ter
9167 @opindex ftree-ter
9168 Perform temporary expression replacement during the SSA->normal phase.  Single
9169 use/single def temporaries are replaced at their use location with their
9170 defining expression.  This results in non-GIMPLE code, but gives the expanders
9171 much more complex trees to work on resulting in better RTL generation.  This is
9172 enabled by default at @option{-O} and higher.
9174 @item -ftree-slsr
9175 @opindex ftree-slsr
9176 Perform straight-line strength reduction on trees.  This recognizes related
9177 expressions involving multiplications and replaces them by less expensive
9178 calculations when possible.  This is enabled by default at @option{-O} and
9179 higher.
9181 @item -ftree-vectorize
9182 @opindex ftree-vectorize
9183 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
9184 and @option{-ftree-slp-vectorize} if not explicitly specified.
9186 @item -ftree-loop-vectorize
9187 @opindex ftree-loop-vectorize
9188 Perform loop vectorization on trees. This flag is enabled by default at
9189 @option{-O3} and when @option{-ftree-vectorize} is enabled.
9191 @item -ftree-slp-vectorize
9192 @opindex ftree-slp-vectorize
9193 Perform basic block vectorization on trees. This flag is enabled by default at
9194 @option{-O3} and when @option{-ftree-vectorize} is enabled.
9196 @item -fvect-cost-model=@var{model}
9197 @opindex fvect-cost-model
9198 Alter the cost model used for vectorization.  The @var{model} argument
9199 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
9200 With the @samp{unlimited} model the vectorized code-path is assumed
9201 to be profitable while with the @samp{dynamic} model a runtime check
9202 guards the vectorized code-path to enable it only for iteration
9203 counts that will likely execute faster than when executing the original
9204 scalar loop.  The @samp{cheap} model disables vectorization of
9205 loops where doing so would be cost prohibitive for example due to
9206 required runtime checks for data dependence or alignment but otherwise
9207 is equal to the @samp{dynamic} model.
9208 The default cost model depends on other optimization flags and is
9209 either @samp{dynamic} or @samp{cheap}.
9211 @item -fsimd-cost-model=@var{model}
9212 @opindex fsimd-cost-model
9213 Alter the cost model used for vectorization of loops marked with the OpenMP
9214 simd directive.  The @var{model} argument should be one of
9215 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
9216 have the same meaning as described in @option{-fvect-cost-model} and by
9217 default a cost model defined with @option{-fvect-cost-model} is used.
9219 @item -ftree-vrp
9220 @opindex ftree-vrp
9221 Perform Value Range Propagation on trees.  This is similar to the
9222 constant propagation pass, but instead of values, ranges of values are
9223 propagated.  This allows the optimizers to remove unnecessary range
9224 checks like array bound checks and null pointer checks.  This is
9225 enabled by default at @option{-O2} and higher.  Null pointer check
9226 elimination is only done if @option{-fdelete-null-pointer-checks} is
9227 enabled.
9229 @item -fsplit-paths
9230 @opindex fsplit-paths
9231 Split paths leading to loop backedges.  This can improve dead code
9232 elimination and common subexpression elimination.  This is enabled by
9233 default at @option{-O2} and above.
9235 @item -fsplit-ivs-in-unroller
9236 @opindex fsplit-ivs-in-unroller
9237 Enables expression of values of induction variables in later iterations
9238 of the unrolled loop using the value in the first iteration.  This breaks
9239 long dependency chains, thus improving efficiency of the scheduling passes.
9241 A combination of @option{-fweb} and CSE is often sufficient to obtain the
9242 same effect.  However, that is not reliable in cases where the loop body
9243 is more complicated than a single basic block.  It also does not work at all
9244 on some architectures due to restrictions in the CSE pass.
9246 This optimization is enabled by default.
9248 @item -fvariable-expansion-in-unroller
9249 @opindex fvariable-expansion-in-unroller
9250 With this option, the compiler creates multiple copies of some
9251 local variables when unrolling a loop, which can result in superior code.
9253 @item -fpartial-inlining
9254 @opindex fpartial-inlining
9255 Inline parts of functions.  This option has any effect only
9256 when inlining itself is turned on by the @option{-finline-functions}
9257 or @option{-finline-small-functions} options.
9259 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9261 @item -fpredictive-commoning
9262 @opindex fpredictive-commoning
9263 Perform predictive commoning optimization, i.e., reusing computations
9264 (especially memory loads and stores) performed in previous
9265 iterations of loops.
9267 This option is enabled at level @option{-O3}.
9269 @item -fprefetch-loop-arrays
9270 @opindex fprefetch-loop-arrays
9271 If supported by the target machine, generate instructions to prefetch
9272 memory to improve the performance of loops that access large arrays.
9274 This option may generate better or worse code; results are highly
9275 dependent on the structure of loops within the source code.
9277 Disabled at level @option{-Os}.
9279 @item -fno-printf-return-value
9280 @opindex fno-printf-return-value
9281 Do not substitute constants for known return value of formatted output
9282 functions such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and
9283 @code{vsnprintf} (but not @code{printf} of @code{fprintf}).  This
9284 transformation allows GCC to optimize or even eliminate branches based
9285 on the known return value of these functions called with arguments that
9286 are either constant, or whose values are known to be in a range that
9287 makes determining the exact return value possible.  For example, when
9288 @option{-fprintf-return-value} is in effect, both the branch and the
9289 body of the @code{if} statement (but not the call to @code{snprint})
9290 can be optimized away when @code{i} is a 32-bit or smaller integer
9291 because the return value is guaranteed to be at most 8.
9293 @smallexample
9294 char buf[9];
9295 if (snprintf (buf, "%08x", i) >= sizeof buf)
9296   @dots{}
9297 @end smallexample
9299 The @option{-fprintf-return-value} option relies on other optimizations
9300 and yields best results with @option{-O2} and above.  It works in tandem
9301 with the @option{-Wformat-overflow} and @option{-Wformat-truncation}
9302 options.  The @option{-fprintf-return-value} option is enabled by default.
9304 @item -fno-peephole
9305 @itemx -fno-peephole2
9306 @opindex fno-peephole
9307 @opindex fno-peephole2
9308 Disable any machine-specific peephole optimizations.  The difference
9309 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
9310 are implemented in the compiler; some targets use one, some use the
9311 other, a few use both.
9313 @option{-fpeephole} is enabled by default.
9314 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9316 @item -fno-guess-branch-probability
9317 @opindex fno-guess-branch-probability
9318 Do not guess branch probabilities using heuristics.
9320 GCC uses heuristics to guess branch probabilities if they are
9321 not provided by profiling feedback (@option{-fprofile-arcs}).  These
9322 heuristics are based on the control flow graph.  If some branch probabilities
9323 are specified by @code{__builtin_expect}, then the heuristics are
9324 used to guess branch probabilities for the rest of the control flow graph,
9325 taking the @code{__builtin_expect} info into account.  The interactions
9326 between the heuristics and @code{__builtin_expect} can be complex, and in
9327 some cases, it may be useful to disable the heuristics so that the effects
9328 of @code{__builtin_expect} are easier to understand.
9330 It is also possible to specify expected probability of the expression
9331 with @code{__builtin_expect_with_probability} built-in function.
9333 The default is @option{-fguess-branch-probability} at levels
9334 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9336 @item -freorder-blocks
9337 @opindex freorder-blocks
9338 Reorder basic blocks in the compiled function in order to reduce number of
9339 taken branches and improve code locality.
9341 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9343 @item -freorder-blocks-algorithm=@var{algorithm}
9344 @opindex freorder-blocks-algorithm
9345 Use the specified algorithm for basic block reordering.  The
9346 @var{algorithm} argument can be @samp{simple}, which does not increase
9347 code size (except sometimes due to secondary effects like alignment),
9348 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
9349 put all often executed code together, minimizing the number of branches
9350 executed by making extra copies of code.
9352 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
9353 @samp{stc} at levels @option{-O2}, @option{-O3}.
9355 @item -freorder-blocks-and-partition
9356 @opindex freorder-blocks-and-partition
9357 In addition to reordering basic blocks in the compiled function, in order
9358 to reduce number of taken branches, partitions hot and cold basic blocks
9359 into separate sections of the assembly and @file{.o} files, to improve
9360 paging and cache locality performance.
9362 This optimization is automatically turned off in the presence of
9363 exception handling or unwind tables (on targets using setjump/longjump or target specific scheme), for linkonce sections, for functions with a user-defined
9364 section attribute and on any architecture that does not support named
9365 sections.  When @option{-fsplit-stack} is used this option is not
9366 enabled by default (to avoid linker errors), but may be enabled
9367 explicitly (if using a working linker).
9369 Enabled for x86 at levels @option{-O2}, @option{-O3}, @option{-Os}.
9371 @item -freorder-functions
9372 @opindex freorder-functions
9373 Reorder functions in the object file in order to
9374 improve code locality.  This is implemented by using special
9375 subsections @code{.text.hot} for most frequently executed functions and
9376 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
9377 the linker so object file format must support named sections and linker must
9378 place them in a reasonable way.
9380 Also profile feedback must be available to make this option effective.  See
9381 @option{-fprofile-arcs} for details.
9383 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9385 @item -fstrict-aliasing
9386 @opindex fstrict-aliasing
9387 Allow the compiler to assume the strictest aliasing rules applicable to
9388 the language being compiled.  For C (and C++), this activates
9389 optimizations based on the type of expressions.  In particular, an
9390 object of one type is assumed never to reside at the same address as an
9391 object of a different type, unless the types are almost the same.  For
9392 example, an @code{unsigned int} can alias an @code{int}, but not a
9393 @code{void*} or a @code{double}.  A character type may alias any other
9394 type.
9396 @anchor{Type-punning}Pay special attention to code like this:
9397 @smallexample
9398 union a_union @{
9399   int i;
9400   double d;
9403 int f() @{
9404   union a_union t;
9405   t.d = 3.0;
9406   return t.i;
9408 @end smallexample
9409 The practice of reading from a different union member than the one most
9410 recently written to (called ``type-punning'') is common.  Even with
9411 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
9412 is accessed through the union type.  So, the code above works as
9413 expected.  @xref{Structures unions enumerations and bit-fields
9414 implementation}.  However, this code might not:
9415 @smallexample
9416 int f() @{
9417   union a_union t;
9418   int* ip;
9419   t.d = 3.0;
9420   ip = &t.i;
9421   return *ip;
9423 @end smallexample
9425 Similarly, access by taking the address, casting the resulting pointer
9426 and dereferencing the result has undefined behavior, even if the cast
9427 uses a union type, e.g.:
9428 @smallexample
9429 int f() @{
9430   double d = 3.0;
9431   return ((union a_union *) &d)->i;
9433 @end smallexample
9435 The @option{-fstrict-aliasing} option is enabled at levels
9436 @option{-O2}, @option{-O3}, @option{-Os}.
9438 @item -falign-functions
9439 @itemx -falign-functions=@var{n}
9440 @itemx -falign-functions=@var{n}:@var{m}
9441 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}
9442 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}:@var{m2}
9443 @opindex falign-functions
9444 Align the start of functions to the next power-of-two greater than
9445 @var{n}, skipping up to @var{m}-1 bytes.  This ensures that at least
9446 the first @var{m} bytes of the function can be fetched by the CPU
9447 without crossing an @var{n}-byte alignment boundary.
9449 If @var{m} is not specified, it defaults to @var{n}.
9451 Examples: @option{-falign-functions=32} aligns functions to the next
9452 32-byte boundary, @option{-falign-functions=24} aligns to the next
9453 32-byte boundary only if this can be done by skipping 23 bytes or less,
9454 @option{-falign-functions=32:7} aligns to the next
9455 32-byte boundary only if this can be done by skipping 6 bytes or less.
9457 The second pair of @var{n2}:@var{m2} values allows you to specify
9458 a secondary alignment: @option{-falign-functions=64:7:32:3} aligns to
9459 the next 64-byte boundary if this can be done by skipping 6 bytes or less,
9460 otherwise aligns to the next 32-byte boundary if this can be done
9461 by skipping 2 bytes or less.
9462 If @var{m2} is not specified, it defaults to @var{n2}.
9464 Some assemblers only support this flag when @var{n} is a power of two;
9465 in that case, it is rounded up.
9467 @option{-fno-align-functions} and @option{-falign-functions=1} are
9468 equivalent and mean that functions are not aligned.
9470 If @var{n} is not specified or is zero, use a machine-dependent default.
9471 The maximum allowed @var{n} option value is 65536.
9473 Enabled at levels @option{-O2}, @option{-O3}.
9475 @item -flimit-function-alignment
9476 If this option is enabled, the compiler tries to avoid unnecessarily
9477 overaligning functions. It attempts to instruct the assembler to align
9478 by the amount specified by @option{-falign-functions}, but not to
9479 skip more bytes than the size of the function.
9481 @item -falign-labels
9482 @itemx -falign-labels=@var{n}
9483 @itemx -falign-labels=@var{n}:@var{m}
9484 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}
9485 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}:@var{m2}
9486 @opindex falign-labels
9487 Align all branch targets to a power-of-two boundary.
9489 Parameters of this option are analogous to the @option{-falign-functions} option.
9490 @option{-fno-align-labels} and @option{-falign-labels=1} are
9491 equivalent and mean that labels are not aligned.
9493 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
9494 are greater than this value, then their values are used instead.
9496 If @var{n} is not specified or is zero, use a machine-dependent default
9497 which is very likely to be @samp{1}, meaning no alignment.
9498 The maximum allowed @var{n} option value is 65536.
9500 Enabled at levels @option{-O2}, @option{-O3}.
9502 @item -falign-loops
9503 @itemx -falign-loops=@var{n}
9504 @itemx -falign-loops=@var{n}:@var{m}
9505 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}
9506 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}:@var{m2}
9507 @opindex falign-loops
9508 Align loops to a power-of-two boundary.  If the loops are executed
9509 many times, this makes up for any execution of the dummy padding
9510 instructions.
9512 Parameters of this option are analogous to the @option{-falign-functions} option.
9513 @option{-fno-align-loops} and @option{-falign-loops=1} are
9514 equivalent and mean that loops are not aligned.
9515 The maximum allowed @var{n} option value is 65536.
9517 If @var{n} is not specified or is zero, use a machine-dependent default.
9519 Enabled at levels @option{-O2}, @option{-O3}.
9521 @item -falign-jumps
9522 @itemx -falign-jumps=@var{n}
9523 @itemx -falign-jumps=@var{n}:@var{m}
9524 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}
9525 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}:@var{m2}
9526 @opindex falign-jumps
9527 Align branch targets to a power-of-two boundary, for branch targets
9528 where the targets can only be reached by jumping.  In this case,
9529 no dummy operations need be executed.
9531 Parameters of this option are analogous to the @option{-falign-functions} option.
9532 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
9533 equivalent and mean that loops are not aligned.
9535 If @var{n} is not specified or is zero, use a machine-dependent default.
9536 The maximum allowed @var{n} option value is 65536.
9538 Enabled at levels @option{-O2}, @option{-O3}.
9540 @item -funit-at-a-time
9541 @opindex funit-at-a-time
9542 This option is left for compatibility reasons. @option{-funit-at-a-time}
9543 has no effect, while @option{-fno-unit-at-a-time} implies
9544 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
9546 Enabled by default.
9548 @item -fno-toplevel-reorder
9549 @opindex fno-toplevel-reorder
9550 Do not reorder top-level functions, variables, and @code{asm}
9551 statements.  Output them in the same order that they appear in the
9552 input file.  When this option is used, unreferenced static variables
9553 are not removed.  This option is intended to support existing code
9554 that relies on a particular ordering.  For new code, it is better to
9555 use attributes when possible.
9557 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
9558 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
9559 targets.
9561 @item -fweb
9562 @opindex fweb
9563 Constructs webs as commonly used for register allocation purposes and assign
9564 each web individual pseudo register.  This allows the register allocation pass
9565 to operate on pseudos directly, but also strengthens several other optimization
9566 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
9567 however, make debugging impossible, since variables no longer stay in a
9568 ``home register''.
9570 Enabled by default with @option{-funroll-loops}.
9572 @item -fwhole-program
9573 @opindex fwhole-program
9574 Assume that the current compilation unit represents the whole program being
9575 compiled.  All public functions and variables with the exception of @code{main}
9576 and those merged by attribute @code{externally_visible} become static functions
9577 and in effect are optimized more aggressively by interprocedural optimizers.
9579 This option should not be used in combination with @option{-flto}.
9580 Instead relying on a linker plugin should provide safer and more precise
9581 information.
9583 @item -flto[=@var{n}]
9584 @opindex flto
9585 This option runs the standard link-time optimizer.  When invoked
9586 with source code, it generates GIMPLE (one of GCC's internal
9587 representations) and writes it to special ELF sections in the object
9588 file.  When the object files are linked together, all the function
9589 bodies are read from these ELF sections and instantiated as if they
9590 had been part of the same translation unit.
9592 To use the link-time optimizer, @option{-flto} and optimization
9593 options should be specified at compile time and during the final link.
9594 It is recommended that you compile all the files participating in the
9595 same link with the same options and also specify those options at
9596 link time.  
9597 For example:
9599 @smallexample
9600 gcc -c -O2 -flto foo.c
9601 gcc -c -O2 -flto bar.c
9602 gcc -o myprog -flto -O2 foo.o bar.o
9603 @end smallexample
9605 The first two invocations to GCC save a bytecode representation
9606 of GIMPLE into special ELF sections inside @file{foo.o} and
9607 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
9608 @file{foo.o} and @file{bar.o}, merges the two files into a single
9609 internal image, and compiles the result as usual.  Since both
9610 @file{foo.o} and @file{bar.o} are merged into a single image, this
9611 causes all the interprocedural analyses and optimizations in GCC to
9612 work across the two files as if they were a single one.  This means,
9613 for example, that the inliner is able to inline functions in
9614 @file{bar.o} into functions in @file{foo.o} and vice-versa.
9616 Another (simpler) way to enable link-time optimization is:
9618 @smallexample
9619 gcc -o myprog -flto -O2 foo.c bar.c
9620 @end smallexample
9622 The above generates bytecode for @file{foo.c} and @file{bar.c},
9623 merges them together into a single GIMPLE representation and optimizes
9624 them as usual to produce @file{myprog}.
9626 The only important thing to keep in mind is that to enable link-time
9627 optimizations you need to use the GCC driver to perform the link step.
9628 GCC then automatically performs link-time optimization if any of the
9629 objects involved were compiled with the @option{-flto} command-line option.  
9630 You generally
9631 should specify the optimization options to be used for link-time
9632 optimization though GCC tries to be clever at guessing an
9633 optimization level to use from the options used at compile time
9634 if you fail to specify one at link time.  You can always override
9635 the automatic decision to do link-time optimization
9636 by passing @option{-fno-lto} to the link command.
9638 To make whole program optimization effective, it is necessary to make
9639 certain whole program assumptions.  The compiler needs to know
9640 what functions and variables can be accessed by libraries and runtime
9641 outside of the link-time optimized unit.  When supported by the linker,
9642 the linker plugin (see @option{-fuse-linker-plugin}) passes information
9643 to the compiler about used and externally visible symbols.  When
9644 the linker plugin is not available, @option{-fwhole-program} should be
9645 used to allow the compiler to make these assumptions, which leads
9646 to more aggressive optimization decisions.
9648 When @option{-fuse-linker-plugin} is not enabled, when a file is
9649 compiled with @option{-flto}, the generated object file is larger than
9650 a regular object file because it contains GIMPLE bytecodes and the usual
9651 final code (see @option{-ffat-lto-objects}.  This means that
9652 object files with LTO information can be linked as normal object
9653 files; if @option{-fno-lto} is passed to the linker, no
9654 interprocedural optimizations are applied.  Note that when
9655 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
9656 but you cannot perform a regular, non-LTO link on them.
9658 Additionally, the optimization flags used to compile individual files
9659 are not necessarily related to those used at link time.  For instance,
9661 @smallexample
9662 gcc -c -O0 -ffat-lto-objects -flto foo.c
9663 gcc -c -O0 -ffat-lto-objects -flto bar.c
9664 gcc -o myprog -O3 foo.o bar.o
9665 @end smallexample
9667 This produces individual object files with unoptimized assembler
9668 code, but the resulting binary @file{myprog} is optimized at
9669 @option{-O3}.  If, instead, the final binary is generated with
9670 @option{-fno-lto}, then @file{myprog} is not optimized.
9672 When producing the final binary, GCC only
9673 applies link-time optimizations to those files that contain bytecode.
9674 Therefore, you can mix and match object files and libraries with
9675 GIMPLE bytecodes and final object code.  GCC automatically selects
9676 which files to optimize in LTO mode and which files to link without
9677 further processing.
9679 There are some code generation flags preserved by GCC when
9680 generating bytecodes, as they need to be used during the final link
9681 stage.  Generally options specified at link time override those
9682 specified at compile time.
9684 If you do not specify an optimization level option @option{-O} at
9685 link time, then GCC uses the highest optimization level 
9686 used when compiling the object files.
9688 Currently, the following options and their settings are taken from
9689 the first object file that explicitly specifies them: 
9690 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
9691 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
9692 and all the @option{-m} target flags.
9694 Certain ABI-changing flags are required to match in all compilation units,
9695 and trying to override this at link time with a conflicting value
9696 is ignored.  This includes options such as @option{-freg-struct-return}
9697 and @option{-fpcc-struct-return}. 
9699 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
9700 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
9701 are passed through to the link stage and merged conservatively for
9702 conflicting translation units.  Specifically
9703 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
9704 precedence; and for example @option{-ffp-contract=off} takes precedence
9705 over @option{-ffp-contract=fast}.  You can override them at link time.
9707 If LTO encounters objects with C linkage declared with incompatible
9708 types in separate translation units to be linked together (undefined
9709 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
9710 issued.  The behavior is still undefined at run time.  Similar
9711 diagnostics may be raised for other languages.
9713 Another feature of LTO is that it is possible to apply interprocedural
9714 optimizations on files written in different languages:
9716 @smallexample
9717 gcc -c -flto foo.c
9718 g++ -c -flto bar.cc
9719 gfortran -c -flto baz.f90
9720 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
9721 @end smallexample
9723 Notice that the final link is done with @command{g++} to get the C++
9724 runtime libraries and @option{-lgfortran} is added to get the Fortran
9725 runtime libraries.  In general, when mixing languages in LTO mode, you
9726 should use the same link command options as when mixing languages in a
9727 regular (non-LTO) compilation.
9729 If object files containing GIMPLE bytecode are stored in a library archive, say
9730 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
9731 are using a linker with plugin support.  To create static libraries suitable
9732 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
9733 and @command{ranlib}; 
9734 to show the symbols of object files with GIMPLE bytecode, use
9735 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
9736 and @command{nm} have been compiled with plugin support.  At link time, use the
9737 flag @option{-fuse-linker-plugin} to ensure that the library participates in
9738 the LTO optimization process:
9740 @smallexample
9741 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
9742 @end smallexample
9744 With the linker plugin enabled, the linker extracts the needed
9745 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
9746 to make them part of the aggregated GIMPLE image to be optimized.
9748 If you are not using a linker with plugin support and/or do not
9749 enable the linker plugin, then the objects inside @file{libfoo.a}
9750 are extracted and linked as usual, but they do not participate
9751 in the LTO optimization process.  In order to make a static library suitable
9752 for both LTO optimization and usual linkage, compile its object files with
9753 @option{-flto} @option{-ffat-lto-objects}.
9755 Link-time optimizations do not require the presence of the whole program to
9756 operate.  If the program does not require any symbols to be exported, it is
9757 possible to combine @option{-flto} and @option{-fwhole-program} to allow
9758 the interprocedural optimizers to use more aggressive assumptions which may
9759 lead to improved optimization opportunities.
9760 Use of @option{-fwhole-program} is not needed when linker plugin is
9761 active (see @option{-fuse-linker-plugin}).
9763 The current implementation of LTO makes no
9764 attempt to generate bytecode that is portable between different
9765 types of hosts.  The bytecode files are versioned and there is a
9766 strict version check, so bytecode files generated in one version of
9767 GCC do not work with an older or newer version of GCC.
9769 Link-time optimization does not work well with generation of debugging
9770 information on systems other than those using a combination of ELF and
9771 DWARF.
9773 If you specify the optional @var{n}, the optimization and code
9774 generation done at link time is executed in parallel using @var{n}
9775 parallel jobs by utilizing an installed @command{make} program.  The
9776 environment variable @env{MAKE} may be used to override the program
9777 used.  The default value for @var{n} is 1.
9779 You can also specify @option{-flto=jobserver} to use GNU make's
9780 job server mode to determine the number of parallel jobs. This
9781 is useful when the Makefile calling GCC is already executing in parallel.
9782 You must prepend a @samp{+} to the command recipe in the parent Makefile
9783 for this to work.  This option likely only works if @env{MAKE} is
9784 GNU make.
9786 @item -flto-partition=@var{alg}
9787 @opindex flto-partition
9788 Specify the partitioning algorithm used by the link-time optimizer.
9789 The value is either @samp{1to1} to specify a partitioning mirroring
9790 the original source files or @samp{balanced} to specify partitioning
9791 into equally sized chunks (whenever possible) or @samp{max} to create
9792 new partition for every symbol where possible.  Specifying @samp{none}
9793 as an algorithm disables partitioning and streaming completely. 
9794 The default value is @samp{balanced}. While @samp{1to1} can be used
9795 as an workaround for various code ordering issues, the @samp{max}
9796 partitioning is intended for internal testing only.
9797 The value @samp{one} specifies that exactly one partition should be
9798 used while the value @samp{none} bypasses partitioning and executes
9799 the link-time optimization step directly from the WPA phase.
9801 @item -flto-odr-type-merging
9802 @opindex flto-odr-type-merging
9803 Enable streaming of mangled types names of C++ types and their unification
9804 at link time.  This increases size of LTO object files, but enables
9805 diagnostics about One Definition Rule violations.
9807 @item -flto-compression-level=@var{n}
9808 @opindex flto-compression-level
9809 This option specifies the level of compression used for intermediate
9810 language written to LTO object files, and is only meaningful in
9811 conjunction with LTO mode (@option{-flto}).  Valid
9812 values are 0 (no compression) to 9 (maximum compression).  Values
9813 outside this range are clamped to either 0 or 9.  If the option is not
9814 given, a default balanced compression setting is used.
9816 @item -fuse-linker-plugin
9817 @opindex fuse-linker-plugin
9818 Enables the use of a linker plugin during link-time optimization.  This
9819 option relies on plugin support in the linker, which is available in gold
9820 or in GNU ld 2.21 or newer.
9822 This option enables the extraction of object files with GIMPLE bytecode out
9823 of library archives. This improves the quality of optimization by exposing
9824 more code to the link-time optimizer.  This information specifies what
9825 symbols can be accessed externally (by non-LTO object or during dynamic
9826 linking).  Resulting code quality improvements on binaries (and shared
9827 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
9828 See @option{-flto} for a description of the effect of this flag and how to
9829 use it.
9831 This option is enabled by default when LTO support in GCC is enabled
9832 and GCC was configured for use with
9833 a linker supporting plugins (GNU ld 2.21 or newer or gold).
9835 @item -ffat-lto-objects
9836 @opindex ffat-lto-objects
9837 Fat LTO objects are object files that contain both the intermediate language
9838 and the object code. This makes them usable for both LTO linking and normal
9839 linking. This option is effective only when compiling with @option{-flto}
9840 and is ignored at link time.
9842 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
9843 requires the complete toolchain to be aware of LTO. It requires a linker with
9844 linker plugin support for basic functionality.  Additionally,
9845 @command{nm}, @command{ar} and @command{ranlib}
9846 need to support linker plugins to allow a full-featured build environment
9847 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
9848 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
9849 to these tools. With non fat LTO makefiles need to be modified to use them.
9851 Note that modern binutils provide plugin auto-load mechanism.
9852 Installing the linker plugin into @file{$libdir/bfd-plugins} has the same
9853 effect as usage of the command wrappers (@command{gcc-ar}, @command{gcc-nm} and
9854 @command{gcc-ranlib}).
9856 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
9857 support.
9859 @item -fcompare-elim
9860 @opindex fcompare-elim
9861 After register allocation and post-register allocation instruction splitting,
9862 identify arithmetic instructions that compute processor flags similar to a
9863 comparison operation based on that arithmetic.  If possible, eliminate the
9864 explicit comparison operation.
9866 This pass only applies to certain targets that cannot explicitly represent
9867 the comparison operation before register allocation is complete.
9869 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9871 @item -fcprop-registers
9872 @opindex fcprop-registers
9873 After register allocation and post-register allocation instruction splitting,
9874 perform a copy-propagation pass to try to reduce scheduling dependencies
9875 and occasionally eliminate the copy.
9877 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9879 @item -fprofile-correction
9880 @opindex fprofile-correction
9881 Profiles collected using an instrumented binary for multi-threaded programs may
9882 be inconsistent due to missed counter updates. When this option is specified,
9883 GCC uses heuristics to correct or smooth out such inconsistencies. By
9884 default, GCC emits an error message when an inconsistent profile is detected.
9886 @item -fprofile-use
9887 @itemx -fprofile-use=@var{path}
9888 @opindex fprofile-use
9889 Enable profile feedback-directed optimizations, 
9890 and the following optimizations
9891 which are generally profitable only with profile feedback available:
9892 @option{-fbranch-probabilities}, @option{-fvpt},
9893 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9894 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
9896 Before you can use this option, you must first generate profiling information.
9897 @xref{Instrumentation Options}, for information about the
9898 @option{-fprofile-generate} option.
9900 By default, GCC emits an error message if the feedback profiles do not
9901 match the source code.  This error can be turned into a warning by using
9902 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9903 code.
9905 If @var{path} is specified, GCC looks at the @var{path} to find
9906 the profile feedback data files. See @option{-fprofile-dir}.
9908 @item -fauto-profile
9909 @itemx -fauto-profile=@var{path}
9910 @opindex fauto-profile
9911 Enable sampling-based feedback-directed optimizations, 
9912 and the following optimizations
9913 which are generally profitable only with profile feedback available:
9914 @option{-fbranch-probabilities}, @option{-fvpt},
9915 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9916 @option{-ftree-vectorize},
9917 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
9918 @option{-fpredictive-commoning}, @option{-funswitch-loops},
9919 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
9921 @var{path} is the name of a file containing AutoFDO profile information.
9922 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
9924 Producing an AutoFDO profile data file requires running your program
9925 with the @command{perf} utility on a supported GNU/Linux target system.
9926 For more information, see @uref{https://perf.wiki.kernel.org/}.
9928 E.g.
9929 @smallexample
9930 perf record -e br_inst_retired:near_taken -b -o perf.data \
9931     -- your_program
9932 @end smallexample
9934 Then use the @command{create_gcov} tool to convert the raw profile data
9935 to a format that can be used by GCC.@  You must also supply the 
9936 unstripped binary for your program to this tool.  
9937 See @uref{https://github.com/google/autofdo}.
9939 E.g.
9940 @smallexample
9941 create_gcov --binary=your_program.unstripped --profile=perf.data \
9942     --gcov=profile.afdo
9943 @end smallexample
9944 @end table
9946 The following options control compiler behavior regarding floating-point 
9947 arithmetic.  These options trade off between speed and
9948 correctness.  All must be specifically enabled.
9950 @table @gcctabopt
9951 @item -ffloat-store
9952 @opindex ffloat-store
9953 Do not store floating-point variables in registers, and inhibit other
9954 options that might change whether a floating-point value is taken from a
9955 register or memory.
9957 @cindex floating-point precision
9958 This option prevents undesirable excess precision on machines such as
9959 the 68000 where the floating registers (of the 68881) keep more
9960 precision than a @code{double} is supposed to have.  Similarly for the
9961 x86 architecture.  For most programs, the excess precision does only
9962 good, but a few programs rely on the precise definition of IEEE floating
9963 point.  Use @option{-ffloat-store} for such programs, after modifying
9964 them to store all pertinent intermediate computations into variables.
9966 @item -fexcess-precision=@var{style}
9967 @opindex fexcess-precision
9968 This option allows further control over excess precision on machines
9969 where floating-point operations occur in a format with more precision or
9970 range than the IEEE standard and interchange floating-point types.  By
9971 default, @option{-fexcess-precision=fast} is in effect; this means that
9972 operations may be carried out in a wider precision than the types specified
9973 in the source if that would result in faster code, and it is unpredictable
9974 when rounding to the types specified in the source code takes place.
9975 When compiling C, if @option{-fexcess-precision=standard} is specified then
9976 excess precision follows the rules specified in ISO C99; in particular,
9977 both casts and assignments cause values to be rounded to their
9978 semantic types (whereas @option{-ffloat-store} only affects
9979 assignments).  This option is enabled by default for C if a strict
9980 conformance option such as @option{-std=c99} is used.
9981 @option{-ffast-math} enables @option{-fexcess-precision=fast} by default
9982 regardless of whether a strict conformance option is used.
9984 @opindex mfpmath
9985 @option{-fexcess-precision=standard} is not implemented for languages
9986 other than C.  On the x86, it has no effect if @option{-mfpmath=sse}
9987 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9988 semantics apply without excess precision, and in the latter, rounding
9989 is unpredictable.
9991 @item -ffast-math
9992 @opindex ffast-math
9993 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9994 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9995 @option{-fno-signaling-nans}, @option{-fcx-limited-range} and
9996 @option{-fexcess-precision=fast}.
9998 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
10000 This option is not turned on by any @option{-O} option besides
10001 @option{-Ofast} since it can result in incorrect output for programs
10002 that depend on an exact implementation of IEEE or ISO rules/specifications
10003 for math functions. It may, however, yield faster code for programs
10004 that do not require the guarantees of these specifications.
10006 @item -fno-math-errno
10007 @opindex fno-math-errno
10008 Do not set @code{errno} after calling math functions that are executed
10009 with a single instruction, e.g., @code{sqrt}.  A program that relies on
10010 IEEE exceptions for math error handling may want to use this flag
10011 for speed while maintaining IEEE arithmetic compatibility.
10013 This option is not turned on by any @option{-O} option since
10014 it can result in incorrect output for programs that depend on
10015 an exact implementation of IEEE or ISO rules/specifications for
10016 math functions. It may, however, yield faster code for programs
10017 that do not require the guarantees of these specifications.
10019 The default is @option{-fmath-errno}.
10021 On Darwin systems, the math library never sets @code{errno}.  There is
10022 therefore no reason for the compiler to consider the possibility that
10023 it might, and @option{-fno-math-errno} is the default.
10025 @item -funsafe-math-optimizations
10026 @opindex funsafe-math-optimizations
10028 Allow optimizations for floating-point arithmetic that (a) assume
10029 that arguments and results are valid and (b) may violate IEEE or
10030 ANSI standards.  When used at link time, it may include libraries
10031 or startup files that change the default FPU control word or other
10032 similar optimizations.
10034 This option is not turned on by any @option{-O} option since
10035 it can result in incorrect output for programs that depend on
10036 an exact implementation of IEEE or ISO rules/specifications for
10037 math functions. It may, however, yield faster code for programs
10038 that do not require the guarantees of these specifications.
10039 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
10040 @option{-fassociative-math} and @option{-freciprocal-math}.
10042 The default is @option{-fno-unsafe-math-optimizations}.
10044 @item -fassociative-math
10045 @opindex fassociative-math
10047 Allow re-association of operands in series of floating-point operations.
10048 This violates the ISO C and C++ language standard by possibly changing
10049 computation result.  NOTE: re-ordering may change the sign of zero as
10050 well as ignore NaNs and inhibit or create underflow or overflow (and
10051 thus cannot be used on code that relies on rounding behavior like
10052 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
10053 and thus may not be used when ordered comparisons are required.
10054 This option requires that both @option{-fno-signed-zeros} and
10055 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
10056 much sense with @option{-frounding-math}. For Fortran the option
10057 is automatically enabled when both @option{-fno-signed-zeros} and
10058 @option{-fno-trapping-math} are in effect.
10060 The default is @option{-fno-associative-math}.
10062 @item -freciprocal-math
10063 @opindex freciprocal-math
10065 Allow the reciprocal of a value to be used instead of dividing by
10066 the value if this enables optimizations.  For example @code{x / y}
10067 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
10068 is subject to common subexpression elimination.  Note that this loses
10069 precision and increases the number of flops operating on the value.
10071 The default is @option{-fno-reciprocal-math}.
10073 @item -ffinite-math-only
10074 @opindex ffinite-math-only
10075 Allow optimizations for floating-point arithmetic that assume
10076 that arguments and results are not NaNs or +-Infs.
10078 This option is not turned on by any @option{-O} option since
10079 it can result in incorrect output for programs that depend on
10080 an exact implementation of IEEE or ISO rules/specifications for
10081 math functions. It may, however, yield faster code for programs
10082 that do not require the guarantees of these specifications.
10084 The default is @option{-fno-finite-math-only}.
10086 @item -fno-signed-zeros
10087 @opindex fno-signed-zeros
10088 Allow optimizations for floating-point arithmetic that ignore the
10089 signedness of zero.  IEEE arithmetic specifies the behavior of
10090 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
10091 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
10092 This option implies that the sign of a zero result isn't significant.
10094 The default is @option{-fsigned-zeros}.
10096 @item -fno-trapping-math
10097 @opindex fno-trapping-math
10098 Compile code assuming that floating-point operations cannot generate
10099 user-visible traps.  These traps include division by zero, overflow,
10100 underflow, inexact result and invalid operation.  This option requires
10101 that @option{-fno-signaling-nans} be in effect.  Setting this option may
10102 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
10104 This option should never be turned on by any @option{-O} option since
10105 it can result in incorrect output for programs that depend on
10106 an exact implementation of IEEE or ISO rules/specifications for
10107 math functions.
10109 The default is @option{-ftrapping-math}.
10111 @item -frounding-math
10112 @opindex frounding-math
10113 Disable transformations and optimizations that assume default floating-point
10114 rounding behavior.  This is round-to-zero for all floating point
10115 to integer conversions, and round-to-nearest for all other arithmetic
10116 truncations.  This option should be specified for programs that change
10117 the FP rounding mode dynamically, or that may be executed with a
10118 non-default rounding mode.  This option disables constant folding of
10119 floating-point expressions at compile time (which may be affected by
10120 rounding mode) and arithmetic transformations that are unsafe in the
10121 presence of sign-dependent rounding modes.
10123 The default is @option{-fno-rounding-math}.
10125 This option is experimental and does not currently guarantee to
10126 disable all GCC optimizations that are affected by rounding mode.
10127 Future versions of GCC may provide finer control of this setting
10128 using C99's @code{FENV_ACCESS} pragma.  This command-line option
10129 will be used to specify the default state for @code{FENV_ACCESS}.
10131 @item -fsignaling-nans
10132 @opindex fsignaling-nans
10133 Compile code assuming that IEEE signaling NaNs may generate user-visible
10134 traps during floating-point operations.  Setting this option disables
10135 optimizations that may change the number of exceptions visible with
10136 signaling NaNs.  This option implies @option{-ftrapping-math}.
10138 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
10139 be defined.
10141 The default is @option{-fno-signaling-nans}.
10143 This option is experimental and does not currently guarantee to
10144 disable all GCC optimizations that affect signaling NaN behavior.
10146 @item -fno-fp-int-builtin-inexact
10147 @opindex fno-fp-int-builtin-inexact
10148 Do not allow the built-in functions @code{ceil}, @code{floor},
10149 @code{round} and @code{trunc}, and their @code{float} and @code{long
10150 double} variants, to generate code that raises the ``inexact''
10151 floating-point exception for noninteger arguments.  ISO C99 and C11
10152 allow these functions to raise the ``inexact'' exception, but ISO/IEC
10153 TS 18661-1:2014, the C bindings to IEEE 754-2008, does not allow these
10154 functions to do so.
10156 The default is @option{-ffp-int-builtin-inexact}, allowing the
10157 exception to be raised.  This option does nothing unless
10158 @option{-ftrapping-math} is in effect.
10160 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
10161 generate a call to a library function then the ``inexact'' exception
10162 may be raised if the library implementation does not follow TS 18661.
10164 @item -fsingle-precision-constant
10165 @opindex fsingle-precision-constant
10166 Treat floating-point constants as single precision instead of
10167 implicitly converting them to double-precision constants.
10169 @item -fcx-limited-range
10170 @opindex fcx-limited-range
10171 When enabled, this option states that a range reduction step is not
10172 needed when performing complex division.  Also, there is no checking
10173 whether the result of a complex multiplication or division is @code{NaN
10174 + I*NaN}, with an attempt to rescue the situation in that case.  The
10175 default is @option{-fno-cx-limited-range}, but is enabled by
10176 @option{-ffast-math}.
10178 This option controls the default setting of the ISO C99
10179 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
10180 all languages.
10182 @item -fcx-fortran-rules
10183 @opindex fcx-fortran-rules
10184 Complex multiplication and division follow Fortran rules.  Range
10185 reduction is done as part of complex division, but there is no checking
10186 whether the result of a complex multiplication or division is @code{NaN
10187 + I*NaN}, with an attempt to rescue the situation in that case.
10189 The default is @option{-fno-cx-fortran-rules}.
10191 @end table
10193 The following options control optimizations that may improve
10194 performance, but are not enabled by any @option{-O} options.  This
10195 section includes experimental options that may produce broken code.
10197 @table @gcctabopt
10198 @item -fbranch-probabilities
10199 @opindex fbranch-probabilities
10200 After running a program compiled with @option{-fprofile-arcs}
10201 (@pxref{Instrumentation Options}),
10202 you can compile it a second time using
10203 @option{-fbranch-probabilities}, to improve optimizations based on
10204 the number of times each branch was taken.  When a program
10205 compiled with @option{-fprofile-arcs} exits, it saves arc execution
10206 counts to a file called @file{@var{sourcename}.gcda} for each source
10207 file.  The information in this data file is very dependent on the
10208 structure of the generated code, so you must use the same source code
10209 and the same optimization options for both compilations.
10211 With @option{-fbranch-probabilities}, GCC puts a
10212 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
10213 These can be used to improve optimization.  Currently, they are only
10214 used in one place: in @file{reorg.c}, instead of guessing which path a
10215 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
10216 exactly determine which path is taken more often.
10218 @item -fprofile-values
10219 @opindex fprofile-values
10220 If combined with @option{-fprofile-arcs}, it adds code so that some
10221 data about values of expressions in the program is gathered.
10223 With @option{-fbranch-probabilities}, it reads back the data gathered
10224 from profiling values of expressions for usage in optimizations.
10226 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
10228 @item -fprofile-reorder-functions
10229 @opindex fprofile-reorder-functions
10230 Function reordering based on profile instrumentation collects
10231 first time of execution of a function and orders these functions
10232 in ascending order.
10234 Enabled with @option{-fprofile-use}.
10236 @item -fvpt
10237 @opindex fvpt
10238 If combined with @option{-fprofile-arcs}, this option instructs the compiler
10239 to add code to gather information about values of expressions.
10241 With @option{-fbranch-probabilities}, it reads back the data gathered
10242 and actually performs the optimizations based on them.
10243 Currently the optimizations include specialization of division operations
10244 using the knowledge about the value of the denominator.
10246 @item -frename-registers
10247 @opindex frename-registers
10248 Attempt to avoid false dependencies in scheduled code by making use
10249 of registers left over after register allocation.  This optimization
10250 most benefits processors with lots of registers.  Depending on the
10251 debug information format adopted by the target, however, it can
10252 make debugging impossible, since variables no longer stay in
10253 a ``home register''.
10255 Enabled by default with @option{-funroll-loops}.
10257 @item -fschedule-fusion
10258 @opindex fschedule-fusion
10259 Performs a target dependent pass over the instruction stream to schedule
10260 instructions of same type together because target machine can execute them
10261 more efficiently if they are adjacent to each other in the instruction flow.
10263 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10265 @item -ftracer
10266 @opindex ftracer
10267 Perform tail duplication to enlarge superblock size.  This transformation
10268 simplifies the control flow of the function allowing other optimizations to do
10269 a better job.
10271 Enabled with @option{-fprofile-use}.
10273 @item -funroll-loops
10274 @opindex funroll-loops
10275 Unroll loops whose number of iterations can be determined at compile time or
10276 upon entry to the loop.  @option{-funroll-loops} implies
10277 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
10278 It also turns on complete loop peeling (i.e.@: complete removal of loops with
10279 a small constant number of iterations).  This option makes code larger, and may
10280 or may not make it run faster.
10282 Enabled with @option{-fprofile-use}.
10284 @item -funroll-all-loops
10285 @opindex funroll-all-loops
10286 Unroll all loops, even if their number of iterations is uncertain when
10287 the loop is entered.  This usually makes programs run more slowly.
10288 @option{-funroll-all-loops} implies the same options as
10289 @option{-funroll-loops}.
10291 @item -fpeel-loops
10292 @opindex fpeel-loops
10293 Peels loops for which there is enough information that they do not
10294 roll much (from profile feedback or static analysis).  It also turns on
10295 complete loop peeling (i.e.@: complete removal of loops with small constant
10296 number of iterations).
10298 Enabled with @option{-O3} and/or @option{-fprofile-use}.
10300 @item -fmove-loop-invariants
10301 @opindex fmove-loop-invariants
10302 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
10303 at level @option{-O1}
10305 @item -fsplit-loops
10306 @opindex fsplit-loops
10307 Split a loop into two if it contains a condition that's always true
10308 for one side of the iteration space and false for the other.
10310 @item -funswitch-loops
10311 @opindex funswitch-loops
10312 Move branches with loop invariant conditions out of the loop, with duplicates
10313 of the loop on both branches (modified according to result of the condition).
10315 @item -ffunction-sections
10316 @itemx -fdata-sections
10317 @opindex ffunction-sections
10318 @opindex fdata-sections
10319 Place each function or data item into its own section in the output
10320 file if the target supports arbitrary sections.  The name of the
10321 function or the name of the data item determines the section's name
10322 in the output file.
10324 Use these options on systems where the linker can perform optimizations to
10325 improve locality of reference in the instruction space.  Most systems using the
10326 ELF object format have linkers with such optimizations.  On AIX, the linker
10327 rearranges sections (CSECTs) based on the call graph.  The performance impact
10328 varies.
10330 Together with a linker garbage collection (linker @option{--gc-sections}
10331 option) these options may lead to smaller statically-linked executables (after
10332 stripping).
10334 On ELF/DWARF systems these options do not degenerate the quality of the debug
10335 information.  There could be issues with other object files/debug info formats.
10337 Only use these options when there are significant benefits from doing so.  When
10338 you specify these options, the assembler and linker create larger object and
10339 executable files and are also slower.  These options affect code generation.
10340 They prevent optimizations by the compiler and assembler using relative
10341 locations inside a translation unit since the locations are unknown until
10342 link time.  An example of such an optimization is relaxing calls to short call
10343 instructions.
10345 @item -fbranch-target-load-optimize
10346 @opindex fbranch-target-load-optimize
10347 Perform branch target register load optimization before prologue / epilogue
10348 threading.
10349 The use of target registers can typically be exposed only during reload,
10350 thus hoisting loads out of loops and doing inter-block scheduling needs
10351 a separate optimization pass.
10353 @item -fbranch-target-load-optimize2
10354 @opindex fbranch-target-load-optimize2
10355 Perform branch target register load optimization after prologue / epilogue
10356 threading.
10358 @item -fbtr-bb-exclusive
10359 @opindex fbtr-bb-exclusive
10360 When performing branch target register load optimization, don't reuse
10361 branch target registers within any basic block.
10363 @item -fstdarg-opt
10364 @opindex fstdarg-opt
10365 Optimize the prologue of variadic argument functions with respect to usage of
10366 those arguments.
10368 @item -fsection-anchors
10369 @opindex fsection-anchors
10370 Try to reduce the number of symbolic address calculations by using
10371 shared ``anchor'' symbols to address nearby objects.  This transformation
10372 can help to reduce the number of GOT entries and GOT accesses on some
10373 targets.
10375 For example, the implementation of the following function @code{foo}:
10377 @smallexample
10378 static int a, b, c;
10379 int foo (void) @{ return a + b + c; @}
10380 @end smallexample
10382 @noindent
10383 usually calculates the addresses of all three variables, but if you
10384 compile it with @option{-fsection-anchors}, it accesses the variables
10385 from a common anchor point instead.  The effect is similar to the
10386 following pseudocode (which isn't valid C):
10388 @smallexample
10389 int foo (void)
10391   register int *xr = &x;
10392   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
10394 @end smallexample
10396 Not all targets support this option.
10398 @item --param @var{name}=@var{value}
10399 @opindex param
10400 In some places, GCC uses various constants to control the amount of
10401 optimization that is done.  For example, GCC does not inline functions
10402 that contain more than a certain number of instructions.  You can
10403 control some of these constants on the command line using the
10404 @option{--param} option.
10406 The names of specific parameters, and the meaning of the values, are
10407 tied to the internals of the compiler, and are subject to change
10408 without notice in future releases.
10410 In each case, the @var{value} is an integer.  The allowable choices for
10411 @var{name} are:
10413 @table @gcctabopt
10414 @item predictable-branch-outcome
10415 When branch is predicted to be taken with probability lower than this threshold
10416 (in percent), then it is considered well predictable. The default is 10.
10418 @item max-rtl-if-conversion-insns
10419 RTL if-conversion tries to remove conditional branches around a block and
10420 replace them with conditionally executed instructions.  This parameter
10421 gives the maximum number of instructions in a block which should be
10422 considered for if-conversion.  The default is 10, though the compiler will
10423 also use other heuristics to decide whether if-conversion is likely to be
10424 profitable.
10426 @item max-rtl-if-conversion-predictable-cost
10427 @itemx max-rtl-if-conversion-unpredictable-cost
10428 RTL if-conversion will try to remove conditional branches around a block
10429 and replace them with conditionally executed instructions.  These parameters
10430 give the maximum permissible cost for the sequence that would be generated
10431 by if-conversion depending on whether the branch is statically determined
10432 to be predictable or not.  The units for this parameter are the same as
10433 those for the GCC internal seq_cost metric.  The compiler will try to
10434 provide a reasonable default for this parameter using the BRANCH_COST
10435 target macro.
10437 @item max-crossjump-edges
10438 The maximum number of incoming edges to consider for cross-jumping.
10439 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
10440 the number of edges incoming to each block.  Increasing values mean
10441 more aggressive optimization, making the compilation time increase with
10442 probably small improvement in executable size.
10444 @item min-crossjump-insns
10445 The minimum number of instructions that must be matched at the end
10446 of two blocks before cross-jumping is performed on them.  This
10447 value is ignored in the case where all instructions in the block being
10448 cross-jumped from are matched.  The default value is 5.
10450 @item max-grow-copy-bb-insns
10451 The maximum code size expansion factor when copying basic blocks
10452 instead of jumping.  The expansion is relative to a jump instruction.
10453 The default value is 8.
10455 @item max-goto-duplication-insns
10456 The maximum number of instructions to duplicate to a block that jumps
10457 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
10458 passes, GCC factors computed gotos early in the compilation process,
10459 and unfactors them as late as possible.  Only computed jumps at the
10460 end of a basic blocks with no more than max-goto-duplication-insns are
10461 unfactored.  The default value is 8.
10463 @item max-delay-slot-insn-search
10464 The maximum number of instructions to consider when looking for an
10465 instruction to fill a delay slot.  If more than this arbitrary number of
10466 instructions are searched, the time savings from filling the delay slot
10467 are minimal, so stop searching.  Increasing values mean more
10468 aggressive optimization, making the compilation time increase with probably
10469 small improvement in execution time.
10471 @item max-delay-slot-live-search
10472 When trying to fill delay slots, the maximum number of instructions to
10473 consider when searching for a block with valid live register
10474 information.  Increasing this arbitrarily chosen value means more
10475 aggressive optimization, increasing the compilation time.  This parameter
10476 should be removed when the delay slot code is rewritten to maintain the
10477 control-flow graph.
10479 @item max-gcse-memory
10480 The approximate maximum amount of memory that can be allocated in
10481 order to perform the global common subexpression elimination
10482 optimization.  If more memory than specified is required, the
10483 optimization is not done.
10485 @item max-gcse-insertion-ratio
10486 If the ratio of expression insertions to deletions is larger than this value
10487 for any expression, then RTL PRE inserts or removes the expression and thus
10488 leaves partially redundant computations in the instruction stream.  The default value is 20.
10490 @item max-pending-list-length
10491 The maximum number of pending dependencies scheduling allows
10492 before flushing the current state and starting over.  Large functions
10493 with few branches or calls can create excessively large lists which
10494 needlessly consume memory and resources.
10496 @item max-modulo-backtrack-attempts
10497 The maximum number of backtrack attempts the scheduler should make
10498 when modulo scheduling a loop.  Larger values can exponentially increase
10499 compilation time.
10501 @item max-inline-insns-single
10502 Several parameters control the tree inliner used in GCC@.
10503 This number sets the maximum number of instructions (counted in GCC's
10504 internal representation) in a single function that the tree inliner
10505 considers for inlining.  This only affects functions declared
10506 inline and methods implemented in a class declaration (C++).
10507 The default value is 400.
10509 @item max-inline-insns-auto
10510 When you use @option{-finline-functions} (included in @option{-O3}),
10511 a lot of functions that would otherwise not be considered for inlining
10512 by the compiler are investigated.  To those functions, a different
10513 (more restrictive) limit compared to functions declared inline can
10514 be applied.
10515 The default value is 30.
10517 @item inline-min-speedup
10518 When estimated performance improvement of caller + callee runtime exceeds this
10519 threshold (in percent), the function can be inlined regardless of the limit on
10520 @option{--param max-inline-insns-single} and @option{--param
10521 max-inline-insns-auto}.
10522 The default value is 15.
10524 @item large-function-insns
10525 The limit specifying really large functions.  For functions larger than this
10526 limit after inlining, inlining is constrained by
10527 @option{--param large-function-growth}.  This parameter is useful primarily
10528 to avoid extreme compilation time caused by non-linear algorithms used by the
10529 back end.
10530 The default value is 2700.
10532 @item large-function-growth
10533 Specifies maximal growth of large function caused by inlining in percents.
10534 The default value is 100 which limits large function growth to 2.0 times
10535 the original size.
10537 @item large-unit-insns
10538 The limit specifying large translation unit.  Growth caused by inlining of
10539 units larger than this limit is limited by @option{--param inline-unit-growth}.
10540 For small units this might be too tight.
10541 For example, consider a unit consisting of function A
10542 that is inline and B that just calls A three times.  If B is small relative to
10543 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
10544 large units consisting of small inlineable functions, however, the overall unit
10545 growth limit is needed to avoid exponential explosion of code size.  Thus for
10546 smaller units, the size is increased to @option{--param large-unit-insns}
10547 before applying @option{--param inline-unit-growth}.  The default is 10000.
10549 @item inline-unit-growth
10550 Specifies maximal overall growth of the compilation unit caused by inlining.
10551 The default value is 20 which limits unit growth to 1.2 times the original
10552 size. Cold functions (either marked cold via an attribute or by profile
10553 feedback) are not accounted into the unit size.
10555 @item ipcp-unit-growth
10556 Specifies maximal overall growth of the compilation unit caused by
10557 interprocedural constant propagation.  The default value is 10 which limits
10558 unit growth to 1.1 times the original size.
10560 @item large-stack-frame
10561 The limit specifying large stack frames.  While inlining the algorithm is trying
10562 to not grow past this limit too much.  The default value is 256 bytes.
10564 @item large-stack-frame-growth
10565 Specifies maximal growth of large stack frames caused by inlining in percents.
10566 The default value is 1000 which limits large stack frame growth to 11 times
10567 the original size.
10569 @item max-inline-insns-recursive
10570 @itemx max-inline-insns-recursive-auto
10571 Specifies the maximum number of instructions an out-of-line copy of a
10572 self-recursive inline
10573 function can grow into by performing recursive inlining.
10575 @option{--param max-inline-insns-recursive} applies to functions
10576 declared inline.
10577 For functions not declared inline, recursive inlining
10578 happens only when @option{-finline-functions} (included in @option{-O3}) is
10579 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
10580 default value is 450.
10582 @item max-inline-recursive-depth
10583 @itemx max-inline-recursive-depth-auto
10584 Specifies the maximum recursion depth used for recursive inlining.
10586 @option{--param max-inline-recursive-depth} applies to functions
10587 declared inline.  For functions not declared inline, recursive inlining
10588 happens only when @option{-finline-functions} (included in @option{-O3}) is
10589 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
10590 default value is 8.
10592 @item min-inline-recursive-probability
10593 Recursive inlining is profitable only for function having deep recursion
10594 in average and can hurt for function having little recursion depth by
10595 increasing the prologue size or complexity of function body to other
10596 optimizers.
10598 When profile feedback is available (see @option{-fprofile-generate}) the actual
10599 recursion depth can be guessed from the probability that function recurses
10600 via a given call expression.  This parameter limits inlining only to call
10601 expressions whose probability exceeds the given threshold (in percents).
10602 The default value is 10.
10604 @item early-inlining-insns
10605 Specify growth that the early inliner can make.  In effect it increases
10606 the amount of inlining for code having a large abstraction penalty.
10607 The default value is 14.
10609 @item max-early-inliner-iterations
10610 Limit of iterations of the early inliner.  This basically bounds
10611 the number of nested indirect calls the early inliner can resolve.
10612 Deeper chains are still handled by late inlining.
10614 @item comdat-sharing-probability
10615 Probability (in percent) that C++ inline function with comdat visibility
10616 are shared across multiple compilation units.  The default value is 20.
10618 @item profile-func-internal-id
10619 A parameter to control whether to use function internal id in profile
10620 database lookup. If the value is 0, the compiler uses an id that
10621 is based on function assembler name and filename, which makes old profile
10622 data more tolerant to source changes such as function reordering etc.
10623 The default value is 0.
10625 @item min-vect-loop-bound
10626 The minimum number of iterations under which loops are not vectorized
10627 when @option{-ftree-vectorize} is used.  The number of iterations after
10628 vectorization needs to be greater than the value specified by this option
10629 to allow vectorization.  The default value is 0.
10631 @item gcse-cost-distance-ratio
10632 Scaling factor in calculation of maximum distance an expression
10633 can be moved by GCSE optimizations.  This is currently supported only in the
10634 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
10635 is with simple expressions, i.e., the expressions that have cost
10636 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
10637 hoisting of simple expressions.  The default value is 10.
10639 @item gcse-unrestricted-cost
10640 Cost, roughly measured as the cost of a single typical machine
10641 instruction, at which GCSE optimizations do not constrain
10642 the distance an expression can travel.  This is currently
10643 supported only in the code hoisting pass.  The lesser the cost,
10644 the more aggressive code hoisting is.  Specifying 0 
10645 allows all expressions to travel unrestricted distances.
10646 The default value is 3.
10648 @item max-hoist-depth
10649 The depth of search in the dominator tree for expressions to hoist.
10650 This is used to avoid quadratic behavior in hoisting algorithm.
10651 The value of 0 does not limit on the search, but may slow down compilation
10652 of huge functions.  The default value is 30.
10654 @item max-tail-merge-comparisons
10655 The maximum amount of similar bbs to compare a bb with.  This is used to
10656 avoid quadratic behavior in tree tail merging.  The default value is 10.
10658 @item max-tail-merge-iterations
10659 The maximum amount of iterations of the pass over the function.  This is used to
10660 limit compilation time in tree tail merging.  The default value is 2.
10662 @item store-merging-allow-unaligned
10663 Allow the store merging pass to introduce unaligned stores if it is legal to
10664 do so.  The default value is 1.
10666 @item max-stores-to-merge
10667 The maximum number of stores to attempt to merge into wider stores in the store
10668 merging pass.  The minimum value is 2 and the default is 64.
10670 @item max-unrolled-insns
10671 The maximum number of instructions that a loop may have to be unrolled.
10672 If a loop is unrolled, this parameter also determines how many times
10673 the loop code is unrolled.
10675 @item max-average-unrolled-insns
10676 The maximum number of instructions biased by probabilities of their execution
10677 that a loop may have to be unrolled.  If a loop is unrolled,
10678 this parameter also determines how many times the loop code is unrolled.
10680 @item max-unroll-times
10681 The maximum number of unrollings of a single loop.
10683 @item max-peeled-insns
10684 The maximum number of instructions that a loop may have to be peeled.
10685 If a loop is peeled, this parameter also determines how many times
10686 the loop code is peeled.
10688 @item max-peel-times
10689 The maximum number of peelings of a single loop.
10691 @item max-peel-branches
10692 The maximum number of branches on the hot path through the peeled sequence.
10694 @item max-completely-peeled-insns
10695 The maximum number of insns of a completely peeled loop.
10697 @item max-completely-peel-times
10698 The maximum number of iterations of a loop to be suitable for complete peeling.
10700 @item max-completely-peel-loop-nest-depth
10701 The maximum depth of a loop nest suitable for complete peeling.
10703 @item max-unswitch-insns
10704 The maximum number of insns of an unswitched loop.
10706 @item max-unswitch-level
10707 The maximum number of branches unswitched in a single loop.
10709 @item max-loop-headers-insns
10710 The maximum number of insns in loop header duplicated by the copy loop headers
10711 pass.
10713 @item lim-expensive
10714 The minimum cost of an expensive expression in the loop invariant motion.
10716 @item iv-consider-all-candidates-bound
10717 Bound on number of candidates for induction variables, below which
10718 all candidates are considered for each use in induction variable
10719 optimizations.  If there are more candidates than this,
10720 only the most relevant ones are considered to avoid quadratic time complexity.
10722 @item iv-max-considered-uses
10723 The induction variable optimizations give up on loops that contain more
10724 induction variable uses.
10726 @item iv-always-prune-cand-set-bound
10727 If the number of candidates in the set is smaller than this value,
10728 always try to remove unnecessary ivs from the set
10729 when adding a new one.
10731 @item avg-loop-niter
10732 Average number of iterations of a loop.
10734 @item dse-max-object-size
10735 Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
10736 Larger values may result in larger compilation times.
10738 @item dse-max-alias-queries-per-store
10739 Maximum number of queries into the alias oracle per store.
10740 Larger values result in larger compilation times and may result in more
10741 removed dead stores.
10743 @item scev-max-expr-size
10744 Bound on size of expressions used in the scalar evolutions analyzer.
10745 Large expressions slow the analyzer.
10747 @item scev-max-expr-complexity
10748 Bound on the complexity of the expressions in the scalar evolutions analyzer.
10749 Complex expressions slow the analyzer.
10751 @item max-tree-if-conversion-phi-args
10752 Maximum number of arguments in a PHI supported by TREE if conversion
10753 unless the loop is marked with simd pragma.
10755 @item vect-max-version-for-alignment-checks
10756 The maximum number of run-time checks that can be performed when
10757 doing loop versioning for alignment in the vectorizer.
10759 @item vect-max-version-for-alias-checks
10760 The maximum number of run-time checks that can be performed when
10761 doing loop versioning for alias in the vectorizer.
10763 @item vect-max-peeling-for-alignment
10764 The maximum number of loop peels to enhance access alignment
10765 for vectorizer. Value -1 means no limit.
10767 @item max-iterations-to-track
10768 The maximum number of iterations of a loop the brute-force algorithm
10769 for analysis of the number of iterations of the loop tries to evaluate.
10771 @item hot-bb-count-ws-permille
10772 A basic block profile count is considered hot if it contributes to 
10773 the given permillage (i.e. 0...1000) of the entire profiled execution.
10775 @item hot-bb-frequency-fraction
10776 Select fraction of the entry block frequency of executions of basic block in
10777 function given basic block needs to have to be considered hot.
10779 @item max-predicted-iterations
10780 The maximum number of loop iterations we predict statically.  This is useful
10781 in cases where a function contains a single loop with known bound and
10782 another loop with unknown bound.
10783 The known number of iterations is predicted correctly, while
10784 the unknown number of iterations average to roughly 10.  This means that the
10785 loop without bounds appears artificially cold relative to the other one.
10787 @item builtin-expect-probability
10788 Control the probability of the expression having the specified value. This
10789 parameter takes a percentage (i.e. 0 ... 100) as input.
10790 The default probability of 90 is obtained empirically.
10792 @item builtin-string-cmp-inline-length
10793 The maximum length of a constant string for a builtin string cmp call 
10794 eligible for inlining.
10795 The default value is 3.
10797 @item align-threshold
10799 Select fraction of the maximal frequency of executions of a basic block in
10800 a function to align the basic block.
10802 @item align-loop-iterations
10804 A loop expected to iterate at least the selected number of iterations is
10805 aligned.
10807 @item tracer-dynamic-coverage
10808 @itemx tracer-dynamic-coverage-feedback
10810 This value is used to limit superblock formation once the given percentage of
10811 executed instructions is covered.  This limits unnecessary code size
10812 expansion.
10814 The @option{tracer-dynamic-coverage-feedback} parameter
10815 is used only when profile
10816 feedback is available.  The real profiles (as opposed to statically estimated
10817 ones) are much less balanced allowing the threshold to be larger value.
10819 @item tracer-max-code-growth
10820 Stop tail duplication once code growth has reached given percentage.  This is
10821 a rather artificial limit, as most of the duplicates are eliminated later in
10822 cross jumping, so it may be set to much higher values than is the desired code
10823 growth.
10825 @item tracer-min-branch-ratio
10827 Stop reverse growth when the reverse probability of best edge is less than this
10828 threshold (in percent).
10830 @item tracer-min-branch-probability
10831 @itemx tracer-min-branch-probability-feedback
10833 Stop forward growth if the best edge has probability lower than this
10834 threshold.
10836 Similarly to @option{tracer-dynamic-coverage} two parameters are
10837 provided.  @option{tracer-min-branch-probability-feedback} is used for
10838 compilation with profile feedback and @option{tracer-min-branch-probability}
10839 compilation without.  The value for compilation with profile feedback
10840 needs to be more conservative (higher) in order to make tracer
10841 effective.
10843 @item stack-clash-protection-guard-size
10844 Specify the size of the operating system provided stack guard as
10845 2 raised to @var{num} bytes.  The default value is 12 (4096 bytes).
10846 Acceptable values are between 12 and 30.  Higher values may reduce the
10847 number of explicit probes, but a value larger than the operating system
10848 provided guard will leave code vulnerable to stack clash style attacks.
10850 @item stack-clash-protection-probe-interval
10851 Stack clash protection involves probing stack space as it is allocated.  This
10852 param controls the maximum distance between probes into the stack as 2 raised
10853 to @var{num} bytes.  Acceptable values are between 10 and 16 and defaults to
10854 12.  Higher values may reduce the number of explicit probes, but a value
10855 larger than the operating system provided guard will leave code vulnerable to
10856 stack clash style attacks.
10858 @item max-cse-path-length
10860 The maximum number of basic blocks on path that CSE considers.
10861 The default is 10.
10863 @item max-cse-insns
10864 The maximum number of instructions CSE processes before flushing.
10865 The default is 1000.
10867 @item ggc-min-expand
10869 GCC uses a garbage collector to manage its own memory allocation.  This
10870 parameter specifies the minimum percentage by which the garbage
10871 collector's heap should be allowed to expand between collections.
10872 Tuning this may improve compilation speed; it has no effect on code
10873 generation.
10875 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
10876 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
10877 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10878 GCC is not able to calculate RAM on a particular platform, the lower
10879 bound of 30% is used.  Setting this parameter and
10880 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10881 every opportunity.  This is extremely slow, but can be useful for
10882 debugging.
10884 @item ggc-min-heapsize
10886 Minimum size of the garbage collector's heap before it begins bothering
10887 to collect garbage.  The first collection occurs after the heap expands
10888 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10889 tuning this may improve compilation speed, and has no effect on code
10890 generation.
10892 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10893 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10894 with a lower bound of 4096 (four megabytes) and an upper bound of
10895 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10896 particular platform, the lower bound is used.  Setting this parameter
10897 very large effectively disables garbage collection.  Setting this
10898 parameter and @option{ggc-min-expand} to zero causes a full collection
10899 to occur at every opportunity.
10901 @item max-reload-search-insns
10902 The maximum number of instruction reload should look backward for equivalent
10903 register.  Increasing values mean more aggressive optimization, making the
10904 compilation time increase with probably slightly better performance.
10905 The default value is 100.
10907 @item max-cselib-memory-locations
10908 The maximum number of memory locations cselib should take into account.
10909 Increasing values mean more aggressive optimization, making the compilation time
10910 increase with probably slightly better performance.  The default value is 500.
10912 @item max-sched-ready-insns
10913 The maximum number of instructions ready to be issued the scheduler should
10914 consider at any given time during the first scheduling pass.  Increasing
10915 values mean more thorough searches, making the compilation time increase
10916 with probably little benefit.  The default value is 100.
10918 @item max-sched-region-blocks
10919 The maximum number of blocks in a region to be considered for
10920 interblock scheduling.  The default value is 10.
10922 @item max-pipeline-region-blocks
10923 The maximum number of blocks in a region to be considered for
10924 pipelining in the selective scheduler.  The default value is 15.
10926 @item max-sched-region-insns
10927 The maximum number of insns in a region to be considered for
10928 interblock scheduling.  The default value is 100.
10930 @item max-pipeline-region-insns
10931 The maximum number of insns in a region to be considered for
10932 pipelining in the selective scheduler.  The default value is 200.
10934 @item min-spec-prob
10935 The minimum probability (in percents) of reaching a source block
10936 for interblock speculative scheduling.  The default value is 40.
10938 @item max-sched-extend-regions-iters
10939 The maximum number of iterations through CFG to extend regions.
10940 A value of 0 (the default) disables region extensions.
10942 @item max-sched-insn-conflict-delay
10943 The maximum conflict delay for an insn to be considered for speculative motion.
10944 The default value is 3.
10946 @item sched-spec-prob-cutoff
10947 The minimal probability of speculation success (in percents), so that
10948 speculative insns are scheduled.
10949 The default value is 40.
10951 @item sched-state-edge-prob-cutoff
10952 The minimum probability an edge must have for the scheduler to save its
10953 state across it.
10954 The default value is 10.
10956 @item sched-mem-true-dep-cost
10957 Minimal distance (in CPU cycles) between store and load targeting same
10958 memory locations.  The default value is 1.
10960 @item selsched-max-lookahead
10961 The maximum size of the lookahead window of selective scheduling.  It is a
10962 depth of search for available instructions.
10963 The default value is 50.
10965 @item selsched-max-sched-times
10966 The maximum number of times that an instruction is scheduled during
10967 selective scheduling.  This is the limit on the number of iterations
10968 through which the instruction may be pipelined.  The default value is 2.
10970 @item selsched-insns-to-rename
10971 The maximum number of best instructions in the ready list that are considered
10972 for renaming in the selective scheduler.  The default value is 2.
10974 @item sms-min-sc
10975 The minimum value of stage count that swing modulo scheduler
10976 generates.  The default value is 2.
10978 @item max-last-value-rtl
10979 The maximum size measured as number of RTLs that can be recorded in an expression
10980 in combiner for a pseudo register as last known value of that register.  The default
10981 is 10000.
10983 @item max-combine-insns
10984 The maximum number of instructions the RTL combiner tries to combine.
10985 The default value is 2 at @option{-Og} and 4 otherwise.
10987 @item integer-share-limit
10988 Small integer constants can use a shared data structure, reducing the
10989 compiler's memory usage and increasing its speed.  This sets the maximum
10990 value of a shared integer constant.  The default value is 256.
10992 @item ssp-buffer-size
10993 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10994 protection when @option{-fstack-protection} is used.
10996 @item min-size-for-stack-sharing
10997 The minimum size of variables taking part in stack slot sharing when not
10998 optimizing. The default value is 32.
11000 @item max-jump-thread-duplication-stmts
11001 Maximum number of statements allowed in a block that needs to be
11002 duplicated when threading jumps.
11004 @item max-fields-for-field-sensitive
11005 Maximum number of fields in a structure treated in
11006 a field sensitive manner during pointer analysis.  The default is zero
11007 for @option{-O0} and @option{-O1},
11008 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
11010 @item prefetch-latency
11011 Estimate on average number of instructions that are executed before
11012 prefetch finishes.  The distance prefetched ahead is proportional
11013 to this constant.  Increasing this number may also lead to less
11014 streams being prefetched (see @option{simultaneous-prefetches}).
11016 @item simultaneous-prefetches
11017 Maximum number of prefetches that can run at the same time.
11019 @item l1-cache-line-size
11020 The size of cache line in L1 cache, in bytes.
11022 @item l1-cache-size
11023 The size of L1 cache, in kilobytes.
11025 @item l2-cache-size
11026 The size of L2 cache, in kilobytes.
11028 @item prefetch-dynamic-strides
11029 Whether the loop array prefetch pass should issue software prefetch hints
11030 for strides that are non-constant.  In some cases this may be
11031 beneficial, though the fact the stride is non-constant may make it
11032 hard to predict when there is clear benefit to issuing these hints.
11034 Set to 1, the default, if the prefetch hints should be issued for non-constant
11035 strides.  Set to 0 if prefetch hints should be issued only for strides that
11036 are known to be constant and below @option{prefetch-minimum-stride}.
11038 @item prefetch-minimum-stride
11039 Minimum constant stride, in bytes, to start using prefetch hints for.  If
11040 the stride is less than this threshold, prefetch hints will not be issued.
11042 This setting is useful for processors that have hardware prefetchers, in
11043 which case there may be conflicts between the hardware prefetchers and
11044 the software prefetchers.  If the hardware prefetchers have a maximum
11045 stride they can handle, it should be used here to improve the use of
11046 software prefetchers.
11048 A value of -1, the default, means we don't have a threshold and therefore
11049 prefetch hints can be issued for any constant stride.
11051 This setting is only useful for strides that are known and constant.
11053 @item loop-interchange-max-num-stmts
11054 The maximum number of stmts in a loop to be interchanged.
11056 @item loop-interchange-stride-ratio
11057 The minimum ratio between stride of two loops for interchange to be profitable.
11059 @item min-insn-to-prefetch-ratio
11060 The minimum ratio between the number of instructions and the
11061 number of prefetches to enable prefetching in a loop.
11063 @item prefetch-min-insn-to-mem-ratio
11064 The minimum ratio between the number of instructions and the
11065 number of memory references to enable prefetching in a loop.
11067 @item use-canonical-types
11068 Whether the compiler should use the ``canonical'' type system.  By
11069 default, this should always be 1, which uses a more efficient internal
11070 mechanism for comparing types in C++ and Objective-C++.  However, if
11071 bugs in the canonical type system are causing compilation failures,
11072 set this value to 0 to disable canonical types.
11074 @item switch-conversion-max-branch-ratio
11075 Switch initialization conversion refuses to create arrays that are
11076 bigger than @option{switch-conversion-max-branch-ratio} times the number of
11077 branches in the switch.
11079 @item max-partial-antic-length
11080 Maximum length of the partial antic set computed during the tree
11081 partial redundancy elimination optimization (@option{-ftree-pre}) when
11082 optimizing at @option{-O3} and above.  For some sorts of source code
11083 the enhanced partial redundancy elimination optimization can run away,
11084 consuming all of the memory available on the host machine.  This
11085 parameter sets a limit on the length of the sets that are computed,
11086 which prevents the runaway behavior.  Setting a value of 0 for
11087 this parameter allows an unlimited set length.
11089 @item rpo-vn-max-loop-depth
11090 Maximum loop depth that is value-numbered optimistically.  The default
11091 maximum loop depth is three.  When the limit hits the innermost
11092 @var{rpo-vn-max-loop-depth} loops and the outermost loop in the
11093 loop nest are value-numbered optimistically and the remaining ones not.
11094 The default maximum loop depth is seven.
11096 @item sccvn-max-alias-queries-per-access
11097 Maximum number of alias-oracle queries we perform when looking for
11098 redundancies for loads and stores.  If this limit is hit the search
11099 is aborted and the load or store is not considered redundant.  The
11100 number of queries is algorithmically limited to the number of
11101 stores on all paths from the load to the function entry.
11102 The default maximum number of queries is 1000.
11104 @item ira-max-loops-num
11105 IRA uses regional register allocation by default.  If a function
11106 contains more loops than the number given by this parameter, only at most
11107 the given number of the most frequently-executed loops form regions
11108 for regional register allocation.  The default value of the
11109 parameter is 100.
11111 @item ira-max-conflict-table-size 
11112 Although IRA uses a sophisticated algorithm to compress the conflict
11113 table, the table can still require excessive amounts of memory for
11114 huge functions.  If the conflict table for a function could be more
11115 than the size in MB given by this parameter, the register allocator
11116 instead uses a faster, simpler, and lower-quality
11117 algorithm that does not require building a pseudo-register conflict table.  
11118 The default value of the parameter is 2000.
11120 @item ira-loop-reserved-regs
11121 IRA can be used to evaluate more accurate register pressure in loops
11122 for decisions to move loop invariants (see @option{-O3}).  The number
11123 of available registers reserved for some other purposes is given
11124 by this parameter.  The default value of the parameter is 2, which is
11125 the minimal number of registers needed by typical instructions.
11126 This value is the best found from numerous experiments.
11128 @item lra-inheritance-ebb-probability-cutoff
11129 LRA tries to reuse values reloaded in registers in subsequent insns.
11130 This optimization is called inheritance.  EBB is used as a region to
11131 do this optimization.  The parameter defines a minimal fall-through
11132 edge probability in percentage used to add BB to inheritance EBB in
11133 LRA.  The default value of the parameter is 40.  The value was chosen
11134 from numerous runs of SPEC2000 on x86-64.
11136 @item loop-invariant-max-bbs-in-loop
11137 Loop invariant motion can be very expensive, both in compilation time and
11138 in amount of needed compile-time memory, with very large loops.  Loops
11139 with more basic blocks than this parameter won't have loop invariant
11140 motion optimization performed on them.  The default value of the
11141 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
11143 @item loop-max-datarefs-for-datadeps
11144 Building data dependencies is expensive for very large loops.  This
11145 parameter limits the number of data references in loops that are
11146 considered for data dependence analysis.  These large loops are no
11147 handled by the optimizations using loop data dependencies.
11148 The default value is 1000.
11150 @item max-vartrack-size
11151 Sets a maximum number of hash table slots to use during variable
11152 tracking dataflow analysis of any function.  If this limit is exceeded
11153 with variable tracking at assignments enabled, analysis for that
11154 function is retried without it, after removing all debug insns from
11155 the function.  If the limit is exceeded even without debug insns, var
11156 tracking analysis is completely disabled for the function.  Setting
11157 the parameter to zero makes it unlimited.
11159 @item max-vartrack-expr-depth
11160 Sets a maximum number of recursion levels when attempting to map
11161 variable names or debug temporaries to value expressions.  This trades
11162 compilation time for more complete debug information.  If this is set too
11163 low, value expressions that are available and could be represented in
11164 debug information may end up not being used; setting this higher may
11165 enable the compiler to find more complex debug expressions, but compile
11166 time and memory use may grow.  The default is 12.
11168 @item max-debug-marker-count
11169 Sets a threshold on the number of debug markers (e.g. begin stmt
11170 markers) to avoid complexity explosion at inlining or expanding to RTL.
11171 If a function has more such gimple stmts than the set limit, such stmts
11172 will be dropped from the inlined copy of a function, and from its RTL
11173 expansion.  The default is 100000.
11175 @item min-nondebug-insn-uid
11176 Use uids starting at this parameter for nondebug insns.  The range below
11177 the parameter is reserved exclusively for debug insns created by
11178 @option{-fvar-tracking-assignments}, but debug insns may get
11179 (non-overlapping) uids above it if the reserved range is exhausted.
11181 @item ipa-sra-ptr-growth-factor
11182 IPA-SRA replaces a pointer to an aggregate with one or more new
11183 parameters only when their cumulative size is less or equal to
11184 @option{ipa-sra-ptr-growth-factor} times the size of the original
11185 pointer parameter.
11187 @item sra-max-scalarization-size-Ospeed
11188 @itemx sra-max-scalarization-size-Osize
11189 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
11190 replace scalar parts of aggregates with uses of independent scalar
11191 variables.  These parameters control the maximum size, in storage units,
11192 of aggregate which is considered for replacement when compiling for
11193 speed
11194 (@option{sra-max-scalarization-size-Ospeed}) or size
11195 (@option{sra-max-scalarization-size-Osize}) respectively.
11197 @item tm-max-aggregate-size
11198 When making copies of thread-local variables in a transaction, this
11199 parameter specifies the size in bytes after which variables are
11200 saved with the logging functions as opposed to save/restore code
11201 sequence pairs.  This option only applies when using
11202 @option{-fgnu-tm}.
11204 @item graphite-max-nb-scop-params
11205 To avoid exponential effects in the Graphite loop transforms, the
11206 number of parameters in a Static Control Part (SCoP) is bounded.  The
11207 default value is 10 parameters, a value of zero can be used to lift
11208 the bound.  A variable whose value is unknown at compilation time and
11209 defined outside a SCoP is a parameter of the SCoP.
11211 @item loop-block-tile-size
11212 Loop blocking or strip mining transforms, enabled with
11213 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
11214 loop in the loop nest by a given number of iterations.  The strip
11215 length can be changed using the @option{loop-block-tile-size}
11216 parameter.  The default value is 51 iterations.
11218 @item loop-unroll-jam-size
11219 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
11220 default value is 4.
11222 @item loop-unroll-jam-depth
11223 Specify the dimension to be unrolled (counting from the most inner loop)
11224 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
11226 @item ipa-cp-value-list-size
11227 IPA-CP attempts to track all possible values and types passed to a function's
11228 parameter in order to propagate them and perform devirtualization.
11229 @option{ipa-cp-value-list-size} is the maximum number of values and types it
11230 stores per one formal parameter of a function.
11232 @item ipa-cp-eval-threshold
11233 IPA-CP calculates its own score of cloning profitability heuristics
11234 and performs those cloning opportunities with scores that exceed
11235 @option{ipa-cp-eval-threshold}.
11237 @item ipa-cp-recursion-penalty
11238 Percentage penalty the recursive functions will receive when they
11239 are evaluated for cloning.
11241 @item ipa-cp-single-call-penalty
11242 Percentage penalty functions containing a single call to another
11243 function will receive when they are evaluated for cloning.
11246 @item ipa-max-agg-items
11247 IPA-CP is also capable to propagate a number of scalar values passed
11248 in an aggregate. @option{ipa-max-agg-items} controls the maximum
11249 number of such values per one parameter.
11251 @item ipa-cp-loop-hint-bonus
11252 When IPA-CP determines that a cloning candidate would make the number
11253 of iterations of a loop known, it adds a bonus of
11254 @option{ipa-cp-loop-hint-bonus} to the profitability score of
11255 the candidate.
11257 @item ipa-cp-array-index-hint-bonus
11258 When IPA-CP determines that a cloning candidate would make the index of
11259 an array access known, it adds a bonus of
11260 @option{ipa-cp-array-index-hint-bonus} to the profitability
11261 score of the candidate.
11263 @item ipa-max-aa-steps
11264 During its analysis of function bodies, IPA-CP employs alias analysis
11265 in order to track values pointed to by function parameters.  In order
11266 not spend too much time analyzing huge functions, it gives up and
11267 consider all memory clobbered after examining
11268 @option{ipa-max-aa-steps} statements modifying memory.
11270 @item lto-partitions
11271 Specify desired number of partitions produced during WHOPR compilation.
11272 The number of partitions should exceed the number of CPUs used for compilation.
11273 The default value is 32.
11275 @item lto-min-partition
11276 Size of minimal partition for WHOPR (in estimated instructions).
11277 This prevents expenses of splitting very small programs into too many
11278 partitions.
11280 @item lto-max-partition
11281 Size of max partition for WHOPR (in estimated instructions).
11282 to provide an upper bound for individual size of partition.
11283 Meant to be used only with balanced partitioning.
11285 @item cxx-max-namespaces-for-diagnostic-help
11286 The maximum number of namespaces to consult for suggestions when C++
11287 name lookup fails for an identifier.  The default is 1000.
11289 @item sink-frequency-threshold
11290 The maximum relative execution frequency (in percents) of the target block
11291 relative to a statement's original block to allow statement sinking of a
11292 statement.  Larger numbers result in more aggressive statement sinking.
11293 The default value is 75.  A small positive adjustment is applied for
11294 statements with memory operands as those are even more profitable so sink.
11296 @item max-stores-to-sink
11297 The maximum number of conditional store pairs that can be sunk.  Set to 0
11298 if either vectorization (@option{-ftree-vectorize}) or if-conversion
11299 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
11301 @item allow-store-data-races
11302 Allow optimizers to introduce new data races on stores.
11303 Set to 1 to allow, otherwise to 0.  This option is enabled by default
11304 at optimization level @option{-Ofast}.
11306 @item case-values-threshold
11307 The smallest number of different values for which it is best to use a
11308 jump-table instead of a tree of conditional branches.  If the value is
11309 0, use the default for the machine.  The default is 0.
11311 @item tree-reassoc-width
11312 Set the maximum number of instructions executed in parallel in
11313 reassociated tree. This parameter overrides target dependent
11314 heuristics used by default if has non zero value.
11316 @item sched-pressure-algorithm
11317 Choose between the two available implementations of
11318 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
11319 and is the more likely to prevent instructions from being reordered.
11320 Algorithm 2 was designed to be a compromise between the relatively
11321 conservative approach taken by algorithm 1 and the rather aggressive
11322 approach taken by the default scheduler.  It relies more heavily on
11323 having a regular register file and accurate register pressure classes.
11324 See @file{haifa-sched.c} in the GCC sources for more details.
11326 The default choice depends on the target.
11328 @item max-slsr-cand-scan
11329 Set the maximum number of existing candidates that are considered when
11330 seeking a basis for a new straight-line strength reduction candidate.
11332 @item asan-globals
11333 Enable buffer overflow detection for global objects.  This kind
11334 of protection is enabled by default if you are using
11335 @option{-fsanitize=address} option.
11336 To disable global objects protection use @option{--param asan-globals=0}.
11338 @item asan-stack
11339 Enable buffer overflow detection for stack objects.  This kind of
11340 protection is enabled by default when using @option{-fsanitize=address}.
11341 To disable stack protection use @option{--param asan-stack=0} option.
11343 @item asan-instrument-reads
11344 Enable buffer overflow detection for memory reads.  This kind of
11345 protection is enabled by default when using @option{-fsanitize=address}.
11346 To disable memory reads protection use
11347 @option{--param asan-instrument-reads=0}.
11349 @item asan-instrument-writes
11350 Enable buffer overflow detection for memory writes.  This kind of
11351 protection is enabled by default when using @option{-fsanitize=address}.
11352 To disable memory writes protection use
11353 @option{--param asan-instrument-writes=0} option.
11355 @item asan-memintrin
11356 Enable detection for built-in functions.  This kind of protection
11357 is enabled by default when using @option{-fsanitize=address}.
11358 To disable built-in functions protection use
11359 @option{--param asan-memintrin=0}.
11361 @item asan-use-after-return
11362 Enable detection of use-after-return.  This kind of protection
11363 is enabled by default when using the @option{-fsanitize=address} option.
11364 To disable it use @option{--param asan-use-after-return=0}.
11366 Note: By default the check is disabled at run time.  To enable it,
11367 add @code{detect_stack_use_after_return=1} to the environment variable
11368 @env{ASAN_OPTIONS}.
11370 @item asan-instrumentation-with-call-threshold
11371 If number of memory accesses in function being instrumented
11372 is greater or equal to this number, use callbacks instead of inline checks.
11373 E.g. to disable inline code use
11374 @option{--param asan-instrumentation-with-call-threshold=0}.
11376 @item use-after-scope-direct-emission-threshold
11377 If the size of a local variable in bytes is smaller or equal to this
11378 number, directly poison (or unpoison) shadow memory instead of using
11379 run-time callbacks.  The default value is 256.
11381 @item max-fsm-thread-path-insns
11382 Maximum number of instructions to copy when duplicating blocks on a
11383 finite state automaton jump thread path.  The default is 100.
11385 @item max-fsm-thread-length
11386 Maximum number of basic blocks on a finite state automaton jump thread
11387 path.  The default is 10.
11389 @item max-fsm-thread-paths
11390 Maximum number of new jump thread paths to create for a finite state
11391 automaton.  The default is 50.
11393 @item parloops-chunk-size
11394 Chunk size of omp schedule for loops parallelized by parloops.  The default
11395 is 0.
11397 @item parloops-schedule
11398 Schedule type of omp schedule for loops parallelized by parloops (static,
11399 dynamic, guided, auto, runtime).  The default is static.
11401 @item parloops-min-per-thread
11402 The minimum number of iterations per thread of an innermost parallelized
11403 loop for which the parallelized variant is prefered over the single threaded
11404 one.  The default is 100.  Note that for a parallelized loop nest the
11405 minimum number of iterations of the outermost loop per thread is two.
11407 @item max-ssa-name-query-depth
11408 Maximum depth of recursion when querying properties of SSA names in things
11409 like fold routines.  One level of recursion corresponds to following a
11410 use-def chain.
11412 @item hsa-gen-debug-stores
11413 Enable emission of special debug stores within HSA kernels which are
11414 then read and reported by libgomp plugin.  Generation of these stores
11415 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
11416 enable it.
11418 @item max-speculative-devirt-maydefs
11419 The maximum number of may-defs we analyze when looking for a must-def
11420 specifying the dynamic type of an object that invokes a virtual call
11421 we may be able to devirtualize speculatively.
11423 @item max-vrp-switch-assertions
11424 The maximum number of assertions to add along the default edge of a switch
11425 statement during VRP.  The default is 10.
11427 @item unroll-jam-min-percent
11428 The minimum percentage of memory references that must be optimized
11429 away for the unroll-and-jam transformation to be considered profitable.
11431 @item unroll-jam-max-unroll
11432 The maximum number of times the outer loop should be unrolled by
11433 the unroll-and-jam transformation.
11434 @end table
11435 @end table
11437 @node Instrumentation Options
11438 @section Program Instrumentation Options
11439 @cindex instrumentation options
11440 @cindex program instrumentation options
11441 @cindex run-time error checking options
11442 @cindex profiling options
11443 @cindex options, program instrumentation
11444 @cindex options, run-time error checking
11445 @cindex options, profiling
11447 GCC supports a number of command-line options that control adding
11448 run-time instrumentation to the code it normally generates.  
11449 For example, one purpose of instrumentation is collect profiling
11450 statistics for use in finding program hot spots, code coverage
11451 analysis, or profile-guided optimizations.
11452 Another class of program instrumentation is adding run-time checking 
11453 to detect programming errors like invalid pointer
11454 dereferences or out-of-bounds array accesses, as well as deliberately
11455 hostile attacks such as stack smashing or C++ vtable hijacking.
11456 There is also a general hook which can be used to implement other
11457 forms of tracing or function-level instrumentation for debug or
11458 program analysis purposes.
11460 @table @gcctabopt
11461 @cindex @command{prof}
11462 @item -p
11463 @opindex p
11464 Generate extra code to write profile information suitable for the
11465 analysis program @command{prof}.  You must use this option when compiling
11466 the source files you want data about, and you must also use it when
11467 linking.
11469 @cindex @command{gprof}
11470 @item -pg
11471 @opindex pg
11472 Generate extra code to write profile information suitable for the
11473 analysis program @command{gprof}.  You must use this option when compiling
11474 the source files you want data about, and you must also use it when
11475 linking.
11477 @item -fprofile-arcs
11478 @opindex fprofile-arcs
11479 Add code so that program flow @dfn{arcs} are instrumented.  During
11480 execution the program records how many times each branch and call is
11481 executed and how many times it is taken or returns.  On targets that support
11482 constructors with priority support, profiling properly handles constructors,
11483 destructors and C++ constructors (and destructors) of classes which are used
11484 as a type of a global variable.
11486 When the compiled
11487 program exits it saves this data to a file called
11488 @file{@var{auxname}.gcda} for each source file.  The data may be used for
11489 profile-directed optimizations (@option{-fbranch-probabilities}), or for
11490 test coverage analysis (@option{-ftest-coverage}).  Each object file's
11491 @var{auxname} is generated from the name of the output file, if
11492 explicitly specified and it is not the final executable, otherwise it is
11493 the basename of the source file.  In both cases any suffix is removed
11494 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
11495 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
11496 @xref{Cross-profiling}.
11498 @cindex @command{gcov}
11499 @item --coverage
11500 @opindex coverage
11502 This option is used to compile and link code instrumented for coverage
11503 analysis.  The option is a synonym for @option{-fprofile-arcs}
11504 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
11505 linking).  See the documentation for those options for more details.
11507 @itemize
11509 @item
11510 Compile the source files with @option{-fprofile-arcs} plus optimization
11511 and code generation options.  For test coverage analysis, use the
11512 additional @option{-ftest-coverage} option.  You do not need to profile
11513 every source file in a program.
11515 @item
11516 Compile the source files additionally with @option{-fprofile-abs-path}
11517 to create absolute path names in the @file{.gcno} files.  This allows
11518 @command{gcov} to find the correct sources in projects where compilations
11519 occur with different working directories.
11521 @item
11522 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
11523 (the latter implies the former).
11525 @item
11526 Run the program on a representative workload to generate the arc profile
11527 information.  This may be repeated any number of times.  You can run
11528 concurrent instances of your program, and provided that the file system
11529 supports locking, the data files will be correctly updated.  Unless
11530 a strict ISO C dialect option is in effect, @code{fork} calls are
11531 detected and correctly handled without double counting.
11533 @item
11534 For profile-directed optimizations, compile the source files again with
11535 the same optimization and code generation options plus
11536 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
11537 Control Optimization}).
11539 @item
11540 For test coverage analysis, use @command{gcov} to produce human readable
11541 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
11542 @command{gcov} documentation for further information.
11544 @end itemize
11546 With @option{-fprofile-arcs}, for each function of your program GCC
11547 creates a program flow graph, then finds a spanning tree for the graph.
11548 Only arcs that are not on the spanning tree have to be instrumented: the
11549 compiler adds code to count the number of times that these arcs are
11550 executed.  When an arc is the only exit or only entrance to a block, the
11551 instrumentation code can be added to the block; otherwise, a new basic
11552 block must be created to hold the instrumentation code.
11554 @need 2000
11555 @item -ftest-coverage
11556 @opindex ftest-coverage
11557 Produce a notes file that the @command{gcov} code-coverage utility
11558 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
11559 show program coverage.  Each source file's note file is called
11560 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
11561 above for a description of @var{auxname} and instructions on how to
11562 generate test coverage data.  Coverage data matches the source files
11563 more closely if you do not optimize.
11565 @item -fprofile-abs-path
11566 @opindex fprofile-abs-path
11567 Automatically convert relative source file names to absolute path names
11568 in the @file{.gcno} files.  This allows @command{gcov} to find the correct
11569 sources in projects where compilations occur with different working
11570 directories.
11572 @item -fprofile-dir=@var{path}
11573 @opindex fprofile-dir
11575 Set the directory to search for the profile data files in to @var{path}.
11576 This option affects only the profile data generated by
11577 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
11578 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
11579 and its related options.  Both absolute and relative paths can be used.
11580 By default, GCC uses the current directory as @var{path}, thus the
11581 profile data file appears in the same directory as the object file.
11582 In order to prevent the file name clashing, if the object file name is
11583 not an absolute path, we mangle the absolute path of the
11584 @file{@var{sourcename}.gcda} file and use it as the file name of a
11585 @file{.gcda} file.
11587 When an executable is run in a massive parallel environment, it is recommended
11588 to save profile to different folders.  That can be done with variables
11589 in @var{path} that are exported during run-time:
11591 @table @gcctabopt
11593 @item %p
11594 process ID.
11596 @item %q@{VAR@}
11597 value of environment variable @var{VAR}
11599 @end table
11601 @item -fprofile-generate
11602 @itemx -fprofile-generate=@var{path}
11603 @opindex fprofile-generate
11605 Enable options usually used for instrumenting application to produce
11606 profile useful for later recompilation with profile feedback based
11607 optimization.  You must use @option{-fprofile-generate} both when
11608 compiling and when linking your program.
11610 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
11612 If @var{path} is specified, GCC looks at the @var{path} to find
11613 the profile feedback data files. See @option{-fprofile-dir}.
11615 To optimize the program based on the collected profile information, use
11616 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
11618 @item -fprofile-update=@var{method}
11619 @opindex fprofile-update
11621 Alter the update method for an application instrumented for profile
11622 feedback based optimization.  The @var{method} argument should be one of
11623 @samp{single}, @samp{atomic} or @samp{prefer-atomic}.
11624 The first one is useful for single-threaded applications,
11625 while the second one prevents profile corruption by emitting thread-safe code.
11627 @strong{Warning:} When an application does not properly join all threads
11628 (or creates an detached thread), a profile file can be still corrupted.
11630 Using @samp{prefer-atomic} would be transformed either to @samp{atomic},
11631 when supported by a target, or to @samp{single} otherwise.  The GCC driver
11632 automatically selects @samp{prefer-atomic} when @option{-pthread}
11633 is present in the command line.
11635 @item -fsanitize=address
11636 @opindex fsanitize=address
11637 Enable AddressSanitizer, a fast memory error detector.
11638 Memory access instructions are instrumented to detect
11639 out-of-bounds and use-after-free bugs.
11640 The option enables @option{-fsanitize-address-use-after-scope}.
11641 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
11642 more details.  The run-time behavior can be influenced using the
11643 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
11644 the available options are shown at startup of the instrumented program.  See
11645 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
11646 for a list of supported options.
11647 The option cannot be combined with @option{-fsanitize=thread}.
11649 @item -fsanitize=kernel-address
11650 @opindex fsanitize=kernel-address
11651 Enable AddressSanitizer for Linux kernel.
11652 See @uref{https://github.com/google/kasan/wiki} for more details.
11654 @item -fsanitize=pointer-compare
11655 @opindex fsanitize=pointer-compare
11656 Instrument comparison operation (<, <=, >, >=) with pointer operands.
11657 The option must be combined with either @option{-fsanitize=kernel-address} or
11658 @option{-fsanitize=address}
11659 The option cannot be combined with @option{-fsanitize=thread}.
11660 Note: By default the check is disabled at run time.  To enable it,
11661 add @code{detect_invalid_pointer_pairs=2} to the environment variable
11662 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
11663 invalid operation only when both pointers are non-null.
11665 @item -fsanitize=pointer-subtract
11666 @opindex fsanitize=pointer-subtract
11667 Instrument subtraction with pointer operands.
11668 The option must be combined with either @option{-fsanitize=kernel-address} or
11669 @option{-fsanitize=address}
11670 The option cannot be combined with @option{-fsanitize=thread}.
11671 Note: By default the check is disabled at run time.  To enable it,
11672 add @code{detect_invalid_pointer_pairs=2} to the environment variable
11673 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
11674 invalid operation only when both pointers are non-null.
11676 @item -fsanitize=thread
11677 @opindex fsanitize=thread
11678 Enable ThreadSanitizer, a fast data race detector.
11679 Memory access instructions are instrumented to detect
11680 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
11681 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
11682 environment variable; see
11683 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
11684 supported options.
11685 The option cannot be combined with @option{-fsanitize=address},
11686 @option{-fsanitize=leak}.
11688 Note that sanitized atomic builtins cannot throw exceptions when
11689 operating on invalid memory addresses with non-call exceptions
11690 (@option{-fnon-call-exceptions}).
11692 @item -fsanitize=leak
11693 @opindex fsanitize=leak
11694 Enable LeakSanitizer, a memory leak detector.
11695 This option only matters for linking of executables and
11696 the executable is linked against a library that overrides @code{malloc}
11697 and other allocator functions.  See
11698 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
11699 details.  The run-time behavior can be influenced using the
11700 @env{LSAN_OPTIONS} environment variable.
11701 The option cannot be combined with @option{-fsanitize=thread}.
11703 @item -fsanitize=undefined
11704 @opindex fsanitize=undefined
11705 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
11706 Various computations are instrumented to detect undefined behavior
11707 at runtime.  Current suboptions are:
11709 @table @gcctabopt
11711 @item -fsanitize=shift
11712 @opindex fsanitize=shift
11713 This option enables checking that the result of a shift operation is
11714 not undefined.  Note that what exactly is considered undefined differs
11715 slightly between C and C++, as well as between ISO C90 and C99, etc.
11716 This option has two suboptions, @option{-fsanitize=shift-base} and
11717 @option{-fsanitize=shift-exponent}.
11719 @item -fsanitize=shift-exponent
11720 @opindex fsanitize=shift-exponent
11721 This option enables checking that the second argument of a shift operation
11722 is not negative and is smaller than the precision of the promoted first
11723 argument.
11725 @item -fsanitize=shift-base
11726 @opindex fsanitize=shift-base
11727 If the second argument of a shift operation is within range, check that the
11728 result of a shift operation is not undefined.  Note that what exactly is
11729 considered undefined differs slightly between C and C++, as well as between
11730 ISO C90 and C99, etc.
11732 @item -fsanitize=integer-divide-by-zero
11733 @opindex fsanitize=integer-divide-by-zero
11734 Detect integer division by zero as well as @code{INT_MIN / -1} division.
11736 @item -fsanitize=unreachable
11737 @opindex fsanitize=unreachable
11738 With this option, the compiler turns the @code{__builtin_unreachable}
11739 call into a diagnostics message call instead.  When reaching the
11740 @code{__builtin_unreachable} call, the behavior is undefined.
11742 @item -fsanitize=vla-bound
11743 @opindex fsanitize=vla-bound
11744 This option instructs the compiler to check that the size of a variable
11745 length array is positive.
11747 @item -fsanitize=null
11748 @opindex fsanitize=null
11749 This option enables pointer checking.  Particularly, the application
11750 built with this option turned on will issue an error message when it
11751 tries to dereference a NULL pointer, or if a reference (possibly an
11752 rvalue reference) is bound to a NULL pointer, or if a method is invoked
11753 on an object pointed by a NULL pointer.
11755 @item -fsanitize=return
11756 @opindex fsanitize=return
11757 This option enables return statement checking.  Programs
11758 built with this option turned on will issue an error message
11759 when the end of a non-void function is reached without actually
11760 returning a value.  This option works in C++ only.
11762 @item -fsanitize=signed-integer-overflow
11763 @opindex fsanitize=signed-integer-overflow
11764 This option enables signed integer overflow checking.  We check that
11765 the result of @code{+}, @code{*}, and both unary and binary @code{-}
11766 does not overflow in the signed arithmetics.  Note, integer promotion
11767 rules must be taken into account.  That is, the following is not an
11768 overflow:
11769 @smallexample
11770 signed char a = SCHAR_MAX;
11771 a++;
11772 @end smallexample
11774 @item -fsanitize=bounds
11775 @opindex fsanitize=bounds
11776 This option enables instrumentation of array bounds.  Various out of bounds
11777 accesses are detected.  Flexible array members, flexible array member-like
11778 arrays, and initializers of variables with static storage are not instrumented.
11780 @item -fsanitize=bounds-strict
11781 @opindex fsanitize=bounds-strict
11782 This option enables strict instrumentation of array bounds.  Most out of bounds
11783 accesses are detected, including flexible array members and flexible array
11784 member-like arrays.  Initializers of variables with static storage are not
11785 instrumented.
11787 @item -fsanitize=alignment
11788 @opindex fsanitize=alignment
11790 This option enables checking of alignment of pointers when they are
11791 dereferenced, or when a reference is bound to insufficiently aligned target,
11792 or when a method or constructor is invoked on insufficiently aligned object.
11794 @item -fsanitize=object-size
11795 @opindex fsanitize=object-size
11796 This option enables instrumentation of memory references using the
11797 @code{__builtin_object_size} function.  Various out of bounds pointer
11798 accesses are detected.
11800 @item -fsanitize=float-divide-by-zero
11801 @opindex fsanitize=float-divide-by-zero
11802 Detect floating-point division by zero.  Unlike other similar options,
11803 @option{-fsanitize=float-divide-by-zero} is not enabled by
11804 @option{-fsanitize=undefined}, since floating-point division by zero can
11805 be a legitimate way of obtaining infinities and NaNs.
11807 @item -fsanitize=float-cast-overflow
11808 @opindex fsanitize=float-cast-overflow
11809 This option enables floating-point type to integer conversion checking.
11810 We check that the result of the conversion does not overflow.
11811 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
11812 not enabled by @option{-fsanitize=undefined}.
11813 This option does not work well with @code{FE_INVALID} exceptions enabled.
11815 @item -fsanitize=nonnull-attribute
11816 @opindex fsanitize=nonnull-attribute
11818 This option enables instrumentation of calls, checking whether null values
11819 are not passed to arguments marked as requiring a non-null value by the
11820 @code{nonnull} function attribute.
11822 @item -fsanitize=returns-nonnull-attribute
11823 @opindex fsanitize=returns-nonnull-attribute
11825 This option enables instrumentation of return statements in functions
11826 marked with @code{returns_nonnull} function attribute, to detect returning
11827 of null values from such functions.
11829 @item -fsanitize=bool
11830 @opindex fsanitize=bool
11832 This option enables instrumentation of loads from bool.  If a value other
11833 than 0/1 is loaded, a run-time error is issued.
11835 @item -fsanitize=enum
11836 @opindex fsanitize=enum
11838 This option enables instrumentation of loads from an enum type.  If
11839 a value outside the range of values for the enum type is loaded,
11840 a run-time error is issued.
11842 @item -fsanitize=vptr
11843 @opindex fsanitize=vptr
11845 This option enables instrumentation of C++ member function calls, member
11846 accesses and some conversions between pointers to base and derived classes,
11847 to verify the referenced object has the correct dynamic type.
11849 @item -fsanitize=pointer-overflow
11850 @opindex fsanitize=pointer-overflow
11852 This option enables instrumentation of pointer arithmetics.  If the pointer
11853 arithmetics overflows, a run-time error is issued.
11855 @item -fsanitize=builtin
11856 @opindex fsanitize=builtin
11858 This option enables instrumentation of arguments to selected builtin
11859 functions.  If an invalid value is passed to such arguments, a run-time
11860 error is issued.  E.g.@ passing 0 as the argument to @code{__builtin_ctz}
11861 or @code{__builtin_clz} invokes undefined behavior and is diagnosed
11862 by this option.
11864 @end table
11866 While @option{-ftrapv} causes traps for signed overflows to be emitted,
11867 @option{-fsanitize=undefined} gives a diagnostic message.
11868 This currently works only for the C family of languages.
11870 @item -fno-sanitize=all
11871 @opindex fno-sanitize=all
11873 This option disables all previously enabled sanitizers.
11874 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
11875 together.
11877 @item -fasan-shadow-offset=@var{number}
11878 @opindex fasan-shadow-offset
11879 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
11880 It is useful for experimenting with different shadow memory layouts in
11881 Kernel AddressSanitizer.
11883 @item -fsanitize-sections=@var{s1},@var{s2},...
11884 @opindex fsanitize-sections
11885 Sanitize global variables in selected user-defined sections.  @var{si} may
11886 contain wildcards.
11888 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
11889 @opindex fsanitize-recover
11890 @opindex fno-sanitize-recover
11891 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
11892 mentioned in comma-separated list of @var{opts}.  Enabling this option
11893 for a sanitizer component causes it to attempt to continue
11894 running the program as if no error happened.  This means multiple
11895 runtime errors can be reported in a single program run, and the exit
11896 code of the program may indicate success even when errors
11897 have been reported.  The @option{-fno-sanitize-recover=} option
11898 can be used to alter
11899 this behavior: only the first detected error is reported
11900 and program then exits with a non-zero exit code.
11902 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
11903 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
11904 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
11905 @option{-fsanitize=bounds-strict},
11906 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
11907 For these sanitizers error recovery is turned on by default,
11908 except @option{-fsanitize=address}, for which this feature is experimental.
11909 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
11910 accepted, the former enables recovery for all sanitizers that support it,
11911 the latter disables recovery for all sanitizers that support it.
11913 Even if a recovery mode is turned on the compiler side, it needs to be also
11914 enabled on the runtime library side, otherwise the failures are still fatal.
11915 The runtime library defaults to @code{halt_on_error=0} for
11916 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
11917 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
11918 setting the @code{halt_on_error} flag in the corresponding environment variable.
11920 Syntax without an explicit @var{opts} parameter is deprecated.  It is
11921 equivalent to specifying an @var{opts} list of:
11923 @smallexample
11924 undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
11925 @end smallexample
11927 @item -fsanitize-address-use-after-scope
11928 @opindex fsanitize-address-use-after-scope
11929 Enable sanitization of local variables to detect use-after-scope bugs.
11930 The option sets @option{-fstack-reuse} to @samp{none}.
11932 @item -fsanitize-undefined-trap-on-error
11933 @opindex fsanitize-undefined-trap-on-error
11934 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
11935 report undefined behavior using @code{__builtin_trap} rather than
11936 a @code{libubsan} library routine.  The advantage of this is that the
11937 @code{libubsan} library is not needed and is not linked in, so this
11938 is usable even in freestanding environments.
11940 @item -fsanitize-coverage=trace-pc
11941 @opindex fsanitize-coverage=trace-pc
11942 Enable coverage-guided fuzzing code instrumentation.
11943 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
11945 @item -fsanitize-coverage=trace-cmp
11946 @opindex fsanitize-coverage=trace-cmp
11947 Enable dataflow guided fuzzing code instrumentation.
11948 Inserts a call to @code{__sanitizer_cov_trace_cmp1},
11949 @code{__sanitizer_cov_trace_cmp2}, @code{__sanitizer_cov_trace_cmp4} or
11950 @code{__sanitizer_cov_trace_cmp8} for integral comparison with both operands
11951 variable or @code{__sanitizer_cov_trace_const_cmp1},
11952 @code{__sanitizer_cov_trace_const_cmp2},
11953 @code{__sanitizer_cov_trace_const_cmp4} or
11954 @code{__sanitizer_cov_trace_const_cmp8} for integral comparison with one
11955 operand constant, @code{__sanitizer_cov_trace_cmpf} or
11956 @code{__sanitizer_cov_trace_cmpd} for float or double comparisons and
11957 @code{__sanitizer_cov_trace_switch} for switch statements.
11959 @item -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]}
11960 @opindex fcf-protection
11961 Enable code instrumentation of control-flow transfers to increase
11962 program security by checking that target addresses of control-flow
11963 transfer instructions (such as indirect function call, function return,
11964 indirect jump) are valid.  This prevents diverting the flow of control
11965 to an unexpected target.  This is intended to protect against such
11966 threats as Return-oriented Programming (ROP), and similarly
11967 call/jmp-oriented programming (COP/JOP).
11969 The value @code{branch} tells the compiler to implement checking of
11970 validity of control-flow transfer at the point of indirect branch
11971 instructions, i.e. call/jmp instructions.  The value @code{return}
11972 implements checking of validity at the point of returning from a
11973 function.  The value @code{full} is an alias for specifying both
11974 @code{branch} and @code{return}. The value @code{none} turns off
11975 instrumentation.
11977 The macro @code{__CET__} is defined when @option{-fcf-protection} is
11978 used.  The first bit of @code{__CET__} is set to 1 for the value
11979 @code{branch} and the second bit of @code{__CET__} is set to 1 for
11980 the @code{return}.
11982 You can also use the @code{nocf_check} attribute to identify
11983 which functions and calls should be skipped from instrumentation
11984 (@pxref{Function Attributes}).
11986 Currently the x86 GNU/Linux target provides an implementation based
11987 on Intel Control-flow Enforcement Technology (CET).
11989 @item -fstack-protector
11990 @opindex fstack-protector
11991 Emit extra code to check for buffer overflows, such as stack smashing
11992 attacks.  This is done by adding a guard variable to functions with
11993 vulnerable objects.  This includes functions that call @code{alloca}, and
11994 functions with buffers larger than 8 bytes.  The guards are initialized
11995 when a function is entered and then checked when the function exits.
11996 If a guard check fails, an error message is printed and the program exits.
11998 @item -fstack-protector-all
11999 @opindex fstack-protector-all
12000 Like @option{-fstack-protector} except that all functions are protected.
12002 @item -fstack-protector-strong
12003 @opindex fstack-protector-strong
12004 Like @option{-fstack-protector} but includes additional functions to
12005 be protected --- those that have local array definitions, or have
12006 references to local frame addresses.
12008 @item -fstack-protector-explicit
12009 @opindex fstack-protector-explicit
12010 Like @option{-fstack-protector} but only protects those functions which
12011 have the @code{stack_protect} attribute.
12013 @item -fstack-check
12014 @opindex fstack-check
12015 Generate code to verify that you do not go beyond the boundary of the
12016 stack.  You should specify this flag if you are running in an
12017 environment with multiple threads, but you only rarely need to specify it in
12018 a single-threaded environment since stack overflow is automatically
12019 detected on nearly all systems if there is only one stack.
12021 Note that this switch does not actually cause checking to be done; the
12022 operating system or the language runtime must do that.  The switch causes
12023 generation of code to ensure that they see the stack being extended.
12025 You can additionally specify a string parameter: @samp{no} means no
12026 checking, @samp{generic} means force the use of old-style checking,
12027 @samp{specific} means use the best checking method and is equivalent
12028 to bare @option{-fstack-check}.
12030 Old-style checking is a generic mechanism that requires no specific
12031 target support in the compiler but comes with the following drawbacks:
12033 @enumerate
12034 @item
12035 Modified allocation strategy for large objects: they are always
12036 allocated dynamically if their size exceeds a fixed threshold.  Note this
12037 may change the semantics of some code.
12039 @item
12040 Fixed limit on the size of the static frame of functions: when it is
12041 topped by a particular function, stack checking is not reliable and
12042 a warning is issued by the compiler.
12044 @item
12045 Inefficiency: because of both the modified allocation strategy and the
12046 generic implementation, code performance is hampered.
12047 @end enumerate
12049 Note that old-style stack checking is also the fallback method for
12050 @samp{specific} if no target support has been added in the compiler.
12052 @samp{-fstack-check=} is designed for Ada's needs to detect infinite recursion
12053 and stack overflows.  @samp{specific} is an excellent choice when compiling
12054 Ada code.  It is not generally sufficient to protect against stack-clash
12055 attacks.  To protect against those you want @samp{-fstack-clash-protection}.
12057 @item -fstack-clash-protection
12058 @opindex fstack-clash-protection
12059 Generate code to prevent stack clash style attacks.  When this option is
12060 enabled, the compiler will only allocate one page of stack space at a time
12061 and each page is accessed immediately after allocation.  Thus, it prevents
12062 allocations from jumping over any stack guard page provided by the
12063 operating system.
12065 Most targets do not fully support stack clash protection.  However, on
12066 those targets @option{-fstack-clash-protection} will protect dynamic stack
12067 allocations.  @option{-fstack-clash-protection} may also provide limited
12068 protection for static stack allocations if the target supports
12069 @option{-fstack-check=specific}.
12071 @item -fstack-limit-register=@var{reg}
12072 @itemx -fstack-limit-symbol=@var{sym}
12073 @itemx -fno-stack-limit
12074 @opindex fstack-limit-register
12075 @opindex fstack-limit-symbol
12076 @opindex fno-stack-limit
12077 Generate code to ensure that the stack does not grow beyond a certain value,
12078 either the value of a register or the address of a symbol.  If a larger
12079 stack is required, a signal is raised at run time.  For most targets,
12080 the signal is raised before the stack overruns the boundary, so
12081 it is possible to catch the signal without taking special precautions.
12083 For instance, if the stack starts at absolute address @samp{0x80000000}
12084 and grows downwards, you can use the flags
12085 @option{-fstack-limit-symbol=__stack_limit} and
12086 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
12087 of 128KB@.  Note that this may only work with the GNU linker.
12089 You can locally override stack limit checking by using the
12090 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
12092 @item -fsplit-stack
12093 @opindex fsplit-stack
12094 Generate code to automatically split the stack before it overflows.
12095 The resulting program has a discontiguous stack which can only
12096 overflow if the program is unable to allocate any more memory.  This
12097 is most useful when running threaded programs, as it is no longer
12098 necessary to calculate a good stack size to use for each thread.  This
12099 is currently only implemented for the x86 targets running
12100 GNU/Linux.
12102 When code compiled with @option{-fsplit-stack} calls code compiled
12103 without @option{-fsplit-stack}, there may not be much stack space
12104 available for the latter code to run.  If compiling all code,
12105 including library code, with @option{-fsplit-stack} is not an option,
12106 then the linker can fix up these calls so that the code compiled
12107 without @option{-fsplit-stack} always has a large stack.  Support for
12108 this is implemented in the gold linker in GNU binutils release 2.21
12109 and later.
12111 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
12112 @opindex fvtable-verify
12113 This option is only available when compiling C++ code.
12114 It turns on (or off, if using @option{-fvtable-verify=none}) the security
12115 feature that verifies at run time, for every virtual call, that
12116 the vtable pointer through which the call is made is valid for the type of
12117 the object, and has not been corrupted or overwritten.  If an invalid vtable
12118 pointer is detected at run time, an error is reported and execution of the
12119 program is immediately halted.
12121 This option causes run-time data structures to be built at program startup,
12122 which are used for verifying the vtable pointers.  
12123 The options @samp{std} and @samp{preinit}
12124 control the timing of when these data structures are built.  In both cases the
12125 data structures are built before execution reaches @code{main}.  Using
12126 @option{-fvtable-verify=std} causes the data structures to be built after
12127 shared libraries have been loaded and initialized.
12128 @option{-fvtable-verify=preinit} causes them to be built before shared
12129 libraries have been loaded and initialized.
12131 If this option appears multiple times in the command line with different
12132 values specified, @samp{none} takes highest priority over both @samp{std} and
12133 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
12135 @item -fvtv-debug
12136 @opindex fvtv-debug
12137 When used in conjunction with @option{-fvtable-verify=std} or 
12138 @option{-fvtable-verify=preinit}, causes debug versions of the 
12139 runtime functions for the vtable verification feature to be called.  
12140 This flag also causes the compiler to log information about which 
12141 vtable pointers it finds for each class.
12142 This information is written to a file named @file{vtv_set_ptr_data.log} 
12143 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
12144 if that is defined or the current working directory otherwise.
12146 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
12147 file, be sure to delete any existing one.
12149 @item -fvtv-counts
12150 @opindex fvtv-counts
12151 This is a debugging flag.  When used in conjunction with
12152 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
12153 causes the compiler to keep track of the total number of virtual calls
12154 it encounters and the number of verifications it inserts.  It also
12155 counts the number of calls to certain run-time library functions
12156 that it inserts and logs this information for each compilation unit.
12157 The compiler writes this information to a file named
12158 @file{vtv_count_data.log} in the directory named by the environment
12159 variable @env{VTV_LOGS_DIR} if that is defined or the current working
12160 directory otherwise.  It also counts the size of the vtable pointer sets
12161 for each class, and writes this information to @file{vtv_class_set_sizes.log}
12162 in the same directory.
12164 Note:  This feature @emph{appends} data to the log files.  To get fresh log
12165 files, be sure to delete any existing ones.
12167 @item -finstrument-functions
12168 @opindex finstrument-functions
12169 Generate instrumentation calls for entry and exit to functions.  Just
12170 after function entry and just before function exit, the following
12171 profiling functions are called with the address of the current
12172 function and its call site.  (On some platforms,
12173 @code{__builtin_return_address} does not work beyond the current
12174 function, so the call site information may not be available to the
12175 profiling functions otherwise.)
12177 @smallexample
12178 void __cyg_profile_func_enter (void *this_fn,
12179                                void *call_site);
12180 void __cyg_profile_func_exit  (void *this_fn,
12181                                void *call_site);
12182 @end smallexample
12184 The first argument is the address of the start of the current function,
12185 which may be looked up exactly in the symbol table.
12187 This instrumentation is also done for functions expanded inline in other
12188 functions.  The profiling calls indicate where, conceptually, the
12189 inline function is entered and exited.  This means that addressable
12190 versions of such functions must be available.  If all your uses of a
12191 function are expanded inline, this may mean an additional expansion of
12192 code size.  If you use @code{extern inline} in your C code, an
12193 addressable version of such functions must be provided.  (This is
12194 normally the case anyway, but if you get lucky and the optimizer always
12195 expands the functions inline, you might have gotten away without
12196 providing static copies.)
12198 A function may be given the attribute @code{no_instrument_function}, in
12199 which case this instrumentation is not done.  This can be used, for
12200 example, for the profiling functions listed above, high-priority
12201 interrupt routines, and any functions from which the profiling functions
12202 cannot safely be called (perhaps signal handlers, if the profiling
12203 routines generate output or allocate memory).
12205 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
12206 @opindex finstrument-functions-exclude-file-list
12208 Set the list of functions that are excluded from instrumentation (see
12209 the description of @option{-finstrument-functions}).  If the file that
12210 contains a function definition matches with one of @var{file}, then
12211 that function is not instrumented.  The match is done on substrings:
12212 if the @var{file} parameter is a substring of the file name, it is
12213 considered to be a match.
12215 For example:
12217 @smallexample
12218 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
12219 @end smallexample
12221 @noindent
12222 excludes any inline function defined in files whose pathnames
12223 contain @file{/bits/stl} or @file{include/sys}.
12225 If, for some reason, you want to include letter @samp{,} in one of
12226 @var{sym}, write @samp{\,}. For example,
12227 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
12228 (note the single quote surrounding the option).
12230 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
12231 @opindex finstrument-functions-exclude-function-list
12233 This is similar to @option{-finstrument-functions-exclude-file-list},
12234 but this option sets the list of function names to be excluded from
12235 instrumentation.  The function name to be matched is its user-visible
12236 name, such as @code{vector<int> blah(const vector<int> &)}, not the
12237 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
12238 match is done on substrings: if the @var{sym} parameter is a substring
12239 of the function name, it is considered to be a match.  For C99 and C++
12240 extended identifiers, the function name must be given in UTF-8, not
12241 using universal character names.
12243 @item -fpatchable-function-entry=@var{N}[,@var{M}]
12244 @opindex fpatchable-function-entry
12245 Generate @var{N} NOPs right at the beginning
12246 of each function, with the function entry point before the @var{M}th NOP.
12247 If @var{M} is omitted, it defaults to @code{0} so the
12248 function entry points to the address just at the first NOP.
12249 The NOP instructions reserve extra space which can be used to patch in
12250 any desired instrumentation at run time, provided that the code segment
12251 is writable.  The amount of space is controllable indirectly via
12252 the number of NOPs; the NOP instruction used corresponds to the instruction
12253 emitted by the internal GCC back-end interface @code{gen_nop}.  This behavior
12254 is target-specific and may also depend on the architecture variant and/or
12255 other compilation options.
12257 For run-time identification, the starting addresses of these areas,
12258 which correspond to their respective function entries minus @var{M},
12259 are additionally collected in the @code{__patchable_function_entries}
12260 section of the resulting binary.
12262 Note that the value of @code{__attribute__ ((patchable_function_entry
12263 (N,M)))} takes precedence over command-line option
12264 @option{-fpatchable-function-entry=N,M}.  This can be used to increase
12265 the area size or to remove it completely on a single function.
12266 If @code{N=0}, no pad location is recorded.
12268 The NOP instructions are inserted at---and maybe before, depending on
12269 @var{M}---the function entry address, even before the prologue.
12271 @end table
12274 @node Preprocessor Options
12275 @section Options Controlling the Preprocessor
12276 @cindex preprocessor options
12277 @cindex options, preprocessor
12279 These options control the C preprocessor, which is run on each C source
12280 file before actual compilation.
12282 If you use the @option{-E} option, nothing is done except preprocessing.
12283 Some of these options make sense only together with @option{-E} because
12284 they cause the preprocessor output to be unsuitable for actual
12285 compilation.
12287 In addition to the options listed here, there are a number of options 
12288 to control search paths for include files documented in 
12289 @ref{Directory Options}.  
12290 Options to control preprocessor diagnostics are listed in 
12291 @ref{Warning Options}.
12293 @table @gcctabopt
12294 @include cppopts.texi
12296 @item -Wp,@var{option}
12297 @opindex Wp
12298 You can use @option{-Wp,@var{option}} to bypass the compiler driver
12299 and pass @var{option} directly through to the preprocessor.  If
12300 @var{option} contains commas, it is split into multiple options at the
12301 commas.  However, many options are modified, translated or interpreted
12302 by the compiler driver before being passed to the preprocessor, and
12303 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
12304 interface is undocumented and subject to change, so whenever possible
12305 you should avoid using @option{-Wp} and let the driver handle the
12306 options instead.
12308 @item -Xpreprocessor @var{option}
12309 @opindex Xpreprocessor
12310 Pass @var{option} as an option to the preprocessor.  You can use this to
12311 supply system-specific preprocessor options that GCC does not 
12312 recognize.
12314 If you want to pass an option that takes an argument, you must use
12315 @option{-Xpreprocessor} twice, once for the option and once for the argument.
12317 @item -no-integrated-cpp
12318 @opindex no-integrated-cpp
12319 Perform preprocessing as a separate pass before compilation.
12320 By default, GCC performs preprocessing as an integrated part of
12321 input tokenization and parsing.
12322 If this option is provided, the appropriate language front end
12323 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
12324 and Objective-C, respectively) is instead invoked twice,
12325 once for preprocessing only and once for actual compilation
12326 of the preprocessed input.
12327 This option may be useful in conjunction with the @option{-B} or
12328 @option{-wrapper} options to specify an alternate preprocessor or
12329 perform additional processing of the program source between
12330 normal preprocessing and compilation.
12332 @end table
12334 @node Assembler Options
12335 @section Passing Options to the Assembler
12337 @c prevent bad page break with this line
12338 You can pass options to the assembler.
12340 @table @gcctabopt
12341 @item -Wa,@var{option}
12342 @opindex Wa
12343 Pass @var{option} as an option to the assembler.  If @var{option}
12344 contains commas, it is split into multiple options at the commas.
12346 @item -Xassembler @var{option}
12347 @opindex Xassembler
12348 Pass @var{option} as an option to the assembler.  You can use this to
12349 supply system-specific assembler options that GCC does not
12350 recognize.
12352 If you want to pass an option that takes an argument, you must use
12353 @option{-Xassembler} twice, once for the option and once for the argument.
12355 @end table
12357 @node Link Options
12358 @section Options for Linking
12359 @cindex link options
12360 @cindex options, linking
12362 These options come into play when the compiler links object files into
12363 an executable output file.  They are meaningless if the compiler is
12364 not doing a link step.
12366 @table @gcctabopt
12367 @cindex file names
12368 @item @var{object-file-name}
12369 A file name that does not end in a special recognized suffix is
12370 considered to name an object file or library.  (Object files are
12371 distinguished from libraries by the linker according to the file
12372 contents.)  If linking is done, these object files are used as input
12373 to the linker.
12375 @item -c
12376 @itemx -S
12377 @itemx -E
12378 @opindex c
12379 @opindex S
12380 @opindex E
12381 If any of these options is used, then the linker is not run, and
12382 object file names should not be used as arguments.  @xref{Overall
12383 Options}.
12385 @item -flinker-output=@var{type}
12386 @opindex -flinker-output
12387 This option controls the code generation of the link time optimizer.  By
12388 default the linker output is determined by the linker plugin automatically. For
12389 debugging the compiler and in the case of incremental linking to non-lto object
12390 file is desired, it may be useful to control the type manually.
12392 If @var{type} is @samp{exec} the code generation is configured to produce static
12393 binary. In this case @option{-fpic} and @option{-fpie} are both disabled.
12395 If @var{type} is @samp{dyn} the code generation is configured to produce shared
12396 library. In this case @option{-fpic} or @option{-fPIC} is preserved, but not
12397 enabled automatically.  This makes it possible to build shared libraries without
12398 position independent code on architectures this is possible, i.e. on x86.
12400 If @var{type} is @samp{pie} the code generation is configured to produce
12401 @option{-fpie} executable. This result in similar optimizations as @samp{exec}
12402 except that @option{-fpie} is not disabled if specified at compilation time.
12404 If @var{type} is @samp{rel} the compiler assumes that incremental linking is
12405 done.  The sections containing intermediate code for link-time optimization are
12406 merged, pre-optimized, and output to the resulting object file. In addition, if
12407 @option{-ffat-lto-objects} is specified the binary code is produced for future
12408 non-lto linking. The object file produced by incremental linking will be smaller
12409 than a static library produced from the same object files.  At link-time the
12410 result of incremental linking will also load faster to compiler than a static
12411 library assuming that majority of objects in the library are used.
12413 Finally @samp{nolto-rel} configure compiler to for incremental linking where
12414 code generation is forced, final binary is produced and the intermediate code
12415 for later link-time optimization is stripped. When multiple object files are
12416 linked together the resulting code will be optimized better than with link time
12417 optimizations disabled (for example, the cross-module inlining will happen),
12418 most of benefits of whole program optimizations are however lost. 
12420 During the incremental link (by @option{-r}) the linker plugin will default to
12421 @option{rel}. With current interfaces to GNU Binutils it is however not
12422 possible to link incrementally LTO objects and non-LTO objects into a single
12423 mixed object file.  In the case any of object files in incremental link can not
12424 be used for link-time optimization the linker plugin will output warning and
12425 use @samp{nolto-rel}. To maintain the whole program optimization it is
12426 recommended to link such objects into static library instead. Alternatively it
12427 is possible to use H.J. Lu's binutils with support for mixed objects.
12429 @item -fuse-ld=bfd
12430 @opindex fuse-ld=bfd
12431 Use the @command{bfd} linker instead of the default linker.
12433 @item -fuse-ld=gold
12434 @opindex fuse-ld=gold
12435 Use the @command{gold} linker instead of the default linker.
12437 @cindex Libraries
12438 @item -l@var{library}
12439 @itemx -l @var{library}
12440 @opindex l
12441 Search the library named @var{library} when linking.  (The second
12442 alternative with the library as a separate argument is only for
12443 POSIX compliance and is not recommended.)
12445 It makes a difference where in the command you write this option; the
12446 linker searches and processes libraries and object files in the order they
12447 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
12448 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
12449 to functions in @samp{z}, those functions may not be loaded.
12451 The linker searches a standard list of directories for the library,
12452 which is actually a file named @file{lib@var{library}.a}.  The linker
12453 then uses this file as if it had been specified precisely by name.
12455 The directories searched include several standard system directories
12456 plus any that you specify with @option{-L}.
12458 Normally the files found this way are library files---archive files
12459 whose members are object files.  The linker handles an archive file by
12460 scanning through it for members which define symbols that have so far
12461 been referenced but not defined.  But if the file that is found is an
12462 ordinary object file, it is linked in the usual fashion.  The only
12463 difference between using an @option{-l} option and specifying a file name
12464 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
12465 and searches several directories.
12467 @item -lobjc
12468 @opindex lobjc
12469 You need this special case of the @option{-l} option in order to
12470 link an Objective-C or Objective-C++ program.
12472 @item -nostartfiles
12473 @opindex nostartfiles
12474 Do not use the standard system startup files when linking.
12475 The standard system libraries are used normally, unless @option{-nostdlib},
12476 @option{-nolibc}, or @option{-nodefaultlibs} is used.
12478 @item -nodefaultlibs
12479 @opindex nodefaultlibs
12480 Do not use the standard system libraries when linking.
12481 Only the libraries you specify are passed to the linker, and options
12482 specifying linkage of the system libraries, such as @option{-static-libgcc}
12483 or @option{-shared-libgcc}, are ignored.  
12484 The standard startup files are used normally, unless @option{-nostartfiles}
12485 is used.  
12487 The compiler may generate calls to @code{memcmp},
12488 @code{memset}, @code{memcpy} and @code{memmove}.
12489 These entries are usually resolved by entries in
12490 libc.  These entry points should be supplied through some other
12491 mechanism when this option is specified.
12493 @item -nolibc
12494 @opindex nolibc
12495 Do not use the C library or system libraries tightly coupled with it when
12496 linking.  Still link with the startup files, @file{libgcc} or toolchain
12497 provided language support libraries such as @file{libgnat}, @file{libgfortran}
12498 or @file{libstdc++} unless options preventing their inclusion are used as
12499 well.  This typically removes @option{-lc} from the link command line, as well
12500 as system libraries that normally go with it and become meaningless when
12501 absence of a C library is assumed, for example @option{-lpthread} or
12502 @option{-lm} in some configurations.  This is intended for bare-board
12503 targets when there is indeed no C library available.
12505 @item -nostdlib
12506 @opindex nostdlib
12507 Do not use the standard system startup files or libraries when linking.
12508 No startup files and only the libraries you specify are passed to
12509 the linker, and options specifying linkage of the system libraries, such as
12510 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
12512 The compiler may generate calls to @code{memcmp}, @code{memset},
12513 @code{memcpy} and @code{memmove}.
12514 These entries are usually resolved by entries in
12515 libc.  These entry points should be supplied through some other
12516 mechanism when this option is specified.
12518 @cindex @option{-lgcc}, use with @option{-nostdlib}
12519 @cindex @option{-nostdlib} and unresolved references
12520 @cindex unresolved references and @option{-nostdlib}
12521 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
12522 @cindex @option{-nodefaultlibs} and unresolved references
12523 @cindex unresolved references and @option{-nodefaultlibs}
12524 One of the standard libraries bypassed by @option{-nostdlib} and
12525 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
12526 which GCC uses to overcome shortcomings of particular machines, or special
12527 needs for some languages.
12528 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
12529 Collection (GCC) Internals},
12530 for more discussion of @file{libgcc.a}.)
12531 In most cases, you need @file{libgcc.a} even when you want to avoid
12532 other standard libraries.  In other words, when you specify @option{-nostdlib}
12533 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
12534 This ensures that you have no unresolved references to internal GCC
12535 library subroutines.
12536 (An example of such an internal subroutine is @code{__main}, used to ensure C++
12537 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
12538 GNU Compiler Collection (GCC) Internals}.)
12540 @item -pie
12541 @opindex pie
12542 Produce a dynamically linked position independent executable on targets
12543 that support it.  For predictable results, you must also specify the same
12544 set of options used for compilation (@option{-fpie}, @option{-fPIE},
12545 or model suboptions) when you specify this linker option.
12547 @item -no-pie
12548 @opindex no-pie
12549 Don't produce a dynamically linked position independent executable.
12551 @item -static-pie
12552 @opindex static-pie
12553 Produce a static position independent executable on targets that support
12554 it.  A static position independent executable is similar to a static
12555 executable, but can be loaded at any address without a dynamic linker.
12556 For predictable results, you must also specify the same set of options
12557 used for compilation (@option{-fpie}, @option{-fPIE}, or model
12558 suboptions) when you specify this linker option.
12560 @item -pthread
12561 @opindex pthread
12562 Link with the POSIX threads library.  This option is supported on 
12563 GNU/Linux targets, most other Unix derivatives, and also on 
12564 x86 Cygwin and MinGW targets.  On some targets this option also sets 
12565 flags for the preprocessor, so it should be used consistently for both
12566 compilation and linking.
12568 @item -rdynamic
12569 @opindex rdynamic
12570 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
12571 that support it. This instructs the linker to add all symbols, not
12572 only used ones, to the dynamic symbol table. This option is needed
12573 for some uses of @code{dlopen} or to allow obtaining backtraces
12574 from within a program.
12576 @item -s
12577 @opindex s
12578 Remove all symbol table and relocation information from the executable.
12580 @item -static
12581 @opindex static
12582 On systems that support dynamic linking, this overrides @option{-pie}
12583 and prevents linking with the shared libraries.  On other systems, this
12584 option has no effect.
12586 @item -shared
12587 @opindex shared
12588 Produce a shared object which can then be linked with other objects to
12589 form an executable.  Not all systems support this option.  For predictable
12590 results, you must also specify the same set of options used for compilation
12591 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
12592 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
12593 needs to build supplementary stub code for constructors to work.  On
12594 multi-libbed systems, @samp{gcc -shared} must select the correct support
12595 libraries to link against.  Failing to supply the correct flags may lead
12596 to subtle defects.  Supplying them in cases where they are not necessary
12597 is innocuous.}
12599 @item -shared-libgcc
12600 @itemx -static-libgcc
12601 @opindex shared-libgcc
12602 @opindex static-libgcc
12603 On systems that provide @file{libgcc} as a shared library, these options
12604 force the use of either the shared or static version, respectively.
12605 If no shared version of @file{libgcc} was built when the compiler was
12606 configured, these options have no effect.
12608 There are several situations in which an application should use the
12609 shared @file{libgcc} instead of the static version.  The most common
12610 of these is when the application wishes to throw and catch exceptions
12611 across different shared libraries.  In that case, each of the libraries
12612 as well as the application itself should use the shared @file{libgcc}.
12614 Therefore, the G++ and driver automatically adds @option{-shared-libgcc}
12615  whenever you build a shared library or a main executable, because C++
12616  programs typically use exceptions, so this is the right thing to do.
12618 If, instead, you use the GCC driver to create shared libraries, you may
12619 find that they are not always linked with the shared @file{libgcc}.
12620 If GCC finds, at its configuration time, that you have a non-GNU linker
12621 or a GNU linker that does not support option @option{--eh-frame-hdr},
12622 it links the shared version of @file{libgcc} into shared libraries
12623 by default.  Otherwise, it takes advantage of the linker and optimizes
12624 away the linking with the shared version of @file{libgcc}, linking with
12625 the static version of libgcc by default.  This allows exceptions to
12626 propagate through such shared libraries, without incurring relocation
12627 costs at library load time.
12629 However, if a library or main executable is supposed to throw or catch
12630 exceptions, you must link it using the G++ driver, as appropriate
12631 for the languages used in the program, or using the option
12632 @option{-shared-libgcc}, such that it is linked with the shared
12633 @file{libgcc}.
12635 @item -static-libasan
12636 @opindex static-libasan
12637 When the @option{-fsanitize=address} option is used to link a program,
12638 the GCC driver automatically links against @option{libasan}.  If
12639 @file{libasan} is available as a shared library, and the @option{-static}
12640 option is not used, then this links against the shared version of
12641 @file{libasan}.  The @option{-static-libasan} option directs the GCC
12642 driver to link @file{libasan} statically, without necessarily linking
12643 other libraries statically.
12645 @item -static-libtsan
12646 @opindex static-libtsan
12647 When the @option{-fsanitize=thread} option is used to link a program,
12648 the GCC driver automatically links against @option{libtsan}.  If
12649 @file{libtsan} is available as a shared library, and the @option{-static}
12650 option is not used, then this links against the shared version of
12651 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
12652 driver to link @file{libtsan} statically, without necessarily linking
12653 other libraries statically.
12655 @item -static-liblsan
12656 @opindex static-liblsan
12657 When the @option{-fsanitize=leak} option is used to link a program,
12658 the GCC driver automatically links against @option{liblsan}.  If
12659 @file{liblsan} is available as a shared library, and the @option{-static}
12660 option is not used, then this links against the shared version of
12661 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
12662 driver to link @file{liblsan} statically, without necessarily linking
12663 other libraries statically.
12665 @item -static-libubsan
12666 @opindex static-libubsan
12667 When the @option{-fsanitize=undefined} option is used to link a program,
12668 the GCC driver automatically links against @option{libubsan}.  If
12669 @file{libubsan} is available as a shared library, and the @option{-static}
12670 option is not used, then this links against the shared version of
12671 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
12672 driver to link @file{libubsan} statically, without necessarily linking
12673 other libraries statically.
12675 @item -static-libstdc++
12676 @opindex static-libstdc++
12677 When the @command{g++} program is used to link a C++ program, it
12678 normally automatically links against @option{libstdc++}.  If
12679 @file{libstdc++} is available as a shared library, and the
12680 @option{-static} option is not used, then this links against the
12681 shared version of @file{libstdc++}.  That is normally fine.  However, it
12682 is sometimes useful to freeze the version of @file{libstdc++} used by
12683 the program without going all the way to a fully static link.  The
12684 @option{-static-libstdc++} option directs the @command{g++} driver to
12685 link @file{libstdc++} statically, without necessarily linking other
12686 libraries statically.
12688 @item -symbolic
12689 @opindex symbolic
12690 Bind references to global symbols when building a shared object.  Warn
12691 about any unresolved references (unless overridden by the link editor
12692 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
12693 this option.
12695 @item -T @var{script}
12696 @opindex T
12697 @cindex linker script
12698 Use @var{script} as the linker script.  This option is supported by most
12699 systems using the GNU linker.  On some targets, such as bare-board
12700 targets without an operating system, the @option{-T} option may be required
12701 when linking to avoid references to undefined symbols.
12703 @item -Xlinker @var{option}
12704 @opindex Xlinker
12705 Pass @var{option} as an option to the linker.  You can use this to
12706 supply system-specific linker options that GCC does not recognize.
12708 If you want to pass an option that takes a separate argument, you must use
12709 @option{-Xlinker} twice, once for the option and once for the argument.
12710 For example, to pass @option{-assert definitions}, you must write
12711 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
12712 @option{-Xlinker "-assert definitions"}, because this passes the entire
12713 string as a single argument, which is not what the linker expects.
12715 When using the GNU linker, it is usually more convenient to pass
12716 arguments to linker options using the @option{@var{option}=@var{value}}
12717 syntax than as separate arguments.  For example, you can specify
12718 @option{-Xlinker -Map=output.map} rather than
12719 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
12720 this syntax for command-line options.
12722 @item -Wl,@var{option}
12723 @opindex Wl
12724 Pass @var{option} as an option to the linker.  If @var{option} contains
12725 commas, it is split into multiple options at the commas.  You can use this
12726 syntax to pass an argument to the option.
12727 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
12728 linker.  When using the GNU linker, you can also get the same effect with
12729 @option{-Wl,-Map=output.map}.
12731 @item -u @var{symbol}
12732 @opindex u
12733 Pretend the symbol @var{symbol} is undefined, to force linking of
12734 library modules to define it.  You can use @option{-u} multiple times with
12735 different symbols to force loading of additional library modules.
12737 @item -z @var{keyword}
12738 @opindex z
12739 @option{-z} is passed directly on to the linker along with the keyword
12740 @var{keyword}. See the section in the documentation of your linker for
12741 permitted values and their meanings.
12742 @end table
12744 @node Directory Options
12745 @section Options for Directory Search
12746 @cindex directory options
12747 @cindex options, directory search
12748 @cindex search path
12750 These options specify directories to search for header files, for
12751 libraries and for parts of the compiler:
12753 @table @gcctabopt
12754 @include cppdiropts.texi
12756 @item -iplugindir=@var{dir}
12757 @opindex iplugindir=
12758 Set the directory to search for plugins that are passed
12759 by @option{-fplugin=@var{name}} instead of
12760 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
12761 to be used by the user, but only passed by the driver.
12763 @item -L@var{dir}
12764 @opindex L
12765 Add directory @var{dir} to the list of directories to be searched
12766 for @option{-l}.
12768 @item -B@var{prefix}
12769 @opindex B
12770 This option specifies where to find the executables, libraries,
12771 include files, and data files of the compiler itself.
12773 The compiler driver program runs one or more of the subprograms
12774 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
12775 @var{prefix} as a prefix for each program it tries to run, both with and
12776 without @samp{@var{machine}/@var{version}/} for the corresponding target
12777 machine and compiler version.
12779 For each subprogram to be run, the compiler driver first tries the
12780 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
12781 is not specified, the driver tries two standard prefixes, 
12782 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
12783 those results in a file name that is found, the unmodified program
12784 name is searched for using the directories specified in your
12785 @env{PATH} environment variable.
12787 The compiler checks to see if the path provided by @option{-B}
12788 refers to a directory, and if necessary it adds a directory
12789 separator character at the end of the path.
12791 @option{-B} prefixes that effectively specify directory names also apply
12792 to libraries in the linker, because the compiler translates these
12793 options into @option{-L} options for the linker.  They also apply to
12794 include files in the preprocessor, because the compiler translates these
12795 options into @option{-isystem} options for the preprocessor.  In this case,
12796 the compiler appends @samp{include} to the prefix.
12798 The runtime support file @file{libgcc.a} can also be searched for using
12799 the @option{-B} prefix, if needed.  If it is not found there, the two
12800 standard prefixes above are tried, and that is all.  The file is left
12801 out of the link if it is not found by those means.
12803 Another way to specify a prefix much like the @option{-B} prefix is to use
12804 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
12805 Variables}.
12807 As a special kludge, if the path provided by @option{-B} is
12808 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
12809 9, then it is replaced by @file{[dir/]include}.  This is to help
12810 with boot-strapping the compiler.
12812 @item -no-canonical-prefixes
12813 @opindex no-canonical-prefixes
12814 Do not expand any symbolic links, resolve references to @samp{/../}
12815 or @samp{/./}, or make the path absolute when generating a relative
12816 prefix.
12818 @item --sysroot=@var{dir}
12819 @opindex sysroot
12820 Use @var{dir} as the logical root directory for headers and libraries.
12821 For example, if the compiler normally searches for headers in
12822 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
12823 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
12825 If you use both this option and the @option{-isysroot} option, then
12826 the @option{--sysroot} option applies to libraries, but the
12827 @option{-isysroot} option applies to header files.
12829 The GNU linker (beginning with version 2.16) has the necessary support
12830 for this option.  If your linker does not support this option, the
12831 header file aspect of @option{--sysroot} still works, but the
12832 library aspect does not.
12834 @item --no-sysroot-suffix
12835 @opindex no-sysroot-suffix
12836 For some targets, a suffix is added to the root directory specified
12837 with @option{--sysroot}, depending on the other options used, so that
12838 headers may for example be found in
12839 @file{@var{dir}/@var{suffix}/usr/include} instead of
12840 @file{@var{dir}/usr/include}.  This option disables the addition of
12841 such a suffix.
12843 @end table
12845 @node Code Gen Options
12846 @section Options for Code Generation Conventions
12847 @cindex code generation conventions
12848 @cindex options, code generation
12849 @cindex run-time options
12851 These machine-independent options control the interface conventions
12852 used in code generation.
12854 Most of them have both positive and negative forms; the negative form
12855 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
12856 one of the forms is listed---the one that is not the default.  You
12857 can figure out the other form by either removing @samp{no-} or adding
12860 @table @gcctabopt
12861 @item -fstack-reuse=@var{reuse-level}
12862 @opindex fstack_reuse
12863 This option controls stack space reuse for user declared local/auto variables
12864 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
12865 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
12866 local variables and temporaries, @samp{named_vars} enables the reuse only for
12867 user defined local variables with names, and @samp{none} disables stack reuse
12868 completely. The default value is @samp{all}. The option is needed when the
12869 program extends the lifetime of a scoped local variable or a compiler generated
12870 temporary beyond the end point defined by the language.  When a lifetime of
12871 a variable ends, and if the variable lives in memory, the optimizing compiler
12872 has the freedom to reuse its stack space with other temporaries or scoped
12873 local variables whose live range does not overlap with it. Legacy code extending
12874 local lifetime is likely to break with the stack reuse optimization.
12876 For example,
12878 @smallexample
12879    int *p;
12880    @{
12881      int local1;
12883      p = &local1;
12884      local1 = 10;
12885      ....
12886    @}
12887    @{
12888       int local2;
12889       local2 = 20;
12890       ...
12891    @}
12893    if (*p == 10)  // out of scope use of local1
12894      @{
12896      @}
12897 @end smallexample
12899 Another example:
12900 @smallexample
12902    struct A
12903    @{
12904        A(int k) : i(k), j(k) @{ @}
12905        int i;
12906        int j;
12907    @};
12909    A *ap;
12911    void foo(const A& ar)
12912    @{
12913       ap = &ar;
12914    @}
12916    void bar()
12917    @{
12918       foo(A(10)); // temp object's lifetime ends when foo returns
12920       @{
12921         A a(20);
12922         ....
12923       @}
12924       ap->i+= 10;  // ap references out of scope temp whose space
12925                    // is reused with a. What is the value of ap->i?
12926    @}
12928 @end smallexample
12930 The lifetime of a compiler generated temporary is well defined by the C++
12931 standard. When a lifetime of a temporary ends, and if the temporary lives
12932 in memory, the optimizing compiler has the freedom to reuse its stack
12933 space with other temporaries or scoped local variables whose live range
12934 does not overlap with it. However some of the legacy code relies on
12935 the behavior of older compilers in which temporaries' stack space is
12936 not reused, the aggressive stack reuse can lead to runtime errors. This
12937 option is used to control the temporary stack reuse optimization.
12939 @item -ftrapv
12940 @opindex ftrapv
12941 This option generates traps for signed overflow on addition, subtraction,
12942 multiplication operations.
12943 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
12944 @option{-ftrapv} @option{-fwrapv} on the command-line results in
12945 @option{-fwrapv} being effective.  Note that only active options override, so
12946 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
12947 results in @option{-ftrapv} being effective.
12949 @item -fwrapv
12950 @opindex fwrapv
12951 This option instructs the compiler to assume that signed arithmetic
12952 overflow of addition, subtraction and multiplication wraps around
12953 using twos-complement representation.  This flag enables some optimizations
12954 and disables others.
12955 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
12956 @option{-ftrapv} @option{-fwrapv} on the command-line results in
12957 @option{-fwrapv} being effective.  Note that only active options override, so
12958 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
12959 results in @option{-ftrapv} being effective.
12961 @item -fwrapv-pointer
12962 @opindex fwrapv-pointer
12963 This option instructs the compiler to assume that pointer arithmetic
12964 overflow on addition and subtraction wraps around using twos-complement
12965 representation.  This flag disables some optimizations which assume
12966 pointer overflow is invalid.
12968 @item -fstrict-overflow
12969 @opindex fstrict-overflow
12970 This option implies @option{-fno-wrapv} @option{-fno-wrapv-pointer} and when
12971 negated implies @option{-fwrapv} @option{-fwrapv-pointer}.
12973 @item -fexceptions
12974 @opindex fexceptions
12975 Enable exception handling.  Generates extra code needed to propagate
12976 exceptions.  For some targets, this implies GCC generates frame
12977 unwind information for all functions, which can produce significant data
12978 size overhead, although it does not affect execution.  If you do not
12979 specify this option, GCC enables it by default for languages like
12980 C++ that normally require exception handling, and disables it for
12981 languages like C that do not normally require it.  However, you may need
12982 to enable this option when compiling C code that needs to interoperate
12983 properly with exception handlers written in C++.  You may also wish to
12984 disable this option if you are compiling older C++ programs that don't
12985 use exception handling.
12987 @item -fnon-call-exceptions
12988 @opindex fnon-call-exceptions
12989 Generate code that allows trapping instructions to throw exceptions.
12990 Note that this requires platform-specific runtime support that does
12991 not exist everywhere.  Moreover, it only allows @emph{trapping}
12992 instructions to throw exceptions, i.e.@: memory references or floating-point
12993 instructions.  It does not allow exceptions to be thrown from
12994 arbitrary signal handlers such as @code{SIGALRM}.
12996 @item -fdelete-dead-exceptions
12997 @opindex fdelete-dead-exceptions
12998 Consider that instructions that may throw exceptions but don't otherwise
12999 contribute to the execution of the program can be optimized away.
13000 This option is enabled by default for the Ada front end, as permitted by
13001 the Ada language specification.
13002 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
13004 @item -funwind-tables
13005 @opindex funwind-tables
13006 Similar to @option{-fexceptions}, except that it just generates any needed
13007 static data, but does not affect the generated code in any other way.
13008 You normally do not need to enable this option; instead, a language processor
13009 that needs this handling enables it on your behalf.
13011 @item -fasynchronous-unwind-tables
13012 @opindex fasynchronous-unwind-tables
13013 Generate unwind table in DWARF format, if supported by target machine.  The
13014 table is exact at each instruction boundary, so it can be used for stack
13015 unwinding from asynchronous events (such as debugger or garbage collector).
13017 @item -fno-gnu-unique
13018 @opindex fno-gnu-unique
13019 On systems with recent GNU assembler and C library, the C++ compiler
13020 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
13021 of template static data members and static local variables in inline
13022 functions are unique even in the presence of @code{RTLD_LOCAL}; this
13023 is necessary to avoid problems with a library used by two different
13024 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
13025 therefore disagreeing with the other one about the binding of the
13026 symbol.  But this causes @code{dlclose} to be ignored for affected
13027 DSOs; if your program relies on reinitialization of a DSO via
13028 @code{dlclose} and @code{dlopen}, you can use
13029 @option{-fno-gnu-unique}.
13031 @item -fpcc-struct-return
13032 @opindex fpcc-struct-return
13033 Return ``short'' @code{struct} and @code{union} values in memory like
13034 longer ones, rather than in registers.  This convention is less
13035 efficient, but it has the advantage of allowing intercallability between
13036 GCC-compiled files and files compiled with other compilers, particularly
13037 the Portable C Compiler (pcc).
13039 The precise convention for returning structures in memory depends
13040 on the target configuration macros.
13042 Short structures and unions are those whose size and alignment match
13043 that of some integer type.
13045 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13046 switch is not binary compatible with code compiled with the
13047 @option{-freg-struct-return} switch.
13048 Use it to conform to a non-default application binary interface.
13050 @item -freg-struct-return
13051 @opindex freg-struct-return
13052 Return @code{struct} and @code{union} values in registers when possible.
13053 This is more efficient for small structures than
13054 @option{-fpcc-struct-return}.
13056 If you specify neither @option{-fpcc-struct-return} nor
13057 @option{-freg-struct-return}, GCC defaults to whichever convention is
13058 standard for the target.  If there is no standard convention, GCC
13059 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
13060 the principal compiler.  In those cases, we can choose the standard, and
13061 we chose the more efficient register return alternative.
13063 @strong{Warning:} code compiled with the @option{-freg-struct-return}
13064 switch is not binary compatible with code compiled with the
13065 @option{-fpcc-struct-return} switch.
13066 Use it to conform to a non-default application binary interface.
13068 @item -fshort-enums
13069 @opindex fshort-enums
13070 Allocate to an @code{enum} type only as many bytes as it needs for the
13071 declared range of possible values.  Specifically, the @code{enum} type
13072 is equivalent to the smallest integer type that has enough room.
13074 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
13075 code that is not binary compatible with code generated without that switch.
13076 Use it to conform to a non-default application binary interface.
13078 @item -fshort-wchar
13079 @opindex fshort-wchar
13080 Override the underlying type for @code{wchar_t} to be @code{short
13081 unsigned int} instead of the default for the target.  This option is
13082 useful for building programs to run under WINE@.
13084 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
13085 code that is not binary compatible with code generated without that switch.
13086 Use it to conform to a non-default application binary interface.
13088 @item -fno-common
13089 @opindex fno-common
13090 @cindex tentative definitions
13091 In C code, this option controls the placement of global variables 
13092 defined without an initializer, known as @dfn{tentative definitions} 
13093 in the C standard.  Tentative definitions are distinct from declarations 
13094 of a variable with the @code{extern} keyword, which do not allocate storage.
13096 Unix C compilers have traditionally allocated storage for
13097 uninitialized global variables in a common block.  This allows the
13098 linker to resolve all tentative definitions of the same variable
13099 in different compilation units to the same object, or to a non-tentative
13100 definition.  
13101 This is the behavior specified by @option{-fcommon}, and is the default for 
13102 GCC on most targets.  
13103 On the other hand, this behavior is not required by ISO
13104 C, and on some targets may carry a speed or code size penalty on
13105 variable references.
13107 The @option{-fno-common} option specifies that the compiler should instead
13108 place uninitialized global variables in the data section of the object file.
13109 This inhibits the merging of tentative definitions by the linker so
13110 you get a multiple-definition error if the same 
13111 variable is defined in more than one compilation unit.
13112 Compiling with @option{-fno-common} is useful on targets for which
13113 it provides better performance, or if you wish to verify that the
13114 program will work on other systems that always treat uninitialized
13115 variable definitions this way.
13117 @item -fno-ident
13118 @opindex fno-ident
13119 Ignore the @code{#ident} directive.
13121 @item -finhibit-size-directive
13122 @opindex finhibit-size-directive
13123 Don't output a @code{.size} assembler directive, or anything else that
13124 would cause trouble if the function is split in the middle, and the
13125 two halves are placed at locations far apart in memory.  This option is
13126 used when compiling @file{crtstuff.c}; you should not need to use it
13127 for anything else.
13129 @item -fverbose-asm
13130 @opindex fverbose-asm
13131 Put extra commentary information in the generated assembly code to
13132 make it more readable.  This option is generally only of use to those
13133 who actually need to read the generated assembly code (perhaps while
13134 debugging the compiler itself).
13136 @option{-fno-verbose-asm}, the default, causes the
13137 extra information to be omitted and is useful when comparing two assembler
13138 files.
13140 The added comments include:
13142 @itemize @bullet
13144 @item
13145 information on the compiler version and command-line options,
13147 @item
13148 the source code lines associated with the assembly instructions,
13149 in the form FILENAME:LINENUMBER:CONTENT OF LINE,
13151 @item
13152 hints on which high-level expressions correspond to
13153 the various assembly instruction operands.
13155 @end itemize
13157 For example, given this C source file:
13159 @smallexample
13160 int test (int n)
13162   int i;
13163   int total = 0;
13165   for (i = 0; i < n; i++)
13166     total += i * i;
13168   return total;
13170 @end smallexample
13172 compiling to (x86_64) assembly via @option{-S} and emitting the result
13173 direct to stdout via @option{-o} @option{-}
13175 @smallexample
13176 gcc -S test.c -fverbose-asm -Os -o -
13177 @end smallexample
13179 gives output similar to this:
13181 @smallexample
13182         .file   "test.c"
13183 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
13184   [...snip...]
13185 # options passed:
13186   [...snip...]
13188         .text
13189         .globl  test
13190         .type   test, @@function
13191 test:
13192 .LFB0:
13193         .cfi_startproc
13194 # test.c:4:   int total = 0;
13195         xorl    %eax, %eax      # <retval>
13196 # test.c:6:   for (i = 0; i < n; i++)
13197         xorl    %edx, %edx      # i
13198 .L2:
13199 # test.c:6:   for (i = 0; i < n; i++)
13200         cmpl    %edi, %edx      # n, i
13201         jge     .L5     #,
13202 # test.c:7:     total += i * i;
13203         movl    %edx, %ecx      # i, tmp92
13204         imull   %edx, %ecx      # i, tmp92
13205 # test.c:6:   for (i = 0; i < n; i++)
13206         incl    %edx    # i
13207 # test.c:7:     total += i * i;
13208         addl    %ecx, %eax      # tmp92, <retval>
13209         jmp     .L2     #
13210 .L5:
13211 # test.c:10: @}
13212         ret
13213         .cfi_endproc
13214 .LFE0:
13215         .size   test, .-test
13216         .ident  "GCC: (GNU) 7.0.0 20160809 (experimental)"
13217         .section        .note.GNU-stack,"",@@progbits
13218 @end smallexample
13220 The comments are intended for humans rather than machines and hence the
13221 precise format of the comments is subject to change.
13223 @item -frecord-gcc-switches
13224 @opindex frecord-gcc-switches
13225 This switch causes the command line used to invoke the
13226 compiler to be recorded into the object file that is being created.
13227 This switch is only implemented on some targets and the exact format
13228 of the recording is target and binary file format dependent, but it
13229 usually takes the form of a section containing ASCII text.  This
13230 switch is related to the @option{-fverbose-asm} switch, but that
13231 switch only records information in the assembler output file as
13232 comments, so it never reaches the object file.
13233 See also @option{-grecord-gcc-switches} for another
13234 way of storing compiler options into the object file.
13236 @item -fpic
13237 @opindex fpic
13238 @cindex global offset table
13239 @cindex PIC
13240 Generate position-independent code (PIC) suitable for use in a shared
13241 library, if supported for the target machine.  Such code accesses all
13242 constant addresses through a global offset table (GOT)@.  The dynamic
13243 loader resolves the GOT entries when the program starts (the dynamic
13244 loader is not part of GCC; it is part of the operating system).  If
13245 the GOT size for the linked executable exceeds a machine-specific
13246 maximum size, you get an error message from the linker indicating that
13247 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
13248 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
13249 on the m68k and RS/6000.  The x86 has no such limit.)
13251 Position-independent code requires special support, and therefore works
13252 only on certain machines.  For the x86, GCC supports PIC for System V
13253 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
13254 position-independent.
13256 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13257 are defined to 1.
13259 @item -fPIC
13260 @opindex fPIC
13261 If supported for the target machine, emit position-independent code,
13262 suitable for dynamic linking and avoiding any limit on the size of the
13263 global offset table.  This option makes a difference on AArch64, m68k,
13264 PowerPC and SPARC@.
13266 Position-independent code requires special support, and therefore works
13267 only on certain machines.
13269 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13270 are defined to 2.
13272 @item -fpie
13273 @itemx -fPIE
13274 @opindex fpie
13275 @opindex fPIE
13276 These options are similar to @option{-fpic} and @option{-fPIC}, but the
13277 generated position-independent code can be only linked into executables.
13278 Usually these options are used to compile code that will be linked using
13279 the @option{-pie} GCC option.
13281 @option{-fpie} and @option{-fPIE} both define the macros
13282 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
13283 for @option{-fpie} and 2 for @option{-fPIE}.
13285 @item -fno-plt
13286 @opindex fno-plt
13287 Do not use the PLT for external function calls in position-independent code.
13288 Instead, load the callee address at call sites from the GOT and branch to it.
13289 This leads to more efficient code by eliminating PLT stubs and exposing
13290 GOT loads to optimizations.  On architectures such as 32-bit x86 where
13291 PLT stubs expect the GOT pointer in a specific register, this gives more
13292 register allocation freedom to the compiler.
13293 Lazy binding requires use of the PLT; 
13294 with @option{-fno-plt} all external symbols are resolved at load time.
13296 Alternatively, the function attribute @code{noplt} can be used to avoid calls
13297 through the PLT for specific external functions.
13299 In position-dependent code, a few targets also convert calls to
13300 functions that are marked to not use the PLT to use the GOT instead.
13302 @item -fno-jump-tables
13303 @opindex fno-jump-tables
13304 Do not use jump tables for switch statements even where it would be
13305 more efficient than other code generation strategies.  This option is
13306 of use in conjunction with @option{-fpic} or @option{-fPIC} for
13307 building code that forms part of a dynamic linker and cannot
13308 reference the address of a jump table.  On some targets, jump tables
13309 do not require a GOT and this option is not needed.
13311 @item -ffixed-@var{reg}
13312 @opindex ffixed
13313 Treat the register named @var{reg} as a fixed register; generated code
13314 should never refer to it (except perhaps as a stack pointer, frame
13315 pointer or in some other fixed role).
13317 @var{reg} must be the name of a register.  The register names accepted
13318 are machine-specific and are defined in the @code{REGISTER_NAMES}
13319 macro in the machine description macro file.
13321 This flag does not have a negative form, because it specifies a
13322 three-way choice.
13324 @item -fcall-used-@var{reg}
13325 @opindex fcall-used
13326 Treat the register named @var{reg} as an allocable register that is
13327 clobbered by function calls.  It may be allocated for temporaries or
13328 variables that do not live across a call.  Functions compiled this way
13329 do not save and restore the register @var{reg}.
13331 It is an error to use this flag with the frame pointer or stack pointer.
13332 Use of this flag for other registers that have fixed pervasive roles in
13333 the machine's execution model produces disastrous results.
13335 This flag does not have a negative form, because it specifies a
13336 three-way choice.
13338 @item -fcall-saved-@var{reg}
13339 @opindex fcall-saved
13340 Treat the register named @var{reg} as an allocable register saved by
13341 functions.  It may be allocated even for temporaries or variables that
13342 live across a call.  Functions compiled this way save and restore
13343 the register @var{reg} if they use it.
13345 It is an error to use this flag with the frame pointer or stack pointer.
13346 Use of this flag for other registers that have fixed pervasive roles in
13347 the machine's execution model produces disastrous results.
13349 A different sort of disaster results from the use of this flag for
13350 a register in which function values may be returned.
13352 This flag does not have a negative form, because it specifies a
13353 three-way choice.
13355 @item -fpack-struct[=@var{n}]
13356 @opindex fpack-struct
13357 Without a value specified, pack all structure members together without
13358 holes.  When a value is specified (which must be a small power of two), pack
13359 structure members according to this value, representing the maximum
13360 alignment (that is, objects with default alignment requirements larger than
13361 this are output potentially unaligned at the next fitting location.
13363 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
13364 code that is not binary compatible with code generated without that switch.
13365 Additionally, it makes the code suboptimal.
13366 Use it to conform to a non-default application binary interface.
13368 @item -fleading-underscore
13369 @opindex fleading-underscore
13370 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
13371 change the way C symbols are represented in the object file.  One use
13372 is to help link with legacy assembly code.
13374 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
13375 generate code that is not binary compatible with code generated without that
13376 switch.  Use it to conform to a non-default application binary interface.
13377 Not all targets provide complete support for this switch.
13379 @item -ftls-model=@var{model}
13380 @opindex ftls-model
13381 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
13382 The @var{model} argument should be one of @samp{global-dynamic},
13383 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
13384 Note that the choice is subject to optimization: the compiler may use
13385 a more efficient model for symbols not visible outside of the translation
13386 unit, or if @option{-fpic} is not given on the command line.
13388 The default without @option{-fpic} is @samp{initial-exec}; with
13389 @option{-fpic} the default is @samp{global-dynamic}.
13391 @item -ftrampolines
13392 @opindex ftrampolines
13393 For targets that normally need trampolines for nested functions, always
13394 generate them instead of using descriptors.  Otherwise, for targets that
13395 do not need them, like for example HP-PA or IA-64, do nothing.
13397 A trampoline is a small piece of code that is created at run time on the
13398 stack when the address of a nested function is taken, and is used to call
13399 the nested function indirectly.  Therefore, it requires the stack to be
13400 made executable in order for the program to work properly.
13402 @option{-fno-trampolines} is enabled by default on a language by language
13403 basis to let the compiler avoid generating them, if it computes that this
13404 is safe, and replace them with descriptors.  Descriptors are made up of data
13405 only, but the generated code must be prepared to deal with them.  As of this
13406 writing, @option{-fno-trampolines} is enabled by default only for Ada.
13408 Moreover, code compiled with @option{-ftrampolines} and code compiled with
13409 @option{-fno-trampolines} are not binary compatible if nested functions are
13410 present.  This option must therefore be used on a program-wide basis and be
13411 manipulated with extreme care.
13413 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
13414 @opindex fvisibility
13415 Set the default ELF image symbol visibility to the specified option---all
13416 symbols are marked with this unless overridden within the code.
13417 Using this feature can very substantially improve linking and
13418 load times of shared object libraries, produce more optimized
13419 code, provide near-perfect API export and prevent symbol clashes.
13420 It is @strong{strongly} recommended that you use this in any shared objects
13421 you distribute.
13423 Despite the nomenclature, @samp{default} always means public; i.e.,
13424 available to be linked against from outside the shared object.
13425 @samp{protected} and @samp{internal} are pretty useless in real-world
13426 usage so the only other commonly used option is @samp{hidden}.
13427 The default if @option{-fvisibility} isn't specified is
13428 @samp{default}, i.e., make every symbol public.
13430 A good explanation of the benefits offered by ensuring ELF
13431 symbols have the correct visibility is given by ``How To Write
13432 Shared Libraries'' by Ulrich Drepper (which can be found at
13433 @w{@uref{https://www.akkadia.org/drepper/}})---however a superior
13434 solution made possible by this option to marking things hidden when
13435 the default is public is to make the default hidden and mark things
13436 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
13437 and @code{__attribute__ ((visibility("default")))} instead of
13438 @code{__declspec(dllexport)} you get almost identical semantics with
13439 identical syntax.  This is a great boon to those working with
13440 cross-platform projects.
13442 For those adding visibility support to existing code, you may find
13443 @code{#pragma GCC visibility} of use.  This works by you enclosing
13444 the declarations you wish to set visibility for with (for example)
13445 @code{#pragma GCC visibility push(hidden)} and
13446 @code{#pragma GCC visibility pop}.
13447 Bear in mind that symbol visibility should be viewed @strong{as
13448 part of the API interface contract} and thus all new code should
13449 always specify visibility when it is not the default; i.e., declarations
13450 only for use within the local DSO should @strong{always} be marked explicitly
13451 as hidden as so to avoid PLT indirection overheads---making this
13452 abundantly clear also aids readability and self-documentation of the code.
13453 Note that due to ISO C++ specification requirements, @code{operator new} and
13454 @code{operator delete} must always be of default visibility.
13456 Be aware that headers from outside your project, in particular system
13457 headers and headers from any other library you use, may not be
13458 expecting to be compiled with visibility other than the default.  You
13459 may need to explicitly say @code{#pragma GCC visibility push(default)}
13460 before including any such headers.
13462 @code{extern} declarations are not affected by @option{-fvisibility}, so
13463 a lot of code can be recompiled with @option{-fvisibility=hidden} with
13464 no modifications.  However, this means that calls to @code{extern}
13465 functions with no explicit visibility use the PLT, so it is more
13466 effective to use @code{__attribute ((visibility))} and/or
13467 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
13468 declarations should be treated as hidden.
13470 Note that @option{-fvisibility} does affect C++ vague linkage
13471 entities. This means that, for instance, an exception class that is
13472 be thrown between DSOs must be explicitly marked with default
13473 visibility so that the @samp{type_info} nodes are unified between
13474 the DSOs.
13476 An overview of these techniques, their benefits and how to use them
13477 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
13479 @item -fstrict-volatile-bitfields
13480 @opindex fstrict-volatile-bitfields
13481 This option should be used if accesses to volatile bit-fields (or other
13482 structure fields, although the compiler usually honors those types
13483 anyway) should use a single access of the width of the
13484 field's type, aligned to a natural alignment if possible.  For
13485 example, targets with memory-mapped peripheral registers might require
13486 all such accesses to be 16 bits wide; with this flag you can
13487 declare all peripheral bit-fields as @code{unsigned short} (assuming short
13488 is 16 bits on these targets) to force GCC to use 16-bit accesses
13489 instead of, perhaps, a more efficient 32-bit access.
13491 If this option is disabled, the compiler uses the most efficient
13492 instruction.  In the previous example, that might be a 32-bit load
13493 instruction, even though that accesses bytes that do not contain
13494 any portion of the bit-field, or memory-mapped registers unrelated to
13495 the one being updated.
13497 In some cases, such as when the @code{packed} attribute is applied to a 
13498 structure field, it may not be possible to access the field with a single
13499 read or write that is correctly aligned for the target machine.  In this
13500 case GCC falls back to generating multiple accesses rather than code that 
13501 will fault or truncate the result at run time.
13503 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
13504 not allowed to touch non bit-field members.  It is therefore recommended
13505 to define all bits of the field's type as bit-field members.
13507 The default value of this option is determined by the application binary
13508 interface for the target processor.
13510 @item -fsync-libcalls
13511 @opindex fsync-libcalls
13512 This option controls whether any out-of-line instance of the @code{__sync}
13513 family of functions may be used to implement the C++11 @code{__atomic}
13514 family of functions.
13516 The default value of this option is enabled, thus the only useful form
13517 of the option is @option{-fno-sync-libcalls}.  This option is used in
13518 the implementation of the @file{libatomic} runtime library.
13520 @end table
13522 @node Developer Options
13523 @section GCC Developer Options
13524 @cindex developer options
13525 @cindex debugging GCC
13526 @cindex debug dump options
13527 @cindex dump options
13528 @cindex compilation statistics
13530 This section describes command-line options that are primarily of
13531 interest to GCC developers, including options to support compiler
13532 testing and investigation of compiler bugs and compile-time
13533 performance problems.  This includes options that produce debug dumps
13534 at various points in the compilation; that print statistics such as
13535 memory use and execution time; and that print information about GCC's
13536 configuration, such as where it searches for libraries.  You should
13537 rarely need to use any of these options for ordinary compilation and
13538 linking tasks.
13540 Many developer options that cause GCC to dump output to a file take an
13541 optional @samp{=@var{filename}} suffix. You can specify @samp{stdout}
13542 or @samp{-} to dump to standard output, and @samp{stderr} for standard
13543 error.
13545 If @samp{=@var{filename}} is omitted, a default dump file name is
13546 constructed by concatenating the base dump file name, a pass number,
13547 phase letter, and pass name.  The base dump file name is the name of
13548 output file produced by the compiler if explicitly specified and not
13549 an executable; otherwise it is the source file name.
13550 The pass number is determined by the order passes are registered with
13551 the compiler's pass manager. 
13552 This is generally the same as the order of execution, but passes
13553 registered by plugins, target-specific passes, or passes that are
13554 otherwise registered late are numbered higher than the pass named
13555 @samp{final}, even if they are executed earlier.  The phase letter is
13556 one of @samp{i} (inter-procedural analysis), @samp{l}
13557 (language-specific), @samp{r} (RTL), or @samp{t} (tree). 
13558 The files are created in the directory of the output file. 
13560 @table @gcctabopt
13562 @item -d@var{letters}
13563 @itemx -fdump-rtl-@var{pass}
13564 @itemx -fdump-rtl-@var{pass}=@var{filename}
13565 @opindex d
13566 @opindex fdump-rtl-@var{pass}
13567 Says to make debugging dumps during compilation at times specified by
13568 @var{letters}.  This is used for debugging the RTL-based passes of the
13569 compiler.
13571 Some @option{-d@var{letters}} switches have different meaning when
13572 @option{-E} is used for preprocessing.  @xref{Preprocessor Options},
13573 for information about preprocessor-specific dump options.
13575 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
13576 @option{-d} option @var{letters}.  Here are the possible
13577 letters for use in @var{pass} and @var{letters}, and their meanings:
13579 @table @gcctabopt
13581 @item -fdump-rtl-alignments
13582 @opindex fdump-rtl-alignments
13583 Dump after branch alignments have been computed.
13585 @item -fdump-rtl-asmcons
13586 @opindex fdump-rtl-asmcons
13587 Dump after fixing rtl statements that have unsatisfied in/out constraints.
13589 @item -fdump-rtl-auto_inc_dec
13590 @opindex fdump-rtl-auto_inc_dec
13591 Dump after auto-inc-dec discovery.  This pass is only run on
13592 architectures that have auto inc or auto dec instructions.
13594 @item -fdump-rtl-barriers
13595 @opindex fdump-rtl-barriers
13596 Dump after cleaning up the barrier instructions.
13598 @item -fdump-rtl-bbpart
13599 @opindex fdump-rtl-bbpart
13600 Dump after partitioning hot and cold basic blocks.
13602 @item -fdump-rtl-bbro
13603 @opindex fdump-rtl-bbro
13604 Dump after block reordering.
13606 @item -fdump-rtl-btl1
13607 @itemx -fdump-rtl-btl2
13608 @opindex fdump-rtl-btl2
13609 @opindex fdump-rtl-btl2
13610 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
13611 after the two branch
13612 target load optimization passes.
13614 @item -fdump-rtl-bypass
13615 @opindex fdump-rtl-bypass
13616 Dump after jump bypassing and control flow optimizations.
13618 @item -fdump-rtl-combine
13619 @opindex fdump-rtl-combine
13620 Dump after the RTL instruction combination pass.
13622 @item -fdump-rtl-compgotos
13623 @opindex fdump-rtl-compgotos
13624 Dump after duplicating the computed gotos.
13626 @item -fdump-rtl-ce1
13627 @itemx -fdump-rtl-ce2
13628 @itemx -fdump-rtl-ce3
13629 @opindex fdump-rtl-ce1
13630 @opindex fdump-rtl-ce2
13631 @opindex fdump-rtl-ce3
13632 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
13633 @option{-fdump-rtl-ce3} enable dumping after the three
13634 if conversion passes.
13636 @item -fdump-rtl-cprop_hardreg
13637 @opindex fdump-rtl-cprop_hardreg
13638 Dump after hard register copy propagation.
13640 @item -fdump-rtl-csa
13641 @opindex fdump-rtl-csa
13642 Dump after combining stack adjustments.
13644 @item -fdump-rtl-cse1
13645 @itemx -fdump-rtl-cse2
13646 @opindex fdump-rtl-cse1
13647 @opindex fdump-rtl-cse2
13648 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
13649 the two common subexpression elimination passes.
13651 @item -fdump-rtl-dce
13652 @opindex fdump-rtl-dce
13653 Dump after the standalone dead code elimination passes.
13655 @item -fdump-rtl-dbr
13656 @opindex fdump-rtl-dbr
13657 Dump after delayed branch scheduling.
13659 @item -fdump-rtl-dce1
13660 @itemx -fdump-rtl-dce2
13661 @opindex fdump-rtl-dce1
13662 @opindex fdump-rtl-dce2
13663 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
13664 the two dead store elimination passes.
13666 @item -fdump-rtl-eh
13667 @opindex fdump-rtl-eh
13668 Dump after finalization of EH handling code.
13670 @item -fdump-rtl-eh_ranges
13671 @opindex fdump-rtl-eh_ranges
13672 Dump after conversion of EH handling range regions.
13674 @item -fdump-rtl-expand
13675 @opindex fdump-rtl-expand
13676 Dump after RTL generation.
13678 @item -fdump-rtl-fwprop1
13679 @itemx -fdump-rtl-fwprop2
13680 @opindex fdump-rtl-fwprop1
13681 @opindex fdump-rtl-fwprop2
13682 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
13683 dumping after the two forward propagation passes.
13685 @item -fdump-rtl-gcse1
13686 @itemx -fdump-rtl-gcse2
13687 @opindex fdump-rtl-gcse1
13688 @opindex fdump-rtl-gcse2
13689 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
13690 after global common subexpression elimination.
13692 @item -fdump-rtl-init-regs
13693 @opindex fdump-rtl-init-regs
13694 Dump after the initialization of the registers.
13696 @item -fdump-rtl-initvals
13697 @opindex fdump-rtl-initvals
13698 Dump after the computation of the initial value sets.
13700 @item -fdump-rtl-into_cfglayout
13701 @opindex fdump-rtl-into_cfglayout
13702 Dump after converting to cfglayout mode.
13704 @item -fdump-rtl-ira
13705 @opindex fdump-rtl-ira
13706 Dump after iterated register allocation.
13708 @item -fdump-rtl-jump
13709 @opindex fdump-rtl-jump
13710 Dump after the second jump optimization.
13712 @item -fdump-rtl-loop2
13713 @opindex fdump-rtl-loop2
13714 @option{-fdump-rtl-loop2} enables dumping after the rtl
13715 loop optimization passes.
13717 @item -fdump-rtl-mach
13718 @opindex fdump-rtl-mach
13719 Dump after performing the machine dependent reorganization pass, if that
13720 pass exists.
13722 @item -fdump-rtl-mode_sw
13723 @opindex fdump-rtl-mode_sw
13724 Dump after removing redundant mode switches.
13726 @item -fdump-rtl-rnreg
13727 @opindex fdump-rtl-rnreg
13728 Dump after register renumbering.
13730 @item -fdump-rtl-outof_cfglayout
13731 @opindex fdump-rtl-outof_cfglayout
13732 Dump after converting from cfglayout mode.
13734 @item -fdump-rtl-peephole2
13735 @opindex fdump-rtl-peephole2
13736 Dump after the peephole pass.
13738 @item -fdump-rtl-postreload
13739 @opindex fdump-rtl-postreload
13740 Dump after post-reload optimizations.
13742 @item -fdump-rtl-pro_and_epilogue
13743 @opindex fdump-rtl-pro_and_epilogue
13744 Dump after generating the function prologues and epilogues.
13746 @item -fdump-rtl-sched1
13747 @itemx -fdump-rtl-sched2
13748 @opindex fdump-rtl-sched1
13749 @opindex fdump-rtl-sched2
13750 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
13751 after the basic block scheduling passes.
13753 @item -fdump-rtl-ree
13754 @opindex fdump-rtl-ree
13755 Dump after sign/zero extension elimination.
13757 @item -fdump-rtl-seqabstr
13758 @opindex fdump-rtl-seqabstr
13759 Dump after common sequence discovery.
13761 @item -fdump-rtl-shorten
13762 @opindex fdump-rtl-shorten
13763 Dump after shortening branches.
13765 @item -fdump-rtl-sibling
13766 @opindex fdump-rtl-sibling
13767 Dump after sibling call optimizations.
13769 @item -fdump-rtl-split1
13770 @itemx -fdump-rtl-split2
13771 @itemx -fdump-rtl-split3
13772 @itemx -fdump-rtl-split4
13773 @itemx -fdump-rtl-split5
13774 @opindex fdump-rtl-split1
13775 @opindex fdump-rtl-split2
13776 @opindex fdump-rtl-split3
13777 @opindex fdump-rtl-split4
13778 @opindex fdump-rtl-split5
13779 These options enable dumping after five rounds of
13780 instruction splitting.
13782 @item -fdump-rtl-sms
13783 @opindex fdump-rtl-sms
13784 Dump after modulo scheduling.  This pass is only run on some
13785 architectures.
13787 @item -fdump-rtl-stack
13788 @opindex fdump-rtl-stack
13789 Dump after conversion from GCC's ``flat register file'' registers to the
13790 x87's stack-like registers.  This pass is only run on x86 variants.
13792 @item -fdump-rtl-subreg1
13793 @itemx -fdump-rtl-subreg2
13794 @opindex fdump-rtl-subreg1
13795 @opindex fdump-rtl-subreg2
13796 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
13797 the two subreg expansion passes.
13799 @item -fdump-rtl-unshare
13800 @opindex fdump-rtl-unshare
13801 Dump after all rtl has been unshared.
13803 @item -fdump-rtl-vartrack
13804 @opindex fdump-rtl-vartrack
13805 Dump after variable tracking.
13807 @item -fdump-rtl-vregs
13808 @opindex fdump-rtl-vregs
13809 Dump after converting virtual registers to hard registers.
13811 @item -fdump-rtl-web
13812 @opindex fdump-rtl-web
13813 Dump after live range splitting.
13815 @item -fdump-rtl-regclass
13816 @itemx -fdump-rtl-subregs_of_mode_init
13817 @itemx -fdump-rtl-subregs_of_mode_finish
13818 @itemx -fdump-rtl-dfinit
13819 @itemx -fdump-rtl-dfinish
13820 @opindex fdump-rtl-regclass
13821 @opindex fdump-rtl-subregs_of_mode_init
13822 @opindex fdump-rtl-subregs_of_mode_finish
13823 @opindex fdump-rtl-dfinit
13824 @opindex fdump-rtl-dfinish
13825 These dumps are defined but always produce empty files.
13827 @item -da
13828 @itemx -fdump-rtl-all
13829 @opindex da
13830 @opindex fdump-rtl-all
13831 Produce all the dumps listed above.
13833 @item -dA
13834 @opindex dA
13835 Annotate the assembler output with miscellaneous debugging information.
13837 @item -dD
13838 @opindex dD
13839 Dump all macro definitions, at the end of preprocessing, in addition to
13840 normal output.
13842 @item -dH
13843 @opindex dH
13844 Produce a core dump whenever an error occurs.
13846 @item -dp
13847 @opindex dp
13848 Annotate the assembler output with a comment indicating which
13849 pattern and alternative is used.  The length and cost of each instruction are
13850 also printed.
13852 @item -dP
13853 @opindex dP
13854 Dump the RTL in the assembler output as a comment before each instruction.
13855 Also turns on @option{-dp} annotation.
13857 @item -dx
13858 @opindex dx
13859 Just generate RTL for a function instead of compiling it.  Usually used
13860 with @option{-fdump-rtl-expand}.
13861 @end table
13863 @item -fdump-debug
13864 @opindex fdump-debug
13865 Dump debugging information generated during the debug
13866 generation phase.
13868 @item -fdump-earlydebug
13869 @opindex fdump-earlydebug
13870 Dump debugging information generated during the early debug
13871 generation phase.
13873 @item -fdump-noaddr
13874 @opindex fdump-noaddr
13875 When doing debugging dumps, suppress address output.  This makes it more
13876 feasible to use diff on debugging dumps for compiler invocations with
13877 different compiler binaries and/or different
13878 text / bss / data / heap / stack / dso start locations.
13880 @item -freport-bug
13881 @opindex freport-bug
13882 Collect and dump debug information into a temporary file if an
13883 internal compiler error (ICE) occurs.
13885 @item -fdump-unnumbered
13886 @opindex fdump-unnumbered
13887 When doing debugging dumps, suppress instruction numbers and address output.
13888 This makes it more feasible to use diff on debugging dumps for compiler
13889 invocations with different options, in particular with and without
13890 @option{-g}.
13892 @item -fdump-unnumbered-links
13893 @opindex fdump-unnumbered-links
13894 When doing debugging dumps (see @option{-d} option above), suppress
13895 instruction numbers for the links to the previous and next instructions
13896 in a sequence.
13898 @item -fdump-ipa-@var{switch}
13899 @opindex fdump-ipa
13900 Control the dumping at various stages of inter-procedural analysis
13901 language tree to a file.  The file name is generated by appending a
13902 switch specific suffix to the source file name, and the file is created
13903 in the same directory as the output file.  The following dumps are
13904 possible:
13906 @table @samp
13907 @item all
13908 Enables all inter-procedural analysis dumps.
13910 @item cgraph
13911 Dumps information about call-graph optimization, unused function removal,
13912 and inlining decisions.
13914 @item inline
13915 Dump after function inlining.
13917 @end table
13919 @item -fdump-lang-all
13920 @itemx -fdump-lang-@var{switch}
13921 @itemx -fdump-lang-@var{switch}-@var{options}
13922 @itemx -fdump-lang-@var{switch}-@var{options}=@var{filename}
13923 @opindex fdump-lang-all
13924 @opindex fdump-lang
13925 Control the dumping of language-specific information.  The @var{options}
13926 and @var{filename} portions behave as described in the
13927 @option{-fdump-tree} option.  The following @var{switch} values are
13928 accepted:
13930 @table @samp
13931 @item all
13933 Enable all language-specific dumps.
13935 @item class
13936 Dump class hierarchy information.  Virtual table information is emitted
13937 unless '@option{slim}' is specified.  This option is applicable to C++ only.
13939 @item raw
13940 Dump the raw internal tree data.  This option is applicable to C++ only.
13942 @end table
13944 @item -fdump-passes
13945 @opindex fdump-passes
13946 Print on @file{stderr} the list of optimization passes that are turned
13947 on and off by the current command-line options.
13949 @item -fdump-statistics-@var{option}
13950 @opindex fdump-statistics
13951 Enable and control dumping of pass statistics in a separate file.  The
13952 file name is generated by appending a suffix ending in
13953 @samp{.statistics} to the source file name, and the file is created in
13954 the same directory as the output file.  If the @samp{-@var{option}}
13955 form is used, @samp{-stats} causes counters to be summed over the
13956 whole compilation unit while @samp{-details} dumps every event as
13957 the passes generate them.  The default with no option is to sum
13958 counters for each function compiled.
13960 @item -fdump-tree-all
13961 @itemx -fdump-tree-@var{switch}
13962 @itemx -fdump-tree-@var{switch}-@var{options}
13963 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
13964 @opindex fdump-tree-all
13965 @opindex fdump-tree
13966 Control the dumping at various stages of processing the intermediate
13967 language tree to a file.  If the @samp{-@var{options}}
13968 form is used, @var{options} is a list of @samp{-} separated options
13969 which control the details of the dump.  Not all options are applicable
13970 to all dumps; those that are not meaningful are ignored.  The
13971 following options are available
13973 @table @samp
13974 @item address
13975 Print the address of each node.  Usually this is not meaningful as it
13976 changes according to the environment and source file.  Its primary use
13977 is for tying up a dump file with a debug environment.
13978 @item asmname
13979 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
13980 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
13981 use working backward from mangled names in the assembly file.
13982 @item slim
13983 When dumping front-end intermediate representations, inhibit dumping
13984 of members of a scope or body of a function merely because that scope
13985 has been reached.  Only dump such items when they are directly reachable
13986 by some other path.
13988 When dumping pretty-printed trees, this option inhibits dumping the
13989 bodies of control structures.
13991 When dumping RTL, print the RTL in slim (condensed) form instead of
13992 the default LISP-like representation.
13993 @item raw
13994 Print a raw representation of the tree.  By default, trees are
13995 pretty-printed into a C-like representation.
13996 @item details
13997 Enable more detailed dumps (not honored by every dump option). Also
13998 include information from the optimization passes.
13999 @item stats
14000 Enable dumping various statistics about the pass (not honored by every dump
14001 option).
14002 @item blocks
14003 Enable showing basic block boundaries (disabled in raw dumps).
14004 @item graph
14005 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
14006 dump a representation of the control flow graph suitable for viewing with
14007 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
14008 the file is pretty-printed as a subgraph, so that GraphViz can render them
14009 all in a single plot.
14011 This option currently only works for RTL dumps, and the RTL is always
14012 dumped in slim form.
14013 @item vops
14014 Enable showing virtual operands for every statement.
14015 @item lineno
14016 Enable showing line numbers for statements.
14017 @item uid
14018 Enable showing the unique ID (@code{DECL_UID}) for each variable.
14019 @item verbose
14020 Enable showing the tree dump for each statement.
14021 @item eh
14022 Enable showing the EH region number holding each statement.
14023 @item scev
14024 Enable showing scalar evolution analysis details.
14025 @item optimized
14026 Enable showing optimization information (only available in certain
14027 passes).
14028 @item missed
14029 Enable showing missed optimization information (only available in certain
14030 passes).
14031 @item note
14032 Enable other detailed optimization information (only available in
14033 certain passes).
14034 @item all
14035 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
14036 and @option{lineno}.
14037 @item optall
14038 Turn on all optimization options, i.e., @option{optimized},
14039 @option{missed}, and @option{note}.
14040 @end table
14042 To determine what tree dumps are available or find the dump for a pass
14043 of interest follow the steps below.
14045 @enumerate
14046 @item
14047 Invoke GCC with @option{-fdump-passes} and in the @file{stderr} output
14048 look for a code that corresponds to the pass you are interested in.
14049 For example, the codes @code{tree-evrp}, @code{tree-vrp1}, and
14050 @code{tree-vrp2} correspond to the three Value Range Propagation passes.
14051 The number at the end distinguishes distinct invocations of the same pass.
14052 @item
14053 To enable the creation of the dump file, append the pass code to
14054 the @option{-fdump-} option prefix and invoke GCC with it.  For example,
14055 to enable the dump from the Early Value Range Propagation pass, invoke
14056 GCC with the @option{-fdump-tree-evrp} option.  Optionally, you may
14057 specify the name of the dump file.  If you don't specify one, GCC
14058 creates as described below.
14059 @item
14060 Find the pass dump in a file whose name is composed of three components
14061 separated by a period: the name of the source file GCC was invoked to
14062 compile, a numeric suffix indicating the pass number followed by the
14063 letter @samp{t} for tree passes (and the letter @samp{r} for RTL passes),
14064 and finally the pass code.  For example, the Early VRP pass dump might
14065 be in a file named @file{myfile.c.038t.evrp} in the current working
14066 directory.  Note that the numeric codes are not stable and may change
14067 from one version of GCC to another.
14068 @end enumerate
14070 @item -fopt-info
14071 @itemx -fopt-info-@var{options}
14072 @itemx -fopt-info-@var{options}=@var{filename}
14073 @opindex fopt-info
14074 Controls optimization dumps from various optimization passes. If the
14075 @samp{-@var{options}} form is used, @var{options} is a list of
14076 @samp{-} separated option keywords to select the dump details and
14077 optimizations.  
14079 The @var{options} can be divided into two groups: options describing the
14080 verbosity of the dump, and options describing which optimizations
14081 should be included. The options from both the groups can be freely
14082 mixed as they are non-overlapping. However, in case of any conflicts,
14083 the later options override the earlier options on the command
14084 line. 
14086 The following options control the dump verbosity:
14088 @table @samp
14089 @item optimized
14090 Print information when an optimization is successfully applied. It is
14091 up to a pass to decide which information is relevant. For example, the
14092 vectorizer passes print the source location of loops which are
14093 successfully vectorized.
14094 @item missed
14095 Print information about missed optimizations. Individual passes
14096 control which information to include in the output. 
14097 @item note
14098 Print verbose information about optimizations, such as certain
14099 transformations, more detailed messages about decisions etc.
14100 @item all
14101 Print detailed optimization information. This includes
14102 @samp{optimized}, @samp{missed}, and @samp{note}.
14103 @end table
14105 One or more of the following option keywords can be used to describe a
14106 group of optimizations:
14108 @table @samp
14109 @item ipa
14110 Enable dumps from all interprocedural optimizations.
14111 @item loop
14112 Enable dumps from all loop optimizations.
14113 @item inline
14114 Enable dumps from all inlining optimizations.
14115 @item omp
14116 Enable dumps from all OMP (Offloading and Multi Processing) optimizations.
14117 @item vec
14118 Enable dumps from all vectorization optimizations.
14119 @item optall
14120 Enable dumps from all optimizations. This is a superset of
14121 the optimization groups listed above.
14122 @end table
14124 If @var{options} is
14125 omitted, it defaults to @samp{optimized-optall}, which means to dump all
14126 info about successful optimizations from all the passes.  
14128 If the @var{filename} is provided, then the dumps from all the
14129 applicable optimizations are concatenated into the @var{filename}.
14130 Otherwise the dump is output onto @file{stderr}. Though multiple
14131 @option{-fopt-info} options are accepted, only one of them can include
14132 a @var{filename}. If other filenames are provided then all but the
14133 first such option are ignored.
14135 Note that the output @var{filename} is overwritten
14136 in case of multiple translation units. If a combined output from
14137 multiple translation units is desired, @file{stderr} should be used
14138 instead.
14140 In the following example, the optimization info is output to
14141 @file{stderr}:
14143 @smallexample
14144 gcc -O3 -fopt-info
14145 @end smallexample
14147 This example:
14148 @smallexample
14149 gcc -O3 -fopt-info-missed=missed.all
14150 @end smallexample
14152 @noindent
14153 outputs missed optimization report from all the passes into
14154 @file{missed.all}, and this one:
14156 @smallexample
14157 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
14158 @end smallexample
14160 @noindent
14161 prints information about missed optimization opportunities from
14162 vectorization passes on @file{stderr}.  
14163 Note that @option{-fopt-info-vec-missed} is equivalent to 
14164 @option{-fopt-info-missed-vec}.  The order of the optimization group
14165 names and message types listed after @option{-fopt-info} does not matter.
14167 As another example,
14168 @smallexample
14169 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
14170 @end smallexample
14172 @noindent
14173 outputs information about missed optimizations as well as
14174 optimized locations from all the inlining passes into
14175 @file{inline.txt}.
14177 Finally, consider:
14179 @smallexample
14180 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
14181 @end smallexample
14183 @noindent
14184 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
14185 in conflict since only one output file is allowed. In this case, only
14186 the first option takes effect and the subsequent options are
14187 ignored. Thus only @file{vec.miss} is produced which contains
14188 dumps from the vectorizer about missed opportunities.
14190 @item -fsave-optimization-record
14191 @opindex fsave-optimization-record
14192 Write a SRCFILE.opt-record.json file detailing what optimizations
14193 were performed, for those optimizations that support @option{-fopt-info}.
14195 This option is experimental and the format of the data within the JSON
14196 file is subject to change.
14198 It is roughly equivalent to a machine-readable version of
14199 @option{-fopt-info-all}, as a collection of messages with source file,
14200 line number and column number, with the following additional data for
14201 each message:
14203 @itemize @bullet
14205 @item
14206 the execution count of the code being optimized, along with metadata about
14207 whether this was from actual profile data, or just an estimate, allowing
14208 consumers to prioritize messages by code hotness,
14210 @item
14211 the function name of the code being optimized, where applicable,
14213 @item
14214 the ``inlining chain'' for the code being optimized, so that when
14215 a function is inlined into several different places (which might
14216 themselves be inlined), the reader can distinguish between the copies,
14218 @item
14219 objects identifying those parts of the message that refer to expressions,
14220 statements or symbol-table nodes, which of these categories they are, and,
14221 when available, their source code location,
14223 @item
14224 the GCC pass that emitted the message, and
14226 @item
14227 the location in GCC's own code from which the message was emitted
14229 @end itemize
14231 Additionally, some messages are logically nested within other
14232 messages, reflecting implementation details of the optimization
14233 passes.
14235 @item -fsched-verbose=@var{n}
14236 @opindex fsched-verbose
14237 On targets that use instruction scheduling, this option controls the
14238 amount of debugging output the scheduler prints to the dump files.
14240 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
14241 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
14242 For @var{n} greater than one, it also output basic block probabilities,
14243 detailed ready list information and unit/insn info.  For @var{n} greater
14244 than two, it includes RTL at abort point, control-flow and regions info.
14245 And for @var{n} over four, @option{-fsched-verbose} also includes
14246 dependence info.
14250 @item -fenable-@var{kind}-@var{pass}
14251 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
14252 @opindex fdisable-
14253 @opindex fenable-
14255 This is a set of options that are used to explicitly disable/enable
14256 optimization passes.  These options are intended for use for debugging GCC.
14257 Compiler users should use regular options for enabling/disabling
14258 passes instead.
14260 @table @gcctabopt
14262 @item -fdisable-ipa-@var{pass}
14263 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
14264 statically invoked in the compiler multiple times, the pass name should be
14265 appended with a sequential number starting from 1.
14267 @item -fdisable-rtl-@var{pass}
14268 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
14269 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
14270 statically invoked in the compiler multiple times, the pass name should be
14271 appended with a sequential number starting from 1.  @var{range-list} is a 
14272 comma-separated list of function ranges or assembler names.  Each range is a number
14273 pair separated by a colon.  The range is inclusive in both ends.  If the range
14274 is trivial, the number pair can be simplified as a single number.  If the
14275 function's call graph node's @var{uid} falls within one of the specified ranges,
14276 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
14277 function header of a dump file, and the pass names can be dumped by using
14278 option @option{-fdump-passes}.
14280 @item -fdisable-tree-@var{pass}
14281 @itemx -fdisable-tree-@var{pass}=@var{range-list}
14282 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
14283 option arguments.
14285 @item -fenable-ipa-@var{pass}
14286 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
14287 statically invoked in the compiler multiple times, the pass name should be
14288 appended with a sequential number starting from 1.
14290 @item -fenable-rtl-@var{pass}
14291 @itemx -fenable-rtl-@var{pass}=@var{range-list}
14292 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
14293 description and examples.
14295 @item -fenable-tree-@var{pass}
14296 @itemx -fenable-tree-@var{pass}=@var{range-list}
14297 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
14298 of option arguments.
14300 @end table
14302 Here are some examples showing uses of these options.
14304 @smallexample
14306 # disable ccp1 for all functions
14307    -fdisable-tree-ccp1
14308 # disable complete unroll for function whose cgraph node uid is 1
14309    -fenable-tree-cunroll=1
14310 # disable gcse2 for functions at the following ranges [1,1],
14311 # [300,400], and [400,1000]
14312 # disable gcse2 for functions foo and foo2
14313    -fdisable-rtl-gcse2=foo,foo2
14314 # disable early inlining
14315    -fdisable-tree-einline
14316 # disable ipa inlining
14317    -fdisable-ipa-inline
14318 # enable tree full unroll
14319    -fenable-tree-unroll
14321 @end smallexample
14323 @item -fchecking
14324 @itemx -fchecking=@var{n}
14325 @opindex fchecking
14326 @opindex fno-checking
14327 Enable internal consistency checking.  The default depends on
14328 the compiler configuration.  @option{-fchecking=2} enables further
14329 internal consistency checking that might affect code generation.
14331 @item -frandom-seed=@var{string}
14332 @opindex frandom-seed
14333 This option provides a seed that GCC uses in place of
14334 random numbers in generating certain symbol names
14335 that have to be different in every compiled file.  It is also used to
14336 place unique stamps in coverage data files and the object files that
14337 produce them.  You can use the @option{-frandom-seed} option to produce
14338 reproducibly identical object files.
14340 The @var{string} can either be a number (decimal, octal or hex) or an
14341 arbitrary string (in which case it's converted to a number by
14342 computing CRC32).
14344 The @var{string} should be different for every file you compile.
14346 @item -save-temps
14347 @itemx -save-temps=cwd
14348 @opindex save-temps
14349 Store the usual ``temporary'' intermediate files permanently; place them
14350 in the current directory and name them based on the source file.  Thus,
14351 compiling @file{foo.c} with @option{-c -save-temps} produces files
14352 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
14353 preprocessed @file{foo.i} output file even though the compiler now
14354 normally uses an integrated preprocessor.
14356 When used in combination with the @option{-x} command-line option,
14357 @option{-save-temps} is sensible enough to avoid over writing an
14358 input source file with the same extension as an intermediate file.
14359 The corresponding intermediate file may be obtained by renaming the
14360 source file before using @option{-save-temps}.
14362 If you invoke GCC in parallel, compiling several different source
14363 files that share a common base name in different subdirectories or the
14364 same source file compiled for multiple output destinations, it is
14365 likely that the different parallel compilers will interfere with each
14366 other, and overwrite the temporary files.  For instance:
14368 @smallexample
14369 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
14370 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
14371 @end smallexample
14373 may result in @file{foo.i} and @file{foo.o} being written to
14374 simultaneously by both compilers.
14376 @item -save-temps=obj
14377 @opindex save-temps=obj
14378 Store the usual ``temporary'' intermediate files permanently.  If the
14379 @option{-o} option is used, the temporary files are based on the
14380 object file.  If the @option{-o} option is not used, the
14381 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
14383 For example:
14385 @smallexample
14386 gcc -save-temps=obj -c foo.c
14387 gcc -save-temps=obj -c bar.c -o dir/xbar.o
14388 gcc -save-temps=obj foobar.c -o dir2/yfoobar
14389 @end smallexample
14391 @noindent
14392 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
14393 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
14394 @file{dir2/yfoobar.o}.
14396 @item -time@r{[}=@var{file}@r{]}
14397 @opindex time
14398 Report the CPU time taken by each subprocess in the compilation
14399 sequence.  For C source files, this is the compiler proper and assembler
14400 (plus the linker if linking is done).
14402 Without the specification of an output file, the output looks like this:
14404 @smallexample
14405 # cc1 0.12 0.01
14406 # as 0.00 0.01
14407 @end smallexample
14409 The first number on each line is the ``user time'', that is time spent
14410 executing the program itself.  The second number is ``system time'',
14411 time spent executing operating system routines on behalf of the program.
14412 Both numbers are in seconds.
14414 With the specification of an output file, the output is appended to the
14415 named file, and it looks like this:
14417 @smallexample
14418 0.12 0.01 cc1 @var{options}
14419 0.00 0.01 as @var{options}
14420 @end smallexample
14422 The ``user time'' and the ``system time'' are moved before the program
14423 name, and the options passed to the program are displayed, so that one
14424 can later tell what file was being compiled, and with which options.
14426 @item -fdump-final-insns@r{[}=@var{file}@r{]}
14427 @opindex fdump-final-insns
14428 Dump the final internal representation (RTL) to @var{file}.  If the
14429 optional argument is omitted (or if @var{file} is @code{.}), the name
14430 of the dump file is determined by appending @code{.gkd} to the
14431 compilation output file name.
14433 @item -fcompare-debug@r{[}=@var{opts}@r{]}
14434 @opindex fcompare-debug
14435 @opindex fno-compare-debug
14436 If no error occurs during compilation, run the compiler a second time,
14437 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
14438 passed to the second compilation.  Dump the final internal
14439 representation in both compilations, and print an error if they differ.
14441 If the equal sign is omitted, the default @option{-gtoggle} is used.
14443 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
14444 and nonzero, implicitly enables @option{-fcompare-debug}.  If
14445 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
14446 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
14447 is used.
14449 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
14450 is equivalent to @option{-fno-compare-debug}, which disables the dumping
14451 of the final representation and the second compilation, preventing even
14452 @env{GCC_COMPARE_DEBUG} from taking effect.
14454 To verify full coverage during @option{-fcompare-debug} testing, set
14455 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
14456 which GCC rejects as an invalid option in any actual compilation
14457 (rather than preprocessing, assembly or linking).  To get just a
14458 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
14459 not overridden} will do.
14461 @item -fcompare-debug-second
14462 @opindex fcompare-debug-second
14463 This option is implicitly passed to the compiler for the second
14464 compilation requested by @option{-fcompare-debug}, along with options to
14465 silence warnings, and omitting other options that would cause the compiler
14466 to produce output to files or to standard output as a side effect.  Dump
14467 files and preserved temporary files are renamed so as to contain the
14468 @code{.gk} additional extension during the second compilation, to avoid
14469 overwriting those generated by the first.
14471 When this option is passed to the compiler driver, it causes the
14472 @emph{first} compilation to be skipped, which makes it useful for little
14473 other than debugging the compiler proper.
14475 @item -gtoggle
14476 @opindex gtoggle
14477 Turn off generation of debug info, if leaving out this option
14478 generates it, or turn it on at level 2 otherwise.  The position of this
14479 argument in the command line does not matter; it takes effect after all
14480 other options are processed, and it does so only once, no matter how
14481 many times it is given.  This is mainly intended to be used with
14482 @option{-fcompare-debug}.
14484 @item -fvar-tracking-assignments-toggle
14485 @opindex fvar-tracking-assignments-toggle
14486 @opindex fno-var-tracking-assignments-toggle
14487 Toggle @option{-fvar-tracking-assignments}, in the same way that
14488 @option{-gtoggle} toggles @option{-g}.
14490 @item -Q
14491 @opindex Q
14492 Makes the compiler print out each function name as it is compiled, and
14493 print some statistics about each pass when it finishes.
14495 @item -ftime-report
14496 @opindex ftime-report
14497 Makes the compiler print some statistics about the time consumed by each
14498 pass when it finishes.
14500 @item -ftime-report-details
14501 @opindex ftime-report-details
14502 Record the time consumed by infrastructure parts separately for each pass.
14504 @item -fira-verbose=@var{n}
14505 @opindex fira-verbose
14506 Control the verbosity of the dump file for the integrated register allocator.
14507 The default value is 5.  If the value @var{n} is greater or equal to 10,
14508 the dump output is sent to stderr using the same format as @var{n} minus 10.
14510 @item -flto-report
14511 @opindex flto-report
14512 Prints a report with internal details on the workings of the link-time
14513 optimizer.  The contents of this report vary from version to version.
14514 It is meant to be useful to GCC developers when processing object
14515 files in LTO mode (via @option{-flto}).
14517 Disabled by default.
14519 @item -flto-report-wpa
14520 @opindex flto-report-wpa
14521 Like @option{-flto-report}, but only print for the WPA phase of Link
14522 Time Optimization.
14524 @item -fmem-report
14525 @opindex fmem-report
14526 Makes the compiler print some statistics about permanent memory
14527 allocation when it finishes.
14529 @item -fmem-report-wpa
14530 @opindex fmem-report-wpa
14531 Makes the compiler print some statistics about permanent memory
14532 allocation for the WPA phase only.
14534 @item -fpre-ipa-mem-report
14535 @opindex fpre-ipa-mem-report
14536 @item -fpost-ipa-mem-report
14537 @opindex fpost-ipa-mem-report
14538 Makes the compiler print some statistics about permanent memory
14539 allocation before or after interprocedural optimization.
14541 @item -fprofile-report
14542 @opindex fprofile-report
14543 Makes the compiler print some statistics about consistency of the
14544 (estimated) profile and effect of individual passes.
14546 @item -fstack-usage
14547 @opindex fstack-usage
14548 Makes the compiler output stack usage information for the program, on a
14549 per-function basis.  The filename for the dump is made by appending
14550 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
14551 the output file, if explicitly specified and it is not an executable,
14552 otherwise it is the basename of the source file.  An entry is made up
14553 of three fields:
14555 @itemize
14556 @item
14557 The name of the function.
14558 @item
14559 A number of bytes.
14560 @item
14561 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
14562 @end itemize
14564 The qualifier @code{static} means that the function manipulates the stack
14565 statically: a fixed number of bytes are allocated for the frame on function
14566 entry and released on function exit; no stack adjustments are otherwise made
14567 in the function.  The second field is this fixed number of bytes.
14569 The qualifier @code{dynamic} means that the function manipulates the stack
14570 dynamically: in addition to the static allocation described above, stack
14571 adjustments are made in the body of the function, for example to push/pop
14572 arguments around function calls.  If the qualifier @code{bounded} is also
14573 present, the amount of these adjustments is bounded at compile time and
14574 the second field is an upper bound of the total amount of stack used by
14575 the function.  If it is not present, the amount of these adjustments is
14576 not bounded at compile time and the second field only represents the
14577 bounded part.
14579 @item -fstats
14580 @opindex fstats
14581 Emit statistics about front-end processing at the end of the compilation.
14582 This option is supported only by the C++ front end, and
14583 the information is generally only useful to the G++ development team.
14585 @item -fdbg-cnt-list
14586 @opindex fdbg-cnt-list
14587 Print the name and the counter upper bound for all debug counters.
14590 @item -fdbg-cnt=@var{counter-value-list}
14591 @opindex fdbg-cnt
14592 Set the internal debug counter lower and upper bound.  @var{counter-value-list}
14593 is a comma-separated list of @var{name}:@var{lower_bound}:@var{upper_bound}
14594 tuples which sets the lower and the upper bound of each debug
14595 counter @var{name}.  The @var{lower_bound} is optional and is zero
14596 initialized if not set.
14597 All debug counters have the initial upper bound of @code{UINT_MAX};
14598 thus @code{dbg_cnt} returns true always unless the upper bound
14599 is set by this option.
14600 For example, with @option{-fdbg-cnt=dce:2:4,tail_call:10},
14601 @code{dbg_cnt(dce)} returns true only for third and fourth invocation.
14602 For @code{dbg_cnt(tail_call)} true is returned for first 10 invocations.
14604 @item -print-file-name=@var{library}
14605 @opindex print-file-name
14606 Print the full absolute name of the library file @var{library} that
14607 would be used when linking---and don't do anything else.  With this
14608 option, GCC does not compile or link anything; it just prints the
14609 file name.
14611 @item -print-multi-directory
14612 @opindex print-multi-directory
14613 Print the directory name corresponding to the multilib selected by any
14614 other switches present in the command line.  This directory is supposed
14615 to exist in @env{GCC_EXEC_PREFIX}.
14617 @item -print-multi-lib
14618 @opindex print-multi-lib
14619 Print the mapping from multilib directory names to compiler switches
14620 that enable them.  The directory name is separated from the switches by
14621 @samp{;}, and each switch starts with an @samp{@@} instead of the
14622 @samp{-}, without spaces between multiple switches.  This is supposed to
14623 ease shell processing.
14625 @item -print-multi-os-directory
14626 @opindex print-multi-os-directory
14627 Print the path to OS libraries for the selected
14628 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
14629 present in the @file{lib} subdirectory and no multilibs are used, this is
14630 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
14631 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
14632 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
14633 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
14635 @item -print-multiarch
14636 @opindex print-multiarch
14637 Print the path to OS libraries for the selected multiarch,
14638 relative to some @file{lib} subdirectory.
14640 @item -print-prog-name=@var{program}
14641 @opindex print-prog-name
14642 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
14644 @item -print-libgcc-file-name
14645 @opindex print-libgcc-file-name
14646 Same as @option{-print-file-name=libgcc.a}.
14648 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
14649 but you do want to link with @file{libgcc.a}.  You can do:
14651 @smallexample
14652 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
14653 @end smallexample
14655 @item -print-search-dirs
14656 @opindex print-search-dirs
14657 Print the name of the configured installation directory and a list of
14658 program and library directories @command{gcc} searches---and don't do anything else.
14660 This is useful when @command{gcc} prints the error message
14661 @samp{installation problem, cannot exec cpp0: No such file or directory}.
14662 To resolve this you either need to put @file{cpp0} and the other compiler
14663 components where @command{gcc} expects to find them, or you can set the environment
14664 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
14665 Don't forget the trailing @samp{/}.
14666 @xref{Environment Variables}.
14668 @item -print-sysroot
14669 @opindex print-sysroot
14670 Print the target sysroot directory that is used during
14671 compilation.  This is the target sysroot specified either at configure
14672 time or using the @option{--sysroot} option, possibly with an extra
14673 suffix that depends on compilation options.  If no target sysroot is
14674 specified, the option prints nothing.
14676 @item -print-sysroot-headers-suffix
14677 @opindex print-sysroot-headers-suffix
14678 Print the suffix added to the target sysroot when searching for
14679 headers, or give an error if the compiler is not configured with such
14680 a suffix---and don't do anything else.
14682 @item -dumpmachine
14683 @opindex dumpmachine
14684 Print the compiler's target machine (for example,
14685 @samp{i686-pc-linux-gnu})---and don't do anything else.
14687 @item -dumpversion
14688 @opindex dumpversion
14689 Print the compiler version (for example, @code{3.0}, @code{6.3.0} or @code{7})---and don't do
14690 anything else.  This is the compiler version used in filesystem paths,
14691 specs, can be depending on how the compiler has been configured just
14692 a single number (major version), two numbers separated by dot (major and
14693 minor version) or three numbers separated by dots (major, minor and patchlevel
14694 version).
14696 @item -dumpfullversion
14697 @opindex dumpfullversion
14698 Print the full compiler version, always 3 numbers separated by dots,
14699 major, minor and patchlevel version.
14701 @item -dumpspecs
14702 @opindex dumpspecs
14703 Print the compiler's built-in specs---and don't do anything else.  (This
14704 is used when GCC itself is being built.)  @xref{Spec Files}.
14705 @end table
14707 @node Submodel Options
14708 @section Machine-Dependent Options
14709 @cindex submodel options
14710 @cindex specifying hardware config
14711 @cindex hardware models and configurations, specifying
14712 @cindex target-dependent options
14713 @cindex machine-dependent options
14715 Each target machine supported by GCC can have its own options---for
14716 example, to allow you to compile for a particular processor variant or
14717 ABI, or to control optimizations specific to that machine.  By
14718 convention, the names of machine-specific options start with
14719 @samp{-m}.
14721 Some configurations of the compiler also support additional target-specific
14722 options, usually for compatibility with other compilers on the same
14723 platform.
14725 @c This list is ordered alphanumerically by subsection name.
14726 @c It should be the same order and spelling as these options are listed
14727 @c in Machine Dependent Options
14729 @menu
14730 * AArch64 Options::
14731 * Adapteva Epiphany Options::
14732 * ARC Options::
14733 * ARM Options::
14734 * AVR Options::
14735 * Blackfin Options::
14736 * C6X Options::
14737 * CRIS Options::
14738 * CR16 Options::
14739 * C-SKY Options::
14740 * Darwin Options::
14741 * DEC Alpha Options::
14742 * FR30 Options::
14743 * FT32 Options::
14744 * FRV Options::
14745 * GNU/Linux Options::
14746 * H8/300 Options::
14747 * HPPA Options::
14748 * IA-64 Options::
14749 * LM32 Options::
14750 * M32C Options::
14751 * M32R/D Options::
14752 * M680x0 Options::
14753 * MCore Options::
14754 * MeP Options::
14755 * MicroBlaze Options::
14756 * MIPS Options::
14757 * MMIX Options::
14758 * MN10300 Options::
14759 * Moxie Options::
14760 * MSP430 Options::
14761 * NDS32 Options::
14762 * Nios II Options::
14763 * Nvidia PTX Options::
14764 * PDP-11 Options::
14765 * picoChip Options::
14766 * PowerPC Options::
14767 * PowerPC SPE Options::
14768 * RISC-V Options::
14769 * RL78 Options::
14770 * RS/6000 and PowerPC Options::
14771 * RX Options::
14772 * S/390 and zSeries Options::
14773 * Score Options::
14774 * SH Options::
14775 * Solaris 2 Options::
14776 * SPARC Options::
14777 * SPU Options::
14778 * System V Options::
14779 * TILE-Gx Options::
14780 * TILEPro Options::
14781 * V850 Options::
14782 * VAX Options::
14783 * Visium Options::
14784 * VMS Options::
14785 * VxWorks Options::
14786 * x86 Options::
14787 * x86 Windows Options::
14788 * Xstormy16 Options::
14789 * Xtensa Options::
14790 * zSeries Options::
14791 @end menu
14793 @node AArch64 Options
14794 @subsection AArch64 Options
14795 @cindex AArch64 Options
14797 These options are defined for AArch64 implementations:
14799 @table @gcctabopt
14801 @item -mabi=@var{name}
14802 @opindex mabi
14803 Generate code for the specified data model.  Permissible values
14804 are @samp{ilp32} for SysV-like data model where int, long int and pointers
14805 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
14806 but long int and pointers are 64 bits.
14808 The default depends on the specific target configuration.  Note that
14809 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
14810 entire program with the same ABI, and link with a compatible set of libraries.
14812 @item -mbig-endian
14813 @opindex mbig-endian
14814 Generate big-endian code.  This is the default when GCC is configured for an
14815 @samp{aarch64_be-*-*} target.
14817 @item -mgeneral-regs-only
14818 @opindex mgeneral-regs-only
14819 Generate code which uses only the general-purpose registers.  This will prevent
14820 the compiler from using floating-point and Advanced SIMD registers but will not
14821 impose any restrictions on the assembler.
14823 @item -mlittle-endian
14824 @opindex mlittle-endian
14825 Generate little-endian code.  This is the default when GCC is configured for an
14826 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
14828 @item -mcmodel=tiny
14829 @opindex mcmodel=tiny
14830 Generate code for the tiny code model.  The program and its statically defined
14831 symbols must be within 1MB of each other.  Programs can be statically or
14832 dynamically linked.
14834 @item -mcmodel=small
14835 @opindex mcmodel=small
14836 Generate code for the small code model.  The program and its statically defined
14837 symbols must be within 4GB of each other.  Programs can be statically or
14838 dynamically linked.  This is the default code model.
14840 @item -mcmodel=large
14841 @opindex mcmodel=large
14842 Generate code for the large code model.  This makes no assumptions about
14843 addresses and sizes of sections.  Programs can be statically linked only.
14845 @item -mstrict-align
14846 @itemx -mno-strict-align
14847 @opindex mstrict-align
14848 @opindex mno-strict-align
14849 Avoid or allow generating memory accesses that may not be aligned on a natural
14850 object boundary as described in the architecture specification.
14852 @item -momit-leaf-frame-pointer
14853 @itemx -mno-omit-leaf-frame-pointer
14854 @opindex momit-leaf-frame-pointer
14855 @opindex mno-omit-leaf-frame-pointer
14856 Omit or keep the frame pointer in leaf functions.  The former behavior is the
14857 default.
14859 @item -mtls-dialect=desc
14860 @opindex mtls-dialect=desc
14861 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
14862 of TLS variables.  This is the default.
14864 @item -mtls-dialect=traditional
14865 @opindex mtls-dialect=traditional
14866 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
14867 of TLS variables.
14869 @item -mtls-size=@var{size}
14870 @opindex mtls-size
14871 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
14872 This option requires binutils 2.26 or newer.
14874 @item -mfix-cortex-a53-835769
14875 @itemx -mno-fix-cortex-a53-835769
14876 @opindex mfix-cortex-a53-835769
14877 @opindex mno-fix-cortex-a53-835769
14878 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
14879 This involves inserting a NOP instruction between memory instructions and
14880 64-bit integer multiply-accumulate instructions.
14882 @item -mfix-cortex-a53-843419
14883 @itemx -mno-fix-cortex-a53-843419
14884 @opindex mfix-cortex-a53-843419
14885 @opindex mno-fix-cortex-a53-843419
14886 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
14887 This erratum workaround is made at link time and this will only pass the
14888 corresponding flag to the linker.
14890 @item -mlow-precision-recip-sqrt
14891 @itemx -mno-low-precision-recip-sqrt
14892 @opindex mlow-precision-recip-sqrt
14893 @opindex mno-low-precision-recip-sqrt
14894 Enable or disable the reciprocal square root approximation.
14895 This option only has an effect if @option{-ffast-math} or
14896 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14897 precision of reciprocal square root results to about 16 bits for
14898 single precision and to 32 bits for double precision.
14900 @item -mlow-precision-sqrt
14901 @itemx -mno-low-precision-sqrt
14902 @opindex -mlow-precision-sqrt
14903 @opindex -mno-low-precision-sqrt
14904 Enable or disable the square root approximation.
14905 This option only has an effect if @option{-ffast-math} or
14906 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14907 precision of square root results to about 16 bits for
14908 single precision and to 32 bits for double precision.
14909 If enabled, it implies @option{-mlow-precision-recip-sqrt}.
14911 @item -mlow-precision-div
14912 @itemx -mno-low-precision-div
14913 @opindex -mlow-precision-div
14914 @opindex -mno-low-precision-div
14915 Enable or disable the division approximation.
14916 This option only has an effect if @option{-ffast-math} or
14917 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14918 precision of division results to about 16 bits for
14919 single precision and to 32 bits for double precision.
14921 @item -mtrack-speculation
14922 @itemx -mno-track-speculation
14923 Enable or disable generation of additional code to track speculative
14924 execution through conditional branches.  The tracking state can then
14925 be used by the compiler when expanding calls to
14926 @code{__builtin_speculation_safe_copy} to permit a more efficient code
14927 sequence to be generated.
14929 @item -march=@var{name}
14930 @opindex march
14931 Specify the name of the target architecture and, optionally, one or
14932 more feature modifiers.  This option has the form
14933 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
14935 The permissible values for @var{arch} are @samp{armv8-a},
14936 @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a} or @samp{armv8.4-a}
14937 or @var{native}.
14939 The value @samp{armv8.4-a} implies @samp{armv8.3-a} and enables compiler
14940 support for the ARMv8.4-A architecture extensions.
14942 The value @samp{armv8.3-a} implies @samp{armv8.2-a} and enables compiler
14943 support for the ARMv8.3-A architecture extensions.
14945 The value @samp{armv8.2-a} implies @samp{armv8.1-a} and enables compiler
14946 support for the ARMv8.2-A architecture extensions.
14948 The value @samp{armv8.1-a} implies @samp{armv8-a} and enables compiler
14949 support for the ARMv8.1-A architecture extension.  In particular, it
14950 enables the @samp{+crc}, @samp{+lse}, and @samp{+rdma} features.
14952 The value @samp{native} is available on native AArch64 GNU/Linux and
14953 causes the compiler to pick the architecture of the host system.  This
14954 option has no effect if the compiler is unable to recognize the
14955 architecture of the host system,
14957 The permissible values for @var{feature} are listed in the sub-section
14958 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
14959 Feature Modifiers}.  Where conflicting feature modifiers are
14960 specified, the right-most feature is used.
14962 GCC uses @var{name} to determine what kind of instructions it can emit
14963 when generating assembly code.  If @option{-march} is specified
14964 without either of @option{-mtune} or @option{-mcpu} also being
14965 specified, the code is tuned to perform well across a range of target
14966 processors implementing the target architecture.
14968 @item -mtune=@var{name}
14969 @opindex mtune
14970 Specify the name of the target processor for which GCC should tune the
14971 performance of the code.  Permissible values for this option are:
14972 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
14973 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
14974 @samp{cortex-a76}, @samp{exynos-m1}, @samp{falkor}, @samp{qdf24xx},
14975 @samp{saphira}, @samp{phecda}, @samp{xgene1}, @samp{vulcan}, @samp{thunderx},
14976 @samp{thunderxt88}, @samp{thunderxt88p1}, @samp{thunderxt81},
14977 @samp{thunderxt83}, @samp{thunderx2t99}, @samp{cortex-a57.cortex-a53},
14978 @samp{cortex-a72.cortex-a53}, @samp{cortex-a73.cortex-a35},
14979 @samp{cortex-a73.cortex-a53}, @samp{cortex-a75.cortex-a55},
14980 @samp{cortex-a76.cortex-a55}
14981 @samp{native}.
14983 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
14984 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
14985 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55} specify that GCC
14986 should tune for a big.LITTLE system.
14988 Additionally on native AArch64 GNU/Linux systems the value
14989 @samp{native} tunes performance to the host system.  This option has no effect
14990 if the compiler is unable to recognize the processor of the host system.
14992 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
14993 are specified, the code is tuned to perform well across a range
14994 of target processors.
14996 This option cannot be suffixed by feature modifiers.
14998 @item -mcpu=@var{name}
14999 @opindex mcpu
15000 Specify the name of the target processor, optionally suffixed by one
15001 or more feature modifiers.  This option has the form
15002 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
15003 the permissible values for @var{cpu} are the same as those available
15004 for @option{-mtune}.  The permissible values for @var{feature} are
15005 documented in the sub-section on
15006 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
15007 Feature Modifiers}.  Where conflicting feature modifiers are
15008 specified, the right-most feature is used.
15010 GCC uses @var{name} to determine what kind of instructions it can emit when
15011 generating assembly code (as if by @option{-march}) and to determine
15012 the target processor for which to tune for performance (as if
15013 by @option{-mtune}).  Where this option is used in conjunction
15014 with @option{-march} or @option{-mtune}, those options take precedence
15015 over the appropriate part of this option.
15017 @item -moverride=@var{string}
15018 @opindex moverride
15019 Override tuning decisions made by the back-end in response to a
15020 @option{-mtune=} switch.  The syntax, semantics, and accepted values
15021 for @var{string} in this option are not guaranteed to be consistent
15022 across releases.
15024 This option is only intended to be useful when developing GCC.
15026 @item -mverbose-cost-dump
15027 @opindex mverbose-cost-dump
15028 Enable verbose cost model dumping in the debug dump files.  This option is
15029 provided for use in debugging the compiler.
15031 @item -mpc-relative-literal-loads
15032 @itemx -mno-pc-relative-literal-loads
15033 @opindex mpc-relative-literal-loads
15034 @opindex mno-pc-relative-literal-loads
15035 Enable or disable PC-relative literal loads.  With this option literal pools are
15036 accessed using a single instruction and emitted after each function.  This
15037 limits the maximum size of functions to 1MB.  This is enabled by default for
15038 @option{-mcmodel=tiny}.
15040 @item -msign-return-address=@var{scope}
15041 @opindex msign-return-address
15042 Select the function scope on which return address signing will be applied.
15043 Permissible values are @samp{none}, which disables return address signing,
15044 @samp{non-leaf}, which enables pointer signing for functions which are not leaf
15045 functions, and @samp{all}, which enables pointer signing for all functions.  The
15046 default value is @samp{none}.
15048 @item -msve-vector-bits=@var{bits}
15049 @opindex msve-vector-bits
15050 Specify the number of bits in an SVE vector register.  This option only has
15051 an effect when SVE is enabled.
15053 GCC supports two forms of SVE code generation: ``vector-length
15054 agnostic'' output that works with any size of vector register and
15055 ``vector-length specific'' output that only works when the vector
15056 registers are a particular size.  Replacing @var{bits} with
15057 @samp{scalable} selects vector-length agnostic output while
15058 replacing it with a number selects vector-length specific output.
15059 The possible lengths in the latter case are: 128, 256, 512, 1024
15060 and 2048.  @samp{scalable} is the default.
15062 At present, @samp{-msve-vector-bits=128} produces the same output
15063 as @samp{-msve-vector-bits=scalable}.
15065 @end table
15067 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
15068 @anchor{aarch64-feature-modifiers}
15069 @cindex @option{-march} feature modifiers
15070 @cindex @option{-mcpu} feature modifiers
15071 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
15072 the following and their inverses @option{no@var{feature}}:
15074 @table @samp
15075 @item crc
15076 Enable CRC extension.  This is on by default for
15077 @option{-march=armv8.1-a}.
15078 @item crypto
15079 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
15080 instructions.
15081 @item fp
15082 Enable floating-point instructions.  This is on by default for all possible
15083 values for options @option{-march} and @option{-mcpu}.
15084 @item simd
15085 Enable Advanced SIMD instructions.  This also enables floating-point
15086 instructions.  This is on by default for all possible values for options
15087 @option{-march} and @option{-mcpu}.
15088 @item sve
15089 Enable Scalable Vector Extension instructions.  This also enables Advanced
15090 SIMD and floating-point instructions.
15091 @item lse
15092 Enable Large System Extension instructions.  This is on by default for
15093 @option{-march=armv8.1-a}.
15094 @item rdma
15095 Enable Round Double Multiply Accumulate instructions.  This is on by default
15096 for @option{-march=armv8.1-a}.
15097 @item fp16
15098 Enable FP16 extension.  This also enables floating-point instructions.
15099 @item fp16fml
15100 Enable FP16 fmla extension.  This also enables FP16 extensions and
15101 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.
15103 @item rcpc
15104 Enable the RcPc extension.  This does not change code generation from GCC,
15105 but is passed on to the assembler, enabling inline asm statements to use
15106 instructions from the RcPc extension.
15107 @item dotprod
15108 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
15109 @item aes
15110 Enable the Armv8-a aes and pmull crypto extension.  This also enables Advanced
15111 SIMD instructions.
15112 @item sha2
15113 Enable the Armv8-a sha2 crypto extension.  This also enables Advanced SIMD instructions.
15114 @item sha3
15115 Enable the sha512 and sha3 crypto extension.  This also enables Advanced SIMD
15116 instructions. Use of this option with architectures prior to Armv8.2-A is not supported.
15117 @item sm4
15118 Enable the sm3 and sm4 crypto extension.  This also enables Advanced SIMD instructions.
15119 Use of this option with architectures prior to Armv8.2-A is not supported.
15120 @item profile
15121 Enable the Statistical Profiling extension.  This option is only to enable the
15122 extension at the assembler level and does not affect code generation.
15124 @end table
15126 Feature @option{crypto} implies @option{aes}, @option{sha2}, and @option{simd},
15127 which implies @option{fp}.
15128 Conversely, @option{nofp} implies @option{nosimd}, which implies
15129 @option{nocrypto}, @option{noaes} and @option{nosha2}.
15131 @node Adapteva Epiphany Options
15132 @subsection Adapteva Epiphany Options
15134 These @samp{-m} options are defined for Adapteva Epiphany:
15136 @table @gcctabopt
15137 @item -mhalf-reg-file
15138 @opindex mhalf-reg-file
15139 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
15140 That allows code to run on hardware variants that lack these registers.
15142 @item -mprefer-short-insn-regs
15143 @opindex mprefer-short-insn-regs
15144 Preferentially allocate registers that allow short instruction generation.
15145 This can result in increased instruction count, so this may either reduce or
15146 increase overall code size.
15148 @item -mbranch-cost=@var{num}
15149 @opindex mbranch-cost
15150 Set the cost of branches to roughly @var{num} ``simple'' instructions.
15151 This cost is only a heuristic and is not guaranteed to produce
15152 consistent results across releases.
15154 @item -mcmove
15155 @opindex mcmove
15156 Enable the generation of conditional moves.
15158 @item -mnops=@var{num}
15159 @opindex mnops
15160 Emit @var{num} NOPs before every other generated instruction.
15162 @item -mno-soft-cmpsf
15163 @opindex mno-soft-cmpsf
15164 For single-precision floating-point comparisons, emit an @code{fsub} instruction
15165 and test the flags.  This is faster than a software comparison, but can
15166 get incorrect results in the presence of NaNs, or when two different small
15167 numbers are compared such that their difference is calculated as zero.
15168 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
15169 software comparisons.
15171 @item -mstack-offset=@var{num}
15172 @opindex mstack-offset
15173 Set the offset between the top of the stack and the stack pointer.
15174 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
15175 can be used by leaf functions without stack allocation.
15176 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
15177 Note also that this option changes the ABI; compiling a program with a
15178 different stack offset than the libraries have been compiled with
15179 generally does not work.
15180 This option can be useful if you want to evaluate if a different stack
15181 offset would give you better code, but to actually use a different stack
15182 offset to build working programs, it is recommended to configure the
15183 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
15185 @item -mno-round-nearest
15186 @opindex mno-round-nearest
15187 Make the scheduler assume that the rounding mode has been set to
15188 truncating.  The default is @option{-mround-nearest}.
15190 @item -mlong-calls
15191 @opindex mlong-calls
15192 If not otherwise specified by an attribute, assume all calls might be beyond
15193 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
15194 function address into a register before performing a (otherwise direct) call.
15195 This is the default.
15197 @item -mshort-calls
15198 @opindex short-calls
15199 If not otherwise specified by an attribute, assume all direct calls are
15200 in the range of the @code{b} / @code{bl} instructions, so use these instructions
15201 for direct calls.  The default is @option{-mlong-calls}.
15203 @item -msmall16
15204 @opindex msmall16
15205 Assume addresses can be loaded as 16-bit unsigned values.  This does not
15206 apply to function addresses for which @option{-mlong-calls} semantics
15207 are in effect.
15209 @item -mfp-mode=@var{mode}
15210 @opindex mfp-mode
15211 Set the prevailing mode of the floating-point unit.
15212 This determines the floating-point mode that is provided and expected
15213 at function call and return time.  Making this mode match the mode you
15214 predominantly need at function start can make your programs smaller and
15215 faster by avoiding unnecessary mode switches.
15217 @var{mode} can be set to one the following values:
15219 @table @samp
15220 @item caller
15221 Any mode at function entry is valid, and retained or restored when
15222 the function returns, and when it calls other functions.
15223 This mode is useful for compiling libraries or other compilation units
15224 you might want to incorporate into different programs with different
15225 prevailing FPU modes, and the convenience of being able to use a single
15226 object file outweighs the size and speed overhead for any extra
15227 mode switching that might be needed, compared with what would be needed
15228 with a more specific choice of prevailing FPU mode.
15230 @item truncate
15231 This is the mode used for floating-point calculations with
15232 truncating (i.e.@: round towards zero) rounding mode.  That includes
15233 conversion from floating point to integer.
15235 @item round-nearest
15236 This is the mode used for floating-point calculations with
15237 round-to-nearest-or-even rounding mode.
15239 @item int
15240 This is the mode used to perform integer calculations in the FPU, e.g.@:
15241 integer multiply, or integer multiply-and-accumulate.
15242 @end table
15244 The default is @option{-mfp-mode=caller}
15246 @item -mnosplit-lohi
15247 @itemx -mno-postinc
15248 @itemx -mno-postmodify
15249 @opindex mnosplit-lohi
15250 @opindex mno-postinc
15251 @opindex mno-postmodify
15252 Code generation tweaks that disable, respectively, splitting of 32-bit
15253 loads, generation of post-increment addresses, and generation of
15254 post-modify addresses.  The defaults are @option{msplit-lohi},
15255 @option{-mpost-inc}, and @option{-mpost-modify}.
15257 @item -mnovect-double
15258 @opindex mno-vect-double
15259 Change the preferred SIMD mode to SImode.  The default is
15260 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
15262 @item -max-vect-align=@var{num}
15263 @opindex max-vect-align
15264 The maximum alignment for SIMD vector mode types.
15265 @var{num} may be 4 or 8.  The default is 8.
15266 Note that this is an ABI change, even though many library function
15267 interfaces are unaffected if they don't use SIMD vector modes
15268 in places that affect size and/or alignment of relevant types.
15270 @item -msplit-vecmove-early
15271 @opindex msplit-vecmove-early
15272 Split vector moves into single word moves before reload.  In theory this
15273 can give better register allocation, but so far the reverse seems to be
15274 generally the case.
15276 @item -m1reg-@var{reg}
15277 @opindex m1reg-
15278 Specify a register to hold the constant @minus{}1, which makes loading small negative
15279 constants and certain bitmasks faster.
15280 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
15281 which specify use of that register as a fixed register,
15282 and @samp{none}, which means that no register is used for this
15283 purpose.  The default is @option{-m1reg-none}.
15285 @end table
15287 @node ARC Options
15288 @subsection ARC Options
15289 @cindex ARC options
15291 The following options control the architecture variant for which code
15292 is being compiled:
15294 @c architecture variants
15295 @table @gcctabopt
15297 @item -mbarrel-shifter
15298 @opindex mbarrel-shifter
15299 Generate instructions supported by barrel shifter.  This is the default
15300 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
15302 @item -mjli-always
15303 @opindex mjli-alawys
15304 Force to call a function using jli_s instruction.  This option is
15305 valid only for ARCv2 architecture.
15307 @item -mcpu=@var{cpu}
15308 @opindex mcpu
15309 Set architecture type, register usage, and instruction scheduling
15310 parameters for @var{cpu}.  There are also shortcut alias options
15311 available for backward compatibility and convenience.  Supported
15312 values for @var{cpu} are
15314 @table @samp
15315 @opindex mA6
15316 @opindex mARC600
15317 @item arc600
15318 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
15320 @item arc601
15321 @opindex mARC601
15322 Compile for ARC601.  Alias: @option{-mARC601}.
15324 @item arc700
15325 @opindex mA7
15326 @opindex mARC700
15327 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
15328 This is the default when configured with @option{--with-cpu=arc700}@.
15330 @item arcem
15331 Compile for ARC EM.
15333 @item archs
15334 Compile for ARC HS.
15336 @item em
15337 Compile for ARC EM CPU with no hardware extensions.
15339 @item em4
15340 Compile for ARC EM4 CPU.
15342 @item em4_dmips
15343 Compile for ARC EM4 DMIPS CPU.
15345 @item em4_fpus
15346 Compile for ARC EM4 DMIPS CPU with the single-precision floating-point
15347 extension.
15349 @item em4_fpuda
15350 Compile for ARC EM4 DMIPS CPU with single-precision floating-point and
15351 double assist instructions.
15353 @item hs
15354 Compile for ARC HS CPU with no hardware extensions except the atomic
15355 instructions.
15357 @item hs34
15358 Compile for ARC HS34 CPU.
15360 @item hs38
15361 Compile for ARC HS38 CPU.
15363 @item hs38_linux
15364 Compile for ARC HS38 CPU with all hardware extensions on.
15366 @item arc600_norm
15367 Compile for ARC 600 CPU with @code{norm} instructions enabled.
15369 @item arc600_mul32x16
15370 Compile for ARC 600 CPU with @code{norm} and 32x16-bit multiply 
15371 instructions enabled.
15373 @item arc600_mul64
15374 Compile for ARC 600 CPU with @code{norm} and @code{mul64}-family 
15375 instructions enabled.
15377 @item arc601_norm
15378 Compile for ARC 601 CPU with @code{norm} instructions enabled.
15380 @item arc601_mul32x16
15381 Compile for ARC 601 CPU with @code{norm} and 32x16-bit multiply
15382 instructions enabled.
15384 @item arc601_mul64
15385 Compile for ARC 601 CPU with @code{norm} and @code{mul64}-family
15386 instructions enabled.
15388 @item nps400
15389 Compile for ARC 700 on NPS400 chip.
15391 @item em_mini
15392 Compile for ARC EM minimalist configuration featuring reduced register
15393 set.
15395 @end table
15397 @item -mdpfp
15398 @opindex mdpfp
15399 @itemx -mdpfp-compact
15400 @opindex mdpfp-compact
15401 Generate double-precision FPX instructions, tuned for the compact
15402 implementation.
15404 @item -mdpfp-fast
15405 @opindex mdpfp-fast
15406 Generate double-precision FPX instructions, tuned for the fast
15407 implementation.
15409 @item -mno-dpfp-lrsr
15410 @opindex mno-dpfp-lrsr
15411 Disable @code{lr} and @code{sr} instructions from using FPX extension
15412 aux registers.
15414 @item -mea
15415 @opindex mea
15416 Generate extended arithmetic instructions.  Currently only
15417 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
15418 supported.  This is always enabled for @option{-mcpu=ARC700}.
15420 @item -mno-mpy
15421 @opindex mno-mpy
15422 Do not generate @code{mpy}-family instructions for ARC700.  This option is
15423 deprecated.
15425 @item -mmul32x16
15426 @opindex mmul32x16
15427 Generate 32x16-bit multiply and multiply-accumulate instructions.
15429 @item -mmul64
15430 @opindex mmul64
15431 Generate @code{mul64} and @code{mulu64} instructions.  
15432 Only valid for @option{-mcpu=ARC600}.
15434 @item -mnorm
15435 @opindex mnorm
15436 Generate @code{norm} instructions.  This is the default if @option{-mcpu=ARC700}
15437 is in effect.
15439 @item -mspfp
15440 @opindex mspfp
15441 @itemx -mspfp-compact
15442 @opindex mspfp-compact
15443 Generate single-precision FPX instructions, tuned for the compact
15444 implementation.
15446 @item -mspfp-fast
15447 @opindex mspfp-fast
15448 Generate single-precision FPX instructions, tuned for the fast
15449 implementation.
15451 @item -msimd
15452 @opindex msimd
15453 Enable generation of ARC SIMD instructions via target-specific
15454 builtins.  Only valid for @option{-mcpu=ARC700}.
15456 @item -msoft-float
15457 @opindex msoft-float
15458 This option ignored; it is provided for compatibility purposes only.
15459 Software floating-point code is emitted by default, and this default
15460 can overridden by FPX options; @option{-mspfp}, @option{-mspfp-compact}, or
15461 @option{-mspfp-fast} for single precision, and @option{-mdpfp},
15462 @option{-mdpfp-compact}, or @option{-mdpfp-fast} for double precision.
15464 @item -mswap
15465 @opindex mswap
15466 Generate @code{swap} instructions.
15468 @item -matomic
15469 @opindex matomic
15470 This enables use of the locked load/store conditional extension to implement
15471 atomic memory built-in functions.  Not available for ARC 6xx or ARC
15472 EM cores.
15474 @item -mdiv-rem
15475 @opindex mdiv-rem
15476 Enable @code{div} and @code{rem} instructions for ARCv2 cores.
15478 @item -mcode-density
15479 @opindex mcode-density
15480 Enable code density instructions for ARC EM.  
15481 This option is on by default for ARC HS.
15483 @item -mll64
15484 @opindex mll64
15485 Enable double load/store operations for ARC HS cores.
15487 @item -mtp-regno=@var{regno}
15488 @opindex mtp-regno
15489 Specify thread pointer register number.
15491 @item -mmpy-option=@var{multo}
15492 @opindex mmpy-option
15493 Compile ARCv2 code with a multiplier design option.  You can specify 
15494 the option using either a string or numeric value for @var{multo}.  
15495 @samp{wlh1} is the default value.  The recognized values are:
15497 @table @samp
15498 @item 0
15499 @itemx none
15500 No multiplier available.
15502 @item 1
15503 @itemx w
15504 16x16 multiplier, fully pipelined.
15505 The following instructions are enabled: @code{mpyw} and @code{mpyuw}.
15507 @item 2
15508 @itemx wlh1
15509 32x32 multiplier, fully
15510 pipelined (1 stage).  The following instructions are additionally
15511 enabled: @code{mpy}, @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15513 @item 3
15514 @itemx wlh2
15515 32x32 multiplier, fully pipelined
15516 (2 stages).  The following instructions are additionally enabled: @code{mpy},
15517 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15519 @item 4
15520 @itemx wlh3
15521 Two 16x16 multipliers, blocking,
15522 sequential.  The following instructions are additionally enabled: @code{mpy},
15523 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15525 @item 5
15526 @itemx wlh4
15527 One 16x16 multiplier, blocking,
15528 sequential.  The following instructions are additionally enabled: @code{mpy},
15529 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15531 @item 6
15532 @itemx wlh5
15533 One 32x4 multiplier, blocking,
15534 sequential.  The following instructions are additionally enabled: @code{mpy},
15535 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15537 @item 7
15538 @itemx plus_dmpy
15539 ARC HS SIMD support.
15541 @item 8
15542 @itemx plus_macd
15543 ARC HS SIMD support.
15545 @item 9
15546 @itemx plus_qmacw
15547 ARC HS SIMD support.
15549 @end table
15551 This option is only available for ARCv2 cores@.
15553 @item -mfpu=@var{fpu}
15554 @opindex mfpu
15555 Enables support for specific floating-point hardware extensions for ARCv2
15556 cores.  Supported values for @var{fpu} are:
15558 @table @samp
15560 @item fpus
15561 Enables support for single-precision floating-point hardware
15562 extensions@.
15564 @item fpud
15565 Enables support for double-precision floating-point hardware
15566 extensions.  The single-precision floating-point extension is also
15567 enabled.  Not available for ARC EM@.
15569 @item fpuda
15570 Enables support for double-precision floating-point hardware
15571 extensions using double-precision assist instructions.  The single-precision
15572 floating-point extension is also enabled.  This option is
15573 only available for ARC EM@.
15575 @item fpuda_div
15576 Enables support for double-precision floating-point hardware
15577 extensions using double-precision assist instructions.
15578 The single-precision floating-point, square-root, and divide 
15579 extensions are also enabled.  This option is
15580 only available for ARC EM@.
15582 @item fpuda_fma
15583 Enables support for double-precision floating-point hardware
15584 extensions using double-precision assist instructions.
15585 The single-precision floating-point and fused multiply and add 
15586 hardware extensions are also enabled.  This option is
15587 only available for ARC EM@.
15589 @item fpuda_all
15590 Enables support for double-precision floating-point hardware
15591 extensions using double-precision assist instructions.
15592 All single-precision floating-point hardware extensions are also
15593 enabled.  This option is only available for ARC EM@.
15595 @item fpus_div
15596 Enables support for single-precision floating-point, square-root and divide 
15597 hardware extensions@.
15599 @item fpud_div
15600 Enables support for double-precision floating-point, square-root and divide 
15601 hardware extensions.  This option
15602 includes option @samp{fpus_div}. Not available for ARC EM@.
15604 @item fpus_fma
15605 Enables support for single-precision floating-point and 
15606 fused multiply and add hardware extensions@.
15608 @item fpud_fma
15609 Enables support for double-precision floating-point and 
15610 fused multiply and add hardware extensions.  This option
15611 includes option @samp{fpus_fma}.  Not available for ARC EM@.
15613 @item fpus_all
15614 Enables support for all single-precision floating-point hardware
15615 extensions@.
15617 @item fpud_all
15618 Enables support for all single- and double-precision floating-point
15619 hardware extensions.  Not available for ARC EM@.
15621 @end table
15623 @item -mirq-ctrl-saved=@var{register-range}, @var{blink}, @var{lp_count}
15624 @opindex mirq-ctrl-saved
15625 Specifies general-purposes registers that the processor automatically
15626 saves/restores on interrupt entry and exit.  @var{register-range} is
15627 specified as two registers separated by a dash.  The register range
15628 always starts with @code{r0}, the upper limit is @code{fp} register.
15629 @var{blink} and @var{lp_count} are optional.  This option is only
15630 valid for ARC EM and ARC HS cores.
15632 @item -mrgf-banked-regs=@var{number}
15633 @opindex mrgf-banked-regs
15634 Specifies the number of registers replicated in second register bank
15635 on entry to fast interrupt.  Fast interrupts are interrupts with the
15636 highest priority level P0.  These interrupts save only PC and STATUS32
15637 registers to avoid memory transactions during interrupt entry and exit
15638 sequences.  Use this option when you are using fast interrupts in an
15639 ARC V2 family processor.  Permitted values are 4, 8, 16, and 32.
15641 @item -mlpc-width=@var{width}
15642 @opindex mlpc-width
15643 Specify the width of the @code{lp_count} register.  Valid values for
15644 @var{width} are 8, 16, 20, 24, 28 and 32 bits.  The default width is
15645 fixed to 32 bits.  If the width is less than 32, the compiler does not
15646 attempt to transform loops in your program to use the zero-delay loop
15647 mechanism unless it is known that the @code{lp_count} register can
15648 hold the required loop-counter value.  Depending on the width
15649 specified, the compiler and run-time library might continue to use the
15650 loop mechanism for various needs.  This option defines macro
15651 @code{__ARC_LPC_WIDTH__} with the value of @var{width}.
15653 @item -mrf16
15654 @opindex mrf16
15655 This option instructs the compiler to generate code for a 16-entry
15656 register file.  This option defines the @code{__ARC_RF16__}
15657 preprocessor macro.
15659 @end table
15661 The following options are passed through to the assembler, and also
15662 define preprocessor macro symbols.
15664 @c Flags used by the assembler, but for which we define preprocessor
15665 @c macro symbols as well.
15666 @table @gcctabopt
15667 @item -mdsp-packa
15668 @opindex mdsp-packa
15669 Passed down to the assembler to enable the DSP Pack A extensions.
15670 Also sets the preprocessor symbol @code{__Xdsp_packa}.  This option is
15671 deprecated.
15673 @item -mdvbf
15674 @opindex mdvbf
15675 Passed down to the assembler to enable the dual Viterbi butterfly
15676 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.  This
15677 option is deprecated.
15679 @c ARC700 4.10 extension instruction
15680 @item -mlock
15681 @opindex mlock
15682 Passed down to the assembler to enable the locked load/store
15683 conditional extension.  Also sets the preprocessor symbol
15684 @code{__Xlock}.
15686 @item -mmac-d16
15687 @opindex mmac-d16
15688 Passed down to the assembler.  Also sets the preprocessor symbol
15689 @code{__Xxmac_d16}.  This option is deprecated.
15691 @item -mmac-24
15692 @opindex mmac-24
15693 Passed down to the assembler.  Also sets the preprocessor symbol
15694 @code{__Xxmac_24}.  This option is deprecated.
15696 @c ARC700 4.10 extension instruction
15697 @item -mrtsc
15698 @opindex mrtsc
15699 Passed down to the assembler to enable the 64-bit time-stamp counter
15700 extension instruction.  Also sets the preprocessor symbol
15701 @code{__Xrtsc}.  This option is deprecated.
15703 @c ARC700 4.10 extension instruction
15704 @item -mswape
15705 @opindex mswape
15706 Passed down to the assembler to enable the swap byte ordering
15707 extension instruction.  Also sets the preprocessor symbol
15708 @code{__Xswape}.
15710 @item -mtelephony
15711 @opindex mtelephony
15712 Passed down to the assembler to enable dual- and single-operand
15713 instructions for telephony.  Also sets the preprocessor symbol
15714 @code{__Xtelephony}.  This option is deprecated.
15716 @item -mxy
15717 @opindex mxy
15718 Passed down to the assembler to enable the XY memory extension.  Also
15719 sets the preprocessor symbol @code{__Xxy}.
15721 @end table
15723 The following options control how the assembly code is annotated:
15725 @c Assembly annotation options
15726 @table @gcctabopt
15727 @item -misize
15728 @opindex misize
15729 Annotate assembler instructions with estimated addresses.
15731 @item -mannotate-align
15732 @opindex mannotate-align
15733 Explain what alignment considerations lead to the decision to make an
15734 instruction short or long.
15736 @end table
15738 The following options are passed through to the linker:
15740 @c options passed through to the linker
15741 @table @gcctabopt
15742 @item -marclinux
15743 @opindex marclinux
15744 Passed through to the linker, to specify use of the @code{arclinux} emulation.
15745 This option is enabled by default in tool chains built for
15746 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
15747 when profiling is not requested.
15749 @item -marclinux_prof
15750 @opindex marclinux_prof
15751 Passed through to the linker, to specify use of the
15752 @code{arclinux_prof} emulation.  This option is enabled by default in
15753 tool chains built for @w{@code{arc-linux-uclibc}} and
15754 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
15756 @end table
15758 The following options control the semantics of generated code:
15760 @c semantically relevant code generation options
15761 @table @gcctabopt
15762 @item -mlong-calls
15763 @opindex mlong-calls
15764 Generate calls as register indirect calls, thus providing access
15765 to the full 32-bit address range.
15767 @item -mmedium-calls
15768 @opindex mmedium-calls
15769 Don't use less than 25-bit addressing range for calls, which is the
15770 offset available for an unconditional branch-and-link
15771 instruction.  Conditional execution of function calls is suppressed, to
15772 allow use of the 25-bit range, rather than the 21-bit range with
15773 conditional branch-and-link.  This is the default for tool chains built
15774 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
15776 @item -G @var{num}
15777 @opindex G
15778 Put definitions of externally-visible data in a small data section if
15779 that data is no bigger than @var{num} bytes.  The default value of
15780 @var{num} is 4 for any ARC configuration, or 8 when we have double
15781 load/store operations.
15783 @item -mno-sdata
15784 @opindex mno-sdata
15785 Do not generate sdata references.  This is the default for tool chains
15786 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
15787 targets.
15789 @item -mvolatile-cache
15790 @opindex mvolatile-cache
15791 Use ordinarily cached memory accesses for volatile references.  This is the
15792 default.
15794 @item -mno-volatile-cache
15795 @opindex mno-volatile-cache
15796 Enable cache bypass for volatile references.
15798 @end table
15800 The following options fine tune code generation:
15801 @c code generation tuning options
15802 @table @gcctabopt
15803 @item -malign-call
15804 @opindex malign-call
15805 Do alignment optimizations for call instructions.
15807 @item -mauto-modify-reg
15808 @opindex mauto-modify-reg
15809 Enable the use of pre/post modify with register displacement.
15811 @item -mbbit-peephole
15812 @opindex mbbit-peephole
15813 Enable bbit peephole2.
15815 @item -mno-brcc
15816 @opindex mno-brcc
15817 This option disables a target-specific pass in @file{arc_reorg} to
15818 generate compare-and-branch (@code{br@var{cc}}) instructions.  
15819 It has no effect on
15820 generation of these instructions driven by the combiner pass.
15822 @item -mcase-vector-pcrel
15823 @opindex mcase-vector-pcrel
15824 Use PC-relative switch case tables to enable case table shortening.
15825 This is the default for @option{-Os}.
15827 @item -mcompact-casesi
15828 @opindex mcompact-casesi
15829 Enable compact @code{casesi} pattern.  This is the default for @option{-Os},
15830 and only available for ARCv1 cores.
15832 @item -mno-cond-exec
15833 @opindex mno-cond-exec
15834 Disable the ARCompact-specific pass to generate conditional 
15835 execution instructions.
15837 Due to delay slot scheduling and interactions between operand numbers,
15838 literal sizes, instruction lengths, and the support for conditional execution,
15839 the target-independent pass to generate conditional execution is often lacking,
15840 so the ARC port has kept a special pass around that tries to find more
15841 conditional execution generation opportunities after register allocation,
15842 branch shortening, and delay slot scheduling have been done.  This pass
15843 generally, but not always, improves performance and code size, at the cost of
15844 extra compilation time, which is why there is an option to switch it off.
15845 If you have a problem with call instructions exceeding their allowable
15846 offset range because they are conditionalized, you should consider using
15847 @option{-mmedium-calls} instead.
15849 @item -mearly-cbranchsi
15850 @opindex mearly-cbranchsi
15851 Enable pre-reload use of the @code{cbranchsi} pattern.
15853 @item -mexpand-adddi
15854 @opindex mexpand-adddi
15855 Expand @code{adddi3} and @code{subdi3} at RTL generation time into
15856 @code{add.f}, @code{adc} etc.  This option is deprecated.
15858 @item -mindexed-loads
15859 @opindex mindexed-loads
15860 Enable the use of indexed loads.  This can be problematic because some
15861 optimizers then assume that indexed stores exist, which is not
15862 the case.
15864 @item -mlra
15865 @opindex mlra
15866 Enable Local Register Allocation.  This is still experimental for ARC,
15867 so by default the compiler uses standard reload
15868 (i.e. @option{-mno-lra}).
15870 @item -mlra-priority-none
15871 @opindex mlra-priority-none
15872 Don't indicate any priority for target registers.
15874 @item -mlra-priority-compact
15875 @opindex mlra-priority-compact
15876 Indicate target register priority for r0..r3 / r12..r15.
15878 @item -mlra-priority-noncompact
15879 @opindex mlra-priority-noncompact
15880 Reduce target register priority for r0..r3 / r12..r15.
15882 @item -mno-millicode
15883 @opindex mno-millicode
15884 When optimizing for size (using @option{-Os}), prologues and epilogues
15885 that have to save or restore a large number of registers are often
15886 shortened by using call to a special function in libgcc; this is
15887 referred to as a @emph{millicode} call.  As these calls can pose
15888 performance issues, and/or cause linking issues when linking in a
15889 nonstandard way, this option is provided to turn off millicode call
15890 generation.
15892 @item -mmixed-code
15893 @opindex mmixed-code
15894 Tweak register allocation to help 16-bit instruction generation.
15895 This generally has the effect of decreasing the average instruction size
15896 while increasing the instruction count.
15898 @item -mq-class
15899 @opindex mq-class
15900 Enable @samp{q} instruction alternatives.
15901 This is the default for @option{-Os}.
15903 @item -mRcq
15904 @opindex mRcq
15905 Enable @samp{Rcq} constraint handling.  
15906 Most short code generation depends on this.
15907 This is the default.
15909 @item -mRcw
15910 @opindex mRcw
15911 Enable @samp{Rcw} constraint handling.  
15912 Most ccfsm condexec mostly depends on this.
15913 This is the default.
15915 @item -msize-level=@var{level}
15916 @opindex msize-level
15917 Fine-tune size optimization with regards to instruction lengths and alignment.
15918 The recognized values for @var{level} are:
15919 @table @samp
15920 @item 0
15921 No size optimization.  This level is deprecated and treated like @samp{1}.
15923 @item 1
15924 Short instructions are used opportunistically.
15926 @item 2
15927 In addition, alignment of loops and of code after barriers are dropped.
15929 @item 3
15930 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
15932 @end table
15934 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
15935 the behavior when this is not set is equivalent to level @samp{1}.
15937 @item -mtune=@var{cpu}
15938 @opindex mtune
15939 Set instruction scheduling parameters for @var{cpu}, overriding any implied
15940 by @option{-mcpu=}.
15942 Supported values for @var{cpu} are
15944 @table @samp
15945 @item ARC600
15946 Tune for ARC600 CPU.
15948 @item ARC601
15949 Tune for ARC601 CPU.
15951 @item ARC700
15952 Tune for ARC700 CPU with standard multiplier block.
15954 @item ARC700-xmac
15955 Tune for ARC700 CPU with XMAC block.
15957 @item ARC725D
15958 Tune for ARC725D CPU.
15960 @item ARC750D
15961 Tune for ARC750D CPU.
15963 @end table
15965 @item -mmultcost=@var{num}
15966 @opindex mmultcost
15967 Cost to assume for a multiply instruction, with @samp{4} being equal to a
15968 normal instruction.
15970 @item -munalign-prob-threshold=@var{probability}
15971 @opindex munalign-prob-threshold
15972 Set probability threshold for unaligning branches.
15973 When tuning for @samp{ARC700} and optimizing for speed, branches without
15974 filled delay slot are preferably emitted unaligned and long, unless
15975 profiling indicates that the probability for the branch to be taken
15976 is below @var{probability}.  @xref{Cross-profiling}.
15977 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
15979 @end table
15981 The following options are maintained for backward compatibility, but
15982 are now deprecated and will be removed in a future release:
15984 @c Deprecated options
15985 @table @gcctabopt
15987 @item -margonaut
15988 @opindex margonaut
15989 Obsolete FPX.
15991 @item -mbig-endian
15992 @opindex mbig-endian
15993 @itemx -EB
15994 @opindex EB
15995 Compile code for big-endian targets.  Use of these options is now
15996 deprecated.  Big-endian code is supported by configuring GCC to build
15997 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets,
15998 for which big endian is the default.
16000 @item -mlittle-endian
16001 @opindex mlittle-endian
16002 @itemx -EL
16003 @opindex EL
16004 Compile code for little-endian targets.  Use of these options is now
16005 deprecated.  Little-endian code is supported by configuring GCC to build 
16006 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets,
16007 for which little endian is the default.
16009 @item -mbarrel_shifter
16010 @opindex mbarrel_shifter
16011 Replaced by @option{-mbarrel-shifter}.
16013 @item -mdpfp_compact
16014 @opindex mdpfp_compact
16015 Replaced by @option{-mdpfp-compact}.
16017 @item -mdpfp_fast
16018 @opindex mdpfp_fast
16019 Replaced by @option{-mdpfp-fast}.
16021 @item -mdsp_packa
16022 @opindex mdsp_packa
16023 Replaced by @option{-mdsp-packa}.
16025 @item -mEA
16026 @opindex mEA
16027 Replaced by @option{-mea}.
16029 @item -mmac_24
16030 @opindex mmac_24
16031 Replaced by @option{-mmac-24}.
16033 @item -mmac_d16
16034 @opindex mmac_d16
16035 Replaced by @option{-mmac-d16}.
16037 @item -mspfp_compact
16038 @opindex mspfp_compact
16039 Replaced by @option{-mspfp-compact}.
16041 @item -mspfp_fast
16042 @opindex mspfp_fast
16043 Replaced by @option{-mspfp-fast}.
16045 @item -mtune=@var{cpu}
16046 @opindex mtune
16047 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
16048 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
16049 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively.
16051 @item -multcost=@var{num}
16052 @opindex multcost
16053 Replaced by @option{-mmultcost}.
16055 @end table
16057 @node ARM Options
16058 @subsection ARM Options
16059 @cindex ARM options
16061 These @samp{-m} options are defined for the ARM port:
16063 @table @gcctabopt
16064 @item -mabi=@var{name}
16065 @opindex mabi
16066 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
16067 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
16069 @item -mapcs-frame
16070 @opindex mapcs-frame
16071 Generate a stack frame that is compliant with the ARM Procedure Call
16072 Standard for all functions, even if this is not strictly necessary for
16073 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
16074 with this option causes the stack frames not to be generated for
16075 leaf functions.  The default is @option{-mno-apcs-frame}.
16076 This option is deprecated.
16078 @item -mapcs
16079 @opindex mapcs
16080 This is a synonym for @option{-mapcs-frame} and is deprecated.
16082 @ignore
16083 @c not currently implemented
16084 @item -mapcs-stack-check
16085 @opindex mapcs-stack-check
16086 Generate code to check the amount of stack space available upon entry to
16087 every function (that actually uses some stack space).  If there is
16088 insufficient space available then either the function
16089 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
16090 called, depending upon the amount of stack space required.  The runtime
16091 system is required to provide these functions.  The default is
16092 @option{-mno-apcs-stack-check}, since this produces smaller code.
16094 @c not currently implemented
16095 @item -mapcs-reentrant
16096 @opindex mapcs-reentrant
16097 Generate reentrant, position-independent code.  The default is
16098 @option{-mno-apcs-reentrant}.
16099 @end ignore
16101 @item -mthumb-interwork
16102 @opindex mthumb-interwork
16103 Generate code that supports calling between the ARM and Thumb
16104 instruction sets.  Without this option, on pre-v5 architectures, the
16105 two instruction sets cannot be reliably used inside one program.  The
16106 default is @option{-mno-thumb-interwork}, since slightly larger code
16107 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
16108 configurations this option is meaningless.
16110 @item -mno-sched-prolog
16111 @opindex mno-sched-prolog
16112 Prevent the reordering of instructions in the function prologue, or the
16113 merging of those instruction with the instructions in the function's
16114 body.  This means that all functions start with a recognizable set
16115 of instructions (or in fact one of a choice from a small set of
16116 different function prologues), and this information can be used to
16117 locate the start of functions inside an executable piece of code.  The
16118 default is @option{-msched-prolog}.
16120 @item -mfloat-abi=@var{name}
16121 @opindex mfloat-abi
16122 Specifies which floating-point ABI to use.  Permissible values
16123 are: @samp{soft}, @samp{softfp} and @samp{hard}.
16125 Specifying @samp{soft} causes GCC to generate output containing
16126 library calls for floating-point operations.
16127 @samp{softfp} allows the generation of code using hardware floating-point
16128 instructions, but still uses the soft-float calling conventions.
16129 @samp{hard} allows generation of floating-point instructions
16130 and uses FPU-specific calling conventions.
16132 The default depends on the specific target configuration.  Note that
16133 the hard-float and soft-float ABIs are not link-compatible; you must
16134 compile your entire program with the same ABI, and link with a
16135 compatible set of libraries.
16137 @item -mlittle-endian
16138 @opindex mlittle-endian
16139 Generate code for a processor running in little-endian mode.  This is
16140 the default for all standard configurations.
16142 @item -mbig-endian
16143 @opindex mbig-endian
16144 Generate code for a processor running in big-endian mode; the default is
16145 to compile code for a little-endian processor.
16147 @item -mbe8
16148 @itemx -mbe32
16149 @opindex mbe8
16150 When linking a big-endian image select between BE8 and BE32 formats.
16151 The option has no effect for little-endian images and is ignored.  The
16152 default is dependent on the selected target architecture.  For ARMv6
16153 and later architectures the default is BE8, for older architectures
16154 the default is BE32.  BE32 format has been deprecated by ARM.
16156 @item -march=@var{name}@r{[}+extension@dots{}@r{]}
16157 @opindex march
16158 This specifies the name of the target ARM architecture.  GCC uses this
16159 name to determine what kind of instructions it can emit when generating
16160 assembly code.  This option can be used in conjunction with or instead
16161 of the @option{-mcpu=} option.
16163 Permissible names are:
16164 @samp{armv4t},
16165 @samp{armv5t}, @samp{armv5te},
16166 @samp{armv6}, @samp{armv6j}, @samp{armv6k}, @samp{armv6kz}, @samp{armv6t2},
16167 @samp{armv6z}, @samp{armv6zk},
16168 @samp{armv7}, @samp{armv7-a}, @samp{armv7ve}, 
16169 @samp{armv8-a}, @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a},
16170 @samp{armv8.4-a},
16171 @samp{armv7-r},
16172 @samp{armv8-r},
16173 @samp{armv6-m}, @samp{armv6s-m},
16174 @samp{armv7-m}, @samp{armv7e-m},
16175 @samp{armv8-m.base}, @samp{armv8-m.main},
16176 @samp{iwmmxt} and @samp{iwmmxt2}.
16178 Additionally, the following architectures, which lack support for the
16179 Thumb execution state, are recognized but support is deprecated: @samp{armv4}.
16181 Many of the architectures support extensions.  These can be added by
16182 appending @samp{+@var{extension}} to the architecture name.  Extension
16183 options are processed in order and capabilities accumulate.  An extension
16184 will also enable any necessary base extensions
16185 upon which it depends.  For example, the @samp{+crypto} extension
16186 will always enable the @samp{+simd} extension.  The exception to the
16187 additive construction is for extensions that are prefixed with
16188 @samp{+no@dots{}}: these extensions disable the specified option and
16189 any other extensions that may depend on the presence of that
16190 extension.
16192 For example, @samp{-march=armv7-a+simd+nofp+vfpv4} is equivalent to
16193 writing @samp{-march=armv7-a+vfpv4} since the @samp{+simd} option is
16194 entirely disabled by the @samp{+nofp} option that follows it.
16196 Most extension names are generically named, but have an effect that is
16197 dependent upon the architecture to which it is applied.  For example,
16198 the @samp{+simd} option can be applied to both @samp{armv7-a} and
16199 @samp{armv8-a} architectures, but will enable the original ARMv7-A
16200 Advanced SIMD (Neon) extensions for @samp{armv7-a} and the ARMv8-A
16201 variant for @samp{armv8-a}.
16203 The table below lists the supported extensions for each architecture.
16204 Architectures not mentioned do not support any extensions.
16206 @table @samp
16207 @item armv5te
16208 @itemx armv6
16209 @itemx armv6j
16210 @itemx armv6k
16211 @itemx armv6kz
16212 @itemx armv6t2
16213 @itemx armv6z
16214 @itemx armv6zk
16215 @table @samp
16216 @item +fp
16217 The VFPv2 floating-point instructions.  The extension @samp{+vfpv2} can be
16218 used as an alias for this extension.
16220 @item +nofp
16221 Disable the floating-point instructions.
16222 @end table
16224 @item armv7
16225 The common subset of the ARMv7-A, ARMv7-R and ARMv7-M architectures.
16226 @table @samp
16227 @item +fp
16228 The VFPv3 floating-point instructions, with 16 double-precision
16229 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
16230 for this extension.  Note that floating-point is not supported by the
16231 base ARMv7-M architecture, but is compatible with both the ARMv7-A and
16232 ARMv7-R architectures.
16234 @item +nofp
16235 Disable the floating-point instructions.
16236 @end table
16238 @item armv7-a
16239 @table @samp
16240 @item +fp
16241 The VFPv3 floating-point instructions, with 16 double-precision
16242 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
16243 for this extension.
16245 @item +simd
16246 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
16247 The extensions @samp{+neon} and @samp{+neon-vfpv3} can be used as aliases
16248 for this extension.
16250 @item +vfpv3
16251 The VFPv3 floating-point instructions, with 32 double-precision
16252 registers.
16254 @item +vfpv3-d16-fp16
16255 The VFPv3 floating-point instructions, with 16 double-precision
16256 registers and the half-precision floating-point conversion operations.
16258 @item +vfpv3-fp16
16259 The VFPv3 floating-point instructions, with 32 double-precision
16260 registers and the half-precision floating-point conversion operations.
16262 @item +vfpv4-d16
16263 The VFPv4 floating-point instructions, with 16 double-precision
16264 registers.
16266 @item +vfpv4
16267 The VFPv4 floating-point instructions, with 32 double-precision
16268 registers.
16270 @item +neon-fp16
16271 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
16272 the half-precision floating-point conversion operations.
16274 @item +neon-vfpv4
16275 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.
16277 @item +nosimd
16278 Disable the Advanced SIMD instructions (does not disable floating point).
16280 @item +nofp
16281 Disable the floating-point and Advanced SIMD instructions.
16282 @end table
16284 @item armv7ve
16285 The extended version of the ARMv7-A architecture with support for
16286 virtualization.
16287 @table @samp
16288 @item +fp
16289 The VFPv4 floating-point instructions, with 16 double-precision registers.
16290 The extension @samp{+vfpv4-d16} can be used as an alias for this extension.
16292 @item +simd
16293 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.  The
16294 extension @samp{+neon-vfpv4} can be used as an alias for this extension.
16296 @item +vfpv3-d16
16297 The VFPv3 floating-point instructions, with 16 double-precision
16298 registers.
16300 @item +vfpv3
16301 The VFPv3 floating-point instructions, with 32 double-precision
16302 registers.
16304 @item +vfpv3-d16-fp16
16305 The VFPv3 floating-point instructions, with 16 double-precision
16306 registers and the half-precision floating-point conversion operations.
16308 @item +vfpv3-fp16
16309 The VFPv3 floating-point instructions, with 32 double-precision
16310 registers and the half-precision floating-point conversion operations.
16312 @item +vfpv4-d16
16313 The VFPv4 floating-point instructions, with 16 double-precision
16314 registers.
16316 @item +vfpv4
16317 The VFPv4 floating-point instructions, with 32 double-precision
16318 registers.
16320 @item +neon
16321 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
16322 The extension @samp{+neon-vfpv3} can be used as an alias for this extension.
16324 @item +neon-fp16
16325 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
16326 the half-precision floating-point conversion operations.
16328 @item +nosimd
16329 Disable the Advanced SIMD instructions (does not disable floating point).
16331 @item +nofp
16332 Disable the floating-point and Advanced SIMD instructions.
16333 @end table
16335 @item armv8-a
16336 @table @samp
16337 @item +crc
16338 The Cyclic Redundancy Check (CRC) instructions.
16339 @item +simd
16340 The ARMv8-A Advanced SIMD and floating-point instructions.
16341 @item +crypto
16342 The cryptographic instructions.
16343 @item +nocrypto
16344 Disable the cryptographic instructions.
16345 @item +nofp
16346 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16347 @end table
16349 @item armv8.1-a
16350 @table @samp
16351 @item +simd
16352 The ARMv8.1-A Advanced SIMD and floating-point instructions.
16354 @item +crypto
16355 The cryptographic instructions.  This also enables the Advanced SIMD and
16356 floating-point instructions.
16358 @item +nocrypto
16359 Disable the cryptographic instructions.
16361 @item +nofp
16362 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16363 @end table
16365 @item armv8.2-a
16366 @itemx armv8.3-a
16367 @table @samp
16368 @item +fp16
16369 The half-precision floating-point data processing instructions.
16370 This also enables the Advanced SIMD and floating-point instructions.
16372 @item +fp16fml
16373 The half-precision floating-point fmla extension.  This also enables
16374 the half-precision floating-point extension and Advanced SIMD and
16375 floating-point instructions.
16377 @item +simd
16378 The ARMv8.1-A Advanced SIMD and floating-point instructions.
16380 @item +crypto
16381 The cryptographic instructions.  This also enables the Advanced SIMD and
16382 floating-point instructions.
16384 @item +dotprod
16385 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
16387 @item +nocrypto
16388 Disable the cryptographic extension.
16390 @item +nofp
16391 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16392 @end table
16394 @item armv8.4-a
16395 @table @samp
16396 @item +fp16
16397 The half-precision floating-point data processing instructions.
16398 This also enables the Advanced SIMD and floating-point instructions as well
16399 as the Dot Product extension and the half-precision floating-point fmla
16400 extension.
16402 @item +simd
16403 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
16404 Dot Product extension.
16406 @item +crypto
16407 The cryptographic instructions.  This also enables the Advanced SIMD and
16408 floating-point instructions as well as the Dot Product extension.
16410 @item +nocrypto
16411 Disable the cryptographic extension.
16413 @item +nofp
16414 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16415 @end table
16417 @item armv7-r
16418 @table @samp
16419 @item +fp.sp
16420 The single-precision VFPv3 floating-point instructions.  The extension
16421 @samp{+vfpv3xd} can be used as an alias for this extension.
16423 @item +fp
16424 The VFPv3 floating-point instructions with 16 double-precision registers.
16425 The extension +vfpv3-d16 can be used as an alias for this extension.
16427 @item +nofp
16428 Disable the floating-point extension.
16430 @item +idiv
16431 The ARM-state integer division instructions.
16433 @item +noidiv
16434 Disable the ARM-state integer division extension.
16435 @end table
16437 @item armv7e-m
16438 @table @samp
16439 @item +fp
16440 The single-precision VFPv4 floating-point instructions.
16442 @item +fpv5
16443 The single-precision FPv5 floating-point instructions.
16445 @item +fp.dp
16446 The single- and double-precision FPv5 floating-point instructions.
16448 @item +nofp
16449 Disable the floating-point extensions.
16450 @end table
16452 @item  armv8-m.main
16453 @table @samp
16454 @item +dsp
16455 The DSP instructions.
16457 @item +nodsp
16458 Disable the DSP extension.
16460 @item +fp
16461 The single-precision floating-point instructions.
16463 @item +fp.dp
16464 The single- and double-precision floating-point instructions.
16466 @item +nofp
16467 Disable the floating-point extension.
16468 @end table
16470 @item armv8-r
16471 @table @samp
16472 @item +crc
16473 The Cyclic Redundancy Check (CRC) instructions.
16474 @item +fp.sp
16475 The single-precision FPv5 floating-point instructions.
16476 @item +simd
16477 The ARMv8-A Advanced SIMD and floating-point instructions.
16478 @item +crypto
16479 The cryptographic instructions.
16480 @item +nocrypto
16481 Disable the cryptographic instructions.
16482 @item +nofp
16483 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16484 @end table
16486 @end table
16488 @option{-march=native} causes the compiler to auto-detect the architecture
16489 of the build computer.  At present, this feature is only supported on
16490 GNU/Linux, and not all architectures are recognized.  If the auto-detect
16491 is unsuccessful the option has no effect.
16493 @item -mtune=@var{name}
16494 @opindex mtune
16495 This option specifies the name of the target ARM processor for
16496 which GCC should tune the performance of the code.
16497 For some ARM implementations better performance can be obtained by using
16498 this option.
16499 Permissible names are: @samp{arm2}, @samp{arm250},
16500 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
16501 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
16502 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
16503 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
16504 @samp{arm720},
16505 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
16506 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
16507 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
16508 @samp{strongarm1110},
16509 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
16510 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
16511 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
16512 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
16513 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
16514 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
16515 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
16516 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
16517 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
16518 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
16519 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
16520 @samp{cortex-a76}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
16521 @samp{cortex-r7}, @samp{cortex-r8}, @samp{cortex-r52},
16522 @samp{cortex-m33},
16523 @samp{cortex-m23},
16524 @samp{cortex-m7},
16525 @samp{cortex-m4},
16526 @samp{cortex-m3},
16527 @samp{cortex-m1},
16528 @samp{cortex-m0},
16529 @samp{cortex-m0plus},
16530 @samp{cortex-m1.small-multiply},
16531 @samp{cortex-m0.small-multiply},
16532 @samp{cortex-m0plus.small-multiply},
16533 @samp{exynos-m1},
16534 @samp{marvell-pj4},
16535 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
16536 @samp{fa526}, @samp{fa626},
16537 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
16538 @samp{xgene1}.
16540 Additionally, this option can specify that GCC should tune the performance
16541 of the code for a big.LITTLE system.  Permissible names are:
16542 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
16543 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
16544 @samp{cortex-a72.cortex-a35}, @samp{cortex-a73.cortex-a53},
16545 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55}.
16547 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
16548 performance for a blend of processors within architecture @var{arch}.
16549 The aim is to generate code that run well on the current most popular
16550 processors, balancing between optimizations that benefit some CPUs in the
16551 range, and avoiding performance pitfalls of other CPUs.  The effects of
16552 this option may change in future GCC versions as CPU models come and go.
16554 @option{-mtune} permits the same extension options as @option{-mcpu}, but
16555 the extension options do not affect the tuning of the generated code.
16557 @option{-mtune=native} causes the compiler to auto-detect the CPU
16558 of the build computer.  At present, this feature is only supported on
16559 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
16560 unsuccessful the option has no effect.
16562 @item -mcpu=@var{name}@r{[}+extension@dots{}@r{]}
16563 @opindex mcpu
16564 This specifies the name of the target ARM processor.  GCC uses this name
16565 to derive the name of the target ARM architecture (as if specified
16566 by @option{-march}) and the ARM processor type for which to tune for
16567 performance (as if specified by @option{-mtune}).  Where this option
16568 is used in conjunction with @option{-march} or @option{-mtune},
16569 those options take precedence over the appropriate part of this option.
16571 Many of the supported CPUs implement optional architectural
16572 extensions.  Where this is so the architectural extensions are
16573 normally enabled by default.  If implementations that lack the
16574 extension exist, then the extension syntax can be used to disable
16575 those extensions that have been omitted.  For floating-point and
16576 Advanced SIMD (Neon) instructions, the settings of the options
16577 @option{-mfloat-abi} and @option{-mfpu} must also be considered:
16578 floating-point and Advanced SIMD instructions will only be used if
16579 @option{-mfloat-abi} is not set to @samp{soft}; and any setting of
16580 @option{-mfpu} other than @samp{auto} will override the available
16581 floating-point and SIMD extension instructions.
16583 For example, @samp{cortex-a9} can be found in three major
16584 configurations: integer only, with just a floating-point unit or with
16585 floating-point and Advanced SIMD.  The default is to enable all the
16586 instructions, but the extensions @samp{+nosimd} and @samp{+nofp} can
16587 be used to disable just the SIMD or both the SIMD and floating-point
16588 instructions respectively.
16590 Permissible names for this option are the same as those for
16591 @option{-mtune}.
16593 The following extension options are common to the listed CPUs:
16595 @table @samp
16596 @item +nodsp
16597 Disable the DSP instructions on @samp{cortex-m33}.
16599 @item  +nofp
16600 Disables the floating-point instructions on @samp{arm9e},
16601 @samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm10e},
16602 @samp{arm1020e}, @samp{arm1022e}, @samp{arm926ej-s},
16603 @samp{arm1026ej-s}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
16604 @samp{cortex-m4}, @samp{cortex-m7} and @samp{cortex-m33}.
16605 Disables the floating-point and SIMD instructions on
16606 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7},
16607 @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a12},
16608 @samp{cortex-a15}, @samp{cortex-a17}, @samp{cortex-a15.cortex-a7},
16609 @samp{cortex-a17.cortex-a7}, @samp{cortex-a32}, @samp{cortex-a35},
16610 @samp{cortex-a53} and @samp{cortex-a55}.
16612 @item +nofp.dp
16613 Disables the double-precision component of the floating-point instructions
16614 on @samp{cortex-r5}, @samp{cortex-r52} and @samp{cortex-m7}.
16616 @item +nosimd
16617 Disables the SIMD (but not floating-point) instructions on
16618 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}
16619 and @samp{cortex-a9}.
16621 @item +crypto
16622 Enables the cryptographic instructions on @samp{cortex-a32},
16623 @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55}, @samp{cortex-a57},
16624 @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75}, @samp{exynos-m1},
16625 @samp{xgene1}, @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
16626 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53} and
16627 @samp{cortex-a75.cortex-a55}.
16628 @end table
16630 Additionally the @samp{generic-armv7-a} pseudo target defaults to
16631 VFPv3 with 16 double-precision registers.  It supports the following
16632 extension options: @samp{vfpv3-d16}, @samp{vfpv3},
16633 @samp{vfpv3-d16-fp16}, @samp{vfpv3-fp16}, @samp{vfpv4-d16},
16634 @samp{vfpv4}, @samp{neon}, @samp{neon-vfpv3}, @samp{neon-fp16},
16635 @samp{neon-vfpv4}.  The meanings are the same as for the extensions to
16636 @option{-march=armv7-a}.
16638 @option{-mcpu=generic-@var{arch}} is also permissible, and is
16639 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
16640 See @option{-mtune} for more information.
16642 @option{-mcpu=native} causes the compiler to auto-detect the CPU
16643 of the build computer.  At present, this feature is only supported on
16644 GNU/Linux, and not all architectures are recognized.  If the auto-detect
16645 is unsuccessful the option has no effect.
16647 @item -mfpu=@var{name}
16648 @opindex mfpu
16649 This specifies what floating-point hardware (or hardware emulation) is
16650 available on the target.  Permissible names are: @samp{auto}, @samp{vfpv2},
16651 @samp{vfpv3},
16652 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
16653 @samp{vfpv3xd-fp16}, @samp{neon-vfpv3}, @samp{neon-fp16}, @samp{vfpv4},
16654 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
16655 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
16656 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
16657 Note that @samp{neon} is an alias for @samp{neon-vfpv3} and @samp{vfp}
16658 is an alias for @samp{vfpv2}.
16660 The setting @samp{auto} is the default and is special.  It causes the
16661 compiler to select the floating-point and Advanced SIMD instructions
16662 based on the settings of @option{-mcpu} and @option{-march}.
16664 If the selected floating-point hardware includes the NEON extension
16665 (e.g. @option{-mfpu=neon}), note that floating-point
16666 operations are not generated by GCC's auto-vectorization pass unless
16667 @option{-funsafe-math-optimizations} is also specified.  This is
16668 because NEON hardware does not fully implement the IEEE 754 standard for
16669 floating-point arithmetic (in particular denormal values are treated as
16670 zero), so the use of NEON instructions may lead to a loss of precision.
16672 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}).
16674 @item -mfp16-format=@var{name}
16675 @opindex mfp16-format
16676 Specify the format of the @code{__fp16} half-precision floating-point type.
16677 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
16678 the default is @samp{none}, in which case the @code{__fp16} type is not
16679 defined.  @xref{Half-Precision}, for more information.
16681 @item -mstructure-size-boundary=@var{n}
16682 @opindex mstructure-size-boundary
16683 The sizes of all structures and unions are rounded up to a multiple
16684 of the number of bits set by this option.  Permissible values are 8, 32
16685 and 64.  The default value varies for different toolchains.  For the COFF
16686 targeted toolchain the default value is 8.  A value of 64 is only allowed
16687 if the underlying ABI supports it.
16689 Specifying a larger number can produce faster, more efficient code, but
16690 can also increase the size of the program.  Different values are potentially
16691 incompatible.  Code compiled with one value cannot necessarily expect to
16692 work with code or libraries compiled with another value, if they exchange
16693 information using structures or unions.
16695 This option is deprecated.
16697 @item -mabort-on-noreturn
16698 @opindex mabort-on-noreturn
16699 Generate a call to the function @code{abort} at the end of a
16700 @code{noreturn} function.  It is executed if the function tries to
16701 return.
16703 @item -mlong-calls
16704 @itemx -mno-long-calls
16705 @opindex mlong-calls
16706 @opindex mno-long-calls
16707 Tells the compiler to perform function calls by first loading the
16708 address of the function into a register and then performing a subroutine
16709 call on this register.  This switch is needed if the target function
16710 lies outside of the 64-megabyte addressing range of the offset-based
16711 version of subroutine call instruction.
16713 Even if this switch is enabled, not all function calls are turned
16714 into long calls.  The heuristic is that static functions, functions
16715 that have the @code{short_call} attribute, functions that are inside
16716 the scope of a @code{#pragma no_long_calls} directive, and functions whose
16717 definitions have already been compiled within the current compilation
16718 unit are not turned into long calls.  The exceptions to this rule are
16719 that weak function definitions, functions with the @code{long_call}
16720 attribute or the @code{section} attribute, and functions that are within
16721 the scope of a @code{#pragma long_calls} directive are always
16722 turned into long calls.
16724 This feature is not enabled by default.  Specifying
16725 @option{-mno-long-calls} restores the default behavior, as does
16726 placing the function calls within the scope of a @code{#pragma
16727 long_calls_off} directive.  Note these switches have no effect on how
16728 the compiler generates code to handle function calls via function
16729 pointers.
16731 @item -msingle-pic-base
16732 @opindex msingle-pic-base
16733 Treat the register used for PIC addressing as read-only, rather than
16734 loading it in the prologue for each function.  The runtime system is
16735 responsible for initializing this register with an appropriate value
16736 before execution begins.
16738 @item -mpic-register=@var{reg}
16739 @opindex mpic-register
16740 Specify the register to be used for PIC addressing.
16741 For standard PIC base case, the default is any suitable register
16742 determined by compiler.  For single PIC base case, the default is
16743 @samp{R9} if target is EABI based or stack-checking is enabled,
16744 otherwise the default is @samp{R10}.
16746 @item -mpic-data-is-text-relative
16747 @opindex mpic-data-is-text-relative
16748 Assume that the displacement between the text and data segments is fixed
16749 at static link time.  This permits using PC-relative addressing
16750 operations to access data known to be in the data segment.  For
16751 non-VxWorks RTP targets, this option is enabled by default.  When
16752 disabled on such targets, it will enable @option{-msingle-pic-base} by
16753 default.
16755 @item -mpoke-function-name
16756 @opindex mpoke-function-name
16757 Write the name of each function into the text section, directly
16758 preceding the function prologue.  The generated code is similar to this:
16760 @smallexample
16761      t0
16762          .ascii "arm_poke_function_name", 0
16763          .align
16764      t1
16765          .word 0xff000000 + (t1 - t0)
16766      arm_poke_function_name
16767          mov     ip, sp
16768          stmfd   sp!, @{fp, ip, lr, pc@}
16769          sub     fp, ip, #4
16770 @end smallexample
16772 When performing a stack backtrace, code can inspect the value of
16773 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
16774 location @code{pc - 12} and the top 8 bits are set, then we know that
16775 there is a function name embedded immediately preceding this location
16776 and has length @code{((pc[-3]) & 0xff000000)}.
16778 @item -mthumb
16779 @itemx -marm
16780 @opindex marm
16781 @opindex mthumb
16783 Select between generating code that executes in ARM and Thumb
16784 states.  The default for most configurations is to generate code
16785 that executes in ARM state, but the default can be changed by
16786 configuring GCC with the @option{--with-mode=}@var{state}
16787 configure option.
16789 You can also override the ARM and Thumb mode for each function
16790 by using the @code{target("thumb")} and @code{target("arm")} function attributes
16791 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
16793 @item -mflip-thumb 
16794 @opindex mflip-thumb
16795 Switch ARM/Thumb modes on alternating functions.
16796 This option is provided for regression testing of mixed Thumb/ARM code
16797 generation, and is not intended for ordinary use in compiling code.
16799 @item -mtpcs-frame
16800 @opindex mtpcs-frame
16801 Generate a stack frame that is compliant with the Thumb Procedure Call
16802 Standard for all non-leaf functions.  (A leaf function is one that does
16803 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
16805 @item -mtpcs-leaf-frame
16806 @opindex mtpcs-leaf-frame
16807 Generate a stack frame that is compliant with the Thumb Procedure Call
16808 Standard for all leaf functions.  (A leaf function is one that does
16809 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
16811 @item -mcallee-super-interworking
16812 @opindex mcallee-super-interworking
16813 Gives all externally visible functions in the file being compiled an ARM
16814 instruction set header which switches to Thumb mode before executing the
16815 rest of the function.  This allows these functions to be called from
16816 non-interworking code.  This option is not valid in AAPCS configurations
16817 because interworking is enabled by default.
16819 @item -mcaller-super-interworking
16820 @opindex mcaller-super-interworking
16821 Allows calls via function pointers (including virtual functions) to
16822 execute correctly regardless of whether the target code has been
16823 compiled for interworking or not.  There is a small overhead in the cost
16824 of executing a function pointer if this option is enabled.  This option
16825 is not valid in AAPCS configurations because interworking is enabled
16826 by default.
16828 @item -mtp=@var{name}
16829 @opindex mtp
16830 Specify the access model for the thread local storage pointer.  The valid
16831 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
16832 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
16833 (supported in the arm6k architecture), and @samp{auto}, which uses the
16834 best available method for the selected processor.  The default setting is
16835 @samp{auto}.
16837 @item -mtls-dialect=@var{dialect}
16838 @opindex mtls-dialect
16839 Specify the dialect to use for accessing thread local storage.  Two
16840 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
16841 @samp{gnu} dialect selects the original GNU scheme for supporting
16842 local and global dynamic TLS models.  The @samp{gnu2} dialect
16843 selects the GNU descriptor scheme, which provides better performance
16844 for shared libraries.  The GNU descriptor scheme is compatible with
16845 the original scheme, but does require new assembler, linker and
16846 library support.  Initial and local exec TLS models are unaffected by
16847 this option and always use the original scheme.
16849 @item -mword-relocations
16850 @opindex mword-relocations
16851 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
16852 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
16853 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
16854 is specified.
16856 @item -mfix-cortex-m3-ldrd
16857 @opindex mfix-cortex-m3-ldrd
16858 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
16859 with overlapping destination and base registers are used.  This option avoids
16860 generating these instructions.  This option is enabled by default when
16861 @option{-mcpu=cortex-m3} is specified.
16863 @item -munaligned-access
16864 @itemx -mno-unaligned-access
16865 @opindex munaligned-access
16866 @opindex mno-unaligned-access
16867 Enables (or disables) reading and writing of 16- and 32- bit values
16868 from addresses that are not 16- or 32- bit aligned.  By default
16869 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
16870 ARMv8-M Baseline architectures, and enabled for all other
16871 architectures.  If unaligned access is not enabled then words in packed
16872 data structures are accessed a byte at a time.
16874 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
16875 generated object file to either true or false, depending upon the
16876 setting of this option.  If unaligned access is enabled then the
16877 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
16878 defined.
16880 @item -mneon-for-64bits
16881 @opindex mneon-for-64bits
16882 Enables using Neon to handle scalar 64-bits operations. This is
16883 disabled by default since the cost of moving data from core registers
16884 to Neon is high.
16886 @item -mslow-flash-data
16887 @opindex mslow-flash-data
16888 Assume loading data from flash is slower than fetching instruction.
16889 Therefore literal load is minimized for better performance.
16890 This option is only supported when compiling for ARMv7 M-profile and
16891 off by default.
16893 @item -masm-syntax-unified
16894 @opindex masm-syntax-unified
16895 Assume inline assembler is using unified asm syntax.  The default is
16896 currently off which implies divided syntax.  This option has no impact
16897 on Thumb2. However, this may change in future releases of GCC.
16898 Divided syntax should be considered deprecated.
16900 @item -mrestrict-it
16901 @opindex mrestrict-it
16902 Restricts generation of IT blocks to conform to the rules of ARMv8-A.
16903 IT blocks can only contain a single 16-bit instruction from a select
16904 set of instructions. This option is on by default for ARMv8-A Thumb mode.
16906 @item -mprint-tune-info
16907 @opindex mprint-tune-info
16908 Print CPU tuning information as comment in assembler file.  This is
16909 an option used only for regression testing of the compiler and not
16910 intended for ordinary use in compiling code.  This option is disabled
16911 by default.
16913 @item -mverbose-cost-dump
16914 @opindex mverbose-cost-dump
16915 Enable verbose cost model dumping in the debug dump files.  This option is
16916 provided for use in debugging the compiler.
16918 @item -mpure-code
16919 @opindex mpure-code
16920 Do not allow constant data to be placed in code sections.
16921 Additionally, when compiling for ELF object format give all text sections the
16922 ELF processor-specific section attribute @code{SHF_ARM_PURECODE}.  This option
16923 is only available when generating non-pic code for M-profile targets with the
16924 MOVT instruction.
16926 @item -mcmse
16927 @opindex mcmse
16928 Generate secure code as per the "ARMv8-M Security Extensions: Requirements on
16929 Development Tools Engineering Specification", which can be found on
16930 @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}.
16931 @end table
16933 @node AVR Options
16934 @subsection AVR Options
16935 @cindex AVR Options
16937 These options are defined for AVR implementations:
16939 @table @gcctabopt
16940 @item -mmcu=@var{mcu}
16941 @opindex mmcu
16942 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
16944 The default for this option is@tie{}@samp{avr2}.
16946 GCC supports the following AVR devices and ISAs:
16948 @include avr-mmcu.texi
16950 @item -mabsdata
16951 @opindex mabsdata
16953 Assume that all data in static storage can be accessed by LDS / STS
16954 instructions.  This option has only an effect on reduced Tiny devices like
16955 ATtiny40.  See also the @code{absdata}
16956 @ref{AVR Variable Attributes,variable attribute}.
16958 @item -maccumulate-args
16959 @opindex maccumulate-args
16960 Accumulate outgoing function arguments and acquire/release the needed
16961 stack space for outgoing function arguments once in function
16962 prologue/epilogue.  Without this option, outgoing arguments are pushed
16963 before calling a function and popped afterwards.
16965 Popping the arguments after the function call can be expensive on
16966 AVR so that accumulating the stack space might lead to smaller
16967 executables because arguments need not be removed from the
16968 stack after such a function call.
16970 This option can lead to reduced code size for functions that perform
16971 several calls to functions that get their arguments on the stack like
16972 calls to printf-like functions.
16974 @item -mbranch-cost=@var{cost}
16975 @opindex mbranch-cost
16976 Set the branch costs for conditional branch instructions to
16977 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
16978 integers. The default branch cost is 0.
16980 @item -mcall-prologues
16981 @opindex mcall-prologues
16982 Functions prologues/epilogues are expanded as calls to appropriate
16983 subroutines.  Code size is smaller.
16985 @item -mgas-isr-prologues
16986 @opindex mgas-isr-prologues
16987 Interrupt service routines (ISRs) may use the @code{__gcc_isr} pseudo
16988 instruction supported by GNU Binutils.
16989 If this option is on, the feature can still be disabled for individual
16990 ISRs by means of the @ref{AVR Function Attributes,,@code{no_gccisr}}
16991 function attribute.  This feature is activated per default
16992 if optimization is on (but not with @option{-Og}, @pxref{Optimize Options}),
16993 and if GNU Binutils support @w{@uref{https://sourceware.org/PR21683,PR21683}}.
16995 @item -mint8
16996 @opindex mint8
16997 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
16998 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
16999 and @code{long long} is 4 bytes.  Please note that this option does not
17000 conform to the C standards, but it results in smaller code
17001 size.
17003 @item -mmain-is-OS_task
17004 @opindex mmain-is-OS_task
17005 Do not save registers in @code{main}.  The effect is the same like
17006 attaching attribute @ref{AVR Function Attributes,,@code{OS_task}}
17007 to @code{main}. It is activated per default if optimization is on.
17009 @item -mn-flash=@var{num}
17010 @opindex mn-flash
17011 Assume that the flash memory has a size of 
17012 @var{num} times 64@tie{}KiB.
17014 @item -mno-interrupts
17015 @opindex mno-interrupts
17016 Generated code is not compatible with hardware interrupts.
17017 Code size is smaller.
17019 @item -mrelax
17020 @opindex mrelax
17021 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
17022 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
17023 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
17024 the assembler's command line and the @option{--relax} option to the
17025 linker's command line.
17027 Jump relaxing is performed by the linker because jump offsets are not
17028 known before code is located. Therefore, the assembler code generated by the
17029 compiler is the same, but the instructions in the executable may
17030 differ from instructions in the assembler code.
17032 Relaxing must be turned on if linker stubs are needed, see the
17033 section on @code{EIND} and linker stubs below.
17035 @item -mrmw
17036 @opindex mrmw
17037 Assume that the device supports the Read-Modify-Write
17038 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
17040 @item -mshort-calls
17041 @opindex mshort-calls
17043 Assume that @code{RJMP} and @code{RCALL} can target the whole
17044 program memory.
17046 This option is used internally for multilib selection.  It is
17047 not an optimization option, and you don't need to set it by hand.
17049 @item -msp8
17050 @opindex msp8
17051 Treat the stack pointer register as an 8-bit register,
17052 i.e.@: assume the high byte of the stack pointer is zero.
17053 In general, you don't need to set this option by hand.
17055 This option is used internally by the compiler to select and
17056 build multilibs for architectures @code{avr2} and @code{avr25}.
17057 These architectures mix devices with and without @code{SPH}.
17058 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
17059 the compiler driver adds or removes this option from the compiler
17060 proper's command line, because the compiler then knows if the device
17061 or architecture has an 8-bit stack pointer and thus no @code{SPH}
17062 register or not.
17064 @item -mstrict-X
17065 @opindex mstrict-X
17066 Use address register @code{X} in a way proposed by the hardware.  This means
17067 that @code{X} is only used in indirect, post-increment or
17068 pre-decrement addressing.
17070 Without this option, the @code{X} register may be used in the same way
17071 as @code{Y} or @code{Z} which then is emulated by additional
17072 instructions.  
17073 For example, loading a value with @code{X+const} addressing with a
17074 small non-negative @code{const < 64} to a register @var{Rn} is
17075 performed as
17077 @example
17078 adiw r26, const   ; X += const
17079 ld   @var{Rn}, X        ; @var{Rn} = *X
17080 sbiw r26, const   ; X -= const
17081 @end example
17083 @item -mtiny-stack
17084 @opindex mtiny-stack
17085 Only change the lower 8@tie{}bits of the stack pointer.
17087 @item -mfract-convert-truncate
17088 @opindex mfract-convert-truncate
17089 Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
17091 @item -nodevicelib
17092 @opindex nodevicelib
17093 Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
17095 @item -Waddr-space-convert
17096 @opindex Waddr-space-convert
17097 @opindex Wno-addr-space-convert
17098 Warn about conversions between address spaces in the case where the
17099 resulting address space is not contained in the incoming address space.
17101 @item -Wmisspelled-isr
17102 @opindex Wmisspelled-isr
17103 @opindex Wno-misspelled-isr
17104 Warn if the ISR is misspelled, i.e. without __vector prefix.
17105 Enabled by default.
17106 @end table
17108 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
17109 @cindex @code{EIND}
17110 Pointers in the implementation are 16@tie{}bits wide.
17111 The address of a function or label is represented as word address so
17112 that indirect jumps and calls can target any code address in the
17113 range of 64@tie{}Ki words.
17115 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
17116 bytes of program memory space, there is a special function register called
17117 @code{EIND} that serves as most significant part of the target address
17118 when @code{EICALL} or @code{EIJMP} instructions are used.
17120 Indirect jumps and calls on these devices are handled as follows by
17121 the compiler and are subject to some limitations:
17123 @itemize @bullet
17125 @item
17126 The compiler never sets @code{EIND}.
17128 @item
17129 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
17130 instructions or might read @code{EIND} directly in order to emulate an
17131 indirect call/jump by means of a @code{RET} instruction.
17133 @item
17134 The compiler assumes that @code{EIND} never changes during the startup
17135 code or during the application. In particular, @code{EIND} is not
17136 saved/restored in function or interrupt service routine
17137 prologue/epilogue.
17139 @item
17140 For indirect calls to functions and computed goto, the linker
17141 generates @emph{stubs}. Stubs are jump pads sometimes also called
17142 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
17143 The stub contains a direct jump to the desired address.
17145 @item
17146 Linker relaxation must be turned on so that the linker generates
17147 the stubs correctly in all situations. See the compiler option
17148 @option{-mrelax} and the linker option @option{--relax}.
17149 There are corner cases where the linker is supposed to generate stubs
17150 but aborts without relaxation and without a helpful error message.
17152 @item
17153 The default linker script is arranged for code with @code{EIND = 0}.
17154 If code is supposed to work for a setup with @code{EIND != 0}, a custom
17155 linker script has to be used in order to place the sections whose
17156 name start with @code{.trampolines} into the segment where @code{EIND}
17157 points to.
17159 @item
17160 The startup code from libgcc never sets @code{EIND}.
17161 Notice that startup code is a blend of code from libgcc and AVR-LibC.
17162 For the impact of AVR-LibC on @code{EIND}, see the
17163 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
17165 @item
17166 It is legitimate for user-specific startup code to set up @code{EIND}
17167 early, for example by means of initialization code located in
17168 section @code{.init3}. Such code runs prior to general startup code
17169 that initializes RAM and calls constructors, but after the bit
17170 of startup code from AVR-LibC that sets @code{EIND} to the segment
17171 where the vector table is located.
17172 @example
17173 #include <avr/io.h>
17175 static void
17176 __attribute__((section(".init3"),naked,used,no_instrument_function))
17177 init3_set_eind (void)
17179   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
17180                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
17182 @end example
17184 @noindent
17185 The @code{__trampolines_start} symbol is defined in the linker script.
17187 @item
17188 Stubs are generated automatically by the linker if
17189 the following two conditions are met:
17190 @itemize @minus
17192 @item The address of a label is taken by means of the @code{gs} modifier
17193 (short for @emph{generate stubs}) like so:
17194 @example
17195 LDI r24, lo8(gs(@var{func}))
17196 LDI r25, hi8(gs(@var{func}))
17197 @end example
17198 @item The final location of that label is in a code segment
17199 @emph{outside} the segment where the stubs are located.
17200 @end itemize
17202 @item
17203 The compiler emits such @code{gs} modifiers for code labels in the
17204 following situations:
17205 @itemize @minus
17206 @item Taking address of a function or code label.
17207 @item Computed goto.
17208 @item If prologue-save function is used, see @option{-mcall-prologues}
17209 command-line option.
17210 @item Switch/case dispatch tables. If you do not want such dispatch
17211 tables you can specify the @option{-fno-jump-tables} command-line option.
17212 @item C and C++ constructors/destructors called during startup/shutdown.
17213 @item If the tools hit a @code{gs()} modifier explained above.
17214 @end itemize
17216 @item
17217 Jumping to non-symbolic addresses like so is @emph{not} supported:
17219 @example
17220 int main (void)
17222     /* Call function at word address 0x2 */
17223     return ((int(*)(void)) 0x2)();
17225 @end example
17227 Instead, a stub has to be set up, i.e.@: the function has to be called
17228 through a symbol (@code{func_4} in the example):
17230 @example
17231 int main (void)
17233     extern int func_4 (void);
17235     /* Call function at byte address 0x4 */
17236     return func_4();
17238 @end example
17240 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
17241 Alternatively, @code{func_4} can be defined in the linker script.
17242 @end itemize
17244 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
17245 @cindex @code{RAMPD}
17246 @cindex @code{RAMPX}
17247 @cindex @code{RAMPY}
17248 @cindex @code{RAMPZ}
17249 Some AVR devices support memories larger than the 64@tie{}KiB range
17250 that can be accessed with 16-bit pointers.  To access memory locations
17251 outside this 64@tie{}KiB range, the content of a @code{RAMP}
17252 register is used as high part of the address:
17253 The @code{X}, @code{Y}, @code{Z} address register is concatenated
17254 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
17255 register, respectively, to get a wide address. Similarly,
17256 @code{RAMPD} is used together with direct addressing.
17258 @itemize
17259 @item
17260 The startup code initializes the @code{RAMP} special function
17261 registers with zero.
17263 @item
17264 If a @ref{AVR Named Address Spaces,named address space} other than
17265 generic or @code{__flash} is used, then @code{RAMPZ} is set
17266 as needed before the operation.
17268 @item
17269 If the device supports RAM larger than 64@tie{}KiB and the compiler
17270 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
17271 is reset to zero after the operation.
17273 @item
17274 If the device comes with a specific @code{RAMP} register, the ISR
17275 prologue/epilogue saves/restores that SFR and initializes it with
17276 zero in case the ISR code might (implicitly) use it.
17278 @item
17279 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
17280 If you use inline assembler to read from locations outside the
17281 16-bit address range and change one of the @code{RAMP} registers,
17282 you must reset it to zero after the access.
17284 @end itemize
17286 @subsubsection AVR Built-in Macros
17288 GCC defines several built-in macros so that the user code can test
17289 for the presence or absence of features.  Almost any of the following
17290 built-in macros are deduced from device capabilities and thus
17291 triggered by the @option{-mmcu=} command-line option.
17293 For even more AVR-specific built-in macros see
17294 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
17296 @table @code
17298 @item __AVR_ARCH__
17299 Build-in macro that resolves to a decimal number that identifies the
17300 architecture and depends on the @option{-mmcu=@var{mcu}} option.
17301 Possible values are:
17303 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
17304 @code{4}, @code{5}, @code{51}, @code{6}
17306 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
17307 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
17309 respectively and
17311 @code{100},
17312 @code{102}, @code{103}, @code{104},
17313 @code{105}, @code{106}, @code{107}
17315 for @var{mcu}=@code{avrtiny},
17316 @code{avrxmega2}, @code{avrxmega3}, @code{avrxmega4},
17317 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
17318 If @var{mcu} specifies a device, this built-in macro is set
17319 accordingly. For example, with @option{-mmcu=atmega8} the macro is
17320 defined to @code{4}.
17322 @item __AVR_@var{Device}__
17323 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
17324 the device's name. For example, @option{-mmcu=atmega8} defines the
17325 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
17326 @code{__AVR_ATtiny261A__}, etc.
17328 The built-in macros' names follow
17329 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
17330 the device name as from the AVR user manual. The difference between
17331 @var{Device} in the built-in macro and @var{device} in
17332 @option{-mmcu=@var{device}} is that the latter is always lowercase.
17334 If @var{device} is not a device but only a core architecture like
17335 @samp{avr51}, this macro is not defined.
17337 @item __AVR_DEVICE_NAME__
17338 Setting @option{-mmcu=@var{device}} defines this built-in macro to
17339 the device's name. For example, with @option{-mmcu=atmega8} the macro
17340 is defined to @code{atmega8}.
17342 If @var{device} is not a device but only a core architecture like
17343 @samp{avr51}, this macro is not defined.
17345 @item __AVR_XMEGA__
17346 The device / architecture belongs to the XMEGA family of devices.
17348 @item __AVR_HAVE_ELPM__
17349 The device has the @code{ELPM} instruction.
17351 @item __AVR_HAVE_ELPMX__
17352 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
17353 R@var{n},Z+} instructions.
17355 @item __AVR_HAVE_MOVW__
17356 The device has the @code{MOVW} instruction to perform 16-bit
17357 register-register moves.
17359 @item __AVR_HAVE_LPMX__
17360 The device has the @code{LPM R@var{n},Z} and
17361 @code{LPM R@var{n},Z+} instructions.
17363 @item __AVR_HAVE_MUL__
17364 The device has a hardware multiplier. 
17366 @item __AVR_HAVE_JMP_CALL__
17367 The device has the @code{JMP} and @code{CALL} instructions.
17368 This is the case for devices with more than 8@tie{}KiB of program
17369 memory.
17371 @item __AVR_HAVE_EIJMP_EICALL__
17372 @itemx __AVR_3_BYTE_PC__
17373 The device has the @code{EIJMP} and @code{EICALL} instructions.
17374 This is the case for devices with more than 128@tie{}KiB of program memory.
17375 This also means that the program counter
17376 (PC) is 3@tie{}bytes wide.
17378 @item __AVR_2_BYTE_PC__
17379 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
17380 with up to 128@tie{}KiB of program memory.
17382 @item __AVR_HAVE_8BIT_SP__
17383 @itemx __AVR_HAVE_16BIT_SP__
17384 The stack pointer (SP) register is treated as 8-bit respectively
17385 16-bit register by the compiler.
17386 The definition of these macros is affected by @option{-mtiny-stack}.
17388 @item __AVR_HAVE_SPH__
17389 @itemx __AVR_SP8__
17390 The device has the SPH (high part of stack pointer) special function
17391 register or has an 8-bit stack pointer, respectively.
17392 The definition of these macros is affected by @option{-mmcu=} and
17393 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
17394 by @option{-msp8}.
17396 @item __AVR_HAVE_RAMPD__
17397 @itemx __AVR_HAVE_RAMPX__
17398 @itemx __AVR_HAVE_RAMPY__
17399 @itemx __AVR_HAVE_RAMPZ__
17400 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
17401 @code{RAMPZ} special function register, respectively.
17403 @item __NO_INTERRUPTS__
17404 This macro reflects the @option{-mno-interrupts} command-line option.
17406 @item __AVR_ERRATA_SKIP__
17407 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
17408 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
17409 instructions because of a hardware erratum.  Skip instructions are
17410 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
17411 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
17412 set.
17414 @item __AVR_ISA_RMW__
17415 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
17417 @item __AVR_SFR_OFFSET__=@var{offset}
17418 Instructions that can address I/O special function registers directly
17419 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
17420 address as if addressed by an instruction to access RAM like @code{LD}
17421 or @code{STS}. This offset depends on the device architecture and has
17422 to be subtracted from the RAM address in order to get the
17423 respective I/O@tie{}address.
17425 @item __AVR_SHORT_CALLS__
17426 The @option{-mshort-calls} command line option is set.
17428 @item __AVR_PM_BASE_ADDRESS__=@var{addr}
17429 Some devices support reading from flash memory by means of @code{LD*}
17430 instructions.  The flash memory is seen in the data address space
17431 at an offset of @code{__AVR_PM_BASE_ADDRESS__}.  If this macro
17432 is not defined, this feature is not available.  If defined,
17433 the address space is linear and there is no need to put
17434 @code{.rodata} into RAM.  This is handled by the default linker
17435 description file, and is currently available for
17436 @code{avrtiny} and @code{avrxmega3}.  Even more convenient,
17437 there is no need to use address spaces like @code{__flash} or
17438 features like attribute @code{progmem} and @code{pgm_read_*}.
17440 @item __WITH_AVRLIBC__
17441 The compiler is configured to be used together with AVR-Libc.
17442 See the @option{--with-avrlibc} configure option.
17444 @end table
17446 @node Blackfin Options
17447 @subsection Blackfin Options
17448 @cindex Blackfin Options
17450 @table @gcctabopt
17451 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
17452 @opindex mcpu=
17453 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
17454 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
17455 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
17456 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
17457 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
17458 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
17459 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
17460 @samp{bf561}, @samp{bf592}.
17462 The optional @var{sirevision} specifies the silicon revision of the target
17463 Blackfin processor.  Any workarounds available for the targeted silicon revision
17464 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
17465 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
17466 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
17467 hexadecimal digits representing the major and minor numbers in the silicon
17468 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
17469 is not defined.  If @var{sirevision} is @samp{any}, the
17470 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
17471 If this optional @var{sirevision} is not used, GCC assumes the latest known
17472 silicon revision of the targeted Blackfin processor.
17474 GCC defines a preprocessor macro for the specified @var{cpu}.
17475 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
17476 provided by libgloss to be linked in if @option{-msim} is not given.
17478 Without this option, @samp{bf532} is used as the processor by default.
17480 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
17481 only the preprocessor macro is defined.
17483 @item -msim
17484 @opindex msim
17485 Specifies that the program will be run on the simulator.  This causes
17486 the simulator BSP provided by libgloss to be linked in.  This option
17487 has effect only for @samp{bfin-elf} toolchain.
17488 Certain other options, such as @option{-mid-shared-library} and
17489 @option{-mfdpic}, imply @option{-msim}.
17491 @item -momit-leaf-frame-pointer
17492 @opindex momit-leaf-frame-pointer
17493 Don't keep the frame pointer in a register for leaf functions.  This
17494 avoids the instructions to save, set up and restore frame pointers and
17495 makes an extra register available in leaf functions.
17497 @item -mspecld-anomaly
17498 @opindex mspecld-anomaly
17499 When enabled, the compiler ensures that the generated code does not
17500 contain speculative loads after jump instructions. If this option is used,
17501 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
17503 @item -mno-specld-anomaly
17504 @opindex mno-specld-anomaly
17505 Don't generate extra code to prevent speculative loads from occurring.
17507 @item -mcsync-anomaly
17508 @opindex mcsync-anomaly
17509 When enabled, the compiler ensures that the generated code does not
17510 contain CSYNC or SSYNC instructions too soon after conditional branches.
17511 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
17513 @item -mno-csync-anomaly
17514 @opindex mno-csync-anomaly
17515 Don't generate extra code to prevent CSYNC or SSYNC instructions from
17516 occurring too soon after a conditional branch.
17518 @item -mlow-64k
17519 @opindex mlow-64k
17520 When enabled, the compiler is free to take advantage of the knowledge that
17521 the entire program fits into the low 64k of memory.
17523 @item -mno-low-64k
17524 @opindex mno-low-64k
17525 Assume that the program is arbitrarily large.  This is the default.
17527 @item -mstack-check-l1
17528 @opindex mstack-check-l1
17529 Do stack checking using information placed into L1 scratchpad memory by the
17530 uClinux kernel.
17532 @item -mid-shared-library
17533 @opindex mid-shared-library
17534 Generate code that supports shared libraries via the library ID method.
17535 This allows for execute in place and shared libraries in an environment
17536 without virtual memory management.  This option implies @option{-fPIC}.
17537 With a @samp{bfin-elf} target, this option implies @option{-msim}.
17539 @item -mno-id-shared-library
17540 @opindex mno-id-shared-library
17541 Generate code that doesn't assume ID-based shared libraries are being used.
17542 This is the default.
17544 @item -mleaf-id-shared-library
17545 @opindex mleaf-id-shared-library
17546 Generate code that supports shared libraries via the library ID method,
17547 but assumes that this library or executable won't link against any other
17548 ID shared libraries.  That allows the compiler to use faster code for jumps
17549 and calls.
17551 @item -mno-leaf-id-shared-library
17552 @opindex mno-leaf-id-shared-library
17553 Do not assume that the code being compiled won't link against any ID shared
17554 libraries.  Slower code is generated for jump and call insns.
17556 @item -mshared-library-id=n
17557 @opindex mshared-library-id
17558 Specifies the identification number of the ID-based shared library being
17559 compiled.  Specifying a value of 0 generates more compact code; specifying
17560 other values forces the allocation of that number to the current
17561 library but is no more space- or time-efficient than omitting this option.
17563 @item -msep-data
17564 @opindex msep-data
17565 Generate code that allows the data segment to be located in a different
17566 area of memory from the text segment.  This allows for execute in place in
17567 an environment without virtual memory management by eliminating relocations
17568 against the text section.
17570 @item -mno-sep-data
17571 @opindex mno-sep-data
17572 Generate code that assumes that the data segment follows the text segment.
17573 This is the default.
17575 @item -mlong-calls
17576 @itemx -mno-long-calls
17577 @opindex mlong-calls
17578 @opindex mno-long-calls
17579 Tells the compiler to perform function calls by first loading the
17580 address of the function into a register and then performing a subroutine
17581 call on this register.  This switch is needed if the target function
17582 lies outside of the 24-bit addressing range of the offset-based
17583 version of subroutine call instruction.
17585 This feature is not enabled by default.  Specifying
17586 @option{-mno-long-calls} restores the default behavior.  Note these
17587 switches have no effect on how the compiler generates code to handle
17588 function calls via function pointers.
17590 @item -mfast-fp
17591 @opindex mfast-fp
17592 Link with the fast floating-point library. This library relaxes some of
17593 the IEEE floating-point standard's rules for checking inputs against
17594 Not-a-Number (NAN), in the interest of performance.
17596 @item -minline-plt
17597 @opindex minline-plt
17598 Enable inlining of PLT entries in function calls to functions that are
17599 not known to bind locally.  It has no effect without @option{-mfdpic}.
17601 @item -mmulticore
17602 @opindex mmulticore
17603 Build a standalone application for multicore Blackfin processors. 
17604 This option causes proper start files and link scripts supporting 
17605 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
17606 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
17608 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
17609 selects the one-application-per-core programming model.  Without
17610 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
17611 programming model is used. In this model, the main function of Core B
17612 should be named as @code{coreb_main}.
17614 If this option is not used, the single-core application programming
17615 model is used.
17617 @item -mcorea
17618 @opindex mcorea
17619 Build a standalone application for Core A of BF561 when using
17620 the one-application-per-core programming model. Proper start files
17621 and link scripts are used to support Core A, and the macro
17622 @code{__BFIN_COREA} is defined.
17623 This option can only be used in conjunction with @option{-mmulticore}.
17625 @item -mcoreb
17626 @opindex mcoreb
17627 Build a standalone application for Core B of BF561 when using
17628 the one-application-per-core programming model. Proper start files
17629 and link scripts are used to support Core B, and the macro
17630 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
17631 should be used instead of @code{main}. 
17632 This option can only be used in conjunction with @option{-mmulticore}.
17634 @item -msdram
17635 @opindex msdram
17636 Build a standalone application for SDRAM. Proper start files and
17637 link scripts are used to put the application into SDRAM, and the macro
17638 @code{__BFIN_SDRAM} is defined.
17639 The loader should initialize SDRAM before loading the application.
17641 @item -micplb
17642 @opindex micplb
17643 Assume that ICPLBs are enabled at run time.  This has an effect on certain
17644 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
17645 are enabled; for standalone applications the default is off.
17646 @end table
17648 @node C6X Options
17649 @subsection C6X Options
17650 @cindex C6X Options
17652 @table @gcctabopt
17653 @item -march=@var{name}
17654 @opindex march
17655 This specifies the name of the target architecture.  GCC uses this
17656 name to determine what kind of instructions it can emit when generating
17657 assembly code.  Permissible names are: @samp{c62x},
17658 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
17660 @item -mbig-endian
17661 @opindex mbig-endian
17662 Generate code for a big-endian target.
17664 @item -mlittle-endian
17665 @opindex mlittle-endian
17666 Generate code for a little-endian target.  This is the default.
17668 @item -msim
17669 @opindex msim
17670 Choose startup files and linker script suitable for the simulator.
17672 @item -msdata=default
17673 @opindex msdata=default
17674 Put small global and static data in the @code{.neardata} section,
17675 which is pointed to by register @code{B14}.  Put small uninitialized
17676 global and static data in the @code{.bss} section, which is adjacent
17677 to the @code{.neardata} section.  Put small read-only data into the
17678 @code{.rodata} section.  The corresponding sections used for large
17679 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
17681 @item -msdata=all
17682 @opindex msdata=all
17683 Put all data, not just small objects, into the sections reserved for
17684 small data, and use addressing relative to the @code{B14} register to
17685 access them.
17687 @item -msdata=none
17688 @opindex msdata=none
17689 Make no use of the sections reserved for small data, and use absolute
17690 addresses to access all data.  Put all initialized global and static
17691 data in the @code{.fardata} section, and all uninitialized data in the
17692 @code{.far} section.  Put all constant data into the @code{.const}
17693 section.
17694 @end table
17696 @node CRIS Options
17697 @subsection CRIS Options
17698 @cindex CRIS Options
17700 These options are defined specifically for the CRIS ports.
17702 @table @gcctabopt
17703 @item -march=@var{architecture-type}
17704 @itemx -mcpu=@var{architecture-type}
17705 @opindex march
17706 @opindex mcpu
17707 Generate code for the specified architecture.  The choices for
17708 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
17709 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
17710 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
17711 @samp{v10}.
17713 @item -mtune=@var{architecture-type}
17714 @opindex mtune
17715 Tune to @var{architecture-type} everything applicable about the generated
17716 code, except for the ABI and the set of available instructions.  The
17717 choices for @var{architecture-type} are the same as for
17718 @option{-march=@var{architecture-type}}.
17720 @item -mmax-stack-frame=@var{n}
17721 @opindex mmax-stack-frame
17722 Warn when the stack frame of a function exceeds @var{n} bytes.
17724 @item -metrax4
17725 @itemx -metrax100
17726 @opindex metrax4
17727 @opindex metrax100
17728 The options @option{-metrax4} and @option{-metrax100} are synonyms for
17729 @option{-march=v3} and @option{-march=v8} respectively.
17731 @item -mmul-bug-workaround
17732 @itemx -mno-mul-bug-workaround
17733 @opindex mmul-bug-workaround
17734 @opindex mno-mul-bug-workaround
17735 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
17736 models where it applies.  This option is active by default.
17738 @item -mpdebug
17739 @opindex mpdebug
17740 Enable CRIS-specific verbose debug-related information in the assembly
17741 code.  This option also has the effect of turning off the @samp{#NO_APP}
17742 formatted-code indicator to the assembler at the beginning of the
17743 assembly file.
17745 @item -mcc-init
17746 @opindex mcc-init
17747 Do not use condition-code results from previous instruction; always emit
17748 compare and test instructions before use of condition codes.
17750 @item -mno-side-effects
17751 @opindex mno-side-effects
17752 Do not emit instructions with side effects in addressing modes other than
17753 post-increment.
17755 @item -mstack-align
17756 @itemx -mno-stack-align
17757 @itemx -mdata-align
17758 @itemx -mno-data-align
17759 @itemx -mconst-align
17760 @itemx -mno-const-align
17761 @opindex mstack-align
17762 @opindex mno-stack-align
17763 @opindex mdata-align
17764 @opindex mno-data-align
17765 @opindex mconst-align
17766 @opindex mno-const-align
17767 These options (@samp{no-} options) arrange (eliminate arrangements) for the
17768 stack frame, individual data and constants to be aligned for the maximum
17769 single data access size for the chosen CPU model.  The default is to
17770 arrange for 32-bit alignment.  ABI details such as structure layout are
17771 not affected by these options.
17773 @item -m32-bit
17774 @itemx -m16-bit
17775 @itemx -m8-bit
17776 @opindex m32-bit
17777 @opindex m16-bit
17778 @opindex m8-bit
17779 Similar to the stack- data- and const-align options above, these options
17780 arrange for stack frame, writable data and constants to all be 32-bit,
17781 16-bit or 8-bit aligned.  The default is 32-bit alignment.
17783 @item -mno-prologue-epilogue
17784 @itemx -mprologue-epilogue
17785 @opindex mno-prologue-epilogue
17786 @opindex mprologue-epilogue
17787 With @option{-mno-prologue-epilogue}, the normal function prologue and
17788 epilogue which set up the stack frame are omitted and no return
17789 instructions or return sequences are generated in the code.  Use this
17790 option only together with visual inspection of the compiled code: no
17791 warnings or errors are generated when call-saved registers must be saved,
17792 or storage for local variables needs to be allocated.
17794 @item -mno-gotplt
17795 @itemx -mgotplt
17796 @opindex mno-gotplt
17797 @opindex mgotplt
17798 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
17799 instruction sequences that load addresses for functions from the PLT part
17800 of the GOT rather than (traditional on other architectures) calls to the
17801 PLT@.  The default is @option{-mgotplt}.
17803 @item -melf
17804 @opindex melf
17805 Legacy no-op option only recognized with the cris-axis-elf and
17806 cris-axis-linux-gnu targets.
17808 @item -mlinux
17809 @opindex mlinux
17810 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
17812 @item -sim
17813 @opindex sim
17814 This option, recognized for the cris-axis-elf, arranges
17815 to link with input-output functions from a simulator library.  Code,
17816 initialized data and zero-initialized data are allocated consecutively.
17818 @item -sim2
17819 @opindex sim2
17820 Like @option{-sim}, but pass linker options to locate initialized data at
17821 0x40000000 and zero-initialized data at 0x80000000.
17822 @end table
17824 @node CR16 Options
17825 @subsection CR16 Options
17826 @cindex CR16 Options
17828 These options are defined specifically for the CR16 ports.
17830 @table @gcctabopt
17832 @item -mmac
17833 @opindex mmac
17834 Enable the use of multiply-accumulate instructions. Disabled by default.
17836 @item -mcr16cplus
17837 @itemx -mcr16c
17838 @opindex mcr16cplus
17839 @opindex mcr16c
17840 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
17841 is default.
17843 @item -msim
17844 @opindex msim
17845 Links the library libsim.a which is in compatible with simulator. Applicable
17846 to ELF compiler only.
17848 @item -mint32
17849 @opindex mint32
17850 Choose integer type as 32-bit wide.
17852 @item -mbit-ops
17853 @opindex mbit-ops
17854 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
17856 @item -mdata-model=@var{model}
17857 @opindex mdata-model
17858 Choose a data model. The choices for @var{model} are @samp{near},
17859 @samp{far} or @samp{medium}. @samp{medium} is default.
17860 However, @samp{far} is not valid with @option{-mcr16c}, as the
17861 CR16C architecture does not support the far data model.
17862 @end table
17864 @node C-SKY Options
17865 @subsection C-SKY Options
17866 @cindex C-SKY Options
17868 GCC supports these options when compiling for C-SKY V2 processors.
17870 @table @gcctabopt
17872 @item -march=@var{arch}
17873 @opindex march=
17874 Specify the C-SKY target architecture.  Valid values for @var{arch} are:
17875 @samp{ck801}, @samp{ck802}, @samp{ck803}, @samp{ck807}, and @samp{ck810}.
17876 The default is @samp{ck810}.
17878 @item -mcpu=@var{cpu}
17879 @opindex mcpu=
17880 Specify the C-SKY target processor.  Valid values for @var{cpu} are:
17881 @samp{ck801}, @samp{ck801t},
17882 @samp{ck802}, @samp{ck802t}, @samp{ck802j},
17883 @samp{ck803}, @samp{ck803h}, @samp{ck803t}, @samp{ck803ht},
17884 @samp{ck803f}, @samp{ck803fh}, @samp{ck803e}, @samp{ck803eh},
17885 @samp{ck803et}, @samp{ck803eht}, @samp{ck803ef}, @samp{ck803efh},
17886 @samp{ck803ft}, @samp{ck803eft}, @samp{ck803efht}, @samp{ck803r1},
17887 @samp{ck803hr1}, @samp{ck803tr1}, @samp{ck803htr1}, @samp{ck803fr1},
17888 @samp{ck803fhr1}, @samp{ck803er1}, @samp{ck803ehr1}, @samp{ck803etr1},
17889 @samp{ck803ehtr1}, @samp{ck803efr1}, @samp{ck803efhr1}, @samp{ck803ftr1},
17890 @samp{ck803eftr1}, @samp{ck803efhtr1},
17891 @samp{ck803s}, @samp{ck803st}, @samp{ck803se}, @samp{ck803sf},
17892 @samp{ck803sef}, @samp{ck803seft},
17893 @samp{ck807e}, @samp{ck807ef}, @samp{ck807}, @samp{ck807f},
17894 @samp{ck810e}, @samp{ck810et}, @samp{ck810ef}, @samp{ck810eft},
17895 @samp{ck810}, @samp{ck810v}, @samp{ck810f}, @samp{ck810t}, @samp{ck810fv},
17896 @samp{ck810tv}, @samp{ck810ft}, and @samp{ck810ftv}.
17898 @item -mbig-endian
17899 @opindex mbig-endian
17900 @itemx -EB
17901 @opindex -EB
17902 @itemx -mlittle-endian
17903 @opindex mlittle-endian
17904 @itemx -EL
17905 @opindex -EL
17907 Select big- or little-endian code.  The default is little-endian.
17909 @item -mhard-float
17910 @opindex mhard-float
17911 @itemx -msoft-float
17912 @opindex msoft-float
17914 Select hardware or software floating-point implementations.
17915 The default is soft float.
17917 @item -mdouble-float
17918 @itemx -mno-double-float
17919 @opindex mdouble-float
17920 When @option{-mhard-float} is in effect, enable generation of
17921 double-precision float instructions.  This is the default except
17922 when compiling for CK803.
17924 @item -mfdivdu
17925 @itemx -mno-fdivdu
17926 @opindex mfdivdu
17927 When @option{-mhard-float} is in effect, enable generation of
17928 @code{frecipd}, @code{fsqrtd}, and @code{fdivd} instructions.
17929 This is the default except when compiling for CK803.
17931 @item -mfpu=@var{fpu}
17932 @opindex mfpu=
17933 Select the floating-point processor.  This option can only be used with
17934 @option{-mhard-float}.
17935 Values for @var{fpu} are
17936 @samp{fpv2_sf} (equivalent to @samp{-mno-double-float -mno-fdivdu}),
17937 @samp{fpv2} (@samp{-mdouble-float -mno-divdu}), and
17938 @samp{fpv2_divd} (@samp{-mdouble-float -mdivdu}).
17940 @item -melrw
17941 @itemx -mno-elrw
17942 @opindex melrw
17943 Enable the extended @code{lrw} instruction.  This option defaults to on
17944 for CK801 and off otherwise.
17946 @item -mistack
17947 @itemx -mno-istack
17948 @opindex mistack
17949 Enable interrupt stack instructions; the default is off.
17951 The @option{-mistack} option is required to handle the
17952 @code{interrupt} and @code{isr} function attributes
17953 (@pxref{C-SKY Function Attributes}).
17955 @item -mmp
17956 @opindex mmp
17957 Enable multiprocessor instructions; the default is off.
17959 @item -mcp
17960 @opindex mcp
17961 Enable coprocessor instructions; the default is off.
17963 @item -mcache
17964 @opindex mcache
17965 Enable coprocessor instructions; the default is off.
17967 @item -msecurity
17968 @opindex msecurity
17969 Enable C-SKY security instructions; the default is off.
17971 @item -mtrust
17972 @opindex mtrust
17973 Enable C-SKY trust instructions; the default is off.
17975 @item -mdsp
17976 @opindex mdsp
17977 @itemx -medsp
17978 @opindex medsp
17979 @itemx -mvdsp
17980 @opindex mvdsp
17981 Enable C-SKY DSP, Enhanced DSP, or Vector DSP instructions, respectively.
17982 All of these options default to off.
17984 @item -mdiv
17985 @itemx -mno-div
17986 @opindex mdiv
17987 Generate divide instructions.  Default is off.
17989 @item -msmart
17990 @itemx -mno-smart
17991 @opindex msmart
17992 Generate code for Smart Mode, using only registers numbered 0-7 to allow
17993 use of 16-bit instructions.  This option is ignored for CK801 where this
17994 is the required behavior, and it defaults to on for CK802.
17995 For other targets, the default is off.
17997 @item -mhigh-registers
17998 @itemx -mno-high-registers
17999 @opindex mhigh-registers
18000 Generate code using the high registers numbered 16-31.  This option
18001 is not supported on CK801, CK802, or CK803, and is enabled by default
18002 for other processors.
18004 @item -manchor
18005 @itemx -mno-anchor
18006 @opindex manchor
18007 Generate code using global anchor symbol addresses.
18009 @item -mpushpop
18010 @itemx -mno-pushpop
18011 @opindex mpushpop
18012 Generate code using @code{push} and @code{pop} instructions.  This option
18013 defaults to on.
18015 @item -mmultiple-stld
18016 @itemx -mstm
18017 @itemx -mno-multiple-stld
18018 @itemx -mno-stm
18019 @opindex mmultiple-stld
18020 Generate code using @code{stm} and @code{ldm} instructions.  This option
18021 isn't supported on CK801 but is enabled by default on other processors.
18023 @item -mconstpool
18024 @itemx -mno-constpool
18025 @opindex mconstpool
18026 Create constant pools in the compiler instead of deferring it to the
18027 assembler.  This option is the default and required for correct code
18028 generation on CK801 and CK802, and is optional on other processors.
18030 @item -mstack-size
18031 @item -mno-stack-size
18032 @opindex mstack-size
18033 Emit @code{.stack_size} directives for each function in the assembly
18034 output.  This option defaults to off.
18036 @item -mccrt
18037 @itemx -mno-ccrt
18038 @opindex mccrt
18039 Generate code for the C-SKY compiler runtime instead of libgcc.  This
18040 option defaults to off.
18042 @item -mbranch-cost=@var{n}
18043 @opindex mbranch-cost=
18044 Set the branch costs to roughly @code{n} instructions.  The default is 1.
18046 @item -msched-prolog
18047 @itemx -mno-sched-prolog
18048 @opindex msched-prolog
18049 Permit scheduling of function prologue and epilogue sequences.  Using
18050 this option can result in code that is not compliant with the C-SKY V2 ABI
18051 prologue requirements and that cannot be debugged or backtraced.
18052 It is disabled by default.
18054 @end table
18056 @node Darwin Options
18057 @subsection Darwin Options
18058 @cindex Darwin options
18060 These options are defined for all architectures running the Darwin operating
18061 system.
18063 FSF GCC on Darwin does not create ``fat'' object files; it creates
18064 an object file for the single architecture that GCC was built to
18065 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
18066 @option{-arch} options are used; it does so by running the compiler or
18067 linker multiple times and joining the results together with
18068 @file{lipo}.
18070 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
18071 @samp{i686}) is determined by the flags that specify the ISA
18072 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
18073 @option{-force_cpusubtype_ALL} option can be used to override this.
18075 The Darwin tools vary in their behavior when presented with an ISA
18076 mismatch.  The assembler, @file{as}, only permits instructions to
18077 be used that are valid for the subtype of the file it is generating,
18078 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
18079 The linker for shared libraries, @file{/usr/bin/libtool}, fails
18080 and prints an error if asked to create a shared library with a less
18081 restrictive subtype than its input files (for instance, trying to put
18082 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
18083 for executables, @command{ld}, quietly gives the executable the most
18084 restrictive subtype of any of its input files.
18086 @table @gcctabopt
18087 @item -F@var{dir}
18088 @opindex F
18089 Add the framework directory @var{dir} to the head of the list of
18090 directories to be searched for header files.  These directories are
18091 interleaved with those specified by @option{-I} options and are
18092 scanned in a left-to-right order.
18094 A framework directory is a directory with frameworks in it.  A
18095 framework is a directory with a @file{Headers} and/or
18096 @file{PrivateHeaders} directory contained directly in it that ends
18097 in @file{.framework}.  The name of a framework is the name of this
18098 directory excluding the @file{.framework}.  Headers associated with
18099 the framework are found in one of those two directories, with
18100 @file{Headers} being searched first.  A subframework is a framework
18101 directory that is in a framework's @file{Frameworks} directory.
18102 Includes of subframework headers can only appear in a header of a
18103 framework that contains the subframework, or in a sibling subframework
18104 header.  Two subframeworks are siblings if they occur in the same
18105 framework.  A subframework should not have the same name as a
18106 framework; a warning is issued if this is violated.  Currently a
18107 subframework cannot have subframeworks; in the future, the mechanism
18108 may be extended to support this.  The standard frameworks can be found
18109 in @file{/System/Library/Frameworks} and
18110 @file{/Library/Frameworks}.  An example include looks like
18111 @code{#include <Framework/header.h>}, where @file{Framework} denotes
18112 the name of the framework and @file{header.h} is found in the
18113 @file{PrivateHeaders} or @file{Headers} directory.
18115 @item -iframework@var{dir}
18116 @opindex iframework
18117 Like @option{-F} except the directory is a treated as a system
18118 directory.  The main difference between this @option{-iframework} and
18119 @option{-F} is that with @option{-iframework} the compiler does not
18120 warn about constructs contained within header files found via
18121 @var{dir}.  This option is valid only for the C family of languages.
18123 @item -gused
18124 @opindex gused
18125 Emit debugging information for symbols that are used.  For stabs
18126 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
18127 This is by default ON@.
18129 @item -gfull
18130 @opindex gfull
18131 Emit debugging information for all symbols and types.
18133 @item -mmacosx-version-min=@var{version}
18134 The earliest version of MacOS X that this executable will run on
18135 is @var{version}.  Typical values of @var{version} include @code{10.1},
18136 @code{10.2}, and @code{10.3.9}.
18138 If the compiler was built to use the system's headers by default,
18139 then the default for this option is the system version on which the
18140 compiler is running, otherwise the default is to make choices that
18141 are compatible with as many systems and code bases as possible.
18143 @item -mkernel
18144 @opindex mkernel
18145 Enable kernel development mode.  The @option{-mkernel} option sets
18146 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
18147 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
18148 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
18149 applicable.  This mode also sets @option{-mno-altivec},
18150 @option{-msoft-float}, @option{-fno-builtin} and
18151 @option{-mlong-branch} for PowerPC targets.
18153 @item -mone-byte-bool
18154 @opindex mone-byte-bool
18155 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
18156 By default @code{sizeof(bool)} is @code{4} when compiling for
18157 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
18158 option has no effect on x86.
18160 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
18161 to generate code that is not binary compatible with code generated
18162 without that switch.  Using this switch may require recompiling all
18163 other modules in a program, including system libraries.  Use this
18164 switch to conform to a non-default data model.
18166 @item -mfix-and-continue
18167 @itemx -ffix-and-continue
18168 @itemx -findirect-data
18169 @opindex mfix-and-continue
18170 @opindex ffix-and-continue
18171 @opindex findirect-data
18172 Generate code suitable for fast turnaround development, such as to
18173 allow GDB to dynamically load @file{.o} files into already-running
18174 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
18175 are provided for backwards compatibility.
18177 @item -all_load
18178 @opindex all_load
18179 Loads all members of static archive libraries.
18180 See man ld(1) for more information.
18182 @item -arch_errors_fatal
18183 @opindex arch_errors_fatal
18184 Cause the errors having to do with files that have the wrong architecture
18185 to be fatal.
18187 @item -bind_at_load
18188 @opindex bind_at_load
18189 Causes the output file to be marked such that the dynamic linker will
18190 bind all undefined references when the file is loaded or launched.
18192 @item -bundle
18193 @opindex bundle
18194 Produce a Mach-o bundle format file.
18195 See man ld(1) for more information.
18197 @item -bundle_loader @var{executable}
18198 @opindex bundle_loader
18199 This option specifies the @var{executable} that will load the build
18200 output file being linked.  See man ld(1) for more information.
18202 @item -dynamiclib
18203 @opindex dynamiclib
18204 When passed this option, GCC produces a dynamic library instead of
18205 an executable when linking, using the Darwin @file{libtool} command.
18207 @item -force_cpusubtype_ALL
18208 @opindex force_cpusubtype_ALL
18209 This causes GCC's output file to have the @samp{ALL} subtype, instead of
18210 one controlled by the @option{-mcpu} or @option{-march} option.
18212 @item -allowable_client  @var{client_name}
18213 @itemx -client_name
18214 @itemx -compatibility_version
18215 @itemx -current_version
18216 @itemx -dead_strip
18217 @itemx -dependency-file
18218 @itemx -dylib_file
18219 @itemx -dylinker_install_name
18220 @itemx -dynamic
18221 @itemx -exported_symbols_list
18222 @itemx -filelist
18223 @need 800
18224 @itemx -flat_namespace
18225 @itemx -force_flat_namespace
18226 @itemx -headerpad_max_install_names
18227 @itemx -image_base
18228 @itemx -init
18229 @itemx -install_name
18230 @itemx -keep_private_externs
18231 @itemx -multi_module
18232 @itemx -multiply_defined
18233 @itemx -multiply_defined_unused
18234 @need 800
18235 @itemx -noall_load
18236 @itemx -no_dead_strip_inits_and_terms
18237 @itemx -nofixprebinding
18238 @itemx -nomultidefs
18239 @itemx -noprebind
18240 @itemx -noseglinkedit
18241 @itemx -pagezero_size
18242 @itemx -prebind
18243 @itemx -prebind_all_twolevel_modules
18244 @itemx -private_bundle
18245 @need 800
18246 @itemx -read_only_relocs
18247 @itemx -sectalign
18248 @itemx -sectobjectsymbols
18249 @itemx -whyload
18250 @itemx -seg1addr
18251 @itemx -sectcreate
18252 @itemx -sectobjectsymbols
18253 @itemx -sectorder
18254 @itemx -segaddr
18255 @itemx -segs_read_only_addr
18256 @need 800
18257 @itemx -segs_read_write_addr
18258 @itemx -seg_addr_table
18259 @itemx -seg_addr_table_filename
18260 @itemx -seglinkedit
18261 @itemx -segprot
18262 @itemx -segs_read_only_addr
18263 @itemx -segs_read_write_addr
18264 @itemx -single_module
18265 @itemx -static
18266 @itemx -sub_library
18267 @need 800
18268 @itemx -sub_umbrella
18269 @itemx -twolevel_namespace
18270 @itemx -umbrella
18271 @itemx -undefined
18272 @itemx -unexported_symbols_list
18273 @itemx -weak_reference_mismatches
18274 @itemx -whatsloaded
18275 @opindex allowable_client
18276 @opindex client_name
18277 @opindex compatibility_version
18278 @opindex current_version
18279 @opindex dead_strip
18280 @opindex dependency-file
18281 @opindex dylib_file
18282 @opindex dylinker_install_name
18283 @opindex dynamic
18284 @opindex exported_symbols_list
18285 @opindex filelist
18286 @opindex flat_namespace
18287 @opindex force_flat_namespace
18288 @opindex headerpad_max_install_names
18289 @opindex image_base
18290 @opindex init
18291 @opindex install_name
18292 @opindex keep_private_externs
18293 @opindex multi_module
18294 @opindex multiply_defined
18295 @opindex multiply_defined_unused
18296 @opindex noall_load
18297 @opindex no_dead_strip_inits_and_terms
18298 @opindex nofixprebinding
18299 @opindex nomultidefs
18300 @opindex noprebind
18301 @opindex noseglinkedit
18302 @opindex pagezero_size
18303 @opindex prebind
18304 @opindex prebind_all_twolevel_modules
18305 @opindex private_bundle
18306 @opindex read_only_relocs
18307 @opindex sectalign
18308 @opindex sectobjectsymbols
18309 @opindex whyload
18310 @opindex seg1addr
18311 @opindex sectcreate
18312 @opindex sectobjectsymbols
18313 @opindex sectorder
18314 @opindex segaddr
18315 @opindex segs_read_only_addr
18316 @opindex segs_read_write_addr
18317 @opindex seg_addr_table
18318 @opindex seg_addr_table_filename
18319 @opindex seglinkedit
18320 @opindex segprot
18321 @opindex segs_read_only_addr
18322 @opindex segs_read_write_addr
18323 @opindex single_module
18324 @opindex static
18325 @opindex sub_library
18326 @opindex sub_umbrella
18327 @opindex twolevel_namespace
18328 @opindex umbrella
18329 @opindex undefined
18330 @opindex unexported_symbols_list
18331 @opindex weak_reference_mismatches
18332 @opindex whatsloaded
18333 These options are passed to the Darwin linker.  The Darwin linker man page
18334 describes them in detail.
18335 @end table
18337 @node DEC Alpha Options
18338 @subsection DEC Alpha Options
18340 These @samp{-m} options are defined for the DEC Alpha implementations:
18342 @table @gcctabopt
18343 @item -mno-soft-float
18344 @itemx -msoft-float
18345 @opindex mno-soft-float
18346 @opindex msoft-float
18347 Use (do not use) the hardware floating-point instructions for
18348 floating-point operations.  When @option{-msoft-float} is specified,
18349 functions in @file{libgcc.a} are used to perform floating-point
18350 operations.  Unless they are replaced by routines that emulate the
18351 floating-point operations, or compiled in such a way as to call such
18352 emulations routines, these routines issue floating-point
18353 operations.   If you are compiling for an Alpha without floating-point
18354 operations, you must ensure that the library is built so as not to call
18355 them.
18357 Note that Alpha implementations without floating-point operations are
18358 required to have floating-point registers.
18360 @item -mfp-reg
18361 @itemx -mno-fp-regs
18362 @opindex mfp-reg
18363 @opindex mno-fp-regs
18364 Generate code that uses (does not use) the floating-point register set.
18365 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
18366 register set is not used, floating-point operands are passed in integer
18367 registers as if they were integers and floating-point results are passed
18368 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
18369 so any function with a floating-point argument or return value called by code
18370 compiled with @option{-mno-fp-regs} must also be compiled with that
18371 option.
18373 A typical use of this option is building a kernel that does not use,
18374 and hence need not save and restore, any floating-point registers.
18376 @item -mieee
18377 @opindex mieee
18378 The Alpha architecture implements floating-point hardware optimized for
18379 maximum performance.  It is mostly compliant with the IEEE floating-point
18380 standard.  However, for full compliance, software assistance is
18381 required.  This option generates code fully IEEE-compliant code
18382 @emph{except} that the @var{inexact-flag} is not maintained (see below).
18383 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
18384 defined during compilation.  The resulting code is less efficient but is
18385 able to correctly support denormalized numbers and exceptional IEEE
18386 values such as not-a-number and plus/minus infinity.  Other Alpha
18387 compilers call this option @option{-ieee_with_no_inexact}.
18389 @item -mieee-with-inexact
18390 @opindex mieee-with-inexact
18391 This is like @option{-mieee} except the generated code also maintains
18392 the IEEE @var{inexact-flag}.  Turning on this option causes the
18393 generated code to implement fully-compliant IEEE math.  In addition to
18394 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
18395 macro.  On some Alpha implementations the resulting code may execute
18396 significantly slower than the code generated by default.  Since there is
18397 very little code that depends on the @var{inexact-flag}, you should
18398 normally not specify this option.  Other Alpha compilers call this
18399 option @option{-ieee_with_inexact}.
18401 @item -mfp-trap-mode=@var{trap-mode}
18402 @opindex mfp-trap-mode
18403 This option controls what floating-point related traps are enabled.
18404 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
18405 The trap mode can be set to one of four values:
18407 @table @samp
18408 @item n
18409 This is the default (normal) setting.  The only traps that are enabled
18410 are the ones that cannot be disabled in software (e.g., division by zero
18411 trap).
18413 @item u
18414 In addition to the traps enabled by @samp{n}, underflow traps are enabled
18415 as well.
18417 @item su
18418 Like @samp{u}, but the instructions are marked to be safe for software
18419 completion (see Alpha architecture manual for details).
18421 @item sui
18422 Like @samp{su}, but inexact traps are enabled as well.
18423 @end table
18425 @item -mfp-rounding-mode=@var{rounding-mode}
18426 @opindex mfp-rounding-mode
18427 Selects the IEEE rounding mode.  Other Alpha compilers call this option
18428 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
18431 @table @samp
18432 @item n
18433 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
18434 the nearest machine number or towards the even machine number in case
18435 of a tie.
18437 @item m
18438 Round towards minus infinity.
18440 @item c
18441 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
18443 @item d
18444 Dynamic rounding mode.  A field in the floating-point control register
18445 (@var{fpcr}, see Alpha architecture reference manual) controls the
18446 rounding mode in effect.  The C library initializes this register for
18447 rounding towards plus infinity.  Thus, unless your program modifies the
18448 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
18449 @end table
18451 @item -mtrap-precision=@var{trap-precision}
18452 @opindex mtrap-precision
18453 In the Alpha architecture, floating-point traps are imprecise.  This
18454 means without software assistance it is impossible to recover from a
18455 floating trap and program execution normally needs to be terminated.
18456 GCC can generate code that can assist operating system trap handlers
18457 in determining the exact location that caused a floating-point trap.
18458 Depending on the requirements of an application, different levels of
18459 precisions can be selected:
18461 @table @samp
18462 @item p
18463 Program precision.  This option is the default and means a trap handler
18464 can only identify which program caused a floating-point exception.
18466 @item f
18467 Function precision.  The trap handler can determine the function that
18468 caused a floating-point exception.
18470 @item i
18471 Instruction precision.  The trap handler can determine the exact
18472 instruction that caused a floating-point exception.
18473 @end table
18475 Other Alpha compilers provide the equivalent options called
18476 @option{-scope_safe} and @option{-resumption_safe}.
18478 @item -mieee-conformant
18479 @opindex mieee-conformant
18480 This option marks the generated code as IEEE conformant.  You must not
18481 use this option unless you also specify @option{-mtrap-precision=i} and either
18482 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
18483 is to emit the line @samp{.eflag 48} in the function prologue of the
18484 generated assembly file.
18486 @item -mbuild-constants
18487 @opindex mbuild-constants
18488 Normally GCC examines a 32- or 64-bit integer constant to
18489 see if it can construct it from smaller constants in two or three
18490 instructions.  If it cannot, it outputs the constant as a literal and
18491 generates code to load it from the data segment at run time.
18493 Use this option to require GCC to construct @emph{all} integer constants
18494 using code, even if it takes more instructions (the maximum is six).
18496 You typically use this option to build a shared library dynamic
18497 loader.  Itself a shared library, it must relocate itself in memory
18498 before it can find the variables and constants in its own data segment.
18500 @item -mbwx
18501 @itemx -mno-bwx
18502 @itemx -mcix
18503 @itemx -mno-cix
18504 @itemx -mfix
18505 @itemx -mno-fix
18506 @itemx -mmax
18507 @itemx -mno-max
18508 @opindex mbwx
18509 @opindex mno-bwx
18510 @opindex mcix
18511 @opindex mno-cix
18512 @opindex mfix
18513 @opindex mno-fix
18514 @opindex mmax
18515 @opindex mno-max
18516 Indicate whether GCC should generate code to use the optional BWX,
18517 CIX, FIX and MAX instruction sets.  The default is to use the instruction
18518 sets supported by the CPU type specified via @option{-mcpu=} option or that
18519 of the CPU on which GCC was built if none is specified.
18521 @item -mfloat-vax
18522 @itemx -mfloat-ieee
18523 @opindex mfloat-vax
18524 @opindex mfloat-ieee
18525 Generate code that uses (does not use) VAX F and G floating-point
18526 arithmetic instead of IEEE single and double precision.
18528 @item -mexplicit-relocs
18529 @itemx -mno-explicit-relocs
18530 @opindex mexplicit-relocs
18531 @opindex mno-explicit-relocs
18532 Older Alpha assemblers provided no way to generate symbol relocations
18533 except via assembler macros.  Use of these macros does not allow
18534 optimal instruction scheduling.  GNU binutils as of version 2.12
18535 supports a new syntax that allows the compiler to explicitly mark
18536 which relocations should apply to which instructions.  This option
18537 is mostly useful for debugging, as GCC detects the capabilities of
18538 the assembler when it is built and sets the default accordingly.
18540 @item -msmall-data
18541 @itemx -mlarge-data
18542 @opindex msmall-data
18543 @opindex mlarge-data
18544 When @option{-mexplicit-relocs} is in effect, static data is
18545 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
18546 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
18547 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
18548 16-bit relocations off of the @code{$gp} register.  This limits the
18549 size of the small data area to 64KB, but allows the variables to be
18550 directly accessed via a single instruction.
18552 The default is @option{-mlarge-data}.  With this option the data area
18553 is limited to just below 2GB@.  Programs that require more than 2GB of
18554 data must use @code{malloc} or @code{mmap} to allocate the data in the
18555 heap instead of in the program's data segment.
18557 When generating code for shared libraries, @option{-fpic} implies
18558 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
18560 @item -msmall-text
18561 @itemx -mlarge-text
18562 @opindex msmall-text
18563 @opindex mlarge-text
18564 When @option{-msmall-text} is used, the compiler assumes that the
18565 code of the entire program (or shared library) fits in 4MB, and is
18566 thus reachable with a branch instruction.  When @option{-msmall-data}
18567 is used, the compiler can assume that all local symbols share the
18568 same @code{$gp} value, and thus reduce the number of instructions
18569 required for a function call from 4 to 1.
18571 The default is @option{-mlarge-text}.
18573 @item -mcpu=@var{cpu_type}
18574 @opindex mcpu
18575 Set the instruction set and instruction scheduling parameters for
18576 machine type @var{cpu_type}.  You can specify either the @samp{EV}
18577 style name or the corresponding chip number.  GCC supports scheduling
18578 parameters for the EV4, EV5 and EV6 family of processors and
18579 chooses the default values for the instruction set from the processor
18580 you specify.  If you do not specify a processor type, GCC defaults
18581 to the processor on which the compiler was built.
18583 Supported values for @var{cpu_type} are
18585 @table @samp
18586 @item ev4
18587 @itemx ev45
18588 @itemx 21064
18589 Schedules as an EV4 and has no instruction set extensions.
18591 @item ev5
18592 @itemx 21164
18593 Schedules as an EV5 and has no instruction set extensions.
18595 @item ev56
18596 @itemx 21164a
18597 Schedules as an EV5 and supports the BWX extension.
18599 @item pca56
18600 @itemx 21164pc
18601 @itemx 21164PC
18602 Schedules as an EV5 and supports the BWX and MAX extensions.
18604 @item ev6
18605 @itemx 21264
18606 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
18608 @item ev67
18609 @itemx 21264a
18610 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
18611 @end table
18613 Native toolchains also support the value @samp{native},
18614 which selects the best architecture option for the host processor.
18615 @option{-mcpu=native} has no effect if GCC does not recognize
18616 the processor.
18618 @item -mtune=@var{cpu_type}
18619 @opindex mtune
18620 Set only the instruction scheduling parameters for machine type
18621 @var{cpu_type}.  The instruction set is not changed.
18623 Native toolchains also support the value @samp{native},
18624 which selects the best architecture option for the host processor.
18625 @option{-mtune=native} has no effect if GCC does not recognize
18626 the processor.
18628 @item -mmemory-latency=@var{time}
18629 @opindex mmemory-latency
18630 Sets the latency the scheduler should assume for typical memory
18631 references as seen by the application.  This number is highly
18632 dependent on the memory access patterns used by the application
18633 and the size of the external cache on the machine.
18635 Valid options for @var{time} are
18637 @table @samp
18638 @item @var{number}
18639 A decimal number representing clock cycles.
18641 @item L1
18642 @itemx L2
18643 @itemx L3
18644 @itemx main
18645 The compiler contains estimates of the number of clock cycles for
18646 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
18647 (also called Dcache, Scache, and Bcache), as well as to main memory.
18648 Note that L3 is only valid for EV5.
18650 @end table
18651 @end table
18653 @node FR30 Options
18654 @subsection FR30 Options
18655 @cindex FR30 Options
18657 These options are defined specifically for the FR30 port.
18659 @table @gcctabopt
18661 @item -msmall-model
18662 @opindex msmall-model
18663 Use the small address space model.  This can produce smaller code, but
18664 it does assume that all symbolic values and addresses fit into a
18665 20-bit range.
18667 @item -mno-lsim
18668 @opindex mno-lsim
18669 Assume that runtime support has been provided and so there is no need
18670 to include the simulator library (@file{libsim.a}) on the linker
18671 command line.
18673 @end table
18675 @node FT32 Options
18676 @subsection FT32 Options
18677 @cindex FT32 Options
18679 These options are defined specifically for the FT32 port.
18681 @table @gcctabopt
18683 @item -msim
18684 @opindex msim
18685 Specifies that the program will be run on the simulator.  This causes
18686 an alternate runtime startup and library to be linked.
18687 You must not use this option when generating programs that will run on
18688 real hardware; you must provide your own runtime library for whatever
18689 I/O functions are needed.
18691 @item -mlra
18692 @opindex mlra
18693 Enable Local Register Allocation.  This is still experimental for FT32,
18694 so by default the compiler uses standard reload.
18696 @item -mnodiv
18697 @opindex mnodiv
18698 Do not use div and mod instructions.
18700 @item -mft32b
18701 @opindex mft32b
18702 Enable use of the extended instructions of the FT32B processor.
18704 @item -mcompress
18705 @opindex mcompress
18706 Compress all code using the Ft32B code compression scheme.
18708 @item -mnopm
18709 @opindex  mnopm
18710 Do not generate code that reads program memory.
18712 @end table
18714 @node FRV Options
18715 @subsection FRV Options
18716 @cindex FRV Options
18718 @table @gcctabopt
18719 @item -mgpr-32
18720 @opindex mgpr-32
18722 Only use the first 32 general-purpose registers.
18724 @item -mgpr-64
18725 @opindex mgpr-64
18727 Use all 64 general-purpose registers.
18729 @item -mfpr-32
18730 @opindex mfpr-32
18732 Use only the first 32 floating-point registers.
18734 @item -mfpr-64
18735 @opindex mfpr-64
18737 Use all 64 floating-point registers.
18739 @item -mhard-float
18740 @opindex mhard-float
18742 Use hardware instructions for floating-point operations.
18744 @item -msoft-float
18745 @opindex msoft-float
18747 Use library routines for floating-point operations.
18749 @item -malloc-cc
18750 @opindex malloc-cc
18752 Dynamically allocate condition code registers.
18754 @item -mfixed-cc
18755 @opindex mfixed-cc
18757 Do not try to dynamically allocate condition code registers, only
18758 use @code{icc0} and @code{fcc0}.
18760 @item -mdword
18761 @opindex mdword
18763 Change ABI to use double word insns.
18765 @item -mno-dword
18766 @opindex mno-dword
18768 Do not use double word instructions.
18770 @item -mdouble
18771 @opindex mdouble
18773 Use floating-point double instructions.
18775 @item -mno-double
18776 @opindex mno-double
18778 Do not use floating-point double instructions.
18780 @item -mmedia
18781 @opindex mmedia
18783 Use media instructions.
18785 @item -mno-media
18786 @opindex mno-media
18788 Do not use media instructions.
18790 @item -mmuladd
18791 @opindex mmuladd
18793 Use multiply and add/subtract instructions.
18795 @item -mno-muladd
18796 @opindex mno-muladd
18798 Do not use multiply and add/subtract instructions.
18800 @item -mfdpic
18801 @opindex mfdpic
18803 Select the FDPIC ABI, which uses function descriptors to represent
18804 pointers to functions.  Without any PIC/PIE-related options, it
18805 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
18806 assumes GOT entries and small data are within a 12-bit range from the
18807 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
18808 are computed with 32 bits.
18809 With a @samp{bfin-elf} target, this option implies @option{-msim}.
18811 @item -minline-plt
18812 @opindex minline-plt
18814 Enable inlining of PLT entries in function calls to functions that are
18815 not known to bind locally.  It has no effect without @option{-mfdpic}.
18816 It's enabled by default if optimizing for speed and compiling for
18817 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
18818 optimization option such as @option{-O3} or above is present in the
18819 command line.
18821 @item -mTLS
18822 @opindex mTLS
18824 Assume a large TLS segment when generating thread-local code.
18826 @item -mtls
18827 @opindex mtls
18829 Do not assume a large TLS segment when generating thread-local code.
18831 @item -mgprel-ro
18832 @opindex mgprel-ro
18834 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
18835 that is known to be in read-only sections.  It's enabled by default,
18836 except for @option{-fpic} or @option{-fpie}: even though it may help
18837 make the global offset table smaller, it trades 1 instruction for 4.
18838 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
18839 one of which may be shared by multiple symbols, and it avoids the need
18840 for a GOT entry for the referenced symbol, so it's more likely to be a
18841 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
18843 @item -multilib-library-pic
18844 @opindex multilib-library-pic
18846 Link with the (library, not FD) pic libraries.  It's implied by
18847 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
18848 @option{-fpic} without @option{-mfdpic}.  You should never have to use
18849 it explicitly.
18851 @item -mlinked-fp
18852 @opindex mlinked-fp
18854 Follow the EABI requirement of always creating a frame pointer whenever
18855 a stack frame is allocated.  This option is enabled by default and can
18856 be disabled with @option{-mno-linked-fp}.
18858 @item -mlong-calls
18859 @opindex mlong-calls
18861 Use indirect addressing to call functions outside the current
18862 compilation unit.  This allows the functions to be placed anywhere
18863 within the 32-bit address space.
18865 @item -malign-labels
18866 @opindex malign-labels
18868 Try to align labels to an 8-byte boundary by inserting NOPs into the
18869 previous packet.  This option only has an effect when VLIW packing
18870 is enabled.  It doesn't create new packets; it merely adds NOPs to
18871 existing ones.
18873 @item -mlibrary-pic
18874 @opindex mlibrary-pic
18876 Generate position-independent EABI code.
18878 @item -macc-4
18879 @opindex macc-4
18881 Use only the first four media accumulator registers.
18883 @item -macc-8
18884 @opindex macc-8
18886 Use all eight media accumulator registers.
18888 @item -mpack
18889 @opindex mpack
18891 Pack VLIW instructions.
18893 @item -mno-pack
18894 @opindex mno-pack
18896 Do not pack VLIW instructions.
18898 @item -mno-eflags
18899 @opindex mno-eflags
18901 Do not mark ABI switches in e_flags.
18903 @item -mcond-move
18904 @opindex mcond-move
18906 Enable the use of conditional-move instructions (default).
18908 This switch is mainly for debugging the compiler and will likely be removed
18909 in a future version.
18911 @item -mno-cond-move
18912 @opindex mno-cond-move
18914 Disable the use of conditional-move instructions.
18916 This switch is mainly for debugging the compiler and will likely be removed
18917 in a future version.
18919 @item -mscc
18920 @opindex mscc
18922 Enable the use of conditional set instructions (default).
18924 This switch is mainly for debugging the compiler and will likely be removed
18925 in a future version.
18927 @item -mno-scc
18928 @opindex mno-scc
18930 Disable the use of conditional set instructions.
18932 This switch is mainly for debugging the compiler and will likely be removed
18933 in a future version.
18935 @item -mcond-exec
18936 @opindex mcond-exec
18938 Enable the use of conditional execution (default).
18940 This switch is mainly for debugging the compiler and will likely be removed
18941 in a future version.
18943 @item -mno-cond-exec
18944 @opindex mno-cond-exec
18946 Disable the use of conditional execution.
18948 This switch is mainly for debugging the compiler and will likely be removed
18949 in a future version.
18951 @item -mvliw-branch
18952 @opindex mvliw-branch
18954 Run a pass to pack branches into VLIW instructions (default).
18956 This switch is mainly for debugging the compiler and will likely be removed
18957 in a future version.
18959 @item -mno-vliw-branch
18960 @opindex mno-vliw-branch
18962 Do not run a pass to pack branches into VLIW instructions.
18964 This switch is mainly for debugging the compiler and will likely be removed
18965 in a future version.
18967 @item -mmulti-cond-exec
18968 @opindex mmulti-cond-exec
18970 Enable optimization of @code{&&} and @code{||} in conditional execution
18971 (default).
18973 This switch is mainly for debugging the compiler and will likely be removed
18974 in a future version.
18976 @item -mno-multi-cond-exec
18977 @opindex mno-multi-cond-exec
18979 Disable optimization of @code{&&} and @code{||} in conditional execution.
18981 This switch is mainly for debugging the compiler and will likely be removed
18982 in a future version.
18984 @item -mnested-cond-exec
18985 @opindex mnested-cond-exec
18987 Enable nested conditional execution optimizations (default).
18989 This switch is mainly for debugging the compiler and will likely be removed
18990 in a future version.
18992 @item -mno-nested-cond-exec
18993 @opindex mno-nested-cond-exec
18995 Disable nested conditional execution optimizations.
18997 This switch is mainly for debugging the compiler and will likely be removed
18998 in a future version.
19000 @item -moptimize-membar
19001 @opindex moptimize-membar
19003 This switch removes redundant @code{membar} instructions from the
19004 compiler-generated code.  It is enabled by default.
19006 @item -mno-optimize-membar
19007 @opindex mno-optimize-membar
19009 This switch disables the automatic removal of redundant @code{membar}
19010 instructions from the generated code.
19012 @item -mtomcat-stats
19013 @opindex mtomcat-stats
19015 Cause gas to print out tomcat statistics.
19017 @item -mcpu=@var{cpu}
19018 @opindex mcpu
19020 Select the processor type for which to generate code.  Possible values are
19021 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
19022 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
19024 @end table
19026 @node GNU/Linux Options
19027 @subsection GNU/Linux Options
19029 These @samp{-m} options are defined for GNU/Linux targets:
19031 @table @gcctabopt
19032 @item -mglibc
19033 @opindex mglibc
19034 Use the GNU C library.  This is the default except
19035 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
19036 @samp{*-*-linux-*android*} targets.
19038 @item -muclibc
19039 @opindex muclibc
19040 Use uClibc C library.  This is the default on
19041 @samp{*-*-linux-*uclibc*} targets.
19043 @item -mmusl
19044 @opindex mmusl
19045 Use the musl C library.  This is the default on
19046 @samp{*-*-linux-*musl*} targets.
19048 @item -mbionic
19049 @opindex mbionic
19050 Use Bionic C library.  This is the default on
19051 @samp{*-*-linux-*android*} targets.
19053 @item -mandroid
19054 @opindex mandroid
19055 Compile code compatible with Android platform.  This is the default on
19056 @samp{*-*-linux-*android*} targets.
19058 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
19059 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
19060 this option makes the GCC driver pass Android-specific options to the linker.
19061 Finally, this option causes the preprocessor macro @code{__ANDROID__}
19062 to be defined.
19064 @item -tno-android-cc
19065 @opindex tno-android-cc
19066 Disable compilation effects of @option{-mandroid}, i.e., do not enable
19067 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
19068 @option{-fno-rtti} by default.
19070 @item -tno-android-ld
19071 @opindex tno-android-ld
19072 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
19073 linking options to the linker.
19075 @end table
19077 @node H8/300 Options
19078 @subsection H8/300 Options
19080 These @samp{-m} options are defined for the H8/300 implementations:
19082 @table @gcctabopt
19083 @item -mrelax
19084 @opindex mrelax
19085 Shorten some address references at link time, when possible; uses the
19086 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
19087 ld, Using ld}, for a fuller description.
19089 @item -mh
19090 @opindex mh
19091 Generate code for the H8/300H@.
19093 @item -ms
19094 @opindex ms
19095 Generate code for the H8S@.
19097 @item -mn
19098 @opindex mn
19099 Generate code for the H8S and H8/300H in the normal mode.  This switch
19100 must be used either with @option{-mh} or @option{-ms}.
19102 @item -ms2600
19103 @opindex ms2600
19104 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
19106 @item -mexr
19107 @opindex mexr
19108 Extended registers are stored on stack before execution of function
19109 with monitor attribute. Default option is @option{-mexr}.
19110 This option is valid only for H8S targets.
19112 @item -mno-exr
19113 @opindex mno-exr
19114 Extended registers are not stored on stack before execution of function 
19115 with monitor attribute. Default option is @option{-mno-exr}. 
19116 This option is valid only for H8S targets.
19118 @item -mint32
19119 @opindex mint32
19120 Make @code{int} data 32 bits by default.
19122 @item -malign-300
19123 @opindex malign-300
19124 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
19125 The default for the H8/300H and H8S is to align longs and floats on
19126 4-byte boundaries.
19127 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
19128 This option has no effect on the H8/300.
19129 @end table
19131 @node HPPA Options
19132 @subsection HPPA Options
19133 @cindex HPPA Options
19135 These @samp{-m} options are defined for the HPPA family of computers:
19137 @table @gcctabopt
19138 @item -march=@var{architecture-type}
19139 @opindex march
19140 Generate code for the specified architecture.  The choices for
19141 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
19142 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
19143 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
19144 architecture option for your machine.  Code compiled for lower numbered
19145 architectures runs on higher numbered architectures, but not the
19146 other way around.
19148 @item -mpa-risc-1-0
19149 @itemx -mpa-risc-1-1
19150 @itemx -mpa-risc-2-0
19151 @opindex mpa-risc-1-0
19152 @opindex mpa-risc-1-1
19153 @opindex mpa-risc-2-0
19154 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
19156 @item -mcaller-copies
19157 @opindex mcaller-copies
19158 The caller copies function arguments passed by hidden reference.  This
19159 option should be used with care as it is not compatible with the default
19160 32-bit runtime.  However, only aggregates larger than eight bytes are
19161 passed by hidden reference and the option provides better compatibility
19162 with OpenMP.
19164 @item -mjump-in-delay
19165 @opindex mjump-in-delay
19166 This option is ignored and provided for compatibility purposes only.
19168 @item -mdisable-fpregs
19169 @opindex mdisable-fpregs
19170 Prevent floating-point registers from being used in any manner.  This is
19171 necessary for compiling kernels that perform lazy context switching of
19172 floating-point registers.  If you use this option and attempt to perform
19173 floating-point operations, the compiler aborts.
19175 @item -mdisable-indexing
19176 @opindex mdisable-indexing
19177 Prevent the compiler from using indexing address modes.  This avoids some
19178 rather obscure problems when compiling MIG generated code under MACH@.
19180 @item -mno-space-regs
19181 @opindex mno-space-regs
19182 Generate code that assumes the target has no space registers.  This allows
19183 GCC to generate faster indirect calls and use unscaled index address modes.
19185 Such code is suitable for level 0 PA systems and kernels.
19187 @item -mfast-indirect-calls
19188 @opindex mfast-indirect-calls
19189 Generate code that assumes calls never cross space boundaries.  This
19190 allows GCC to emit code that performs faster indirect calls.
19192 This option does not work in the presence of shared libraries or nested
19193 functions.
19195 @item -mfixed-range=@var{register-range}
19196 @opindex mfixed-range
19197 Generate code treating the given register range as fixed registers.
19198 A fixed register is one that the register allocator cannot use.  This is
19199 useful when compiling kernel code.  A register range is specified as
19200 two registers separated by a dash.  Multiple register ranges can be
19201 specified separated by a comma.
19203 @item -mlong-load-store
19204 @opindex mlong-load-store
19205 Generate 3-instruction load and store sequences as sometimes required by
19206 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
19207 the HP compilers.
19209 @item -mportable-runtime
19210 @opindex mportable-runtime
19211 Use the portable calling conventions proposed by HP for ELF systems.
19213 @item -mgas
19214 @opindex mgas
19215 Enable the use of assembler directives only GAS understands.
19217 @item -mschedule=@var{cpu-type}
19218 @opindex mschedule
19219 Schedule code according to the constraints for the machine type
19220 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
19221 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
19222 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
19223 proper scheduling option for your machine.  The default scheduling is
19224 @samp{8000}.
19226 @item -mlinker-opt
19227 @opindex mlinker-opt
19228 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
19229 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
19230 linkers in which they give bogus error messages when linking some programs.
19232 @item -msoft-float
19233 @opindex msoft-float
19234 Generate output containing library calls for floating point.
19235 @strong{Warning:} the requisite libraries are not available for all HPPA
19236 targets.  Normally the facilities of the machine's usual C compiler are
19237 used, but this cannot be done directly in cross-compilation.  You must make
19238 your own arrangements to provide suitable library functions for
19239 cross-compilation.
19241 @option{-msoft-float} changes the calling convention in the output file;
19242 therefore, it is only useful if you compile @emph{all} of a program with
19243 this option.  In particular, you need to compile @file{libgcc.a}, the
19244 library that comes with GCC, with @option{-msoft-float} in order for
19245 this to work.
19247 @item -msio
19248 @opindex msio
19249 Generate the predefine, @code{_SIO}, for server IO@.  The default is
19250 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
19251 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
19252 options are available under HP-UX and HI-UX@.
19254 @item -mgnu-ld
19255 @opindex mgnu-ld
19256 Use options specific to GNU @command{ld}.
19257 This passes @option{-shared} to @command{ld} when
19258 building a shared library.  It is the default when GCC is configured,
19259 explicitly or implicitly, with the GNU linker.  This option does not
19260 affect which @command{ld} is called; it only changes what parameters
19261 are passed to that @command{ld}.
19262 The @command{ld} that is called is determined by the
19263 @option{--with-ld} configure option, GCC's program search path, and
19264 finally by the user's @env{PATH}.  The linker used by GCC can be printed
19265 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
19266 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
19268 @item -mhp-ld
19269 @opindex mhp-ld
19270 Use options specific to HP @command{ld}.
19271 This passes @option{-b} to @command{ld} when building
19272 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
19273 links.  It is the default when GCC is configured, explicitly or
19274 implicitly, with the HP linker.  This option does not affect
19275 which @command{ld} is called; it only changes what parameters are passed to that
19276 @command{ld}.
19277 The @command{ld} that is called is determined by the @option{--with-ld}
19278 configure option, GCC's program search path, and finally by the user's
19279 @env{PATH}.  The linker used by GCC can be printed using @samp{which
19280 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
19281 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
19283 @item -mlong-calls
19284 @opindex mno-long-calls
19285 Generate code that uses long call sequences.  This ensures that a call
19286 is always able to reach linker generated stubs.  The default is to generate
19287 long calls only when the distance from the call site to the beginning
19288 of the function or translation unit, as the case may be, exceeds a
19289 predefined limit set by the branch type being used.  The limits for
19290 normal calls are 7,600,000 and 240,000 bytes, respectively for the
19291 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
19292 240,000 bytes.
19294 Distances are measured from the beginning of functions when using the
19295 @option{-ffunction-sections} option, or when using the @option{-mgas}
19296 and @option{-mno-portable-runtime} options together under HP-UX with
19297 the SOM linker.
19299 It is normally not desirable to use this option as it degrades
19300 performance.  However, it may be useful in large applications,
19301 particularly when partial linking is used to build the application.
19303 The types of long calls used depends on the capabilities of the
19304 assembler and linker, and the type of code being generated.  The
19305 impact on systems that support long absolute calls, and long pic
19306 symbol-difference or pc-relative calls should be relatively small.
19307 However, an indirect call is used on 32-bit ELF systems in pic code
19308 and it is quite long.
19310 @item -munix=@var{unix-std}
19311 @opindex march
19312 Generate compiler predefines and select a startfile for the specified
19313 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
19314 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
19315 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
19316 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
19317 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
19318 and later.
19320 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
19321 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
19322 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
19323 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
19324 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
19325 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
19327 It is @emph{important} to note that this option changes the interfaces
19328 for various library routines.  It also affects the operational behavior
19329 of the C library.  Thus, @emph{extreme} care is needed in using this
19330 option.
19332 Library code that is intended to operate with more than one UNIX
19333 standard must test, set and restore the variable @code{__xpg4_extended_mask}
19334 as appropriate.  Most GNU software doesn't provide this capability.
19336 @item -nolibdld
19337 @opindex nolibdld
19338 Suppress the generation of link options to search libdld.sl when the
19339 @option{-static} option is specified on HP-UX 10 and later.
19341 @item -static
19342 @opindex static
19343 The HP-UX implementation of setlocale in libc has a dependency on
19344 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
19345 when the @option{-static} option is specified, special link options
19346 are needed to resolve this dependency.
19348 On HP-UX 10 and later, the GCC driver adds the necessary options to
19349 link with libdld.sl when the @option{-static} option is specified.
19350 This causes the resulting binary to be dynamic.  On the 64-bit port,
19351 the linkers generate dynamic binaries by default in any case.  The
19352 @option{-nolibdld} option can be used to prevent the GCC driver from
19353 adding these link options.
19355 @item -threads
19356 @opindex threads
19357 Add support for multithreading with the @dfn{dce thread} library
19358 under HP-UX@.  This option sets flags for both the preprocessor and
19359 linker.
19360 @end table
19362 @node IA-64 Options
19363 @subsection IA-64 Options
19364 @cindex IA-64 Options
19366 These are the @samp{-m} options defined for the Intel IA-64 architecture.
19368 @table @gcctabopt
19369 @item -mbig-endian
19370 @opindex mbig-endian
19371 Generate code for a big-endian target.  This is the default for HP-UX@.
19373 @item -mlittle-endian
19374 @opindex mlittle-endian
19375 Generate code for a little-endian target.  This is the default for AIX5
19376 and GNU/Linux.
19378 @item -mgnu-as
19379 @itemx -mno-gnu-as
19380 @opindex mgnu-as
19381 @opindex mno-gnu-as
19382 Generate (or don't) code for the GNU assembler.  This is the default.
19383 @c Also, this is the default if the configure option @option{--with-gnu-as}
19384 @c is used.
19386 @item -mgnu-ld
19387 @itemx -mno-gnu-ld
19388 @opindex mgnu-ld
19389 @opindex mno-gnu-ld
19390 Generate (or don't) code for the GNU linker.  This is the default.
19391 @c Also, this is the default if the configure option @option{--with-gnu-ld}
19392 @c is used.
19394 @item -mno-pic
19395 @opindex mno-pic
19396 Generate code that does not use a global pointer register.  The result
19397 is not position independent code, and violates the IA-64 ABI@.
19399 @item -mvolatile-asm-stop
19400 @itemx -mno-volatile-asm-stop
19401 @opindex mvolatile-asm-stop
19402 @opindex mno-volatile-asm-stop
19403 Generate (or don't) a stop bit immediately before and after volatile asm
19404 statements.
19406 @item -mregister-names
19407 @itemx -mno-register-names
19408 @opindex mregister-names
19409 @opindex mno-register-names
19410 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
19411 the stacked registers.  This may make assembler output more readable.
19413 @item -mno-sdata
19414 @itemx -msdata
19415 @opindex mno-sdata
19416 @opindex msdata
19417 Disable (or enable) optimizations that use the small data section.  This may
19418 be useful for working around optimizer bugs.
19420 @item -mconstant-gp
19421 @opindex mconstant-gp
19422 Generate code that uses a single constant global pointer value.  This is
19423 useful when compiling kernel code.
19425 @item -mauto-pic
19426 @opindex mauto-pic
19427 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
19428 This is useful when compiling firmware code.
19430 @item -minline-float-divide-min-latency
19431 @opindex minline-float-divide-min-latency
19432 Generate code for inline divides of floating-point values
19433 using the minimum latency algorithm.
19435 @item -minline-float-divide-max-throughput
19436 @opindex minline-float-divide-max-throughput
19437 Generate code for inline divides of floating-point values
19438 using the maximum throughput algorithm.
19440 @item -mno-inline-float-divide
19441 @opindex mno-inline-float-divide
19442 Do not generate inline code for divides of floating-point values.
19444 @item -minline-int-divide-min-latency
19445 @opindex minline-int-divide-min-latency
19446 Generate code for inline divides of integer values
19447 using the minimum latency algorithm.
19449 @item -minline-int-divide-max-throughput
19450 @opindex minline-int-divide-max-throughput
19451 Generate code for inline divides of integer values
19452 using the maximum throughput algorithm.
19454 @item -mno-inline-int-divide
19455 @opindex mno-inline-int-divide
19456 Do not generate inline code for divides of integer values.
19458 @item -minline-sqrt-min-latency
19459 @opindex minline-sqrt-min-latency
19460 Generate code for inline square roots
19461 using the minimum latency algorithm.
19463 @item -minline-sqrt-max-throughput
19464 @opindex minline-sqrt-max-throughput
19465 Generate code for inline square roots
19466 using the maximum throughput algorithm.
19468 @item -mno-inline-sqrt
19469 @opindex mno-inline-sqrt
19470 Do not generate inline code for @code{sqrt}.
19472 @item -mfused-madd
19473 @itemx -mno-fused-madd
19474 @opindex mfused-madd
19475 @opindex mno-fused-madd
19476 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
19477 instructions.  The default is to use these instructions.
19479 @item -mno-dwarf2-asm
19480 @itemx -mdwarf2-asm
19481 @opindex mno-dwarf2-asm
19482 @opindex mdwarf2-asm
19483 Don't (or do) generate assembler code for the DWARF line number debugging
19484 info.  This may be useful when not using the GNU assembler.
19486 @item -mearly-stop-bits
19487 @itemx -mno-early-stop-bits
19488 @opindex mearly-stop-bits
19489 @opindex mno-early-stop-bits
19490 Allow stop bits to be placed earlier than immediately preceding the
19491 instruction that triggered the stop bit.  This can improve instruction
19492 scheduling, but does not always do so.
19494 @item -mfixed-range=@var{register-range}
19495 @opindex mfixed-range
19496 Generate code treating the given register range as fixed registers.
19497 A fixed register is one that the register allocator cannot use.  This is
19498 useful when compiling kernel code.  A register range is specified as
19499 two registers separated by a dash.  Multiple register ranges can be
19500 specified separated by a comma.
19502 @item -mtls-size=@var{tls-size}
19503 @opindex mtls-size
19504 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
19507 @item -mtune=@var{cpu-type}
19508 @opindex mtune
19509 Tune the instruction scheduling for a particular CPU, Valid values are
19510 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
19511 and @samp{mckinley}.
19513 @item -milp32
19514 @itemx -mlp64
19515 @opindex milp32
19516 @opindex mlp64
19517 Generate code for a 32-bit or 64-bit environment.
19518 The 32-bit environment sets int, long and pointer to 32 bits.
19519 The 64-bit environment sets int to 32 bits and long and pointer
19520 to 64 bits.  These are HP-UX specific flags.
19522 @item -mno-sched-br-data-spec
19523 @itemx -msched-br-data-spec
19524 @opindex mno-sched-br-data-spec
19525 @opindex msched-br-data-spec
19526 (Dis/En)able data speculative scheduling before reload.
19527 This results in generation of @code{ld.a} instructions and
19528 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
19529 The default setting is disabled.
19531 @item -msched-ar-data-spec
19532 @itemx -mno-sched-ar-data-spec
19533 @opindex msched-ar-data-spec
19534 @opindex mno-sched-ar-data-spec
19535 (En/Dis)able data speculative scheduling after reload.
19536 This results in generation of @code{ld.a} instructions and
19537 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
19538 The default setting is enabled.
19540 @item -mno-sched-control-spec
19541 @itemx -msched-control-spec
19542 @opindex mno-sched-control-spec
19543 @opindex msched-control-spec
19544 (Dis/En)able control speculative scheduling.  This feature is
19545 available only during region scheduling (i.e.@: before reload).
19546 This results in generation of the @code{ld.s} instructions and
19547 the corresponding check instructions @code{chk.s}.
19548 The default setting is disabled.
19550 @item -msched-br-in-data-spec
19551 @itemx -mno-sched-br-in-data-spec
19552 @opindex msched-br-in-data-spec
19553 @opindex mno-sched-br-in-data-spec
19554 (En/Dis)able speculative scheduling of the instructions that
19555 are dependent on the data speculative loads before reload.
19556 This is effective only with @option{-msched-br-data-spec} enabled.
19557 The default setting is enabled.
19559 @item -msched-ar-in-data-spec
19560 @itemx -mno-sched-ar-in-data-spec
19561 @opindex msched-ar-in-data-spec
19562 @opindex mno-sched-ar-in-data-spec
19563 (En/Dis)able speculative scheduling of the instructions that
19564 are dependent on the data speculative loads after reload.
19565 This is effective only with @option{-msched-ar-data-spec} enabled.
19566 The default setting is enabled.
19568 @item -msched-in-control-spec
19569 @itemx -mno-sched-in-control-spec
19570 @opindex msched-in-control-spec
19571 @opindex mno-sched-in-control-spec
19572 (En/Dis)able speculative scheduling of the instructions that
19573 are dependent on the control speculative loads.
19574 This is effective only with @option{-msched-control-spec} enabled.
19575 The default setting is enabled.
19577 @item -mno-sched-prefer-non-data-spec-insns
19578 @itemx -msched-prefer-non-data-spec-insns
19579 @opindex mno-sched-prefer-non-data-spec-insns
19580 @opindex msched-prefer-non-data-spec-insns
19581 If enabled, data-speculative instructions are chosen for schedule
19582 only if there are no other choices at the moment.  This makes
19583 the use of the data speculation much more conservative.
19584 The default setting is disabled.
19586 @item -mno-sched-prefer-non-control-spec-insns
19587 @itemx -msched-prefer-non-control-spec-insns
19588 @opindex mno-sched-prefer-non-control-spec-insns
19589 @opindex msched-prefer-non-control-spec-insns
19590 If enabled, control-speculative instructions are chosen for schedule
19591 only if there are no other choices at the moment.  This makes
19592 the use of the control speculation much more conservative.
19593 The default setting is disabled.
19595 @item -mno-sched-count-spec-in-critical-path
19596 @itemx -msched-count-spec-in-critical-path
19597 @opindex mno-sched-count-spec-in-critical-path
19598 @opindex msched-count-spec-in-critical-path
19599 If enabled, speculative dependencies are considered during
19600 computation of the instructions priorities.  This makes the use of the
19601 speculation a bit more conservative.
19602 The default setting is disabled.
19604 @item -msched-spec-ldc
19605 @opindex msched-spec-ldc
19606 Use a simple data speculation check.  This option is on by default.
19608 @item -msched-control-spec-ldc
19609 @opindex msched-spec-ldc
19610 Use a simple check for control speculation.  This option is on by default.
19612 @item -msched-stop-bits-after-every-cycle
19613 @opindex msched-stop-bits-after-every-cycle
19614 Place a stop bit after every cycle when scheduling.  This option is on
19615 by default.
19617 @item -msched-fp-mem-deps-zero-cost
19618 @opindex msched-fp-mem-deps-zero-cost
19619 Assume that floating-point stores and loads are not likely to cause a conflict
19620 when placed into the same instruction group.  This option is disabled by
19621 default.
19623 @item -msel-sched-dont-check-control-spec
19624 @opindex msel-sched-dont-check-control-spec
19625 Generate checks for control speculation in selective scheduling.
19626 This flag is disabled by default.
19628 @item -msched-max-memory-insns=@var{max-insns}
19629 @opindex msched-max-memory-insns
19630 Limit on the number of memory insns per instruction group, giving lower
19631 priority to subsequent memory insns attempting to schedule in the same
19632 instruction group. Frequently useful to prevent cache bank conflicts.
19633 The default value is 1.
19635 @item -msched-max-memory-insns-hard-limit
19636 @opindex msched-max-memory-insns-hard-limit
19637 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
19638 disallowing more than that number in an instruction group.
19639 Otherwise, the limit is ``soft'', meaning that non-memory operations
19640 are preferred when the limit is reached, but memory operations may still
19641 be scheduled.
19643 @end table
19645 @node LM32 Options
19646 @subsection LM32 Options
19647 @cindex LM32 options
19649 These @option{-m} options are defined for the LatticeMico32 architecture:
19651 @table @gcctabopt
19652 @item -mbarrel-shift-enabled
19653 @opindex mbarrel-shift-enabled
19654 Enable barrel-shift instructions.
19656 @item -mdivide-enabled
19657 @opindex mdivide-enabled
19658 Enable divide and modulus instructions.
19660 @item -mmultiply-enabled
19661 @opindex multiply-enabled
19662 Enable multiply instructions.
19664 @item -msign-extend-enabled
19665 @opindex msign-extend-enabled
19666 Enable sign extend instructions.
19668 @item -muser-enabled
19669 @opindex muser-enabled
19670 Enable user-defined instructions.
19672 @end table
19674 @node M32C Options
19675 @subsection M32C Options
19676 @cindex M32C options
19678 @table @gcctabopt
19679 @item -mcpu=@var{name}
19680 @opindex mcpu=
19681 Select the CPU for which code is generated.  @var{name} may be one of
19682 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
19683 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
19684 the M32C/80 series.
19686 @item -msim
19687 @opindex msim
19688 Specifies that the program will be run on the simulator.  This causes
19689 an alternate runtime library to be linked in which supports, for
19690 example, file I/O@.  You must not use this option when generating
19691 programs that will run on real hardware; you must provide your own
19692 runtime library for whatever I/O functions are needed.
19694 @item -memregs=@var{number}
19695 @opindex memregs=
19696 Specifies the number of memory-based pseudo-registers GCC uses
19697 during code generation.  These pseudo-registers are used like real
19698 registers, so there is a tradeoff between GCC's ability to fit the
19699 code into available registers, and the performance penalty of using
19700 memory instead of registers.  Note that all modules in a program must
19701 be compiled with the same value for this option.  Because of that, you
19702 must not use this option with GCC's default runtime libraries.
19704 @end table
19706 @node M32R/D Options
19707 @subsection M32R/D Options
19708 @cindex M32R/D options
19710 These @option{-m} options are defined for Renesas M32R/D architectures:
19712 @table @gcctabopt
19713 @item -m32r2
19714 @opindex m32r2
19715 Generate code for the M32R/2@.
19717 @item -m32rx
19718 @opindex m32rx
19719 Generate code for the M32R/X@.
19721 @item -m32r
19722 @opindex m32r
19723 Generate code for the M32R@.  This is the default.
19725 @item -mmodel=small
19726 @opindex mmodel=small
19727 Assume all objects live in the lower 16MB of memory (so that their addresses
19728 can be loaded with the @code{ld24} instruction), and assume all subroutines
19729 are reachable with the @code{bl} instruction.
19730 This is the default.
19732 The addressability of a particular object can be set with the
19733 @code{model} attribute.
19735 @item -mmodel=medium
19736 @opindex mmodel=medium
19737 Assume objects may be anywhere in the 32-bit address space (the compiler
19738 generates @code{seth/add3} instructions to load their addresses), and
19739 assume all subroutines are reachable with the @code{bl} instruction.
19741 @item -mmodel=large
19742 @opindex mmodel=large
19743 Assume objects may be anywhere in the 32-bit address space (the compiler
19744 generates @code{seth/add3} instructions to load their addresses), and
19745 assume subroutines may not be reachable with the @code{bl} instruction
19746 (the compiler generates the much slower @code{seth/add3/jl}
19747 instruction sequence).
19749 @item -msdata=none
19750 @opindex msdata=none
19751 Disable use of the small data area.  Variables are put into
19752 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
19753 @code{section} attribute has been specified).
19754 This is the default.
19756 The small data area consists of sections @code{.sdata} and @code{.sbss}.
19757 Objects may be explicitly put in the small data area with the
19758 @code{section} attribute using one of these sections.
19760 @item -msdata=sdata
19761 @opindex msdata=sdata
19762 Put small global and static data in the small data area, but do not
19763 generate special code to reference them.
19765 @item -msdata=use
19766 @opindex msdata=use
19767 Put small global and static data in the small data area, and generate
19768 special instructions to reference them.
19770 @item -G @var{num}
19771 @opindex G
19772 @cindex smaller data references
19773 Put global and static objects less than or equal to @var{num} bytes
19774 into the small data or BSS sections instead of the normal data or BSS
19775 sections.  The default value of @var{num} is 8.
19776 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
19777 for this option to have any effect.
19779 All modules should be compiled with the same @option{-G @var{num}} value.
19780 Compiling with different values of @var{num} may or may not work; if it
19781 doesn't the linker gives an error message---incorrect code is not
19782 generated.
19784 @item -mdebug
19785 @opindex mdebug
19786 Makes the M32R-specific code in the compiler display some statistics
19787 that might help in debugging programs.
19789 @item -malign-loops
19790 @opindex malign-loops
19791 Align all loops to a 32-byte boundary.
19793 @item -mno-align-loops
19794 @opindex mno-align-loops
19795 Do not enforce a 32-byte alignment for loops.  This is the default.
19797 @item -missue-rate=@var{number}
19798 @opindex missue-rate=@var{number}
19799 Issue @var{number} instructions per cycle.  @var{number} can only be 1
19800 or 2.
19802 @item -mbranch-cost=@var{number}
19803 @opindex mbranch-cost=@var{number}
19804 @var{number} can only be 1 or 2.  If it is 1 then branches are
19805 preferred over conditional code, if it is 2, then the opposite applies.
19807 @item -mflush-trap=@var{number}
19808 @opindex mflush-trap=@var{number}
19809 Specifies the trap number to use to flush the cache.  The default is
19810 12.  Valid numbers are between 0 and 15 inclusive.
19812 @item -mno-flush-trap
19813 @opindex mno-flush-trap
19814 Specifies that the cache cannot be flushed by using a trap.
19816 @item -mflush-func=@var{name}
19817 @opindex mflush-func=@var{name}
19818 Specifies the name of the operating system function to call to flush
19819 the cache.  The default is @samp{_flush_cache}, but a function call
19820 is only used if a trap is not available.
19822 @item -mno-flush-func
19823 @opindex mno-flush-func
19824 Indicates that there is no OS function for flushing the cache.
19826 @end table
19828 @node M680x0 Options
19829 @subsection M680x0 Options
19830 @cindex M680x0 options
19832 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
19833 The default settings depend on which architecture was selected when
19834 the compiler was configured; the defaults for the most common choices
19835 are given below.
19837 @table @gcctabopt
19838 @item -march=@var{arch}
19839 @opindex march
19840 Generate code for a specific M680x0 or ColdFire instruction set
19841 architecture.  Permissible values of @var{arch} for M680x0
19842 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
19843 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
19844 architectures are selected according to Freescale's ISA classification
19845 and the permissible values are: @samp{isaa}, @samp{isaaplus},
19846 @samp{isab} and @samp{isac}.
19848 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
19849 code for a ColdFire target.  The @var{arch} in this macro is one of the
19850 @option{-march} arguments given above.
19852 When used together, @option{-march} and @option{-mtune} select code
19853 that runs on a family of similar processors but that is optimized
19854 for a particular microarchitecture.
19856 @item -mcpu=@var{cpu}
19857 @opindex mcpu
19858 Generate code for a specific M680x0 or ColdFire processor.
19859 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
19860 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
19861 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
19862 below, which also classifies the CPUs into families:
19864 @multitable @columnfractions 0.20 0.80
19865 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
19866 @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}
19867 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
19868 @item @samp{5206e} @tab @samp{5206e}
19869 @item @samp{5208} @tab @samp{5207} @samp{5208}
19870 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
19871 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
19872 @item @samp{5216} @tab @samp{5214} @samp{5216}
19873 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
19874 @item @samp{5225} @tab @samp{5224} @samp{5225}
19875 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
19876 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
19877 @item @samp{5249} @tab @samp{5249}
19878 @item @samp{5250} @tab @samp{5250}
19879 @item @samp{5271} @tab @samp{5270} @samp{5271}
19880 @item @samp{5272} @tab @samp{5272}
19881 @item @samp{5275} @tab @samp{5274} @samp{5275}
19882 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
19883 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
19884 @item @samp{5307} @tab @samp{5307}
19885 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
19886 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
19887 @item @samp{5407} @tab @samp{5407}
19888 @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}
19889 @end multitable
19891 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
19892 @var{arch} is compatible with @var{cpu}.  Other combinations of
19893 @option{-mcpu} and @option{-march} are rejected.
19895 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
19896 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
19897 where the value of @var{family} is given by the table above.
19899 @item -mtune=@var{tune}
19900 @opindex mtune
19901 Tune the code for a particular microarchitecture within the
19902 constraints set by @option{-march} and @option{-mcpu}.
19903 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
19904 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
19905 and @samp{cpu32}.  The ColdFire microarchitectures
19906 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
19908 You can also use @option{-mtune=68020-40} for code that needs
19909 to run relatively well on 68020, 68030 and 68040 targets.
19910 @option{-mtune=68020-60} is similar but includes 68060 targets
19911 as well.  These two options select the same tuning decisions as
19912 @option{-m68020-40} and @option{-m68020-60} respectively.
19914 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
19915 when tuning for 680x0 architecture @var{arch}.  It also defines
19916 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
19917 option is used.  If GCC is tuning for a range of architectures,
19918 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
19919 it defines the macros for every architecture in the range.
19921 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
19922 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
19923 of the arguments given above.
19925 @item -m68000
19926 @itemx -mc68000
19927 @opindex m68000
19928 @opindex mc68000
19929 Generate output for a 68000.  This is the default
19930 when the compiler is configured for 68000-based systems.
19931 It is equivalent to @option{-march=68000}.
19933 Use this option for microcontrollers with a 68000 or EC000 core,
19934 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
19936 @item -m68010
19937 @opindex m68010
19938 Generate output for a 68010.  This is the default
19939 when the compiler is configured for 68010-based systems.
19940 It is equivalent to @option{-march=68010}.
19942 @item -m68020
19943 @itemx -mc68020
19944 @opindex m68020
19945 @opindex mc68020
19946 Generate output for a 68020.  This is the default
19947 when the compiler is configured for 68020-based systems.
19948 It is equivalent to @option{-march=68020}.
19950 @item -m68030
19951 @opindex m68030
19952 Generate output for a 68030.  This is the default when the compiler is
19953 configured for 68030-based systems.  It is equivalent to
19954 @option{-march=68030}.
19956 @item -m68040
19957 @opindex m68040
19958 Generate output for a 68040.  This is the default when the compiler is
19959 configured for 68040-based systems.  It is equivalent to
19960 @option{-march=68040}.
19962 This option inhibits the use of 68881/68882 instructions that have to be
19963 emulated by software on the 68040.  Use this option if your 68040 does not
19964 have code to emulate those instructions.
19966 @item -m68060
19967 @opindex m68060
19968 Generate output for a 68060.  This is the default when the compiler is
19969 configured for 68060-based systems.  It is equivalent to
19970 @option{-march=68060}.
19972 This option inhibits the use of 68020 and 68881/68882 instructions that
19973 have to be emulated by software on the 68060.  Use this option if your 68060
19974 does not have code to emulate those instructions.
19976 @item -mcpu32
19977 @opindex mcpu32
19978 Generate output for a CPU32.  This is the default
19979 when the compiler is configured for CPU32-based systems.
19980 It is equivalent to @option{-march=cpu32}.
19982 Use this option for microcontrollers with a
19983 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
19984 68336, 68340, 68341, 68349 and 68360.
19986 @item -m5200
19987 @opindex m5200
19988 Generate output for a 520X ColdFire CPU@.  This is the default
19989 when the compiler is configured for 520X-based systems.
19990 It is equivalent to @option{-mcpu=5206}, and is now deprecated
19991 in favor of that option.
19993 Use this option for microcontroller with a 5200 core, including
19994 the MCF5202, MCF5203, MCF5204 and MCF5206.
19996 @item -m5206e
19997 @opindex m5206e
19998 Generate output for a 5206e ColdFire CPU@.  The option is now
19999 deprecated in favor of the equivalent @option{-mcpu=5206e}.
20001 @item -m528x
20002 @opindex m528x
20003 Generate output for a member of the ColdFire 528X family.
20004 The option is now deprecated in favor of the equivalent
20005 @option{-mcpu=528x}.
20007 @item -m5307
20008 @opindex m5307
20009 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
20010 in favor of the equivalent @option{-mcpu=5307}.
20012 @item -m5407
20013 @opindex m5407
20014 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
20015 in favor of the equivalent @option{-mcpu=5407}.
20017 @item -mcfv4e
20018 @opindex mcfv4e
20019 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
20020 This includes use of hardware floating-point instructions.
20021 The option is equivalent to @option{-mcpu=547x}, and is now
20022 deprecated in favor of that option.
20024 @item -m68020-40
20025 @opindex m68020-40
20026 Generate output for a 68040, without using any of the new instructions.
20027 This results in code that can run relatively efficiently on either a
20028 68020/68881 or a 68030 or a 68040.  The generated code does use the
20029 68881 instructions that are emulated on the 68040.
20031 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
20033 @item -m68020-60
20034 @opindex m68020-60
20035 Generate output for a 68060, without using any of the new instructions.
20036 This results in code that can run relatively efficiently on either a
20037 68020/68881 or a 68030 or a 68040.  The generated code does use the
20038 68881 instructions that are emulated on the 68060.
20040 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
20042 @item -mhard-float
20043 @itemx -m68881
20044 @opindex mhard-float
20045 @opindex m68881
20046 Generate floating-point instructions.  This is the default for 68020
20047 and above, and for ColdFire devices that have an FPU@.  It defines the
20048 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
20049 on ColdFire targets.
20051 @item -msoft-float
20052 @opindex msoft-float
20053 Do not generate floating-point instructions; use library calls instead.
20054 This is the default for 68000, 68010, and 68832 targets.  It is also
20055 the default for ColdFire devices that have no FPU.
20057 @item -mdiv
20058 @itemx -mno-div
20059 @opindex mdiv
20060 @opindex mno-div
20061 Generate (do not generate) ColdFire hardware divide and remainder
20062 instructions.  If @option{-march} is used without @option{-mcpu},
20063 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
20064 architectures.  Otherwise, the default is taken from the target CPU
20065 (either the default CPU, or the one specified by @option{-mcpu}).  For
20066 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
20067 @option{-mcpu=5206e}.
20069 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
20071 @item -mshort
20072 @opindex mshort
20073 Consider type @code{int} to be 16 bits wide, like @code{short int}.
20074 Additionally, parameters passed on the stack are also aligned to a
20075 16-bit boundary even on targets whose API mandates promotion to 32-bit.
20077 @item -mno-short
20078 @opindex mno-short
20079 Do not consider type @code{int} to be 16 bits wide.  This is the default.
20081 @item -mnobitfield
20082 @itemx -mno-bitfield
20083 @opindex mnobitfield
20084 @opindex mno-bitfield
20085 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
20086 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
20088 @item -mbitfield
20089 @opindex mbitfield
20090 Do use the bit-field instructions.  The @option{-m68020} option implies
20091 @option{-mbitfield}.  This is the default if you use a configuration
20092 designed for a 68020.
20094 @item -mrtd
20095 @opindex mrtd
20096 Use a different function-calling convention, in which functions
20097 that take a fixed number of arguments return with the @code{rtd}
20098 instruction, which pops their arguments while returning.  This
20099 saves one instruction in the caller since there is no need to pop
20100 the arguments there.
20102 This calling convention is incompatible with the one normally
20103 used on Unix, so you cannot use it if you need to call libraries
20104 compiled with the Unix compiler.
20106 Also, you must provide function prototypes for all functions that
20107 take variable numbers of arguments (including @code{printf});
20108 otherwise incorrect code is generated for calls to those
20109 functions.
20111 In addition, seriously incorrect code results if you call a
20112 function with too many arguments.  (Normally, extra arguments are
20113 harmlessly ignored.)
20115 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
20116 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
20118 @item -mno-rtd
20119 @opindex mno-rtd
20120 Do not use the calling conventions selected by @option{-mrtd}.
20121 This is the default.
20123 @item -malign-int
20124 @itemx -mno-align-int
20125 @opindex malign-int
20126 @opindex mno-align-int
20127 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
20128 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
20129 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
20130 Aligning variables on 32-bit boundaries produces code that runs somewhat
20131 faster on processors with 32-bit busses at the expense of more memory.
20133 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
20134 aligns structures containing the above types differently than
20135 most published application binary interface specifications for the m68k.
20137 @item -mpcrel
20138 @opindex mpcrel
20139 Use the pc-relative addressing mode of the 68000 directly, instead of
20140 using a global offset table.  At present, this option implies @option{-fpic},
20141 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
20142 not presently supported with @option{-mpcrel}, though this could be supported for
20143 68020 and higher processors.
20145 @item -mno-strict-align
20146 @itemx -mstrict-align
20147 @opindex mno-strict-align
20148 @opindex mstrict-align
20149 Do not (do) assume that unaligned memory references are handled by
20150 the system.
20152 @item -msep-data
20153 Generate code that allows the data segment to be located in a different
20154 area of memory from the text segment.  This allows for execute-in-place in
20155 an environment without virtual memory management.  This option implies
20156 @option{-fPIC}.
20158 @item -mno-sep-data
20159 Generate code that assumes that the data segment follows the text segment.
20160 This is the default.
20162 @item -mid-shared-library
20163 Generate code that supports shared libraries via the library ID method.
20164 This allows for execute-in-place and shared libraries in an environment
20165 without virtual memory management.  This option implies @option{-fPIC}.
20167 @item -mno-id-shared-library
20168 Generate code that doesn't assume ID-based shared libraries are being used.
20169 This is the default.
20171 @item -mshared-library-id=n
20172 Specifies the identification number of the ID-based shared library being
20173 compiled.  Specifying a value of 0 generates more compact code; specifying
20174 other values forces the allocation of that number to the current
20175 library, but is no more space- or time-efficient than omitting this option.
20177 @item -mxgot
20178 @itemx -mno-xgot
20179 @opindex mxgot
20180 @opindex mno-xgot
20181 When generating position-independent code for ColdFire, generate code
20182 that works if the GOT has more than 8192 entries.  This code is
20183 larger and slower than code generated without this option.  On M680x0
20184 processors, this option is not needed; @option{-fPIC} suffices.
20186 GCC normally uses a single instruction to load values from the GOT@.
20187 While this is relatively efficient, it only works if the GOT
20188 is smaller than about 64k.  Anything larger causes the linker
20189 to report an error such as:
20191 @cindex relocation truncated to fit (ColdFire)
20192 @smallexample
20193 relocation truncated to fit: R_68K_GOT16O foobar
20194 @end smallexample
20196 If this happens, you should recompile your code with @option{-mxgot}.
20197 It should then work with very large GOTs.  However, code generated with
20198 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
20199 the value of a global symbol.
20201 Note that some linkers, including newer versions of the GNU linker,
20202 can create multiple GOTs and sort GOT entries.  If you have such a linker,
20203 you should only need to use @option{-mxgot} when compiling a single
20204 object file that accesses more than 8192 GOT entries.  Very few do.
20206 These options have no effect unless GCC is generating
20207 position-independent code.
20209 @item -mlong-jump-table-offsets
20210 @opindex mlong-jump-table-offsets
20211 Use 32-bit offsets in @code{switch} tables.  The default is to use
20212 16-bit offsets.
20214 @end table
20216 @node MCore Options
20217 @subsection MCore Options
20218 @cindex MCore options
20220 These are the @samp{-m} options defined for the Motorola M*Core
20221 processors.
20223 @table @gcctabopt
20225 @item -mhardlit
20226 @itemx -mno-hardlit
20227 @opindex mhardlit
20228 @opindex mno-hardlit
20229 Inline constants into the code stream if it can be done in two
20230 instructions or less.
20232 @item -mdiv
20233 @itemx -mno-div
20234 @opindex mdiv
20235 @opindex mno-div
20236 Use the divide instruction.  (Enabled by default).
20238 @item -mrelax-immediate
20239 @itemx -mno-relax-immediate
20240 @opindex mrelax-immediate
20241 @opindex mno-relax-immediate
20242 Allow arbitrary-sized immediates in bit operations.
20244 @item -mwide-bitfields
20245 @itemx -mno-wide-bitfields
20246 @opindex mwide-bitfields
20247 @opindex mno-wide-bitfields
20248 Always treat bit-fields as @code{int}-sized.
20250 @item -m4byte-functions
20251 @itemx -mno-4byte-functions
20252 @opindex m4byte-functions
20253 @opindex mno-4byte-functions
20254 Force all functions to be aligned to a 4-byte boundary.
20256 @item -mcallgraph-data
20257 @itemx -mno-callgraph-data
20258 @opindex mcallgraph-data
20259 @opindex mno-callgraph-data
20260 Emit callgraph information.
20262 @item -mslow-bytes
20263 @itemx -mno-slow-bytes
20264 @opindex mslow-bytes
20265 @opindex mno-slow-bytes
20266 Prefer word access when reading byte quantities.
20268 @item -mlittle-endian
20269 @itemx -mbig-endian
20270 @opindex mlittle-endian
20271 @opindex mbig-endian
20272 Generate code for a little-endian target.
20274 @item -m210
20275 @itemx -m340
20276 @opindex m210
20277 @opindex m340
20278 Generate code for the 210 processor.
20280 @item -mno-lsim
20281 @opindex mno-lsim
20282 Assume that runtime support has been provided and so omit the
20283 simulator library (@file{libsim.a)} from the linker command line.
20285 @item -mstack-increment=@var{size}
20286 @opindex mstack-increment
20287 Set the maximum amount for a single stack increment operation.  Large
20288 values can increase the speed of programs that contain functions
20289 that need a large amount of stack space, but they can also trigger a
20290 segmentation fault if the stack is extended too much.  The default
20291 value is 0x1000.
20293 @end table
20295 @node MeP Options
20296 @subsection MeP Options
20297 @cindex MeP options
20299 @table @gcctabopt
20301 @item -mabsdiff
20302 @opindex mabsdiff
20303 Enables the @code{abs} instruction, which is the absolute difference
20304 between two registers.
20306 @item -mall-opts
20307 @opindex mall-opts
20308 Enables all the optional instructions---average, multiply, divide, bit
20309 operations, leading zero, absolute difference, min/max, clip, and
20310 saturation.
20313 @item -maverage
20314 @opindex maverage
20315 Enables the @code{ave} instruction, which computes the average of two
20316 registers.
20318 @item -mbased=@var{n}
20319 @opindex mbased=
20320 Variables of size @var{n} bytes or smaller are placed in the
20321 @code{.based} section by default.  Based variables use the @code{$tp}
20322 register as a base register, and there is a 128-byte limit to the
20323 @code{.based} section.
20325 @item -mbitops
20326 @opindex mbitops
20327 Enables the bit operation instructions---bit test (@code{btstm}), set
20328 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
20329 test-and-set (@code{tas}).
20331 @item -mc=@var{name}
20332 @opindex mc=
20333 Selects which section constant data is placed in.  @var{name} may
20334 be @samp{tiny}, @samp{near}, or @samp{far}.
20336 @item -mclip
20337 @opindex mclip
20338 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
20339 useful unless you also provide @option{-mminmax}.
20341 @item -mconfig=@var{name}
20342 @opindex mconfig=
20343 Selects one of the built-in core configurations.  Each MeP chip has
20344 one or more modules in it; each module has a core CPU and a variety of
20345 coprocessors, optional instructions, and peripherals.  The
20346 @code{MeP-Integrator} tool, not part of GCC, provides these
20347 configurations through this option; using this option is the same as
20348 using all the corresponding command-line options.  The default
20349 configuration is @samp{default}.
20351 @item -mcop
20352 @opindex mcop
20353 Enables the coprocessor instructions.  By default, this is a 32-bit
20354 coprocessor.  Note that the coprocessor is normally enabled via the
20355 @option{-mconfig=} option.
20357 @item -mcop32
20358 @opindex mcop32
20359 Enables the 32-bit coprocessor's instructions.
20361 @item -mcop64
20362 @opindex mcop64
20363 Enables the 64-bit coprocessor's instructions.
20365 @item -mivc2
20366 @opindex mivc2
20367 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
20369 @item -mdc
20370 @opindex mdc
20371 Causes constant variables to be placed in the @code{.near} section.
20373 @item -mdiv
20374 @opindex mdiv
20375 Enables the @code{div} and @code{divu} instructions.
20377 @item -meb
20378 @opindex meb
20379 Generate big-endian code.
20381 @item -mel
20382 @opindex mel
20383 Generate little-endian code.
20385 @item -mio-volatile
20386 @opindex mio-volatile
20387 Tells the compiler that any variable marked with the @code{io}
20388 attribute is to be considered volatile.
20390 @item -ml
20391 @opindex ml
20392 Causes variables to be assigned to the @code{.far} section by default.
20394 @item -mleadz
20395 @opindex mleadz
20396 Enables the @code{leadz} (leading zero) instruction.
20398 @item -mm
20399 @opindex mm
20400 Causes variables to be assigned to the @code{.near} section by default.
20402 @item -mminmax
20403 @opindex mminmax
20404 Enables the @code{min} and @code{max} instructions.
20406 @item -mmult
20407 @opindex mmult
20408 Enables the multiplication and multiply-accumulate instructions.
20410 @item -mno-opts
20411 @opindex mno-opts
20412 Disables all the optional instructions enabled by @option{-mall-opts}.
20414 @item -mrepeat
20415 @opindex mrepeat
20416 Enables the @code{repeat} and @code{erepeat} instructions, used for
20417 low-overhead looping.
20419 @item -ms
20420 @opindex ms
20421 Causes all variables to default to the @code{.tiny} section.  Note
20422 that there is a 65536-byte limit to this section.  Accesses to these
20423 variables use the @code{%gp} base register.
20425 @item -msatur
20426 @opindex msatur
20427 Enables the saturation instructions.  Note that the compiler does not
20428 currently generate these itself, but this option is included for
20429 compatibility with other tools, like @code{as}.
20431 @item -msdram
20432 @opindex msdram
20433 Link the SDRAM-based runtime instead of the default ROM-based runtime.
20435 @item -msim
20436 @opindex msim
20437 Link the simulator run-time libraries.
20439 @item -msimnovec
20440 @opindex msimnovec
20441 Link the simulator runtime libraries, excluding built-in support
20442 for reset and exception vectors and tables.
20444 @item -mtf
20445 @opindex mtf
20446 Causes all functions to default to the @code{.far} section.  Without
20447 this option, functions default to the @code{.near} section.
20449 @item -mtiny=@var{n}
20450 @opindex mtiny=
20451 Variables that are @var{n} bytes or smaller are allocated to the
20452 @code{.tiny} section.  These variables use the @code{$gp} base
20453 register.  The default for this option is 4, but note that there's a
20454 65536-byte limit to the @code{.tiny} section.
20456 @end table
20458 @node MicroBlaze Options
20459 @subsection MicroBlaze Options
20460 @cindex MicroBlaze Options
20462 @table @gcctabopt
20464 @item -msoft-float
20465 @opindex msoft-float
20466 Use software emulation for floating point (default).
20468 @item -mhard-float
20469 @opindex mhard-float
20470 Use hardware floating-point instructions.
20472 @item -mmemcpy
20473 @opindex mmemcpy
20474 Do not optimize block moves, use @code{memcpy}.
20476 @item -mno-clearbss
20477 @opindex mno-clearbss
20478 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
20480 @item -mcpu=@var{cpu-type}
20481 @opindex mcpu=
20482 Use features of, and schedule code for, the given CPU.
20483 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
20484 where @var{X} is a major version, @var{YY} is the minor version, and
20485 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
20486 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v6.00.a}.
20488 @item -mxl-soft-mul
20489 @opindex mxl-soft-mul
20490 Use software multiply emulation (default).
20492 @item -mxl-soft-div
20493 @opindex mxl-soft-div
20494 Use software emulation for divides (default).
20496 @item -mxl-barrel-shift
20497 @opindex mxl-barrel-shift
20498 Use the hardware barrel shifter.
20500 @item -mxl-pattern-compare
20501 @opindex mxl-pattern-compare
20502 Use pattern compare instructions.
20504 @item -msmall-divides
20505 @opindex msmall-divides
20506 Use table lookup optimization for small signed integer divisions.
20508 @item -mxl-stack-check
20509 @opindex mxl-stack-check
20510 This option is deprecated.  Use @option{-fstack-check} instead.
20512 @item -mxl-gp-opt
20513 @opindex mxl-gp-opt
20514 Use GP-relative @code{.sdata}/@code{.sbss} sections.
20516 @item -mxl-multiply-high
20517 @opindex mxl-multiply-high
20518 Use multiply high instructions for high part of 32x32 multiply.
20520 @item -mxl-float-convert
20521 @opindex mxl-float-convert
20522 Use hardware floating-point conversion instructions.
20524 @item -mxl-float-sqrt
20525 @opindex mxl-float-sqrt
20526 Use hardware floating-point square root instruction.
20528 @item -mbig-endian
20529 @opindex mbig-endian
20530 Generate code for a big-endian target.
20532 @item -mlittle-endian
20533 @opindex mlittle-endian
20534 Generate code for a little-endian target.
20536 @item -mxl-reorder
20537 @opindex mxl-reorder
20538 Use reorder instructions (swap and byte reversed load/store).
20540 @item -mxl-mode-@var{app-model}
20541 Select application model @var{app-model}.  Valid models are
20542 @table @samp
20543 @item executable
20544 normal executable (default), uses startup code @file{crt0.o}.
20546 @item -mpic-data-is-text-relative
20547 @opindex mpic-data-is-text-relative
20548 Assume that the displacement between the text and data segments is fixed
20549 at static link time.  This allows data to be referenced by offset from start of
20550 text address instead of GOT since PC-relative addressing is not supported.
20552 @item xmdstub
20553 for use with Xilinx Microprocessor Debugger (XMD) based
20554 software intrusive debug agent called xmdstub. This uses startup file
20555 @file{crt1.o} and sets the start address of the program to 0x800.
20557 @item bootstrap
20558 for applications that are loaded using a bootloader.
20559 This model uses startup file @file{crt2.o} which does not contain a processor
20560 reset vector handler. This is suitable for transferring control on a
20561 processor reset to the bootloader rather than the application.
20563 @item novectors
20564 for applications that do not require any of the
20565 MicroBlaze vectors. This option may be useful for applications running
20566 within a monitoring application. This model uses @file{crt3.o} as a startup file.
20567 @end table
20569 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
20570 @option{-mxl-mode-@var{app-model}}.
20572 @end table
20574 @node MIPS Options
20575 @subsection MIPS Options
20576 @cindex MIPS options
20578 @table @gcctabopt
20580 @item -EB
20581 @opindex EB
20582 Generate big-endian code.
20584 @item -EL
20585 @opindex EL
20586 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
20587 configurations.
20589 @item -march=@var{arch}
20590 @opindex march
20591 Generate code that runs on @var{arch}, which can be the name of a
20592 generic MIPS ISA, or the name of a particular processor.
20593 The ISA names are:
20594 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
20595 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
20596 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
20597 @samp{mips64r5} and @samp{mips64r6}.
20598 The processor names are:
20599 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
20600 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
20601 @samp{5kc}, @samp{5kf},
20602 @samp{20kc},
20603 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
20604 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
20605 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
20606 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
20607 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
20608 @samp{i6400}, @samp{i6500},
20609 @samp{interaptiv},
20610 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
20611 @samp{m4k},
20612 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
20613 @samp{m5100}, @samp{m5101},
20614 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
20615 @samp{orion},
20616 @samp{p5600}, @samp{p6600},
20617 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
20618 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
20619 @samp{rm7000}, @samp{rm9000},
20620 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
20621 @samp{sb1},
20622 @samp{sr71000},
20623 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
20624 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
20625 @samp{xlr} and @samp{xlp}.
20626 The special value @samp{from-abi} selects the
20627 most compatible architecture for the selected ABI (that is,
20628 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
20630 The native Linux/GNU toolchain also supports the value @samp{native},
20631 which selects the best architecture option for the host processor.
20632 @option{-march=native} has no effect if GCC does not recognize
20633 the processor.
20635 In processor names, a final @samp{000} can be abbreviated as @samp{k}
20636 (for example, @option{-march=r2k}).  Prefixes are optional, and
20637 @samp{vr} may be written @samp{r}.
20639 Names of the form @samp{@var{n}f2_1} refer to processors with
20640 FPUs clocked at half the rate of the core, names of the form
20641 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
20642 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
20643 processors with FPUs clocked a ratio of 3:2 with respect to the core.
20644 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
20645 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
20646 accepted as synonyms for @samp{@var{n}f1_1}.
20648 GCC defines two macros based on the value of this option.  The first
20649 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
20650 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
20651 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
20652 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
20653 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
20655 Note that the @code{_MIPS_ARCH} macro uses the processor names given
20656 above.  In other words, it has the full prefix and does not
20657 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
20658 the macro names the resolved architecture (either @code{"mips1"} or
20659 @code{"mips3"}).  It names the default architecture when no
20660 @option{-march} option is given.
20662 @item -mtune=@var{arch}
20663 @opindex mtune
20664 Optimize for @var{arch}.  Among other things, this option controls
20665 the way instructions are scheduled, and the perceived cost of arithmetic
20666 operations.  The list of @var{arch} values is the same as for
20667 @option{-march}.
20669 When this option is not used, GCC optimizes for the processor
20670 specified by @option{-march}.  By using @option{-march} and
20671 @option{-mtune} together, it is possible to generate code that
20672 runs on a family of processors, but optimize the code for one
20673 particular member of that family.
20675 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
20676 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
20677 @option{-march} ones described above.
20679 @item -mips1
20680 @opindex mips1
20681 Equivalent to @option{-march=mips1}.
20683 @item -mips2
20684 @opindex mips2
20685 Equivalent to @option{-march=mips2}.
20687 @item -mips3
20688 @opindex mips3
20689 Equivalent to @option{-march=mips3}.
20691 @item -mips4
20692 @opindex mips4
20693 Equivalent to @option{-march=mips4}.
20695 @item -mips32
20696 @opindex mips32
20697 Equivalent to @option{-march=mips32}.
20699 @item -mips32r3
20700 @opindex mips32r3
20701 Equivalent to @option{-march=mips32r3}.
20703 @item -mips32r5
20704 @opindex mips32r5
20705 Equivalent to @option{-march=mips32r5}.
20707 @item -mips32r6
20708 @opindex mips32r6
20709 Equivalent to @option{-march=mips32r6}.
20711 @item -mips64
20712 @opindex mips64
20713 Equivalent to @option{-march=mips64}.
20715 @item -mips64r2
20716 @opindex mips64r2
20717 Equivalent to @option{-march=mips64r2}.
20719 @item -mips64r3
20720 @opindex mips64r3
20721 Equivalent to @option{-march=mips64r3}.
20723 @item -mips64r5
20724 @opindex mips64r5
20725 Equivalent to @option{-march=mips64r5}.
20727 @item -mips64r6
20728 @opindex mips64r6
20729 Equivalent to @option{-march=mips64r6}.
20731 @item -mips16
20732 @itemx -mno-mips16
20733 @opindex mips16
20734 @opindex mno-mips16
20735 Generate (do not generate) MIPS16 code.  If GCC is targeting a
20736 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
20738 MIPS16 code generation can also be controlled on a per-function basis
20739 by means of @code{mips16} and @code{nomips16} attributes.
20740 @xref{Function Attributes}, for more information.
20742 @item -mflip-mips16
20743 @opindex mflip-mips16
20744 Generate MIPS16 code on alternating functions.  This option is provided
20745 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
20746 not intended for ordinary use in compiling user code.
20748 @item -minterlink-compressed
20749 @itemx -mno-interlink-compressed
20750 @opindex minterlink-compressed
20751 @opindex mno-interlink-compressed
20752 Require (do not require) that code using the standard (uncompressed) MIPS ISA
20753 be link-compatible with MIPS16 and microMIPS code, and vice versa.
20755 For example, code using the standard ISA encoding cannot jump directly
20756 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
20757 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
20758 knows that the target of the jump is not compressed.
20760 @item -minterlink-mips16
20761 @itemx -mno-interlink-mips16
20762 @opindex minterlink-mips16
20763 @opindex mno-interlink-mips16
20764 Aliases of @option{-minterlink-compressed} and
20765 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
20766 and are retained for backwards compatibility.
20768 @item -mabi=32
20769 @itemx -mabi=o64
20770 @itemx -mabi=n32
20771 @itemx -mabi=64
20772 @itemx -mabi=eabi
20773 @opindex mabi=32
20774 @opindex mabi=o64
20775 @opindex mabi=n32
20776 @opindex mabi=64
20777 @opindex mabi=eabi
20778 Generate code for the given ABI@.
20780 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
20781 generates 64-bit code when you select a 64-bit architecture, but you
20782 can use @option{-mgp32} to get 32-bit code instead.
20784 For information about the O64 ABI, see
20785 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
20787 GCC supports a variant of the o32 ABI in which floating-point registers
20788 are 64 rather than 32 bits wide.  You can select this combination with
20789 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
20790 and @code{mfhc1} instructions and is therefore only supported for
20791 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
20793 The register assignments for arguments and return values remain the
20794 same, but each scalar value is passed in a single 64-bit register
20795 rather than a pair of 32-bit registers.  For example, scalar
20796 floating-point values are returned in @samp{$f0} only, not a
20797 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
20798 remains the same in that the even-numbered double-precision registers
20799 are saved.
20801 Two additional variants of the o32 ABI are supported to enable
20802 a transition from 32-bit to 64-bit registers.  These are FPXX
20803 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
20804 The FPXX extension mandates that all code must execute correctly
20805 when run using 32-bit or 64-bit registers.  The code can be interlinked
20806 with either FP32 or FP64, but not both.
20807 The FP64A extension is similar to the FP64 extension but forbids the
20808 use of odd-numbered single-precision registers.  This can be used
20809 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
20810 processors and allows both FP32 and FP64A code to interlink and
20811 run in the same process without changing FPU modes.
20813 @item -mabicalls
20814 @itemx -mno-abicalls
20815 @opindex mabicalls
20816 @opindex mno-abicalls
20817 Generate (do not generate) code that is suitable for SVR4-style
20818 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
20819 systems.
20821 @item -mshared
20822 @itemx -mno-shared
20823 Generate (do not generate) code that is fully position-independent,
20824 and that can therefore be linked into shared libraries.  This option
20825 only affects @option{-mabicalls}.
20827 All @option{-mabicalls} code has traditionally been position-independent,
20828 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
20829 as an extension, the GNU toolchain allows executables to use absolute
20830 accesses for locally-binding symbols.  It can also use shorter GP
20831 initialization sequences and generate direct calls to locally-defined
20832 functions.  This mode is selected by @option{-mno-shared}.
20834 @option{-mno-shared} depends on binutils 2.16 or higher and generates
20835 objects that can only be linked by the GNU linker.  However, the option
20836 does not affect the ABI of the final executable; it only affects the ABI
20837 of relocatable objects.  Using @option{-mno-shared} generally makes
20838 executables both smaller and quicker.
20840 @option{-mshared} is the default.
20842 @item -mplt
20843 @itemx -mno-plt
20844 @opindex mplt
20845 @opindex mno-plt
20846 Assume (do not assume) that the static and dynamic linkers
20847 support PLTs and copy relocations.  This option only affects
20848 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
20849 has no effect without @option{-msym32}.
20851 You can make @option{-mplt} the default by configuring
20852 GCC with @option{--with-mips-plt}.  The default is
20853 @option{-mno-plt} otherwise.
20855 @item -mxgot
20856 @itemx -mno-xgot
20857 @opindex mxgot
20858 @opindex mno-xgot
20859 Lift (do not lift) the usual restrictions on the size of the global
20860 offset table.
20862 GCC normally uses a single instruction to load values from the GOT@.
20863 While this is relatively efficient, it only works if the GOT
20864 is smaller than about 64k.  Anything larger causes the linker
20865 to report an error such as:
20867 @cindex relocation truncated to fit (MIPS)
20868 @smallexample
20869 relocation truncated to fit: R_MIPS_GOT16 foobar
20870 @end smallexample
20872 If this happens, you should recompile your code with @option{-mxgot}.
20873 This works with very large GOTs, although the code is also
20874 less efficient, since it takes three instructions to fetch the
20875 value of a global symbol.
20877 Note that some linkers can create multiple GOTs.  If you have such a
20878 linker, you should only need to use @option{-mxgot} when a single object
20879 file accesses more than 64k's worth of GOT entries.  Very few do.
20881 These options have no effect unless GCC is generating position
20882 independent code.
20884 @item -mgp32
20885 @opindex mgp32
20886 Assume that general-purpose registers are 32 bits wide.
20888 @item -mgp64
20889 @opindex mgp64
20890 Assume that general-purpose registers are 64 bits wide.
20892 @item -mfp32
20893 @opindex mfp32
20894 Assume that floating-point registers are 32 bits wide.
20896 @item -mfp64
20897 @opindex mfp64
20898 Assume that floating-point registers are 64 bits wide.
20900 @item -mfpxx
20901 @opindex mfpxx
20902 Do not assume the width of floating-point registers.
20904 @item -mhard-float
20905 @opindex mhard-float
20906 Use floating-point coprocessor instructions.
20908 @item -msoft-float
20909 @opindex msoft-float
20910 Do not use floating-point coprocessor instructions.  Implement
20911 floating-point calculations using library calls instead.
20913 @item -mno-float
20914 @opindex mno-float
20915 Equivalent to @option{-msoft-float}, but additionally asserts that the
20916 program being compiled does not perform any floating-point operations.
20917 This option is presently supported only by some bare-metal MIPS
20918 configurations, where it may select a special set of libraries
20919 that lack all floating-point support (including, for example, the
20920 floating-point @code{printf} formats).  
20921 If code compiled with @option{-mno-float} accidentally contains
20922 floating-point operations, it is likely to suffer a link-time
20923 or run-time failure.
20925 @item -msingle-float
20926 @opindex msingle-float
20927 Assume that the floating-point coprocessor only supports single-precision
20928 operations.
20930 @item -mdouble-float
20931 @opindex mdouble-float
20932 Assume that the floating-point coprocessor supports double-precision
20933 operations.  This is the default.
20935 @item -modd-spreg
20936 @itemx -mno-odd-spreg
20937 @opindex modd-spreg
20938 @opindex mno-odd-spreg
20939 Enable the use of odd-numbered single-precision floating-point registers
20940 for the o32 ABI.  This is the default for processors that are known to
20941 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
20942 is set by default.
20944 @item -mabs=2008
20945 @itemx -mabs=legacy
20946 @opindex mabs=2008
20947 @opindex mabs=legacy
20948 These options control the treatment of the special not-a-number (NaN)
20949 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
20950 @code{neg.@i{fmt}} machine instructions.
20952 By default or when @option{-mabs=legacy} is used the legacy
20953 treatment is selected.  In this case these instructions are considered
20954 arithmetic and avoided where correct operation is required and the
20955 input operand might be a NaN.  A longer sequence of instructions that
20956 manipulate the sign bit of floating-point datum manually is used
20957 instead unless the @option{-ffinite-math-only} option has also been
20958 specified.
20960 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
20961 this case these instructions are considered non-arithmetic and therefore
20962 operating correctly in all cases, including in particular where the
20963 input operand is a NaN.  These instructions are therefore always used
20964 for the respective operations.
20966 @item -mnan=2008
20967 @itemx -mnan=legacy
20968 @opindex mnan=2008
20969 @opindex mnan=legacy
20970 These options control the encoding of the special not-a-number (NaN)
20971 IEEE 754 floating-point data.
20973 The @option{-mnan=legacy} option selects the legacy encoding.  In this
20974 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
20975 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
20976 by the first bit of their trailing significand field being 1.
20978 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
20979 this case qNaNs are denoted by the first bit of their trailing
20980 significand field being 1, whereas sNaNs are denoted by the first bit of
20981 their trailing significand field being 0.
20983 The default is @option{-mnan=legacy} unless GCC has been configured with
20984 @option{--with-nan=2008}.
20986 @item -mllsc
20987 @itemx -mno-llsc
20988 @opindex mllsc
20989 @opindex mno-llsc
20990 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
20991 implement atomic memory built-in functions.  When neither option is
20992 specified, GCC uses the instructions if the target architecture
20993 supports them.
20995 @option{-mllsc} is useful if the runtime environment can emulate the
20996 instructions and @option{-mno-llsc} can be useful when compiling for
20997 nonstandard ISAs.  You can make either option the default by
20998 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
20999 respectively.  @option{--with-llsc} is the default for some
21000 configurations; see the installation documentation for details.
21002 @item -mdsp
21003 @itemx -mno-dsp
21004 @opindex mdsp
21005 @opindex mno-dsp
21006 Use (do not use) revision 1 of the MIPS DSP ASE@.
21007 @xref{MIPS DSP Built-in Functions}.  This option defines the
21008 preprocessor macro @code{__mips_dsp}.  It also defines
21009 @code{__mips_dsp_rev} to 1.
21011 @item -mdspr2
21012 @itemx -mno-dspr2
21013 @opindex mdspr2
21014 @opindex mno-dspr2
21015 Use (do not use) revision 2 of the MIPS DSP ASE@.
21016 @xref{MIPS DSP Built-in Functions}.  This option defines the
21017 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
21018 It also defines @code{__mips_dsp_rev} to 2.
21020 @item -msmartmips
21021 @itemx -mno-smartmips
21022 @opindex msmartmips
21023 @opindex mno-smartmips
21024 Use (do not use) the MIPS SmartMIPS ASE.
21026 @item -mpaired-single
21027 @itemx -mno-paired-single
21028 @opindex mpaired-single
21029 @opindex mno-paired-single
21030 Use (do not use) paired-single floating-point instructions.
21031 @xref{MIPS Paired-Single Support}.  This option requires
21032 hardware floating-point support to be enabled.
21034 @item -mdmx
21035 @itemx -mno-mdmx
21036 @opindex mdmx
21037 @opindex mno-mdmx
21038 Use (do not use) MIPS Digital Media Extension instructions.
21039 This option can only be used when generating 64-bit code and requires
21040 hardware floating-point support to be enabled.
21042 @item -mips3d
21043 @itemx -mno-mips3d
21044 @opindex mips3d
21045 @opindex mno-mips3d
21046 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
21047 The option @option{-mips3d} implies @option{-mpaired-single}.
21049 @item -mmicromips
21050 @itemx -mno-micromips
21051 @opindex mmicromips
21052 @opindex mno-mmicromips
21053 Generate (do not generate) microMIPS code.
21055 MicroMIPS code generation can also be controlled on a per-function basis
21056 by means of @code{micromips} and @code{nomicromips} attributes.
21057 @xref{Function Attributes}, for more information.
21059 @item -mmt
21060 @itemx -mno-mt
21061 @opindex mmt
21062 @opindex mno-mt
21063 Use (do not use) MT Multithreading instructions.
21065 @item -mmcu
21066 @itemx -mno-mcu
21067 @opindex mmcu
21068 @opindex mno-mcu
21069 Use (do not use) the MIPS MCU ASE instructions.
21071 @item -meva
21072 @itemx -mno-eva
21073 @opindex meva
21074 @opindex mno-eva
21075 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
21077 @item -mvirt
21078 @itemx -mno-virt
21079 @opindex mvirt
21080 @opindex mno-virt
21081 Use (do not use) the MIPS Virtualization (VZ) instructions.
21083 @item -mxpa
21084 @itemx -mno-xpa
21085 @opindex mxpa
21086 @opindex mno-xpa
21087 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
21089 @item -mcrc
21090 @itemx -mno-crc
21091 @opindex mcrc
21092 @opindex mno-crc
21093 Use (do not use) the MIPS Cyclic Redundancy Check (CRC) instructions.
21095 @item -mginv
21096 @itemx -mno-ginv
21097 @opindex mginv
21098 @opindex mno-ginv
21099 Use (do not use) the MIPS Global INValidate (GINV) instructions.
21101 @item -mlong64
21102 @opindex mlong64
21103 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
21104 an explanation of the default and the way that the pointer size is
21105 determined.
21107 @item -mlong32
21108 @opindex mlong32
21109 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
21111 The default size of @code{int}s, @code{long}s and pointers depends on
21112 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
21113 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
21114 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
21115 or the same size as integer registers, whichever is smaller.
21117 @item -msym32
21118 @itemx -mno-sym32
21119 @opindex msym32
21120 @opindex mno-sym32
21121 Assume (do not assume) that all symbols have 32-bit values, regardless
21122 of the selected ABI@.  This option is useful in combination with
21123 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
21124 to generate shorter and faster references to symbolic addresses.
21126 @item -G @var{num}
21127 @opindex G
21128 Put definitions of externally-visible data in a small data section
21129 if that data is no bigger than @var{num} bytes.  GCC can then generate
21130 more efficient accesses to the data; see @option{-mgpopt} for details.
21132 The default @option{-G} option depends on the configuration.
21134 @item -mlocal-sdata
21135 @itemx -mno-local-sdata
21136 @opindex mlocal-sdata
21137 @opindex mno-local-sdata
21138 Extend (do not extend) the @option{-G} behavior to local data too,
21139 such as to static variables in C@.  @option{-mlocal-sdata} is the
21140 default for all configurations.
21142 If the linker complains that an application is using too much small data,
21143 you might want to try rebuilding the less performance-critical parts with
21144 @option{-mno-local-sdata}.  You might also want to build large
21145 libraries with @option{-mno-local-sdata}, so that the libraries leave
21146 more room for the main program.
21148 @item -mextern-sdata
21149 @itemx -mno-extern-sdata
21150 @opindex mextern-sdata
21151 @opindex mno-extern-sdata
21152 Assume (do not assume) that externally-defined data is in
21153 a small data section if the size of that data is within the @option{-G} limit.
21154 @option{-mextern-sdata} is the default for all configurations.
21156 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
21157 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
21158 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
21159 is placed in a small data section.  If @var{Var} is defined by another
21160 module, you must either compile that module with a high-enough
21161 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
21162 definition.  If @var{Var} is common, you must link the application
21163 with a high-enough @option{-G} setting.
21165 The easiest way of satisfying these restrictions is to compile
21166 and link every module with the same @option{-G} option.  However,
21167 you may wish to build a library that supports several different
21168 small data limits.  You can do this by compiling the library with
21169 the highest supported @option{-G} setting and additionally using
21170 @option{-mno-extern-sdata} to stop the library from making assumptions
21171 about externally-defined data.
21173 @item -mgpopt
21174 @itemx -mno-gpopt
21175 @opindex mgpopt
21176 @opindex mno-gpopt
21177 Use (do not use) GP-relative accesses for symbols that are known to be
21178 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
21179 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
21180 configurations.
21182 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
21183 might not hold the value of @code{_gp}.  For example, if the code is
21184 part of a library that might be used in a boot monitor, programs that
21185 call boot monitor routines pass an unknown value in @code{$gp}.
21186 (In such situations, the boot monitor itself is usually compiled
21187 with @option{-G0}.)
21189 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
21190 @option{-mno-extern-sdata}.
21192 @item -membedded-data
21193 @itemx -mno-embedded-data
21194 @opindex membedded-data
21195 @opindex mno-embedded-data
21196 Allocate variables to the read-only data section first if possible, then
21197 next in the small data section if possible, otherwise in data.  This gives
21198 slightly slower code than the default, but reduces the amount of RAM required
21199 when executing, and thus may be preferred for some embedded systems.
21201 @item -muninit-const-in-rodata
21202 @itemx -mno-uninit-const-in-rodata
21203 @opindex muninit-const-in-rodata
21204 @opindex mno-uninit-const-in-rodata
21205 Put uninitialized @code{const} variables in the read-only data section.
21206 This option is only meaningful in conjunction with @option{-membedded-data}.
21208 @item -mcode-readable=@var{setting}
21209 @opindex mcode-readable
21210 Specify whether GCC may generate code that reads from executable sections.
21211 There are three possible settings:
21213 @table @gcctabopt
21214 @item -mcode-readable=yes
21215 Instructions may freely access executable sections.  This is the
21216 default setting.
21218 @item -mcode-readable=pcrel
21219 MIPS16 PC-relative load instructions can access executable sections,
21220 but other instructions must not do so.  This option is useful on 4KSc
21221 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
21222 It is also useful on processors that can be configured to have a dual
21223 instruction/data SRAM interface and that, like the M4K, automatically
21224 redirect PC-relative loads to the instruction RAM.
21226 @item -mcode-readable=no
21227 Instructions must not access executable sections.  This option can be
21228 useful on targets that are configured to have a dual instruction/data
21229 SRAM interface but that (unlike the M4K) do not automatically redirect
21230 PC-relative loads to the instruction RAM.
21231 @end table
21233 @item -msplit-addresses
21234 @itemx -mno-split-addresses
21235 @opindex msplit-addresses
21236 @opindex mno-split-addresses
21237 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
21238 relocation operators.  This option has been superseded by
21239 @option{-mexplicit-relocs} but is retained for backwards compatibility.
21241 @item -mexplicit-relocs
21242 @itemx -mno-explicit-relocs
21243 @opindex mexplicit-relocs
21244 @opindex mno-explicit-relocs
21245 Use (do not use) assembler relocation operators when dealing with symbolic
21246 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
21247 is to use assembler macros instead.
21249 @option{-mexplicit-relocs} is the default if GCC was configured
21250 to use an assembler that supports relocation operators.
21252 @item -mcheck-zero-division
21253 @itemx -mno-check-zero-division
21254 @opindex mcheck-zero-division
21255 @opindex mno-check-zero-division
21256 Trap (do not trap) on integer division by zero.
21258 The default is @option{-mcheck-zero-division}.
21260 @item -mdivide-traps
21261 @itemx -mdivide-breaks
21262 @opindex mdivide-traps
21263 @opindex mdivide-breaks
21264 MIPS systems check for division by zero by generating either a
21265 conditional trap or a break instruction.  Using traps results in
21266 smaller code, but is only supported on MIPS II and later.  Also, some
21267 versions of the Linux kernel have a bug that prevents trap from
21268 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
21269 allow conditional traps on architectures that support them and
21270 @option{-mdivide-breaks} to force the use of breaks.
21272 The default is usually @option{-mdivide-traps}, but this can be
21273 overridden at configure time using @option{--with-divide=breaks}.
21274 Divide-by-zero checks can be completely disabled using
21275 @option{-mno-check-zero-division}.
21277 @item -mload-store-pairs
21278 @itemx -mno-load-store-pairs
21279 @opindex mload-store-pairs
21280 @opindex mno-load-store-pairs
21281 Enable (disable) an optimization that pairs consecutive load or store
21282 instructions to enable load/store bonding.  This option is enabled by
21283 default but only takes effect when the selected architecture is known
21284 to support bonding.
21286 @item -mmemcpy
21287 @itemx -mno-memcpy
21288 @opindex mmemcpy
21289 @opindex mno-memcpy
21290 Force (do not force) the use of @code{memcpy} for non-trivial block
21291 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
21292 most constant-sized copies.
21294 @item -mlong-calls
21295 @itemx -mno-long-calls
21296 @opindex mlong-calls
21297 @opindex mno-long-calls
21298 Disable (do not disable) use of the @code{jal} instruction.  Calling
21299 functions using @code{jal} is more efficient but requires the caller
21300 and callee to be in the same 256 megabyte segment.
21302 This option has no effect on abicalls code.  The default is
21303 @option{-mno-long-calls}.
21305 @item -mmad
21306 @itemx -mno-mad
21307 @opindex mmad
21308 @opindex mno-mad
21309 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
21310 instructions, as provided by the R4650 ISA@.
21312 @item -mimadd
21313 @itemx -mno-imadd
21314 @opindex mimadd
21315 @opindex mno-imadd
21316 Enable (disable) use of the @code{madd} and @code{msub} integer
21317 instructions.  The default is @option{-mimadd} on architectures
21318 that support @code{madd} and @code{msub} except for the 74k 
21319 architecture where it was found to generate slower code.
21321 @item -mfused-madd
21322 @itemx -mno-fused-madd
21323 @opindex mfused-madd
21324 @opindex mno-fused-madd
21325 Enable (disable) use of the floating-point multiply-accumulate
21326 instructions, when they are available.  The default is
21327 @option{-mfused-madd}.
21329 On the R8000 CPU when multiply-accumulate instructions are used,
21330 the intermediate product is calculated to infinite precision
21331 and is not subject to the FCSR Flush to Zero bit.  This may be
21332 undesirable in some circumstances.  On other processors the result
21333 is numerically identical to the equivalent computation using
21334 separate multiply, add, subtract and negate instructions.
21336 @item -nocpp
21337 @opindex nocpp
21338 Tell the MIPS assembler to not run its preprocessor over user
21339 assembler files (with a @samp{.s} suffix) when assembling them.
21341 @item -mfix-24k
21342 @itemx -mno-fix-24k
21343 @opindex mfix-24k
21344 @opindex mno-fix-24k
21345 Work around the 24K E48 (lost data on stores during refill) errata.
21346 The workarounds are implemented by the assembler rather than by GCC@.
21348 @item -mfix-r4000
21349 @itemx -mno-fix-r4000
21350 @opindex mfix-r4000
21351 @opindex mno-fix-r4000
21352 Work around certain R4000 CPU errata:
21353 @itemize @minus
21354 @item
21355 A double-word or a variable shift may give an incorrect result if executed
21356 immediately after starting an integer division.
21357 @item
21358 A double-word or a variable shift may give an incorrect result if executed
21359 while an integer multiplication is in progress.
21360 @item
21361 An integer division may give an incorrect result if started in a delay slot
21362 of a taken branch or a jump.
21363 @end itemize
21365 @item -mfix-r4400
21366 @itemx -mno-fix-r4400
21367 @opindex mfix-r4400
21368 @opindex mno-fix-r4400
21369 Work around certain R4400 CPU errata:
21370 @itemize @minus
21371 @item
21372 A double-word or a variable shift may give an incorrect result if executed
21373 immediately after starting an integer division.
21374 @end itemize
21376 @item -mfix-r10000
21377 @itemx -mno-fix-r10000
21378 @opindex mfix-r10000
21379 @opindex mno-fix-r10000
21380 Work around certain R10000 errata:
21381 @itemize @minus
21382 @item
21383 @code{ll}/@code{sc} sequences may not behave atomically on revisions
21384 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
21385 @end itemize
21387 This option can only be used if the target architecture supports
21388 branch-likely instructions.  @option{-mfix-r10000} is the default when
21389 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
21390 otherwise.
21392 @item -mfix-rm7000
21393 @itemx -mno-fix-rm7000
21394 @opindex mfix-rm7000
21395 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
21396 workarounds are implemented by the assembler rather than by GCC@.
21398 @item -mfix-vr4120
21399 @itemx -mno-fix-vr4120
21400 @opindex mfix-vr4120
21401 Work around certain VR4120 errata:
21402 @itemize @minus
21403 @item
21404 @code{dmultu} does not always produce the correct result.
21405 @item
21406 @code{div} and @code{ddiv} do not always produce the correct result if one
21407 of the operands is negative.
21408 @end itemize
21409 The workarounds for the division errata rely on special functions in
21410 @file{libgcc.a}.  At present, these functions are only provided by
21411 the @code{mips64vr*-elf} configurations.
21413 Other VR4120 errata require a NOP to be inserted between certain pairs of
21414 instructions.  These errata are handled by the assembler, not by GCC itself.
21416 @item -mfix-vr4130
21417 @opindex mfix-vr4130
21418 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
21419 workarounds are implemented by the assembler rather than by GCC,
21420 although GCC avoids using @code{mflo} and @code{mfhi} if the
21421 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
21422 instructions are available instead.
21424 @item -mfix-sb1
21425 @itemx -mno-fix-sb1
21426 @opindex mfix-sb1
21427 Work around certain SB-1 CPU core errata.
21428 (This flag currently works around the SB-1 revision 2
21429 ``F1'' and ``F2'' floating-point errata.)
21431 @item -mr10k-cache-barrier=@var{setting}
21432 @opindex mr10k-cache-barrier
21433 Specify whether GCC should insert cache barriers to avoid the
21434 side effects of speculation on R10K processors.
21436 In common with many processors, the R10K tries to predict the outcome
21437 of a conditional branch and speculatively executes instructions from
21438 the ``taken'' branch.  It later aborts these instructions if the
21439 predicted outcome is wrong.  However, on the R10K, even aborted
21440 instructions can have side effects.
21442 This problem only affects kernel stores and, depending on the system,
21443 kernel loads.  As an example, a speculatively-executed store may load
21444 the target memory into cache and mark the cache line as dirty, even if
21445 the store itself is later aborted.  If a DMA operation writes to the
21446 same area of memory before the ``dirty'' line is flushed, the cached
21447 data overwrites the DMA-ed data.  See the R10K processor manual
21448 for a full description, including other potential problems.
21450 One workaround is to insert cache barrier instructions before every memory
21451 access that might be speculatively executed and that might have side
21452 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
21453 controls GCC's implementation of this workaround.  It assumes that
21454 aborted accesses to any byte in the following regions does not have
21455 side effects:
21457 @enumerate
21458 @item
21459 the memory occupied by the current function's stack frame;
21461 @item
21462 the memory occupied by an incoming stack argument;
21464 @item
21465 the memory occupied by an object with a link-time-constant address.
21466 @end enumerate
21468 It is the kernel's responsibility to ensure that speculative
21469 accesses to these regions are indeed safe.
21471 If the input program contains a function declaration such as:
21473 @smallexample
21474 void foo (void);
21475 @end smallexample
21477 then the implementation of @code{foo} must allow @code{j foo} and
21478 @code{jal foo} to be executed speculatively.  GCC honors this
21479 restriction for functions it compiles itself.  It expects non-GCC
21480 functions (such as hand-written assembly code) to do the same.
21482 The option has three forms:
21484 @table @gcctabopt
21485 @item -mr10k-cache-barrier=load-store
21486 Insert a cache barrier before a load or store that might be
21487 speculatively executed and that might have side effects even
21488 if aborted.
21490 @item -mr10k-cache-barrier=store
21491 Insert a cache barrier before a store that might be speculatively
21492 executed and that might have side effects even if aborted.
21494 @item -mr10k-cache-barrier=none
21495 Disable the insertion of cache barriers.  This is the default setting.
21496 @end table
21498 @item -mflush-func=@var{func}
21499 @itemx -mno-flush-func
21500 @opindex mflush-func
21501 Specifies the function to call to flush the I and D caches, or to not
21502 call any such function.  If called, the function must take the same
21503 arguments as the common @code{_flush_func}, that is, the address of the
21504 memory range for which the cache is being flushed, the size of the
21505 memory range, and the number 3 (to flush both caches).  The default
21506 depends on the target GCC was configured for, but commonly is either
21507 @code{_flush_func} or @code{__cpu_flush}.
21509 @item mbranch-cost=@var{num}
21510 @opindex mbranch-cost
21511 Set the cost of branches to roughly @var{num} ``simple'' instructions.
21512 This cost is only a heuristic and is not guaranteed to produce
21513 consistent results across releases.  A zero cost redundantly selects
21514 the default, which is based on the @option{-mtune} setting.
21516 @item -mbranch-likely
21517 @itemx -mno-branch-likely
21518 @opindex mbranch-likely
21519 @opindex mno-branch-likely
21520 Enable or disable use of Branch Likely instructions, regardless of the
21521 default for the selected architecture.  By default, Branch Likely
21522 instructions may be generated if they are supported by the selected
21523 architecture.  An exception is for the MIPS32 and MIPS64 architectures
21524 and processors that implement those architectures; for those, Branch
21525 Likely instructions are not be generated by default because the MIPS32
21526 and MIPS64 architectures specifically deprecate their use.
21528 @item -mcompact-branches=never
21529 @itemx -mcompact-branches=optimal
21530 @itemx -mcompact-branches=always
21531 @opindex mcompact-branches=never
21532 @opindex mcompact-branches=optimal
21533 @opindex mcompact-branches=always
21534 These options control which form of branches will be generated.  The
21535 default is @option{-mcompact-branches=optimal}.
21537 The @option{-mcompact-branches=never} option ensures that compact branch
21538 instructions will never be generated.
21540 The @option{-mcompact-branches=always} option ensures that a compact
21541 branch instruction will be generated if available.  If a compact branch
21542 instruction is not available, a delay slot form of the branch will be
21543 used instead.
21545 This option is supported from MIPS Release 6 onwards.
21547 The @option{-mcompact-branches=optimal} option will cause a delay slot
21548 branch to be used if one is available in the current ISA and the delay
21549 slot is successfully filled.  If the delay slot is not filled, a compact
21550 branch will be chosen if one is available.
21552 @item -mfp-exceptions
21553 @itemx -mno-fp-exceptions
21554 @opindex mfp-exceptions
21555 Specifies whether FP exceptions are enabled.  This affects how
21556 FP instructions are scheduled for some processors.
21557 The default is that FP exceptions are
21558 enabled.
21560 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
21561 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
21562 FP pipe.
21564 @item -mvr4130-align
21565 @itemx -mno-vr4130-align
21566 @opindex mvr4130-align
21567 The VR4130 pipeline is two-way superscalar, but can only issue two
21568 instructions together if the first one is 8-byte aligned.  When this
21569 option is enabled, GCC aligns pairs of instructions that it
21570 thinks should execute in parallel.
21572 This option only has an effect when optimizing for the VR4130.
21573 It normally makes code faster, but at the expense of making it bigger.
21574 It is enabled by default at optimization level @option{-O3}.
21576 @item -msynci
21577 @itemx -mno-synci
21578 @opindex msynci
21579 Enable (disable) generation of @code{synci} instructions on
21580 architectures that support it.  The @code{synci} instructions (if
21581 enabled) are generated when @code{__builtin___clear_cache} is
21582 compiled.
21584 This option defaults to @option{-mno-synci}, but the default can be
21585 overridden by configuring GCC with @option{--with-synci}.
21587 When compiling code for single processor systems, it is generally safe
21588 to use @code{synci}.  However, on many multi-core (SMP) systems, it
21589 does not invalidate the instruction caches on all cores and may lead
21590 to undefined behavior.
21592 @item -mrelax-pic-calls
21593 @itemx -mno-relax-pic-calls
21594 @opindex mrelax-pic-calls
21595 Try to turn PIC calls that are normally dispatched via register
21596 @code{$25} into direct calls.  This is only possible if the linker can
21597 resolve the destination at link time and if the destination is within
21598 range for a direct call.
21600 @option{-mrelax-pic-calls} is the default if GCC was configured to use
21601 an assembler and a linker that support the @code{.reloc} assembly
21602 directive and @option{-mexplicit-relocs} is in effect.  With
21603 @option{-mno-explicit-relocs}, this optimization can be performed by the
21604 assembler and the linker alone without help from the compiler.
21606 @item -mmcount-ra-address
21607 @itemx -mno-mcount-ra-address
21608 @opindex mmcount-ra-address
21609 @opindex mno-mcount-ra-address
21610 Emit (do not emit) code that allows @code{_mcount} to modify the
21611 calling function's return address.  When enabled, this option extends
21612 the usual @code{_mcount} interface with a new @var{ra-address}
21613 parameter, which has type @code{intptr_t *} and is passed in register
21614 @code{$12}.  @code{_mcount} can then modify the return address by
21615 doing both of the following:
21616 @itemize
21617 @item
21618 Returning the new address in register @code{$31}.
21619 @item
21620 Storing the new address in @code{*@var{ra-address}},
21621 if @var{ra-address} is nonnull.
21622 @end itemize
21624 The default is @option{-mno-mcount-ra-address}.
21626 @item -mframe-header-opt
21627 @itemx -mno-frame-header-opt
21628 @opindex mframe-header-opt
21629 Enable (disable) frame header optimization in the o32 ABI.  When using the
21630 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
21631 function to write out register arguments.  When enabled, this optimization
21632 will suppress the allocation of the frame header if it can be determined that
21633 it is unused.
21635 This optimization is off by default at all optimization levels.
21637 @item -mlxc1-sxc1
21638 @itemx -mno-lxc1-sxc1
21639 @opindex mlxc1-sxc1
21640 When applicable, enable (disable) the generation of @code{lwxc1},
21641 @code{swxc1}, @code{ldxc1}, @code{sdxc1} instructions.  Enabled by default.
21643 @item -mmadd4
21644 @itemx -mno-madd4
21645 @opindex mmadd4
21646 When applicable, enable (disable) the generation of 4-operand @code{madd.s},
21647 @code{madd.d} and related instructions.  Enabled by default.
21649 @end table
21651 @node MMIX Options
21652 @subsection MMIX Options
21653 @cindex MMIX Options
21655 These options are defined for the MMIX:
21657 @table @gcctabopt
21658 @item -mlibfuncs
21659 @itemx -mno-libfuncs
21660 @opindex mlibfuncs
21661 @opindex mno-libfuncs
21662 Specify that intrinsic library functions are being compiled, passing all
21663 values in registers, no matter the size.
21665 @item -mepsilon
21666 @itemx -mno-epsilon
21667 @opindex mepsilon
21668 @opindex mno-epsilon
21669 Generate floating-point comparison instructions that compare with respect
21670 to the @code{rE} epsilon register.
21672 @item -mabi=mmixware
21673 @itemx -mabi=gnu
21674 @opindex mabi=mmixware
21675 @opindex mabi=gnu
21676 Generate code that passes function parameters and return values that (in
21677 the called function) are seen as registers @code{$0} and up, as opposed to
21678 the GNU ABI which uses global registers @code{$231} and up.
21680 @item -mzero-extend
21681 @itemx -mno-zero-extend
21682 @opindex mzero-extend
21683 @opindex mno-zero-extend
21684 When reading data from memory in sizes shorter than 64 bits, use (do not
21685 use) zero-extending load instructions by default, rather than
21686 sign-extending ones.
21688 @item -mknuthdiv
21689 @itemx -mno-knuthdiv
21690 @opindex mknuthdiv
21691 @opindex mno-knuthdiv
21692 Make the result of a division yielding a remainder have the same sign as
21693 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
21694 remainder follows the sign of the dividend.  Both methods are
21695 arithmetically valid, the latter being almost exclusively used.
21697 @item -mtoplevel-symbols
21698 @itemx -mno-toplevel-symbols
21699 @opindex mtoplevel-symbols
21700 @opindex mno-toplevel-symbols
21701 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
21702 code can be used with the @code{PREFIX} assembly directive.
21704 @item -melf
21705 @opindex melf
21706 Generate an executable in the ELF format, rather than the default
21707 @samp{mmo} format used by the @command{mmix} simulator.
21709 @item -mbranch-predict
21710 @itemx -mno-branch-predict
21711 @opindex mbranch-predict
21712 @opindex mno-branch-predict
21713 Use (do not use) the probable-branch instructions, when static branch
21714 prediction indicates a probable branch.
21716 @item -mbase-addresses
21717 @itemx -mno-base-addresses
21718 @opindex mbase-addresses
21719 @opindex mno-base-addresses
21720 Generate (do not generate) code that uses @emph{base addresses}.  Using a
21721 base address automatically generates a request (handled by the assembler
21722 and the linker) for a constant to be set up in a global register.  The
21723 register is used for one or more base address requests within the range 0
21724 to 255 from the value held in the register.  The generally leads to short
21725 and fast code, but the number of different data items that can be
21726 addressed is limited.  This means that a program that uses lots of static
21727 data may require @option{-mno-base-addresses}.
21729 @item -msingle-exit
21730 @itemx -mno-single-exit
21731 @opindex msingle-exit
21732 @opindex mno-single-exit
21733 Force (do not force) generated code to have a single exit point in each
21734 function.
21735 @end table
21737 @node MN10300 Options
21738 @subsection MN10300 Options
21739 @cindex MN10300 options
21741 These @option{-m} options are defined for Matsushita MN10300 architectures:
21743 @table @gcctabopt
21744 @item -mmult-bug
21745 @opindex mmult-bug
21746 Generate code to avoid bugs in the multiply instructions for the MN10300
21747 processors.  This is the default.
21749 @item -mno-mult-bug
21750 @opindex mno-mult-bug
21751 Do not generate code to avoid bugs in the multiply instructions for the
21752 MN10300 processors.
21754 @item -mam33
21755 @opindex mam33
21756 Generate code using features specific to the AM33 processor.
21758 @item -mno-am33
21759 @opindex mno-am33
21760 Do not generate code using features specific to the AM33 processor.  This
21761 is the default.
21763 @item -mam33-2
21764 @opindex mam33-2
21765 Generate code using features specific to the AM33/2.0 processor.
21767 @item -mam34
21768 @opindex mam34
21769 Generate code using features specific to the AM34 processor.
21771 @item -mtune=@var{cpu-type}
21772 @opindex mtune
21773 Use the timing characteristics of the indicated CPU type when
21774 scheduling instructions.  This does not change the targeted processor
21775 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
21776 @samp{am33-2} or @samp{am34}.
21778 @item -mreturn-pointer-on-d0
21779 @opindex mreturn-pointer-on-d0
21780 When generating a function that returns a pointer, return the pointer
21781 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
21782 only in @code{a0}, and attempts to call such functions without a prototype
21783 result in errors.  Note that this option is on by default; use
21784 @option{-mno-return-pointer-on-d0} to disable it.
21786 @item -mno-crt0
21787 @opindex mno-crt0
21788 Do not link in the C run-time initialization object file.
21790 @item -mrelax
21791 @opindex mrelax
21792 Indicate to the linker that it should perform a relaxation optimization pass
21793 to shorten branches, calls and absolute memory addresses.  This option only
21794 has an effect when used on the command line for the final link step.
21796 This option makes symbolic debugging impossible.
21798 @item -mliw
21799 @opindex mliw
21800 Allow the compiler to generate @emph{Long Instruction Word}
21801 instructions if the target is the @samp{AM33} or later.  This is the
21802 default.  This option defines the preprocessor macro @code{__LIW__}.
21804 @item -mnoliw
21805 @opindex mnoliw
21806 Do not allow the compiler to generate @emph{Long Instruction Word}
21807 instructions.  This option defines the preprocessor macro
21808 @code{__NO_LIW__}.
21810 @item -msetlb
21811 @opindex msetlb
21812 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
21813 instructions if the target is the @samp{AM33} or later.  This is the
21814 default.  This option defines the preprocessor macro @code{__SETLB__}.
21816 @item -mnosetlb
21817 @opindex mnosetlb
21818 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
21819 instructions.  This option defines the preprocessor macro
21820 @code{__NO_SETLB__}.
21822 @end table
21824 @node Moxie Options
21825 @subsection Moxie Options
21826 @cindex Moxie Options
21828 @table @gcctabopt
21830 @item -meb
21831 @opindex meb
21832 Generate big-endian code.  This is the default for @samp{moxie-*-*}
21833 configurations.
21835 @item -mel
21836 @opindex mel
21837 Generate little-endian code.
21839 @item -mmul.x
21840 @opindex mmul.x
21841 Generate mul.x and umul.x instructions.  This is the default for
21842 @samp{moxiebox-*-*} configurations.
21844 @item -mno-crt0
21845 @opindex mno-crt0
21846 Do not link in the C run-time initialization object file.
21848 @end table
21850 @node MSP430 Options
21851 @subsection MSP430 Options
21852 @cindex MSP430 Options
21854 These options are defined for the MSP430:
21856 @table @gcctabopt
21858 @item -masm-hex
21859 @opindex masm-hex
21860 Force assembly output to always use hex constants.  Normally such
21861 constants are signed decimals, but this option is available for
21862 testsuite and/or aesthetic purposes.
21864 @item -mmcu=
21865 @opindex mmcu=
21866 Select the MCU to target.  This is used to create a C preprocessor
21867 symbol based upon the MCU name, converted to upper case and pre- and
21868 post-fixed with @samp{__}.  This in turn is used by the
21869 @file{msp430.h} header file to select an MCU-specific supplementary
21870 header file.
21872 The option also sets the ISA to use.  If the MCU name is one that is
21873 known to only support the 430 ISA then that is selected, otherwise the
21874 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
21875 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
21876 name selects the 430X ISA.
21878 In addition an MCU-specific linker script is added to the linker
21879 command line.  The script's name is the name of the MCU with
21880 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
21881 command line defines the C preprocessor symbol @code{__XXX__} and
21882 cause the linker to search for a script called @file{xxx.ld}.
21884 This option is also passed on to the assembler.
21886 @item -mwarn-mcu
21887 @itemx -mno-warn-mcu
21888 @opindex mwarn-mcu
21889 @opindex mno-warn-mcu
21890 This option enables or disables warnings about conflicts between the
21891 MCU name specified by the @option{-mmcu} option and the ISA set by the
21892 @option{-mcpu} option and/or the hardware multiply support set by the
21893 @option{-mhwmult} option.  It also toggles warnings about unrecognized
21894 MCU names.  This option is on by default.
21896 @item -mcpu=
21897 @opindex mcpu=
21898 Specifies the ISA to use.  Accepted values are @samp{msp430},
21899 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
21900 @option{-mmcu=} option should be used to select the ISA.
21902 @item -msim
21903 @opindex msim
21904 Link to the simulator runtime libraries and linker script.  Overrides
21905 any scripts that would be selected by the @option{-mmcu=} option.
21907 @item -mlarge
21908 @opindex mlarge
21909 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
21911 @item -msmall
21912 @opindex msmall
21913 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
21915 @item -mrelax
21916 @opindex mrelax
21917 This option is passed to the assembler and linker, and allows the
21918 linker to perform certain optimizations that cannot be done until
21919 the final link.
21921 @item mhwmult=
21922 @opindex mhwmult=
21923 Describes the type of hardware multiply supported by the target.
21924 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
21925 for the original 16-bit-only multiply supported by early MCUs.
21926 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
21927 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
21928 A value of @samp{auto} can also be given.  This tells GCC to deduce
21929 the hardware multiply support based upon the MCU name provided by the
21930 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
21931 the MCU name is not recognized then no hardware multiply support is
21932 assumed.  @code{auto} is the default setting.
21934 Hardware multiplies are normally performed by calling a library
21935 routine.  This saves space in the generated code.  When compiling at
21936 @option{-O3} or higher however the hardware multiplier is invoked
21937 inline.  This makes for bigger, but faster code.
21939 The hardware multiply routines disable interrupts whilst running and
21940 restore the previous interrupt state when they finish.  This makes
21941 them safe to use inside interrupt handlers as well as in normal code.
21943 @item -minrt
21944 @opindex minrt
21945 Enable the use of a minimum runtime environment - no static
21946 initializers or constructors.  This is intended for memory-constrained
21947 devices.  The compiler includes special symbols in some objects
21948 that tell the linker and runtime which code fragments are required.
21950 @item -mcode-region=
21951 @itemx -mdata-region=
21952 @opindex mcode-region
21953 @opindex mdata-region
21954 These options tell the compiler where to place functions and data that
21955 do not have one of the @code{lower}, @code{upper}, @code{either} or
21956 @code{section} attributes.  Possible values are @code{lower},
21957 @code{upper}, @code{either} or @code{any}.  The first three behave
21958 like the corresponding attribute.  The fourth possible value -
21959 @code{any} - is the default.  It leaves placement entirely up to the
21960 linker script and how it assigns the standard sections
21961 (@code{.text}, @code{.data}, etc) to the memory regions.
21963 @item -msilicon-errata=
21964 @opindex msilicon-errata
21965 This option passes on a request to assembler to enable the fixes for
21966 the named silicon errata.
21968 @item -msilicon-errata-warn=
21969 @opindex msilicon-errata-warn
21970 This option passes on a request to the assembler to enable warning
21971 messages when a silicon errata might need to be applied.
21973 @end table
21975 @node NDS32 Options
21976 @subsection NDS32 Options
21977 @cindex NDS32 Options
21979 These options are defined for NDS32 implementations:
21981 @table @gcctabopt
21983 @item -mbig-endian
21984 @opindex mbig-endian
21985 Generate code in big-endian mode.
21987 @item -mlittle-endian
21988 @opindex mlittle-endian
21989 Generate code in little-endian mode.
21991 @item -mreduced-regs
21992 @opindex mreduced-regs
21993 Use reduced-set registers for register allocation.
21995 @item -mfull-regs
21996 @opindex mfull-regs
21997 Use full-set registers for register allocation.
21999 @item -mcmov
22000 @opindex mcmov
22001 Generate conditional move instructions.
22003 @item -mno-cmov
22004 @opindex mno-cmov
22005 Do not generate conditional move instructions.
22007 @item -mext-perf
22008 @opindex mperf-ext
22009 Generate performance extension instructions.
22011 @item -mno-ext-perf
22012 @opindex mno-perf-ext
22013 Do not generate performance extension instructions.
22015 @item -mext-perf2
22016 @opindex mperf-ext
22017 Generate performance extension 2 instructions.
22019 @item -mno-ext-perf2
22020 @opindex mno-perf-ext
22021 Do not generate performance extension 2 instructions.
22023 @item -mext-string
22024 @opindex mperf-ext
22025 Generate string extension instructions.
22027 @item -mno-ext-string
22028 @opindex mno-perf-ext
22029 Do not generate string extension instructions.
22031 @item -mv3push
22032 @opindex mv3push
22033 Generate v3 push25/pop25 instructions.
22035 @item -mno-v3push
22036 @opindex mno-v3push
22037 Do not generate v3 push25/pop25 instructions.
22039 @item -m16-bit
22040 @opindex m16-bit
22041 Generate 16-bit instructions.
22043 @item -mno-16-bit
22044 @opindex mno-16-bit
22045 Do not generate 16-bit instructions.
22047 @item -misr-vector-size=@var{num}
22048 @opindex misr-vector-size
22049 Specify the size of each interrupt vector, which must be 4 or 16.
22051 @item -mcache-block-size=@var{num}
22052 @opindex mcache-block-size
22053 Specify the size of each cache block,
22054 which must be a power of 2 between 4 and 512.
22056 @item -march=@var{arch}
22057 @opindex march
22058 Specify the name of the target architecture.
22060 @item -mcmodel=@var{code-model}
22061 @opindex mcmodel
22062 Set the code model to one of
22063 @table @asis
22064 @item @samp{small}
22065 All the data and read-only data segments must be within 512KB addressing space.
22066 The text segment must be within 16MB addressing space.
22067 @item @samp{medium}
22068 The data segment must be within 512KB while the read-only data segment can be
22069 within 4GB addressing space.  The text segment should be still within 16MB
22070 addressing space.
22071 @item @samp{large}
22072 All the text and data segments can be within 4GB addressing space.
22073 @end table
22075 @item -mctor-dtor
22076 @opindex mctor-dtor
22077 Enable constructor/destructor feature.
22079 @item -mrelax
22080 @opindex mrelax
22081 Guide linker to relax instructions.
22083 @end table
22085 @node Nios II Options
22086 @subsection Nios II Options
22087 @cindex Nios II options
22088 @cindex Altera Nios II options
22090 These are the options defined for the Altera Nios II processor.
22092 @table @gcctabopt
22094 @item -G @var{num}
22095 @opindex G
22096 @cindex smaller data references
22097 Put global and static objects less than or equal to @var{num} bytes
22098 into the small data or BSS sections instead of the normal data or BSS
22099 sections.  The default value of @var{num} is 8.
22101 @item -mgpopt=@var{option}
22102 @itemx -mgpopt
22103 @itemx -mno-gpopt
22104 @opindex mgpopt
22105 @opindex mno-gpopt
22106 Generate (do not generate) GP-relative accesses.  The following 
22107 @var{option} names are recognized:
22109 @table @samp
22111 @item none
22112 Do not generate GP-relative accesses.
22114 @item local
22115 Generate GP-relative accesses for small data objects that are not 
22116 external, weak, or uninitialized common symbols.  
22117 Also use GP-relative addressing for objects that
22118 have been explicitly placed in a small data section via a @code{section}
22119 attribute.
22121 @item global
22122 As for @samp{local}, but also generate GP-relative accesses for
22123 small data objects that are external, weak, or common.  If you use this option,
22124 you must ensure that all parts of your program (including libraries) are
22125 compiled with the same @option{-G} setting.
22127 @item data
22128 Generate GP-relative accesses for all data objects in the program.  If you
22129 use this option, the entire data and BSS segments
22130 of your program must fit in 64K of memory and you must use an appropriate
22131 linker script to allocate them within the addressable range of the
22132 global pointer.
22134 @item all
22135 Generate GP-relative addresses for function pointers as well as data
22136 pointers.  If you use this option, the entire text, data, and BSS segments
22137 of your program must fit in 64K of memory and you must use an appropriate
22138 linker script to allocate them within the addressable range of the
22139 global pointer.
22141 @end table
22143 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
22144 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
22146 The default is @option{-mgpopt} except when @option{-fpic} or
22147 @option{-fPIC} is specified to generate position-independent code.
22148 Note that the Nios II ABI does not permit GP-relative accesses from
22149 shared libraries.
22151 You may need to specify @option{-mno-gpopt} explicitly when building
22152 programs that include large amounts of small data, including large
22153 GOT data sections.  In this case, the 16-bit offset for GP-relative
22154 addressing may not be large enough to allow access to the entire 
22155 small data section.
22157 @item -mgprel-sec=@var{regexp}
22158 @opindex mgprel-sec
22159 This option specifies additional section names that can be accessed via
22160 GP-relative addressing.  It is most useful in conjunction with 
22161 @code{section} attributes on variable declarations 
22162 (@pxref{Common Variable Attributes}) and a custom linker script.  
22163 The @var{regexp} is a POSIX Extended Regular Expression.
22165 This option does not affect the behavior of the @option{-G} option, and 
22166 the specified sections are in addition to the standard @code{.sdata}
22167 and @code{.sbss} small-data sections that are recognized by @option{-mgpopt}.
22169 @item -mr0rel-sec=@var{regexp}
22170 @opindex mr0rel-sec
22171 This option specifies names of sections that can be accessed via a 
22172 16-bit offset from @code{r0}; that is, in the low 32K or high 32K 
22173 of the 32-bit address space.  It is most useful in conjunction with 
22174 @code{section} attributes on variable declarations 
22175 (@pxref{Common Variable Attributes}) and a custom linker script.  
22176 The @var{regexp} is a POSIX Extended Regular Expression.
22178 In contrast to the use of GP-relative addressing for small data, 
22179 zero-based addressing is never generated by default and there are no 
22180 conventional section names used in standard linker scripts for sections
22181 in the low or high areas of memory.
22183 @item -mel
22184 @itemx -meb
22185 @opindex mel
22186 @opindex meb
22187 Generate little-endian (default) or big-endian (experimental) code,
22188 respectively.
22190 @item -march=@var{arch}
22191 @opindex march
22192 This specifies the name of the target Nios II architecture.  GCC uses this
22193 name to determine what kind of instructions it can emit when generating
22194 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
22196 The preprocessor macro @code{__nios2_arch__} is available to programs,
22197 with value 1 or 2, indicating the targeted ISA level.
22199 @item -mbypass-cache
22200 @itemx -mno-bypass-cache
22201 @opindex mno-bypass-cache
22202 @opindex mbypass-cache
22203 Force all load and store instructions to always bypass cache by 
22204 using I/O variants of the instructions. The default is not to
22205 bypass the cache.
22207 @item -mno-cache-volatile 
22208 @itemx -mcache-volatile       
22209 @opindex mcache-volatile 
22210 @opindex mno-cache-volatile
22211 Volatile memory access bypass the cache using the I/O variants of 
22212 the load and store instructions. The default is not to bypass the cache.
22214 @item -mno-fast-sw-div
22215 @itemx -mfast-sw-div
22216 @opindex mno-fast-sw-div
22217 @opindex mfast-sw-div
22218 Do not use table-based fast divide for small numbers. The default 
22219 is to use the fast divide at @option{-O3} and above.
22221 @item -mno-hw-mul
22222 @itemx -mhw-mul
22223 @itemx -mno-hw-mulx
22224 @itemx -mhw-mulx
22225 @itemx -mno-hw-div
22226 @itemx -mhw-div
22227 @opindex mno-hw-mul
22228 @opindex mhw-mul
22229 @opindex mno-hw-mulx
22230 @opindex mhw-mulx
22231 @opindex mno-hw-div
22232 @opindex mhw-div
22233 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
22234 instructions by the compiler. The default is to emit @code{mul}
22235 and not emit @code{div} and @code{mulx}.
22237 @item -mbmx
22238 @itemx -mno-bmx
22239 @itemx -mcdx
22240 @itemx -mno-cdx
22241 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
22242 CDX (code density) instructions.  Enabling these instructions also
22243 requires @option{-march=r2}.  Since these instructions are optional
22244 extensions to the R2 architecture, the default is not to emit them.
22246 @item -mcustom-@var{insn}=@var{N}
22247 @itemx -mno-custom-@var{insn}
22248 @opindex mcustom-@var{insn}
22249 @opindex mno-custom-@var{insn}
22250 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
22251 custom instruction with encoding @var{N} when generating code that uses 
22252 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
22253 instruction 253 for single-precision floating-point add operations instead
22254 of the default behavior of using a library call.
22256 The following values of @var{insn} are supported.  Except as otherwise
22257 noted, floating-point operations are expected to be implemented with
22258 normal IEEE 754 semantics and correspond directly to the C operators or the
22259 equivalent GCC built-in functions (@pxref{Other Builtins}).
22261 Single-precision floating point:
22262 @table @asis
22264 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
22265 Binary arithmetic operations.
22267 @item @samp{fnegs}
22268 Unary negation.
22270 @item @samp{fabss}
22271 Unary absolute value.
22273 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
22274 Comparison operations.
22276 @item @samp{fmins}, @samp{fmaxs}
22277 Floating-point minimum and maximum.  These instructions are only
22278 generated if @option{-ffinite-math-only} is specified.
22280 @item @samp{fsqrts}
22281 Unary square root operation.
22283 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
22284 Floating-point trigonometric and exponential functions.  These instructions
22285 are only generated if @option{-funsafe-math-optimizations} is also specified.
22287 @end table
22289 Double-precision floating point:
22290 @table @asis
22292 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
22293 Binary arithmetic operations.
22295 @item @samp{fnegd}
22296 Unary negation.
22298 @item @samp{fabsd}
22299 Unary absolute value.
22301 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
22302 Comparison operations.
22304 @item @samp{fmind}, @samp{fmaxd}
22305 Double-precision minimum and maximum.  These instructions are only
22306 generated if @option{-ffinite-math-only} is specified.
22308 @item @samp{fsqrtd}
22309 Unary square root operation.
22311 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
22312 Double-precision trigonometric and exponential functions.  These instructions
22313 are only generated if @option{-funsafe-math-optimizations} is also specified.
22315 @end table
22317 Conversions:
22318 @table @asis
22319 @item @samp{fextsd}
22320 Conversion from single precision to double precision.
22322 @item @samp{ftruncds}
22323 Conversion from double precision to single precision.
22325 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
22326 Conversion from floating point to signed or unsigned integer types, with
22327 truncation towards zero.
22329 @item @samp{round}
22330 Conversion from single-precision floating point to signed integer,
22331 rounding to the nearest integer and ties away from zero.
22332 This corresponds to the @code{__builtin_lroundf} function when
22333 @option{-fno-math-errno} is used.
22335 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
22336 Conversion from signed or unsigned integer types to floating-point types.
22338 @end table
22340 In addition, all of the following transfer instructions for internal
22341 registers X and Y must be provided to use any of the double-precision
22342 floating-point instructions.  Custom instructions taking two
22343 double-precision source operands expect the first operand in the
22344 64-bit register X.  The other operand (or only operand of a unary
22345 operation) is given to the custom arithmetic instruction with the
22346 least significant half in source register @var{src1} and the most
22347 significant half in @var{src2}.  A custom instruction that returns a
22348 double-precision result returns the most significant 32 bits in the
22349 destination register and the other half in 32-bit register Y.  
22350 GCC automatically generates the necessary code sequences to write
22351 register X and/or read register Y when double-precision floating-point
22352 instructions are used.
22354 @table @asis
22356 @item @samp{fwrx}
22357 Write @var{src1} into the least significant half of X and @var{src2} into
22358 the most significant half of X.
22360 @item @samp{fwry}
22361 Write @var{src1} into Y.
22363 @item @samp{frdxhi}, @samp{frdxlo}
22364 Read the most or least (respectively) significant half of X and store it in
22365 @var{dest}.
22367 @item @samp{frdy}
22368 Read the value of Y and store it into @var{dest}.
22369 @end table
22371 Note that you can gain more local control over generation of Nios II custom
22372 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
22373 and @code{target("no-custom-@var{insn}")} function attributes
22374 (@pxref{Function Attributes})
22375 or pragmas (@pxref{Function Specific Option Pragmas}).
22377 @item -mcustom-fpu-cfg=@var{name}
22378 @opindex mcustom-fpu-cfg
22380 This option enables a predefined, named set of custom instruction encodings
22381 (see @option{-mcustom-@var{insn}} above).  
22382 Currently, the following sets are defined:
22384 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
22385 @gccoptlist{-mcustom-fmuls=252 @gol
22386 -mcustom-fadds=253 @gol
22387 -mcustom-fsubs=254 @gol
22388 -fsingle-precision-constant}
22390 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
22391 @gccoptlist{-mcustom-fmuls=252 @gol
22392 -mcustom-fadds=253 @gol
22393 -mcustom-fsubs=254 @gol
22394 -mcustom-fdivs=255 @gol
22395 -fsingle-precision-constant}
22397 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
22398 @gccoptlist{-mcustom-floatus=243 @gol
22399 -mcustom-fixsi=244 @gol
22400 -mcustom-floatis=245 @gol
22401 -mcustom-fcmpgts=246 @gol
22402 -mcustom-fcmples=249 @gol
22403 -mcustom-fcmpeqs=250 @gol
22404 -mcustom-fcmpnes=251 @gol
22405 -mcustom-fmuls=252 @gol
22406 -mcustom-fadds=253 @gol
22407 -mcustom-fsubs=254 @gol
22408 -mcustom-fdivs=255 @gol
22409 -fsingle-precision-constant}
22411 Custom instruction assignments given by individual
22412 @option{-mcustom-@var{insn}=} options override those given by
22413 @option{-mcustom-fpu-cfg=}, regardless of the
22414 order of the options on the command line.
22416 Note that you can gain more local control over selection of a FPU
22417 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
22418 function attribute (@pxref{Function Attributes})
22419 or pragma (@pxref{Function Specific Option Pragmas}).
22421 @end table
22423 These additional @samp{-m} options are available for the Altera Nios II
22424 ELF (bare-metal) target:
22426 @table @gcctabopt
22428 @item -mhal
22429 @opindex mhal
22430 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
22431 startup and termination code, and is typically used in conjunction with
22432 @option{-msys-crt0=} to specify the location of the alternate startup code
22433 provided by the HAL BSP.
22435 @item -msmallc
22436 @opindex msmallc
22437 Link with a limited version of the C library, @option{-lsmallc}, rather than
22438 Newlib.
22440 @item -msys-crt0=@var{startfile}
22441 @opindex msys-crt0
22442 @var{startfile} is the file name of the startfile (crt0) to use 
22443 when linking.  This option is only useful in conjunction with @option{-mhal}.
22445 @item -msys-lib=@var{systemlib}
22446 @opindex msys-lib
22447 @var{systemlib} is the library name of the library that provides
22448 low-level system calls required by the C library,
22449 e.g. @code{read} and @code{write}.
22450 This option is typically used to link with a library provided by a HAL BSP.
22452 @end table
22454 @node Nvidia PTX Options
22455 @subsection Nvidia PTX Options
22456 @cindex Nvidia PTX options
22457 @cindex nvptx options
22459 These options are defined for Nvidia PTX:
22461 @table @gcctabopt
22463 @item -m32
22464 @itemx -m64
22465 @opindex m32
22466 @opindex m64
22467 Generate code for 32-bit or 64-bit ABI.
22469 @item -misa=@var{ISA-string}
22470 @opindex march
22471 Generate code for given the specified PTX ISA (e.g.@ @samp{sm_35}).  ISA
22472 strings must be lower-case.  Valid ISA strings include @samp{sm_30} and
22473 @samp{sm_35}.  The default ISA is sm_30.
22475 @item -mmainkernel
22476 @opindex mmainkernel
22477 Link in code for a __main kernel.  This is for stand-alone instead of
22478 offloading execution.
22480 @item -moptimize
22481 @opindex moptimize
22482 Apply partitioned execution optimizations.  This is the default when any
22483 level of optimization is selected.
22485 @item -msoft-stack
22486 @opindex msoft-stack
22487 Generate code that does not use @code{.local} memory
22488 directly for stack storage. Instead, a per-warp stack pointer is
22489 maintained explicitly. This enables variable-length stack allocation (with
22490 variable-length arrays or @code{alloca}), and when global memory is used for
22491 underlying storage, makes it possible to access automatic variables from other
22492 threads, or with atomic instructions. This code generation variant is used
22493 for OpenMP offloading, but the option is exposed on its own for the purpose
22494 of testing the compiler; to generate code suitable for linking into programs
22495 using OpenMP offloading, use option @option{-mgomp}.
22497 @item -muniform-simt
22498 @opindex muniform-simt
22499 Switch to code generation variant that allows to execute all threads in each
22500 warp, while maintaining memory state and side effects as if only one thread
22501 in each warp was active outside of OpenMP SIMD regions.  All atomic operations
22502 and calls to runtime (malloc, free, vprintf) are conditionally executed (iff
22503 current lane index equals the master lane index), and the register being
22504 assigned is copied via a shuffle instruction from the master lane.  Outside of
22505 SIMD regions lane 0 is the master; inside, each thread sees itself as the
22506 master.  Shared memory array @code{int __nvptx_uni[]} stores all-zeros or
22507 all-ones bitmasks for each warp, indicating current mode (0 outside of SIMD
22508 regions).  Each thread can bitwise-and the bitmask at position @code{tid.y}
22509 with current lane index to compute the master lane index.
22511 @item -mgomp
22512 @opindex mgomp
22513 Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and
22514 @option{-muniform-simt} options, and selects corresponding multilib variant.
22516 @end table
22518 @node PDP-11 Options
22519 @subsection PDP-11 Options
22520 @cindex PDP-11 Options
22522 These options are defined for the PDP-11:
22524 @table @gcctabopt
22525 @item -mfpu
22526 @opindex mfpu
22527 Use hardware FPP floating point.  This is the default.  (FIS floating
22528 point on the PDP-11/40 is not supported.)  Implies -m45.
22530 @item -msoft-float
22531 @opindex msoft-float
22532 Do not use hardware floating point.
22534 @item -mac0
22535 @opindex mac0
22536 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
22538 @item -mno-ac0
22539 @opindex mno-ac0
22540 Return floating-point results in memory.  This is the default.
22542 @item -m40
22543 @opindex m40
22544 Generate code for a PDP-11/40.  Implies -msoft-float -mno-split.
22546 @item -m45
22547 @opindex m45
22548 Generate code for a PDP-11/45.  This is the default.
22550 @item -m10
22551 @opindex m10
22552 Generate code for a PDP-11/10.  Implies -msoft-float -mno-split.
22554 @item -mint16
22555 @itemx -mno-int32
22556 @opindex mint16
22557 @opindex mno-int32
22558 Use 16-bit @code{int}.  This is the default.
22560 @item -mint32
22561 @itemx -mno-int16
22562 @opindex mint32
22563 @opindex mno-int16
22564 Use 32-bit @code{int}.
22566 @item -mfloat64
22567 @itemx -mno-float32
22568 @opindex mfloat64
22569 @opindex mno-float32
22570 Use 64-bit @code{float}.  This is the default.
22572 @item -mfloat32
22573 @itemx -mno-float64
22574 @opindex mfloat32
22575 @opindex mno-float64
22576 Use 32-bit @code{float}.
22578 @item -msplit
22579 @opindex msplit
22580 Target has split instruction and data space.  Implies -m45.
22582 @item -munix-asm
22583 @opindex munix-asm
22584 Use Unix assembler syntax.
22586 @item -mdec-asm
22587 @opindex mdec-asm
22588 Use DEC assembler syntax.
22590 @item -mgnu-asm
22591 @opindex mgnu-asm
22592 Use GNU assembler syntax.  This is the default.
22593 @end table
22595 @node picoChip Options
22596 @subsection picoChip Options
22597 @cindex picoChip options
22599 These @samp{-m} options are defined for picoChip implementations:
22601 @table @gcctabopt
22603 @item -mae=@var{ae_type}
22604 @opindex mcpu
22605 Set the instruction set, register set, and instruction scheduling
22606 parameters for array element type @var{ae_type}.  Supported values
22607 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
22609 @option{-mae=ANY} selects a completely generic AE type.  Code
22610 generated with this option runs on any of the other AE types.  The
22611 code is not as efficient as it would be if compiled for a specific
22612 AE type, and some types of operation (e.g., multiplication) do not
22613 work properly on all types of AE.
22615 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
22616 for compiled code, and is the default.
22618 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
22619 option may suffer from poor performance of byte (char) manipulation,
22620 since the DSP AE does not provide hardware support for byte load/stores.
22622 @item -msymbol-as-address
22623 Enable the compiler to directly use a symbol name as an address in a
22624 load/store instruction, without first loading it into a
22625 register.  Typically, the use of this option generates larger
22626 programs, which run faster than when the option isn't used.  However, the
22627 results vary from program to program, so it is left as a user option,
22628 rather than being permanently enabled.
22630 @item -mno-inefficient-warnings
22631 Disables warnings about the generation of inefficient code.  These
22632 warnings can be generated, for example, when compiling code that
22633 performs byte-level memory operations on the MAC AE type.  The MAC AE has
22634 no hardware support for byte-level memory operations, so all byte
22635 load/stores must be synthesized from word load/store operations.  This is
22636 inefficient and a warning is generated to indicate
22637 that you should rewrite the code to avoid byte operations, or to target
22638 an AE type that has the necessary hardware support.  This option disables
22639 these warnings.
22641 @end table
22643 @node PowerPC Options
22644 @subsection PowerPC Options
22645 @cindex PowerPC options
22647 These are listed under @xref{RS/6000 and PowerPC Options}.
22649 @node PowerPC SPE Options
22650 @subsection PowerPC SPE Options
22651 @cindex PowerPC SPE options
22653 These @samp{-m} options are defined for PowerPC SPE:
22654 @table @gcctabopt
22655 @item -mmfcrf
22656 @itemx -mno-mfcrf
22657 @itemx -mpopcntb
22658 @itemx -mno-popcntb
22659 @opindex mmfcrf
22660 @opindex mno-mfcrf
22661 @opindex mpopcntb
22662 @opindex mno-popcntb
22663 You use these options to specify which instructions are available on the
22664 processor you are using.  The default value of these options is
22665 determined when configuring GCC@.  Specifying the
22666 @option{-mcpu=@var{cpu_type}} overrides the specification of these
22667 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
22668 rather than the options listed above.
22670 The @option{-mmfcrf} option allows GCC to generate the move from
22671 condition register field instruction implemented on the POWER4
22672 processor and other processors that support the PowerPC V2.01
22673 architecture.
22674 The @option{-mpopcntb} option allows GCC to generate the popcount and
22675 double-precision FP reciprocal estimate instruction implemented on the
22676 POWER5 processor and other processors that support the PowerPC V2.02
22677 architecture.
22679 @item -mcpu=@var{cpu_type}
22680 @opindex mcpu
22681 Set architecture type, register usage, and
22682 instruction scheduling parameters for machine type @var{cpu_type}.
22683 Supported values for @var{cpu_type} are @samp{8540}, @samp{8548},
22684 and @samp{native}.
22686 @option{-mcpu=powerpc} specifies pure 32-bit PowerPC (either
22687 endian), with an appropriate, generic processor model assumed for
22688 scheduling purposes.
22690 Specifying @samp{native} as cpu type detects and selects the
22691 architecture option that corresponds to the host processor of the
22692 system performing the compilation.
22693 @option{-mcpu=native} has no effect if GCC does not recognize the
22694 processor.
22696 The other options specify a specific processor.  Code generated under
22697 those options runs best on that processor, and may not run at all on
22698 others.
22700 The @option{-mcpu} options automatically enable or disable the
22701 following options:
22703 @gccoptlist{-mhard-float  -mmfcrf  -mmultiple @gol
22704 -mpopcntb -mpopcntd @gol
22705 -msingle-float -mdouble-float @gol
22706 -mfloat128}
22708 The particular options set for any particular CPU varies between
22709 compiler versions, depending on what setting seems to produce optimal
22710 code for that CPU; it doesn't necessarily reflect the actual hardware's
22711 capabilities.  If you wish to set an individual option to a particular
22712 value, you may specify it after the @option{-mcpu} option, like
22713 @option{-mcpu=8548}.
22715 @item -mtune=@var{cpu_type}
22716 @opindex mtune
22717 Set the instruction scheduling parameters for machine type
22718 @var{cpu_type}, but do not set the architecture type or register usage,
22719 as @option{-mcpu=@var{cpu_type}} does.  The same
22720 values for @var{cpu_type} are used for @option{-mtune} as for
22721 @option{-mcpu}.  If both are specified, the code generated uses the
22722 architecture and registers set by @option{-mcpu}, but the
22723 scheduling parameters set by @option{-mtune}.
22725 @item -msecure-plt
22726 @opindex msecure-plt
22727 Generate code that allows @command{ld} and @command{ld.so}
22728 to build executables and shared
22729 libraries with non-executable @code{.plt} and @code{.got} sections.
22730 This is a PowerPC
22731 32-bit SYSV ABI option.
22733 @item -mbss-plt
22734 @opindex mbss-plt
22735 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
22736 fills in, and
22737 requires @code{.plt} and @code{.got}
22738 sections that are both writable and executable.
22739 This is a PowerPC 32-bit SYSV ABI option.
22741 @item -misel
22742 @itemx -mno-isel
22743 @opindex misel
22744 @opindex mno-isel
22745 This switch enables or disables the generation of ISEL instructions.
22747 @item -misel=@var{yes/no}
22748 This switch has been deprecated.  Use @option{-misel} and
22749 @option{-mno-isel} instead.
22751 @item -mspe
22752 @itemx -mno-spe
22753 @opindex mspe
22754 @opindex mno-spe
22755 This switch enables or disables the generation of SPE simd
22756 instructions.
22758 @item -mspe=@var{yes/no}
22759 This option has been deprecated.  Use @option{-mspe} and
22760 @option{-mno-spe} instead.
22762 @item -mfloat128
22763 @itemx -mno-float128
22764 @opindex mfloat128
22765 @opindex mno-float128
22766 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
22767 and use either software emulation for IEEE 128-bit floating point or
22768 hardware instructions.
22770 @item -mfloat-gprs=@var{yes/single/double/no}
22771 @itemx -mfloat-gprs
22772 @opindex mfloat-gprs
22773 This switch enables or disables the generation of floating-point
22774 operations on the general-purpose registers for architectures that
22775 support it.
22777 The argument @samp{yes} or @samp{single} enables the use of
22778 single-precision floating-point operations.
22780 The argument @samp{double} enables the use of single and
22781 double-precision floating-point operations.
22783 The argument @samp{no} disables floating-point operations on the
22784 general-purpose registers.
22786 This option is currently only available on the MPC854x.
22788 @item -mfull-toc
22789 @itemx -mno-fp-in-toc
22790 @itemx -mno-sum-in-toc
22791 @itemx -mminimal-toc
22792 @opindex mfull-toc
22793 @opindex mno-fp-in-toc
22794 @opindex mno-sum-in-toc
22795 @opindex mminimal-toc
22796 Modify generation of the TOC (Table Of Contents), which is created for
22797 every executable file.  The @option{-mfull-toc} option is selected by
22798 default.  In that case, GCC allocates at least one TOC entry for
22799 each unique non-automatic variable reference in your program.  GCC
22800 also places floating-point constants in the TOC@.  However, only
22801 16,384 entries are available in the TOC@.
22803 If you receive a linker error message that saying you have overflowed
22804 the available TOC space, you can reduce the amount of TOC space used
22805 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
22806 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
22807 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
22808 generate code to calculate the sum of an address and a constant at
22809 run time instead of putting that sum into the TOC@.  You may specify one
22810 or both of these options.  Each causes GCC to produce very slightly
22811 slower and larger code at the expense of conserving TOC space.
22813 If you still run out of space in the TOC even when you specify both of
22814 these options, specify @option{-mminimal-toc} instead.  This option causes
22815 GCC to make only one TOC entry for every file.  When you specify this
22816 option, GCC produces code that is slower and larger but which
22817 uses extremely little TOC space.  You may wish to use this option
22818 only on files that contain less frequently-executed code.
22820 @item -maix32
22821 @opindex maix32
22822 Disables the 64-bit ABI.  GCC defaults to @option{-maix32}.
22824 @item -mxl-compat
22825 @itemx -mno-xl-compat
22826 @opindex mxl-compat
22827 @opindex mno-xl-compat
22828 Produce code that conforms more closely to IBM XL compiler semantics
22829 when using AIX-compatible ABI@.  Pass floating-point arguments to
22830 prototyped functions beyond the register save area (RSA) on the stack
22831 in addition to argument FPRs.  Do not assume that most significant
22832 double in 128-bit long double value is properly rounded when comparing
22833 values and converting to double.  Use XL symbol names for long double
22834 support routines.
22836 The AIX calling convention was extended but not initially documented to
22837 handle an obscure K&R C case of calling a function that takes the
22838 address of its arguments with fewer arguments than declared.  IBM XL
22839 compilers access floating-point arguments that do not fit in the
22840 RSA from the stack when a subroutine is compiled without
22841 optimization.  Because always storing floating-point arguments on the
22842 stack is inefficient and rarely needed, this option is not enabled by
22843 default and only is necessary when calling subroutines compiled by IBM
22844 XL compilers without optimization.
22846 @item -malign-natural
22847 @itemx -malign-power
22848 @opindex malign-natural
22849 @opindex malign-power
22850 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
22851 @option{-malign-natural} overrides the ABI-defined alignment of larger
22852 types, such as floating-point doubles, on their natural size-based boundary.
22853 The option @option{-malign-power} instructs GCC to follow the ABI-specified
22854 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
22856 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
22857 is not supported.
22859 @item -msoft-float
22860 @itemx -mhard-float
22861 @opindex msoft-float
22862 @opindex mhard-float
22863 Generate code that does not use (uses) the floating-point register set.
22864 Software floating-point emulation is provided if you use the
22865 @option{-msoft-float} option, and pass the option to GCC when linking.
22867 @item -msingle-float
22868 @itemx -mdouble-float
22869 @opindex msingle-float
22870 @opindex mdouble-float
22871 Generate code for single- or double-precision floating-point operations.
22872 @option{-mdouble-float} implies @option{-msingle-float}.
22874 @item -mmultiple
22875 @itemx -mno-multiple
22876 @opindex mmultiple
22877 @opindex mno-multiple
22878 Generate code that uses (does not use) the load multiple word
22879 instructions and the store multiple word instructions.  These
22880 instructions are generated by default on POWER systems, and not
22881 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
22882 PowerPC systems, since those instructions do not work when the
22883 processor is in little-endian mode.  The exceptions are PPC740 and
22884 PPC750 which permit these instructions in little-endian mode.
22886 @item -mupdate
22887 @itemx -mno-update
22888 @opindex mupdate
22889 @opindex mno-update
22890 Generate code that uses (does not use) the load or store instructions
22891 that update the base register to the address of the calculated memory
22892 location.  These instructions are generated by default.  If you use
22893 @option{-mno-update}, there is a small window between the time that the
22894 stack pointer is updated and the address of the previous frame is
22895 stored, which means code that walks the stack frame across interrupts or
22896 signals may get corrupted data.
22898 @item -mavoid-indexed-addresses
22899 @itemx -mno-avoid-indexed-addresses
22900 @opindex mavoid-indexed-addresses
22901 @opindex mno-avoid-indexed-addresses
22902 Generate code that tries to avoid (not avoid) the use of indexed load
22903 or store instructions. These instructions can incur a performance
22904 penalty on Power6 processors in certain situations, such as when
22905 stepping through large arrays that cross a 16M boundary.  This option
22906 is enabled by default when targeting Power6 and disabled otherwise.
22908 @item -mfused-madd
22909 @itemx -mno-fused-madd
22910 @opindex mfused-madd
22911 @opindex mno-fused-madd
22912 Generate code that uses (does not use) the floating-point multiply and
22913 accumulate instructions.  These instructions are generated by default
22914 if hardware floating point is used.  The machine-dependent
22915 @option{-mfused-madd} option is now mapped to the machine-independent
22916 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
22917 mapped to @option{-ffp-contract=off}.
22919 @item -mno-strict-align
22920 @itemx -mstrict-align
22921 @opindex mno-strict-align
22922 @opindex mstrict-align
22923 On System V.4 and embedded PowerPC systems do not (do) assume that
22924 unaligned memory references are handled by the system.
22926 @item -mrelocatable
22927 @itemx -mno-relocatable
22928 @opindex mrelocatable
22929 @opindex mno-relocatable
22930 Generate code that allows (does not allow) a static executable to be
22931 relocated to a different address at run time.  A simple embedded
22932 PowerPC system loader should relocate the entire contents of
22933 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
22934 a table of 32-bit addresses generated by this option.  For this to
22935 work, all objects linked together must be compiled with
22936 @option{-mrelocatable} or @option{-mrelocatable-lib}.
22937 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
22939 @item -mrelocatable-lib
22940 @itemx -mno-relocatable-lib
22941 @opindex mrelocatable-lib
22942 @opindex mno-relocatable-lib
22943 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
22944 @code{.fixup} section to allow static executables to be relocated at
22945 run time, but @option{-mrelocatable-lib} does not use the smaller stack
22946 alignment of @option{-mrelocatable}.  Objects compiled with
22947 @option{-mrelocatable-lib} may be linked with objects compiled with
22948 any combination of the @option{-mrelocatable} options.
22950 @item -mno-toc
22951 @itemx -mtoc
22952 @opindex mno-toc
22953 @opindex mtoc
22954 On System V.4 and embedded PowerPC systems do not (do) assume that
22955 register 2 contains a pointer to a global area pointing to the addresses
22956 used in the program.
22958 @item -mlittle
22959 @itemx -mlittle-endian
22960 @opindex mlittle
22961 @opindex mlittle-endian
22962 On System V.4 and embedded PowerPC systems compile code for the
22963 processor in little-endian mode.  The @option{-mlittle-endian} option is
22964 the same as @option{-mlittle}.
22966 @item -mbig
22967 @itemx -mbig-endian
22968 @opindex mbig
22969 @opindex mbig-endian
22970 On System V.4 and embedded PowerPC systems compile code for the
22971 processor in big-endian mode.  The @option{-mbig-endian} option is
22972 the same as @option{-mbig}.
22974 @item -mdynamic-no-pic
22975 @opindex mdynamic-no-pic
22976 On Darwin and Mac OS X systems, compile code so that it is not
22977 relocatable, but that its external references are relocatable.  The
22978 resulting code is suitable for applications, but not shared
22979 libraries.
22981 @item -msingle-pic-base
22982 @opindex msingle-pic-base
22983 Treat the register used for PIC addressing as read-only, rather than
22984 loading it in the prologue for each function.  The runtime system is
22985 responsible for initializing this register with an appropriate value
22986 before execution begins.
22988 @item -mprioritize-restricted-insns=@var{priority}
22989 @opindex mprioritize-restricted-insns
22990 This option controls the priority that is assigned to
22991 dispatch-slot restricted instructions during the second scheduling
22992 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
22993 or @samp{2} to assign no, highest, or second-highest (respectively)
22994 priority to dispatch-slot restricted
22995 instructions.
22997 @item -msched-costly-dep=@var{dependence_type}
22998 @opindex msched-costly-dep
22999 This option controls which dependences are considered costly
23000 by the target during instruction scheduling.  The argument
23001 @var{dependence_type} takes one of the following values:
23003 @table @asis
23004 @item @samp{no}
23005 No dependence is costly.
23007 @item @samp{all}
23008 All dependences are costly.
23010 @item @samp{true_store_to_load}
23011 A true dependence from store to load is costly.
23013 @item @samp{store_to_load}
23014 Any dependence from store to load is costly.
23016 @item @var{number}
23017 Any dependence for which the latency is greater than or equal to
23018 @var{number} is costly.
23019 @end table
23021 @item -minsert-sched-nops=@var{scheme}
23022 @opindex minsert-sched-nops
23023 This option controls which NOP insertion scheme is used during
23024 the second scheduling pass.  The argument @var{scheme} takes one of the
23025 following values:
23027 @table @asis
23028 @item @samp{no}
23029 Don't insert NOPs.
23031 @item @samp{pad}
23032 Pad with NOPs any dispatch group that has vacant issue slots,
23033 according to the scheduler's grouping.
23035 @item @samp{regroup_exact}
23036 Insert NOPs to force costly dependent insns into
23037 separate groups.  Insert exactly as many NOPs as needed to force an insn
23038 to a new group, according to the estimated processor grouping.
23040 @item @var{number}
23041 Insert NOPs to force costly dependent insns into
23042 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
23043 @end table
23045 @item -mcall-sysv
23046 @opindex mcall-sysv
23047 On System V.4 and embedded PowerPC systems compile code using calling
23048 conventions that adhere to the March 1995 draft of the System V
23049 Application Binary Interface, PowerPC processor supplement.  This is the
23050 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
23052 @item -mcall-sysv-eabi
23053 @itemx -mcall-eabi
23054 @opindex mcall-sysv-eabi
23055 @opindex mcall-eabi
23056 Specify both @option{-mcall-sysv} and @option{-meabi} options.
23058 @item -mcall-sysv-noeabi
23059 @opindex mcall-sysv-noeabi
23060 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
23062 @item -mcall-aixdesc
23063 @opindex m
23064 On System V.4 and embedded PowerPC systems compile code for the AIX
23065 operating system.
23067 @item -mcall-linux
23068 @opindex mcall-linux
23069 On System V.4 and embedded PowerPC systems compile code for the
23070 Linux-based GNU system.
23072 @item -mcall-freebsd
23073 @opindex mcall-freebsd
23074 On System V.4 and embedded PowerPC systems compile code for the
23075 FreeBSD operating system.
23077 @item -mcall-netbsd
23078 @opindex mcall-netbsd
23079 On System V.4 and embedded PowerPC systems compile code for the
23080 NetBSD operating system.
23082 @item -mcall-openbsd
23083 @opindex mcall-netbsd
23084 On System V.4 and embedded PowerPC systems compile code for the
23085 OpenBSD operating system.
23087 @item -maix-struct-return
23088 @opindex maix-struct-return
23089 Return all structures in memory (as specified by the AIX ABI)@.
23091 @item -msvr4-struct-return
23092 @opindex msvr4-struct-return
23093 Return structures smaller than 8 bytes in registers (as specified by the
23094 SVR4 ABI)@.
23096 @item -mabi=@var{abi-type}
23097 @opindex mabi
23098 Extend the current ABI with a particular extension, or remove such extension.
23099 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
23100 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
23101 @samp{elfv1}, @samp{elfv2}@.
23103 @item -mabi=spe
23104 @opindex mabi=spe
23105 Extend the current ABI with SPE ABI extensions.  This does not change
23106 the default ABI, instead it adds the SPE ABI extensions to the current
23107 ABI@.
23109 @item -mabi=no-spe
23110 @opindex mabi=no-spe
23111 Disable Book-E SPE ABI extensions for the current ABI@.
23113 @item -mabi=ibmlongdouble
23114 @opindex mabi=ibmlongdouble
23115 Change the current ABI to use IBM extended-precision long double.
23116 This is not likely to work if your system defaults to using IEEE
23117 extended-precision long double.  If you change the long double type
23118 from IEEE extended-precision, the compiler will issue a warning unless
23119 you use the @option{-Wno-psabi} option.
23121 @item -mabi=ieeelongdouble
23122 @opindex mabi=ieeelongdouble
23123 Change the current ABI to use IEEE extended-precision long double.
23124 This is not likely to work if your system defaults to using IBM
23125 extended-precision long double.  If you change the long double type
23126 from IBM extended-precision, the compiler will issue a warning unless
23127 you use the @option{-Wno-psabi} option.
23129 @item -mabi=elfv1
23130 @opindex mabi=elfv1
23131 Change the current ABI to use the ELFv1 ABI.
23132 This is the default ABI for big-endian PowerPC 64-bit Linux.
23133 Overriding the default ABI requires special system support and is
23134 likely to fail in spectacular ways.
23136 @item -mabi=elfv2
23137 @opindex mabi=elfv2
23138 Change the current ABI to use the ELFv2 ABI.
23139 This is the default ABI for little-endian PowerPC 64-bit Linux.
23140 Overriding the default ABI requires special system support and is
23141 likely to fail in spectacular ways.
23143 @item -mgnu-attribute
23144 @itemx -mno-gnu-attribute
23145 @opindex mgnu-attribute
23146 @opindex mno-gnu-attribute
23147 Emit .gnu_attribute assembly directives to set tag/value pairs in a
23148 .gnu.attributes section that specify ABI variations in function
23149 parameters or return values.
23151 @item -mprototype
23152 @itemx -mno-prototype
23153 @opindex mprototype
23154 @opindex mno-prototype
23155 On System V.4 and embedded PowerPC systems assume that all calls to
23156 variable argument functions are properly prototyped.  Otherwise, the
23157 compiler must insert an instruction before every non-prototyped call to
23158 set or clear bit 6 of the condition code register (@code{CR}) to
23159 indicate whether floating-point values are passed in the floating-point
23160 registers in case the function takes variable arguments.  With
23161 @option{-mprototype}, only calls to prototyped variable argument functions
23162 set or clear the bit.
23164 @item -msim
23165 @opindex msim
23166 On embedded PowerPC systems, assume that the startup module is called
23167 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
23168 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
23169 configurations.
23171 @item -mmvme
23172 @opindex mmvme
23173 On embedded PowerPC systems, assume that the startup module is called
23174 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
23175 @file{libc.a}.
23177 @item -mads
23178 @opindex mads
23179 On embedded PowerPC systems, assume that the startup module is called
23180 @file{crt0.o} and the standard C libraries are @file{libads.a} and
23181 @file{libc.a}.
23183 @item -myellowknife
23184 @opindex myellowknife
23185 On embedded PowerPC systems, assume that the startup module is called
23186 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
23187 @file{libc.a}.
23189 @item -mvxworks
23190 @opindex mvxworks
23191 On System V.4 and embedded PowerPC systems, specify that you are
23192 compiling for a VxWorks system.
23194 @item -memb
23195 @opindex memb
23196 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
23197 header to indicate that @samp{eabi} extended relocations are used.
23199 @item -meabi
23200 @itemx -mno-eabi
23201 @opindex meabi
23202 @opindex mno-eabi
23203 On System V.4 and embedded PowerPC systems do (do not) adhere to the
23204 Embedded Applications Binary Interface (EABI), which is a set of
23205 modifications to the System V.4 specifications.  Selecting @option{-meabi}
23206 means that the stack is aligned to an 8-byte boundary, a function
23207 @code{__eabi} is called from @code{main} to set up the EABI
23208 environment, and the @option{-msdata} option can use both @code{r2} and
23209 @code{r13} to point to two separate small data areas.  Selecting
23210 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
23211 no EABI initialization function is called from @code{main}, and the
23212 @option{-msdata} option only uses @code{r13} to point to a single
23213 small data area.  The @option{-meabi} option is on by default if you
23214 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
23216 @item -msdata=eabi
23217 @opindex msdata=eabi
23218 On System V.4 and embedded PowerPC systems, put small initialized
23219 @code{const} global and static data in the @code{.sdata2} section, which
23220 is pointed to by register @code{r2}.  Put small initialized
23221 non-@code{const} global and static data in the @code{.sdata} section,
23222 which is pointed to by register @code{r13}.  Put small uninitialized
23223 global and static data in the @code{.sbss} section, which is adjacent to
23224 the @code{.sdata} section.  The @option{-msdata=eabi} option is
23225 incompatible with the @option{-mrelocatable} option.  The
23226 @option{-msdata=eabi} option also sets the @option{-memb} option.
23228 @item -msdata=sysv
23229 @opindex msdata=sysv
23230 On System V.4 and embedded PowerPC systems, put small global and static
23231 data in the @code{.sdata} section, which is pointed to by register
23232 @code{r13}.  Put small uninitialized global and static data in the
23233 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
23234 The @option{-msdata=sysv} option is incompatible with the
23235 @option{-mrelocatable} option.
23237 @item -msdata=default
23238 @itemx -msdata
23239 @opindex msdata=default
23240 @opindex msdata
23241 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
23242 compile code the same as @option{-msdata=eabi}, otherwise compile code the
23243 same as @option{-msdata=sysv}.
23245 @item -msdata=data
23246 @opindex msdata=data
23247 On System V.4 and embedded PowerPC systems, put small global
23248 data in the @code{.sdata} section.  Put small uninitialized global
23249 data in the @code{.sbss} section.  Do not use register @code{r13}
23250 to address small data however.  This is the default behavior unless
23251 other @option{-msdata} options are used.
23253 @item -msdata=none
23254 @itemx -mno-sdata
23255 @opindex msdata=none
23256 @opindex mno-sdata
23257 On embedded PowerPC systems, put all initialized global and static data
23258 in the @code{.data} section, and all uninitialized data in the
23259 @code{.bss} section.
23261 @item -mblock-move-inline-limit=@var{num}
23262 @opindex mblock-move-inline-limit
23263 Inline all block moves (such as calls to @code{memcpy} or structure
23264 copies) less than or equal to @var{num} bytes.  The minimum value for
23265 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
23266 targets.  The default value is target-specific.
23268 @item -G @var{num}
23269 @opindex G
23270 @cindex smaller data references (PowerPC)
23271 @cindex .sdata/.sdata2 references (PowerPC)
23272 On embedded PowerPC systems, put global and static items less than or
23273 equal to @var{num} bytes into the small data or BSS sections instead of
23274 the normal data or BSS section.  By default, @var{num} is 8.  The
23275 @option{-G @var{num}} switch is also passed to the linker.
23276 All modules should be compiled with the same @option{-G @var{num}} value.
23278 @item -mregnames
23279 @itemx -mno-regnames
23280 @opindex mregnames
23281 @opindex mno-regnames
23282 On System V.4 and embedded PowerPC systems do (do not) emit register
23283 names in the assembly language output using symbolic forms.
23285 @item -mlongcall
23286 @itemx -mno-longcall
23287 @opindex mlongcall
23288 @opindex mno-longcall
23289 By default assume that all calls are far away so that a longer and more
23290 expensive calling sequence is required.  This is required for calls
23291 farther than 32 megabytes (33,554,432 bytes) from the current location.
23292 A short call is generated if the compiler knows
23293 the call cannot be that far away.  This setting can be overridden by
23294 the @code{shortcall} function attribute, or by @code{#pragma
23295 longcall(0)}.
23297 Some linkers are capable of detecting out-of-range calls and generating
23298 glue code on the fly.  On these systems, long calls are unnecessary and
23299 generate slower code.  As of this writing, the AIX linker can do this,
23300 as can the GNU linker for PowerPC/64.  It is planned to add this feature
23301 to the GNU linker for 32-bit PowerPC systems as well.
23303 In the future, GCC may ignore all longcall specifications
23304 when the linker is known to generate glue.
23306 @item -mtls-markers
23307 @itemx -mno-tls-markers
23308 @opindex mtls-markers
23309 @opindex mno-tls-markers
23310 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
23311 specifying the function argument.  The relocation allows the linker to
23312 reliably associate function call with argument setup instructions for
23313 TLS optimization, which in turn allows GCC to better schedule the
23314 sequence.
23316 @item -mrecip
23317 @itemx -mno-recip
23318 @opindex mrecip
23319 This option enables use of the reciprocal estimate and
23320 reciprocal square root estimate instructions with additional
23321 Newton-Raphson steps to increase precision instead of doing a divide or
23322 square root and divide for floating-point arguments.  You should use
23323 the @option{-ffast-math} option when using @option{-mrecip} (or at
23324 least @option{-funsafe-math-optimizations},
23325 @option{-ffinite-math-only}, @option{-freciprocal-math} and
23326 @option{-fno-trapping-math}).  Note that while the throughput of the
23327 sequence is generally higher than the throughput of the non-reciprocal
23328 instruction, the precision of the sequence can be decreased by up to 2
23329 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
23330 roots.
23332 @item -mrecip=@var{opt}
23333 @opindex mrecip=opt
23334 This option controls which reciprocal estimate instructions
23335 may be used.  @var{opt} is a comma-separated list of options, which may
23336 be preceded by a @code{!} to invert the option:
23338 @table @samp
23340 @item all
23341 Enable all estimate instructions.
23343 @item default
23344 Enable the default instructions, equivalent to @option{-mrecip}.
23346 @item none
23347 Disable all estimate instructions, equivalent to @option{-mno-recip}.
23349 @item div
23350 Enable the reciprocal approximation instructions for both
23351 single and double precision.
23353 @item divf
23354 Enable the single-precision reciprocal approximation instructions.
23356 @item divd
23357 Enable the double-precision reciprocal approximation instructions.
23359 @item rsqrt
23360 Enable the reciprocal square root approximation instructions for both
23361 single and double precision.
23363 @item rsqrtf
23364 Enable the single-precision reciprocal square root approximation instructions.
23366 @item rsqrtd
23367 Enable the double-precision reciprocal square root approximation instructions.
23369 @end table
23371 So, for example, @option{-mrecip=all,!rsqrtd} enables
23372 all of the reciprocal estimate instructions, except for the
23373 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
23374 which handle the double-precision reciprocal square root calculations.
23376 @item -mrecip-precision
23377 @itemx -mno-recip-precision
23378 @opindex mrecip-precision
23379 Assume (do not assume) that the reciprocal estimate instructions
23380 provide higher-precision estimates than is mandated by the PowerPC
23381 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
23382 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
23383 The double-precision square root estimate instructions are not generated by
23384 default on low-precision machines, since they do not provide an
23385 estimate that converges after three steps.
23387 @item -mpointers-to-nested-functions
23388 @itemx -mno-pointers-to-nested-functions
23389 @opindex mpointers-to-nested-functions
23390 Generate (do not generate) code to load up the static chain register
23391 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
23392 systems where a function pointer points to a 3-word descriptor giving
23393 the function address, TOC value to be loaded in register @code{r2}, and
23394 static chain value to be loaded in register @code{r11}.  The
23395 @option{-mpointers-to-nested-functions} is on by default.  You cannot
23396 call through pointers to nested functions or pointers
23397 to functions compiled in other languages that use the static chain if
23398 you use @option{-mno-pointers-to-nested-functions}.
23400 @item -msave-toc-indirect
23401 @itemx -mno-save-toc-indirect
23402 @opindex msave-toc-indirect
23403 Generate (do not generate) code to save the TOC value in the reserved
23404 stack location in the function prologue if the function calls through
23405 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
23406 saved in the prologue, it is saved just before the call through the
23407 pointer.  The @option{-mno-save-toc-indirect} option is the default.
23409 @item -mcompat-align-parm
23410 @itemx -mno-compat-align-parm
23411 @opindex mcompat-align-parm
23412 Generate (do not generate) code to pass structure parameters with a
23413 maximum alignment of 64 bits, for compatibility with older versions
23414 of GCC.
23416 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
23417 structure parameter on a 128-bit boundary when that structure contained
23418 a member requiring 128-bit alignment.  This is corrected in more
23419 recent versions of GCC.  This option may be used to generate code
23420 that is compatible with functions compiled with older versions of
23421 GCC.
23423 The @option{-mno-compat-align-parm} option is the default.
23425 @item -mstack-protector-guard=@var{guard}
23426 @itemx -mstack-protector-guard-reg=@var{reg}
23427 @itemx -mstack-protector-guard-offset=@var{offset}
23428 @itemx -mstack-protector-guard-symbol=@var{symbol}
23429 @opindex mstack-protector-guard
23430 @opindex mstack-protector-guard-reg
23431 @opindex mstack-protector-guard-offset
23432 @opindex mstack-protector-guard-symbol
23433 Generate stack protection code using canary at @var{guard}.  Supported
23434 locations are @samp{global} for global canary or @samp{tls} for per-thread
23435 canary in the TLS block (the default with GNU libc version 2.4 or later).
23437 With the latter choice the options
23438 @option{-mstack-protector-guard-reg=@var{reg}} and
23439 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
23440 which register to use as base register for reading the canary, and from what
23441 offset from that base register. The default for those is as specified in the
23442 relevant ABI.  @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
23443 the offset with a symbol reference to a canary in the TLS block.
23444 @end table
23447 @node RISC-V Options
23448 @subsection RISC-V Options
23449 @cindex RISC-V Options
23451 These command-line options are defined for RISC-V targets:
23453 @table @gcctabopt
23454 @item -mbranch-cost=@var{n}
23455 @opindex mbranch-cost
23456 Set the cost of branches to roughly @var{n} instructions.
23458 @item -mplt
23459 @itemx -mno-plt
23460 @opindex plt
23461 When generating PIC code, do or don't allow the use of PLTs. Ignored for
23462 non-PIC.  The default is @option{-mplt}.
23464 @item -mabi=@var{ABI-string}
23465 @opindex mabi
23466 Specify integer and floating-point calling convention.  @var{ABI-string}
23467 contains two parts: the size of integer types and the registers used for
23468 floating-point types.  For example @samp{-march=rv64ifd -mabi=lp64d} means that
23469 @samp{long} and pointers are 64-bit (implicitly defining @samp{int} to be
23470 32-bit), and that floating-point values up to 64 bits wide are passed in F
23471 registers.  Contrast this with @samp{-march=rv64ifd -mabi=lp64f}, which still
23472 allows the compiler to generate code that uses the F and D extensions but only
23473 allows floating-point values up to 32 bits long to be passed in registers; or
23474 @samp{-march=rv64ifd -mabi=lp64}, in which no floating-point arguments will be
23475 passed in registers.
23477 The default for this argument is system dependent, users who want a specific
23478 calling convention should specify one explicitly.  The valid calling
23479 conventions are: @samp{ilp32}, @samp{ilp32f}, @samp{ilp32d}, @samp{lp64},
23480 @samp{lp64f}, and @samp{lp64d}.  Some calling conventions are impossible to
23481 implement on some ISAs: for example, @samp{-march=rv32if -mabi=ilp32d} is
23482 invalid because the ABI requires 64-bit values be passed in F registers, but F
23483 registers are only 32 bits wide.  There is also the @samp{ilp32e} ABI that can
23484 only be used with the @samp{rv32e} architecture.  This ABI is not well
23485 specified at present, and is subject to change.
23487 @item -mfdiv
23488 @itemx -mno-fdiv
23489 @opindex mfdiv
23490 Do or don't use hardware floating-point divide and square root instructions.
23491 This requires the F or D extensions for floating-point registers.  The default
23492 is to use them if the specified architecture has these instructions.
23494 @item -mdiv
23495 @itemx -mno-div
23496 @opindex mdiv
23497 Do or don't use hardware instructions for integer division.  This requires the
23498 M extension.  The default is to use them if the specified architecture has
23499 these instructions.
23501 @item -march=@var{ISA-string}
23502 @opindex march
23503 Generate code for given RISC-V ISA (e.g.@ @samp{rv64im}).  ISA strings must be
23504 lower-case.  Examples include @samp{rv64i}, @samp{rv32g}, @samp{rv32e}, and
23505 @samp{rv32imaf}.
23507 @item -mtune=@var{processor-string}
23508 @opindex mtune
23509 Optimize the output for the given processor, specified by microarchitecture
23510 name.
23512 @item -mpreferred-stack-boundary=@var{num}
23513 @opindex mpreferred-stack-boundary
23514 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
23515 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
23516 the default is 4 (16 bytes or 128-bits).
23518 @strong{Warning:} If you use this switch, then you must build all modules with
23519 the same value, including any libraries.  This includes the system libraries
23520 and startup modules.
23522 @item -msmall-data-limit=@var{n}
23523 @opindex msmall-data-limit
23524 Put global and static data smaller than @var{n} bytes into a special section
23525 (on some targets).
23527 @item -msave-restore
23528 @itemx -mno-save-restore
23529 @opindex msave-restore
23530 Do or don't use smaller but slower prologue and epilogue code that uses
23531 library function calls.  The default is to use fast inline prologues and
23532 epilogues.
23534 @item -mstrict-align
23535 @itemx -mno-strict-align
23536 @opindex mstrict-align
23537 Do not or do generate unaligned memory accesses.  The default is set depending
23538 on whether the processor we are optimizing for supports fast unaligned access
23539 or not.
23541 @item -mcmodel=medlow
23542 @opindex mcmodel=medlow
23543 Generate code for the medium-low code model. The program and its statically
23544 defined symbols must lie within a single 2 GiB address range and must lie
23545 between absolute addresses @minus{}2 GiB and +2 GiB. Programs can be
23546 statically or dynamically linked. This is the default code model.
23548 @item -mcmodel=medany
23549 @opindex mcmodel=medany
23550 Generate code for the medium-any code model. The program and its statically
23551 defined symbols must be within any single 2 GiB address range. Programs can be
23552 statically or dynamically linked.
23554 @item -mexplicit-relocs
23555 @itemx -mno-exlicit-relocs
23556 Use or do not use assembler relocation operators when dealing with symbolic
23557 addresses.  The alternative is to use assembler macros instead, which may
23558 limit optimization.
23560 @item -mrelax
23561 @itemx -mno-relax
23562 Take advantage of linker relaxations to reduce the number of instructions
23563 required to materialize symbol addresses. The default is to take advantage of
23564 linker relaxations.
23566 @end table
23568 @node RL78 Options
23569 @subsection RL78 Options
23570 @cindex RL78 Options
23572 @table @gcctabopt
23574 @item -msim
23575 @opindex msim
23576 Links in additional target libraries to support operation within a
23577 simulator.
23579 @item -mmul=none
23580 @itemx -mmul=g10
23581 @itemx -mmul=g13
23582 @itemx -mmul=g14
23583 @itemx -mmul=rl78
23584 @opindex mmul
23585 Specifies the type of hardware multiplication and division support to
23586 be used.  The simplest is @code{none}, which uses software for both
23587 multiplication and division.  This is the default.  The @code{g13}
23588 value is for the hardware multiply/divide peripheral found on the
23589 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
23590 the multiplication and division instructions supported by the RL78/G14
23591 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
23592 the value @code{mg10} is an alias for @code{none}.
23594 In addition a C preprocessor macro is defined, based upon the setting
23595 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
23596 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
23598 @item -mcpu=g10
23599 @itemx -mcpu=g13
23600 @itemx -mcpu=g14
23601 @itemx -mcpu=rl78
23602 @opindex mcpu
23603 Specifies the RL78 core to target.  The default is the G14 core, also
23604 known as an S3 core or just RL78.  The G13 or S2 core does not have
23605 multiply or divide instructions, instead it uses a hardware peripheral
23606 for these operations.  The G10 or S1 core does not have register
23607 banks, so it uses a different calling convention.
23609 If this option is set it also selects the type of hardware multiply
23610 support to use, unless this is overridden by an explicit
23611 @option{-mmul=none} option on the command line.  Thus specifying
23612 @option{-mcpu=g13} enables the use of the G13 hardware multiply
23613 peripheral and specifying @option{-mcpu=g10} disables the use of
23614 hardware multiplications altogether.
23616 Note, although the RL78/G14 core is the default target, specifying
23617 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
23618 change the behavior of the toolchain since it also enables G14
23619 hardware multiply support.  If these options are not specified on the
23620 command line then software multiplication routines will be used even
23621 though the code targets the RL78 core.  This is for backwards
23622 compatibility with older toolchains which did not have hardware
23623 multiply and divide support.
23625 In addition a C preprocessor macro is defined, based upon the setting
23626 of this option.  Possible values are: @code{__RL78_G10__},
23627 @code{__RL78_G13__} or @code{__RL78_G14__}.
23629 @item -mg10
23630 @itemx -mg13
23631 @itemx -mg14
23632 @itemx -mrl78
23633 @opindex mg10
23634 @opindex mg13
23635 @opindex mg14
23636 @opindex mrl78
23637 These are aliases for the corresponding @option{-mcpu=} option.  They
23638 are provided for backwards compatibility.
23640 @item -mallregs
23641 @opindex mallregs
23642 Allow the compiler to use all of the available registers.  By default
23643 registers @code{r24..r31} are reserved for use in interrupt handlers.
23644 With this option enabled these registers can be used in ordinary
23645 functions as well.
23647 @item -m64bit-doubles
23648 @itemx -m32bit-doubles
23649 @opindex m64bit-doubles
23650 @opindex m32bit-doubles
23651 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
23652 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
23653 @option{-m32bit-doubles}.
23655 @item -msave-mduc-in-interrupts
23656 @itemx -mno-save-mduc-in-interrupts
23657 @opindex msave-mduc-in-interrupts
23658 @opindex mno-save-mduc-in-interrupts
23659 Specifies that interrupt handler functions should preserve the
23660 MDUC registers.  This is only necessary if normal code might use
23661 the MDUC registers, for example because it performs multiplication
23662 and division operations.  The default is to ignore the MDUC registers
23663 as this makes the interrupt handlers faster.  The target option -mg13
23664 needs to be passed for this to work as this feature is only available
23665 on the G13 target (S2 core).  The MDUC registers will only be saved
23666 if the interrupt handler performs a multiplication or division
23667 operation or it calls another function.
23669 @end table
23671 @node RS/6000 and PowerPC Options
23672 @subsection IBM RS/6000 and PowerPC Options
23673 @cindex RS/6000 and PowerPC Options
23674 @cindex IBM RS/6000 and PowerPC Options
23676 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
23677 @table @gcctabopt
23678 @item -mpowerpc-gpopt
23679 @itemx -mno-powerpc-gpopt
23680 @itemx -mpowerpc-gfxopt
23681 @itemx -mno-powerpc-gfxopt
23682 @need 800
23683 @itemx -mpowerpc64
23684 @itemx -mno-powerpc64
23685 @itemx -mmfcrf
23686 @itemx -mno-mfcrf
23687 @itemx -mpopcntb
23688 @itemx -mno-popcntb
23689 @itemx -mpopcntd
23690 @itemx -mno-popcntd
23691 @itemx -mfprnd
23692 @itemx -mno-fprnd
23693 @need 800
23694 @itemx -mcmpb
23695 @itemx -mno-cmpb
23696 @itemx -mmfpgpr
23697 @itemx -mno-mfpgpr
23698 @itemx -mhard-dfp
23699 @itemx -mno-hard-dfp
23700 @opindex mpowerpc-gpopt
23701 @opindex mno-powerpc-gpopt
23702 @opindex mpowerpc-gfxopt
23703 @opindex mno-powerpc-gfxopt
23704 @opindex mpowerpc64
23705 @opindex mno-powerpc64
23706 @opindex mmfcrf
23707 @opindex mno-mfcrf
23708 @opindex mpopcntb
23709 @opindex mno-popcntb
23710 @opindex mpopcntd
23711 @opindex mno-popcntd
23712 @opindex mfprnd
23713 @opindex mno-fprnd
23714 @opindex mcmpb
23715 @opindex mno-cmpb
23716 @opindex mmfpgpr
23717 @opindex mno-mfpgpr
23718 @opindex mhard-dfp
23719 @opindex mno-hard-dfp
23720 You use these options to specify which instructions are available on the
23721 processor you are using.  The default value of these options is
23722 determined when configuring GCC@.  Specifying the
23723 @option{-mcpu=@var{cpu_type}} overrides the specification of these
23724 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
23725 rather than the options listed above.
23727 Specifying @option{-mpowerpc-gpopt} allows
23728 GCC to use the optional PowerPC architecture instructions in the
23729 General Purpose group, including floating-point square root.  Specifying
23730 @option{-mpowerpc-gfxopt} allows GCC to
23731 use the optional PowerPC architecture instructions in the Graphics
23732 group, including floating-point select.
23734 The @option{-mmfcrf} option allows GCC to generate the move from
23735 condition register field instruction implemented on the POWER4
23736 processor and other processors that support the PowerPC V2.01
23737 architecture.
23738 The @option{-mpopcntb} option allows GCC to generate the popcount and
23739 double-precision FP reciprocal estimate instruction implemented on the
23740 POWER5 processor and other processors that support the PowerPC V2.02
23741 architecture.
23742 The @option{-mpopcntd} option allows GCC to generate the popcount
23743 instruction implemented on the POWER7 processor and other processors
23744 that support the PowerPC V2.06 architecture.
23745 The @option{-mfprnd} option allows GCC to generate the FP round to
23746 integer instructions implemented on the POWER5+ processor and other
23747 processors that support the PowerPC V2.03 architecture.
23748 The @option{-mcmpb} option allows GCC to generate the compare bytes
23749 instruction implemented on the POWER6 processor and other processors
23750 that support the PowerPC V2.05 architecture.
23751 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
23752 general-purpose register instructions implemented on the POWER6X
23753 processor and other processors that support the extended PowerPC V2.05
23754 architecture.
23755 The @option{-mhard-dfp} option allows GCC to generate the decimal
23756 floating-point instructions implemented on some POWER processors.
23758 The @option{-mpowerpc64} option allows GCC to generate the additional
23759 64-bit instructions that are found in the full PowerPC64 architecture
23760 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
23761 @option{-mno-powerpc64}.
23763 @item -mcpu=@var{cpu_type}
23764 @opindex mcpu
23765 Set architecture type, register usage, and
23766 instruction scheduling parameters for machine type @var{cpu_type}.
23767 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
23768 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
23769 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
23770 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
23771 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
23772 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
23773 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
23774 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
23775 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
23776 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
23777 @samp{power9}, @samp{powerpc}, @samp{powerpc64}, @samp{powerpc64le},
23778 @samp{rs64}, and @samp{native}.
23780 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
23781 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
23782 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
23783 architecture machine types, with an appropriate, generic processor
23784 model assumed for scheduling purposes.
23786 Specifying @samp{native} as cpu type detects and selects the
23787 architecture option that corresponds to the host processor of the
23788 system performing the compilation.
23789 @option{-mcpu=native} has no effect if GCC does not recognize the
23790 processor.
23792 The other options specify a specific processor.  Code generated under
23793 those options runs best on that processor, and may not run at all on
23794 others.
23796 The @option{-mcpu} options automatically enable or disable the
23797 following options:
23799 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
23800 -mpopcntb -mpopcntd  -mpowerpc64 @gol
23801 -mpowerpc-gpopt  -mpowerpc-gfxopt @gol
23802 -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
23803 -mcrypto -mhtm -mpower8-fusion -mpower8-vector @gol
23804 -mquad-memory -mquad-memory-atomic -mfloat128 -mfloat128-hardware}
23806 The particular options set for any particular CPU varies between
23807 compiler versions, depending on what setting seems to produce optimal
23808 code for that CPU; it doesn't necessarily reflect the actual hardware's
23809 capabilities.  If you wish to set an individual option to a particular
23810 value, you may specify it after the @option{-mcpu} option, like
23811 @option{-mcpu=970 -mno-altivec}.
23813 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
23814 not enabled or disabled by the @option{-mcpu} option at present because
23815 AIX does not have full support for these options.  You may still
23816 enable or disable them individually if you're sure it'll work in your
23817 environment.
23819 @item -mtune=@var{cpu_type}
23820 @opindex mtune
23821 Set the instruction scheduling parameters for machine type
23822 @var{cpu_type}, but do not set the architecture type or register usage,
23823 as @option{-mcpu=@var{cpu_type}} does.  The same
23824 values for @var{cpu_type} are used for @option{-mtune} as for
23825 @option{-mcpu}.  If both are specified, the code generated uses the
23826 architecture and registers set by @option{-mcpu}, but the
23827 scheduling parameters set by @option{-mtune}.
23829 @item -mcmodel=small
23830 @opindex mcmodel=small
23831 Generate PowerPC64 code for the small model: The TOC is limited to
23832 64k.
23834 @item -mcmodel=medium
23835 @opindex mcmodel=medium
23836 Generate PowerPC64 code for the medium model: The TOC and other static
23837 data may be up to a total of 4G in size.  This is the default for 64-bit
23838 Linux.
23840 @item -mcmodel=large
23841 @opindex mcmodel=large
23842 Generate PowerPC64 code for the large model: The TOC may be up to 4G
23843 in size.  Other data and code is only limited by the 64-bit address
23844 space.
23846 @item -maltivec
23847 @itemx -mno-altivec
23848 @opindex maltivec
23849 @opindex mno-altivec
23850 Generate code that uses (does not use) AltiVec instructions, and also
23851 enable the use of built-in functions that allow more direct access to
23852 the AltiVec instruction set.  You may also need to set
23853 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
23854 enhancements.
23856 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
23857 @option{-maltivec=be}, the element order for AltiVec intrinsics such
23858 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
23859 match array element order corresponding to the endianness of the
23860 target.  That is, element zero identifies the leftmost element in a
23861 vector register when targeting a big-endian platform, and identifies
23862 the rightmost element in a vector register when targeting a
23863 little-endian platform.
23865 @item -maltivec=be
23866 @opindex maltivec=be
23867 Generate AltiVec instructions using big-endian element order,
23868 regardless of whether the target is big- or little-endian.  This is
23869 the default when targeting a big-endian platform.  Using this option
23870 is currently deprecated.  Support for this feature will be removed in
23871 GCC 9.
23873 The element order is used to interpret element numbers in AltiVec
23874 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
23875 @code{vec_insert}.  By default, these match array element order
23876 corresponding to the endianness for the target.
23878 @item -maltivec=le
23879 @opindex maltivec=le
23880 Generate AltiVec instructions using little-endian element order,
23881 regardless of whether the target is big- or little-endian.  This is
23882 the default when targeting a little-endian platform.  This option is
23883 currently ignored when targeting a big-endian platform.
23885 The element order is used to interpret element numbers in AltiVec
23886 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
23887 @code{vec_insert}.  By default, these match array element order
23888 corresponding to the endianness for the target.
23890 @item -mvrsave
23891 @itemx -mno-vrsave
23892 @opindex mvrsave
23893 @opindex mno-vrsave
23894 Generate VRSAVE instructions when generating AltiVec code.
23896 @item -msecure-plt
23897 @opindex msecure-plt
23898 Generate code that allows @command{ld} and @command{ld.so}
23899 to build executables and shared
23900 libraries with non-executable @code{.plt} and @code{.got} sections.
23901 This is a PowerPC
23902 32-bit SYSV ABI option.
23904 @item -mbss-plt
23905 @opindex mbss-plt
23906 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
23907 fills in, and
23908 requires @code{.plt} and @code{.got}
23909 sections that are both writable and executable.
23910 This is a PowerPC 32-bit SYSV ABI option.
23912 @item -misel
23913 @itemx -mno-isel
23914 @opindex misel
23915 @opindex mno-isel
23916 This switch enables or disables the generation of ISEL instructions.
23918 @item -misel=@var{yes/no}
23919 This switch has been deprecated.  Use @option{-misel} and
23920 @option{-mno-isel} instead.
23922 @item -mvsx
23923 @itemx -mno-vsx
23924 @opindex mvsx
23925 @opindex mno-vsx
23926 Generate code that uses (does not use) vector/scalar (VSX)
23927 instructions, and also enable the use of built-in functions that allow
23928 more direct access to the VSX instruction set.
23930 @item -mcrypto
23931 @itemx -mno-crypto
23932 @opindex mcrypto
23933 @opindex mno-crypto
23934 Enable the use (disable) of the built-in functions that allow direct
23935 access to the cryptographic instructions that were added in version
23936 2.07 of the PowerPC ISA.
23938 @item -mhtm
23939 @itemx -mno-htm
23940 @opindex mhtm
23941 @opindex mno-htm
23942 Enable (disable) the use of the built-in functions that allow direct
23943 access to the Hardware Transactional Memory (HTM) instructions that
23944 were added in version 2.07 of the PowerPC ISA.
23946 @item -mpower8-fusion
23947 @itemx -mno-power8-fusion
23948 @opindex mpower8-fusion
23949 @opindex mno-power8-fusion
23950 Generate code that keeps (does not keeps) some integer operations
23951 adjacent so that the instructions can be fused together on power8 and
23952 later processors.
23954 @item -mpower8-vector
23955 @itemx -mno-power8-vector
23956 @opindex mpower8-vector
23957 @opindex mno-power8-vector
23958 Generate code that uses (does not use) the vector and scalar
23959 instructions that were added in version 2.07 of the PowerPC ISA.  Also
23960 enable the use of built-in functions that allow more direct access to
23961 the vector instructions.
23963 @item -mquad-memory
23964 @itemx -mno-quad-memory
23965 @opindex mquad-memory
23966 @opindex mno-quad-memory
23967 Generate code that uses (does not use) the non-atomic quad word memory
23968 instructions.  The @option{-mquad-memory} option requires use of
23969 64-bit mode.
23971 @item -mquad-memory-atomic
23972 @itemx -mno-quad-memory-atomic
23973 @opindex mquad-memory-atomic
23974 @opindex mno-quad-memory-atomic
23975 Generate code that uses (does not use) the atomic quad word memory
23976 instructions.  The @option{-mquad-memory-atomic} option requires use of
23977 64-bit mode.
23979 @item -mfloat128
23980 @itemx -mno-float128
23981 @opindex mfloat128
23982 @opindex mno-float128
23983 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
23984 and use either software emulation for IEEE 128-bit floating point or
23985 hardware instructions.
23987 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7},
23988 @option{-mcpu=power8}), or @option{-mcpu=power9} must be enabled to
23989 use the IEEE 128-bit floating point support.  The IEEE 128-bit
23990 floating point support only works on PowerPC Linux systems.
23992 The default for @option{-mfloat128} is enabled on PowerPC Linux
23993 systems using the VSX instruction set, and disabled on other systems.
23995 If you use the ISA 3.0 instruction set (@option{-mpower9-vector} or
23996 @option{-mcpu=power9}) on a 64-bit system, the IEEE 128-bit floating
23997 point support will also enable the generation of ISA 3.0 IEEE 128-bit
23998 floating point instructions.  Otherwise, if you do not specify to
23999 generate ISA 3.0 instructions or you are targeting a 32-bit big endian
24000 system, IEEE 128-bit floating point will be done with software
24001 emulation.
24003 @item -mfloat128-hardware
24004 @itemx -mno-float128-hardware
24005 @opindex mfloat128-hardware
24006 @opindex mno-float128-hardware
24007 Enable/disable using ISA 3.0 hardware instructions to support the
24008 @var{__float128} data type.
24010 The default for @option{-mfloat128-hardware} is enabled on PowerPC
24011 Linux systems using the ISA 3.0 instruction set, and disabled on other
24012 systems.
24014 @item -m32
24015 @itemx -m64
24016 @opindex m32
24017 @opindex m64
24018 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
24019 targets (including GNU/Linux).  The 32-bit environment sets int, long
24020 and pointer to 32 bits and generates code that runs on any PowerPC
24021 variant.  The 64-bit environment sets int to 32 bits and long and
24022 pointer to 64 bits, and generates code for PowerPC64, as for
24023 @option{-mpowerpc64}.
24025 @item -mfull-toc
24026 @itemx -mno-fp-in-toc
24027 @itemx -mno-sum-in-toc
24028 @itemx -mminimal-toc
24029 @opindex mfull-toc
24030 @opindex mno-fp-in-toc
24031 @opindex mno-sum-in-toc
24032 @opindex mminimal-toc
24033 Modify generation of the TOC (Table Of Contents), which is created for
24034 every executable file.  The @option{-mfull-toc} option is selected by
24035 default.  In that case, GCC allocates at least one TOC entry for
24036 each unique non-automatic variable reference in your program.  GCC
24037 also places floating-point constants in the TOC@.  However, only
24038 16,384 entries are available in the TOC@.
24040 If you receive a linker error message that saying you have overflowed
24041 the available TOC space, you can reduce the amount of TOC space used
24042 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
24043 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
24044 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
24045 generate code to calculate the sum of an address and a constant at
24046 run time instead of putting that sum into the TOC@.  You may specify one
24047 or both of these options.  Each causes GCC to produce very slightly
24048 slower and larger code at the expense of conserving TOC space.
24050 If you still run out of space in the TOC even when you specify both of
24051 these options, specify @option{-mminimal-toc} instead.  This option causes
24052 GCC to make only one TOC entry for every file.  When you specify this
24053 option, GCC produces code that is slower and larger but which
24054 uses extremely little TOC space.  You may wish to use this option
24055 only on files that contain less frequently-executed code.
24057 @item -maix64
24058 @itemx -maix32
24059 @opindex maix64
24060 @opindex maix32
24061 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
24062 @code{long} type, and the infrastructure needed to support them.
24063 Specifying @option{-maix64} implies @option{-mpowerpc64},
24064 while @option{-maix32} disables the 64-bit ABI and
24065 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
24067 @item -mxl-compat
24068 @itemx -mno-xl-compat
24069 @opindex mxl-compat
24070 @opindex mno-xl-compat
24071 Produce code that conforms more closely to IBM XL compiler semantics
24072 when using AIX-compatible ABI@.  Pass floating-point arguments to
24073 prototyped functions beyond the register save area (RSA) on the stack
24074 in addition to argument FPRs.  Do not assume that most significant
24075 double in 128-bit long double value is properly rounded when comparing
24076 values and converting to double.  Use XL symbol names for long double
24077 support routines.
24079 The AIX calling convention was extended but not initially documented to
24080 handle an obscure K&R C case of calling a function that takes the
24081 address of its arguments with fewer arguments than declared.  IBM XL
24082 compilers access floating-point arguments that do not fit in the
24083 RSA from the stack when a subroutine is compiled without
24084 optimization.  Because always storing floating-point arguments on the
24085 stack is inefficient and rarely needed, this option is not enabled by
24086 default and only is necessary when calling subroutines compiled by IBM
24087 XL compilers without optimization.
24089 @item -mpe
24090 @opindex mpe
24091 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
24092 application written to use message passing with special startup code to
24093 enable the application to run.  The system must have PE installed in the
24094 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
24095 must be overridden with the @option{-specs=} option to specify the
24096 appropriate directory location.  The Parallel Environment does not
24097 support threads, so the @option{-mpe} option and the @option{-pthread}
24098 option are incompatible.
24100 @item -malign-natural
24101 @itemx -malign-power
24102 @opindex malign-natural
24103 @opindex malign-power
24104 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
24105 @option{-malign-natural} overrides the ABI-defined alignment of larger
24106 types, such as floating-point doubles, on their natural size-based boundary.
24107 The option @option{-malign-power} instructs GCC to follow the ABI-specified
24108 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
24110 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
24111 is not supported.
24113 @item -msoft-float
24114 @itemx -mhard-float
24115 @opindex msoft-float
24116 @opindex mhard-float
24117 Generate code that does not use (uses) the floating-point register set.
24118 Software floating-point emulation is provided if you use the
24119 @option{-msoft-float} option, and pass the option to GCC when linking.
24121 @item -mmultiple
24122 @itemx -mno-multiple
24123 @opindex mmultiple
24124 @opindex mno-multiple
24125 Generate code that uses (does not use) the load multiple word
24126 instructions and the store multiple word instructions.  These
24127 instructions are generated by default on POWER systems, and not
24128 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
24129 PowerPC systems, since those instructions do not work when the
24130 processor is in little-endian mode.  The exceptions are PPC740 and
24131 PPC750 which permit these instructions in little-endian mode.
24133 @item -mupdate
24134 @itemx -mno-update
24135 @opindex mupdate
24136 @opindex mno-update
24137 Generate code that uses (does not use) the load or store instructions
24138 that update the base register to the address of the calculated memory
24139 location.  These instructions are generated by default.  If you use
24140 @option{-mno-update}, there is a small window between the time that the
24141 stack pointer is updated and the address of the previous frame is
24142 stored, which means code that walks the stack frame across interrupts or
24143 signals may get corrupted data.
24145 @item -mavoid-indexed-addresses
24146 @itemx -mno-avoid-indexed-addresses
24147 @opindex mavoid-indexed-addresses
24148 @opindex mno-avoid-indexed-addresses
24149 Generate code that tries to avoid (not avoid) the use of indexed load
24150 or store instructions. These instructions can incur a performance
24151 penalty on Power6 processors in certain situations, such as when
24152 stepping through large arrays that cross a 16M boundary.  This option
24153 is enabled by default when targeting Power6 and disabled otherwise.
24155 @item -mfused-madd
24156 @itemx -mno-fused-madd
24157 @opindex mfused-madd
24158 @opindex mno-fused-madd
24159 Generate code that uses (does not use) the floating-point multiply and
24160 accumulate instructions.  These instructions are generated by default
24161 if hardware floating point is used.  The machine-dependent
24162 @option{-mfused-madd} option is now mapped to the machine-independent
24163 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
24164 mapped to @option{-ffp-contract=off}.
24166 @item -mmulhw
24167 @itemx -mno-mulhw
24168 @opindex mmulhw
24169 @opindex mno-mulhw
24170 Generate code that uses (does not use) the half-word multiply and
24171 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
24172 These instructions are generated by default when targeting those
24173 processors.
24175 @item -mdlmzb
24176 @itemx -mno-dlmzb
24177 @opindex mdlmzb
24178 @opindex mno-dlmzb
24179 Generate code that uses (does not use) the string-search @samp{dlmzb}
24180 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
24181 generated by default when targeting those processors.
24183 @item -mno-bit-align
24184 @itemx -mbit-align
24185 @opindex mno-bit-align
24186 @opindex mbit-align
24187 On System V.4 and embedded PowerPC systems do not (do) force structures
24188 and unions that contain bit-fields to be aligned to the base type of the
24189 bit-field.
24191 For example, by default a structure containing nothing but 8
24192 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
24193 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
24194 the structure is aligned to a 1-byte boundary and is 1 byte in
24195 size.
24197 @item -mno-strict-align
24198 @itemx -mstrict-align
24199 @opindex mno-strict-align
24200 @opindex mstrict-align
24201 On System V.4 and embedded PowerPC systems do not (do) assume that
24202 unaligned memory references are handled by the system.
24204 @item -mrelocatable
24205 @itemx -mno-relocatable
24206 @opindex mrelocatable
24207 @opindex mno-relocatable
24208 Generate code that allows (does not allow) a static executable to be
24209 relocated to a different address at run time.  A simple embedded
24210 PowerPC system loader should relocate the entire contents of
24211 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
24212 a table of 32-bit addresses generated by this option.  For this to
24213 work, all objects linked together must be compiled with
24214 @option{-mrelocatable} or @option{-mrelocatable-lib}.
24215 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
24217 @item -mrelocatable-lib
24218 @itemx -mno-relocatable-lib
24219 @opindex mrelocatable-lib
24220 @opindex mno-relocatable-lib
24221 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
24222 @code{.fixup} section to allow static executables to be relocated at
24223 run time, but @option{-mrelocatable-lib} does not use the smaller stack
24224 alignment of @option{-mrelocatable}.  Objects compiled with
24225 @option{-mrelocatable-lib} may be linked with objects compiled with
24226 any combination of the @option{-mrelocatable} options.
24228 @item -mno-toc
24229 @itemx -mtoc
24230 @opindex mno-toc
24231 @opindex mtoc
24232 On System V.4 and embedded PowerPC systems do not (do) assume that
24233 register 2 contains a pointer to a global area pointing to the addresses
24234 used in the program.
24236 @item -mlittle
24237 @itemx -mlittle-endian
24238 @opindex mlittle
24239 @opindex mlittle-endian
24240 On System V.4 and embedded PowerPC systems compile code for the
24241 processor in little-endian mode.  The @option{-mlittle-endian} option is
24242 the same as @option{-mlittle}.
24244 @item -mbig
24245 @itemx -mbig-endian
24246 @opindex mbig
24247 @opindex mbig-endian
24248 On System V.4 and embedded PowerPC systems compile code for the
24249 processor in big-endian mode.  The @option{-mbig-endian} option is
24250 the same as @option{-mbig}.
24252 @item -mdynamic-no-pic
24253 @opindex mdynamic-no-pic
24254 On Darwin and Mac OS X systems, compile code so that it is not
24255 relocatable, but that its external references are relocatable.  The
24256 resulting code is suitable for applications, but not shared
24257 libraries.
24259 @item -msingle-pic-base
24260 @opindex msingle-pic-base
24261 Treat the register used for PIC addressing as read-only, rather than
24262 loading it in the prologue for each function.  The runtime system is
24263 responsible for initializing this register with an appropriate value
24264 before execution begins.
24266 @item -mprioritize-restricted-insns=@var{priority}
24267 @opindex mprioritize-restricted-insns
24268 This option controls the priority that is assigned to
24269 dispatch-slot restricted instructions during the second scheduling
24270 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
24271 or @samp{2} to assign no, highest, or second-highest (respectively) 
24272 priority to dispatch-slot restricted
24273 instructions.
24275 @item -msched-costly-dep=@var{dependence_type}
24276 @opindex msched-costly-dep
24277 This option controls which dependences are considered costly
24278 by the target during instruction scheduling.  The argument
24279 @var{dependence_type} takes one of the following values:
24281 @table @asis
24282 @item @samp{no}
24283 No dependence is costly.
24285 @item @samp{all}
24286 All dependences are costly.
24288 @item @samp{true_store_to_load}
24289 A true dependence from store to load is costly.
24291 @item @samp{store_to_load}
24292 Any dependence from store to load is costly.
24294 @item @var{number}
24295 Any dependence for which the latency is greater than or equal to 
24296 @var{number} is costly.
24297 @end table
24299 @item -minsert-sched-nops=@var{scheme}
24300 @opindex minsert-sched-nops
24301 This option controls which NOP insertion scheme is used during
24302 the second scheduling pass.  The argument @var{scheme} takes one of the
24303 following values:
24305 @table @asis
24306 @item @samp{no}
24307 Don't insert NOPs.
24309 @item @samp{pad}
24310 Pad with NOPs any dispatch group that has vacant issue slots,
24311 according to the scheduler's grouping.
24313 @item @samp{regroup_exact}
24314 Insert NOPs to force costly dependent insns into
24315 separate groups.  Insert exactly as many NOPs as needed to force an insn
24316 to a new group, according to the estimated processor grouping.
24318 @item @var{number}
24319 Insert NOPs to force costly dependent insns into
24320 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
24321 @end table
24323 @item -mcall-sysv
24324 @opindex mcall-sysv
24325 On System V.4 and embedded PowerPC systems compile code using calling
24326 conventions that adhere to the March 1995 draft of the System V
24327 Application Binary Interface, PowerPC processor supplement.  This is the
24328 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
24330 @item -mcall-sysv-eabi
24331 @itemx -mcall-eabi
24332 @opindex mcall-sysv-eabi
24333 @opindex mcall-eabi
24334 Specify both @option{-mcall-sysv} and @option{-meabi} options.
24336 @item -mcall-sysv-noeabi
24337 @opindex mcall-sysv-noeabi
24338 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
24340 @item -mcall-aixdesc
24341 @opindex m
24342 On System V.4 and embedded PowerPC systems compile code for the AIX
24343 operating system.
24345 @item -mcall-linux
24346 @opindex mcall-linux
24347 On System V.4 and embedded PowerPC systems compile code for the
24348 Linux-based GNU system.
24350 @item -mcall-freebsd
24351 @opindex mcall-freebsd
24352 On System V.4 and embedded PowerPC systems compile code for the
24353 FreeBSD operating system.
24355 @item -mcall-netbsd
24356 @opindex mcall-netbsd
24357 On System V.4 and embedded PowerPC systems compile code for the
24358 NetBSD operating system.
24360 @item -mcall-openbsd
24361 @opindex mcall-netbsd
24362 On System V.4 and embedded PowerPC systems compile code for the
24363 OpenBSD operating system.
24365 @item -mtraceback=@var{traceback_type}
24366 @opindex mtraceback
24367 Select the type of traceback table. Valid values for @var{traceback_type}
24368 are @samp{full}, @samp{part}, and @samp{no}.
24370 @item -maix-struct-return
24371 @opindex maix-struct-return
24372 Return all structures in memory (as specified by the AIX ABI)@.
24374 @item -msvr4-struct-return
24375 @opindex msvr4-struct-return
24376 Return structures smaller than 8 bytes in registers (as specified by the
24377 SVR4 ABI)@.
24379 @item -mabi=@var{abi-type}
24380 @opindex mabi
24381 Extend the current ABI with a particular extension, or remove such extension.
24382 Valid values are @samp{altivec}, @samp{no-altivec},
24383 @samp{ibmlongdouble}, @samp{ieeelongdouble},
24384 @samp{elfv1}, @samp{elfv2}@.
24386 @item -mabi=ibmlongdouble
24387 @opindex mabi=ibmlongdouble
24388 Change the current ABI to use IBM extended-precision long double.
24389 This is not likely to work if your system defaults to using IEEE
24390 extended-precision long double.  If you change the long double type
24391 from IEEE extended-precision, the compiler will issue a warning unless
24392 you use the @option{-Wno-psabi} option.
24394 @item -mabi=ieeelongdouble
24395 @opindex mabi=ieeelongdouble
24396 Change the current ABI to use IEEE extended-precision long double.
24397 This is not likely to work if your system defaults to using IBM
24398 extended-precision long double.  If you change the long double type
24399 from IBM extended-precision, the compiler will issue a warning unless
24400 you use the @option{-Wno-psabi} option.
24402 @item -mabi=elfv1
24403 @opindex mabi=elfv1
24404 Change the current ABI to use the ELFv1 ABI.
24405 This is the default ABI for big-endian PowerPC 64-bit Linux.
24406 Overriding the default ABI requires special system support and is
24407 likely to fail in spectacular ways.
24409 @item -mabi=elfv2
24410 @opindex mabi=elfv2
24411 Change the current ABI to use the ELFv2 ABI.
24412 This is the default ABI for little-endian PowerPC 64-bit Linux.
24413 Overriding the default ABI requires special system support and is
24414 likely to fail in spectacular ways.
24416 @item -mgnu-attribute
24417 @itemx -mno-gnu-attribute
24418 @opindex mgnu-attribute
24419 @opindex mno-gnu-attribute
24420 Emit .gnu_attribute assembly directives to set tag/value pairs in a
24421 .gnu.attributes section that specify ABI variations in function
24422 parameters or return values.
24424 @item -mprototype
24425 @itemx -mno-prototype
24426 @opindex mprototype
24427 @opindex mno-prototype
24428 On System V.4 and embedded PowerPC systems assume that all calls to
24429 variable argument functions are properly prototyped.  Otherwise, the
24430 compiler must insert an instruction before every non-prototyped call to
24431 set or clear bit 6 of the condition code register (@code{CR}) to
24432 indicate whether floating-point values are passed in the floating-point
24433 registers in case the function takes variable arguments.  With
24434 @option{-mprototype}, only calls to prototyped variable argument functions
24435 set or clear the bit.
24437 @item -msim
24438 @opindex msim
24439 On embedded PowerPC systems, assume that the startup module is called
24440 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
24441 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
24442 configurations.
24444 @item -mmvme
24445 @opindex mmvme
24446 On embedded PowerPC systems, assume that the startup module is called
24447 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
24448 @file{libc.a}.
24450 @item -mads
24451 @opindex mads
24452 On embedded PowerPC systems, assume that the startup module is called
24453 @file{crt0.o} and the standard C libraries are @file{libads.a} and
24454 @file{libc.a}.
24456 @item -myellowknife
24457 @opindex myellowknife
24458 On embedded PowerPC systems, assume that the startup module is called
24459 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
24460 @file{libc.a}.
24462 @item -mvxworks
24463 @opindex mvxworks
24464 On System V.4 and embedded PowerPC systems, specify that you are
24465 compiling for a VxWorks system.
24467 @item -memb
24468 @opindex memb
24469 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
24470 header to indicate that @samp{eabi} extended relocations are used.
24472 @item -meabi
24473 @itemx -mno-eabi
24474 @opindex meabi
24475 @opindex mno-eabi
24476 On System V.4 and embedded PowerPC systems do (do not) adhere to the
24477 Embedded Applications Binary Interface (EABI), which is a set of
24478 modifications to the System V.4 specifications.  Selecting @option{-meabi}
24479 means that the stack is aligned to an 8-byte boundary, a function
24480 @code{__eabi} is called from @code{main} to set up the EABI
24481 environment, and the @option{-msdata} option can use both @code{r2} and
24482 @code{r13} to point to two separate small data areas.  Selecting
24483 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
24484 no EABI initialization function is called from @code{main}, and the
24485 @option{-msdata} option only uses @code{r13} to point to a single
24486 small data area.  The @option{-meabi} option is on by default if you
24487 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
24489 @item -msdata=eabi
24490 @opindex msdata=eabi
24491 On System V.4 and embedded PowerPC systems, put small initialized
24492 @code{const} global and static data in the @code{.sdata2} section, which
24493 is pointed to by register @code{r2}.  Put small initialized
24494 non-@code{const} global and static data in the @code{.sdata} section,
24495 which is pointed to by register @code{r13}.  Put small uninitialized
24496 global and static data in the @code{.sbss} section, which is adjacent to
24497 the @code{.sdata} section.  The @option{-msdata=eabi} option is
24498 incompatible with the @option{-mrelocatable} option.  The
24499 @option{-msdata=eabi} option also sets the @option{-memb} option.
24501 @item -msdata=sysv
24502 @opindex msdata=sysv
24503 On System V.4 and embedded PowerPC systems, put small global and static
24504 data in the @code{.sdata} section, which is pointed to by register
24505 @code{r13}.  Put small uninitialized global and static data in the
24506 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
24507 The @option{-msdata=sysv} option is incompatible with the
24508 @option{-mrelocatable} option.
24510 @item -msdata=default
24511 @itemx -msdata
24512 @opindex msdata=default
24513 @opindex msdata
24514 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
24515 compile code the same as @option{-msdata=eabi}, otherwise compile code the
24516 same as @option{-msdata=sysv}.
24518 @item -msdata=data
24519 @opindex msdata=data
24520 On System V.4 and embedded PowerPC systems, put small global
24521 data in the @code{.sdata} section.  Put small uninitialized global
24522 data in the @code{.sbss} section.  Do not use register @code{r13}
24523 to address small data however.  This is the default behavior unless
24524 other @option{-msdata} options are used.
24526 @item -msdata=none
24527 @itemx -mno-sdata
24528 @opindex msdata=none
24529 @opindex mno-sdata
24530 On embedded PowerPC systems, put all initialized global and static data
24531 in the @code{.data} section, and all uninitialized data in the
24532 @code{.bss} section.
24534 @item -mreadonly-in-sdata
24535 @opindex mreadonly-in-sdata
24536 @opindex mno-readonly-in-sdata
24537 Put read-only objects in the @code{.sdata} section as well.  This is the
24538 default.
24540 @item -mblock-move-inline-limit=@var{num}
24541 @opindex mblock-move-inline-limit
24542 Inline all block moves (such as calls to @code{memcpy} or structure
24543 copies) less than or equal to @var{num} bytes.  The minimum value for
24544 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
24545 targets.  The default value is target-specific.
24547 @item -mblock-compare-inline-limit=@var{num}
24548 @opindex mblock-compare-inline-limit
24549 Generate non-looping inline code for all block compares (such as calls
24550 to @code{memcmp} or structure compares) less than or equal to @var{num}
24551 bytes. If @var{num} is 0, all inline expansion (non-loop and loop) of
24552 block compare is disabled. The default value is target-specific.
24554 @item -mblock-compare-inline-loop-limit=@var{num}
24555 @opindex mblock-compare-inline-loop-limit
24556 Generate an inline expansion using loop code for all block compares that
24557 are less than or equal to @var{num} bytes, but greater than the limit
24558 for non-loop inline block compare expansion. If the block length is not
24559 constant, at most @var{num} bytes will be compared before @code{memcmp}
24560 is called to compare the remainder of the block. The default value is
24561 target-specific.
24563 @item -mstring-compare-inline-limit=@var{num}
24564 @opindex mstring-compare-inline-limit
24565 Compare at most @var{num} string bytes with inline code.
24566 If the difference or end of string is not found at the
24567 end of the inline compare a call to @code{strcmp} or @code{strncmp} will
24568 take care of the rest of the comparison. The default is 64 bytes.
24570 @item -G @var{num}
24571 @opindex G
24572 @cindex smaller data references (PowerPC)
24573 @cindex .sdata/.sdata2 references (PowerPC)
24574 On embedded PowerPC systems, put global and static items less than or
24575 equal to @var{num} bytes into the small data or BSS sections instead of
24576 the normal data or BSS section.  By default, @var{num} is 8.  The
24577 @option{-G @var{num}} switch is also passed to the linker.
24578 All modules should be compiled with the same @option{-G @var{num}} value.
24580 @item -mregnames
24581 @itemx -mno-regnames
24582 @opindex mregnames
24583 @opindex mno-regnames
24584 On System V.4 and embedded PowerPC systems do (do not) emit register
24585 names in the assembly language output using symbolic forms.
24587 @item -mlongcall
24588 @itemx -mno-longcall
24589 @opindex mlongcall
24590 @opindex mno-longcall
24591 By default assume that all calls are far away so that a longer and more
24592 expensive calling sequence is required.  This is required for calls
24593 farther than 32 megabytes (33,554,432 bytes) from the current location.
24594 A short call is generated if the compiler knows
24595 the call cannot be that far away.  This setting can be overridden by
24596 the @code{shortcall} function attribute, or by @code{#pragma
24597 longcall(0)}.
24599 Some linkers are capable of detecting out-of-range calls and generating
24600 glue code on the fly.  On these systems, long calls are unnecessary and
24601 generate slower code.  As of this writing, the AIX linker can do this,
24602 as can the GNU linker for PowerPC/64.  It is planned to add this feature
24603 to the GNU linker for 32-bit PowerPC systems as well.
24605 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
24606 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
24607 addresses represent the callee and the branch island.  The
24608 Darwin/PPC linker prefers the first address and generates a @code{bl
24609 callee} if the PPC @code{bl} instruction reaches the callee directly;
24610 otherwise, the linker generates @code{bl L42} to call the branch
24611 island.  The branch island is appended to the body of the
24612 calling function; it computes the full 32-bit address of the callee
24613 and jumps to it.
24615 On Mach-O (Darwin) systems, this option directs the compiler emit to
24616 the glue for every direct call, and the Darwin linker decides whether
24617 to use or discard it.
24619 In the future, GCC may ignore all longcall specifications
24620 when the linker is known to generate glue.
24622 @item -mtls-markers
24623 @itemx -mno-tls-markers
24624 @opindex mtls-markers
24625 @opindex mno-tls-markers
24626 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
24627 specifying the function argument.  The relocation allows the linker to
24628 reliably associate function call with argument setup instructions for
24629 TLS optimization, which in turn allows GCC to better schedule the
24630 sequence.
24632 @item -mrecip
24633 @itemx -mno-recip
24634 @opindex mrecip
24635 This option enables use of the reciprocal estimate and
24636 reciprocal square root estimate instructions with additional
24637 Newton-Raphson steps to increase precision instead of doing a divide or
24638 square root and divide for floating-point arguments.  You should use
24639 the @option{-ffast-math} option when using @option{-mrecip} (or at
24640 least @option{-funsafe-math-optimizations},
24641 @option{-ffinite-math-only}, @option{-freciprocal-math} and
24642 @option{-fno-trapping-math}).  Note that while the throughput of the
24643 sequence is generally higher than the throughput of the non-reciprocal
24644 instruction, the precision of the sequence can be decreased by up to 2
24645 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
24646 roots.
24648 @item -mrecip=@var{opt}
24649 @opindex mrecip=opt
24650 This option controls which reciprocal estimate instructions
24651 may be used.  @var{opt} is a comma-separated list of options, which may
24652 be preceded by a @code{!} to invert the option:
24654 @table @samp
24656 @item all
24657 Enable all estimate instructions.
24659 @item default 
24660 Enable the default instructions, equivalent to @option{-mrecip}.
24662 @item none 
24663 Disable all estimate instructions, equivalent to @option{-mno-recip}.
24665 @item div 
24666 Enable the reciprocal approximation instructions for both 
24667 single and double precision.
24669 @item divf 
24670 Enable the single-precision reciprocal approximation instructions.
24672 @item divd 
24673 Enable the double-precision reciprocal approximation instructions.
24675 @item rsqrt 
24676 Enable the reciprocal square root approximation instructions for both
24677 single and double precision.
24679 @item rsqrtf 
24680 Enable the single-precision reciprocal square root approximation instructions.
24682 @item rsqrtd 
24683 Enable the double-precision reciprocal square root approximation instructions.
24685 @end table
24687 So, for example, @option{-mrecip=all,!rsqrtd} enables
24688 all of the reciprocal estimate instructions, except for the
24689 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
24690 which handle the double-precision reciprocal square root calculations.
24692 @item -mrecip-precision
24693 @itemx -mno-recip-precision
24694 @opindex mrecip-precision
24695 Assume (do not assume) that the reciprocal estimate instructions
24696 provide higher-precision estimates than is mandated by the PowerPC
24697 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
24698 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
24699 The double-precision square root estimate instructions are not generated by
24700 default on low-precision machines, since they do not provide an
24701 estimate that converges after three steps.
24703 @item -mveclibabi=@var{type}
24704 @opindex mveclibabi
24705 Specifies the ABI type to use for vectorizing intrinsics using an
24706 external library.  The only type supported at present is @samp{mass},
24707 which specifies to use IBM's Mathematical Acceleration Subsystem
24708 (MASS) libraries for vectorizing intrinsics using external libraries.
24709 GCC currently emits calls to @code{acosd2}, @code{acosf4},
24710 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
24711 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
24712 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
24713 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
24714 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
24715 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
24716 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
24717 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
24718 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
24719 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
24720 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
24721 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
24722 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
24723 for power7.  Both @option{-ftree-vectorize} and
24724 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
24725 libraries must be specified at link time.
24727 @item -mfriz
24728 @itemx -mno-friz
24729 @opindex mfriz
24730 Generate (do not generate) the @code{friz} instruction when the
24731 @option{-funsafe-math-optimizations} option is used to optimize
24732 rounding of floating-point values to 64-bit integer and back to floating
24733 point.  The @code{friz} instruction does not return the same value if
24734 the floating-point number is too large to fit in an integer.
24736 @item -mpointers-to-nested-functions
24737 @itemx -mno-pointers-to-nested-functions
24738 @opindex mpointers-to-nested-functions
24739 Generate (do not generate) code to load up the static chain register
24740 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
24741 systems where a function pointer points to a 3-word descriptor giving
24742 the function address, TOC value to be loaded in register @code{r2}, and
24743 static chain value to be loaded in register @code{r11}.  The
24744 @option{-mpointers-to-nested-functions} is on by default.  You cannot
24745 call through pointers to nested functions or pointers
24746 to functions compiled in other languages that use the static chain if
24747 you use @option{-mno-pointers-to-nested-functions}.
24749 @item -msave-toc-indirect
24750 @itemx -mno-save-toc-indirect
24751 @opindex msave-toc-indirect
24752 Generate (do not generate) code to save the TOC value in the reserved
24753 stack location in the function prologue if the function calls through
24754 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
24755 saved in the prologue, it is saved just before the call through the
24756 pointer.  The @option{-mno-save-toc-indirect} option is the default.
24758 @item -mcompat-align-parm
24759 @itemx -mno-compat-align-parm
24760 @opindex mcompat-align-parm
24761 Generate (do not generate) code to pass structure parameters with a
24762 maximum alignment of 64 bits, for compatibility with older versions
24763 of GCC.
24765 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
24766 structure parameter on a 128-bit boundary when that structure contained
24767 a member requiring 128-bit alignment.  This is corrected in more
24768 recent versions of GCC.  This option may be used to generate code
24769 that is compatible with functions compiled with older versions of
24770 GCC.
24772 The @option{-mno-compat-align-parm} option is the default.
24774 @item -mstack-protector-guard=@var{guard}
24775 @itemx -mstack-protector-guard-reg=@var{reg}
24776 @itemx -mstack-protector-guard-offset=@var{offset}
24777 @itemx -mstack-protector-guard-symbol=@var{symbol}
24778 @opindex mstack-protector-guard
24779 @opindex mstack-protector-guard-reg
24780 @opindex mstack-protector-guard-offset
24781 @opindex mstack-protector-guard-symbol
24782 Generate stack protection code using canary at @var{guard}.  Supported
24783 locations are @samp{global} for global canary or @samp{tls} for per-thread
24784 canary in the TLS block (the default with GNU libc version 2.4 or later).
24786 With the latter choice the options
24787 @option{-mstack-protector-guard-reg=@var{reg}} and
24788 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
24789 which register to use as base register for reading the canary, and from what
24790 offset from that base register. The default for those is as specified in the
24791 relevant ABI.  @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
24792 the offset with a symbol reference to a canary in the TLS block.
24793 @end table
24795 @node RX Options
24796 @subsection RX Options
24797 @cindex RX Options
24799 These command-line options are defined for RX targets:
24801 @table @gcctabopt
24802 @item -m64bit-doubles
24803 @itemx -m32bit-doubles
24804 @opindex m64bit-doubles
24805 @opindex m32bit-doubles
24806 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
24807 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
24808 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
24809 works on 32-bit values, which is why the default is
24810 @option{-m32bit-doubles}.
24812 @item -fpu
24813 @itemx -nofpu
24814 @opindex fpu
24815 @opindex nofpu
24816 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
24817 floating-point hardware.  The default is enabled for the RX600
24818 series and disabled for the RX200 series.
24820 Floating-point instructions are only generated for 32-bit floating-point 
24821 values, however, so the FPU hardware is not used for doubles if the
24822 @option{-m64bit-doubles} option is used.
24824 @emph{Note} If the @option{-fpu} option is enabled then
24825 @option{-funsafe-math-optimizations} is also enabled automatically.
24826 This is because the RX FPU instructions are themselves unsafe.
24828 @item -mcpu=@var{name}
24829 @opindex mcpu
24830 Selects the type of RX CPU to be targeted.  Currently three types are
24831 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
24832 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
24834 The only difference between @samp{RX600} and @samp{RX610} is that the
24835 @samp{RX610} does not support the @code{MVTIPL} instruction.
24837 The @samp{RX200} series does not have a hardware floating-point unit
24838 and so @option{-nofpu} is enabled by default when this type is
24839 selected.
24841 @item -mbig-endian-data
24842 @itemx -mlittle-endian-data
24843 @opindex mbig-endian-data
24844 @opindex mlittle-endian-data
24845 Store data (but not code) in the big-endian format.  The default is
24846 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
24847 format.
24849 @item -msmall-data-limit=@var{N}
24850 @opindex msmall-data-limit
24851 Specifies the maximum size in bytes of global and static variables
24852 which can be placed into the small data area.  Using the small data
24853 area can lead to smaller and faster code, but the size of area is
24854 limited and it is up to the programmer to ensure that the area does
24855 not overflow.  Also when the small data area is used one of the RX's
24856 registers (usually @code{r13}) is reserved for use pointing to this
24857 area, so it is no longer available for use by the compiler.  This
24858 could result in slower and/or larger code if variables are pushed onto
24859 the stack instead of being held in this register.
24861 Note, common variables (variables that have not been initialized) and
24862 constants are not placed into the small data area as they are assigned
24863 to other sections in the output executable.
24865 The default value is zero, which disables this feature.  Note, this
24866 feature is not enabled by default with higher optimization levels
24867 (@option{-O2} etc) because of the potentially detrimental effects of
24868 reserving a register.  It is up to the programmer to experiment and
24869 discover whether this feature is of benefit to their program.  See the
24870 description of the @option{-mpid} option for a description of how the
24871 actual register to hold the small data area pointer is chosen.
24873 @item -msim
24874 @itemx -mno-sim
24875 @opindex msim
24876 @opindex mno-sim
24877 Use the simulator runtime.  The default is to use the libgloss
24878 board-specific runtime.
24880 @item -mas100-syntax
24881 @itemx -mno-as100-syntax
24882 @opindex mas100-syntax
24883 @opindex mno-as100-syntax
24884 When generating assembler output use a syntax that is compatible with
24885 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
24886 assembler, but it has some restrictions so it is not generated by default.
24888 @item -mmax-constant-size=@var{N}
24889 @opindex mmax-constant-size
24890 Specifies the maximum size, in bytes, of a constant that can be used as
24891 an operand in a RX instruction.  Although the RX instruction set does
24892 allow constants of up to 4 bytes in length to be used in instructions,
24893 a longer value equates to a longer instruction.  Thus in some
24894 circumstances it can be beneficial to restrict the size of constants
24895 that are used in instructions.  Constants that are too big are instead
24896 placed into a constant pool and referenced via register indirection.
24898 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
24899 or 4 means that constants of any size are allowed.
24901 @item -mrelax
24902 @opindex mrelax
24903 Enable linker relaxation.  Linker relaxation is a process whereby the
24904 linker attempts to reduce the size of a program by finding shorter
24905 versions of various instructions.  Disabled by default.
24907 @item -mint-register=@var{N}
24908 @opindex mint-register
24909 Specify the number of registers to reserve for fast interrupt handler
24910 functions.  The value @var{N} can be between 0 and 4.  A value of 1
24911 means that register @code{r13} is reserved for the exclusive use
24912 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
24913 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
24914 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
24915 A value of 0, the default, does not reserve any registers.
24917 @item -msave-acc-in-interrupts
24918 @opindex msave-acc-in-interrupts
24919 Specifies that interrupt handler functions should preserve the
24920 accumulator register.  This is only necessary if normal code might use
24921 the accumulator register, for example because it performs 64-bit
24922 multiplications.  The default is to ignore the accumulator as this
24923 makes the interrupt handlers faster.
24925 @item -mpid
24926 @itemx -mno-pid
24927 @opindex mpid
24928 @opindex mno-pid
24929 Enables the generation of position independent data.  When enabled any
24930 access to constant data is done via an offset from a base address
24931 held in a register.  This allows the location of constant data to be
24932 determined at run time without requiring the executable to be
24933 relocated, which is a benefit to embedded applications with tight
24934 memory constraints.  Data that can be modified is not affected by this
24935 option.
24937 Note, using this feature reserves a register, usually @code{r13}, for
24938 the constant data base address.  This can result in slower and/or
24939 larger code, especially in complicated functions.
24941 The actual register chosen to hold the constant data base address
24942 depends upon whether the @option{-msmall-data-limit} and/or the
24943 @option{-mint-register} command-line options are enabled.  Starting
24944 with register @code{r13} and proceeding downwards, registers are
24945 allocated first to satisfy the requirements of @option{-mint-register},
24946 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
24947 is possible for the small data area register to be @code{r8} if both
24948 @option{-mint-register=4} and @option{-mpid} are specified on the
24949 command line.
24951 By default this feature is not enabled.  The default can be restored
24952 via the @option{-mno-pid} command-line option.
24954 @item -mno-warn-multiple-fast-interrupts
24955 @itemx -mwarn-multiple-fast-interrupts
24956 @opindex mno-warn-multiple-fast-interrupts
24957 @opindex mwarn-multiple-fast-interrupts
24958 Prevents GCC from issuing a warning message if it finds more than one
24959 fast interrupt handler when it is compiling a file.  The default is to
24960 issue a warning for each extra fast interrupt handler found, as the RX
24961 only supports one such interrupt.
24963 @item -mallow-string-insns
24964 @itemx -mno-allow-string-insns
24965 @opindex mallow-string-insns
24966 @opindex mno-allow-string-insns
24967 Enables or disables the use of the string manipulation instructions
24968 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
24969 @code{SWHILE} and also the @code{RMPA} instruction.  These
24970 instructions may prefetch data, which is not safe to do if accessing
24971 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
24972 for more information).
24974 The default is to allow these instructions, but it is not possible for
24975 GCC to reliably detect all circumstances where a string instruction
24976 might be used to access an I/O register, so their use cannot be
24977 disabled automatically.  Instead it is reliant upon the programmer to
24978 use the @option{-mno-allow-string-insns} option if their program
24979 accesses I/O space.
24981 When the instructions are enabled GCC defines the C preprocessor
24982 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
24983 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
24985 @item -mjsr
24986 @itemx -mno-jsr
24987 @opindex mjsr
24988 @opindex mno-jsr
24989 Use only (or not only) @code{JSR} instructions to access functions.
24990 This option can be used when code size exceeds the range of @code{BSR}
24991 instructions.  Note that @option{-mno-jsr} does not mean to not use
24992 @code{JSR} but instead means that any type of branch may be used.
24993 @end table
24995 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
24996 has special significance to the RX port when used with the
24997 @code{interrupt} function attribute.  This attribute indicates a
24998 function intended to process fast interrupts.  GCC ensures
24999 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
25000 and/or @code{r13} and only provided that the normal use of the
25001 corresponding registers have been restricted via the
25002 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
25003 options.
25005 @node S/390 and zSeries Options
25006 @subsection S/390 and zSeries Options
25007 @cindex S/390 and zSeries Options
25009 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
25011 @table @gcctabopt
25012 @item -mhard-float
25013 @itemx -msoft-float
25014 @opindex mhard-float
25015 @opindex msoft-float
25016 Use (do not use) the hardware floating-point instructions and registers
25017 for floating-point operations.  When @option{-msoft-float} is specified,
25018 functions in @file{libgcc.a} are used to perform floating-point
25019 operations.  When @option{-mhard-float} is specified, the compiler
25020 generates IEEE floating-point instructions.  This is the default.
25022 @item -mhard-dfp
25023 @itemx -mno-hard-dfp
25024 @opindex mhard-dfp
25025 @opindex mno-hard-dfp
25026 Use (do not use) the hardware decimal-floating-point instructions for
25027 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
25028 specified, functions in @file{libgcc.a} are used to perform
25029 decimal-floating-point operations.  When @option{-mhard-dfp} is
25030 specified, the compiler generates decimal-floating-point hardware
25031 instructions.  This is the default for @option{-march=z9-ec} or higher.
25033 @item -mlong-double-64
25034 @itemx -mlong-double-128
25035 @opindex mlong-double-64
25036 @opindex mlong-double-128
25037 These switches control the size of @code{long double} type. A size
25038 of 64 bits makes the @code{long double} type equivalent to the @code{double}
25039 type. This is the default.
25041 @item -mbackchain
25042 @itemx -mno-backchain
25043 @opindex mbackchain
25044 @opindex mno-backchain
25045 Store (do not store) the address of the caller's frame as backchain pointer
25046 into the callee's stack frame.
25047 A backchain may be needed to allow debugging using tools that do not understand
25048 DWARF call frame information.
25049 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
25050 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
25051 the backchain is placed into the topmost word of the 96/160 byte register
25052 save area.
25054 In general, code compiled with @option{-mbackchain} is call-compatible with
25055 code compiled with @option{-mmo-backchain}; however, use of the backchain
25056 for debugging purposes usually requires that the whole binary is built with
25057 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
25058 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
25059 to build a linux kernel use @option{-msoft-float}.
25061 The default is to not maintain the backchain.
25063 @item -mpacked-stack
25064 @itemx -mno-packed-stack
25065 @opindex mpacked-stack
25066 @opindex mno-packed-stack
25067 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
25068 specified, the compiler uses the all fields of the 96/160 byte register save
25069 area only for their default purpose; unused fields still take up stack space.
25070 When @option{-mpacked-stack} is specified, register save slots are densely
25071 packed at the top of the register save area; unused space is reused for other
25072 purposes, allowing for more efficient use of the available stack space.
25073 However, when @option{-mbackchain} is also in effect, the topmost word of
25074 the save area is always used to store the backchain, and the return address
25075 register is always saved two words below the backchain.
25077 As long as the stack frame backchain is not used, code generated with
25078 @option{-mpacked-stack} is call-compatible with code generated with
25079 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
25080 S/390 or zSeries generated code that uses the stack frame backchain at run
25081 time, not just for debugging purposes.  Such code is not call-compatible
25082 with code compiled with @option{-mpacked-stack}.  Also, note that the
25083 combination of @option{-mbackchain},
25084 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
25085 to build a linux kernel use @option{-msoft-float}.
25087 The default is to not use the packed stack layout.
25089 @item -msmall-exec
25090 @itemx -mno-small-exec
25091 @opindex msmall-exec
25092 @opindex mno-small-exec
25093 Generate (or do not generate) code using the @code{bras} instruction
25094 to do subroutine calls.
25095 This only works reliably if the total executable size does not
25096 exceed 64k.  The default is to use the @code{basr} instruction instead,
25097 which does not have this limitation.
25099 @item -m64
25100 @itemx -m31
25101 @opindex m64
25102 @opindex m31
25103 When @option{-m31} is specified, generate code compliant to the
25104 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
25105 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
25106 particular to generate 64-bit instructions.  For the @samp{s390}
25107 targets, the default is @option{-m31}, while the @samp{s390x}
25108 targets default to @option{-m64}.
25110 @item -mzarch
25111 @itemx -mesa
25112 @opindex mzarch
25113 @opindex mesa
25114 When @option{-mzarch} is specified, generate code using the
25115 instructions available on z/Architecture.
25116 When @option{-mesa} is specified, generate code using the
25117 instructions available on ESA/390.  Note that @option{-mesa} is
25118 not possible with @option{-m64}.
25119 When generating code compliant to the GNU/Linux for S/390 ABI,
25120 the default is @option{-mesa}.  When generating code compliant
25121 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
25123 @item -mhtm
25124 @itemx -mno-htm
25125 @opindex mhtm
25126 @opindex mno-htm
25127 The @option{-mhtm} option enables a set of builtins making use of
25128 instructions available with the transactional execution facility
25129 introduced with the IBM zEnterprise EC12 machine generation
25130 @ref{S/390 System z Built-in Functions}.
25131 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
25133 @item -mvx
25134 @itemx -mno-vx
25135 @opindex mvx
25136 @opindex mno-vx
25137 When @option{-mvx} is specified, generate code using the instructions
25138 available with the vector extension facility introduced with the IBM
25139 z13 machine generation.
25140 This option changes the ABI for some vector type values with regard to
25141 alignment and calling conventions.  In case vector type values are
25142 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
25143 command will be added to mark the resulting binary with the ABI used.
25144 @option{-mvx} is enabled by default when using @option{-march=z13}.
25146 @item -mzvector
25147 @itemx -mno-zvector
25148 @opindex mzvector
25149 @opindex mno-zvector
25150 The @option{-mzvector} option enables vector language extensions and
25151 builtins using instructions available with the vector extension
25152 facility introduced with the IBM z13 machine generation.
25153 This option adds support for @samp{vector} to be used as a keyword to
25154 define vector type variables and arguments.  @samp{vector} is only
25155 available when GNU extensions are enabled.  It will not be expanded
25156 when requesting strict standard compliance e.g. with @option{-std=c99}.
25157 In addition to the GCC low-level builtins @option{-mzvector} enables
25158 a set of builtins added for compatibility with AltiVec-style
25159 implementations like Power and Cell.  In order to make use of these
25160 builtins the header file @file{vecintrin.h} needs to be included.
25161 @option{-mzvector} is disabled by default.
25163 @item -mmvcle
25164 @itemx -mno-mvcle
25165 @opindex mmvcle
25166 @opindex mno-mvcle
25167 Generate (or do not generate) code using the @code{mvcle} instruction
25168 to perform block moves.  When @option{-mno-mvcle} is specified,
25169 use a @code{mvc} loop instead.  This is the default unless optimizing for
25170 size.
25172 @item -mdebug
25173 @itemx -mno-debug
25174 @opindex mdebug
25175 @opindex mno-debug
25176 Print (or do not print) additional debug information when compiling.
25177 The default is to not print debug information.
25179 @item -march=@var{cpu-type}
25180 @opindex march
25181 Generate code that runs on @var{cpu-type}, which is the name of a
25182 system representing a certain processor type.  Possible values for
25183 @var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
25184 @samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
25185 @samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11}, and
25186 @samp{native}.
25188 The default is @option{-march=z900}.
25190 Specifying @samp{native} as cpu type can be used to select the best
25191 architecture option for the host processor.
25192 @option{-march=native} has no effect if GCC does not recognize the
25193 processor.
25195 @item -mtune=@var{cpu-type}
25196 @opindex mtune
25197 Tune to @var{cpu-type} everything applicable about the generated code,
25198 except for the ABI and the set of available instructions.
25199 The list of @var{cpu-type} values is the same as for @option{-march}.
25200 The default is the value used for @option{-march}.
25202 @item -mtpf-trace
25203 @itemx -mno-tpf-trace
25204 @opindex mtpf-trace
25205 @opindex mno-tpf-trace
25206 Generate code that adds (does not add) in TPF OS specific branches to trace
25207 routines in the operating system.  This option is off by default, even
25208 when compiling for the TPF OS@.
25210 @item -mfused-madd
25211 @itemx -mno-fused-madd
25212 @opindex mfused-madd
25213 @opindex mno-fused-madd
25214 Generate code that uses (does not use) the floating-point multiply and
25215 accumulate instructions.  These instructions are generated by default if
25216 hardware floating point is used.
25218 @item -mwarn-framesize=@var{framesize}
25219 @opindex mwarn-framesize
25220 Emit a warning if the current function exceeds the given frame size.  Because
25221 this is a compile-time check it doesn't need to be a real problem when the program
25222 runs.  It is intended to identify functions that most probably cause
25223 a stack overflow.  It is useful to be used in an environment with limited stack
25224 size e.g.@: the linux kernel.
25226 @item -mwarn-dynamicstack
25227 @opindex mwarn-dynamicstack
25228 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
25229 arrays.  This is generally a bad idea with a limited stack size.
25231 @item -mstack-guard=@var{stack-guard}
25232 @itemx -mstack-size=@var{stack-size}
25233 @opindex mstack-guard
25234 @opindex mstack-size
25235 If these options are provided the S/390 back end emits additional instructions in
25236 the function prologue that trigger a trap if the stack size is @var{stack-guard}
25237 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
25238 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
25239 the frame size of the compiled function is chosen.
25240 These options are intended to be used to help debugging stack overflow problems.
25241 The additionally emitted code causes only little overhead and hence can also be
25242 used in production-like systems without greater performance degradation.  The given
25243 values have to be exact powers of 2 and @var{stack-size} has to be greater than
25244 @var{stack-guard} without exceeding 64k.
25245 In order to be efficient the extra code makes the assumption that the stack starts
25246 at an address aligned to the value given by @var{stack-size}.
25247 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
25249 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
25250 @opindex mhotpatch
25251 If the hotpatch option is enabled, a ``hot-patching'' function
25252 prologue is generated for all functions in the compilation unit.
25253 The funtion label is prepended with the given number of two-byte
25254 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
25255 the label, 2 * @var{post-halfwords} bytes are appended, using the
25256 largest NOP like instructions the architecture allows (maximum
25257 1000000).
25259 If both arguments are zero, hotpatching is disabled.
25261 This option can be overridden for individual functions with the
25262 @code{hotpatch} attribute.
25263 @end table
25265 @node Score Options
25266 @subsection Score Options
25267 @cindex Score Options
25269 These options are defined for Score implementations:
25271 @table @gcctabopt
25272 @item -meb
25273 @opindex meb
25274 Compile code for big-endian mode.  This is the default.
25276 @item -mel
25277 @opindex mel
25278 Compile code for little-endian mode.
25280 @item -mnhwloop
25281 @opindex mnhwloop
25282 Disable generation of @code{bcnz} instructions.
25284 @item -muls
25285 @opindex muls
25286 Enable generation of unaligned load and store instructions.
25288 @item -mmac
25289 @opindex mmac
25290 Enable the use of multiply-accumulate instructions. Disabled by default.
25292 @item -mscore5
25293 @opindex mscore5
25294 Specify the SCORE5 as the target architecture.
25296 @item -mscore5u
25297 @opindex mscore5u
25298 Specify the SCORE5U of the target architecture.
25300 @item -mscore7
25301 @opindex mscore7
25302 Specify the SCORE7 as the target architecture. This is the default.
25304 @item -mscore7d
25305 @opindex mscore7d
25306 Specify the SCORE7D as the target architecture.
25307 @end table
25309 @node SH Options
25310 @subsection SH Options
25312 These @samp{-m} options are defined for the SH implementations:
25314 @table @gcctabopt
25315 @item -m1
25316 @opindex m1
25317 Generate code for the SH1.
25319 @item -m2
25320 @opindex m2
25321 Generate code for the SH2.
25323 @item -m2e
25324 Generate code for the SH2e.
25326 @item -m2a-nofpu
25327 @opindex m2a-nofpu
25328 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
25329 that the floating-point unit is not used.
25331 @item -m2a-single-only
25332 @opindex m2a-single-only
25333 Generate code for the SH2a-FPU, in such a way that no double-precision
25334 floating-point operations are used.
25336 @item -m2a-single
25337 @opindex m2a-single
25338 Generate code for the SH2a-FPU assuming the floating-point unit is in
25339 single-precision mode by default.
25341 @item -m2a
25342 @opindex m2a
25343 Generate code for the SH2a-FPU assuming the floating-point unit is in
25344 double-precision mode by default.
25346 @item -m3
25347 @opindex m3
25348 Generate code for the SH3.
25350 @item -m3e
25351 @opindex m3e
25352 Generate code for the SH3e.
25354 @item -m4-nofpu
25355 @opindex m4-nofpu
25356 Generate code for the SH4 without a floating-point unit.
25358 @item -m4-single-only
25359 @opindex m4-single-only
25360 Generate code for the SH4 with a floating-point unit that only
25361 supports single-precision arithmetic.
25363 @item -m4-single
25364 @opindex m4-single
25365 Generate code for the SH4 assuming the floating-point unit is in
25366 single-precision mode by default.
25368 @item -m4
25369 @opindex m4
25370 Generate code for the SH4.
25372 @item -m4-100
25373 @opindex m4-100
25374 Generate code for SH4-100.
25376 @item -m4-100-nofpu
25377 @opindex m4-100-nofpu
25378 Generate code for SH4-100 in such a way that the
25379 floating-point unit is not used.
25381 @item -m4-100-single
25382 @opindex m4-100-single
25383 Generate code for SH4-100 assuming the floating-point unit is in
25384 single-precision mode by default.
25386 @item -m4-100-single-only
25387 @opindex m4-100-single-only
25388 Generate code for SH4-100 in such a way that no double-precision
25389 floating-point operations are used.
25391 @item -m4-200
25392 @opindex m4-200
25393 Generate code for SH4-200.
25395 @item -m4-200-nofpu
25396 @opindex m4-200-nofpu
25397 Generate code for SH4-200 without in such a way that the
25398 floating-point unit is not used.
25400 @item -m4-200-single
25401 @opindex m4-200-single
25402 Generate code for SH4-200 assuming the floating-point unit is in
25403 single-precision mode by default.
25405 @item -m4-200-single-only
25406 @opindex m4-200-single-only
25407 Generate code for SH4-200 in such a way that no double-precision
25408 floating-point operations are used.
25410 @item -m4-300
25411 @opindex m4-300
25412 Generate code for SH4-300.
25414 @item -m4-300-nofpu
25415 @opindex m4-300-nofpu
25416 Generate code for SH4-300 without in such a way that the
25417 floating-point unit is not used.
25419 @item -m4-300-single
25420 @opindex m4-300-single
25421 Generate code for SH4-300 in such a way that no double-precision
25422 floating-point operations are used.
25424 @item -m4-300-single-only
25425 @opindex m4-300-single-only
25426 Generate code for SH4-300 in such a way that no double-precision
25427 floating-point operations are used.
25429 @item -m4-340
25430 @opindex m4-340
25431 Generate code for SH4-340 (no MMU, no FPU).
25433 @item -m4-500
25434 @opindex m4-500
25435 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
25436 assembler.
25438 @item -m4a-nofpu
25439 @opindex m4a-nofpu
25440 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
25441 floating-point unit is not used.
25443 @item -m4a-single-only
25444 @opindex m4a-single-only
25445 Generate code for the SH4a, in such a way that no double-precision
25446 floating-point operations are used.
25448 @item -m4a-single
25449 @opindex m4a-single
25450 Generate code for the SH4a assuming the floating-point unit is in
25451 single-precision mode by default.
25453 @item -m4a
25454 @opindex m4a
25455 Generate code for the SH4a.
25457 @item -m4al
25458 @opindex m4al
25459 Same as @option{-m4a-nofpu}, except that it implicitly passes
25460 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
25461 instructions at the moment.
25463 @item -mb
25464 @opindex mb
25465 Compile code for the processor in big-endian mode.
25467 @item -ml
25468 @opindex ml
25469 Compile code for the processor in little-endian mode.
25471 @item -mdalign
25472 @opindex mdalign
25473 Align doubles at 64-bit boundaries.  Note that this changes the calling
25474 conventions, and thus some functions from the standard C library do
25475 not work unless you recompile it first with @option{-mdalign}.
25477 @item -mrelax
25478 @opindex mrelax
25479 Shorten some address references at link time, when possible; uses the
25480 linker option @option{-relax}.
25482 @item -mbigtable
25483 @opindex mbigtable
25484 Use 32-bit offsets in @code{switch} tables.  The default is to use
25485 16-bit offsets.
25487 @item -mbitops
25488 @opindex mbitops
25489 Enable the use of bit manipulation instructions on SH2A.
25491 @item -mfmovd
25492 @opindex mfmovd
25493 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
25494 alignment constraints.
25496 @item -mrenesas
25497 @opindex mrenesas
25498 Comply with the calling conventions defined by Renesas.
25500 @item -mno-renesas
25501 @opindex mno-renesas
25502 Comply with the calling conventions defined for GCC before the Renesas
25503 conventions were available.  This option is the default for all
25504 targets of the SH toolchain.
25506 @item -mnomacsave
25507 @opindex mnomacsave
25508 Mark the @code{MAC} register as call-clobbered, even if
25509 @option{-mrenesas} is given.
25511 @item -mieee
25512 @itemx -mno-ieee
25513 @opindex mieee
25514 @opindex mno-ieee
25515 Control the IEEE compliance of floating-point comparisons, which affects the
25516 handling of cases where the result of a comparison is unordered.  By default
25517 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
25518 enabled @option{-mno-ieee} is implicitly set, which results in faster
25519 floating-point greater-equal and less-equal comparisons.  The implicit settings
25520 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
25522 @item -minline-ic_invalidate
25523 @opindex minline-ic_invalidate
25524 Inline code to invalidate instruction cache entries after setting up
25525 nested function trampolines.
25526 This option has no effect if @option{-musermode} is in effect and the selected
25527 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
25528 instruction.
25529 If the selected code generation option does not allow the use of the @code{icbi}
25530 instruction, and @option{-musermode} is not in effect, the inlined code
25531 manipulates the instruction cache address array directly with an associative
25532 write.  This not only requires privileged mode at run time, but it also
25533 fails if the cache line had been mapped via the TLB and has become unmapped.
25535 @item -misize
25536 @opindex misize
25537 Dump instruction size and location in the assembly code.
25539 @item -mpadstruct
25540 @opindex mpadstruct
25541 This option is deprecated.  It pads structures to multiple of 4 bytes,
25542 which is incompatible with the SH ABI@.
25544 @item -matomic-model=@var{model}
25545 @opindex matomic-model=@var{model}
25546 Sets the model of atomic operations and additional parameters as a comma
25547 separated list.  For details on the atomic built-in functions see
25548 @ref{__atomic Builtins}.  The following models and parameters are supported:
25550 @table @samp
25552 @item none
25553 Disable compiler generated atomic sequences and emit library calls for atomic
25554 operations.  This is the default if the target is not @code{sh*-*-linux*}.
25556 @item soft-gusa
25557 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
25558 built-in functions.  The generated atomic sequences require additional support
25559 from the interrupt/exception handling code of the system and are only suitable
25560 for SH3* and SH4* single-core systems.  This option is enabled by default when
25561 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
25562 this option also partially utilizes the hardware atomic instructions
25563 @code{movli.l} and @code{movco.l} to create more efficient code, unless
25564 @samp{strict} is specified.  
25566 @item soft-tcb
25567 Generate software atomic sequences that use a variable in the thread control
25568 block.  This is a variation of the gUSA sequences which can also be used on
25569 SH1* and SH2* targets.  The generated atomic sequences require additional
25570 support from the interrupt/exception handling code of the system and are only
25571 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
25572 parameter has to be specified as well.
25574 @item soft-imask
25575 Generate software atomic sequences that temporarily disable interrupts by
25576 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
25577 in privileged mode and is only suitable for single-core systems.  Additional
25578 support from the interrupt/exception handling code of the system is not
25579 required.  This model is enabled by default when the target is
25580 @code{sh*-*-linux*} and SH1* or SH2*.
25582 @item hard-llcs
25583 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
25584 instructions only.  This is only available on SH4A and is suitable for
25585 multi-core systems.  Since the hardware instructions support only 32 bit atomic
25586 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
25587 Code compiled with this option is also compatible with other software
25588 atomic model interrupt/exception handling systems if executed on an SH4A
25589 system.  Additional support from the interrupt/exception handling code of the
25590 system is not required for this model.
25592 @item gbr-offset=
25593 This parameter specifies the offset in bytes of the variable in the thread
25594 control block structure that should be used by the generated atomic sequences
25595 when the @samp{soft-tcb} model has been selected.  For other models this
25596 parameter is ignored.  The specified value must be an integer multiple of four
25597 and in the range 0-1020.
25599 @item strict
25600 This parameter prevents mixed usage of multiple atomic models, even if they
25601 are compatible, and makes the compiler generate atomic sequences of the
25602 specified model only.
25604 @end table
25606 @item -mtas
25607 @opindex mtas
25608 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
25609 Notice that depending on the particular hardware and software configuration
25610 this can degrade overall performance due to the operand cache line flushes
25611 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
25612 processors the @code{tas.b} instruction must be used with caution since it
25613 can result in data corruption for certain cache configurations.
25615 @item -mprefergot
25616 @opindex mprefergot
25617 When generating position-independent code, emit function calls using
25618 the Global Offset Table instead of the Procedure Linkage Table.
25620 @item -musermode
25621 @itemx -mno-usermode
25622 @opindex musermode
25623 @opindex mno-usermode
25624 Don't allow (allow) the compiler generating privileged mode code.  Specifying
25625 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
25626 inlined code would not work in user mode.  @option{-musermode} is the default
25627 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
25628 @option{-musermode} has no effect, since there is no user mode.
25630 @item -multcost=@var{number}
25631 @opindex multcost=@var{number}
25632 Set the cost to assume for a multiply insn.
25634 @item -mdiv=@var{strategy}
25635 @opindex mdiv=@var{strategy}
25636 Set the division strategy to be used for integer division operations.
25637 @var{strategy} can be one of: 
25639 @table @samp
25641 @item call-div1
25642 Calls a library function that uses the single-step division instruction
25643 @code{div1} to perform the operation.  Division by zero calculates an
25644 unspecified result and does not trap.  This is the default except for SH4,
25645 SH2A and SHcompact.
25647 @item call-fp
25648 Calls a library function that performs the operation in double precision
25649 floating point.  Division by zero causes a floating-point exception.  This is
25650 the default for SHcompact with FPU.  Specifying this for targets that do not
25651 have a double precision FPU defaults to @code{call-div1}.
25653 @item call-table
25654 Calls a library function that uses a lookup table for small divisors and
25655 the @code{div1} instruction with case distinction for larger divisors.  Division
25656 by zero calculates an unspecified result and does not trap.  This is the default
25657 for SH4.  Specifying this for targets that do not have dynamic shift
25658 instructions defaults to @code{call-div1}.
25660 @end table
25662 When a division strategy has not been specified the default strategy is
25663 selected based on the current target.  For SH2A the default strategy is to
25664 use the @code{divs} and @code{divu} instructions instead of library function
25665 calls.
25667 @item -maccumulate-outgoing-args
25668 @opindex maccumulate-outgoing-args
25669 Reserve space once for outgoing arguments in the function prologue rather
25670 than around each call.  Generally beneficial for performance and size.  Also
25671 needed for unwinding to avoid changing the stack frame around conditional code.
25673 @item -mdivsi3_libfunc=@var{name}
25674 @opindex mdivsi3_libfunc=@var{name}
25675 Set the name of the library function used for 32-bit signed division to
25676 @var{name}.
25677 This only affects the name used in the @samp{call} division strategies, and
25678 the compiler still expects the same sets of input/output/clobbered registers as
25679 if this option were not present.
25681 @item -mfixed-range=@var{register-range}
25682 @opindex mfixed-range
25683 Generate code treating the given register range as fixed registers.
25684 A fixed register is one that the register allocator can not use.  This is
25685 useful when compiling kernel code.  A register range is specified as
25686 two registers separated by a dash.  Multiple register ranges can be
25687 specified separated by a comma.
25689 @item -mbranch-cost=@var{num}
25690 @opindex mbranch-cost=@var{num}
25691 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
25692 make the compiler try to generate more branch-free code if possible.  
25693 If not specified the value is selected depending on the processor type that
25694 is being compiled for.
25696 @item -mzdcbranch
25697 @itemx -mno-zdcbranch
25698 @opindex mzdcbranch
25699 @opindex mno-zdcbranch
25700 Assume (do not assume) that zero displacement conditional branch instructions
25701 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
25702 compiler prefers zero displacement branch code sequences.  This is
25703 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
25704 disabled by specifying @option{-mno-zdcbranch}.
25706 @item -mcbranch-force-delay-slot
25707 @opindex mcbranch-force-delay-slot
25708 Force the usage of delay slots for conditional branches, which stuffs the delay
25709 slot with a @code{nop} if a suitable instruction cannot be found.  By default
25710 this option is disabled.  It can be enabled to work around hardware bugs as
25711 found in the original SH7055.
25713 @item -mfused-madd
25714 @itemx -mno-fused-madd
25715 @opindex mfused-madd
25716 @opindex mno-fused-madd
25717 Generate code that uses (does not use) the floating-point multiply and
25718 accumulate instructions.  These instructions are generated by default
25719 if hardware floating point is used.  The machine-dependent
25720 @option{-mfused-madd} option is now mapped to the machine-independent
25721 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
25722 mapped to @option{-ffp-contract=off}.
25724 @item -mfsca
25725 @itemx -mno-fsca
25726 @opindex mfsca
25727 @opindex mno-fsca
25728 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
25729 and cosine approximations.  The option @option{-mfsca} must be used in
25730 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
25731 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
25732 approximations even if @option{-funsafe-math-optimizations} is in effect.
25734 @item -mfsrra
25735 @itemx -mno-fsrra
25736 @opindex mfsrra
25737 @opindex mno-fsrra
25738 Allow or disallow the compiler to emit the @code{fsrra} instruction for
25739 reciprocal square root approximations.  The option @option{-mfsrra} must be used
25740 in combination with @option{-funsafe-math-optimizations} and
25741 @option{-ffinite-math-only}.  It is enabled by default when generating code for
25742 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
25743 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
25744 in effect.
25746 @item -mpretend-cmove
25747 @opindex mpretend-cmove
25748 Prefer zero-displacement conditional branches for conditional move instruction
25749 patterns.  This can result in faster code on the SH4 processor.
25751 @item -mfdpic
25752 @opindex fdpic
25753 Generate code using the FDPIC ABI.
25755 @end table
25757 @node Solaris 2 Options
25758 @subsection Solaris 2 Options
25759 @cindex Solaris 2 options
25761 These @samp{-m} options are supported on Solaris 2:
25763 @table @gcctabopt
25764 @item -mclear-hwcap
25765 @opindex mclear-hwcap
25766 @option{-mclear-hwcap} tells the compiler to remove the hardware
25767 capabilities generated by the Solaris assembler.  This is only necessary
25768 when object files use ISA extensions not supported by the current
25769 machine, but check at runtime whether or not to use them.
25771 @item -mimpure-text
25772 @opindex mimpure-text
25773 @option{-mimpure-text}, used in addition to @option{-shared}, tells
25774 the compiler to not pass @option{-z text} to the linker when linking a
25775 shared object.  Using this option, you can link position-dependent
25776 code into a shared object.
25778 @option{-mimpure-text} suppresses the ``relocations remain against
25779 allocatable but non-writable sections'' linker error message.
25780 However, the necessary relocations trigger copy-on-write, and the
25781 shared object is not actually shared across processes.  Instead of
25782 using @option{-mimpure-text}, you should compile all source code with
25783 @option{-fpic} or @option{-fPIC}.
25785 @end table
25787 These switches are supported in addition to the above on Solaris 2:
25789 @table @gcctabopt
25790 @item -pthreads
25791 @opindex pthreads
25792 This is a synonym for @option{-pthread}.
25793 @end table
25795 @node SPARC Options
25796 @subsection SPARC Options
25797 @cindex SPARC options
25799 These @samp{-m} options are supported on the SPARC:
25801 @table @gcctabopt
25802 @item -mno-app-regs
25803 @itemx -mapp-regs
25804 @opindex mno-app-regs
25805 @opindex mapp-regs
25806 Specify @option{-mapp-regs} to generate output using the global registers
25807 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
25808 global register 1, each global register 2 through 4 is then treated as an
25809 allocable register that is clobbered by function calls.  This is the default.
25811 To be fully SVR4 ABI-compliant at the cost of some performance loss,
25812 specify @option{-mno-app-regs}.  You should compile libraries and system
25813 software with this option.
25815 @item -mflat
25816 @itemx -mno-flat
25817 @opindex mflat
25818 @opindex mno-flat
25819 With @option{-mflat}, the compiler does not generate save/restore instructions
25820 and uses a ``flat'' or single register window model.  This model is compatible
25821 with the regular register window model.  The local registers and the input
25822 registers (0--5) are still treated as ``call-saved'' registers and are
25823 saved on the stack as needed.
25825 With @option{-mno-flat} (the default), the compiler generates save/restore
25826 instructions (except for leaf functions).  This is the normal operating mode.
25828 @item -mfpu
25829 @itemx -mhard-float
25830 @opindex mfpu
25831 @opindex mhard-float
25832 Generate output containing floating-point instructions.  This is the
25833 default.
25835 @item -mno-fpu
25836 @itemx -msoft-float
25837 @opindex mno-fpu
25838 @opindex msoft-float
25839 Generate output containing library calls for floating point.
25840 @strong{Warning:} the requisite libraries are not available for all SPARC
25841 targets.  Normally the facilities of the machine's usual C compiler are
25842 used, but this cannot be done directly in cross-compilation.  You must make
25843 your own arrangements to provide suitable library functions for
25844 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
25845 @samp{sparclite-*-*} do provide software floating-point support.
25847 @option{-msoft-float} changes the calling convention in the output file;
25848 therefore, it is only useful if you compile @emph{all} of a program with
25849 this option.  In particular, you need to compile @file{libgcc.a}, the
25850 library that comes with GCC, with @option{-msoft-float} in order for
25851 this to work.
25853 @item -mhard-quad-float
25854 @opindex mhard-quad-float
25855 Generate output containing quad-word (long double) floating-point
25856 instructions.
25858 @item -msoft-quad-float
25859 @opindex msoft-quad-float
25860 Generate output containing library calls for quad-word (long double)
25861 floating-point instructions.  The functions called are those specified
25862 in the SPARC ABI@.  This is the default.
25864 As of this writing, there are no SPARC implementations that have hardware
25865 support for the quad-word floating-point instructions.  They all invoke
25866 a trap handler for one of these instructions, and then the trap handler
25867 emulates the effect of the instruction.  Because of the trap handler overhead,
25868 this is much slower than calling the ABI library routines.  Thus the
25869 @option{-msoft-quad-float} option is the default.
25871 @item -mno-unaligned-doubles
25872 @itemx -munaligned-doubles
25873 @opindex mno-unaligned-doubles
25874 @opindex munaligned-doubles
25875 Assume that doubles have 8-byte alignment.  This is the default.
25877 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
25878 alignment only if they are contained in another type, or if they have an
25879 absolute address.  Otherwise, it assumes they have 4-byte alignment.
25880 Specifying this option avoids some rare compatibility problems with code
25881 generated by other compilers.  It is not the default because it results
25882 in a performance loss, especially for floating-point code.
25884 @item -muser-mode
25885 @itemx -mno-user-mode
25886 @opindex muser-mode
25887 @opindex mno-user-mode
25888 Do not generate code that can only run in supervisor mode.  This is relevant
25889 only for the @code{casa} instruction emitted for the LEON3 processor.  This
25890 is the default.
25892 @item -mfaster-structs
25893 @itemx -mno-faster-structs
25894 @opindex mfaster-structs
25895 @opindex mno-faster-structs
25896 With @option{-mfaster-structs}, the compiler assumes that structures
25897 should have 8-byte alignment.  This enables the use of pairs of
25898 @code{ldd} and @code{std} instructions for copies in structure
25899 assignment, in place of twice as many @code{ld} and @code{st} pairs.
25900 However, the use of this changed alignment directly violates the SPARC
25901 ABI@.  Thus, it's intended only for use on targets where the developer
25902 acknowledges that their resulting code is not directly in line with
25903 the rules of the ABI@.
25905 @item -mstd-struct-return
25906 @itemx -mno-std-struct-return
25907 @opindex mstd-struct-return
25908 @opindex mno-std-struct-return
25909 With @option{-mstd-struct-return}, the compiler generates checking code
25910 in functions returning structures or unions to detect size mismatches
25911 between the two sides of function calls, as per the 32-bit ABI@.
25913 The default is @option{-mno-std-struct-return}.  This option has no effect
25914 in 64-bit mode.
25916 @item -mlra
25917 @itemx -mno-lra
25918 @opindex mlra
25919 @opindex mno-lra
25920 Enable Local Register Allocation.  This is the default for SPARC since GCC 7
25921 so @option{-mno-lra} needs to be passed to get old Reload.
25923 @item -mcpu=@var{cpu_type}
25924 @opindex mcpu
25925 Set the instruction set, register set, and instruction scheduling parameters
25926 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
25927 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
25928 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
25929 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
25930 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
25931 @samp{niagara3}, @samp{niagara4}, @samp{niagara7} and @samp{m8}.
25933 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
25934 which selects the best architecture option for the host processor.
25935 @option{-mcpu=native} has no effect if GCC does not recognize
25936 the processor.
25938 Default instruction scheduling parameters are used for values that select
25939 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
25940 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
25942 Here is a list of each supported architecture and their supported
25943 implementations.
25945 @table @asis
25946 @item v7
25947 cypress, leon3v7
25949 @item v8
25950 supersparc, hypersparc, leon, leon3
25952 @item sparclite
25953 f930, f934, sparclite86x
25955 @item sparclet
25956 tsc701
25958 @item v9
25959 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
25960 niagara7, m8
25961 @end table
25963 By default (unless configured otherwise), GCC generates code for the V7
25964 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
25965 additionally optimizes it for the Cypress CY7C602 chip, as used in the
25966 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
25967 SPARCStation 1, 2, IPX etc.
25969 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
25970 architecture.  The only difference from V7 code is that the compiler emits
25971 the integer multiply and integer divide instructions which exist in SPARC-V8
25972 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
25973 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
25974 2000 series.
25976 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
25977 the SPARC architecture.  This adds the integer multiply, integer divide step
25978 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
25979 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
25980 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
25981 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
25982 MB86934 chip, which is the more recent SPARClite with FPU@.
25984 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
25985 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
25986 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
25987 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
25988 optimizes it for the TEMIC SPARClet chip.
25990 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
25991 architecture.  This adds 64-bit integer and floating-point move instructions,
25992 3 additional floating-point condition code registers and conditional move
25993 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
25994 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
25995 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
25996 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
25997 @option{-mcpu=niagara}, the compiler additionally optimizes it for
25998 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
25999 additionally optimizes it for Sun UltraSPARC T2 chips. With
26000 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
26001 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
26002 additionally optimizes it for Sun UltraSPARC T4 chips.  With
26003 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
26004 Oracle SPARC M7 chips.  With @option{-mcpu=m8}, the compiler
26005 additionally optimizes it for Oracle M8 chips.
26007 @item -mtune=@var{cpu_type}
26008 @opindex mtune
26009 Set the instruction scheduling parameters for machine type
26010 @var{cpu_type}, but do not set the instruction set or register set that the
26011 option @option{-mcpu=@var{cpu_type}} does.
26013 The same values for @option{-mcpu=@var{cpu_type}} can be used for
26014 @option{-mtune=@var{cpu_type}}, but the only useful values are those
26015 that select a particular CPU implementation.  Those are
26016 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
26017 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
26018 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
26019 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
26020 @samp{niagara4}, @samp{niagara7} and @samp{m8}.  With native Solaris
26021 and GNU/Linux toolchains, @samp{native} can also be used.
26023 @item -mv8plus
26024 @itemx -mno-v8plus
26025 @opindex mv8plus
26026 @opindex mno-v8plus
26027 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
26028 difference from the V8 ABI is that the global and out registers are
26029 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
26030 mode for all SPARC-V9 processors.
26032 @item -mvis
26033 @itemx -mno-vis
26034 @opindex mvis
26035 @opindex mno-vis
26036 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
26037 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
26039 @item -mvis2
26040 @itemx -mno-vis2
26041 @opindex mvis2
26042 @opindex mno-vis2
26043 With @option{-mvis2}, GCC generates code that takes advantage of
26044 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
26045 default is @option{-mvis2} when targeting a cpu that supports such
26046 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
26047 also sets @option{-mvis}.
26049 @item -mvis3
26050 @itemx -mno-vis3
26051 @opindex mvis3
26052 @opindex mno-vis3
26053 With @option{-mvis3}, GCC generates code that takes advantage of
26054 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
26055 default is @option{-mvis3} when targeting a cpu that supports such
26056 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
26057 also sets @option{-mvis2} and @option{-mvis}.
26059 @item -mvis4
26060 @itemx -mno-vis4
26061 @opindex mvis4
26062 @opindex mno-vis4
26063 With @option{-mvis4}, GCC generates code that takes advantage of
26064 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
26065 default is @option{-mvis4} when targeting a cpu that supports such
26066 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
26067 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
26069 @item -mvis4b
26070 @itemx -mno-vis4b
26071 @opindex mvis4b
26072 @opindex mno-vis4b
26073 With @option{-mvis4b}, GCC generates code that takes advantage of
26074 version 4.0 of the UltraSPARC Visual Instruction Set extensions, plus
26075 the additional VIS instructions introduced in the Oracle SPARC
26076 Architecture 2017.  The default is @option{-mvis4b} when targeting a
26077 cpu that supports such instructions, such as m8 and later.  Setting
26078 @option{-mvis4b} also sets @option{-mvis4}, @option{-mvis3},
26079 @option{-mvis2} and @option{-mvis}.
26081 @item -mcbcond
26082 @itemx -mno-cbcond
26083 @opindex mcbcond
26084 @opindex mno-cbcond
26085 With @option{-mcbcond}, GCC generates code that takes advantage of the UltraSPARC
26086 Compare-and-Branch-on-Condition instructions.  The default is @option{-mcbcond}
26087 when targeting a CPU that supports such instructions, such as Niagara-4 and
26088 later.
26090 @item -mfmaf
26091 @itemx -mno-fmaf
26092 @opindex mfmaf
26093 @opindex mno-fmaf
26094 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
26095 Fused Multiply-Add Floating-point instructions.  The default is @option{-mfmaf}
26096 when targeting a CPU that supports such instructions, such as Niagara-3 and
26097 later.
26099 @item -mfsmuld
26100 @itemx -mno-fsmuld
26101 @opindex mfsmuld
26102 @opindex mno-fsmuld
26103 With @option{-mfsmuld}, GCC generates code that takes advantage of the
26104 Floating-point Multiply Single to Double (FsMULd) instruction.  The default is
26105 @option{-mfsmuld} when targeting a CPU supporting the architecture versions V8
26106 or V9 with FPU except @option{-mcpu=leon}.
26108 @item -mpopc
26109 @itemx -mno-popc
26110 @opindex mpopc
26111 @opindex mno-popc
26112 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
26113 Population Count instruction.  The default is @option{-mpopc}
26114 when targeting a CPU that supports such an instruction, such as Niagara-2 and
26115 later.
26117 @item -msubxc
26118 @itemx -mno-subxc
26119 @opindex msubxc
26120 @opindex mno-subxc
26121 With @option{-msubxc}, GCC generates code that takes advantage of the UltraSPARC
26122 Subtract-Extended-with-Carry instruction.  The default is @option{-msubxc}
26123 when targeting a CPU that supports such an instruction, such as Niagara-7 and
26124 later.
26126 @item -mfix-at697f
26127 @opindex mfix-at697f
26128 Enable the documented workaround for the single erratum of the Atmel AT697F
26129 processor (which corresponds to erratum #13 of the AT697E processor).
26131 @item -mfix-ut699
26132 @opindex mfix-ut699
26133 Enable the documented workarounds for the floating-point errata and the data
26134 cache nullify errata of the UT699 processor.
26136 @item -mfix-ut700
26137 @opindex mfix-ut700
26138 Enable the documented workaround for the back-to-back store errata of
26139 the UT699E/UT700 processor.
26141 @item -mfix-gr712rc
26142 @opindex mfix-gr712rc
26143 Enable the documented workaround for the back-to-back store errata of
26144 the GR712RC processor.
26145 @end table
26147 These @samp{-m} options are supported in addition to the above
26148 on SPARC-V9 processors in 64-bit environments:
26150 @table @gcctabopt
26151 @item -m32
26152 @itemx -m64
26153 @opindex m32
26154 @opindex m64
26155 Generate code for a 32-bit or 64-bit environment.
26156 The 32-bit environment sets int, long and pointer to 32 bits.
26157 The 64-bit environment sets int to 32 bits and long and pointer
26158 to 64 bits.
26160 @item -mcmodel=@var{which}
26161 @opindex mcmodel
26162 Set the code model to one of
26164 @table @samp
26165 @item medlow
26166 The Medium/Low code model: 64-bit addresses, programs
26167 must be linked in the low 32 bits of memory.  Programs can be statically
26168 or dynamically linked.
26170 @item medmid
26171 The Medium/Middle code model: 64-bit addresses, programs
26172 must be linked in the low 44 bits of memory, the text and data segments must
26173 be less than 2GB in size and the data segment must be located within 2GB of
26174 the text segment.
26176 @item medany
26177 The Medium/Anywhere code model: 64-bit addresses, programs
26178 may be linked anywhere in memory, the text and data segments must be less
26179 than 2GB in size and the data segment must be located within 2GB of the
26180 text segment.
26182 @item embmedany
26183 The Medium/Anywhere code model for embedded systems:
26184 64-bit addresses, the text and data segments must be less than 2GB in
26185 size, both starting anywhere in memory (determined at link time).  The
26186 global register %g4 points to the base of the data segment.  Programs
26187 are statically linked and PIC is not supported.
26188 @end table
26190 @item -mmemory-model=@var{mem-model}
26191 @opindex mmemory-model
26192 Set the memory model in force on the processor to one of
26194 @table @samp
26195 @item default
26196 The default memory model for the processor and operating system.
26198 @item rmo
26199 Relaxed Memory Order
26201 @item pso
26202 Partial Store Order
26204 @item tso
26205 Total Store Order
26207 @item sc
26208 Sequential Consistency
26209 @end table
26211 These memory models are formally defined in Appendix D of the SPARC-V9
26212 architecture manual, as set in the processor's @code{PSTATE.MM} field.
26214 @item -mstack-bias
26215 @itemx -mno-stack-bias
26216 @opindex mstack-bias
26217 @opindex mno-stack-bias
26218 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
26219 frame pointer if present, are offset by @minus{}2047 which must be added back
26220 when making stack frame references.  This is the default in 64-bit mode.
26221 Otherwise, assume no such offset is present.
26222 @end table
26224 @node SPU Options
26225 @subsection SPU Options
26226 @cindex SPU options
26228 These @samp{-m} options are supported on the SPU:
26230 @table @gcctabopt
26231 @item -mwarn-reloc
26232 @itemx -merror-reloc
26233 @opindex mwarn-reloc
26234 @opindex merror-reloc
26236 The loader for SPU does not handle dynamic relocations.  By default, GCC
26237 gives an error when it generates code that requires a dynamic
26238 relocation.  @option{-mno-error-reloc} disables the error,
26239 @option{-mwarn-reloc} generates a warning instead.
26241 @item -msafe-dma
26242 @itemx -munsafe-dma
26243 @opindex msafe-dma
26244 @opindex munsafe-dma
26246 Instructions that initiate or test completion of DMA must not be
26247 reordered with respect to loads and stores of the memory that is being
26248 accessed.
26249 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
26250 memory accesses, but that can lead to inefficient code in places where the
26251 memory is known to not change.  Rather than mark the memory as volatile,
26252 you can use @option{-msafe-dma} to tell the compiler to treat
26253 the DMA instructions as potentially affecting all memory.  
26255 @item -mbranch-hints
26256 @opindex mbranch-hints
26258 By default, GCC generates a branch hint instruction to avoid
26259 pipeline stalls for always-taken or probably-taken branches.  A hint
26260 is not generated closer than 8 instructions away from its branch.
26261 There is little reason to disable them, except for debugging purposes,
26262 or to make an object a little bit smaller.
26264 @item -msmall-mem
26265 @itemx -mlarge-mem
26266 @opindex msmall-mem
26267 @opindex mlarge-mem
26269 By default, GCC generates code assuming that addresses are never larger
26270 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
26271 a full 32-bit address.
26273 @item -mstdmain
26274 @opindex mstdmain
26276 By default, GCC links against startup code that assumes the SPU-style
26277 main function interface (which has an unconventional parameter list).
26278 With @option{-mstdmain}, GCC links your program against startup
26279 code that assumes a C99-style interface to @code{main}, including a
26280 local copy of @code{argv} strings.
26282 @item -mfixed-range=@var{register-range}
26283 @opindex mfixed-range
26284 Generate code treating the given register range as fixed registers.
26285 A fixed register is one that the register allocator cannot use.  This is
26286 useful when compiling kernel code.  A register range is specified as
26287 two registers separated by a dash.  Multiple register ranges can be
26288 specified separated by a comma.
26290 @item -mea32
26291 @itemx -mea64
26292 @opindex mea32
26293 @opindex mea64
26294 Compile code assuming that pointers to the PPU address space accessed
26295 via the @code{__ea} named address space qualifier are either 32 or 64
26296 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
26297 all object code in an executable must be compiled with the same setting.
26299 @item -maddress-space-conversion
26300 @itemx -mno-address-space-conversion
26301 @opindex maddress-space-conversion
26302 @opindex mno-address-space-conversion
26303 Allow/disallow treating the @code{__ea} address space as superset
26304 of the generic address space.  This enables explicit type casts
26305 between @code{__ea} and generic pointer as well as implicit
26306 conversions of generic pointers to @code{__ea} pointers.  The
26307 default is to allow address space pointer conversions.
26309 @item -mcache-size=@var{cache-size}
26310 @opindex mcache-size
26311 This option controls the version of libgcc that the compiler links to an
26312 executable and selects a software-managed cache for accessing variables
26313 in the @code{__ea} address space with a particular cache size.  Possible
26314 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
26315 and @samp{128}.  The default cache size is 64KB.
26317 @item -matomic-updates
26318 @itemx -mno-atomic-updates
26319 @opindex matomic-updates
26320 @opindex mno-atomic-updates
26321 This option controls the version of libgcc that the compiler links to an
26322 executable and selects whether atomic updates to the software-managed
26323 cache of PPU-side variables are used.  If you use atomic updates, changes
26324 to a PPU variable from SPU code using the @code{__ea} named address space
26325 qualifier do not interfere with changes to other PPU variables residing
26326 in the same cache line from PPU code.  If you do not use atomic updates,
26327 such interference may occur; however, writing back cache lines is
26328 more efficient.  The default behavior is to use atomic updates.
26330 @item -mdual-nops
26331 @itemx -mdual-nops=@var{n}
26332 @opindex mdual-nops
26333 By default, GCC inserts NOPs to increase dual issue when it expects
26334 it to increase performance.  @var{n} can be a value from 0 to 10.  A
26335 smaller @var{n} inserts fewer NOPs.  10 is the default, 0 is the
26336 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
26338 @item -mhint-max-nops=@var{n}
26339 @opindex mhint-max-nops
26340 Maximum number of NOPs to insert for a branch hint.  A branch hint must
26341 be at least 8 instructions away from the branch it is affecting.  GCC
26342 inserts up to @var{n} NOPs to enforce this, otherwise it does not
26343 generate the branch hint.
26345 @item -mhint-max-distance=@var{n}
26346 @opindex mhint-max-distance
26347 The encoding of the branch hint instruction limits the hint to be within
26348 256 instructions of the branch it is affecting.  By default, GCC makes
26349 sure it is within 125.
26351 @item -msafe-hints
26352 @opindex msafe-hints
26353 Work around a hardware bug that causes the SPU to stall indefinitely.
26354 By default, GCC inserts the @code{hbrp} instruction to make sure
26355 this stall won't happen.
26357 @end table
26359 @node System V Options
26360 @subsection Options for System V
26362 These additional options are available on System V Release 4 for
26363 compatibility with other compilers on those systems:
26365 @table @gcctabopt
26366 @item -G
26367 @opindex G
26368 Create a shared object.
26369 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
26371 @item -Qy
26372 @opindex Qy
26373 Identify the versions of each tool used by the compiler, in a
26374 @code{.ident} assembler directive in the output.
26376 @item -Qn
26377 @opindex Qn
26378 Refrain from adding @code{.ident} directives to the output file (this is
26379 the default).
26381 @item -YP,@var{dirs}
26382 @opindex YP
26383 Search the directories @var{dirs}, and no others, for libraries
26384 specified with @option{-l}.
26386 @item -Ym,@var{dir}
26387 @opindex Ym
26388 Look in the directory @var{dir} to find the M4 preprocessor.
26389 The assembler uses this option.
26390 @c This is supposed to go with a -Yd for predefined M4 macro files, but
26391 @c the generic assembler that comes with Solaris takes just -Ym.
26392 @end table
26394 @node TILE-Gx Options
26395 @subsection TILE-Gx Options
26396 @cindex TILE-Gx options
26398 These @samp{-m} options are supported on the TILE-Gx:
26400 @table @gcctabopt
26401 @item -mcmodel=small
26402 @opindex mcmodel=small
26403 Generate code for the small model.  The distance for direct calls is
26404 limited to 500M in either direction.  PC-relative addresses are 32
26405 bits.  Absolute addresses support the full address range.
26407 @item -mcmodel=large
26408 @opindex mcmodel=large
26409 Generate code for the large model.  There is no limitation on call
26410 distance, pc-relative addresses, or absolute addresses.
26412 @item -mcpu=@var{name}
26413 @opindex mcpu
26414 Selects the type of CPU to be targeted.  Currently the only supported
26415 type is @samp{tilegx}.
26417 @item -m32
26418 @itemx -m64
26419 @opindex m32
26420 @opindex m64
26421 Generate code for a 32-bit or 64-bit environment.  The 32-bit
26422 environment sets int, long, and pointer to 32 bits.  The 64-bit
26423 environment sets int to 32 bits and long and pointer to 64 bits.
26425 @item -mbig-endian
26426 @itemx -mlittle-endian
26427 @opindex mbig-endian
26428 @opindex mlittle-endian
26429 Generate code in big/little endian mode, respectively.
26430 @end table
26432 @node TILEPro Options
26433 @subsection TILEPro Options
26434 @cindex TILEPro options
26436 These @samp{-m} options are supported on the TILEPro:
26438 @table @gcctabopt
26439 @item -mcpu=@var{name}
26440 @opindex mcpu
26441 Selects the type of CPU to be targeted.  Currently the only supported
26442 type is @samp{tilepro}.
26444 @item -m32
26445 @opindex m32
26446 Generate code for a 32-bit environment, which sets int, long, and
26447 pointer to 32 bits.  This is the only supported behavior so the flag
26448 is essentially ignored.
26449 @end table
26451 @node V850 Options
26452 @subsection V850 Options
26453 @cindex V850 Options
26455 These @samp{-m} options are defined for V850 implementations:
26457 @table @gcctabopt
26458 @item -mlong-calls
26459 @itemx -mno-long-calls
26460 @opindex mlong-calls
26461 @opindex mno-long-calls
26462 Treat all calls as being far away (near).  If calls are assumed to be
26463 far away, the compiler always loads the function's address into a
26464 register, and calls indirect through the pointer.
26466 @item -mno-ep
26467 @itemx -mep
26468 @opindex mno-ep
26469 @opindex mep
26470 Do not optimize (do optimize) basic blocks that use the same index
26471 pointer 4 or more times to copy pointer into the @code{ep} register, and
26472 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
26473 option is on by default if you optimize.
26475 @item -mno-prolog-function
26476 @itemx -mprolog-function
26477 @opindex mno-prolog-function
26478 @opindex mprolog-function
26479 Do not use (do use) external functions to save and restore registers
26480 at the prologue and epilogue of a function.  The external functions
26481 are slower, but use less code space if more than one function saves
26482 the same number of registers.  The @option{-mprolog-function} option
26483 is on by default if you optimize.
26485 @item -mspace
26486 @opindex mspace
26487 Try to make the code as small as possible.  At present, this just turns
26488 on the @option{-mep} and @option{-mprolog-function} options.
26490 @item -mtda=@var{n}
26491 @opindex mtda
26492 Put static or global variables whose size is @var{n} bytes or less into
26493 the tiny data area that register @code{ep} points to.  The tiny data
26494 area can hold up to 256 bytes in total (128 bytes for byte references).
26496 @item -msda=@var{n}
26497 @opindex msda
26498 Put static or global variables whose size is @var{n} bytes or less into
26499 the small data area that register @code{gp} points to.  The small data
26500 area can hold up to 64 kilobytes.
26502 @item -mzda=@var{n}
26503 @opindex mzda
26504 Put static or global variables whose size is @var{n} bytes or less into
26505 the first 32 kilobytes of memory.
26507 @item -mv850
26508 @opindex mv850
26509 Specify that the target processor is the V850.
26511 @item -mv850e3v5
26512 @opindex mv850e3v5
26513 Specify that the target processor is the V850E3V5.  The preprocessor
26514 constant @code{__v850e3v5__} is defined if this option is used.
26516 @item -mv850e2v4
26517 @opindex mv850e2v4
26518 Specify that the target processor is the V850E3V5.  This is an alias for
26519 the @option{-mv850e3v5} option.
26521 @item -mv850e2v3
26522 @opindex mv850e2v3
26523 Specify that the target processor is the V850E2V3.  The preprocessor
26524 constant @code{__v850e2v3__} is defined if this option is used.
26526 @item -mv850e2
26527 @opindex mv850e2
26528 Specify that the target processor is the V850E2.  The preprocessor
26529 constant @code{__v850e2__} is defined if this option is used.
26531 @item -mv850e1
26532 @opindex mv850e1
26533 Specify that the target processor is the V850E1.  The preprocessor
26534 constants @code{__v850e1__} and @code{__v850e__} are defined if
26535 this option is used.
26537 @item -mv850es
26538 @opindex mv850es
26539 Specify that the target processor is the V850ES.  This is an alias for
26540 the @option{-mv850e1} option.
26542 @item -mv850e
26543 @opindex mv850e
26544 Specify that the target processor is the V850E@.  The preprocessor
26545 constant @code{__v850e__} is defined if this option is used.
26547 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
26548 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
26549 are defined then a default target processor is chosen and the
26550 relevant @samp{__v850*__} preprocessor constant is defined.
26552 The preprocessor constants @code{__v850} and @code{__v851__} are always
26553 defined, regardless of which processor variant is the target.
26555 @item -mdisable-callt
26556 @itemx -mno-disable-callt
26557 @opindex mdisable-callt
26558 @opindex mno-disable-callt
26559 This option suppresses generation of the @code{CALLT} instruction for the
26560 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
26561 architecture.
26563 This option is enabled by default when the RH850 ABI is
26564 in use (see @option{-mrh850-abi}), and disabled by default when the
26565 GCC ABI is in use.  If @code{CALLT} instructions are being generated
26566 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
26568 @item -mrelax
26569 @itemx -mno-relax
26570 @opindex mrelax
26571 @opindex mno-relax
26572 Pass on (or do not pass on) the @option{-mrelax} command-line option
26573 to the assembler.
26575 @item -mlong-jumps
26576 @itemx -mno-long-jumps
26577 @opindex mlong-jumps
26578 @opindex mno-long-jumps
26579 Disable (or re-enable) the generation of PC-relative jump instructions.
26581 @item -msoft-float
26582 @itemx -mhard-float
26583 @opindex msoft-float
26584 @opindex mhard-float
26585 Disable (or re-enable) the generation of hardware floating point
26586 instructions.  This option is only significant when the target
26587 architecture is @samp{V850E2V3} or higher.  If hardware floating point
26588 instructions are being generated then the C preprocessor symbol
26589 @code{__FPU_OK__} is defined, otherwise the symbol
26590 @code{__NO_FPU__} is defined.
26592 @item -mloop
26593 @opindex mloop
26594 Enables the use of the e3v5 LOOP instruction.  The use of this
26595 instruction is not enabled by default when the e3v5 architecture is
26596 selected because its use is still experimental.
26598 @item -mrh850-abi
26599 @itemx -mghs
26600 @opindex mrh850-abi
26601 @opindex mghs
26602 Enables support for the RH850 version of the V850 ABI.  This is the
26603 default.  With this version of the ABI the following rules apply:
26605 @itemize
26606 @item
26607 Integer sized structures and unions are returned via a memory pointer
26608 rather than a register.
26610 @item
26611 Large structures and unions (more than 8 bytes in size) are passed by
26612 value.
26614 @item
26615 Functions are aligned to 16-bit boundaries.
26617 @item
26618 The @option{-m8byte-align} command-line option is supported.
26620 @item
26621 The @option{-mdisable-callt} command-line option is enabled by
26622 default.  The @option{-mno-disable-callt} command-line option is not
26623 supported.
26624 @end itemize
26626 When this version of the ABI is enabled the C preprocessor symbol
26627 @code{__V850_RH850_ABI__} is defined.
26629 @item -mgcc-abi
26630 @opindex mgcc-abi
26631 Enables support for the old GCC version of the V850 ABI.  With this
26632 version of the ABI the following rules apply:
26634 @itemize
26635 @item
26636 Integer sized structures and unions are returned in register @code{r10}.
26638 @item
26639 Large structures and unions (more than 8 bytes in size) are passed by
26640 reference.
26642 @item
26643 Functions are aligned to 32-bit boundaries, unless optimizing for
26644 size.
26646 @item
26647 The @option{-m8byte-align} command-line option is not supported.
26649 @item
26650 The @option{-mdisable-callt} command-line option is supported but not
26651 enabled by default.
26652 @end itemize
26654 When this version of the ABI is enabled the C preprocessor symbol
26655 @code{__V850_GCC_ABI__} is defined.
26657 @item -m8byte-align
26658 @itemx -mno-8byte-align
26659 @opindex m8byte-align
26660 @opindex mno-8byte-align
26661 Enables support for @code{double} and @code{long long} types to be
26662 aligned on 8-byte boundaries.  The default is to restrict the
26663 alignment of all objects to at most 4-bytes.  When
26664 @option{-m8byte-align} is in effect the C preprocessor symbol
26665 @code{__V850_8BYTE_ALIGN__} is defined.
26667 @item -mbig-switch
26668 @opindex mbig-switch
26669 Generate code suitable for big switch tables.  Use this option only if
26670 the assembler/linker complain about out of range branches within a switch
26671 table.
26673 @item -mapp-regs
26674 @opindex mapp-regs
26675 This option causes r2 and r5 to be used in the code generated by
26676 the compiler.  This setting is the default.
26678 @item -mno-app-regs
26679 @opindex mno-app-regs
26680 This option causes r2 and r5 to be treated as fixed registers.
26682 @end table
26684 @node VAX Options
26685 @subsection VAX Options
26686 @cindex VAX options
26688 These @samp{-m} options are defined for the VAX:
26690 @table @gcctabopt
26691 @item -munix
26692 @opindex munix
26693 Do not output certain jump instructions (@code{aobleq} and so on)
26694 that the Unix assembler for the VAX cannot handle across long
26695 ranges.
26697 @item -mgnu
26698 @opindex mgnu
26699 Do output those jump instructions, on the assumption that the
26700 GNU assembler is being used.
26702 @item -mg
26703 @opindex mg
26704 Output code for G-format floating-point numbers instead of D-format.
26705 @end table
26707 @node Visium Options
26708 @subsection Visium Options
26709 @cindex Visium options
26711 @table @gcctabopt
26713 @item -mdebug
26714 @opindex mdebug
26715 A program which performs file I/O and is destined to run on an MCM target
26716 should be linked with this option.  It causes the libraries libc.a and
26717 libdebug.a to be linked.  The program should be run on the target under
26718 the control of the GDB remote debugging stub.
26720 @item -msim
26721 @opindex msim
26722 A program which performs file I/O and is destined to run on the simulator
26723 should be linked with option.  This causes libraries libc.a and libsim.a to
26724 be linked.
26726 @item -mfpu
26727 @itemx -mhard-float
26728 @opindex mfpu
26729 @opindex mhard-float
26730 Generate code containing floating-point instructions.  This is the
26731 default.
26733 @item -mno-fpu
26734 @itemx -msoft-float
26735 @opindex mno-fpu
26736 @opindex msoft-float
26737 Generate code containing library calls for floating-point.
26739 @option{-msoft-float} changes the calling convention in the output file;
26740 therefore, it is only useful if you compile @emph{all} of a program with
26741 this option.  In particular, you need to compile @file{libgcc.a}, the
26742 library that comes with GCC, with @option{-msoft-float} in order for
26743 this to work.
26745 @item -mcpu=@var{cpu_type}
26746 @opindex mcpu
26747 Set the instruction set, register set, and instruction scheduling parameters
26748 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
26749 @samp{mcm}, @samp{gr5} and @samp{gr6}.
26751 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
26753 By default (unless configured otherwise), GCC generates code for the GR5
26754 variant of the Visium architecture.  
26756 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
26757 architecture.  The only difference from GR5 code is that the compiler will
26758 generate block move instructions.
26760 @item -mtune=@var{cpu_type}
26761 @opindex mtune
26762 Set the instruction scheduling parameters for machine type @var{cpu_type},
26763 but do not set the instruction set or register set that the option
26764 @option{-mcpu=@var{cpu_type}} would.
26766 @item -msv-mode
26767 @opindex msv-mode
26768 Generate code for the supervisor mode, where there are no restrictions on
26769 the access to general registers.  This is the default.
26771 @item -muser-mode
26772 @opindex muser-mode
26773 Generate code for the user mode, where the access to some general registers
26774 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
26775 mode; on the GR6, only registers r29 to r31 are affected.
26776 @end table
26778 @node VMS Options
26779 @subsection VMS Options
26781 These @samp{-m} options are defined for the VMS implementations:
26783 @table @gcctabopt
26784 @item -mvms-return-codes
26785 @opindex mvms-return-codes
26786 Return VMS condition codes from @code{main}. The default is to return POSIX-style
26787 condition (e.g.@ error) codes.
26789 @item -mdebug-main=@var{prefix}
26790 @opindex mdebug-main=@var{prefix}
26791 Flag the first routine whose name starts with @var{prefix} as the main
26792 routine for the debugger.
26794 @item -mmalloc64
26795 @opindex mmalloc64
26796 Default to 64-bit memory allocation routines.
26798 @item -mpointer-size=@var{size}
26799 @opindex mpointer-size=@var{size}
26800 Set the default size of pointers. Possible options for @var{size} are
26801 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
26802 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
26803 The later option disables @code{pragma pointer_size}.
26804 @end table
26806 @node VxWorks Options
26807 @subsection VxWorks Options
26808 @cindex VxWorks Options
26810 The options in this section are defined for all VxWorks targets.
26811 Options specific to the target hardware are listed with the other
26812 options for that target.
26814 @table @gcctabopt
26815 @item -mrtp
26816 @opindex mrtp
26817 GCC can generate code for both VxWorks kernels and real time processes
26818 (RTPs).  This option switches from the former to the latter.  It also
26819 defines the preprocessor macro @code{__RTP__}.
26821 @item -non-static
26822 @opindex non-static
26823 Link an RTP executable against shared libraries rather than static
26824 libraries.  The options @option{-static} and @option{-shared} can
26825 also be used for RTPs (@pxref{Link Options}); @option{-static}
26826 is the default.
26828 @item -Bstatic
26829 @itemx -Bdynamic
26830 @opindex Bstatic
26831 @opindex Bdynamic
26832 These options are passed down to the linker.  They are defined for
26833 compatibility with Diab.
26835 @item -Xbind-lazy
26836 @opindex Xbind-lazy
26837 Enable lazy binding of function calls.  This option is equivalent to
26838 @option{-Wl,-z,now} and is defined for compatibility with Diab.
26840 @item -Xbind-now
26841 @opindex Xbind-now
26842 Disable lazy binding of function calls.  This option is the default and
26843 is defined for compatibility with Diab.
26844 @end table
26846 @node x86 Options
26847 @subsection x86 Options
26848 @cindex x86 Options
26850 These @samp{-m} options are defined for the x86 family of computers.
26852 @table @gcctabopt
26854 @item -march=@var{cpu-type}
26855 @opindex march
26856 Generate instructions for the machine type @var{cpu-type}.  In contrast to
26857 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
26858 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
26859 to generate code that may not run at all on processors other than the one
26860 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
26861 @option{-mtune=@var{cpu-type}}.
26863 The choices for @var{cpu-type} are:
26865 @table @samp
26866 @item native
26867 This selects the CPU to generate code for at compilation time by determining
26868 the processor type of the compiling machine.  Using @option{-march=native}
26869 enables all instruction subsets supported by the local machine (hence
26870 the result might not run on different machines).  Using @option{-mtune=native}
26871 produces code optimized for the local machine under the constraints
26872 of the selected instruction set.  
26874 @item x86-64
26875 A generic CPU with 64-bit extensions.
26877 @item i386
26878 Original Intel i386 CPU@.
26880 @item i486
26881 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
26883 @item i586
26884 @itemx pentium
26885 Intel Pentium CPU with no MMX support.
26887 @item lakemont
26888 Intel Lakemont MCU, based on Intel Pentium CPU.
26890 @item pentium-mmx
26891 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
26893 @item pentiumpro
26894 Intel Pentium Pro CPU@.
26896 @item i686
26897 When used with @option{-march}, the Pentium Pro
26898 instruction set is used, so the code runs on all i686 family chips.
26899 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
26901 @item pentium2
26902 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
26903 support.
26905 @item pentium3
26906 @itemx pentium3m
26907 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
26908 set support.
26910 @item pentium-m
26911 Intel Pentium M; low-power version of Intel Pentium III CPU
26912 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
26914 @item pentium4
26915 @itemx pentium4m
26916 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
26918 @item prescott
26919 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
26920 set support.
26922 @item nocona
26923 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
26924 SSE2 and SSE3 instruction set support.
26926 @item core2
26927 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
26928 instruction set support.
26930 @item nehalem
26931 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
26932 SSE4.1, SSE4.2 and POPCNT instruction set support.
26934 @item westmere
26935 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
26936 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
26938 @item sandybridge
26939 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
26940 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
26942 @item ivybridge
26943 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
26944 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
26945 instruction set support.
26947 @item haswell
26948 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26949 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
26950 BMI, BMI2 and F16C instruction set support.
26952 @item broadwell
26953 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26954 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
26955 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
26957 @item skylake
26958 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26959 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
26960 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
26961 XSAVES instruction set support.
26963 @item bonnell
26964 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
26965 instruction set support.
26967 @item silvermont
26968 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26969 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
26971 @item goldmont
26972 Intel Goldmont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26973 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT and FSGSBASE
26974 instruction set support.
26976 @item goldmont-plus
26977 Intel Goldmont Plus CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
26978 SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE,
26979 PTWRITE, RDPID, SGX and UMIP instruction set support.
26981 @item tremont
26982 Intel Tremont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26983 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE, PTWRITE,
26984 RDPID, SGX, UMIP, GFNI-SSE, CLWB and ENCLV instruction set support.
26986 @item knl
26987 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
26988 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
26989 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
26990 AVX512CD instruction set support.
26992 @item knm
26993 Intel Knights Mill CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
26994 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
26995 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER, AVX512CD,
26996 AVX5124VNNIW, AVX5124FMAPS and AVX512VPOPCNTDQ instruction set support.
26998 @item skylake-avx512
26999 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27000 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27001 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
27002 CLWB, AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
27004 @item cannonlake
27005 Intel Cannonlake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27006 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27007 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27008 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27009 AVX512IFMA, SHA and UMIP instruction set support.
27011 @item icelake-client
27012 Intel Icelake Client CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27013 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27014 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27015 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27016 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
27017 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES instruction set support.
27019 @item icelake-server
27020 Intel Icelake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27021 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27022 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27023 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27024 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
27025 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES, PCONFIG and WBNOINVD instruction
27026 set support.
27028 @item k6
27029 AMD K6 CPU with MMX instruction set support.
27031 @item k6-2
27032 @itemx k6-3
27033 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
27035 @item athlon
27036 @itemx athlon-tbird
27037 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
27038 support.
27040 @item athlon-4
27041 @itemx athlon-xp
27042 @itemx athlon-mp
27043 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
27044 instruction set support.
27046 @item k8
27047 @itemx opteron
27048 @itemx athlon64
27049 @itemx athlon-fx
27050 Processors based on the AMD K8 core with x86-64 instruction set support,
27051 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
27052 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
27053 instruction set extensions.)
27055 @item k8-sse3
27056 @itemx opteron-sse3
27057 @itemx athlon64-sse3
27058 Improved versions of AMD K8 cores with SSE3 instruction set support.
27060 @item amdfam10
27061 @itemx barcelona
27062 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
27063 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
27064 instruction set extensions.)
27066 @item bdver1
27067 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
27068 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
27069 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
27070 @item bdver2
27071 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27072 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
27073 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
27074 extensions.)
27075 @item bdver3
27076 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27077 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
27078 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
27079 64-bit instruction set extensions.
27080 @item bdver4
27081 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27082 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
27083 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
27084 SSE4.2, ABM and 64-bit instruction set extensions.
27086 @item znver1
27087 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
27088 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
27089 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
27090 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
27091 instruction set extensions.
27093 @item btver1
27094 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
27095 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
27096 instruction set extensions.)
27098 @item btver2
27099 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
27100 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
27101 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
27103 @item winchip-c6
27104 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
27105 set support.
27107 @item winchip2
27108 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
27109 instruction set support.
27111 @item c3
27112 VIA C3 CPU with MMX and 3DNow!@: instruction set support.
27113 (No scheduling is implemented for this chip.)
27115 @item c3-2
27116 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
27117 (No scheduling is implemented for this chip.)
27119 @item c7
27120 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
27121 (No scheduling is implemented for this chip.)
27123 @item samuel-2
27124 VIA Eden Samuel 2 CPU with MMX and 3DNow!@: instruction set support.
27125 (No scheduling is implemented for this chip.)
27127 @item nehemiah
27128 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
27129 (No scheduling is implemented for this chip.)
27131 @item esther
27132 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
27133 (No scheduling is implemented for this chip.)
27135 @item eden-x2
27136 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3 instruction set support.
27137 (No scheduling is implemented for this chip.)
27139 @item eden-x4
27140 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
27141 AVX and AVX2 instruction set support.
27142 (No scheduling is implemented for this chip.)
27144 @item nano
27145 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27146 instruction set support.
27147 (No scheduling is implemented for this chip.)
27149 @item nano-1000
27150 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27151 instruction set support.
27152 (No scheduling is implemented for this chip.)
27154 @item nano-2000
27155 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27156 instruction set support.
27157 (No scheduling is implemented for this chip.)
27159 @item nano-3000
27160 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27161 instruction set support.
27162 (No scheduling is implemented for this chip.)
27164 @item nano-x2
27165 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27166 instruction set support.
27167 (No scheduling is implemented for this chip.)
27169 @item nano-x4
27170 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27171 instruction set support.
27172 (No scheduling is implemented for this chip.)
27174 @item geode
27175 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
27176 @end table
27178 @item -mtune=@var{cpu-type}
27179 @opindex mtune
27180 Tune to @var{cpu-type} everything applicable about the generated code, except
27181 for the ABI and the set of available instructions.  
27182 While picking a specific @var{cpu-type} schedules things appropriately
27183 for that particular chip, the compiler does not generate any code that
27184 cannot run on the default machine type unless you use a
27185 @option{-march=@var{cpu-type}} option.
27186 For example, if GCC is configured for i686-pc-linux-gnu
27187 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
27188 but still runs on i686 machines.
27190 The choices for @var{cpu-type} are the same as for @option{-march}.
27191 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
27193 @table @samp
27194 @item generic
27195 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
27196 If you know the CPU on which your code will run, then you should use
27197 the corresponding @option{-mtune} or @option{-march} option instead of
27198 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
27199 of your application will have, then you should use this option.
27201 As new processors are deployed in the marketplace, the behavior of this
27202 option will change.  Therefore, if you upgrade to a newer version of
27203 GCC, code generation controlled by this option will change to reflect
27204 the processors
27205 that are most common at the time that version of GCC is released.
27207 There is no @option{-march=generic} option because @option{-march}
27208 indicates the instruction set the compiler can use, and there is no
27209 generic instruction set applicable to all processors.  In contrast,
27210 @option{-mtune} indicates the processor (or, in this case, collection of
27211 processors) for which the code is optimized.
27213 @item intel
27214 Produce code optimized for the most current Intel processors, which are
27215 Haswell and Silvermont for this version of GCC.  If you know the CPU
27216 on which your code will run, then you should use the corresponding
27217 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
27218 But, if you want your application performs better on both Haswell and
27219 Silvermont, then you should use this option.
27221 As new Intel processors are deployed in the marketplace, the behavior of
27222 this option will change.  Therefore, if you upgrade to a newer version of
27223 GCC, code generation controlled by this option will change to reflect
27224 the most current Intel processors at the time that version of GCC is
27225 released.
27227 There is no @option{-march=intel} option because @option{-march} indicates
27228 the instruction set the compiler can use, and there is no common
27229 instruction set applicable to all processors.  In contrast,
27230 @option{-mtune} indicates the processor (or, in this case, collection of
27231 processors) for which the code is optimized.
27232 @end table
27234 @item -mcpu=@var{cpu-type}
27235 @opindex mcpu
27236 A deprecated synonym for @option{-mtune}.
27238 @item -mfpmath=@var{unit}
27239 @opindex mfpmath
27240 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
27241 for @var{unit} are:
27243 @table @samp
27244 @item 387
27245 Use the standard 387 floating-point coprocessor present on the majority of chips and
27246 emulated otherwise.  Code compiled with this option runs almost everywhere.
27247 The temporary results are computed in 80-bit precision instead of the precision
27248 specified by the type, resulting in slightly different results compared to most
27249 of other chips.  See @option{-ffloat-store} for more detailed description.
27251 This is the default choice for non-Darwin x86-32 targets.
27253 @item sse
27254 Use scalar floating-point instructions present in the SSE instruction set.
27255 This instruction set is supported by Pentium III and newer chips,
27256 and in the AMD line
27257 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
27258 instruction set supports only single-precision arithmetic, thus the double and
27259 extended-precision arithmetic are still done using 387.  A later version, present
27260 only in Pentium 4 and AMD x86-64 chips, supports double-precision
27261 arithmetic too.
27263 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
27264 or @option{-msse2} switches to enable SSE extensions and make this option
27265 effective.  For the x86-64 compiler, these extensions are enabled by default.
27267 The resulting code should be considerably faster in the majority of cases and avoid
27268 the numerical instability problems of 387 code, but may break some existing
27269 code that expects temporaries to be 80 bits.
27271 This is the default choice for the x86-64 compiler, Darwin x86-32 targets,
27272 and the default choice for x86-32 targets with the SSE2 instruction set
27273 when @option{-ffast-math} is enabled.
27275 @item sse,387
27276 @itemx sse+387
27277 @itemx both
27278 Attempt to utilize both instruction sets at once.  This effectively doubles the
27279 amount of available registers, and on chips with separate execution units for
27280 387 and SSE the execution resources too.  Use this option with care, as it is
27281 still experimental, because the GCC register allocator does not model separate
27282 functional units well, resulting in unstable performance.
27283 @end table
27285 @item -masm=@var{dialect}
27286 @opindex masm=@var{dialect}
27287 Output assembly instructions using selected @var{dialect}.  Also affects
27288 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
27289 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
27290 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
27291 not support @samp{intel}.
27293 @item -mieee-fp
27294 @itemx -mno-ieee-fp
27295 @opindex mieee-fp
27296 @opindex mno-ieee-fp
27297 Control whether or not the compiler uses IEEE floating-point
27298 comparisons.  These correctly handle the case where the result of a
27299 comparison is unordered.
27301 @item -m80387
27302 @itemx -mhard-float
27303 @opindex 80387
27304 @opindex mhard-float
27305 Generate output containing 80387 instructions for floating point.
27307 @item -mno-80387
27308 @itemx -msoft-float
27309 @opindex no-80387
27310 @opindex msoft-float
27311 Generate output containing library calls for floating point.
27313 @strong{Warning:} the requisite libraries are not part of GCC@.
27314 Normally the facilities of the machine's usual C compiler are used, but
27315 this cannot be done directly in cross-compilation.  You must make your
27316 own arrangements to provide suitable library functions for
27317 cross-compilation.
27319 On machines where a function returns floating-point results in the 80387
27320 register stack, some floating-point opcodes may be emitted even if
27321 @option{-msoft-float} is used.
27323 @item -mno-fp-ret-in-387
27324 @opindex mno-fp-ret-in-387
27325 Do not use the FPU registers for return values of functions.
27327 The usual calling convention has functions return values of types
27328 @code{float} and @code{double} in an FPU register, even if there
27329 is no FPU@.  The idea is that the operating system should emulate
27330 an FPU@.
27332 The option @option{-mno-fp-ret-in-387} causes such values to be returned
27333 in ordinary CPU registers instead.
27335 @item -mno-fancy-math-387
27336 @opindex mno-fancy-math-387
27337 Some 387 emulators do not support the @code{sin}, @code{cos} and
27338 @code{sqrt} instructions for the 387.  Specify this option to avoid
27339 generating those instructions.
27340 This option is overridden when @option{-march}
27341 indicates that the target CPU always has an FPU and so the
27342 instruction does not need emulation.  These
27343 instructions are not generated unless you also use the
27344 @option{-funsafe-math-optimizations} switch.
27346 @item -malign-double
27347 @itemx -mno-align-double
27348 @opindex malign-double
27349 @opindex mno-align-double
27350 Control whether GCC aligns @code{double}, @code{long double}, and
27351 @code{long long} variables on a two-word boundary or a one-word
27352 boundary.  Aligning @code{double} variables on a two-word boundary
27353 produces code that runs somewhat faster on a Pentium at the
27354 expense of more memory.
27356 On x86-64, @option{-malign-double} is enabled by default.
27358 @strong{Warning:} if you use the @option{-malign-double} switch,
27359 structures containing the above types are aligned differently than
27360 the published application binary interface specifications for the x86-32
27361 and are not binary compatible with structures in code compiled
27362 without that switch.
27364 @item -m96bit-long-double
27365 @itemx -m128bit-long-double
27366 @opindex m96bit-long-double
27367 @opindex m128bit-long-double
27368 These switches control the size of @code{long double} type.  The x86-32
27369 application binary interface specifies the size to be 96 bits,
27370 so @option{-m96bit-long-double} is the default in 32-bit mode.
27372 Modern architectures (Pentium and newer) prefer @code{long double}
27373 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
27374 conforming to the ABI, this is not possible.  So specifying
27375 @option{-m128bit-long-double} aligns @code{long double}
27376 to a 16-byte boundary by padding the @code{long double} with an additional
27377 32-bit zero.
27379 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
27380 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
27382 Notice that neither of these options enable any extra precision over the x87
27383 standard of 80 bits for a @code{long double}.
27385 @strong{Warning:} if you override the default value for your target ABI, this
27386 changes the size of 
27387 structures and arrays containing @code{long double} variables,
27388 as well as modifying the function calling convention for functions taking
27389 @code{long double}.  Hence they are not binary-compatible
27390 with code compiled without that switch.
27392 @item -mlong-double-64
27393 @itemx -mlong-double-80
27394 @itemx -mlong-double-128
27395 @opindex mlong-double-64
27396 @opindex mlong-double-80
27397 @opindex mlong-double-128
27398 These switches control the size of @code{long double} type. A size
27399 of 64 bits makes the @code{long double} type equivalent to the @code{double}
27400 type. This is the default for 32-bit Bionic C library.  A size
27401 of 128 bits makes the @code{long double} type equivalent to the
27402 @code{__float128} type. This is the default for 64-bit Bionic C library.
27404 @strong{Warning:} if you override the default value for your target ABI, this
27405 changes the size of
27406 structures and arrays containing @code{long double} variables,
27407 as well as modifying the function calling convention for functions taking
27408 @code{long double}.  Hence they are not binary-compatible
27409 with code compiled without that switch.
27411 @item -malign-data=@var{type}
27412 @opindex malign-data
27413 Control how GCC aligns variables.  Supported values for @var{type} are
27414 @samp{compat} uses increased alignment value compatible uses GCC 4.8
27415 and earlier, @samp{abi} uses alignment value as specified by the
27416 psABI, and @samp{cacheline} uses increased alignment value to match
27417 the cache line size.  @samp{compat} is the default.
27419 @item -mlarge-data-threshold=@var{threshold}
27420 @opindex mlarge-data-threshold
27421 When @option{-mcmodel=medium} is specified, data objects larger than
27422 @var{threshold} are placed in the large data section.  This value must be the
27423 same across all objects linked into the binary, and defaults to 65535.
27425 @item -mrtd
27426 @opindex mrtd
27427 Use a different function-calling convention, in which functions that
27428 take a fixed number of arguments return with the @code{ret @var{num}}
27429 instruction, which pops their arguments while returning.  This saves one
27430 instruction in the caller since there is no need to pop the arguments
27431 there.
27433 You can specify that an individual function is called with this calling
27434 sequence with the function attribute @code{stdcall}.  You can also
27435 override the @option{-mrtd} option by using the function attribute
27436 @code{cdecl}.  @xref{Function Attributes}.
27438 @strong{Warning:} this calling convention is incompatible with the one
27439 normally used on Unix, so you cannot use it if you need to call
27440 libraries compiled with the Unix compiler.
27442 Also, you must provide function prototypes for all functions that
27443 take variable numbers of arguments (including @code{printf});
27444 otherwise incorrect code is generated for calls to those
27445 functions.
27447 In addition, seriously incorrect code results if you call a
27448 function with too many arguments.  (Normally, extra arguments are
27449 harmlessly ignored.)
27451 @item -mregparm=@var{num}
27452 @opindex mregparm
27453 Control how many registers are used to pass integer arguments.  By
27454 default, no registers are used to pass arguments, and at most 3
27455 registers can be used.  You can control this behavior for a specific
27456 function by using the function attribute @code{regparm}.
27457 @xref{Function Attributes}.
27459 @strong{Warning:} if you use this switch, and
27460 @var{num} is nonzero, then you must build all modules with the same
27461 value, including any libraries.  This includes the system libraries and
27462 startup modules.
27464 @item -msseregparm
27465 @opindex msseregparm
27466 Use SSE register passing conventions for float and double arguments
27467 and return values.  You can control this behavior for a specific
27468 function by using the function attribute @code{sseregparm}.
27469 @xref{Function Attributes}.
27471 @strong{Warning:} if you use this switch then you must build all
27472 modules with the same value, including any libraries.  This includes
27473 the system libraries and startup modules.
27475 @item -mvect8-ret-in-mem
27476 @opindex mvect8-ret-in-mem
27477 Return 8-byte vectors in memory instead of MMX registers.  This is the
27478 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
27479 Studio compilers until version 12.  Later compiler versions (starting
27480 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
27481 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
27482 you need to remain compatible with existing code produced by those
27483 previous compiler versions or older versions of GCC@.
27485 @item -mpc32
27486 @itemx -mpc64
27487 @itemx -mpc80
27488 @opindex mpc32
27489 @opindex mpc64
27490 @opindex mpc80
27492 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
27493 is specified, the significands of results of floating-point operations are
27494 rounded to 24 bits (single precision); @option{-mpc64} rounds the
27495 significands of results of floating-point operations to 53 bits (double
27496 precision) and @option{-mpc80} rounds the significands of results of
27497 floating-point operations to 64 bits (extended double precision), which is
27498 the default.  When this option is used, floating-point operations in higher
27499 precisions are not available to the programmer without setting the FPU
27500 control word explicitly.
27502 Setting the rounding of floating-point operations to less than the default
27503 80 bits can speed some programs by 2% or more.  Note that some mathematical
27504 libraries assume that extended-precision (80-bit) floating-point operations
27505 are enabled by default; routines in such libraries could suffer significant
27506 loss of accuracy, typically through so-called ``catastrophic cancellation'',
27507 when this option is used to set the precision to less than extended precision.
27509 @item -mstackrealign
27510 @opindex mstackrealign
27511 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
27512 option generates an alternate prologue and epilogue that realigns the
27513 run-time stack if necessary.  This supports mixing legacy codes that keep
27514 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
27515 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
27516 applicable to individual functions.
27518 @item -mpreferred-stack-boundary=@var{num}
27519 @opindex mpreferred-stack-boundary
27520 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
27521 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
27522 the default is 4 (16 bytes or 128 bits).
27524 @strong{Warning:} When generating code for the x86-64 architecture with
27525 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
27526 used to keep the stack boundary aligned to 8 byte boundary.  Since
27527 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
27528 intended to be used in controlled environment where stack space is
27529 important limitation.  This option leads to wrong code when functions
27530 compiled with 16 byte stack alignment (such as functions from a standard
27531 library) are called with misaligned stack.  In this case, SSE
27532 instructions may lead to misaligned memory access traps.  In addition,
27533 variable arguments are handled incorrectly for 16 byte aligned
27534 objects (including x87 long double and __int128), leading to wrong
27535 results.  You must build all modules with
27536 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
27537 includes the system libraries and startup modules.
27539 @item -mincoming-stack-boundary=@var{num}
27540 @opindex mincoming-stack-boundary
27541 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
27542 boundary.  If @option{-mincoming-stack-boundary} is not specified,
27543 the one specified by @option{-mpreferred-stack-boundary} is used.
27545 On Pentium and Pentium Pro, @code{double} and @code{long double} values
27546 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
27547 suffer significant run time performance penalties.  On Pentium III, the
27548 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
27549 properly if it is not 16-byte aligned.
27551 To ensure proper alignment of this values on the stack, the stack boundary
27552 must be as aligned as that required by any value stored on the stack.
27553 Further, every function must be generated such that it keeps the stack
27554 aligned.  Thus calling a function compiled with a higher preferred
27555 stack boundary from a function compiled with a lower preferred stack
27556 boundary most likely misaligns the stack.  It is recommended that
27557 libraries that use callbacks always use the default setting.
27559 This extra alignment does consume extra stack space, and generally
27560 increases code size.  Code that is sensitive to stack space usage, such
27561 as embedded systems and operating system kernels, may want to reduce the
27562 preferred alignment to @option{-mpreferred-stack-boundary=2}.
27564 @need 200
27565 @item -mmmx
27566 @opindex mmmx
27567 @need 200
27568 @itemx -msse
27569 @opindex msse
27570 @need 200
27571 @itemx -msse2
27572 @opindex msse2
27573 @need 200
27574 @itemx -msse3
27575 @opindex msse3
27576 @need 200
27577 @itemx -mssse3
27578 @opindex mssse3
27579 @need 200
27580 @itemx -msse4
27581 @opindex msse4
27582 @need 200
27583 @itemx -msse4a
27584 @opindex msse4a
27585 @need 200
27586 @itemx -msse4.1
27587 @opindex msse4.1
27588 @need 200
27589 @itemx -msse4.2
27590 @opindex msse4.2
27591 @need 200
27592 @itemx -mavx
27593 @opindex mavx
27594 @need 200
27595 @itemx -mavx2
27596 @opindex mavx2
27597 @need 200
27598 @itemx -mavx512f
27599 @opindex mavx512f
27600 @need 200
27601 @itemx -mavx512pf
27602 @opindex mavx512pf
27603 @need 200
27604 @itemx -mavx512er
27605 @opindex mavx512er
27606 @need 200
27607 @itemx -mavx512cd
27608 @opindex mavx512cd
27609 @need 200
27610 @itemx -mavx512vl
27611 @opindex mavx512vl
27612 @need 200
27613 @itemx -mavx512bw
27614 @opindex mavx512bw
27615 @need 200
27616 @itemx -mavx512dq
27617 @opindex mavx512dq
27618 @need 200
27619 @itemx -mavx512ifma
27620 @opindex mavx512ifma
27621 @need 200
27622 @itemx -mavx512vbmi
27623 @opindex mavx512vbmi
27624 @need 200
27625 @itemx -msha
27626 @opindex msha
27627 @need 200
27628 @itemx -maes
27629 @opindex maes
27630 @need 200
27631 @itemx -mpclmul
27632 @opindex mpclmul
27633 @need 200
27634 @itemx -mclflushopt
27635 @opindex mclflushopt
27636 @need 200
27637 @itemx -mfsgsbase
27638 @opindex mfsgsbase
27639 @need 200
27640 @itemx -mrdrnd
27641 @opindex mrdrnd
27642 @need 200
27643 @itemx -mf16c
27644 @opindex mf16c
27645 @need 200
27646 @itemx -mfma
27647 @opindex mfma
27648 @need 200
27649 @itemx -mpconfig
27650 @opindex mpconfig
27651 @need 200
27652 @itemx -mwbnoinvd
27653 @opindex mwbnoinvd
27654 @need 200
27655 @itemx -mfma4
27656 @opindex mfma4
27657 @need 200
27658 @itemx -mprefetchwt1
27659 @opindex mprefetchwt1
27660 @need 200
27661 @itemx -mxop
27662 @opindex mxop
27663 @need 200
27664 @itemx -mlwp
27665 @opindex mlwp
27666 @need 200
27667 @itemx -m3dnow
27668 @opindex m3dnow
27669 @need 200
27670 @itemx -m3dnowa
27671 @opindex m3dnowa
27672 @need 200
27673 @itemx -mpopcnt
27674 @opindex mpopcnt
27675 @need 200
27676 @itemx -mabm
27677 @opindex mabm
27678 @need 200
27679 @itemx -mbmi
27680 @opindex mbmi
27681 @need 200
27682 @itemx -mbmi2
27683 @need 200
27684 @itemx -mlzcnt
27685 @opindex mlzcnt
27686 @need 200
27687 @itemx -mfxsr
27688 @opindex mfxsr
27689 @need 200
27690 @itemx -mxsave
27691 @opindex mxsave
27692 @need 200
27693 @itemx -mxsaveopt
27694 @opindex mxsaveopt
27695 @need 200
27696 @itemx -mxsavec
27697 @opindex mxsavec
27698 @need 200
27699 @itemx -mxsaves
27700 @opindex mxsaves
27701 @need 200
27702 @itemx -mrtm
27703 @opindex mrtm
27704 @need 200
27705 @itemx -mtbm
27706 @opindex mtbm
27707 @need 200
27708 @itemx -mmwaitx
27709 @opindex mmwaitx
27710 @need 200
27711 @itemx -mclzero
27712 @opindex mclzero
27713 @need 200
27714 @itemx -mpku
27715 @opindex mpku
27716 @need 200
27717 @itemx -mavx512vbmi2
27718 @opindex mavx512vbmi2
27719 @need 200
27720 @itemx -mgfni
27721 @opindex mgfni
27722 @need 200
27723 @itemx -mvaes
27724 @opindex mvaes
27725 @need 200
27726 @itemx -mwaitpkg
27727 @opindex -mwaitpkg
27728 @need 200
27729 @itemx -mvpclmulqdq
27730 @opindex mvpclmulqdq
27731 @need 200
27732 @itemx -mavx512bitalg
27733 @opindex mavx512bitalg
27734 @need 200
27735 @itemx -mmovdiri
27736 @opindex mmovdiri
27737 @need 200
27738 @itemx -mmovdir64b
27739 @opindex mmovdir64b
27740 @need 200
27741 @itemx -mavx512vpopcntdq
27742 @opindex mavx512vpopcntdq
27743 @need 200
27744 @itemx -mcldemote
27745 @opindex mcldemote
27746 These switches enable the use of instructions in the MMX, SSE,
27747 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
27748 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
27749 AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA, AVX512VBMI, BMI, BMI2, VAES, WAITPKG,
27750 FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, MWAITX, PKU, IBT, SHSTK, AVX512VBMI2,
27751 GFNI, VPCLMULQDQ, AVX512BITALG, MOVDIRI, MOVDIR64B,
27752 AVX512VPOPCNTDQ, CLDEMOTE, 3DNow!@: or enhanced 3DNow!@: extended instruction
27753 sets. Each has a corresponding @option{-mno-} option to disable use of these
27754 instructions.
27756 These extensions are also available as built-in functions: see
27757 @ref{x86 Built-in Functions}, for details of the functions enabled and
27758 disabled by these switches.
27760 To generate SSE/SSE2 instructions automatically from floating-point
27761 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
27763 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
27764 generates new AVX instructions or AVX equivalence for all SSEx instructions
27765 when needed.
27767 These options enable GCC to use these extended instructions in
27768 generated code, even without @option{-mfpmath=sse}.  Applications that
27769 perform run-time CPU detection must compile separate files for each
27770 supported architecture, using the appropriate flags.  In particular,
27771 the file containing the CPU detection code should be compiled without
27772 these options.
27774 @item -mdump-tune-features
27775 @opindex mdump-tune-features
27776 This option instructs GCC to dump the names of the x86 performance 
27777 tuning features and default settings. The names can be used in 
27778 @option{-mtune-ctrl=@var{feature-list}}.
27780 @item -mtune-ctrl=@var{feature-list}
27781 @opindex mtune-ctrl=@var{feature-list}
27782 This option is used to do fine grain control of x86 code generation features.
27783 @var{feature-list} is a comma separated list of @var{feature} names. See also
27784 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
27785 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
27786 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
27787 developers. Using it may lead to code paths not covered by testing and can
27788 potentially result in compiler ICEs or runtime errors.
27790 @item -mno-default
27791 @opindex mno-default
27792 This option instructs GCC to turn off all tunable features. See also 
27793 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
27795 @item -mcld
27796 @opindex mcld
27797 This option instructs GCC to emit a @code{cld} instruction in the prologue
27798 of functions that use string instructions.  String instructions depend on
27799 the DF flag to select between autoincrement or autodecrement mode.  While the
27800 ABI specifies the DF flag to be cleared on function entry, some operating
27801 systems violate this specification by not clearing the DF flag in their
27802 exception dispatchers.  The exception handler can be invoked with the DF flag
27803 set, which leads to wrong direction mode when string instructions are used.
27804 This option can be enabled by default on 32-bit x86 targets by configuring
27805 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
27806 instructions can be suppressed with the @option{-mno-cld} compiler option
27807 in this case.
27809 @item -mvzeroupper
27810 @opindex mvzeroupper
27811 This option instructs GCC to emit a @code{vzeroupper} instruction
27812 before a transfer of control flow out of the function to minimize
27813 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
27814 intrinsics.
27816 @item -mprefer-avx128
27817 @opindex mprefer-avx128
27818 This option instructs GCC to use 128-bit AVX instructions instead of
27819 256-bit AVX instructions in the auto-vectorizer.
27821 @item -mprefer-vector-width=@var{opt}
27822 @opindex mprefer-vector-width
27823 This option instructs GCC to use @var{opt}-bit vector width in instructions
27824 instead of default on the selected platform.
27826 @table @samp
27827 @item none
27828 No extra limitations applied to GCC other than defined by the selected platform.
27830 @item 128
27831 Prefer 128-bit vector width for instructions.
27833 @item 256
27834 Prefer 256-bit vector width for instructions.
27836 @item 512
27837 Prefer 512-bit vector width for instructions.
27838 @end table
27840 @item -mcx16
27841 @opindex mcx16
27842 This option enables GCC to generate @code{CMPXCHG16B} instructions in 64-bit
27843 code to implement compare-and-exchange operations on 16-byte aligned 128-bit
27844 objects.  This is useful for atomic updates of data structures exceeding one
27845 machine word in size.  The compiler uses this instruction to implement
27846 @ref{__sync Builtins}.  However, for @ref{__atomic Builtins} operating on
27847 128-bit integers, a library call is always used.
27849 @item -msahf
27850 @opindex msahf
27851 This option enables generation of @code{SAHF} instructions in 64-bit code.
27852 Early Intel Pentium 4 CPUs with Intel 64 support,
27853 prior to the introduction of Pentium 4 G1 step in December 2005,
27854 lacked the @code{LAHF} and @code{SAHF} instructions
27855 which are supported by AMD64.
27856 These are load and store instructions, respectively, for certain status flags.
27857 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
27858 @code{drem}, and @code{remainder} built-in functions;
27859 see @ref{Other Builtins} for details.
27861 @item -mmovbe
27862 @opindex mmovbe
27863 This option enables use of the @code{movbe} instruction to implement
27864 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
27866 @item -mshstk
27867 @opindex mshstk
27868 The @option{-mshstk} option enables shadow stack built-in functions
27869 from x86 Control-flow Enforcement Technology (CET).
27871 @item -mcrc32
27872 @opindex mcrc32
27873 This option enables built-in functions @code{__builtin_ia32_crc32qi},
27874 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
27875 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
27877 @item -mrecip
27878 @opindex mrecip
27879 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
27880 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
27881 with an additional Newton-Raphson step
27882 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
27883 (and their vectorized
27884 variants) for single-precision floating-point arguments.  These instructions
27885 are generated only when @option{-funsafe-math-optimizations} is enabled
27886 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
27887 Note that while the throughput of the sequence is higher than the throughput
27888 of the non-reciprocal instruction, the precision of the sequence can be
27889 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
27891 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
27892 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
27893 combination), and doesn't need @option{-mrecip}.
27895 Also note that GCC emits the above sequence with additional Newton-Raphson step
27896 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
27897 already with @option{-ffast-math} (or the above option combination), and
27898 doesn't need @option{-mrecip}.
27900 @item -mrecip=@var{opt}
27901 @opindex mrecip=opt
27902 This option controls which reciprocal estimate instructions
27903 may be used.  @var{opt} is a comma-separated list of options, which may
27904 be preceded by a @samp{!} to invert the option:
27906 @table @samp
27907 @item all
27908 Enable all estimate instructions.
27910 @item default
27911 Enable the default instructions, equivalent to @option{-mrecip}.
27913 @item none
27914 Disable all estimate instructions, equivalent to @option{-mno-recip}.
27916 @item div
27917 Enable the approximation for scalar division.
27919 @item vec-div
27920 Enable the approximation for vectorized division.
27922 @item sqrt
27923 Enable the approximation for scalar square root.
27925 @item vec-sqrt
27926 Enable the approximation for vectorized square root.
27927 @end table
27929 So, for example, @option{-mrecip=all,!sqrt} enables
27930 all of the reciprocal approximations, except for square root.
27932 @item -mveclibabi=@var{type}
27933 @opindex mveclibabi
27934 Specifies the ABI type to use for vectorizing intrinsics using an
27935 external library.  Supported values for @var{type} are @samp{svml} 
27936 for the Intel short
27937 vector math library and @samp{acml} for the AMD math core library.
27938 To use this option, both @option{-ftree-vectorize} and
27939 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
27940 ABI-compatible library must be specified at link time.
27942 GCC currently emits calls to @code{vmldExp2},
27943 @code{vmldLn2}, @code{vmldLog102}, @code{vmldPow2},
27944 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
27945 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
27946 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
27947 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4},
27948 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
27949 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
27950 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
27951 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
27952 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
27953 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
27954 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
27955 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
27956 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
27957 when @option{-mveclibabi=acml} is used.  
27959 @item -mabi=@var{name}
27960 @opindex mabi
27961 Generate code for the specified calling convention.  Permissible values
27962 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
27963 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
27964 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
27965 You can control this behavior for specific functions by
27966 using the function attributes @code{ms_abi} and @code{sysv_abi}.
27967 @xref{Function Attributes}.
27969 @item -mforce-indirect-call
27970 @opindex mforce-indirect-call
27971 Force all calls to functions to be indirect. This is useful
27972 when using Intel Processor Trace where it generates more precise timing
27973 information for function calls.
27975 @item -mcall-ms2sysv-xlogues
27976 @opindex mcall-ms2sysv-xlogues
27977 @opindex mno-call-ms2sysv-xlogues
27978 Due to differences in 64-bit ABIs, any Microsoft ABI function that calls a
27979 System V ABI function must consider RSI, RDI and XMM6-15 as clobbered.  By
27980 default, the code for saving and restoring these registers is emitted inline,
27981 resulting in fairly lengthy prologues and epilogues.  Using
27982 @option{-mcall-ms2sysv-xlogues} emits prologues and epilogues that
27983 use stubs in the static portion of libgcc to perform these saves and restores,
27984 thus reducing function size at the cost of a few extra instructions.
27986 @item -mtls-dialect=@var{type}
27987 @opindex mtls-dialect
27988 Generate code to access thread-local storage using the @samp{gnu} or
27989 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
27990 @samp{gnu2} is more efficient, but it may add compile- and run-time
27991 requirements that cannot be satisfied on all systems.
27993 @item -mpush-args
27994 @itemx -mno-push-args
27995 @opindex mpush-args
27996 @opindex mno-push-args
27997 Use PUSH operations to store outgoing parameters.  This method is shorter
27998 and usually equally fast as method using SUB/MOV operations and is enabled
27999 by default.  In some cases disabling it may improve performance because of
28000 improved scheduling and reduced dependencies.
28002 @item -maccumulate-outgoing-args
28003 @opindex maccumulate-outgoing-args
28004 If enabled, the maximum amount of space required for outgoing arguments is
28005 computed in the function prologue.  This is faster on most modern CPUs
28006 because of reduced dependencies, improved scheduling and reduced stack usage
28007 when the preferred stack boundary is not equal to 2.  The drawback is a notable
28008 increase in code size.  This switch implies @option{-mno-push-args}.
28010 @item -mthreads
28011 @opindex mthreads
28012 Support thread-safe exception handling on MinGW.  Programs that rely
28013 on thread-safe exception handling must compile and link all code with the
28014 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
28015 @option{-D_MT}; when linking, it links in a special thread helper library
28016 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
28018 @item -mms-bitfields
28019 @itemx -mno-ms-bitfields
28020 @opindex mms-bitfields
28021 @opindex mno-ms-bitfields
28023 Enable/disable bit-field layout compatible with the native Microsoft
28024 Windows compiler.  
28026 If @code{packed} is used on a structure, or if bit-fields are used,
28027 it may be that the Microsoft ABI lays out the structure differently
28028 than the way GCC normally does.  Particularly when moving packed
28029 data between functions compiled with GCC and the native Microsoft compiler
28030 (either via function call or as data in a file), it may be necessary to access
28031 either format.
28033 This option is enabled by default for Microsoft Windows
28034 targets.  This behavior can also be controlled locally by use of variable
28035 or type attributes.  For more information, see @ref{x86 Variable Attributes}
28036 and @ref{x86 Type Attributes}.
28038 The Microsoft structure layout algorithm is fairly simple with the exception
28039 of the bit-field packing.  
28040 The padding and alignment of members of structures and whether a bit-field 
28041 can straddle a storage-unit boundary are determine by these rules:
28043 @enumerate
28044 @item Structure members are stored sequentially in the order in which they are
28045 declared: the first member has the lowest memory address and the last member
28046 the highest.
28048 @item Every data object has an alignment requirement.  The alignment requirement
28049 for all data except structures, unions, and arrays is either the size of the
28050 object or the current packing size (specified with either the
28051 @code{aligned} attribute or the @code{pack} pragma),
28052 whichever is less.  For structures, unions, and arrays,
28053 the alignment requirement is the largest alignment requirement of its members.
28054 Every object is allocated an offset so that:
28056 @smallexample
28057 offset % alignment_requirement == 0
28058 @end smallexample
28060 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
28061 unit if the integral types are the same size and if the next bit-field fits
28062 into the current allocation unit without crossing the boundary imposed by the
28063 common alignment requirements of the bit-fields.
28064 @end enumerate
28066 MSVC interprets zero-length bit-fields in the following ways:
28068 @enumerate
28069 @item If a zero-length bit-field is inserted between two bit-fields that
28070 are normally coalesced, the bit-fields are not coalesced.
28072 For example:
28074 @smallexample
28075 struct
28076  @{
28077    unsigned long bf_1 : 12;
28078    unsigned long : 0;
28079    unsigned long bf_2 : 12;
28080  @} t1;
28081 @end smallexample
28083 @noindent
28084 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
28085 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
28087 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
28088 alignment of the zero-length bit-field is greater than the member that follows it,
28089 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
28091 For example:
28093 @smallexample
28094 struct
28095  @{
28096    char foo : 4;
28097    short : 0;
28098    char bar;
28099  @} t2;
28101 struct
28102  @{
28103    char foo : 4;
28104    short : 0;
28105    double bar;
28106  @} t3;
28107 @end smallexample
28109 @noindent
28110 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
28111 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
28112 bit-field does not affect the alignment of @code{bar} or, as a result, the size
28113 of the structure.
28115 Taking this into account, it is important to note the following:
28117 @enumerate
28118 @item If a zero-length bit-field follows a normal bit-field, the type of the
28119 zero-length bit-field may affect the alignment of the structure as whole. For
28120 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
28121 normal bit-field, and is of type short.
28123 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
28124 still affect the alignment of the structure:
28126 @smallexample
28127 struct
28128  @{
28129    char foo : 6;
28130    long : 0;
28131  @} t4;
28132 @end smallexample
28134 @noindent
28135 Here, @code{t4} takes up 4 bytes.
28136 @end enumerate
28138 @item Zero-length bit-fields following non-bit-field members are ignored:
28140 @smallexample
28141 struct
28142  @{
28143    char foo;
28144    long : 0;
28145    char bar;
28146  @} t5;
28147 @end smallexample
28149 @noindent
28150 Here, @code{t5} takes up 2 bytes.
28151 @end enumerate
28154 @item -mno-align-stringops
28155 @opindex mno-align-stringops
28156 Do not align the destination of inlined string operations.  This switch reduces
28157 code size and improves performance in case the destination is already aligned,
28158 but GCC doesn't know about it.
28160 @item -minline-all-stringops
28161 @opindex minline-all-stringops
28162 By default GCC inlines string operations only when the destination is 
28163 known to be aligned to least a 4-byte boundary.  
28164 This enables more inlining and increases code
28165 size, but may improve performance of code that depends on fast
28166 @code{memcpy}, @code{strlen},
28167 and @code{memset} for short lengths.
28169 @item -minline-stringops-dynamically
28170 @opindex minline-stringops-dynamically
28171 For string operations of unknown size, use run-time checks with
28172 inline code for small blocks and a library call for large blocks.
28174 @item -mstringop-strategy=@var{alg}
28175 @opindex mstringop-strategy=@var{alg}
28176 Override the internal decision heuristic for the particular algorithm to use
28177 for inlining string operations.  The allowed values for @var{alg} are:
28179 @table @samp
28180 @item rep_byte
28181 @itemx rep_4byte
28182 @itemx rep_8byte
28183 Expand using i386 @code{rep} prefix of the specified size.
28185 @item byte_loop
28186 @itemx loop
28187 @itemx unrolled_loop
28188 Expand into an inline loop.
28190 @item libcall
28191 Always use a library call.
28192 @end table
28194 @item -mmemcpy-strategy=@var{strategy}
28195 @opindex mmemcpy-strategy=@var{strategy}
28196 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
28197 should be inlined and what inline algorithm to use when the expected size
28198 of the copy operation is known. @var{strategy} 
28199 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
28200 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
28201 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
28202 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
28203 in the list must be specified in increasing order.  The minimal byte size for 
28204 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
28205 preceding range.
28207 @item -mmemset-strategy=@var{strategy}
28208 @opindex mmemset-strategy=@var{strategy}
28209 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
28210 @code{__builtin_memset} expansion.
28212 @item -momit-leaf-frame-pointer
28213 @opindex momit-leaf-frame-pointer
28214 Don't keep the frame pointer in a register for leaf functions.  This
28215 avoids the instructions to save, set up, and restore frame pointers and
28216 makes an extra register available in leaf functions.  The option
28217 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
28218 which might make debugging harder.
28220 @item -mtls-direct-seg-refs
28221 @itemx -mno-tls-direct-seg-refs
28222 @opindex mtls-direct-seg-refs
28223 Controls whether TLS variables may be accessed with offsets from the
28224 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
28225 or whether the thread base pointer must be added.  Whether or not this
28226 is valid depends on the operating system, and whether it maps the
28227 segment to cover the entire TLS area.
28229 For systems that use the GNU C Library, the default is on.
28231 @item -msse2avx
28232 @itemx -mno-sse2avx
28233 @opindex msse2avx
28234 Specify that the assembler should encode SSE instructions with VEX
28235 prefix.  The option @option{-mavx} turns this on by default.
28237 @item -mfentry
28238 @itemx -mno-fentry
28239 @opindex mfentry
28240 If profiling is active (@option{-pg}), put the profiling
28241 counter call before the prologue.
28242 Note: On x86 architectures the attribute @code{ms_hook_prologue}
28243 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
28245 @item -mrecord-mcount
28246 @itemx -mno-record-mcount
28247 @opindex mrecord-mcount
28248 If profiling is active (@option{-pg}), generate a __mcount_loc section
28249 that contains pointers to each profiling call. This is useful for
28250 automatically patching and out calls.
28252 @item -mnop-mcount
28253 @itemx -mno-nop-mcount
28254 @opindex mnop-mcount
28255 If profiling is active (@option{-pg}), generate the calls to
28256 the profiling functions as NOPs. This is useful when they
28257 should be patched in later dynamically. This is likely only
28258 useful together with @option{-mrecord-mcount}.
28260 @item -mskip-rax-setup
28261 @itemx -mno-skip-rax-setup
28262 @opindex mskip-rax-setup
28263 When generating code for the x86-64 architecture with SSE extensions
28264 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
28265 register when there are no variable arguments passed in vector registers.
28267 @strong{Warning:} Since RAX register is used to avoid unnecessarily
28268 saving vector registers on stack when passing variable arguments, the
28269 impacts of this option are callees may waste some stack space,
28270 misbehave or jump to a random location.  GCC 4.4 or newer don't have
28271 those issues, regardless the RAX register value.
28273 @item -m8bit-idiv
28274 @itemx -mno-8bit-idiv
28275 @opindex m8bit-idiv
28276 On some processors, like Intel Atom, 8-bit unsigned integer divide is
28277 much faster than 32-bit/64-bit integer divide.  This option generates a
28278 run-time check.  If both dividend and divisor are within range of 0
28279 to 255, 8-bit unsigned integer divide is used instead of
28280 32-bit/64-bit integer divide.
28282 @item -mavx256-split-unaligned-load
28283 @itemx -mavx256-split-unaligned-store
28284 @opindex mavx256-split-unaligned-load
28285 @opindex mavx256-split-unaligned-store
28286 Split 32-byte AVX unaligned load and store.
28288 @item -mstack-protector-guard=@var{guard}
28289 @itemx -mstack-protector-guard-reg=@var{reg}
28290 @itemx -mstack-protector-guard-offset=@var{offset}
28291 @opindex mstack-protector-guard
28292 @opindex mstack-protector-guard-reg
28293 @opindex mstack-protector-guard-offset
28294 Generate stack protection code using canary at @var{guard}.  Supported
28295 locations are @samp{global} for global canary or @samp{tls} for per-thread
28296 canary in the TLS block (the default).  This option has effect only when
28297 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
28299 With the latter choice the options
28300 @option{-mstack-protector-guard-reg=@var{reg}} and
28301 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
28302 which segment register (@code{%fs} or @code{%gs}) to use as base register
28303 for reading the canary, and from what offset from that base register.
28304 The default for those is as specified in the relevant ABI.
28306 @item -mgeneral-regs-only
28307 @opindex mgeneral-regs-only
28308 Generate code that uses only the general-purpose registers.  This
28309 prevents the compiler from using floating-point, vector, mask and bound
28310 registers.
28312 @item -mindirect-branch=@var{choice}
28313 @opindex -mindirect-branch
28314 Convert indirect call and jump with @var{choice}.  The default is
28315 @samp{keep}, which keeps indirect call and jump unmodified.
28316 @samp{thunk} converts indirect call and jump to call and return thunk.
28317 @samp{thunk-inline} converts indirect call and jump to inlined call
28318 and return thunk.  @samp{thunk-extern} converts indirect call and jump
28319 to external call and return thunk provided in a separate object file.
28320 You can control this behavior for a specific function by using the
28321 function attribute @code{indirect_branch}.  @xref{Function Attributes}.
28323 Note that @option{-mcmodel=large} is incompatible with
28324 @option{-mindirect-branch=thunk} and
28325 @option{-mindirect-branch=thunk-extern} since the thunk function may
28326 not be reachable in the large code model.
28328 Note that @option{-mindirect-branch=thunk-extern} is incompatible with
28329 @option{-fcf-protection=branch} since the external thunk can not be modified
28330 to disable control-flow check.
28332 @item -mfunction-return=@var{choice}
28333 @opindex -mfunction-return
28334 Convert function return with @var{choice}.  The default is @samp{keep},
28335 which keeps function return unmodified.  @samp{thunk} converts function
28336 return to call and return thunk.  @samp{thunk-inline} converts function
28337 return to inlined call and return thunk.  @samp{thunk-extern} converts
28338 function return to external call and return thunk provided in a separate
28339 object file.  You can control this behavior for a specific function by
28340 using the function attribute @code{function_return}.
28341 @xref{Function Attributes}.
28343 Note that @option{-mcmodel=large} is incompatible with
28344 @option{-mfunction-return=thunk} and
28345 @option{-mfunction-return=thunk-extern} since the thunk function may
28346 not be reachable in the large code model.
28349 @item -mindirect-branch-register
28350 @opindex -mindirect-branch-register
28351 Force indirect call and jump via register.
28353 @end table
28355 These @samp{-m} switches are supported in addition to the above
28356 on x86-64 processors in 64-bit environments.
28358 @table @gcctabopt
28359 @item -m32
28360 @itemx -m64
28361 @itemx -mx32
28362 @itemx -m16
28363 @itemx -miamcu
28364 @opindex m32
28365 @opindex m64
28366 @opindex mx32
28367 @opindex m16
28368 @opindex miamcu
28369 Generate code for a 16-bit, 32-bit or 64-bit environment.
28370 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
28371 to 32 bits, and
28372 generates code that runs on any i386 system.
28374 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
28375 types to 64 bits, and generates code for the x86-64 architecture.
28376 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
28377 and @option{-mdynamic-no-pic} options.
28379 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
28380 to 32 bits, and
28381 generates code for the x86-64 architecture.
28383 The @option{-m16} option is the same as @option{-m32}, except for that
28384 it outputs the @code{.code16gcc} assembly directive at the beginning of
28385 the assembly output so that the binary can run in 16-bit mode.
28387 The @option{-miamcu} option generates code which conforms to Intel MCU
28388 psABI.  It requires the @option{-m32} option to be turned on.
28390 @item -mno-red-zone
28391 @opindex mno-red-zone
28392 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
28393 by the x86-64 ABI; it is a 128-byte area beyond the location of the
28394 stack pointer that is not modified by signal or interrupt handlers
28395 and therefore can be used for temporary data without adjusting the stack
28396 pointer.  The flag @option{-mno-red-zone} disables this red zone.
28398 @item -mcmodel=small
28399 @opindex mcmodel=small
28400 Generate code for the small code model: the program and its symbols must
28401 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
28402 Programs can be statically or dynamically linked.  This is the default
28403 code model.
28405 @item -mcmodel=kernel
28406 @opindex mcmodel=kernel
28407 Generate code for the kernel code model.  The kernel runs in the
28408 negative 2 GB of the address space.
28409 This model has to be used for Linux kernel code.
28411 @item -mcmodel=medium
28412 @opindex mcmodel=medium
28413 Generate code for the medium model: the program is linked in the lower 2
28414 GB of the address space.  Small symbols are also placed there.  Symbols
28415 with sizes larger than @option{-mlarge-data-threshold} are put into
28416 large data or BSS sections and can be located above 2GB.  Programs can
28417 be statically or dynamically linked.
28419 @item -mcmodel=large
28420 @opindex mcmodel=large
28421 Generate code for the large model.  This model makes no assumptions
28422 about addresses and sizes of sections.
28424 @item -maddress-mode=long
28425 @opindex maddress-mode=long
28426 Generate code for long address mode.  This is only supported for 64-bit
28427 and x32 environments.  It is the default address mode for 64-bit
28428 environments.
28430 @item -maddress-mode=short
28431 @opindex maddress-mode=short
28432 Generate code for short address mode.  This is only supported for 32-bit
28433 and x32 environments.  It is the default address mode for 32-bit and
28434 x32 environments.
28435 @end table
28437 @node x86 Windows Options
28438 @subsection x86 Windows Options
28439 @cindex x86 Windows Options
28440 @cindex Windows Options for x86
28442 These additional options are available for Microsoft Windows targets:
28444 @table @gcctabopt
28445 @item -mconsole
28446 @opindex mconsole
28447 This option
28448 specifies that a console application is to be generated, by
28449 instructing the linker to set the PE header subsystem type
28450 required for console applications.
28451 This option is available for Cygwin and MinGW targets and is
28452 enabled by default on those targets.
28454 @item -mdll
28455 @opindex mdll
28456 This option is available for Cygwin and MinGW targets.  It
28457 specifies that a DLL---a dynamic link library---is to be
28458 generated, enabling the selection of the required runtime
28459 startup object and entry point.
28461 @item -mnop-fun-dllimport
28462 @opindex mnop-fun-dllimport
28463 This option is available for Cygwin and MinGW targets.  It
28464 specifies that the @code{dllimport} attribute should be ignored.
28466 @item -mthread
28467 @opindex mthread
28468 This option is available for MinGW targets. It specifies
28469 that MinGW-specific thread support is to be used.
28471 @item -municode
28472 @opindex municode
28473 This option is available for MinGW-w64 targets.  It causes
28474 the @code{UNICODE} preprocessor macro to be predefined, and
28475 chooses Unicode-capable runtime startup code.
28477 @item -mwin32
28478 @opindex mwin32
28479 This option is available for Cygwin and MinGW targets.  It
28480 specifies that the typical Microsoft Windows predefined macros are to
28481 be set in the pre-processor, but does not influence the choice
28482 of runtime library/startup code.
28484 @item -mwindows
28485 @opindex mwindows
28486 This option is available for Cygwin and MinGW targets.  It
28487 specifies that a GUI application is to be generated by
28488 instructing the linker to set the PE header subsystem type
28489 appropriately.
28491 @item -fno-set-stack-executable
28492 @opindex fno-set-stack-executable
28493 This option is available for MinGW targets. It specifies that
28494 the executable flag for the stack used by nested functions isn't
28495 set. This is necessary for binaries running in kernel mode of
28496 Microsoft Windows, as there the User32 API, which is used to set executable
28497 privileges, isn't available.
28499 @item -fwritable-relocated-rdata
28500 @opindex fno-writable-relocated-rdata
28501 This option is available for MinGW and Cygwin targets.  It specifies
28502 that relocated-data in read-only section is put into the @code{.data}
28503 section.  This is a necessary for older runtimes not supporting
28504 modification of @code{.rdata} sections for pseudo-relocation.
28506 @item -mpe-aligned-commons
28507 @opindex mpe-aligned-commons
28508 This option is available for Cygwin and MinGW targets.  It
28509 specifies that the GNU extension to the PE file format that
28510 permits the correct alignment of COMMON variables should be
28511 used when generating code.  It is enabled by default if
28512 GCC detects that the target assembler found during configuration
28513 supports the feature.
28514 @end table
28516 See also under @ref{x86 Options} for standard options.
28518 @node Xstormy16 Options
28519 @subsection Xstormy16 Options
28520 @cindex Xstormy16 Options
28522 These options are defined for Xstormy16:
28524 @table @gcctabopt
28525 @item -msim
28526 @opindex msim
28527 Choose startup files and linker script suitable for the simulator.
28528 @end table
28530 @node Xtensa Options
28531 @subsection Xtensa Options
28532 @cindex Xtensa Options
28534 These options are supported for Xtensa targets:
28536 @table @gcctabopt
28537 @item -mconst16
28538 @itemx -mno-const16
28539 @opindex mconst16
28540 @opindex mno-const16
28541 Enable or disable use of @code{CONST16} instructions for loading
28542 constant values.  The @code{CONST16} instruction is currently not a
28543 standard option from Tensilica.  When enabled, @code{CONST16}
28544 instructions are always used in place of the standard @code{L32R}
28545 instructions.  The use of @code{CONST16} is enabled by default only if
28546 the @code{L32R} instruction is not available.
28548 @item -mfused-madd
28549 @itemx -mno-fused-madd
28550 @opindex mfused-madd
28551 @opindex mno-fused-madd
28552 Enable or disable use of fused multiply/add and multiply/subtract
28553 instructions in the floating-point option.  This has no effect if the
28554 floating-point option is not also enabled.  Disabling fused multiply/add
28555 and multiply/subtract instructions forces the compiler to use separate
28556 instructions for the multiply and add/subtract operations.  This may be
28557 desirable in some cases where strict IEEE 754-compliant results are
28558 required: the fused multiply add/subtract instructions do not round the
28559 intermediate result, thereby producing results with @emph{more} bits of
28560 precision than specified by the IEEE standard.  Disabling fused multiply
28561 add/subtract instructions also ensures that the program output is not
28562 sensitive to the compiler's ability to combine multiply and add/subtract
28563 operations.
28565 @item -mserialize-volatile
28566 @itemx -mno-serialize-volatile
28567 @opindex mserialize-volatile
28568 @opindex mno-serialize-volatile
28569 When this option is enabled, GCC inserts @code{MEMW} instructions before
28570 @code{volatile} memory references to guarantee sequential consistency.
28571 The default is @option{-mserialize-volatile}.  Use
28572 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
28574 @item -mforce-no-pic
28575 @opindex mforce-no-pic
28576 For targets, like GNU/Linux, where all user-mode Xtensa code must be
28577 position-independent code (PIC), this option disables PIC for compiling
28578 kernel code.
28580 @item -mtext-section-literals
28581 @itemx -mno-text-section-literals
28582 @opindex mtext-section-literals
28583 @opindex mno-text-section-literals
28584 These options control the treatment of literal pools.  The default is
28585 @option{-mno-text-section-literals}, which places literals in a separate
28586 section in the output file.  This allows the literal pool to be placed
28587 in a data RAM/ROM, and it also allows the linker to combine literal
28588 pools from separate object files to remove redundant literals and
28589 improve code size.  With @option{-mtext-section-literals}, the literals
28590 are interspersed in the text section in order to keep them as close as
28591 possible to their references.  This may be necessary for large assembly
28592 files.  Literals for each function are placed right before that function.
28594 @item -mauto-litpools
28595 @itemx -mno-auto-litpools
28596 @opindex mauto-litpools
28597 @opindex mno-auto-litpools
28598 These options control the treatment of literal pools.  The default is
28599 @option{-mno-auto-litpools}, which places literals in a separate
28600 section in the output file unless @option{-mtext-section-literals} is
28601 used.  With @option{-mauto-litpools} the literals are interspersed in
28602 the text section by the assembler.  Compiler does not produce explicit
28603 @code{.literal} directives and loads literals into registers with
28604 @code{MOVI} instructions instead of @code{L32R} to let the assembler
28605 do relaxation and place literals as necessary.  This option allows
28606 assembler to create several literal pools per function and assemble
28607 very big functions, which may not be possible with
28608 @option{-mtext-section-literals}.
28610 @item -mtarget-align
28611 @itemx -mno-target-align
28612 @opindex mtarget-align
28613 @opindex mno-target-align
28614 When this option is enabled, GCC instructs the assembler to
28615 automatically align instructions to reduce branch penalties at the
28616 expense of some code density.  The assembler attempts to widen density
28617 instructions to align branch targets and the instructions following call
28618 instructions.  If there are not enough preceding safe density
28619 instructions to align a target, no widening is performed.  The
28620 default is @option{-mtarget-align}.  These options do not affect the
28621 treatment of auto-aligned instructions like @code{LOOP}, which the
28622 assembler always aligns, either by widening density instructions or
28623 by inserting NOP instructions.
28625 @item -mlongcalls
28626 @itemx -mno-longcalls
28627 @opindex mlongcalls
28628 @opindex mno-longcalls
28629 When this option is enabled, GCC instructs the assembler to translate
28630 direct calls to indirect calls unless it can determine that the target
28631 of a direct call is in the range allowed by the call instruction.  This
28632 translation typically occurs for calls to functions in other source
28633 files.  Specifically, the assembler translates a direct @code{CALL}
28634 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
28635 The default is @option{-mno-longcalls}.  This option should be used in
28636 programs where the call target can potentially be out of range.  This
28637 option is implemented in the assembler, not the compiler, so the
28638 assembly code generated by GCC still shows direct call
28639 instructions---look at the disassembled object code to see the actual
28640 instructions.  Note that the assembler uses an indirect call for
28641 every cross-file call, not just those that really are out of range.
28642 @end table
28644 @node zSeries Options
28645 @subsection zSeries Options
28646 @cindex zSeries options
28648 These are listed under @xref{S/390 and zSeries Options}.
28651 @c man end
28653 @node Spec Files
28654 @section Specifying Subprocesses and the Switches to Pass to Them
28655 @cindex Spec Files
28657 @command{gcc} is a driver program.  It performs its job by invoking a
28658 sequence of other programs to do the work of compiling, assembling and
28659 linking.  GCC interprets its command-line parameters and uses these to
28660 deduce which programs it should invoke, and which command-line options
28661 it ought to place on their command lines.  This behavior is controlled
28662 by @dfn{spec strings}.  In most cases there is one spec string for each
28663 program that GCC can invoke, but a few programs have multiple spec
28664 strings to control their behavior.  The spec strings built into GCC can
28665 be overridden by using the @option{-specs=} command-line switch to specify
28666 a spec file.
28668 @dfn{Spec files} are plain-text files that are used to construct spec
28669 strings.  They consist of a sequence of directives separated by blank
28670 lines.  The type of directive is determined by the first non-whitespace
28671 character on the line, which can be one of the following:
28673 @table @code
28674 @item %@var{command}
28675 Issues a @var{command} to the spec file processor.  The commands that can
28676 appear here are:
28678 @table @code
28679 @item %include <@var{file}>
28680 @cindex @code{%include}
28681 Search for @var{file} and insert its text at the current point in the
28682 specs file.
28684 @item %include_noerr <@var{file}>
28685 @cindex @code{%include_noerr}
28686 Just like @samp{%include}, but do not generate an error message if the include
28687 file cannot be found.
28689 @item %rename @var{old_name} @var{new_name}
28690 @cindex @code{%rename}
28691 Rename the spec string @var{old_name} to @var{new_name}.
28693 @end table
28695 @item *[@var{spec_name}]:
28696 This tells the compiler to create, override or delete the named spec
28697 string.  All lines after this directive up to the next directive or
28698 blank line are considered to be the text for the spec string.  If this
28699 results in an empty string then the spec is deleted.  (Or, if the
28700 spec did not exist, then nothing happens.)  Otherwise, if the spec
28701 does not currently exist a new spec is created.  If the spec does
28702 exist then its contents are overridden by the text of this
28703 directive, unless the first character of that text is the @samp{+}
28704 character, in which case the text is appended to the spec.
28706 @item [@var{suffix}]:
28707 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
28708 and up to the next directive or blank line are considered to make up the
28709 spec string for the indicated suffix.  When the compiler encounters an
28710 input file with the named suffix, it processes the spec string in
28711 order to work out how to compile that file.  For example:
28713 @smallexample
28714 .ZZ:
28715 z-compile -input %i
28716 @end smallexample
28718 This says that any input file whose name ends in @samp{.ZZ} should be
28719 passed to the program @samp{z-compile}, which should be invoked with the
28720 command-line switch @option{-input} and with the result of performing the
28721 @samp{%i} substitution.  (See below.)
28723 As an alternative to providing a spec string, the text following a
28724 suffix directive can be one of the following:
28726 @table @code
28727 @item @@@var{language}
28728 This says that the suffix is an alias for a known @var{language}.  This is
28729 similar to using the @option{-x} command-line switch to GCC to specify a
28730 language explicitly.  For example:
28732 @smallexample
28733 .ZZ:
28734 @@c++
28735 @end smallexample
28737 Says that .ZZ files are, in fact, C++ source files.
28739 @item #@var{name}
28740 This causes an error messages saying:
28742 @smallexample
28743 @var{name} compiler not installed on this system.
28744 @end smallexample
28745 @end table
28747 GCC already has an extensive list of suffixes built into it.
28748 This directive adds an entry to the end of the list of suffixes, but
28749 since the list is searched from the end backwards, it is effectively
28750 possible to override earlier entries using this technique.
28752 @end table
28754 GCC has the following spec strings built into it.  Spec files can
28755 override these strings or create their own.  Note that individual
28756 targets can also add their own spec strings to this list.
28758 @smallexample
28759 asm          Options to pass to the assembler
28760 asm_final    Options to pass to the assembler post-processor
28761 cpp          Options to pass to the C preprocessor
28762 cc1          Options to pass to the C compiler
28763 cc1plus      Options to pass to the C++ compiler
28764 endfile      Object files to include at the end of the link
28765 link         Options to pass to the linker
28766 lib          Libraries to include on the command line to the linker
28767 libgcc       Decides which GCC support library to pass to the linker
28768 linker       Sets the name of the linker
28769 predefines   Defines to be passed to the C preprocessor
28770 signed_char  Defines to pass to CPP to say whether @code{char} is signed
28771              by default
28772 startfile    Object files to include at the start of the link
28773 @end smallexample
28775 Here is a small example of a spec file:
28777 @smallexample
28778 %rename lib                 old_lib
28780 *lib:
28781 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
28782 @end smallexample
28784 This example renames the spec called @samp{lib} to @samp{old_lib} and
28785 then overrides the previous definition of @samp{lib} with a new one.
28786 The new definition adds in some extra command-line options before
28787 including the text of the old definition.
28789 @dfn{Spec strings} are a list of command-line options to be passed to their
28790 corresponding program.  In addition, the spec strings can contain
28791 @samp{%}-prefixed sequences to substitute variable text or to
28792 conditionally insert text into the command line.  Using these constructs
28793 it is possible to generate quite complex command lines.
28795 Here is a table of all defined @samp{%}-sequences for spec
28796 strings.  Note that spaces are not generated automatically around the
28797 results of expanding these sequences.  Therefore you can concatenate them
28798 together or combine them with constant text in a single argument.
28800 @table @code
28801 @item %%
28802 Substitute one @samp{%} into the program name or argument.
28804 @item %i
28805 Substitute the name of the input file being processed.
28807 @item %b
28808 Substitute the basename of the input file being processed.
28809 This is the substring up to (and not including) the last period
28810 and not including the directory.
28812 @item %B
28813 This is the same as @samp{%b}, but include the file suffix (text after
28814 the last period).
28816 @item %d
28817 Marks the argument containing or following the @samp{%d} as a
28818 temporary file name, so that that file is deleted if GCC exits
28819 successfully.  Unlike @samp{%g}, this contributes no text to the
28820 argument.
28822 @item %g@var{suffix}
28823 Substitute a file name that has suffix @var{suffix} and is chosen
28824 once per compilation, and mark the argument in the same way as
28825 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
28826 name is now chosen in a way that is hard to predict even when previously
28827 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
28828 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
28829 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
28830 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
28831 was simply substituted with a file name chosen once per compilation,
28832 without regard to any appended suffix (which was therefore treated
28833 just like ordinary text), making such attacks more likely to succeed.
28835 @item %u@var{suffix}
28836 Like @samp{%g}, but generates a new temporary file name
28837 each time it appears instead of once per compilation.
28839 @item %U@var{suffix}
28840 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
28841 new one if there is no such last file name.  In the absence of any
28842 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
28843 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
28844 involves the generation of two distinct file names, one
28845 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
28846 simply substituted with a file name chosen for the previous @samp{%u},
28847 without regard to any appended suffix.
28849 @item %j@var{suffix}
28850 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
28851 writable, and if @option{-save-temps} is not used; 
28852 otherwise, substitute the name
28853 of a temporary file, just like @samp{%u}.  This temporary file is not
28854 meant for communication between processes, but rather as a junk
28855 disposal mechanism.
28857 @item %|@var{suffix}
28858 @itemx %m@var{suffix}
28859 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
28860 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
28861 all.  These are the two most common ways to instruct a program that it
28862 should read from standard input or write to standard output.  If you
28863 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
28864 construct: see for example @file{f/lang-specs.h}.
28866 @item %.@var{SUFFIX}
28867 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
28868 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
28869 terminated by the next space or %.
28871 @item %w
28872 Marks the argument containing or following the @samp{%w} as the
28873 designated output file of this compilation.  This puts the argument
28874 into the sequence of arguments that @samp{%o} substitutes.
28876 @item %o
28877 Substitutes the names of all the output files, with spaces
28878 automatically placed around them.  You should write spaces
28879 around the @samp{%o} as well or the results are undefined.
28880 @samp{%o} is for use in the specs for running the linker.
28881 Input files whose names have no recognized suffix are not compiled
28882 at all, but they are included among the output files, so they are
28883 linked.
28885 @item %O
28886 Substitutes the suffix for object files.  Note that this is
28887 handled specially when it immediately follows @samp{%g, %u, or %U},
28888 because of the need for those to form complete file names.  The
28889 handling is such that @samp{%O} is treated exactly as if it had already
28890 been substituted, except that @samp{%g, %u, and %U} do not currently
28891 support additional @var{suffix} characters following @samp{%O} as they do
28892 following, for example, @samp{.o}.
28894 @item %p
28895 Substitutes the standard macro predefinitions for the
28896 current target machine.  Use this when running @command{cpp}.
28898 @item %P
28899 Like @samp{%p}, but puts @samp{__} before and after the name of each
28900 predefined macro, except for macros that start with @samp{__} or with
28901 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
28904 @item %I
28905 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
28906 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
28907 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
28908 and @option{-imultilib} as necessary.
28910 @item %s
28911 Current argument is the name of a library or startup file of some sort.
28912 Search for that file in a standard list of directories and substitute
28913 the full name found.  The current working directory is included in the
28914 list of directories scanned.
28916 @item %T
28917 Current argument is the name of a linker script.  Search for that file
28918 in the current list of directories to scan for libraries. If the file
28919 is located insert a @option{--script} option into the command line
28920 followed by the full path name found.  If the file is not found then
28921 generate an error message.  Note: the current working directory is not
28922 searched.
28924 @item %e@var{str}
28925 Print @var{str} as an error message.  @var{str} is terminated by a newline.
28926 Use this when inconsistent options are detected.
28928 @item %(@var{name})
28929 Substitute the contents of spec string @var{name} at this point.
28931 @item %x@{@var{option}@}
28932 Accumulate an option for @samp{%X}.
28934 @item %X
28935 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
28936 spec string.
28938 @item %Y
28939 Output the accumulated assembler options specified by @option{-Wa}.
28941 @item %Z
28942 Output the accumulated preprocessor options specified by @option{-Wp}.
28944 @item %a
28945 Process the @code{asm} spec.  This is used to compute the
28946 switches to be passed to the assembler.
28948 @item %A
28949 Process the @code{asm_final} spec.  This is a spec string for
28950 passing switches to an assembler post-processor, if such a program is
28951 needed.
28953 @item %l
28954 Process the @code{link} spec.  This is the spec for computing the
28955 command line passed to the linker.  Typically it makes use of the
28956 @samp{%L %G %S %D and %E} sequences.
28958 @item %D
28959 Dump out a @option{-L} option for each directory that GCC believes might
28960 contain startup files.  If the target supports multilibs then the
28961 current multilib directory is prepended to each of these paths.
28963 @item %L
28964 Process the @code{lib} spec.  This is a spec string for deciding which
28965 libraries are included on the command line to the linker.
28967 @item %G
28968 Process the @code{libgcc} spec.  This is a spec string for deciding
28969 which GCC support library is included on the command line to the linker.
28971 @item %S
28972 Process the @code{startfile} spec.  This is a spec for deciding which
28973 object files are the first ones passed to the linker.  Typically
28974 this might be a file named @file{crt0.o}.
28976 @item %E
28977 Process the @code{endfile} spec.  This is a spec string that specifies
28978 the last object files that are passed to the linker.
28980 @item %C
28981 Process the @code{cpp} spec.  This is used to construct the arguments
28982 to be passed to the C preprocessor.
28984 @item %1
28985 Process the @code{cc1} spec.  This is used to construct the options to be
28986 passed to the actual C compiler (@command{cc1}).
28988 @item %2
28989 Process the @code{cc1plus} spec.  This is used to construct the options to be
28990 passed to the actual C++ compiler (@command{cc1plus}).
28992 @item %*
28993 Substitute the variable part of a matched option.  See below.
28994 Note that each comma in the substituted string is replaced by
28995 a single space.
28997 @item %<S
28998 Remove all occurrences of @code{-S} from the command line.  Note---this
28999 command is position dependent.  @samp{%} commands in the spec string
29000 before this one see @code{-S}, @samp{%} commands in the spec string
29001 after this one do not.
29003 @item %:@var{function}(@var{args})
29004 Call the named function @var{function}, passing it @var{args}.
29005 @var{args} is first processed as a nested spec string, then split
29006 into an argument vector in the usual fashion.  The function returns
29007 a string which is processed as if it had appeared literally as part
29008 of the current spec.
29010 The following built-in spec functions are provided:
29012 @table @code
29013 @item @code{getenv}
29014 The @code{getenv} spec function takes two arguments: an environment
29015 variable name and a string.  If the environment variable is not
29016 defined, a fatal error is issued.  Otherwise, the return value is the
29017 value of the environment variable concatenated with the string.  For
29018 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
29020 @smallexample
29021 %:getenv(TOPDIR /include)
29022 @end smallexample
29024 expands to @file{/path/to/top/include}.
29026 @item @code{if-exists}
29027 The @code{if-exists} spec function takes one argument, an absolute
29028 pathname to a file.  If the file exists, @code{if-exists} returns the
29029 pathname.  Here is a small example of its usage:
29031 @smallexample
29032 *startfile:
29033 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
29034 @end smallexample
29036 @item @code{if-exists-else}
29037 The @code{if-exists-else} spec function is similar to the @code{if-exists}
29038 spec function, except that it takes two arguments.  The first argument is
29039 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
29040 returns the pathname.  If it does not exist, it returns the second argument.
29041 This way, @code{if-exists-else} can be used to select one file or another,
29042 based on the existence of the first.  Here is a small example of its usage:
29044 @smallexample
29045 *startfile:
29046 crt0%O%s %:if-exists(crti%O%s) \
29047 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
29048 @end smallexample
29050 @item @code{replace-outfile}
29051 The @code{replace-outfile} spec function takes two arguments.  It looks for the
29052 first argument in the outfiles array and replaces it with the second argument.  Here
29053 is a small example of its usage:
29055 @smallexample
29056 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
29057 @end smallexample
29059 @item @code{remove-outfile}
29060 The @code{remove-outfile} spec function takes one argument.  It looks for the
29061 first argument in the outfiles array and removes it.  Here is a small example
29062 its usage:
29064 @smallexample
29065 %:remove-outfile(-lm)
29066 @end smallexample
29068 @item @code{pass-through-libs}
29069 The @code{pass-through-libs} spec function takes any number of arguments.  It
29070 finds any @option{-l} options and any non-options ending in @file{.a} (which it
29071 assumes are the names of linker input library archive files) and returns a
29072 result containing all the found arguments each prepended by
29073 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
29074 intended to be passed to the LTO linker plugin.
29076 @smallexample
29077 %:pass-through-libs(%G %L %G)
29078 @end smallexample
29080 @item @code{print-asm-header}
29081 The @code{print-asm-header} function takes no arguments and simply
29082 prints a banner like:
29084 @smallexample
29085 Assembler options
29086 =================
29088 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
29089 @end smallexample
29091 It is used to separate compiler options from assembler options
29092 in the @option{--target-help} output.
29093 @end table
29095 @item %@{S@}
29096 Substitutes the @code{-S} switch, if that switch is given to GCC@.
29097 If that switch is not specified, this substitutes nothing.  Note that
29098 the leading dash is omitted when specifying this option, and it is
29099 automatically inserted if the substitution is performed.  Thus the spec
29100 string @samp{%@{foo@}} matches the command-line option @option{-foo}
29101 and outputs the command-line option @option{-foo}.
29103 @item %W@{S@}
29104 Like %@{@code{S}@} but mark last argument supplied within as a file to be
29105 deleted on failure.
29107 @item %@{S*@}
29108 Substitutes all the switches specified to GCC whose names start
29109 with @code{-S}, but which also take an argument.  This is used for
29110 switches like @option{-o}, @option{-D}, @option{-I}, etc.
29111 GCC considers @option{-o foo} as being
29112 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
29113 text, including the space.  Thus two arguments are generated.
29115 @item %@{S*&T*@}
29116 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
29117 (the order of @code{S} and @code{T} in the spec is not significant).
29118 There can be any number of ampersand-separated variables; for each the
29119 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
29121 @item %@{S:X@}
29122 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
29124 @item %@{!S:X@}
29125 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
29127 @item %@{S*:X@}
29128 Substitutes @code{X} if one or more switches whose names start with
29129 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
29130 once, no matter how many such switches appeared.  However, if @code{%*}
29131 appears somewhere in @code{X}, then @code{X} is substituted once
29132 for each matching switch, with the @code{%*} replaced by the part of
29133 that switch matching the @code{*}.
29135 If @code{%*} appears as the last part of a spec sequence then a space
29136 is added after the end of the last substitution.  If there is more
29137 text in the sequence, however, then a space is not generated.  This
29138 allows the @code{%*} substitution to be used as part of a larger
29139 string.  For example, a spec string like this:
29141 @smallexample
29142 %@{mcu=*:--script=%*/memory.ld@}
29143 @end smallexample
29145 @noindent
29146 when matching an option like @option{-mcu=newchip} produces:
29148 @smallexample
29149 --script=newchip/memory.ld
29150 @end smallexample
29152 @item %@{.S:X@}
29153 Substitutes @code{X}, if processing a file with suffix @code{S}.
29155 @item %@{!.S:X@}
29156 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
29158 @item %@{,S:X@}
29159 Substitutes @code{X}, if processing a file for language @code{S}.
29161 @item %@{!,S:X@}
29162 Substitutes @code{X}, if not processing a file for language @code{S}.
29164 @item %@{S|P:X@}
29165 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
29166 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
29167 @code{*} sequences as well, although they have a stronger binding than
29168 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
29169 alternatives must be starred, and only the first matching alternative
29170 is substituted.
29172 For example, a spec string like this:
29174 @smallexample
29175 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
29176 @end smallexample
29178 @noindent
29179 outputs the following command-line options from the following input
29180 command-line options:
29182 @smallexample
29183 fred.c        -foo -baz
29184 jim.d         -bar -boggle
29185 -d fred.c     -foo -baz -boggle
29186 -d jim.d      -bar -baz -boggle
29187 @end smallexample
29189 @item %@{S:X; T:Y; :D@}
29191 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
29192 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
29193 be as many clauses as you need.  This may be combined with @code{.},
29194 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
29197 @end table
29199 The switch matching text @code{S} in a @samp{%@{S@}}, @samp{%@{S:X@}}
29200 or similar construct can use a backslash to ignore the special meaning
29201 of the character following it, thus allowing literal matching of a
29202 character that is otherwise specially treated.  For example,
29203 @samp{%@{std=iso9899\:1999:X@}} substitutes @code{X} if the
29204 @option{-std=iso9899:1999} option is given.
29206 The conditional text @code{X} in a @samp{%@{S:X@}} or similar
29207 construct may contain other nested @samp{%} constructs or spaces, or
29208 even newlines.  They are processed as usual, as described above.
29209 Trailing white space in @code{X} is ignored.  White space may also
29210 appear anywhere on the left side of the colon in these constructs,
29211 except between @code{.} or @code{*} and the corresponding word.
29213 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
29214 handled specifically in these constructs.  If another value of
29215 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
29216 @option{-W} switch is found later in the command line, the earlier
29217 switch value is ignored, except with @{@code{S}*@} where @code{S} is
29218 just one letter, which passes all matching options.
29220 The character @samp{|} at the beginning of the predicate text is used to
29221 indicate that a command should be piped to the following command, but
29222 only if @option{-pipe} is specified.
29224 It is built into GCC which switches take arguments and which do not.
29225 (You might think it would be useful to generalize this to allow each
29226 compiler's spec to say which switches take arguments.  But this cannot
29227 be done in a consistent fashion.  GCC cannot even decide which input
29228 files have been specified without knowing which switches take arguments,
29229 and it must know which input files to compile in order to tell which
29230 compilers to run).
29232 GCC also knows implicitly that arguments starting in @option{-l} are to be
29233 treated as compiler output files, and passed to the linker in their
29234 proper position among the other output files.
29236 @node Environment Variables
29237 @section Environment Variables Affecting GCC
29238 @cindex environment variables
29240 @c man begin ENVIRONMENT
29241 This section describes several environment variables that affect how GCC
29242 operates.  Some of them work by specifying directories or prefixes to use
29243 when searching for various kinds of files.  Some are used to specify other
29244 aspects of the compilation environment.
29246 Note that you can also specify places to search using options such as
29247 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
29248 take precedence over places specified using environment variables, which
29249 in turn take precedence over those specified by the configuration of GCC@.
29250 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
29251 GNU Compiler Collection (GCC) Internals}.
29253 @table @env
29254 @item LANG
29255 @itemx LC_CTYPE
29256 @c @itemx LC_COLLATE
29257 @itemx LC_MESSAGES
29258 @c @itemx LC_MONETARY
29259 @c @itemx LC_NUMERIC
29260 @c @itemx LC_TIME
29261 @itemx LC_ALL
29262 @findex LANG
29263 @findex LC_CTYPE
29264 @c @findex LC_COLLATE
29265 @findex LC_MESSAGES
29266 @c @findex LC_MONETARY
29267 @c @findex LC_NUMERIC
29268 @c @findex LC_TIME
29269 @findex LC_ALL
29270 @cindex locale
29271 These environment variables control the way that GCC uses
29272 localization information which allows GCC to work with different
29273 national conventions.  GCC inspects the locale categories
29274 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
29275 so.  These locale categories can be set to any value supported by your
29276 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
29277 Kingdom encoded in UTF-8.
29279 The @env{LC_CTYPE} environment variable specifies character
29280 classification.  GCC uses it to determine the character boundaries in
29281 a string; this is needed for some multibyte encodings that contain quote
29282 and escape characters that are otherwise interpreted as a string
29283 end or escape.
29285 The @env{LC_MESSAGES} environment variable specifies the language to
29286 use in diagnostic messages.
29288 If the @env{LC_ALL} environment variable is set, it overrides the value
29289 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
29290 and @env{LC_MESSAGES} default to the value of the @env{LANG}
29291 environment variable.  If none of these variables are set, GCC
29292 defaults to traditional C English behavior.
29294 @item TMPDIR
29295 @findex TMPDIR
29296 If @env{TMPDIR} is set, it specifies the directory to use for temporary
29297 files.  GCC uses temporary files to hold the output of one stage of
29298 compilation which is to be used as input to the next stage: for example,
29299 the output of the preprocessor, which is the input to the compiler
29300 proper.
29302 @item GCC_COMPARE_DEBUG
29303 @findex GCC_COMPARE_DEBUG
29304 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
29305 @option{-fcompare-debug} to the compiler driver.  See the documentation
29306 of this option for more details.
29308 @item GCC_EXEC_PREFIX
29309 @findex GCC_EXEC_PREFIX
29310 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
29311 names of the subprograms executed by the compiler.  No slash is added
29312 when this prefix is combined with the name of a subprogram, but you can
29313 specify a prefix that ends with a slash if you wish.
29315 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
29316 an appropriate prefix to use based on the pathname it is invoked with.
29318 If GCC cannot find the subprogram using the specified prefix, it
29319 tries looking in the usual places for the subprogram.
29321 The default value of @env{GCC_EXEC_PREFIX} is
29322 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
29323 the installed compiler. In many cases @var{prefix} is the value
29324 of @code{prefix} when you ran the @file{configure} script.
29326 Other prefixes specified with @option{-B} take precedence over this prefix.
29328 This prefix is also used for finding files such as @file{crt0.o} that are
29329 used for linking.
29331 In addition, the prefix is used in an unusual way in finding the
29332 directories to search for header files.  For each of the standard
29333 directories whose name normally begins with @samp{/usr/local/lib/gcc}
29334 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
29335 replacing that beginning with the specified prefix to produce an
29336 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
29337 @file{foo/bar} just before it searches the standard directory 
29338 @file{/usr/local/lib/bar}.
29339 If a standard directory begins with the configured
29340 @var{prefix} then the value of @var{prefix} is replaced by
29341 @env{GCC_EXEC_PREFIX} when looking for header files.
29343 @item COMPILER_PATH
29344 @findex COMPILER_PATH
29345 The value of @env{COMPILER_PATH} is a colon-separated list of
29346 directories, much like @env{PATH}.  GCC tries the directories thus
29347 specified when searching for subprograms, if it cannot find the
29348 subprograms using @env{GCC_EXEC_PREFIX}.
29350 @item LIBRARY_PATH
29351 @findex LIBRARY_PATH
29352 The value of @env{LIBRARY_PATH} is a colon-separated list of
29353 directories, much like @env{PATH}.  When configured as a native compiler,
29354 GCC tries the directories thus specified when searching for special
29355 linker files, if it cannot find them using @env{GCC_EXEC_PREFIX}.  Linking
29356 using GCC also uses these directories when searching for ordinary
29357 libraries for the @option{-l} option (but directories specified with
29358 @option{-L} come first).
29360 @item LANG
29361 @findex LANG
29362 @cindex locale definition
29363 This variable is used to pass locale information to the compiler.  One way in
29364 which this information is used is to determine the character set to be used
29365 when character literals, string literals and comments are parsed in C and C++.
29366 When the compiler is configured to allow multibyte characters,
29367 the following values for @env{LANG} are recognized:
29369 @table @samp
29370 @item C-JIS
29371 Recognize JIS characters.
29372 @item C-SJIS
29373 Recognize SJIS characters.
29374 @item C-EUCJP
29375 Recognize EUCJP characters.
29376 @end table
29378 If @env{LANG} is not defined, or if it has some other value, then the
29379 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
29380 recognize and translate multibyte characters.
29381 @end table
29383 @noindent
29384 Some additional environment variables affect the behavior of the
29385 preprocessor.
29387 @include cppenv.texi
29389 @c man end
29391 @node Precompiled Headers
29392 @section Using Precompiled Headers
29393 @cindex precompiled headers
29394 @cindex speed of compilation
29396 Often large projects have many header files that are included in every
29397 source file.  The time the compiler takes to process these header files
29398 over and over again can account for nearly all of the time required to
29399 build the project.  To make builds faster, GCC allows you to
29400 @dfn{precompile} a header file.
29402 To create a precompiled header file, simply compile it as you would any
29403 other file, if necessary using the @option{-x} option to make the driver
29404 treat it as a C or C++ header file.  You may want to use a
29405 tool like @command{make} to keep the precompiled header up-to-date when
29406 the headers it contains change.
29408 A precompiled header file is searched for when @code{#include} is
29409 seen in the compilation.  As it searches for the included file
29410 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
29411 compiler looks for a precompiled header in each directory just before it
29412 looks for the include file in that directory.  The name searched for is
29413 the name specified in the @code{#include} with @samp{.gch} appended.  If
29414 the precompiled header file cannot be used, it is ignored.
29416 For instance, if you have @code{#include "all.h"}, and you have
29417 @file{all.h.gch} in the same directory as @file{all.h}, then the
29418 precompiled header file is used if possible, and the original
29419 header is used otherwise.
29421 Alternatively, you might decide to put the precompiled header file in a
29422 directory and use @option{-I} to ensure that directory is searched
29423 before (or instead of) the directory containing the original header.
29424 Then, if you want to check that the precompiled header file is always
29425 used, you can put a file of the same name as the original header in this
29426 directory containing an @code{#error} command.
29428 This also works with @option{-include}.  So yet another way to use
29429 precompiled headers, good for projects not designed with precompiled
29430 header files in mind, is to simply take most of the header files used by
29431 a project, include them from another header file, precompile that header
29432 file, and @option{-include} the precompiled header.  If the header files
29433 have guards against multiple inclusion, they are skipped because
29434 they've already been included (in the precompiled header).
29436 If you need to precompile the same header file for different
29437 languages, targets, or compiler options, you can instead make a
29438 @emph{directory} named like @file{all.h.gch}, and put each precompiled
29439 header in the directory, perhaps using @option{-o}.  It doesn't matter
29440 what you call the files in the directory; every precompiled header in
29441 the directory is considered.  The first precompiled header
29442 encountered in the directory that is valid for this compilation is
29443 used; they're searched in no particular order.
29445 There are many other possibilities, limited only by your imagination,
29446 good sense, and the constraints of your build system.
29448 A precompiled header file can be used only when these conditions apply:
29450 @itemize
29451 @item
29452 Only one precompiled header can be used in a particular compilation.
29454 @item
29455 A precompiled header cannot be used once the first C token is seen.  You
29456 can have preprocessor directives before a precompiled header; you cannot
29457 include a precompiled header from inside another header.
29459 @item
29460 The precompiled header file must be produced for the same language as
29461 the current compilation.  You cannot use a C precompiled header for a C++
29462 compilation.
29464 @item
29465 The precompiled header file must have been produced by the same compiler
29466 binary as the current compilation is using.
29468 @item
29469 Any macros defined before the precompiled header is included must
29470 either be defined in the same way as when the precompiled header was
29471 generated, or must not affect the precompiled header, which usually
29472 means that they don't appear in the precompiled header at all.
29474 The @option{-D} option is one way to define a macro before a
29475 precompiled header is included; using a @code{#define} can also do it.
29476 There are also some options that define macros implicitly, like
29477 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
29478 defined this way.
29480 @item If debugging information is output when using the precompiled
29481 header, using @option{-g} or similar, the same kind of debugging information
29482 must have been output when building the precompiled header.  However,
29483 a precompiled header built using @option{-g} can be used in a compilation
29484 when no debugging information is being output.
29486 @item The same @option{-m} options must generally be used when building
29487 and using the precompiled header.  @xref{Submodel Options},
29488 for any cases where this rule is relaxed.
29490 @item Each of the following options must be the same when building and using
29491 the precompiled header:
29493 @gccoptlist{-fexceptions}
29495 @item
29496 Some other command-line options starting with @option{-f},
29497 @option{-p}, or @option{-O} must be defined in the same way as when
29498 the precompiled header was generated.  At present, it's not clear
29499 which options are safe to change and which are not; the safest choice
29500 is to use exactly the same options when generating and using the
29501 precompiled header.  The following are known to be safe:
29503 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
29504 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
29505 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
29506 -pedantic-errors}
29508 @end itemize
29510 For all of these except the last, the compiler automatically
29511 ignores the precompiled header if the conditions aren't met.  If you
29512 find an option combination that doesn't work and doesn't cause the
29513 precompiled header to be ignored, please consider filing a bug report,
29514 see @ref{Bugs}.
29516 If you do use differing options when generating and using the
29517 precompiled header, the actual behavior is a mixture of the
29518 behavior for the options.  For instance, if you use @option{-g} to
29519 generate the precompiled header but not when using it, you may or may
29520 not get debugging information for routines in the precompiled header.