PR other/87353 fix formatting and grammar in manual
[official-gcc.git] / gcc / doc / invoke.texi
blob685c211e176d13809078cf0fd595d49763adef25
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 -gdescribe-dies -gno-describe-dies @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 @item -Wabsolute-value @r{(C and Objective-C only)}
6285 @opindex Wabsolute-value
6286 @opindex Wno-absolute-value
6287 Warn when a wrong absolute value function seems to be used or when it
6288 does not have any effect because its argument is an unsigned type.
6289 This warning be suppressed with an explicit type cast and it is also
6290 enabled by @option{-Wextra}.
6292 @include cppwarnopts.texi
6294 @item -Wbad-function-cast @r{(C and Objective-C only)}
6295 @opindex Wbad-function-cast
6296 @opindex Wno-bad-function-cast
6297 Warn when a function call is cast to a non-matching type.
6298 For example, warn if a call to a function returning an integer type 
6299 is cast to a pointer type.
6301 @item -Wc90-c99-compat @r{(C and Objective-C only)}
6302 @opindex Wc90-c99-compat
6303 @opindex Wno-c90-c99-compat
6304 Warn about features not present in ISO C90, but present in ISO C99.
6305 For instance, warn about use of variable length arrays, @code{long long}
6306 type, @code{bool} type, compound literals, designated initializers, and so
6307 on.  This option is independent of the standards mode.  Warnings are disabled
6308 in the expression that follows @code{__extension__}.
6310 @item -Wc99-c11-compat @r{(C and Objective-C only)}
6311 @opindex Wc99-c11-compat
6312 @opindex Wno-c99-c11-compat
6313 Warn about features not present in ISO C99, but present in ISO C11.
6314 For instance, warn about use of anonymous structures and unions,
6315 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
6316 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
6317 and so on.  This option is independent of the standards mode.  Warnings are
6318 disabled in the expression that follows @code{__extension__}.
6320 @item -Wc++-compat @r{(C and Objective-C only)}
6321 @opindex Wc++-compat
6322 @opindex Wno-c++-compat
6323 Warn about ISO C constructs that are outside of the common subset of
6324 ISO C and ISO C++, e.g.@: request for implicit conversion from
6325 @code{void *} to a pointer to non-@code{void} type.
6327 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
6328 @opindex Wc++11-compat
6329 @opindex Wno-c++11-compat
6330 Warn about C++ constructs whose meaning differs between ISO C++ 1998
6331 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
6332 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
6333 enabled by @option{-Wall}.
6335 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
6336 @opindex Wc++14-compat
6337 @opindex Wno-c++14-compat
6338 Warn about C++ constructs whose meaning differs between ISO C++ 2011
6339 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
6341 @item -Wc++17-compat @r{(C++ and Objective-C++ only)}
6342 @opindex Wc++17-compat
6343 @opindex Wno-c++17-compat
6344 Warn about C++ constructs whose meaning differs between ISO C++ 2014
6345 and ISO C++ 2017.  This warning is enabled by @option{-Wall}.
6347 @item -Wcast-qual
6348 @opindex Wcast-qual
6349 @opindex Wno-cast-qual
6350 Warn whenever a pointer is cast so as to remove a type qualifier from
6351 the target type.  For example, warn if a @code{const char *} is cast
6352 to an ordinary @code{char *}.
6354 Also warn when making a cast that introduces a type qualifier in an
6355 unsafe way.  For example, casting @code{char **} to @code{const char **}
6356 is unsafe, as in this example:
6358 @smallexample
6359   /* p is char ** value.  */
6360   const char **q = (const char **) p;
6361   /* Assignment of readonly string to const char * is OK.  */
6362   *q = "string";
6363   /* Now char** pointer points to read-only memory.  */
6364   **p = 'b';
6365 @end smallexample
6367 @item -Wcast-align
6368 @opindex Wcast-align
6369 @opindex Wno-cast-align
6370 Warn whenever a pointer is cast such that the required alignment of the
6371 target is increased.  For example, warn if a @code{char *} is cast to
6372 an @code{int *} on machines where integers can only be accessed at
6373 two- or four-byte boundaries.
6375 @item -Wcast-align=strict
6376 @opindex Wcast-align=strict
6377 Warn whenever a pointer is cast such that the required alignment of the
6378 target is increased.  For example, warn if a @code{char *} is cast to
6379 an @code{int *} regardless of the target machine.
6381 @item -Wcast-function-type
6382 @opindex Wcast-function-type
6383 @opindex Wno-cast-function-type
6384 Warn when a function pointer is cast to an incompatible function pointer.
6385 In a cast involving function types with a variable argument list only
6386 the types of initial arguments that are provided are considered.
6387 Any parameter of pointer-type matches any other pointer-type.  Any benign
6388 differences in integral types are ignored, like @code{int} vs. @code{long}
6389 on ILP32 targets.  Likewise type qualifiers are ignored.  The function
6390 type @code{void (*) (void)} is special and matches everything, which can
6391 be used to suppress this warning.
6392 In a cast involving pointer to member types this warning warns whenever
6393 the type cast is changing the pointer to member type.
6394 This warning is enabled by @option{-Wextra}.
6396 @item -Wwrite-strings
6397 @opindex Wwrite-strings
6398 @opindex Wno-write-strings
6399 When compiling C, give string constants the type @code{const
6400 char[@var{length}]} so that copying the address of one into a
6401 non-@code{const} @code{char *} pointer produces a warning.  These
6402 warnings help you find at compile time code that can try to write
6403 into a string constant, but only if you have been very careful about
6404 using @code{const} in declarations and prototypes.  Otherwise, it is
6405 just a nuisance. This is why we did not make @option{-Wall} request
6406 these warnings.
6408 When compiling C++, warn about the deprecated conversion from string
6409 literals to @code{char *}.  This warning is enabled by default for C++
6410 programs.
6412 @item -Wcatch-value
6413 @itemx -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)}
6414 @opindex Wcatch-value
6415 @opindex Wno-catch-value
6416 Warn about catch handlers that do not catch via reference.
6417 With @option{-Wcatch-value=1} (or @option{-Wcatch-value} for short)
6418 warn about polymorphic class types that are caught by value.
6419 With @option{-Wcatch-value=2} warn about all class types that are caught
6420 by value. With @option{-Wcatch-value=3} warn about all types that are
6421 not caught by reference. @option{-Wcatch-value} is enabled by @option{-Wall}.
6423 @item -Wclobbered
6424 @opindex Wclobbered
6425 @opindex Wno-clobbered
6426 Warn for variables that might be changed by @code{longjmp} or
6427 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
6429 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
6430 @opindex Wconditionally-supported
6431 @opindex Wno-conditionally-supported
6432 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
6434 @item -Wconversion
6435 @opindex Wconversion
6436 @opindex Wno-conversion
6437 Warn for implicit conversions that may alter a value. This includes
6438 conversions between real and integer, like @code{abs (x)} when
6439 @code{x} is @code{double}; conversions between signed and unsigned,
6440 like @code{unsigned ui = -1}; and conversions to smaller types, like
6441 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
6442 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
6443 changed by the conversion like in @code{abs (2.0)}.  Warnings about
6444 conversions between signed and unsigned integers can be disabled by
6445 using @option{-Wno-sign-conversion}.
6447 For C++, also warn for confusing overload resolution for user-defined
6448 conversions; and conversions that never use a type conversion
6449 operator: conversions to @code{void}, the same type, a base class or a
6450 reference to them. Warnings about conversions between signed and
6451 unsigned integers are disabled by default in C++ unless
6452 @option{-Wsign-conversion} is explicitly enabled.
6454 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
6455 @opindex Wconversion-null
6456 @opindex Wno-conversion-null
6457 Do not warn for conversions between @code{NULL} and non-pointer
6458 types. @option{-Wconversion-null} is enabled by default.
6460 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
6461 @opindex Wzero-as-null-pointer-constant
6462 @opindex Wno-zero-as-null-pointer-constant
6463 Warn when a literal @samp{0} is used as null pointer constant.  This can
6464 be useful to facilitate the conversion to @code{nullptr} in C++11.
6466 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
6467 @opindex Wsubobject-linkage
6468 @opindex Wno-subobject-linkage
6469 Warn if a class type has a base or a field whose type uses the anonymous
6470 namespace or depends on a type with no linkage.  If a type A depends on
6471 a type B with no or internal linkage, defining it in multiple
6472 translation units would be an ODR violation because the meaning of B
6473 is different in each translation unit.  If A only appears in a single
6474 translation unit, the best way to silence the warning is to give it
6475 internal linkage by putting it in an anonymous namespace as well.  The
6476 compiler doesn't give this warning for types defined in the main .C
6477 file, as those are unlikely to have multiple definitions.
6478 @option{-Wsubobject-linkage} is enabled by default.
6480 @item -Wdangling-else
6481 @opindex Wdangling-else
6482 @opindex Wno-dangling-else
6483 Warn about constructions where there may be confusion to which
6484 @code{if} statement an @code{else} branch belongs.  Here is an example of
6485 such a case:
6487 @smallexample
6488 @group
6490   if (a)
6491     if (b)
6492       foo ();
6493   else
6494     bar ();
6496 @end group
6497 @end smallexample
6499 In C/C++, every @code{else} branch belongs to the innermost possible
6500 @code{if} statement, which in this example is @code{if (b)}.  This is
6501 often not what the programmer expected, as illustrated in the above
6502 example by indentation the programmer chose.  When there is the
6503 potential for this confusion, GCC issues a warning when this flag
6504 is specified.  To eliminate the warning, add explicit braces around
6505 the innermost @code{if} statement so there is no way the @code{else}
6506 can belong to the enclosing @code{if}.  The resulting code
6507 looks like this:
6509 @smallexample
6510 @group
6512   if (a)
6513     @{
6514       if (b)
6515         foo ();
6516       else
6517         bar ();
6518     @}
6520 @end group
6521 @end smallexample
6523 This warning is enabled by @option{-Wparentheses}.
6525 @item -Wdate-time
6526 @opindex Wdate-time
6527 @opindex Wno-date-time
6528 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
6529 are encountered as they might prevent bit-wise-identical reproducible
6530 compilations.
6532 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
6533 @opindex Wdelete-incomplete
6534 @opindex Wno-delete-incomplete
6535 Warn when deleting a pointer to incomplete type, which may cause
6536 undefined behavior at runtime.  This warning is enabled by default.
6538 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
6539 @opindex Wuseless-cast
6540 @opindex Wno-useless-cast
6541 Warn when an expression is casted to its own type.
6543 @item -Wempty-body
6544 @opindex Wempty-body
6545 @opindex Wno-empty-body
6546 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
6547 while} statement.  This warning is also enabled by @option{-Wextra}.
6549 @item -Wenum-compare
6550 @opindex Wenum-compare
6551 @opindex Wno-enum-compare
6552 Warn about a comparison between values of different enumerated types.
6553 In C++ enumerated type mismatches in conditional expressions are also
6554 diagnosed and the warning is enabled by default.  In C this warning is 
6555 enabled by @option{-Wall}.
6557 @item -Wextra-semi @r{(C++, Objective-C++ only)}
6558 @opindex Wextra-semi
6559 @opindex Wno-extra-semi
6560 Warn about redundant semicolon after in-class function definition.
6562 @item -Wjump-misses-init @r{(C, Objective-C only)}
6563 @opindex Wjump-misses-init
6564 @opindex Wno-jump-misses-init
6565 Warn if a @code{goto} statement or a @code{switch} statement jumps
6566 forward across the initialization of a variable, or jumps backward to a
6567 label after the variable has been initialized.  This only warns about
6568 variables that are initialized when they are declared.  This warning is
6569 only supported for C and Objective-C; in C++ this sort of branch is an
6570 error in any case.
6572 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
6573 can be disabled with the @option{-Wno-jump-misses-init} option.
6575 @item -Wsign-compare
6576 @opindex Wsign-compare
6577 @opindex Wno-sign-compare
6578 @cindex warning for comparison of signed and unsigned values
6579 @cindex comparison of signed and unsigned values, warning
6580 @cindex signed and unsigned values, comparison warning
6581 Warn when a comparison between signed and unsigned values could produce
6582 an incorrect result when the signed value is converted to unsigned.
6583 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
6584 also enabled by @option{-Wextra}.
6586 @item -Wsign-conversion
6587 @opindex Wsign-conversion
6588 @opindex Wno-sign-conversion
6589 Warn for implicit conversions that may change the sign of an integer
6590 value, like assigning a signed integer expression to an unsigned
6591 integer variable. An explicit cast silences the warning. In C, this
6592 option is enabled also by @option{-Wconversion}.
6594 @item -Wfloat-conversion
6595 @opindex Wfloat-conversion
6596 @opindex Wno-float-conversion
6597 Warn for implicit conversions that reduce the precision of a real value.
6598 This includes conversions from real to integer, and from higher precision
6599 real to lower precision real values.  This option is also enabled by
6600 @option{-Wconversion}.
6602 @item -Wno-scalar-storage-order
6603 @opindex -Wno-scalar-storage-order
6604 @opindex -Wscalar-storage-order
6605 Do not warn on suspicious constructs involving reverse scalar storage order.
6607 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
6608 @opindex Wsized-deallocation
6609 @opindex Wno-sized-deallocation
6610 Warn about a definition of an unsized deallocation function
6611 @smallexample
6612 void operator delete (void *) noexcept;
6613 void operator delete[] (void *) noexcept;
6614 @end smallexample
6615 without a definition of the corresponding sized deallocation function
6616 @smallexample
6617 void operator delete (void *, std::size_t) noexcept;
6618 void operator delete[] (void *, std::size_t) noexcept;
6619 @end smallexample
6620 or vice versa.  Enabled by @option{-Wextra} along with
6621 @option{-fsized-deallocation}.
6623 @item -Wsizeof-pointer-div
6624 @opindex Wsizeof-pointer-div
6625 @opindex Wno-sizeof-pointer-div
6626 Warn for suspicious divisions of two sizeof expressions that divide
6627 the pointer size by the element size, which is the usual way to compute
6628 the array size but won't work out correctly with pointers.  This warning
6629 warns e.g.@: about @code{sizeof (ptr) / sizeof (ptr[0])} if @code{ptr} is
6630 not an array, but a pointer.  This warning is enabled by @option{-Wall}.
6632 @item -Wsizeof-pointer-memaccess
6633 @opindex Wsizeof-pointer-memaccess
6634 @opindex Wno-sizeof-pointer-memaccess
6635 Warn for suspicious length parameters to certain string and memory built-in
6636 functions if the argument uses @code{sizeof}.  This warning triggers for
6637 example for @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not
6638 an array, but a pointer, and suggests a possible fix, or about
6639 @code{memcpy (&foo, ptr, sizeof (&foo));}.  @option{-Wsizeof-pointer-memaccess}
6640 also warns about calls to bounded string copy functions like @code{strncat}
6641 or @code{strncpy} that specify as the bound a @code{sizeof} expression of
6642 the source array.  For example, in the following function the call to
6643 @code{strncat} specifies the size of the source string as the bound.  That
6644 is almost certainly a mistake and so the call is diagnosed.
6645 @smallexample
6646 void make_file (const char *name)
6648   char path[PATH_MAX];
6649   strncpy (path, name, sizeof path - 1);
6650   strncat (path, ".text", sizeof ".text");
6651   @dots{}
6653 @end smallexample
6655 The @option{-Wsizeof-pointer-memaccess} option is enabled by @option{-Wall}.
6657 @item -Wsizeof-array-argument
6658 @opindex Wsizeof-array-argument
6659 @opindex Wno-sizeof-array-argument
6660 Warn when the @code{sizeof} operator is applied to a parameter that is
6661 declared as an array in a function definition.  This warning is enabled by
6662 default for C and C++ programs.
6664 @item -Wmemset-elt-size
6665 @opindex Wmemset-elt-size
6666 @opindex Wno-memset-elt-size
6667 Warn for suspicious calls to the @code{memset} built-in function, if the
6668 first argument references an array, and the third argument is a number
6669 equal to the number of elements, but not equal to the size of the array
6670 in memory.  This indicates that the user has omitted a multiplication by
6671 the element size.  This warning is enabled by @option{-Wall}.
6673 @item -Wmemset-transposed-args
6674 @opindex Wmemset-transposed-args
6675 @opindex Wno-memset-transposed-args
6676 Warn for suspicious calls to the @code{memset} built-in function, if the
6677 second argument is not zero and the third argument is zero.  This warns e.g.@
6678 about @code{memset (buf, sizeof buf, 0)} where most probably
6679 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
6680 is only emitted if the third argument is literal zero.  If it is some
6681 expression that is folded to zero, a cast of zero to some type, etc., 
6682 it is far less likely that the user has mistakenly exchanged the arguments 
6683 and no warning is emitted.  This warning is enabled by @option{-Wall}.
6685 @item -Waddress
6686 @opindex Waddress
6687 @opindex Wno-address
6688 Warn about suspicious uses of memory addresses. These include using
6689 the address of a function in a conditional expression, such as
6690 @code{void func(void); if (func)}, and comparisons against the memory
6691 address of a string literal, such as @code{if (x == "abc")}.  Such
6692 uses typically indicate a programmer error: the address of a function
6693 always evaluates to true, so their use in a conditional usually
6694 indicate that the programmer forgot the parentheses in a function
6695 call; and comparisons against string literals result in unspecified
6696 behavior and are not portable in C, so they usually indicate that the
6697 programmer intended to use @code{strcmp}.  This warning is enabled by
6698 @option{-Wall}.
6700 @item -Wlogical-op
6701 @opindex Wlogical-op
6702 @opindex Wno-logical-op
6703 Warn about suspicious uses of logical operators in expressions.
6704 This includes using logical operators in contexts where a
6705 bit-wise operator is likely to be expected.  Also warns when
6706 the operands of a logical operator are the same:
6707 @smallexample
6708 extern int a;
6709 if (a < 0 && a < 0) @{ @dots{} @}
6710 @end smallexample
6712 @item -Wlogical-not-parentheses
6713 @opindex Wlogical-not-parentheses
6714 @opindex Wno-logical-not-parentheses
6715 Warn about logical not used on the left hand side operand of a comparison.
6716 This option does not warn if the right operand is considered to be a boolean
6717 expression.  Its purpose is to detect suspicious code like the following:
6718 @smallexample
6719 int a;
6720 @dots{}
6721 if (!a > 1) @{ @dots{} @}
6722 @end smallexample
6724 It is possible to suppress the warning by wrapping the LHS into
6725 parentheses:
6726 @smallexample
6727 if ((!a) > 1) @{ @dots{} @}
6728 @end smallexample
6730 This warning is enabled by @option{-Wall}.
6732 @item -Waggregate-return
6733 @opindex Waggregate-return
6734 @opindex Wno-aggregate-return
6735 Warn if any functions that return structures or unions are defined or
6736 called.  (In languages where you can return an array, this also elicits
6737 a warning.)
6739 @item -Wno-aggressive-loop-optimizations
6740 @opindex Wno-aggressive-loop-optimizations
6741 @opindex Waggressive-loop-optimizations
6742 Warn if in a loop with constant number of iterations the compiler detects
6743 undefined behavior in some statement during one or more of the iterations.
6745 @item -Wno-attributes
6746 @opindex Wno-attributes
6747 @opindex Wattributes
6748 Do not warn if an unexpected @code{__attribute__} is used, such as
6749 unrecognized attributes, function attributes applied to variables,
6750 etc.  This does not stop errors for incorrect use of supported
6751 attributes.
6753 @item -Wno-builtin-declaration-mismatch
6754 @opindex Wno-builtin-declaration-mismatch
6755 @opindex Wbuiltin-declaration-mismatch
6756 Warn if a built-in function is declared with the wrong signature or 
6757 as non-function.
6758 This warning is enabled by default.
6760 @item -Wno-builtin-macro-redefined
6761 @opindex Wno-builtin-macro-redefined
6762 @opindex Wbuiltin-macro-redefined
6763 Do not warn if certain built-in macros are redefined.  This suppresses
6764 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
6765 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
6767 @item -Wstrict-prototypes @r{(C and Objective-C only)}
6768 @opindex Wstrict-prototypes
6769 @opindex Wno-strict-prototypes
6770 Warn if a function is declared or defined without specifying the
6771 argument types.  (An old-style function definition is permitted without
6772 a warning if preceded by a declaration that specifies the argument
6773 types.)
6775 @item -Wold-style-declaration @r{(C and Objective-C only)}
6776 @opindex Wold-style-declaration
6777 @opindex Wno-old-style-declaration
6778 Warn for obsolescent usages, according to the C Standard, in a
6779 declaration. For example, warn if storage-class specifiers like
6780 @code{static} are not the first things in a declaration.  This warning
6781 is also enabled by @option{-Wextra}.
6783 @item -Wold-style-definition @r{(C and Objective-C only)}
6784 @opindex Wold-style-definition
6785 @opindex Wno-old-style-definition
6786 Warn if an old-style function definition is used.  A warning is given
6787 even if there is a previous prototype.
6789 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
6790 @opindex Wmissing-parameter-type
6791 @opindex Wno-missing-parameter-type
6792 A function parameter is declared without a type specifier in K&R-style
6793 functions:
6795 @smallexample
6796 void foo(bar) @{ @}
6797 @end smallexample
6799 This warning is also enabled by @option{-Wextra}.
6801 @item -Wmissing-prototypes @r{(C and Objective-C only)}
6802 @opindex Wmissing-prototypes
6803 @opindex Wno-missing-prototypes
6804 Warn if a global function is defined without a previous prototype
6805 declaration.  This warning is issued even if the definition itself
6806 provides a prototype.  Use this option to detect global functions
6807 that do not have a matching prototype declaration in a header file.
6808 This option is not valid for C++ because all function declarations
6809 provide prototypes and a non-matching declaration declares an
6810 overload rather than conflict with an earlier declaration.
6811 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
6813 @item -Wmissing-declarations
6814 @opindex Wmissing-declarations
6815 @opindex Wno-missing-declarations
6816 Warn if a global function is defined without a previous declaration.
6817 Do so even if the definition itself provides a prototype.
6818 Use this option to detect global functions that are not declared in
6819 header files.  In C, no warnings are issued for functions with previous
6820 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
6821 missing prototypes.  In C++, no warnings are issued for function templates,
6822 or for inline functions, or for functions in anonymous namespaces.
6824 @item -Wmissing-field-initializers
6825 @opindex Wmissing-field-initializers
6826 @opindex Wno-missing-field-initializers
6827 @opindex W
6828 @opindex Wextra
6829 @opindex Wno-extra
6830 Warn if a structure's initializer has some fields missing.  For
6831 example, the following code causes such a warning, because
6832 @code{x.h} is implicitly zero:
6834 @smallexample
6835 struct s @{ int f, g, h; @};
6836 struct s x = @{ 3, 4 @};
6837 @end smallexample
6839 This option does not warn about designated initializers, so the following
6840 modification does not trigger a warning:
6842 @smallexample
6843 struct s @{ int f, g, h; @};
6844 struct s x = @{ .f = 3, .g = 4 @};
6845 @end smallexample
6847 In C this option does not warn about the universal zero initializer
6848 @samp{@{ 0 @}}:
6850 @smallexample
6851 struct s @{ int f, g, h; @};
6852 struct s x = @{ 0 @};
6853 @end smallexample
6855 Likewise, in C++ this option does not warn about the empty @{ @}
6856 initializer, for example:
6858 @smallexample
6859 struct s @{ int f, g, h; @};
6860 s x = @{ @};
6861 @end smallexample
6863 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
6864 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
6866 @item -Wno-multichar
6867 @opindex Wno-multichar
6868 @opindex Wmultichar
6869 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
6870 Usually they indicate a typo in the user's code, as they have
6871 implementation-defined values, and should not be used in portable code.
6873 @item -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]}
6874 @opindex Wnormalized=
6875 @opindex Wnormalized
6876 @opindex Wno-normalized
6877 @cindex NFC
6878 @cindex NFKC
6879 @cindex character set, input normalization
6880 In ISO C and ISO C++, two identifiers are different if they are
6881 different sequences of characters.  However, sometimes when characters
6882 outside the basic ASCII character set are used, you can have two
6883 different character sequences that look the same.  To avoid confusion,
6884 the ISO 10646 standard sets out some @dfn{normalization rules} which
6885 when applied ensure that two sequences that look the same are turned into
6886 the same sequence.  GCC can warn you if you are using identifiers that
6887 have not been normalized; this option controls that warning.
6889 There are four levels of warning supported by GCC@.  The default is
6890 @option{-Wnormalized=nfc}, which warns about any identifier that is
6891 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
6892 recommended form for most uses.  It is equivalent to
6893 @option{-Wnormalized}.
6895 Unfortunately, there are some characters allowed in identifiers by
6896 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
6897 identifiers.  That is, there's no way to use these symbols in portable
6898 ISO C or C++ and have all your identifiers in NFC@.
6899 @option{-Wnormalized=id} suppresses the warning for these characters.
6900 It is hoped that future versions of the standards involved will correct
6901 this, which is why this option is not the default.
6903 You can switch the warning off for all characters by writing
6904 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
6905 only do this if you are using some other normalization scheme (like
6906 ``D''), because otherwise you can easily create bugs that are
6907 literally impossible to see.
6909 Some characters in ISO 10646 have distinct meanings but look identical
6910 in some fonts or display methodologies, especially once formatting has
6911 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
6912 LETTER N'', displays just like a regular @code{n} that has been
6913 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
6914 normalization scheme to convert all these into a standard form as
6915 well, and GCC warns if your code is not in NFKC if you use
6916 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
6917 about every identifier that contains the letter O because it might be
6918 confused with the digit 0, and so is not the default, but may be
6919 useful as a local coding convention if the programming environment 
6920 cannot be fixed to display these characters distinctly.
6922 @item -Wno-deprecated
6923 @opindex Wno-deprecated
6924 @opindex Wdeprecated
6925 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
6927 @item -Wno-deprecated-declarations
6928 @opindex Wno-deprecated-declarations
6929 @opindex Wdeprecated-declarations
6930 Do not warn about uses of functions (@pxref{Function Attributes}),
6931 variables (@pxref{Variable Attributes}), and types (@pxref{Type
6932 Attributes}) marked as deprecated by using the @code{deprecated}
6933 attribute.
6935 @item -Wno-overflow
6936 @opindex Wno-overflow
6937 @opindex Woverflow
6938 Do not warn about compile-time overflow in constant expressions.
6940 @item -Wno-odr
6941 @opindex Wno-odr
6942 @opindex Wodr
6943 Warn about One Definition Rule violations during link-time optimization.
6944 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
6946 @item -Wopenmp-simd
6947 @opindex Wopenmp-simd
6948 @opindex Wno-openmp-simd
6949 Warn if the vectorizer cost model overrides the OpenMP
6950 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
6951 option can be used to relax the cost model.
6953 @item -Woverride-init @r{(C and Objective-C only)}
6954 @opindex Woverride-init
6955 @opindex Wno-override-init
6956 @opindex W
6957 @opindex Wextra
6958 @opindex Wno-extra
6959 Warn if an initialized field without side effects is overridden when
6960 using designated initializers (@pxref{Designated Inits, , Designated
6961 Initializers}).
6963 This warning is included in @option{-Wextra}.  To get other
6964 @option{-Wextra} warnings without this one, use @option{-Wextra
6965 -Wno-override-init}.
6967 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
6968 @opindex Woverride-init-side-effects
6969 @opindex Wno-override-init-side-effects
6970 Warn if an initialized field with side effects is overridden when
6971 using designated initializers (@pxref{Designated Inits, , Designated
6972 Initializers}).  This warning is enabled by default.
6974 @item -Wpacked
6975 @opindex Wpacked
6976 @opindex Wno-packed
6977 Warn if a structure is given the packed attribute, but the packed
6978 attribute has no effect on the layout or size of the structure.
6979 Such structures may be mis-aligned for little benefit.  For
6980 instance, in this code, the variable @code{f.x} in @code{struct bar}
6981 is misaligned even though @code{struct bar} does not itself
6982 have the packed attribute:
6984 @smallexample
6985 @group
6986 struct foo @{
6987   int x;
6988   char a, b, c, d;
6989 @} __attribute__((packed));
6990 struct bar @{
6991   char z;
6992   struct foo f;
6994 @end group
6995 @end smallexample
6997 @item -Wpacked-bitfield-compat
6998 @opindex Wpacked-bitfield-compat
6999 @opindex Wno-packed-bitfield-compat
7000 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
7001 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
7002 the change can lead to differences in the structure layout.  GCC
7003 informs you when the offset of such a field has changed in GCC 4.4.
7004 For example there is no longer a 4-bit padding between field @code{a}
7005 and @code{b} in this structure:
7007 @smallexample
7008 struct foo
7010   char a:4;
7011   char b:8;
7012 @} __attribute__ ((packed));
7013 @end smallexample
7015 This warning is enabled by default.  Use
7016 @option{-Wno-packed-bitfield-compat} to disable this warning.
7018 @item -Wpacked-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
7019 @opindex Wpacked-not-aligned
7020 @opindex Wno-packed-not-aligned
7021 Warn if a structure field with explicitly specified alignment in a
7022 packed struct or union is misaligned.  For example, a warning will
7023 be issued on @code{struct S}, like, @code{warning: alignment 1 of
7024 'struct S' is less than 8}, in this code:
7026 @smallexample
7027 @group
7028 struct __attribute__ ((aligned (8))) S8 @{ char a[8]; @};
7029 struct __attribute__ ((packed)) S @{
7030   struct S8 s8;
7032 @end group
7033 @end smallexample
7035 This warning is enabled by @option{-Wall}.
7037 @item -Wpadded
7038 @opindex Wpadded
7039 @opindex Wno-padded
7040 Warn if padding is included in a structure, either to align an element
7041 of the structure or to align the whole structure.  Sometimes when this
7042 happens it is possible to rearrange the fields of the structure to
7043 reduce the padding and so make the structure smaller.
7045 @item -Wredundant-decls
7046 @opindex Wredundant-decls
7047 @opindex Wno-redundant-decls
7048 Warn if anything is declared more than once in the same scope, even in
7049 cases where multiple declaration is valid and changes nothing.
7051 @item -Wno-restrict
7052 @opindex Wrestrict
7053 @opindex Wno-restrict
7054 Warn when an object referenced by a @code{restrict}-qualified parameter
7055 (or, in C++, a @code{__restrict}-qualified parameter) is aliased by another
7056 argument, or when copies between such objects overlap.  For example,
7057 the call to the @code{strcpy} function below attempts to truncate the string
7058 by replacing its initial characters with the last four.  However, because
7059 the call writes the terminating NUL into @code{a[4]}, the copies overlap and
7060 the call is diagnosed.
7062 @smallexample
7063 void foo (void)
7065   char a[] = "abcd1234";
7066   strcpy (a, a + 4);
7067   @dots{}
7069 @end smallexample
7070 The @option{-Wrestrict} option detects some instances of simple overlap
7071 even without optimization but works best at @option{-O2} and above.  It
7072 is included in @option{-Wall}.
7074 @item -Wnested-externs @r{(C and Objective-C only)}
7075 @opindex Wnested-externs
7076 @opindex Wno-nested-externs
7077 Warn if an @code{extern} declaration is encountered within a function.
7079 @item -Wno-inherited-variadic-ctor
7080 @opindex Winherited-variadic-ctor
7081 @opindex Wno-inherited-variadic-ctor
7082 Suppress warnings about use of C++11 inheriting constructors when the
7083 base class inherited from has a C variadic constructor; the warning is
7084 on by default because the ellipsis is not inherited.
7086 @item -Winline
7087 @opindex Winline
7088 @opindex Wno-inline
7089 Warn if a function that is declared as inline cannot be inlined.
7090 Even with this option, the compiler does not warn about failures to
7091 inline functions declared in system headers.
7093 The compiler uses a variety of heuristics to determine whether or not
7094 to inline a function.  For example, the compiler takes into account
7095 the size of the function being inlined and the amount of inlining
7096 that has already been done in the current function.  Therefore,
7097 seemingly insignificant changes in the source program can cause the
7098 warnings produced by @option{-Winline} to appear or disappear.
7100 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
7101 @opindex Wno-invalid-offsetof
7102 @opindex Winvalid-offsetof
7103 Suppress warnings from applying the @code{offsetof} macro to a non-POD
7104 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
7105 to a non-standard-layout type is undefined.  In existing C++ implementations,
7106 however, @code{offsetof} typically gives meaningful results.
7107 This flag is for users who are aware that they are
7108 writing nonportable code and who have deliberately chosen to ignore the
7109 warning about it.
7111 The restrictions on @code{offsetof} may be relaxed in a future version
7112 of the C++ standard.
7114 @item -Wint-in-bool-context
7115 @opindex Wint-in-bool-context
7116 @opindex Wno-int-in-bool-context
7117 Warn for suspicious use of integer values where boolean values are expected,
7118 such as conditional expressions (?:) using non-boolean integer constants in
7119 boolean context, like @code{if (a <= b ? 2 : 3)}.  Or left shifting of signed
7120 integers in boolean context, like @code{for (a = 0; 1 << a; a++);}.  Likewise
7121 for all kinds of multiplications regardless of the data type.
7122 This warning is enabled by @option{-Wall}.
7124 @item -Wno-int-to-pointer-cast
7125 @opindex Wno-int-to-pointer-cast
7126 @opindex Wint-to-pointer-cast
7127 Suppress warnings from casts to pointer type of an integer of a
7128 different size. In C++, casting to a pointer type of smaller size is
7129 an error. @option{Wint-to-pointer-cast} is enabled by default.
7132 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
7133 @opindex Wno-pointer-to-int-cast
7134 @opindex Wpointer-to-int-cast
7135 Suppress warnings from casts from a pointer to an integer type of a
7136 different size.
7138 @item -Winvalid-pch
7139 @opindex Winvalid-pch
7140 @opindex Wno-invalid-pch
7141 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
7142 the search path but cannot be used.
7144 @item -Wlong-long
7145 @opindex Wlong-long
7146 @opindex Wno-long-long
7147 Warn if @code{long long} type is used.  This is enabled by either
7148 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
7149 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
7151 @item -Wvariadic-macros
7152 @opindex Wvariadic-macros
7153 @opindex Wno-variadic-macros
7154 Warn if variadic macros are used in ISO C90 mode, or if the GNU
7155 alternate syntax is used in ISO C99 mode.  This is enabled by either
7156 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
7157 messages, use @option{-Wno-variadic-macros}.
7159 @item -Wvarargs
7160 @opindex Wvarargs
7161 @opindex Wno-varargs
7162 Warn upon questionable usage of the macros used to handle variable
7163 arguments like @code{va_start}.  This is default.  To inhibit the
7164 warning messages, use @option{-Wno-varargs}.
7166 @item -Wvector-operation-performance
7167 @opindex Wvector-operation-performance
7168 @opindex Wno-vector-operation-performance
7169 Warn if vector operation is not implemented via SIMD capabilities of the
7170 architecture.  Mainly useful for the performance tuning.
7171 Vector operation can be implemented @code{piecewise}, which means that the
7172 scalar operation is performed on every vector element; 
7173 @code{in parallel}, which means that the vector operation is implemented
7174 using scalars of wider type, which normally is more performance efficient;
7175 and @code{as a single scalar}, which means that vector fits into a
7176 scalar type.
7178 @item -Wno-virtual-move-assign
7179 @opindex Wvirtual-move-assign
7180 @opindex Wno-virtual-move-assign
7181 Suppress warnings about inheriting from a virtual base with a
7182 non-trivial C++11 move assignment operator.  This is dangerous because
7183 if the virtual base is reachable along more than one path, it is
7184 moved multiple times, which can mean both objects end up in the
7185 moved-from state.  If the move assignment operator is written to avoid
7186 moving from a moved-from object, this warning can be disabled.
7188 @item -Wvla
7189 @opindex Wvla
7190 @opindex Wno-vla
7191 Warn if a variable-length array is used in the code.
7192 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
7193 the variable-length array.
7195 @item -Wvla-larger-than=@var{byte-size}
7196 @opindex -Wvla-larger-than=
7197 @opindex -Wno-vla-larger-than
7198 If this option is used, the compiler will warn for declarations of
7199 variable-length arrays whose size is either unbounded, or bounded
7200 by an argument that allows the array size to exceed @var{byte-size}
7201 bytes.  This is similar to how @option{-Walloca-larger-than=}@var{byte-size}
7202 works, but with variable-length arrays.
7204 Note that GCC may optimize small variable-length arrays of a known
7205 value into plain arrays, so this warning may not get triggered for
7206 such arrays.
7208 @option{-Wvla-larger-than=}@samp{PTRDIFF_MAX} is enabled by default but
7209 is typically only effective when @option{-ftree-vrp} is active (default
7210 for @option{-O2} and above).
7212 See also @option{-Walloca-larger-than=@var{byte-size}}.
7214 @item -Wno-vla-larger-than
7215 @opindex Wno-vla-larger-than
7216 Disable @option{-Wvla-larger-than=} warnings.  The option is equivalent
7217 to @option{-Wvla-larger-than=}@samp{SIZE_MAX} or larger.
7219 @item -Wvolatile-register-var
7220 @opindex Wvolatile-register-var
7221 @opindex Wno-volatile-register-var
7222 Warn if a register variable is declared volatile.  The volatile
7223 modifier does not inhibit all optimizations that may eliminate reads
7224 and/or writes to register variables.  This warning is enabled by
7225 @option{-Wall}.
7227 @item -Wdisabled-optimization
7228 @opindex Wdisabled-optimization
7229 @opindex Wno-disabled-optimization
7230 Warn if a requested optimization pass is disabled.  This warning does
7231 not generally indicate that there is anything wrong with your code; it
7232 merely indicates that GCC's optimizers are unable to handle the code
7233 effectively.  Often, the problem is that your code is too big or too
7234 complex; GCC refuses to optimize programs when the optimization
7235 itself is likely to take inordinate amounts of time.
7237 @item -Wpointer-sign @r{(C and Objective-C only)}
7238 @opindex Wpointer-sign
7239 @opindex Wno-pointer-sign
7240 Warn for pointer argument passing or assignment with different signedness.
7241 This option is only supported for C and Objective-C@.  It is implied by
7242 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
7243 @option{-Wno-pointer-sign}.
7245 @item -Wstack-protector
7246 @opindex Wstack-protector
7247 @opindex Wno-stack-protector
7248 This option is only active when @option{-fstack-protector} is active.  It
7249 warns about functions that are not protected against stack smashing.
7251 @item -Woverlength-strings
7252 @opindex Woverlength-strings
7253 @opindex Wno-overlength-strings
7254 Warn about string constants that are longer than the ``minimum
7255 maximum'' length specified in the C standard.  Modern compilers
7256 generally allow string constants that are much longer than the
7257 standard's minimum limit, but very portable programs should avoid
7258 using longer strings.
7260 The limit applies @emph{after} string constant concatenation, and does
7261 not count the trailing NUL@.  In C90, the limit was 509 characters; in
7262 C99, it was raised to 4095.  C++98 does not specify a normative
7263 minimum maximum, so we do not diagnose overlength strings in C++@.
7265 This option is implied by @option{-Wpedantic}, and can be disabled with
7266 @option{-Wno-overlength-strings}.
7268 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
7269 @opindex Wunsuffixed-float-constants
7270 @opindex Wno-unsuffixed-float-constants
7272 Issue a warning for any floating constant that does not have
7273 a suffix.  When used together with @option{-Wsystem-headers} it
7274 warns about such constants in system header files.  This can be useful
7275 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
7276 from the decimal floating-point extension to C99.
7278 @item -Wno-designated-init @r{(C and Objective-C only)}
7279 Suppress warnings when a positional initializer is used to initialize
7280 a structure that has been marked with the @code{designated_init}
7281 attribute.
7283 @item -Whsa
7284 Issue a warning when HSAIL cannot be emitted for the compiled function or
7285 OpenMP construct.
7287 @end table
7289 @node Debugging Options
7290 @section Options for Debugging Your Program
7291 @cindex options, debugging
7292 @cindex debugging information options
7294 To tell GCC to emit extra information for use by a debugger, in almost 
7295 all cases you need only to add @option{-g} to your other options.
7297 GCC allows you to use @option{-g} with
7298 @option{-O}.  The shortcuts taken by optimized code may occasionally
7299 be surprising: some variables you declared may not exist
7300 at all; flow of control may briefly move where you did not expect it;
7301 some statements may not be executed because they compute constant
7302 results or their values are already at hand; some statements may
7303 execute in different places because they have been moved out of loops.
7304 Nevertheless it is possible to debug optimized output.  This makes
7305 it reasonable to use the optimizer for programs that might have bugs.
7307 If you are not using some other optimization option, consider
7308 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
7309 With no @option{-O} option at all, some compiler passes that collect
7310 information useful for debugging do not run at all, so that
7311 @option{-Og} may result in a better debugging experience.
7313 @table @gcctabopt
7314 @item -g
7315 @opindex g
7316 Produce debugging information in the operating system's native format
7317 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
7318 information.
7320 On most systems that use stabs format, @option{-g} enables use of extra
7321 debugging information that only GDB can use; this extra information
7322 makes debugging work better in GDB but probably makes other debuggers
7323 crash or
7324 refuse to read the program.  If you want to control for certain whether
7325 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
7326 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
7328 @item -ggdb
7329 @opindex ggdb
7330 Produce debugging information for use by GDB@.  This means to use the
7331 most expressive format available (DWARF, stabs, or the native format
7332 if neither of those are supported), including GDB extensions if at all
7333 possible.
7335 @item -gdwarf
7336 @itemx -gdwarf-@var{version}
7337 @opindex gdwarf
7338 Produce debugging information in DWARF format (if that is supported).
7339 The value of @var{version} may be either 2, 3, 4 or 5; the default version
7340 for most targets is 4.  DWARF Version 5 is only experimental.
7342 Note that with DWARF Version 2, some ports require and always
7343 use some non-conflicting DWARF 3 extensions in the unwind tables.
7345 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
7346 for maximum benefit.
7348 GCC no longer supports DWARF Version 1, which is substantially
7349 different than Version 2 and later.  For historical reasons, some
7350 other DWARF-related options such as
7351 @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
7352 in their names, but apply to all currently-supported versions of DWARF.
7354 @item -gstabs
7355 @opindex gstabs
7356 Produce debugging information in stabs format (if that is supported),
7357 without GDB extensions.  This is the format used by DBX on most BSD
7358 systems.  On MIPS, Alpha and System V Release 4 systems this option
7359 produces stabs debugging output that is not understood by DBX@.
7360 On System V Release 4 systems this option requires the GNU assembler.
7362 @item -gstabs+
7363 @opindex gstabs+
7364 Produce debugging information in stabs format (if that is supported),
7365 using GNU extensions understood only by the GNU debugger (GDB)@.  The
7366 use of these extensions is likely to make other debuggers crash or
7367 refuse to read the program.
7369 @item -gxcoff
7370 @opindex gxcoff
7371 Produce debugging information in XCOFF format (if that is supported).
7372 This is the format used by the DBX debugger on IBM RS/6000 systems.
7374 @item -gxcoff+
7375 @opindex gxcoff+
7376 Produce debugging information in XCOFF format (if that is supported),
7377 using GNU extensions understood only by the GNU debugger (GDB)@.  The
7378 use of these extensions is likely to make other debuggers crash or
7379 refuse to read the program, and may cause assemblers other than the GNU
7380 assembler (GAS) to fail with an error.
7382 @item -gvms
7383 @opindex gvms
7384 Produce debugging information in Alpha/VMS debug format (if that is
7385 supported).  This is the format used by DEBUG on Alpha/VMS systems.
7387 @item -g@var{level}
7388 @itemx -ggdb@var{level}
7389 @itemx -gstabs@var{level}
7390 @itemx -gxcoff@var{level}
7391 @itemx -gvms@var{level}
7392 Request debugging information and also use @var{level} to specify how
7393 much information.  The default level is 2.
7395 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
7396 @option{-g}.
7398 Level 1 produces minimal information, enough for making backtraces in
7399 parts of the program that you don't plan to debug.  This includes
7400 descriptions of functions and external variables, and line number
7401 tables, but no information about local variables.
7403 Level 3 includes extra information, such as all the macro definitions
7404 present in the program.  Some debuggers support macro expansion when
7405 you use @option{-g3}.
7407 @option{-gdwarf} does not accept a concatenated debug level, to avoid
7408 confusion with @option{-gdwarf-@var{level}}.
7409 Instead use an additional @option{-g@var{level}} option to change the
7410 debug level for DWARF.
7412 @item -feliminate-unused-debug-symbols
7413 @opindex feliminate-unused-debug-symbols
7414 Produce debugging information in stabs format (if that is supported),
7415 for only symbols that are actually used.
7417 @item -femit-class-debug-always
7418 @opindex femit-class-debug-always
7419 Instead of emitting debugging information for a C++ class in only one
7420 object file, emit it in all object files using the class.  This option
7421 should be used only with debuggers that are unable to handle the way GCC
7422 normally emits debugging information for classes because using this
7423 option increases the size of debugging information by as much as a
7424 factor of two.
7426 @item -fno-merge-debug-strings
7427 @opindex fmerge-debug-strings
7428 @opindex fno-merge-debug-strings
7429 Direct the linker to not merge together strings in the debugging
7430 information that are identical in different object files.  Merging is
7431 not supported by all assemblers or linkers.  Merging decreases the size
7432 of the debug information in the output file at the cost of increasing
7433 link processing time.  Merging is enabled by default.
7435 @item -fdebug-prefix-map=@var{old}=@var{new}
7436 @opindex fdebug-prefix-map
7437 When compiling files residing in directory @file{@var{old}}, record
7438 debugging information describing them as if the files resided in
7439 directory @file{@var{new}} instead.  This can be used to replace a
7440 build-time path with an install-time path in the debug info.  It can
7441 also be used to change an absolute path to a relative path by using
7442 @file{.} for @var{new}.  This can give more reproducible builds, which
7443 are location independent, but may require an extra command to tell GDB
7444 where to find the source files. See also @option{-ffile-prefix-map}.
7446 @item -fvar-tracking
7447 @opindex fvar-tracking
7448 Run variable tracking pass.  It computes where variables are stored at each
7449 position in code.  Better debugging information is then generated
7450 (if the debugging information format supports this information).
7452 It is enabled by default when compiling with optimization (@option{-Os},
7453 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
7454 the debug info format supports it.
7456 @item -fvar-tracking-assignments
7457 @opindex fvar-tracking-assignments
7458 @opindex fno-var-tracking-assignments
7459 Annotate assignments to user variables early in the compilation and
7460 attempt to carry the annotations over throughout the compilation all the
7461 way to the end, in an attempt to improve debug information while
7462 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
7464 It can be enabled even if var-tracking is disabled, in which case
7465 annotations are created and maintained, but discarded at the end.
7466 By default, this flag is enabled together with @option{-fvar-tracking},
7467 except when selective scheduling is enabled.
7469 @item -gsplit-dwarf
7470 @opindex gsplit-dwarf
7471 Separate as much DWARF debugging information as possible into a
7472 separate output file with the extension @file{.dwo}.  This option allows
7473 the build system to avoid linking files with debug information.  To
7474 be useful, this option requires a debugger capable of reading @file{.dwo}
7475 files.
7477 @item -gdescribe-dies
7478 @opindex gdescribe-dies
7479 Add description attributes to some DWARF DIEs that have no name attribute,
7480 such as artificial variables, external references and call site
7481 parameter DIEs.
7483 @item -gpubnames
7484 @opindex gpubnames
7485 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
7487 @item -ggnu-pubnames
7488 @opindex ggnu-pubnames
7489 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
7490 suitable for conversion into a GDB@ index.  This option is only useful
7491 with a linker that can produce GDB@ index version 7.
7493 @item -fdebug-types-section
7494 @opindex fdebug-types-section
7495 @opindex fno-debug-types-section
7496 When using DWARF Version 4 or higher, type DIEs can be put into
7497 their own @code{.debug_types} section instead of making them part of the
7498 @code{.debug_info} section.  It is more efficient to put them in a separate
7499 comdat section since the linker can then remove duplicates.
7500 But not all DWARF consumers support @code{.debug_types} sections yet
7501 and on some objects @code{.debug_types} produces larger instead of smaller
7502 debugging information.
7504 @item -grecord-gcc-switches
7505 @itemx -gno-record-gcc-switches
7506 @opindex grecord-gcc-switches
7507 @opindex gno-record-gcc-switches
7508 This switch causes the command-line options used to invoke the
7509 compiler that may affect code generation to be appended to the
7510 DW_AT_producer attribute in DWARF debugging information.  The options
7511 are concatenated with spaces separating them from each other and from
7512 the compiler version.  
7513 It is enabled by default.
7514 See also @option{-frecord-gcc-switches} for another
7515 way of storing compiler options into the object file.  
7517 @item -gstrict-dwarf
7518 @opindex gstrict-dwarf
7519 Disallow using extensions of later DWARF standard version than selected
7520 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
7521 DWARF extensions from later standard versions is allowed.
7523 @item -gno-strict-dwarf
7524 @opindex gno-strict-dwarf
7525 Allow using extensions of later DWARF standard version than selected with
7526 @option{-gdwarf-@var{version}}.
7528 @item -gas-loc-support
7529 @opindex gas-loc-support
7530 Inform the compiler that the assembler supports @code{.loc} directives.
7531 It may then use them for the assembler to generate DWARF2+ line number
7532 tables.
7534 This is generally desirable, because assembler-generated line-number
7535 tables are a lot more compact than those the compiler can generate
7536 itself.
7538 This option will be enabled by default if, at GCC configure time, the
7539 assembler was found to support such directives.
7541 @item -gno-as-loc-support
7542 @opindex gno-as-loc-support
7543 Force GCC to generate DWARF2+ line number tables internally, if DWARF2+
7544 line number tables are to be generated.
7546 @item gas-locview-support
7547 @opindex gas-locview-support
7548 Inform the compiler that the assembler supports @code{view} assignment
7549 and reset assertion checking in @code{.loc} directives.
7551 This option will be enabled by default if, at GCC configure time, the
7552 assembler was found to support them.
7554 @item gno-as-locview-support
7555 Force GCC to assign view numbers internally, if
7556 @option{-gvariable-location-views} are explicitly requested.
7558 @item -gcolumn-info
7559 @itemx -gno-column-info
7560 @opindex gcolumn-info
7561 @opindex gno-column-info
7562 Emit location column information into DWARF debugging information, rather
7563 than just file and line.
7564 This option is enabled by default.
7566 @item -gstatement-frontiers
7567 @itemx -gno-statement-frontiers
7568 @opindex gstatement-frontiers
7569 @opindex gno-statement-frontiers
7570 This option causes GCC to create markers in the internal representation
7571 at the beginning of statements, and to keep them roughly in place
7572 throughout compilation, using them to guide the output of @code{is_stmt}
7573 markers in the line number table.  This is enabled by default when
7574 compiling with optimization (@option{-Os}, @option{-O}, @option{-O2},
7575 @dots{}), and outputting DWARF 2 debug information at the normal level.
7577 @item -gvariable-location-views
7578 @itemx -gvariable-location-views=incompat5
7579 @itemx -gno-variable-location-views
7580 @opindex gvariable-location-views
7581 @opindex gvariable-location-views=incompat5
7582 @opindex gno-variable-location-views
7583 Augment variable location lists with progressive view numbers implied
7584 from the line number table.  This enables debug information consumers to
7585 inspect state at certain points of the program, even if no instructions
7586 associated with the corresponding source locations are present at that
7587 point.  If the assembler lacks support for view numbers in line number
7588 tables, this will cause the compiler to emit the line number table,
7589 which generally makes them somewhat less compact.  The augmented line
7590 number tables and location lists are fully backward-compatible, so they
7591 can be consumed by debug information consumers that are not aware of
7592 these augmentations, but they won't derive any benefit from them either.
7594 This is enabled by default when outputting DWARF 2 debug information at
7595 the normal level, as long as there is assembler support,
7596 @option{-fvar-tracking-assignments} is enabled and
7597 @option{-gstrict-dwarf} is not.  When assembler support is not
7598 available, this may still be enabled, but it will force GCC to output
7599 internal line number tables, and if
7600 @option{-ginternal-reset-location-views} is not enabled, that will most
7601 certainly lead to silently mismatching location views.
7603 There is a proposed representation for view numbers that is not backward
7604 compatible with the location list format introduced in DWARF 5, that can
7605 be enabled with @option{-gvariable-location-views=incompat5}.  This
7606 option may be removed in the future, is only provided as a reference
7607 implementation of the proposed representation.  Debug information
7608 consumers are not expected to support this extended format, and they
7609 would be rendered unable to decode location lists using it.
7611 @item -ginternal-reset-location-views
7612 @itemx -gnointernal-reset-location-views
7613 @opindex ginternal-reset-location-views
7614 @opindex gno-internal-reset-location-views
7615 Attempt to determine location views that can be omitted from location
7616 view lists.  This requires the compiler to have very accurate insn
7617 length estimates, which isn't always the case, and it may cause
7618 incorrect view lists to be generated silently when using an assembler
7619 that does not support location view lists.  The GNU assembler will flag
7620 any such error as a @code{view number mismatch}.  This is only enabled
7621 on ports that define a reliable estimation function.
7623 @item -ginline-points
7624 @itemx -gno-inline-points
7625 @opindex ginline-points
7626 @opindex gno-inline-points
7627 Generate extended debug information for inlined functions.  Location
7628 view tracking markers are inserted at inlined entry points, so that
7629 address and view numbers can be computed and output in debug
7630 information.  This can be enabled independently of location views, in
7631 which case the view numbers won't be output, but it can only be enabled
7632 along with statement frontiers, and it is only enabled by default if
7633 location views are enabled.
7635 @item -gz@r{[}=@var{type}@r{]}
7636 @opindex gz
7637 Produce compressed debug sections in DWARF format, if that is supported.
7638 If @var{type} is not given, the default type depends on the capabilities
7639 of the assembler and linker used.  @var{type} may be one of
7640 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
7641 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
7642 compression in traditional GNU format).  If the linker doesn't support
7643 writing compressed debug sections, the option is rejected.  Otherwise,
7644 if the assembler does not support them, @option{-gz} is silently ignored
7645 when producing object files.
7647 @item -femit-struct-debug-baseonly
7648 @opindex femit-struct-debug-baseonly
7649 Emit debug information for struct-like types
7650 only when the base name of the compilation source file
7651 matches the base name of file in which the struct is defined.
7653 This option substantially reduces the size of debugging information,
7654 but at significant potential loss in type information to the debugger.
7655 See @option{-femit-struct-debug-reduced} for a less 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-reduced
7661 @opindex femit-struct-debug-reduced
7662 Emit debug information for struct-like types
7663 only when the base name of the compilation source file
7664 matches the base name of file in which the type is defined,
7665 unless the struct is a template or defined in a system header.
7667 This option significantly reduces the size of debugging information,
7668 with some potential loss in type information to the debugger.
7669 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
7670 See @option{-femit-struct-debug-detailed} for more detailed control.
7672 This option works only with DWARF debug output.
7674 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
7675 @opindex femit-struct-debug-detailed
7676 Specify the struct-like types
7677 for which the compiler generates debug information.
7678 The intent is to reduce duplicate struct debug information
7679 between different object files within the same program.
7681 This option is a detailed version of
7682 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
7683 which serves for most needs.
7685 A specification has the syntax@*
7686 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
7688 The optional first word limits the specification to
7689 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
7690 A struct type is used directly when it is the type of a variable, member.
7691 Indirect uses arise through pointers to structs.
7692 That is, when use of an incomplete struct is valid, the use is indirect.
7693 An example is
7694 @samp{struct one direct; struct two * indirect;}.
7696 The optional second word limits the specification to
7697 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
7698 Generic structs are a bit complicated to explain.
7699 For C++, these are non-explicit specializations of template classes,
7700 or non-template classes within the above.
7701 Other programming languages have generics,
7702 but @option{-femit-struct-debug-detailed} does not yet implement them.
7704 The third word specifies the source files for those
7705 structs for which the compiler should emit debug information.
7706 The values @samp{none} and @samp{any} have the normal meaning.
7707 The value @samp{base} means that
7708 the base of name of the file in which the type declaration appears
7709 must match the base of the name of the main compilation file.
7710 In practice, this means that when compiling @file{foo.c}, debug information
7711 is generated for types declared in that file and @file{foo.h},
7712 but not other header files.
7713 The value @samp{sys} means those types satisfying @samp{base}
7714 or declared in system or compiler headers.
7716 You may need to experiment to determine the best settings for your application.
7718 The default is @option{-femit-struct-debug-detailed=all}.
7720 This option works only with DWARF debug output.
7722 @item -fno-dwarf2-cfi-asm
7723 @opindex fdwarf2-cfi-asm
7724 @opindex fno-dwarf2-cfi-asm
7725 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
7726 instead of using GAS @code{.cfi_*} directives.
7728 @item -fno-eliminate-unused-debug-types
7729 @opindex feliminate-unused-debug-types
7730 @opindex fno-eliminate-unused-debug-types
7731 Normally, when producing DWARF output, GCC avoids producing debug symbol 
7732 output for types that are nowhere used in the source file being compiled.
7733 Sometimes it is useful to have GCC emit debugging
7734 information for all types declared in a compilation
7735 unit, regardless of whether or not they are actually used
7736 in that compilation unit, for example 
7737 if, in the debugger, you want to cast a value to a type that is
7738 not actually used in your program (but is declared).  More often,
7739 however, this results in a significant amount of wasted space.
7740 @end table
7742 @node Optimize Options
7743 @section Options That Control Optimization
7744 @cindex optimize options
7745 @cindex options, optimization
7747 These options control various sorts of optimizations.
7749 Without any optimization option, the compiler's goal is to reduce the
7750 cost of compilation and to make debugging produce the expected
7751 results.  Statements are independent: if you stop the program with a
7752 breakpoint between statements, you can then assign a new value to any
7753 variable or change the program counter to any other statement in the
7754 function and get exactly the results you expect from the source
7755 code.
7757 Turning on optimization flags makes the compiler attempt to improve
7758 the performance and/or code size at the expense of compilation time
7759 and possibly the ability to debug the program.
7761 The compiler performs optimization based on the knowledge it has of the
7762 program.  Compiling multiple files at once to a single output file mode allows
7763 the compiler to use information gained from all of the files when compiling
7764 each of them.
7766 Not all optimizations are controlled directly by a flag.  Only
7767 optimizations that have a flag are listed in this section.
7769 Most optimizations are only enabled if an @option{-O} level is set on
7770 the command line.  Otherwise they are disabled, even if individual
7771 optimization flags are specified.
7773 Depending on the target and how GCC was configured, a slightly different
7774 set of optimizations may be enabled at each @option{-O} level than
7775 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7776 to find out the exact set of optimizations that are enabled at each level.
7777 @xref{Overall Options}, for examples.
7779 @table @gcctabopt
7780 @item -O
7781 @itemx -O1
7782 @opindex O
7783 @opindex O1
7784 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7785 more memory for a large function.
7787 With @option{-O}, the compiler tries to reduce code size and execution
7788 time, without performing any optimizations that take a great deal of
7789 compilation time.
7791 @option{-O} turns on the following optimization flags:
7792 @gccoptlist{
7793 -fauto-inc-dec @gol
7794 -fbranch-count-reg @gol
7795 -fcombine-stack-adjustments @gol
7796 -fcompare-elim @gol
7797 -fcprop-registers @gol
7798 -fdce @gol
7799 -fdefer-pop @gol
7800 -fdelayed-branch @gol
7801 -fdse @gol
7802 -fforward-propagate @gol
7803 -fguess-branch-probability @gol
7804 -fif-conversion2 @gol
7805 -fif-conversion @gol
7806 -finline-functions-called-once @gol
7807 -fipa-pure-const @gol
7808 -fipa-profile @gol
7809 -fipa-reference @gol
7810 -fmerge-constants @gol
7811 -fmove-loop-invariants @gol
7812 -fomit-frame-pointer @gol
7813 -freorder-blocks @gol
7814 -fshrink-wrap @gol
7815 -fshrink-wrap-separate @gol
7816 -fsplit-wide-types @gol
7817 -fssa-backprop @gol
7818 -fssa-phiopt @gol
7819 -ftree-bit-ccp @gol
7820 -ftree-ccp @gol
7821 -ftree-ch @gol
7822 -ftree-coalesce-vars @gol
7823 -ftree-copy-prop @gol
7824 -ftree-dce @gol
7825 -ftree-dominator-opts @gol
7826 -ftree-dse @gol
7827 -ftree-forwprop @gol
7828 -ftree-fre @gol
7829 -ftree-phiprop @gol
7830 -ftree-scev-cprop @gol
7831 -ftree-sink @gol
7832 -ftree-slsr @gol
7833 -ftree-sra @gol
7834 -ftree-pta @gol
7835 -ftree-ter @gol
7836 -funit-at-a-time}
7838 @item -O2
7839 @opindex O2
7840 Optimize even more.  GCC performs nearly all supported optimizations
7841 that do not involve a space-speed tradeoff.
7842 As compared to @option{-O}, this option increases both compilation time
7843 and the performance of the generated code.
7845 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7846 also turns on the following optimization flags:
7847 @gccoptlist{-fthread-jumps @gol
7848 -falign-functions  -falign-jumps @gol
7849 -falign-loops  -falign-labels @gol
7850 -fcaller-saves @gol
7851 -fcrossjumping @gol
7852 -fcse-follow-jumps  -fcse-skip-blocks @gol
7853 -fdelete-null-pointer-checks @gol
7854 -fdevirtualize -fdevirtualize-speculatively @gol
7855 -fexpensive-optimizations @gol
7856 -fgcse  -fgcse-lm  @gol
7857 -fhoist-adjacent-loads @gol
7858 -finline-small-functions @gol
7859 -findirect-inlining @gol
7860 -fipa-cp @gol
7861 -fipa-bit-cp @gol
7862 -fipa-vrp @gol
7863 -fipa-sra @gol
7864 -fipa-icf @gol
7865 -fisolate-erroneous-paths-dereference @gol
7866 -flra-remat @gol
7867 -foptimize-sibling-calls @gol
7868 -foptimize-strlen @gol
7869 -fpartial-inlining @gol
7870 -fpeephole2 @gol
7871 -freorder-blocks-algorithm=stc @gol
7872 -freorder-blocks-and-partition -freorder-functions @gol
7873 -frerun-cse-after-loop  @gol
7874 -fsched-interblock  -fsched-spec @gol
7875 -fschedule-insns  -fschedule-insns2 @gol
7876 -fstore-merging @gol
7877 -fstrict-aliasing @gol
7878 -ftree-builtin-call-dce @gol
7879 -ftree-switch-conversion -ftree-tail-merge @gol
7880 -fcode-hoisting @gol
7881 -ftree-pre @gol
7882 -ftree-vrp @gol
7883 -fipa-ra}
7885 Please note the warning under @option{-fgcse} about
7886 invoking @option{-O2} on programs that use computed gotos.
7888 @item -O3
7889 @opindex O3
7890 Optimize yet more.  @option{-O3} turns on all optimizations specified
7891 by @option{-O2} and also turns on the following optimization flags:
7892 @gccoptlist{-finline-functions @gol
7893 -funswitch-loops @gol
7894 -fpredictive-commoning @gol
7895 -fgcse-after-reload @gol
7896 -ftree-loop-vectorize @gol
7897 -ftree-loop-distribution @gol
7898 -ftree-loop-distribute-patterns @gol
7899 -floop-interchange @gol
7900 -floop-unroll-and-jam @gol
7901 -fsplit-paths @gol
7902 -ftree-slp-vectorize @gol
7903 -fvect-cost-model @gol
7904 -ftree-partial-pre @gol
7905 -fpeel-loops @gol
7906 -fipa-cp-clone}
7908 @item -O0
7909 @opindex O0
7910 Reduce compilation time and make debugging produce the expected
7911 results.  This is the default.
7913 @item -Os
7914 @opindex Os
7915 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7916 do not typically increase code size.  It also performs further
7917 optimizations designed to reduce code size.
7919 @option{-Os} disables the following optimization flags:
7920 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7921 -falign-labels  -freorder-blocks  -freorder-blocks-algorithm=stc @gol
7922 -freorder-blocks-and-partition  -fprefetch-loop-arrays}
7924 @item -Ofast
7925 @opindex Ofast
7926 Disregard strict standards compliance.  @option{-Ofast} enables all
7927 @option{-O3} optimizations.  It also enables optimizations that are not
7928 valid for all standard-compliant programs.
7929 It turns on @option{-ffast-math} and the Fortran-specific
7930 @option{-fstack-arrays}, unless @option{-fmax-stack-var-size} is
7931 specified, and @option{-fno-protect-parens}.
7933 @item -Og
7934 @opindex Og
7935 Optimize debugging experience.  @option{-Og} enables optimizations
7936 that do not interfere with debugging. It should be the optimization
7937 level of choice for the standard edit-compile-debug cycle, offering
7938 a reasonable level of optimization while maintaining fast compilation
7939 and a good debugging experience.
7940 @end table
7942 If you use multiple @option{-O} options, with or without level numbers,
7943 the last such option is the one that is effective.
7945 Options of the form @option{-f@var{flag}} specify machine-independent
7946 flags.  Most flags have both positive and negative forms; the negative
7947 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7948 below, only one of the forms is listed---the one you typically 
7949 use.  You can figure out the other form by either removing @samp{no-}
7950 or adding it.
7952 The following options control specific optimizations.  They are either
7953 activated by @option{-O} options or are related to ones that are.  You
7954 can use the following flags in the rare cases when ``fine-tuning'' of
7955 optimizations to be performed is desired.
7957 @table @gcctabopt
7958 @item -fno-defer-pop
7959 @opindex fno-defer-pop
7960 Always pop the arguments to each function call as soon as that function
7961 returns.  For machines that must pop arguments after a function call,
7962 the compiler normally lets arguments accumulate on the stack for several
7963 function calls and pops them all at once.
7965 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7967 @item -fforward-propagate
7968 @opindex fforward-propagate
7969 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7970 instructions and checks if the result can be simplified.  If loop unrolling
7971 is active, two passes are performed and the second is scheduled after
7972 loop unrolling.
7974 This option is enabled by default at optimization levels @option{-O},
7975 @option{-O2}, @option{-O3}, @option{-Os}.
7977 @item -ffp-contract=@var{style}
7978 @opindex ffp-contract
7979 @option{-ffp-contract=off} disables floating-point expression contraction.
7980 @option{-ffp-contract=fast} enables floating-point expression contraction
7981 such as forming of fused multiply-add operations if the target has
7982 native support for them.
7983 @option{-ffp-contract=on} enables floating-point expression contraction
7984 if allowed by the language standard.  This is currently not implemented
7985 and treated equal to @option{-ffp-contract=off}.
7987 The default is @option{-ffp-contract=fast}.
7989 @item -fomit-frame-pointer
7990 @opindex fomit-frame-pointer
7991 Omit the frame pointer in functions that don't need one.  This avoids the
7992 instructions to save, set up and restore the frame pointer; on many targets
7993 it also makes an extra register available.
7995 On some targets this flag has no effect because the standard calling sequence
7996 always uses a frame pointer, so it cannot be omitted.
7998 Note that @option{-fno-omit-frame-pointer} doesn't guarantee the frame pointer
7999 is used in all functions.  Several targets always omit the frame pointer in
8000 leaf functions.
8002 Enabled by default at @option{-O} and higher.
8004 @item -foptimize-sibling-calls
8005 @opindex foptimize-sibling-calls
8006 Optimize sibling and tail recursive calls.
8008 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8010 @item -foptimize-strlen
8011 @opindex foptimize-strlen
8012 Optimize various standard C string functions (e.g. @code{strlen},
8013 @code{strchr} or @code{strcpy}) and
8014 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
8016 Enabled at levels @option{-O2}, @option{-O3}.
8018 @item -fno-inline
8019 @opindex fno-inline
8020 Do not expand any functions inline apart from those marked with
8021 the @code{always_inline} attribute.  This is the default when not
8022 optimizing.
8024 Single functions can be exempted from inlining by marking them
8025 with the @code{noinline} attribute.
8027 @item -finline-small-functions
8028 @opindex finline-small-functions
8029 Integrate functions into their callers when their body is smaller than expected
8030 function call code (so overall size of program gets smaller).  The compiler
8031 heuristically decides which functions are simple enough to be worth integrating
8032 in this way.  This inlining applies to all functions, even those not declared
8033 inline.
8035 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8037 @item -findirect-inlining
8038 @opindex findirect-inlining
8039 Inline also indirect calls that are discovered to be known at compile
8040 time thanks to previous inlining.  This option has any effect only
8041 when inlining itself is turned on by the @option{-finline-functions}
8042 or @option{-finline-small-functions} options.
8044 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8046 @item -finline-functions
8047 @opindex finline-functions
8048 Consider all functions for inlining, even if they are not declared inline.
8049 The compiler heuristically decides which functions are worth integrating
8050 in this way.
8052 If all calls to a given function are integrated, and the function is
8053 declared @code{static}, then the function is normally not output as
8054 assembler code in its own right.
8056 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8058 @item -finline-functions-called-once
8059 @opindex finline-functions-called-once
8060 Consider all @code{static} functions called once for inlining into their
8061 caller even if they are not marked @code{inline}.  If a call to a given
8062 function is integrated, then the function is not output as assembler code
8063 in its own right.
8065 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
8067 @item -fearly-inlining
8068 @opindex fearly-inlining
8069 Inline functions marked by @code{always_inline} and functions whose body seems
8070 smaller than the function call overhead early before doing
8071 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
8072 makes profiling significantly cheaper and usually inlining faster on programs
8073 having large chains of nested wrapper functions.
8075 Enabled by default.
8077 @item -fipa-sra
8078 @opindex fipa-sra
8079 Perform interprocedural scalar replacement of aggregates, removal of
8080 unused parameters and replacement of parameters passed by reference
8081 by parameters passed by value.
8083 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
8085 @item -finline-limit=@var{n}
8086 @opindex finline-limit
8087 By default, GCC limits the size of functions that can be inlined.  This flag
8088 allows coarse control of this limit.  @var{n} is the size of functions that
8089 can be inlined in number of pseudo instructions.
8091 Inlining is actually controlled by a number of parameters, which may be
8092 specified individually by using @option{--param @var{name}=@var{value}}.
8093 The @option{-finline-limit=@var{n}} option sets some of these parameters
8094 as follows:
8096 @table @gcctabopt
8097 @item max-inline-insns-single
8098 is set to @var{n}/2.
8099 @item max-inline-insns-auto
8100 is set to @var{n}/2.
8101 @end table
8103 See below for a documentation of the individual
8104 parameters controlling inlining and for the defaults of these parameters.
8106 @emph{Note:} there may be no value to @option{-finline-limit} that results
8107 in default behavior.
8109 @emph{Note:} pseudo instruction represents, in this particular context, an
8110 abstract measurement of function's size.  In no way does it represent a count
8111 of assembly instructions and as such its exact meaning might change from one
8112 release to an another.
8114 @item -fno-keep-inline-dllexport
8115 @opindex fno-keep-inline-dllexport
8116 This is a more fine-grained version of @option{-fkeep-inline-functions},
8117 which applies only to functions that are declared using the @code{dllexport}
8118 attribute or declspec.  @xref{Function Attributes,,Declaring Attributes of
8119 Functions}.
8121 @item -fkeep-inline-functions
8122 @opindex fkeep-inline-functions
8123 In C, emit @code{static} functions that are declared @code{inline}
8124 into the object file, even if the function has been inlined into all
8125 of its callers.  This switch does not affect functions using the
8126 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
8127 inline functions into the object file.
8129 @item -fkeep-static-functions
8130 @opindex fkeep-static-functions
8131 Emit @code{static} functions into the object file, even if the function
8132 is never used.
8134 @item -fkeep-static-consts
8135 @opindex fkeep-static-consts
8136 Emit variables declared @code{static const} when optimization isn't turned
8137 on, even if the variables aren't referenced.
8139 GCC enables this option by default.  If you want to force the compiler to
8140 check if a variable is referenced, regardless of whether or not
8141 optimization is turned on, use the @option{-fno-keep-static-consts} option.
8143 @item -fmerge-constants
8144 @opindex fmerge-constants
8145 Attempt to merge identical constants (string constants and floating-point
8146 constants) across compilation units.
8148 This option is the default for optimized compilation if the assembler and
8149 linker support it.  Use @option{-fno-merge-constants} to inhibit this
8150 behavior.
8152 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8154 @item -fmerge-all-constants
8155 @opindex fmerge-all-constants
8156 Attempt to merge identical constants and identical variables.
8158 This option implies @option{-fmerge-constants}.  In addition to
8159 @option{-fmerge-constants} this considers e.g.@: even constant initialized
8160 arrays or initialized constant variables with integral or floating-point
8161 types.  Languages like C or C++ require each variable, including multiple
8162 instances of the same variable in recursive calls, to have distinct locations,
8163 so using this option results in non-conforming
8164 behavior.
8166 @item -fmodulo-sched
8167 @opindex fmodulo-sched
8168 Perform swing modulo scheduling immediately before the first scheduling
8169 pass.  This pass looks at innermost loops and reorders their
8170 instructions by overlapping different iterations.
8172 @item -fmodulo-sched-allow-regmoves
8173 @opindex fmodulo-sched-allow-regmoves
8174 Perform more aggressive SMS-based modulo scheduling with register moves
8175 allowed.  By setting this flag certain anti-dependences edges are
8176 deleted, which triggers the generation of reg-moves based on the
8177 life-range analysis.  This option is effective only with
8178 @option{-fmodulo-sched} enabled.
8180 @item -fno-branch-count-reg
8181 @opindex fno-branch-count-reg
8182 Avoid running a pass scanning for opportunities to use ``decrement and
8183 branch'' instructions on a count register instead of generating sequences
8184 of instructions that decrement a register, compare it against zero, and
8185 then branch based upon the result.  This option is only meaningful on
8186 architectures that support such instructions, which include x86, PowerPC,
8187 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
8188 doesn't remove the decrement and branch instructions from the generated
8189 instruction stream introduced by other optimization passes.
8191 Enabled by default at @option{-O1} and higher.
8193 The default is @option{-fbranch-count-reg}.
8195 @item -fno-function-cse
8196 @opindex fno-function-cse
8197 Do not put function addresses in registers; make each instruction that
8198 calls a constant function contain the function's address explicitly.
8200 This option results in less efficient code, but some strange hacks
8201 that alter the assembler output may be confused by the optimizations
8202 performed when this option is not used.
8204 The default is @option{-ffunction-cse}
8206 @item -fno-zero-initialized-in-bss
8207 @opindex fno-zero-initialized-in-bss
8208 If the target supports a BSS section, GCC by default puts variables that
8209 are initialized to zero into BSS@.  This can save space in the resulting
8210 code.
8212 This option turns off this behavior because some programs explicitly
8213 rely on variables going to the data section---e.g., so that the
8214 resulting executable can find the beginning of that section and/or make
8215 assumptions based on that.
8217 The default is @option{-fzero-initialized-in-bss}.
8219 @item -fthread-jumps
8220 @opindex fthread-jumps
8221 Perform optimizations that check to see if a jump branches to a
8222 location where another comparison subsumed by the first is found.  If
8223 so, the first branch is redirected to either the destination of the
8224 second branch or a point immediately following it, depending on whether
8225 the condition is known to be true or false.
8227 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8229 @item -fsplit-wide-types
8230 @opindex fsplit-wide-types
8231 When using a type that occupies multiple registers, such as @code{long
8232 long} on a 32-bit system, split the registers apart and allocate them
8233 independently.  This normally generates better code for those types,
8234 but may make debugging more difficult.
8236 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
8237 @option{-Os}.
8239 @item -fcse-follow-jumps
8240 @opindex fcse-follow-jumps
8241 In common subexpression elimination (CSE), scan through jump instructions
8242 when the target of the jump is not reached by any other path.  For
8243 example, when CSE encounters an @code{if} statement with an
8244 @code{else} clause, CSE follows the jump when the condition
8245 tested is false.
8247 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8249 @item -fcse-skip-blocks
8250 @opindex fcse-skip-blocks
8251 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
8252 follow jumps that conditionally skip over blocks.  When CSE
8253 encounters a simple @code{if} statement with no else clause,
8254 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
8255 body of the @code{if}.
8257 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8259 @item -frerun-cse-after-loop
8260 @opindex frerun-cse-after-loop
8261 Re-run common subexpression elimination after loop optimizations are
8262 performed.
8264 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8266 @item -fgcse
8267 @opindex fgcse
8268 Perform a global common subexpression elimination pass.
8269 This pass also performs global constant and copy propagation.
8271 @emph{Note:} When compiling a program using computed gotos, a GCC
8272 extension, you may get better run-time performance if you disable
8273 the global common subexpression elimination pass by adding
8274 @option{-fno-gcse} to the command line.
8276 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8278 @item -fgcse-lm
8279 @opindex fgcse-lm
8280 When @option{-fgcse-lm} is enabled, global common subexpression elimination
8281 attempts to move loads that are only killed by stores into themselves.  This
8282 allows a loop containing a load/store sequence to be changed to a load outside
8283 the loop, and a copy/store within the loop.
8285 Enabled by default when @option{-fgcse} is enabled.
8287 @item -fgcse-sm
8288 @opindex fgcse-sm
8289 When @option{-fgcse-sm} is enabled, a store motion pass is run after
8290 global common subexpression elimination.  This pass attempts to move
8291 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
8292 loops containing a load/store sequence can be changed to a load before
8293 the loop and a store after the loop.
8295 Not enabled at any optimization level.
8297 @item -fgcse-las
8298 @opindex fgcse-las
8299 When @option{-fgcse-las} is enabled, the global common subexpression
8300 elimination pass eliminates redundant loads that come after stores to the
8301 same memory location (both partial and full redundancies).
8303 Not enabled at any optimization level.
8305 @item -fgcse-after-reload
8306 @opindex fgcse-after-reload
8307 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
8308 pass is performed after reload.  The purpose of this pass is to clean up
8309 redundant spilling.
8311 @item -faggressive-loop-optimizations
8312 @opindex faggressive-loop-optimizations
8313 This option tells the loop optimizer to use language constraints to
8314 derive bounds for the number of iterations of a loop.  This assumes that
8315 loop code does not invoke undefined behavior by for example causing signed
8316 integer overflows or out-of-bound array accesses.  The bounds for the
8317 number of iterations of a loop are used to guide loop unrolling and peeling
8318 and loop exit test optimizations.
8319 This option is enabled by default.
8321 @item -funconstrained-commons
8322 @opindex funconstrained-commons
8323 This option tells the compiler that variables declared in common blocks
8324 (e.g. Fortran) may later be overridden with longer trailing arrays. This
8325 prevents certain optimizations that depend on knowing the array bounds.
8327 @item -fcrossjumping
8328 @opindex fcrossjumping
8329 Perform cross-jumping transformation.
8330 This transformation unifies equivalent code and saves code size.  The
8331 resulting code may or may not perform better than without cross-jumping.
8333 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8335 @item -fauto-inc-dec
8336 @opindex fauto-inc-dec
8337 Combine increments or decrements of addresses with memory accesses.
8338 This pass is always skipped on architectures that do not have
8339 instructions to support this.  Enabled by default at @option{-O} and
8340 higher on architectures that support this.
8342 @item -fdce
8343 @opindex fdce
8344 Perform dead code elimination (DCE) on RTL@.
8345 Enabled by default at @option{-O} and higher.
8347 @item -fdse
8348 @opindex fdse
8349 Perform dead store elimination (DSE) on RTL@.
8350 Enabled by default at @option{-O} and higher.
8352 @item -fif-conversion
8353 @opindex fif-conversion
8354 Attempt to transform conditional jumps into branch-less equivalents.  This
8355 includes use of conditional moves, min, max, set flags and abs instructions, and
8356 some tricks doable by standard arithmetics.  The use of conditional execution
8357 on chips where it is available is controlled by @option{-fif-conversion2}.
8359 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8361 @item -fif-conversion2
8362 @opindex fif-conversion2
8363 Use conditional execution (where available) to transform conditional jumps into
8364 branch-less equivalents.
8366 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8368 @item -fdeclone-ctor-dtor
8369 @opindex fdeclone-ctor-dtor
8370 The C++ ABI requires multiple entry points for constructors and
8371 destructors: one for a base subobject, one for a complete object, and
8372 one for a virtual destructor that calls operator delete afterwards.
8373 For a hierarchy with virtual bases, the base and complete variants are
8374 clones, which means two copies of the function.  With this option, the
8375 base and complete variants are changed to be thunks that call a common
8376 implementation.
8378 Enabled by @option{-Os}.
8380 @item -fdelete-null-pointer-checks
8381 @opindex fdelete-null-pointer-checks
8382 Assume that programs cannot safely dereference null pointers, and that
8383 no code or data element resides at address zero.
8384 This option enables simple constant
8385 folding optimizations at all optimization levels.  In addition, other
8386 optimization passes in GCC use this flag to control global dataflow
8387 analyses that eliminate useless checks for null pointers; these assume
8388 that a memory access to address zero always results in a trap, so
8389 that if a pointer is checked after it has already been dereferenced,
8390 it cannot be null.
8392 Note however that in some environments this assumption is not true.
8393 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
8394 for programs that depend on that behavior.
8396 This option is enabled by default on most targets.  On Nios II ELF, it
8397 defaults to off.  On AVR, CR16, and MSP430, this option is completely disabled.
8399 Passes that use the dataflow information
8400 are enabled independently at different optimization levels.
8402 @item -fdevirtualize
8403 @opindex fdevirtualize
8404 Attempt to convert calls to virtual functions to direct calls.  This
8405 is done both within a procedure and interprocedurally as part of
8406 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
8407 propagation (@option{-fipa-cp}).
8408 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8410 @item -fdevirtualize-speculatively
8411 @opindex fdevirtualize-speculatively
8412 Attempt to convert calls to virtual functions to speculative direct calls.
8413 Based on the analysis of the type inheritance graph, determine for a given call
8414 the set of likely targets. If the set is small, preferably of size 1, change
8415 the call into a conditional deciding between direct and indirect calls.  The
8416 speculative calls enable more optimizations, such as inlining.  When they seem
8417 useless after further optimization, they are converted back into original form.
8419 @item -fdevirtualize-at-ltrans
8420 @opindex fdevirtualize-at-ltrans
8421 Stream extra information needed for aggressive devirtualization when running
8422 the link-time optimizer in local transformation mode.  
8423 This option enables more devirtualization but
8424 significantly increases the size of streamed data. For this reason it is
8425 disabled by default.
8427 @item -fexpensive-optimizations
8428 @opindex fexpensive-optimizations
8429 Perform a number of minor optimizations that are relatively expensive.
8431 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8433 @item -free
8434 @opindex free
8435 Attempt to remove redundant extension instructions.  This is especially
8436 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
8437 registers after writing to their lower 32-bit half.
8439 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
8440 @option{-O3}, @option{-Os}.
8442 @item -fno-lifetime-dse
8443 @opindex fno-lifetime-dse
8444 In C++ the value of an object is only affected by changes within its
8445 lifetime: when the constructor begins, the object has an indeterminate
8446 value, and any changes during the lifetime of the object are dead when
8447 the object is destroyed.  Normally dead store elimination will take
8448 advantage of this; if your code relies on the value of the object
8449 storage persisting beyond the lifetime of the object, you can use this
8450 flag to disable this optimization.  To preserve stores before the
8451 constructor starts (e.g. because your operator new clears the object
8452 storage) but still treat the object as dead after the destructor you,
8453 can use @option{-flifetime-dse=1}.  The default behavior can be
8454 explicitly selected with @option{-flifetime-dse=2}.
8455 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
8457 @item -flive-range-shrinkage
8458 @opindex flive-range-shrinkage
8459 Attempt to decrease register pressure through register live range
8460 shrinkage.  This is helpful for fast processors with small or moderate
8461 size register sets.
8463 @item -fira-algorithm=@var{algorithm}
8464 @opindex fira-algorithm
8465 Use the specified coloring algorithm for the integrated register
8466 allocator.  The @var{algorithm} argument can be @samp{priority}, which
8467 specifies Chow's priority coloring, or @samp{CB}, which specifies
8468 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
8469 for all architectures, but for those targets that do support it, it is
8470 the default because it generates better code.
8472 @item -fira-region=@var{region}
8473 @opindex fira-region
8474 Use specified regions for the integrated register allocator.  The
8475 @var{region} argument should be one of the following:
8477 @table @samp
8479 @item all
8480 Use all loops as register allocation regions.
8481 This can give the best results for machines with a small and/or
8482 irregular register set.
8484 @item mixed
8485 Use all loops except for loops with small register pressure 
8486 as the regions.  This value usually gives
8487 the best results in most cases and for most architectures,
8488 and is enabled by default when compiling with optimization for speed
8489 (@option{-O}, @option{-O2}, @dots{}).
8491 @item one
8492 Use all functions as a single region.  
8493 This typically results in the smallest code size, and is enabled by default for
8494 @option{-Os} or @option{-O0}.
8496 @end table
8498 @item -fira-hoist-pressure
8499 @opindex fira-hoist-pressure
8500 Use IRA to evaluate register pressure in the code hoisting pass for
8501 decisions to hoist expressions.  This option usually results in smaller
8502 code, but it can slow the compiler down.
8504 This option is enabled at level @option{-Os} for all targets.
8506 @item -fira-loop-pressure
8507 @opindex fira-loop-pressure
8508 Use IRA to evaluate register pressure in loops for decisions to move
8509 loop invariants.  This option usually results in generation
8510 of faster and smaller code on machines with large register files (>= 32
8511 registers), but it can slow the compiler down.
8513 This option is enabled at level @option{-O3} for some targets.
8515 @item -fno-ira-share-save-slots
8516 @opindex fno-ira-share-save-slots
8517 Disable sharing of stack slots used for saving call-used hard
8518 registers living through a call.  Each hard register gets a
8519 separate stack slot, and as a result function stack frames are
8520 larger.
8522 @item -fno-ira-share-spill-slots
8523 @opindex fno-ira-share-spill-slots
8524 Disable sharing of stack slots allocated for pseudo-registers.  Each
8525 pseudo-register that does not get a hard register gets a separate
8526 stack slot, and as a result function stack frames are larger.
8528 @item -flra-remat
8529 @opindex flra-remat
8530 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
8531 values of spilled pseudos, LRA tries to rematerialize (recalculate)
8532 values if it is profitable.
8534 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8536 @item -fdelayed-branch
8537 @opindex fdelayed-branch
8538 If supported for the target machine, attempt to reorder instructions
8539 to exploit instruction slots available after delayed branch
8540 instructions.
8542 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8544 @item -fschedule-insns
8545 @opindex fschedule-insns
8546 If supported for the target machine, attempt to reorder instructions to
8547 eliminate execution stalls due to required data being unavailable.  This
8548 helps machines that have slow floating point or memory load instructions
8549 by allowing other instructions to be issued until the result of the load
8550 or floating-point instruction is required.
8552 Enabled at levels @option{-O2}, @option{-O3}.
8554 @item -fschedule-insns2
8555 @opindex fschedule-insns2
8556 Similar to @option{-fschedule-insns}, but requests an additional pass of
8557 instruction scheduling after register allocation has been done.  This is
8558 especially useful on machines with a relatively small number of
8559 registers and where memory load instructions take more than one cycle.
8561 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8563 @item -fno-sched-interblock
8564 @opindex fno-sched-interblock
8565 Don't schedule instructions across basic blocks.  This is normally
8566 enabled by default when scheduling before register allocation, i.e.@:
8567 with @option{-fschedule-insns} or at @option{-O2} or higher.
8569 @item -fno-sched-spec
8570 @opindex fno-sched-spec
8571 Don't allow speculative motion of non-load instructions.  This is normally
8572 enabled by default when scheduling before register allocation, i.e.@:
8573 with @option{-fschedule-insns} or at @option{-O2} or higher.
8575 @item -fsched-pressure
8576 @opindex fsched-pressure
8577 Enable register pressure sensitive insn scheduling before register
8578 allocation.  This only makes sense when scheduling before register
8579 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
8580 @option{-O2} or higher.  Usage of this option can improve the
8581 generated code and decrease its size by preventing register pressure
8582 increase above the number of available hard registers and subsequent
8583 spills in register allocation.
8585 @item -fsched-spec-load
8586 @opindex fsched-spec-load
8587 Allow speculative motion of some load instructions.  This only makes
8588 sense when scheduling before register allocation, i.e.@: with
8589 @option{-fschedule-insns} or at @option{-O2} or higher.
8591 @item -fsched-spec-load-dangerous
8592 @opindex fsched-spec-load-dangerous
8593 Allow speculative motion of more load instructions.  This only makes
8594 sense when scheduling before register allocation, i.e.@: with
8595 @option{-fschedule-insns} or at @option{-O2} or higher.
8597 @item -fsched-stalled-insns
8598 @itemx -fsched-stalled-insns=@var{n}
8599 @opindex fsched-stalled-insns
8600 Define how many insns (if any) can be moved prematurely from the queue
8601 of stalled insns into the ready list during the second scheduling pass.
8602 @option{-fno-sched-stalled-insns} means that no insns are moved
8603 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
8604 on how many queued insns can be moved prematurely.
8605 @option{-fsched-stalled-insns} without a value is equivalent to
8606 @option{-fsched-stalled-insns=1}.
8608 @item -fsched-stalled-insns-dep
8609 @itemx -fsched-stalled-insns-dep=@var{n}
8610 @opindex fsched-stalled-insns-dep
8611 Define how many insn groups (cycles) are examined for a dependency
8612 on a stalled insn that is a candidate for premature removal from the queue
8613 of stalled insns.  This has an effect only during the second scheduling pass,
8614 and only if @option{-fsched-stalled-insns} is used.
8615 @option{-fno-sched-stalled-insns-dep} is equivalent to
8616 @option{-fsched-stalled-insns-dep=0}.
8617 @option{-fsched-stalled-insns-dep} without a value is equivalent to
8618 @option{-fsched-stalled-insns-dep=1}.
8620 @item -fsched2-use-superblocks
8621 @opindex fsched2-use-superblocks
8622 When scheduling after register allocation, use superblock scheduling.
8623 This allows motion across basic block boundaries,
8624 resulting in faster schedules.  This option is experimental, as not all machine
8625 descriptions used by GCC model the CPU closely enough to avoid unreliable
8626 results from the algorithm.
8628 This only makes sense when scheduling after register allocation, i.e.@: with
8629 @option{-fschedule-insns2} or at @option{-O2} or higher.
8631 @item -fsched-group-heuristic
8632 @opindex fsched-group-heuristic
8633 Enable the group heuristic in the scheduler.  This heuristic favors
8634 the instruction that belongs to a schedule group.  This is enabled
8635 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8636 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8638 @item -fsched-critical-path-heuristic
8639 @opindex fsched-critical-path-heuristic
8640 Enable the critical-path heuristic in the scheduler.  This heuristic favors
8641 instructions on the critical path.  This is enabled by default when
8642 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8643 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8645 @item -fsched-spec-insn-heuristic
8646 @opindex fsched-spec-insn-heuristic
8647 Enable the speculative instruction heuristic in the scheduler.  This
8648 heuristic favors speculative instructions with greater dependency weakness.
8649 This is enabled by default when scheduling is enabled, i.e.@:
8650 with @option{-fschedule-insns} or @option{-fschedule-insns2}
8651 or at @option{-O2} or higher.
8653 @item -fsched-rank-heuristic
8654 @opindex fsched-rank-heuristic
8655 Enable the rank heuristic in the scheduler.  This heuristic favors
8656 the instruction belonging to a basic block with greater size or frequency.
8657 This is enabled by default when scheduling is enabled, i.e.@:
8658 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8659 at @option{-O2} or higher.
8661 @item -fsched-last-insn-heuristic
8662 @opindex fsched-last-insn-heuristic
8663 Enable the last-instruction heuristic in the scheduler.  This heuristic
8664 favors the instruction that is less dependent on the last instruction
8665 scheduled.  This is enabled by default when scheduling is enabled,
8666 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8667 at @option{-O2} or higher.
8669 @item -fsched-dep-count-heuristic
8670 @opindex fsched-dep-count-heuristic
8671 Enable the dependent-count heuristic in the scheduler.  This heuristic
8672 favors the instruction that has more instructions depending on it.
8673 This is enabled by default when scheduling is enabled, i.e.@:
8674 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8675 at @option{-O2} or higher.
8677 @item -freschedule-modulo-scheduled-loops
8678 @opindex freschedule-modulo-scheduled-loops
8679 Modulo scheduling is performed before traditional scheduling.  If a loop
8680 is modulo scheduled, later scheduling passes may change its schedule.  
8681 Use this option to control that behavior.
8683 @item -fselective-scheduling
8684 @opindex fselective-scheduling
8685 Schedule instructions using selective scheduling algorithm.  Selective
8686 scheduling runs instead of the first scheduler pass.
8688 @item -fselective-scheduling2
8689 @opindex fselective-scheduling2
8690 Schedule instructions using selective scheduling algorithm.  Selective
8691 scheduling runs instead of the second scheduler pass.
8693 @item -fsel-sched-pipelining
8694 @opindex fsel-sched-pipelining
8695 Enable software pipelining of innermost loops during selective scheduling.
8696 This option has no effect unless one of @option{-fselective-scheduling} or
8697 @option{-fselective-scheduling2} is turned on.
8699 @item -fsel-sched-pipelining-outer-loops
8700 @opindex fsel-sched-pipelining-outer-loops
8701 When pipelining loops during selective scheduling, also pipeline outer loops.
8702 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
8704 @item -fsemantic-interposition
8705 @opindex fsemantic-interposition
8706 Some object formats, like ELF, allow interposing of symbols by the 
8707 dynamic linker.
8708 This means that for symbols exported from the DSO, the compiler cannot perform
8709 interprocedural propagation, inlining and other optimizations in anticipation
8710 that the function or variable in question may change. While this feature is
8711 useful, for example, to rewrite memory allocation functions by a debugging
8712 implementation, it is expensive in the terms of code quality.
8713 With @option{-fno-semantic-interposition} the compiler assumes that 
8714 if interposition happens for functions the overwriting function will have 
8715 precisely the same semantics (and side effects). 
8716 Similarly if interposition happens
8717 for variables, the constructor of the variable will be the same. The flag
8718 has no effect for functions explicitly declared inline 
8719 (where it is never allowed for interposition to change semantics) 
8720 and for symbols explicitly declared weak.
8722 @item -fshrink-wrap
8723 @opindex fshrink-wrap
8724 Emit function prologues only before parts of the function that need it,
8725 rather than at the top of the function.  This flag is enabled by default at
8726 @option{-O} and higher.
8728 @item -fshrink-wrap-separate
8729 @opindex fshrink-wrap-separate
8730 Shrink-wrap separate parts of the prologue and epilogue separately, so that
8731 those parts are only executed when needed.
8732 This option is on by default, but has no effect unless @option{-fshrink-wrap}
8733 is also turned on and the target supports this.
8735 @item -fcaller-saves
8736 @opindex fcaller-saves
8737 Enable allocation of values to registers that are clobbered by
8738 function calls, by emitting extra instructions to save and restore the
8739 registers around such calls.  Such allocation is done only when it
8740 seems to result in better code.
8742 This option is always enabled by default on certain machines, usually
8743 those which have no call-preserved registers to use instead.
8745 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8747 @item -fcombine-stack-adjustments
8748 @opindex fcombine-stack-adjustments
8749 Tracks stack adjustments (pushes and pops) and stack memory references
8750 and then tries to find ways to combine them.
8752 Enabled by default at @option{-O1} and higher.
8754 @item -fipa-ra
8755 @opindex fipa-ra
8756 Use caller save registers for allocation if those registers are not used by
8757 any called function.  In that case it is not necessary to save and restore
8758 them around calls.  This is only possible if called functions are part of
8759 same compilation unit as current function and they are compiled before it.
8761 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}, however the option
8762 is disabled if generated code will be instrumented for profiling
8763 (@option{-p}, or @option{-pg}) or if callee's register usage cannot be known
8764 exactly (this happens on targets that do not expose prologues
8765 and epilogues in RTL).
8767 @item -fconserve-stack
8768 @opindex fconserve-stack
8769 Attempt to minimize stack usage.  The compiler attempts to use less
8770 stack space, even if that makes the program slower.  This option
8771 implies setting the @option{large-stack-frame} parameter to 100
8772 and the @option{large-stack-frame-growth} parameter to 400.
8774 @item -ftree-reassoc
8775 @opindex ftree-reassoc
8776 Perform reassociation on trees.  This flag is enabled by default
8777 at @option{-O} and higher.
8779 @item -fcode-hoisting
8780 @opindex fcode-hoisting
8781 Perform code hoisting.  Code hoisting tries to move the
8782 evaluation of expressions executed on all paths to the function exit
8783 as early as possible.  This is especially useful as a code size
8784 optimization, but it often helps for code speed as well.
8785 This flag is enabled by default at @option{-O2} and higher.
8787 @item -ftree-pre
8788 @opindex ftree-pre
8789 Perform partial redundancy elimination (PRE) on trees.  This flag is
8790 enabled by default at @option{-O2} and @option{-O3}.
8792 @item -ftree-partial-pre
8793 @opindex ftree-partial-pre
8794 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8795 enabled by default at @option{-O3}.
8797 @item -ftree-forwprop
8798 @opindex ftree-forwprop
8799 Perform forward propagation on trees.  This flag is enabled by default
8800 at @option{-O} and higher.
8802 @item -ftree-fre
8803 @opindex ftree-fre
8804 Perform full redundancy elimination (FRE) on trees.  The difference
8805 between FRE and PRE is that FRE only considers expressions
8806 that are computed on all paths leading to the redundant computation.
8807 This analysis is faster than PRE, though it exposes fewer redundancies.
8808 This flag is enabled by default at @option{-O} and higher.
8810 @item -ftree-phiprop
8811 @opindex ftree-phiprop
8812 Perform hoisting of loads from conditional pointers on trees.  This
8813 pass is enabled by default at @option{-O} and higher.
8815 @item -fhoist-adjacent-loads
8816 @opindex fhoist-adjacent-loads
8817 Speculatively hoist loads from both branches of an if-then-else if the
8818 loads are from adjacent locations in the same structure and the target
8819 architecture has a conditional move instruction.  This flag is enabled
8820 by default at @option{-O2} and higher.
8822 @item -ftree-copy-prop
8823 @opindex ftree-copy-prop
8824 Perform copy propagation on trees.  This pass eliminates unnecessary
8825 copy operations.  This flag is enabled by default at @option{-O} and
8826 higher.
8828 @item -fipa-pure-const
8829 @opindex fipa-pure-const
8830 Discover which functions are pure or constant.
8831 Enabled by default at @option{-O} and higher.
8833 @item -fipa-reference
8834 @opindex fipa-reference
8835 Discover which static variables do not escape the
8836 compilation unit.
8837 Enabled by default at @option{-O} and higher.
8839 @item -fipa-pta
8840 @opindex fipa-pta
8841 Perform interprocedural pointer analysis and interprocedural modification
8842 and reference analysis.  This option can cause excessive memory and
8843 compile-time usage on large compilation units.  It is not enabled by
8844 default at any optimization level.
8846 @item -fipa-profile
8847 @opindex fipa-profile
8848 Perform interprocedural profile propagation.  The functions called only from
8849 cold functions are marked as cold. Also functions executed once (such as
8850 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
8851 functions and loop less parts of functions executed once are then optimized for
8852 size.
8853 Enabled by default at @option{-O} and higher.
8855 @item -fipa-cp
8856 @opindex fipa-cp
8857 Perform interprocedural constant propagation.
8858 This optimization analyzes the program to determine when values passed
8859 to functions are constants and then optimizes accordingly.
8860 This optimization can substantially increase performance
8861 if the application has constants passed to functions.
8862 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
8864 @item -fipa-cp-clone
8865 @opindex fipa-cp-clone
8866 Perform function cloning to make interprocedural constant propagation stronger.
8867 When enabled, interprocedural constant propagation performs function cloning
8868 when externally visible function can be called with constant arguments.
8869 Because this optimization can create multiple copies of functions,
8870 it may significantly increase code size
8871 (see @option{--param ipcp-unit-growth=@var{value}}).
8872 This flag is enabled by default at @option{-O3}.
8874 @item -fipa-bit-cp
8875 @opindex -fipa-bit-cp
8876 When enabled, perform interprocedural bitwise constant
8877 propagation. This flag is enabled by default at @option{-O2}. It
8878 requires that @option{-fipa-cp} is enabled.
8880 @item -fipa-vrp
8881 @opindex -fipa-vrp
8882 When enabled, perform interprocedural propagation of value
8883 ranges. This flag is enabled by default at @option{-O2}. It requires
8884 that @option{-fipa-cp} is enabled.
8886 @item -fipa-icf
8887 @opindex fipa-icf
8888 Perform Identical Code Folding for functions and read-only variables.
8889 The optimization reduces code size and may disturb unwind stacks by replacing
8890 a function by equivalent one with a different name. The optimization works
8891 more effectively with link-time optimization enabled.
8893 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
8894 works on different levels and thus the optimizations are not same - there are
8895 equivalences that are found only by GCC and equivalences found only by Gold.
8897 This flag is enabled by default at @option{-O2} and @option{-Os}.
8899 @item -fisolate-erroneous-paths-dereference
8900 @opindex fisolate-erroneous-paths-dereference
8901 Detect paths that trigger erroneous or undefined behavior due to
8902 dereferencing a null pointer.  Isolate those paths from the main control
8903 flow and turn the statement with erroneous or undefined behavior into a trap.
8904 This flag is enabled by default at @option{-O2} and higher and depends on
8905 @option{-fdelete-null-pointer-checks} also being enabled.
8907 @item -fisolate-erroneous-paths-attribute
8908 @opindex fisolate-erroneous-paths-attribute
8909 Detect paths that trigger erroneous or undefined behavior due to a null value
8910 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
8911 attribute.  Isolate those paths from the main control flow and turn the
8912 statement with erroneous or undefined behavior into a trap.  This is not
8913 currently enabled, but may be enabled by @option{-O2} in the future.
8915 @item -ftree-sink
8916 @opindex ftree-sink
8917 Perform forward store motion on trees.  This flag is
8918 enabled by default at @option{-O} and higher.
8920 @item -ftree-bit-ccp
8921 @opindex ftree-bit-ccp
8922 Perform sparse conditional bit constant propagation on trees and propagate
8923 pointer alignment information.
8924 This pass only operates on local scalar variables and is enabled by default
8925 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
8927 @item -ftree-ccp
8928 @opindex ftree-ccp
8929 Perform sparse conditional constant propagation (CCP) on trees.  This
8930 pass only operates on local scalar variables and is enabled by default
8931 at @option{-O} and higher.
8933 @item -fssa-backprop
8934 @opindex fssa-backprop
8935 Propagate information about uses of a value up the definition chain
8936 in order to simplify the definitions.  For example, this pass strips
8937 sign operations if the sign of a value never matters.  The flag is
8938 enabled by default at @option{-O} and higher.
8940 @item -fssa-phiopt
8941 @opindex fssa-phiopt
8942 Perform pattern matching on SSA PHI nodes to optimize conditional
8943 code.  This pass is enabled by default at @option{-O} and higher.
8945 @item -ftree-switch-conversion
8946 @opindex ftree-switch-conversion
8947 Perform conversion of simple initializations in a switch to
8948 initializations from a scalar array.  This flag is enabled by default
8949 at @option{-O2} and higher.
8951 @item -ftree-tail-merge
8952 @opindex ftree-tail-merge
8953 Look for identical code sequences.  When found, replace one with a jump to the
8954 other.  This optimization is known as tail merging or cross jumping.  This flag
8955 is enabled by default at @option{-O2} and higher.  The compilation time
8956 in this pass can
8957 be limited using @option{max-tail-merge-comparisons} parameter and
8958 @option{max-tail-merge-iterations} parameter.
8960 @item -ftree-dce
8961 @opindex ftree-dce
8962 Perform dead code elimination (DCE) on trees.  This flag is enabled by
8963 default at @option{-O} and higher.
8965 @item -ftree-builtin-call-dce
8966 @opindex ftree-builtin-call-dce
8967 Perform conditional dead code elimination (DCE) for calls to built-in functions
8968 that may set @code{errno} but are otherwise free of side effects.  This flag is
8969 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8970 specified.
8972 @item -ftree-dominator-opts
8973 @opindex ftree-dominator-opts
8974 Perform a variety of simple scalar cleanups (constant/copy
8975 propagation, redundancy elimination, range propagation and expression
8976 simplification) based on a dominator tree traversal.  This also
8977 performs jump threading (to reduce jumps to jumps). This flag is
8978 enabled by default at @option{-O} and higher.
8980 @item -ftree-dse
8981 @opindex ftree-dse
8982 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8983 a memory location that is later overwritten by another store without
8984 any intervening loads.  In this case the earlier store can be deleted.  This
8985 flag is enabled by default at @option{-O} and higher.
8987 @item -ftree-ch
8988 @opindex ftree-ch
8989 Perform loop header copying on trees.  This is beneficial since it increases
8990 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8991 is enabled by default at @option{-O} and higher.  It is not enabled
8992 for @option{-Os}, since it usually increases code size.
8994 @item -ftree-loop-optimize
8995 @opindex ftree-loop-optimize
8996 Perform loop optimizations on trees.  This flag is enabled by default
8997 at @option{-O} and higher.
8999 @item -ftree-loop-linear
9000 @itemx -floop-strip-mine
9001 @itemx -floop-block
9002 @opindex ftree-loop-linear
9003 @opindex floop-strip-mine
9004 @opindex floop-block
9005 Perform loop nest optimizations.  Same as
9006 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
9007 to be configured with @option{--with-isl} to enable the Graphite loop
9008 transformation infrastructure.
9010 @item -fgraphite-identity
9011 @opindex fgraphite-identity
9012 Enable the identity transformation for graphite.  For every SCoP we generate
9013 the polyhedral representation and transform it back to gimple.  Using
9014 @option{-fgraphite-identity} we can check the costs or benefits of the
9015 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
9016 are also performed by the code generator isl, like index splitting and
9017 dead code elimination in loops.
9019 @item -floop-nest-optimize
9020 @opindex floop-nest-optimize
9021 Enable the isl based loop nest optimizer.  This is a generic loop nest
9022 optimizer based on the Pluto optimization algorithms.  It calculates a loop
9023 structure optimized for data-locality and parallelism.  This option
9024 is experimental.
9026 @item -floop-parallelize-all
9027 @opindex floop-parallelize-all
9028 Use the Graphite data dependence analysis to identify loops that can
9029 be parallelized.  Parallelize all the loops that can be analyzed to
9030 not contain loop carried dependences without checking that it is
9031 profitable to parallelize the loops.
9033 @item -ftree-coalesce-vars
9034 @opindex ftree-coalesce-vars
9035 While transforming the program out of the SSA representation, attempt to
9036 reduce copying by coalescing versions of different user-defined
9037 variables, instead of just compiler temporaries.  This may severely
9038 limit the ability to debug an optimized program compiled with
9039 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
9040 prevents SSA coalescing of user variables.  This option is enabled by
9041 default if optimization is enabled, and it does very little otherwise.
9043 @item -ftree-loop-if-convert
9044 @opindex ftree-loop-if-convert
9045 Attempt to transform conditional jumps in the innermost loops to
9046 branch-less equivalents.  The intent is to remove control-flow from
9047 the innermost loops in order to improve the ability of the
9048 vectorization pass to handle these loops.  This is enabled by default
9049 if vectorization is enabled.
9051 @item -ftree-loop-distribution
9052 @opindex ftree-loop-distribution
9053 Perform loop distribution.  This flag can improve cache performance on
9054 big loop bodies and allow further loop optimizations, like
9055 parallelization or vectorization, to take place.  For example, the loop
9056 @smallexample
9057 DO I = 1, N
9058   A(I) = B(I) + C
9059   D(I) = E(I) * F
9060 ENDDO
9061 @end smallexample
9062 is transformed to
9063 @smallexample
9064 DO I = 1, N
9065    A(I) = B(I) + C
9066 ENDDO
9067 DO I = 1, N
9068    D(I) = E(I) * F
9069 ENDDO
9070 @end smallexample
9072 @item -ftree-loop-distribute-patterns
9073 @opindex ftree-loop-distribute-patterns
9074 Perform loop distribution of patterns that can be code generated with
9075 calls to a library.  This flag is enabled by default at @option{-O3}.
9077 This pass distributes the initialization loops and generates a call to
9078 memset zero.  For example, the loop
9079 @smallexample
9080 DO I = 1, N
9081   A(I) = 0
9082   B(I) = A(I) + I
9083 ENDDO
9084 @end smallexample
9085 is transformed to
9086 @smallexample
9087 DO I = 1, N
9088    A(I) = 0
9089 ENDDO
9090 DO I = 1, N
9091    B(I) = A(I) + I
9092 ENDDO
9093 @end smallexample
9094 and the initialization loop is transformed into a call to memset zero.
9096 @item -floop-interchange
9097 @opindex floop-interchange
9098 Perform loop interchange outside of graphite.  This flag can improve cache
9099 performance on loop nest and allow further loop optimizations, like
9100 vectorization, to take place.  For example, the loop
9101 @smallexample
9102 for (int i = 0; i < N; i++)
9103   for (int j = 0; j < N; j++)
9104     for (int k = 0; k < N; k++)
9105       c[i][j] = c[i][j] + a[i][k]*b[k][j];
9106 @end smallexample
9107 is transformed to
9108 @smallexample
9109 for (int i = 0; i < N; i++)
9110   for (int k = 0; k < N; k++)
9111     for (int j = 0; j < N; j++)
9112       c[i][j] = c[i][j] + a[i][k]*b[k][j];
9113 @end smallexample
9114 This flag is enabled by default at @option{-O3}.
9116 @item -floop-unroll-and-jam
9117 @opindex floop-unroll-and-jam
9118 Apply unroll and jam transformations on feasible loops.  In a loop
9119 nest this unrolls the outer loop by some factor and fuses the resulting
9120 multiple inner loops.  This flag is enabled by default at @option{-O3}.
9122 @item -ftree-loop-im
9123 @opindex ftree-loop-im
9124 Perform loop invariant motion on trees.  This pass moves only invariants that
9125 are hard to handle at RTL level (function calls, operations that expand to
9126 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
9127 operands of conditions that are invariant out of the loop, so that we can use
9128 just trivial invariantness analysis in loop unswitching.  The pass also includes
9129 store motion.
9131 @item -ftree-loop-ivcanon
9132 @opindex ftree-loop-ivcanon
9133 Create a canonical counter for number of iterations in loops for which
9134 determining number of iterations requires complicated analysis.  Later
9135 optimizations then may determine the number easily.  Useful especially
9136 in connection with unrolling.
9138 @item -ftree-scev-cprop
9139 @opindex ftree-scev-cprop
9140 Perform final value replacement.  If a variable is modified in a loop
9141 in such a way that its value when exiting the loop can be determined using
9142 only its initial value and the number of loop iterations, replace uses of
9143 the final value by such a computation, provided it is sufficiently cheap.
9144 This reduces data dependencies and may allow further simplifications.
9145 Enabled by default at @option{-O} and higher.
9147 @item -fivopts
9148 @opindex fivopts
9149 Perform induction variable optimizations (strength reduction, induction
9150 variable merging and induction variable elimination) on trees.
9152 @item -ftree-parallelize-loops=n
9153 @opindex ftree-parallelize-loops
9154 Parallelize loops, i.e., split their iteration space to run in n threads.
9155 This is only possible for loops whose iterations are independent
9156 and can be arbitrarily reordered.  The optimization is only
9157 profitable on multiprocessor machines, for loops that are CPU-intensive,
9158 rather than constrained e.g.@: by memory bandwidth.  This option
9159 implies @option{-pthread}, and thus is only supported on targets
9160 that have support for @option{-pthread}.
9162 @item -ftree-pta
9163 @opindex ftree-pta
9164 Perform function-local points-to analysis on trees.  This flag is
9165 enabled by default at @option{-O} and higher.
9167 @item -ftree-sra
9168 @opindex ftree-sra
9169 Perform scalar replacement of aggregates.  This pass replaces structure
9170 references with scalars to prevent committing structures to memory too
9171 early.  This flag is enabled by default at @option{-O} and higher.
9173 @item -fstore-merging
9174 @opindex fstore-merging
9175 Perform merging of narrow stores to consecutive memory addresses.  This pass
9176 merges contiguous stores of immediate values narrower than a word into fewer
9177 wider stores to reduce the number of instructions.  This is enabled by default
9178 at @option{-O2} and higher as well as @option{-Os}.
9180 @item -ftree-ter
9181 @opindex ftree-ter
9182 Perform temporary expression replacement during the SSA->normal phase.  Single
9183 use/single def temporaries are replaced at their use location with their
9184 defining expression.  This results in non-GIMPLE code, but gives the expanders
9185 much more complex trees to work on resulting in better RTL generation.  This is
9186 enabled by default at @option{-O} and higher.
9188 @item -ftree-slsr
9189 @opindex ftree-slsr
9190 Perform straight-line strength reduction on trees.  This recognizes related
9191 expressions involving multiplications and replaces them by less expensive
9192 calculations when possible.  This is enabled by default at @option{-O} and
9193 higher.
9195 @item -ftree-vectorize
9196 @opindex ftree-vectorize
9197 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
9198 and @option{-ftree-slp-vectorize} if not explicitly specified.
9200 @item -ftree-loop-vectorize
9201 @opindex ftree-loop-vectorize
9202 Perform loop vectorization on trees. This flag is enabled by default at
9203 @option{-O3} and when @option{-ftree-vectorize} is enabled.
9205 @item -ftree-slp-vectorize
9206 @opindex ftree-slp-vectorize
9207 Perform basic block vectorization on trees. This flag is enabled by default at
9208 @option{-O3} and when @option{-ftree-vectorize} is enabled.
9210 @item -fvect-cost-model=@var{model}
9211 @opindex fvect-cost-model
9212 Alter the cost model used for vectorization.  The @var{model} argument
9213 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
9214 With the @samp{unlimited} model the vectorized code-path is assumed
9215 to be profitable while with the @samp{dynamic} model a runtime check
9216 guards the vectorized code-path to enable it only for iteration
9217 counts that will likely execute faster than when executing the original
9218 scalar loop.  The @samp{cheap} model disables vectorization of
9219 loops where doing so would be cost prohibitive for example due to
9220 required runtime checks for data dependence or alignment but otherwise
9221 is equal to the @samp{dynamic} model.
9222 The default cost model depends on other optimization flags and is
9223 either @samp{dynamic} or @samp{cheap}.
9225 @item -fsimd-cost-model=@var{model}
9226 @opindex fsimd-cost-model
9227 Alter the cost model used for vectorization of loops marked with the OpenMP
9228 simd directive.  The @var{model} argument should be one of
9229 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
9230 have the same meaning as described in @option{-fvect-cost-model} and by
9231 default a cost model defined with @option{-fvect-cost-model} is used.
9233 @item -ftree-vrp
9234 @opindex ftree-vrp
9235 Perform Value Range Propagation on trees.  This is similar to the
9236 constant propagation pass, but instead of values, ranges of values are
9237 propagated.  This allows the optimizers to remove unnecessary range
9238 checks like array bound checks and null pointer checks.  This is
9239 enabled by default at @option{-O2} and higher.  Null pointer check
9240 elimination is only done if @option{-fdelete-null-pointer-checks} is
9241 enabled.
9243 @item -fsplit-paths
9244 @opindex fsplit-paths
9245 Split paths leading to loop backedges.  This can improve dead code
9246 elimination and common subexpression elimination.  This is enabled by
9247 default at @option{-O2} and above.
9249 @item -fsplit-ivs-in-unroller
9250 @opindex fsplit-ivs-in-unroller
9251 Enables expression of values of induction variables in later iterations
9252 of the unrolled loop using the value in the first iteration.  This breaks
9253 long dependency chains, thus improving efficiency of the scheduling passes.
9255 A combination of @option{-fweb} and CSE is often sufficient to obtain the
9256 same effect.  However, that is not reliable in cases where the loop body
9257 is more complicated than a single basic block.  It also does not work at all
9258 on some architectures due to restrictions in the CSE pass.
9260 This optimization is enabled by default.
9262 @item -fvariable-expansion-in-unroller
9263 @opindex fvariable-expansion-in-unroller
9264 With this option, the compiler creates multiple copies of some
9265 local variables when unrolling a loop, which can result in superior code.
9267 @item -fpartial-inlining
9268 @opindex fpartial-inlining
9269 Inline parts of functions.  This option has any effect only
9270 when inlining itself is turned on by the @option{-finline-functions}
9271 or @option{-finline-small-functions} options.
9273 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9275 @item -fpredictive-commoning
9276 @opindex fpredictive-commoning
9277 Perform predictive commoning optimization, i.e., reusing computations
9278 (especially memory loads and stores) performed in previous
9279 iterations of loops.
9281 This option is enabled at level @option{-O3}.
9283 @item -fprefetch-loop-arrays
9284 @opindex fprefetch-loop-arrays
9285 If supported by the target machine, generate instructions to prefetch
9286 memory to improve the performance of loops that access large arrays.
9288 This option may generate better or worse code; results are highly
9289 dependent on the structure of loops within the source code.
9291 Disabled at level @option{-Os}.
9293 @item -fno-printf-return-value
9294 @opindex fno-printf-return-value
9295 Do not substitute constants for known return value of formatted output
9296 functions such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and
9297 @code{vsnprintf} (but not @code{printf} of @code{fprintf}).  This
9298 transformation allows GCC to optimize or even eliminate branches based
9299 on the known return value of these functions called with arguments that
9300 are either constant, or whose values are known to be in a range that
9301 makes determining the exact return value possible.  For example, when
9302 @option{-fprintf-return-value} is in effect, both the branch and the
9303 body of the @code{if} statement (but not the call to @code{snprint})
9304 can be optimized away when @code{i} is a 32-bit or smaller integer
9305 because the return value is guaranteed to be at most 8.
9307 @smallexample
9308 char buf[9];
9309 if (snprintf (buf, "%08x", i) >= sizeof buf)
9310   @dots{}
9311 @end smallexample
9313 The @option{-fprintf-return-value} option relies on other optimizations
9314 and yields best results with @option{-O2} and above.  It works in tandem
9315 with the @option{-Wformat-overflow} and @option{-Wformat-truncation}
9316 options.  The @option{-fprintf-return-value} option is enabled by default.
9318 @item -fno-peephole
9319 @itemx -fno-peephole2
9320 @opindex fno-peephole
9321 @opindex fno-peephole2
9322 Disable any machine-specific peephole optimizations.  The difference
9323 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
9324 are implemented in the compiler; some targets use one, some use the
9325 other, a few use both.
9327 @option{-fpeephole} is enabled by default.
9328 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9330 @item -fno-guess-branch-probability
9331 @opindex fno-guess-branch-probability
9332 Do not guess branch probabilities using heuristics.
9334 GCC uses heuristics to guess branch probabilities if they are
9335 not provided by profiling feedback (@option{-fprofile-arcs}).  These
9336 heuristics are based on the control flow graph.  If some branch probabilities
9337 are specified by @code{__builtin_expect}, then the heuristics are
9338 used to guess branch probabilities for the rest of the control flow graph,
9339 taking the @code{__builtin_expect} info into account.  The interactions
9340 between the heuristics and @code{__builtin_expect} can be complex, and in
9341 some cases, it may be useful to disable the heuristics so that the effects
9342 of @code{__builtin_expect} are easier to understand.
9344 It is also possible to specify expected probability of the expression
9345 with @code{__builtin_expect_with_probability} built-in function.
9347 The default is @option{-fguess-branch-probability} at levels
9348 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9350 @item -freorder-blocks
9351 @opindex freorder-blocks
9352 Reorder basic blocks in the compiled function in order to reduce number of
9353 taken branches and improve code locality.
9355 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9357 @item -freorder-blocks-algorithm=@var{algorithm}
9358 @opindex freorder-blocks-algorithm
9359 Use the specified algorithm for basic block reordering.  The
9360 @var{algorithm} argument can be @samp{simple}, which does not increase
9361 code size (except sometimes due to secondary effects like alignment),
9362 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
9363 put all often executed code together, minimizing the number of branches
9364 executed by making extra copies of code.
9366 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
9367 @samp{stc} at levels @option{-O2}, @option{-O3}.
9369 @item -freorder-blocks-and-partition
9370 @opindex freorder-blocks-and-partition
9371 In addition to reordering basic blocks in the compiled function, in order
9372 to reduce number of taken branches, partitions hot and cold basic blocks
9373 into separate sections of the assembly and @file{.o} files, to improve
9374 paging and cache locality performance.
9376 This optimization is automatically turned off in the presence of
9377 exception handling or unwind tables (on targets using setjump/longjump or target specific scheme), for linkonce sections, for functions with a user-defined
9378 section attribute and on any architecture that does not support named
9379 sections.  When @option{-fsplit-stack} is used this option is not
9380 enabled by default (to avoid linker errors), but may be enabled
9381 explicitly (if using a working linker).
9383 Enabled for x86 at levels @option{-O2}, @option{-O3}, @option{-Os}.
9385 @item -freorder-functions
9386 @opindex freorder-functions
9387 Reorder functions in the object file in order to
9388 improve code locality.  This is implemented by using special
9389 subsections @code{.text.hot} for most frequently executed functions and
9390 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
9391 the linker so object file format must support named sections and linker must
9392 place them in a reasonable way.
9394 Also profile feedback must be available to make this option effective.  See
9395 @option{-fprofile-arcs} for details.
9397 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9399 @item -fstrict-aliasing
9400 @opindex fstrict-aliasing
9401 Allow the compiler to assume the strictest aliasing rules applicable to
9402 the language being compiled.  For C (and C++), this activates
9403 optimizations based on the type of expressions.  In particular, an
9404 object of one type is assumed never to reside at the same address as an
9405 object of a different type, unless the types are almost the same.  For
9406 example, an @code{unsigned int} can alias an @code{int}, but not a
9407 @code{void*} or a @code{double}.  A character type may alias any other
9408 type.
9410 @anchor{Type-punning}Pay special attention to code like this:
9411 @smallexample
9412 union a_union @{
9413   int i;
9414   double d;
9417 int f() @{
9418   union a_union t;
9419   t.d = 3.0;
9420   return t.i;
9422 @end smallexample
9423 The practice of reading from a different union member than the one most
9424 recently written to (called ``type-punning'') is common.  Even with
9425 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
9426 is accessed through the union type.  So, the code above works as
9427 expected.  @xref{Structures unions enumerations and bit-fields
9428 implementation}.  However, this code might not:
9429 @smallexample
9430 int f() @{
9431   union a_union t;
9432   int* ip;
9433   t.d = 3.0;
9434   ip = &t.i;
9435   return *ip;
9437 @end smallexample
9439 Similarly, access by taking the address, casting the resulting pointer
9440 and dereferencing the result has undefined behavior, even if the cast
9441 uses a union type, e.g.:
9442 @smallexample
9443 int f() @{
9444   double d = 3.0;
9445   return ((union a_union *) &d)->i;
9447 @end smallexample
9449 The @option{-fstrict-aliasing} option is enabled at levels
9450 @option{-O2}, @option{-O3}, @option{-Os}.
9452 @item -falign-functions
9453 @itemx -falign-functions=@var{n}
9454 @itemx -falign-functions=@var{n}:@var{m}
9455 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}
9456 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}:@var{m2}
9457 @opindex falign-functions
9458 Align the start of functions to the next power-of-two greater than
9459 @var{n}, skipping up to @var{m}-1 bytes.  This ensures that at least
9460 the first @var{m} bytes of the function can be fetched by the CPU
9461 without crossing an @var{n}-byte alignment boundary.
9463 If @var{m} is not specified, it defaults to @var{n}.
9465 Examples: @option{-falign-functions=32} aligns functions to the next
9466 32-byte boundary, @option{-falign-functions=24} aligns to the next
9467 32-byte boundary only if this can be done by skipping 23 bytes or less,
9468 @option{-falign-functions=32:7} aligns to the next
9469 32-byte boundary only if this can be done by skipping 6 bytes or less.
9471 The second pair of @var{n2}:@var{m2} values allows you to specify
9472 a secondary alignment: @option{-falign-functions=64:7:32:3} aligns to
9473 the next 64-byte boundary if this can be done by skipping 6 bytes or less,
9474 otherwise aligns to the next 32-byte boundary if this can be done
9475 by skipping 2 bytes or less.
9476 If @var{m2} is not specified, it defaults to @var{n2}.
9478 Some assemblers only support this flag when @var{n} is a power of two;
9479 in that case, it is rounded up.
9481 @option{-fno-align-functions} and @option{-falign-functions=1} are
9482 equivalent and mean that functions are not aligned.
9484 If @var{n} is not specified or is zero, use a machine-dependent default.
9485 The maximum allowed @var{n} option value is 65536.
9487 Enabled at levels @option{-O2}, @option{-O3}.
9489 @item -flimit-function-alignment
9490 If this option is enabled, the compiler tries to avoid unnecessarily
9491 overaligning functions. It attempts to instruct the assembler to align
9492 by the amount specified by @option{-falign-functions}, but not to
9493 skip more bytes than the size of the function.
9495 @item -falign-labels
9496 @itemx -falign-labels=@var{n}
9497 @itemx -falign-labels=@var{n}:@var{m}
9498 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}
9499 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}:@var{m2}
9500 @opindex falign-labels
9501 Align all branch targets to a power-of-two boundary.
9503 Parameters of this option are analogous to the @option{-falign-functions} option.
9504 @option{-fno-align-labels} and @option{-falign-labels=1} are
9505 equivalent and mean that labels are not aligned.
9507 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
9508 are greater than this value, then their values are used instead.
9510 If @var{n} is not specified or is zero, use a machine-dependent default
9511 which is very likely to be @samp{1}, meaning no alignment.
9512 The maximum allowed @var{n} option value is 65536.
9514 Enabled at levels @option{-O2}, @option{-O3}.
9516 @item -falign-loops
9517 @itemx -falign-loops=@var{n}
9518 @itemx -falign-loops=@var{n}:@var{m}
9519 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}
9520 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}:@var{m2}
9521 @opindex falign-loops
9522 Align loops to a power-of-two boundary.  If the loops are executed
9523 many times, this makes up for any execution of the dummy padding
9524 instructions.
9526 Parameters of this option are analogous to the @option{-falign-functions} option.
9527 @option{-fno-align-loops} and @option{-falign-loops=1} are
9528 equivalent and mean that loops are not aligned.
9529 The maximum allowed @var{n} option value is 65536.
9531 If @var{n} is not specified or is zero, use a machine-dependent default.
9533 Enabled at levels @option{-O2}, @option{-O3}.
9535 @item -falign-jumps
9536 @itemx -falign-jumps=@var{n}
9537 @itemx -falign-jumps=@var{n}:@var{m}
9538 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}
9539 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}:@var{m2}
9540 @opindex falign-jumps
9541 Align branch targets to a power-of-two boundary, for branch targets
9542 where the targets can only be reached by jumping.  In this case,
9543 no dummy operations need be executed.
9545 Parameters of this option are analogous to the @option{-falign-functions} option.
9546 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
9547 equivalent and mean that loops are not aligned.
9549 If @var{n} is not specified or is zero, use a machine-dependent default.
9550 The maximum allowed @var{n} option value is 65536.
9552 Enabled at levels @option{-O2}, @option{-O3}.
9554 @item -funit-at-a-time
9555 @opindex funit-at-a-time
9556 This option is left for compatibility reasons. @option{-funit-at-a-time}
9557 has no effect, while @option{-fno-unit-at-a-time} implies
9558 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
9560 Enabled by default.
9562 @item -fno-toplevel-reorder
9563 @opindex fno-toplevel-reorder
9564 Do not reorder top-level functions, variables, and @code{asm}
9565 statements.  Output them in the same order that they appear in the
9566 input file.  When this option is used, unreferenced static variables
9567 are not removed.  This option is intended to support existing code
9568 that relies on a particular ordering.  For new code, it is better to
9569 use attributes when possible.
9571 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
9572 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
9573 targets.
9575 @item -fweb
9576 @opindex fweb
9577 Constructs webs as commonly used for register allocation purposes and assign
9578 each web individual pseudo register.  This allows the register allocation pass
9579 to operate on pseudos directly, but also strengthens several other optimization
9580 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
9581 however, make debugging impossible, since variables no longer stay in a
9582 ``home register''.
9584 Enabled by default with @option{-funroll-loops}.
9586 @item -fwhole-program
9587 @opindex fwhole-program
9588 Assume that the current compilation unit represents the whole program being
9589 compiled.  All public functions and variables with the exception of @code{main}
9590 and those merged by attribute @code{externally_visible} become static functions
9591 and in effect are optimized more aggressively by interprocedural optimizers.
9593 This option should not be used in combination with @option{-flto}.
9594 Instead relying on a linker plugin should provide safer and more precise
9595 information.
9597 @item -flto[=@var{n}]
9598 @opindex flto
9599 This option runs the standard link-time optimizer.  When invoked
9600 with source code, it generates GIMPLE (one of GCC's internal
9601 representations) and writes it to special ELF sections in the object
9602 file.  When the object files are linked together, all the function
9603 bodies are read from these ELF sections and instantiated as if they
9604 had been part of the same translation unit.
9606 To use the link-time optimizer, @option{-flto} and optimization
9607 options should be specified at compile time and during the final link.
9608 It is recommended that you compile all the files participating in the
9609 same link with the same options and also specify those options at
9610 link time.  
9611 For example:
9613 @smallexample
9614 gcc -c -O2 -flto foo.c
9615 gcc -c -O2 -flto bar.c
9616 gcc -o myprog -flto -O2 foo.o bar.o
9617 @end smallexample
9619 The first two invocations to GCC save a bytecode representation
9620 of GIMPLE into special ELF sections inside @file{foo.o} and
9621 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
9622 @file{foo.o} and @file{bar.o}, merges the two files into a single
9623 internal image, and compiles the result as usual.  Since both
9624 @file{foo.o} and @file{bar.o} are merged into a single image, this
9625 causes all the interprocedural analyses and optimizations in GCC to
9626 work across the two files as if they were a single one.  This means,
9627 for example, that the inliner is able to inline functions in
9628 @file{bar.o} into functions in @file{foo.o} and vice-versa.
9630 Another (simpler) way to enable link-time optimization is:
9632 @smallexample
9633 gcc -o myprog -flto -O2 foo.c bar.c
9634 @end smallexample
9636 The above generates bytecode for @file{foo.c} and @file{bar.c},
9637 merges them together into a single GIMPLE representation and optimizes
9638 them as usual to produce @file{myprog}.
9640 The only important thing to keep in mind is that to enable link-time
9641 optimizations you need to use the GCC driver to perform the link step.
9642 GCC then automatically performs link-time optimization if any of the
9643 objects involved were compiled with the @option{-flto} command-line option.  
9644 You generally
9645 should specify the optimization options to be used for link-time
9646 optimization though GCC tries to be clever at guessing an
9647 optimization level to use from the options used at compile time
9648 if you fail to specify one at link time.  You can always override
9649 the automatic decision to do link-time optimization
9650 by passing @option{-fno-lto} to the link command.
9652 To make whole program optimization effective, it is necessary to make
9653 certain whole program assumptions.  The compiler needs to know
9654 what functions and variables can be accessed by libraries and runtime
9655 outside of the link-time optimized unit.  When supported by the linker,
9656 the linker plugin (see @option{-fuse-linker-plugin}) passes information
9657 to the compiler about used and externally visible symbols.  When
9658 the linker plugin is not available, @option{-fwhole-program} should be
9659 used to allow the compiler to make these assumptions, which leads
9660 to more aggressive optimization decisions.
9662 When @option{-fuse-linker-plugin} is not enabled, when a file is
9663 compiled with @option{-flto}, the generated object file is larger than
9664 a regular object file because it contains GIMPLE bytecodes and the usual
9665 final code (see @option{-ffat-lto-objects}.  This means that
9666 object files with LTO information can be linked as normal object
9667 files; if @option{-fno-lto} is passed to the linker, no
9668 interprocedural optimizations are applied.  Note that when
9669 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
9670 but you cannot perform a regular, non-LTO link on them.
9672 Additionally, the optimization flags used to compile individual files
9673 are not necessarily related to those used at link time.  For instance,
9675 @smallexample
9676 gcc -c -O0 -ffat-lto-objects -flto foo.c
9677 gcc -c -O0 -ffat-lto-objects -flto bar.c
9678 gcc -o myprog -O3 foo.o bar.o
9679 @end smallexample
9681 This produces individual object files with unoptimized assembler
9682 code, but the resulting binary @file{myprog} is optimized at
9683 @option{-O3}.  If, instead, the final binary is generated with
9684 @option{-fno-lto}, then @file{myprog} is not optimized.
9686 When producing the final binary, GCC only
9687 applies link-time optimizations to those files that contain bytecode.
9688 Therefore, you can mix and match object files and libraries with
9689 GIMPLE bytecodes and final object code.  GCC automatically selects
9690 which files to optimize in LTO mode and which files to link without
9691 further processing.
9693 There are some code generation flags preserved by GCC when
9694 generating bytecodes, as they need to be used during the final link
9695 stage.  Generally options specified at link time override those
9696 specified at compile time.
9698 If you do not specify an optimization level option @option{-O} at
9699 link time, then GCC uses the highest optimization level 
9700 used when compiling the object files.
9702 Currently, the following options and their settings are taken from
9703 the first object file that explicitly specifies them: 
9704 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
9705 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
9706 and all the @option{-m} target flags.
9708 Certain ABI-changing flags are required to match in all compilation units,
9709 and trying to override this at link time with a conflicting value
9710 is ignored.  This includes options such as @option{-freg-struct-return}
9711 and @option{-fpcc-struct-return}. 
9713 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
9714 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
9715 are passed through to the link stage and merged conservatively for
9716 conflicting translation units.  Specifically
9717 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
9718 precedence; and for example @option{-ffp-contract=off} takes precedence
9719 over @option{-ffp-contract=fast}.  You can override them at link time.
9721 If LTO encounters objects with C linkage declared with incompatible
9722 types in separate translation units to be linked together (undefined
9723 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
9724 issued.  The behavior is still undefined at run time.  Similar
9725 diagnostics may be raised for other languages.
9727 Another feature of LTO is that it is possible to apply interprocedural
9728 optimizations on files written in different languages:
9730 @smallexample
9731 gcc -c -flto foo.c
9732 g++ -c -flto bar.cc
9733 gfortran -c -flto baz.f90
9734 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
9735 @end smallexample
9737 Notice that the final link is done with @command{g++} to get the C++
9738 runtime libraries and @option{-lgfortran} is added to get the Fortran
9739 runtime libraries.  In general, when mixing languages in LTO mode, you
9740 should use the same link command options as when mixing languages in a
9741 regular (non-LTO) compilation.
9743 If object files containing GIMPLE bytecode are stored in a library archive, say
9744 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
9745 are using a linker with plugin support.  To create static libraries suitable
9746 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
9747 and @command{ranlib}; 
9748 to show the symbols of object files with GIMPLE bytecode, use
9749 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
9750 and @command{nm} have been compiled with plugin support.  At link time, use the
9751 flag @option{-fuse-linker-plugin} to ensure that the library participates in
9752 the LTO optimization process:
9754 @smallexample
9755 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
9756 @end smallexample
9758 With the linker plugin enabled, the linker extracts the needed
9759 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
9760 to make them part of the aggregated GIMPLE image to be optimized.
9762 If you are not using a linker with plugin support and/or do not
9763 enable the linker plugin, then the objects inside @file{libfoo.a}
9764 are extracted and linked as usual, but they do not participate
9765 in the LTO optimization process.  In order to make a static library suitable
9766 for both LTO optimization and usual linkage, compile its object files with
9767 @option{-flto} @option{-ffat-lto-objects}.
9769 Link-time optimizations do not require the presence of the whole program to
9770 operate.  If the program does not require any symbols to be exported, it is
9771 possible to combine @option{-flto} and @option{-fwhole-program} to allow
9772 the interprocedural optimizers to use more aggressive assumptions which may
9773 lead to improved optimization opportunities.
9774 Use of @option{-fwhole-program} is not needed when linker plugin is
9775 active (see @option{-fuse-linker-plugin}).
9777 The current implementation of LTO makes no
9778 attempt to generate bytecode that is portable between different
9779 types of hosts.  The bytecode files are versioned and there is a
9780 strict version check, so bytecode files generated in one version of
9781 GCC do not work with an older or newer version of GCC.
9783 Link-time optimization does not work well with generation of debugging
9784 information on systems other than those using a combination of ELF and
9785 DWARF.
9787 If you specify the optional @var{n}, the optimization and code
9788 generation done at link time is executed in parallel using @var{n}
9789 parallel jobs by utilizing an installed @command{make} program.  The
9790 environment variable @env{MAKE} may be used to override the program
9791 used.  The default value for @var{n} is 1.
9793 You can also specify @option{-flto=jobserver} to use GNU make's
9794 job server mode to determine the number of parallel jobs. This
9795 is useful when the Makefile calling GCC is already executing in parallel.
9796 You must prepend a @samp{+} to the command recipe in the parent Makefile
9797 for this to work.  This option likely only works if @env{MAKE} is
9798 GNU make.
9800 @item -flto-partition=@var{alg}
9801 @opindex flto-partition
9802 Specify the partitioning algorithm used by the link-time optimizer.
9803 The value is either @samp{1to1} to specify a partitioning mirroring
9804 the original source files or @samp{balanced} to specify partitioning
9805 into equally sized chunks (whenever possible) or @samp{max} to create
9806 new partition for every symbol where possible.  Specifying @samp{none}
9807 as an algorithm disables partitioning and streaming completely. 
9808 The default value is @samp{balanced}. While @samp{1to1} can be used
9809 as an workaround for various code ordering issues, the @samp{max}
9810 partitioning is intended for internal testing only.
9811 The value @samp{one} specifies that exactly one partition should be
9812 used while the value @samp{none} bypasses partitioning and executes
9813 the link-time optimization step directly from the WPA phase.
9815 @item -flto-odr-type-merging
9816 @opindex flto-odr-type-merging
9817 Enable streaming of mangled types names of C++ types and their unification
9818 at link time.  This increases size of LTO object files, but enables
9819 diagnostics about One Definition Rule violations.
9821 @item -flto-compression-level=@var{n}
9822 @opindex flto-compression-level
9823 This option specifies the level of compression used for intermediate
9824 language written to LTO object files, and is only meaningful in
9825 conjunction with LTO mode (@option{-flto}).  Valid
9826 values are 0 (no compression) to 9 (maximum compression).  Values
9827 outside this range are clamped to either 0 or 9.  If the option is not
9828 given, a default balanced compression setting is used.
9830 @item -fuse-linker-plugin
9831 @opindex fuse-linker-plugin
9832 Enables the use of a linker plugin during link-time optimization.  This
9833 option relies on plugin support in the linker, which is available in gold
9834 or in GNU ld 2.21 or newer.
9836 This option enables the extraction of object files with GIMPLE bytecode out
9837 of library archives. This improves the quality of optimization by exposing
9838 more code to the link-time optimizer.  This information specifies what
9839 symbols can be accessed externally (by non-LTO object or during dynamic
9840 linking).  Resulting code quality improvements on binaries (and shared
9841 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
9842 See @option{-flto} for a description of the effect of this flag and how to
9843 use it.
9845 This option is enabled by default when LTO support in GCC is enabled
9846 and GCC was configured for use with
9847 a linker supporting plugins (GNU ld 2.21 or newer or gold).
9849 @item -ffat-lto-objects
9850 @opindex ffat-lto-objects
9851 Fat LTO objects are object files that contain both the intermediate language
9852 and the object code. This makes them usable for both LTO linking and normal
9853 linking. This option is effective only when compiling with @option{-flto}
9854 and is ignored at link time.
9856 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
9857 requires the complete toolchain to be aware of LTO. It requires a linker with
9858 linker plugin support for basic functionality.  Additionally,
9859 @command{nm}, @command{ar} and @command{ranlib}
9860 need to support linker plugins to allow a full-featured build environment
9861 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
9862 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
9863 to these tools. With non fat LTO makefiles need to be modified to use them.
9865 Note that modern binutils provide plugin auto-load mechanism.
9866 Installing the linker plugin into @file{$libdir/bfd-plugins} has the same
9867 effect as usage of the command wrappers (@command{gcc-ar}, @command{gcc-nm} and
9868 @command{gcc-ranlib}).
9870 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
9871 support.
9873 @item -fcompare-elim
9874 @opindex fcompare-elim
9875 After register allocation and post-register allocation instruction splitting,
9876 identify arithmetic instructions that compute processor flags similar to a
9877 comparison operation based on that arithmetic.  If possible, eliminate the
9878 explicit comparison operation.
9880 This pass only applies to certain targets that cannot explicitly represent
9881 the comparison operation before register allocation is complete.
9883 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9885 @item -fcprop-registers
9886 @opindex fcprop-registers
9887 After register allocation and post-register allocation instruction splitting,
9888 perform a copy-propagation pass to try to reduce scheduling dependencies
9889 and occasionally eliminate the copy.
9891 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9893 @item -fprofile-correction
9894 @opindex fprofile-correction
9895 Profiles collected using an instrumented binary for multi-threaded programs may
9896 be inconsistent due to missed counter updates. When this option is specified,
9897 GCC uses heuristics to correct or smooth out such inconsistencies. By
9898 default, GCC emits an error message when an inconsistent profile is detected.
9900 @item -fprofile-use
9901 @itemx -fprofile-use=@var{path}
9902 @opindex fprofile-use
9903 Enable profile feedback-directed optimizations, 
9904 and the following optimizations
9905 which are generally profitable only with profile feedback available:
9906 @option{-fbranch-probabilities}, @option{-fvpt},
9907 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9908 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
9910 Before you can use this option, you must first generate profiling information.
9911 @xref{Instrumentation Options}, for information about the
9912 @option{-fprofile-generate} option.
9914 By default, GCC emits an error message if the feedback profiles do not
9915 match the source code.  This error can be turned into a warning by using
9916 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9917 code.
9919 If @var{path} is specified, GCC looks at the @var{path} to find
9920 the profile feedback data files. See @option{-fprofile-dir}.
9922 @item -fauto-profile
9923 @itemx -fauto-profile=@var{path}
9924 @opindex fauto-profile
9925 Enable sampling-based feedback-directed optimizations, 
9926 and the following optimizations
9927 which are generally profitable only with profile feedback available:
9928 @option{-fbranch-probabilities}, @option{-fvpt},
9929 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9930 @option{-ftree-vectorize},
9931 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
9932 @option{-fpredictive-commoning}, @option{-funswitch-loops},
9933 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
9935 @var{path} is the name of a file containing AutoFDO profile information.
9936 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
9938 Producing an AutoFDO profile data file requires running your program
9939 with the @command{perf} utility on a supported GNU/Linux target system.
9940 For more information, see @uref{https://perf.wiki.kernel.org/}.
9942 E.g.
9943 @smallexample
9944 perf record -e br_inst_retired:near_taken -b -o perf.data \
9945     -- your_program
9946 @end smallexample
9948 Then use the @command{create_gcov} tool to convert the raw profile data
9949 to a format that can be used by GCC.@  You must also supply the 
9950 unstripped binary for your program to this tool.  
9951 See @uref{https://github.com/google/autofdo}.
9953 E.g.
9954 @smallexample
9955 create_gcov --binary=your_program.unstripped --profile=perf.data \
9956     --gcov=profile.afdo
9957 @end smallexample
9958 @end table
9960 The following options control compiler behavior regarding floating-point 
9961 arithmetic.  These options trade off between speed and
9962 correctness.  All must be specifically enabled.
9964 @table @gcctabopt
9965 @item -ffloat-store
9966 @opindex ffloat-store
9967 Do not store floating-point variables in registers, and inhibit other
9968 options that might change whether a floating-point value is taken from a
9969 register or memory.
9971 @cindex floating-point precision
9972 This option prevents undesirable excess precision on machines such as
9973 the 68000 where the floating registers (of the 68881) keep more
9974 precision than a @code{double} is supposed to have.  Similarly for the
9975 x86 architecture.  For most programs, the excess precision does only
9976 good, but a few programs rely on the precise definition of IEEE floating
9977 point.  Use @option{-ffloat-store} for such programs, after modifying
9978 them to store all pertinent intermediate computations into variables.
9980 @item -fexcess-precision=@var{style}
9981 @opindex fexcess-precision
9982 This option allows further control over excess precision on machines
9983 where floating-point operations occur in a format with more precision or
9984 range than the IEEE standard and interchange floating-point types.  By
9985 default, @option{-fexcess-precision=fast} is in effect; this means that
9986 operations may be carried out in a wider precision than the types specified
9987 in the source if that would result in faster code, and it is unpredictable
9988 when rounding to the types specified in the source code takes place.
9989 When compiling C, if @option{-fexcess-precision=standard} is specified then
9990 excess precision follows the rules specified in ISO C99; in particular,
9991 both casts and assignments cause values to be rounded to their
9992 semantic types (whereas @option{-ffloat-store} only affects
9993 assignments).  This option is enabled by default for C if a strict
9994 conformance option such as @option{-std=c99} is used.
9995 @option{-ffast-math} enables @option{-fexcess-precision=fast} by default
9996 regardless of whether a strict conformance option is used.
9998 @opindex mfpmath
9999 @option{-fexcess-precision=standard} is not implemented for languages
10000 other than C.  On the x86, it has no effect if @option{-mfpmath=sse}
10001 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
10002 semantics apply without excess precision, and in the latter, rounding
10003 is unpredictable.
10005 @item -ffast-math
10006 @opindex ffast-math
10007 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
10008 @option{-ffinite-math-only}, @option{-fno-rounding-math},
10009 @option{-fno-signaling-nans}, @option{-fcx-limited-range} and
10010 @option{-fexcess-precision=fast}.
10012 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
10014 This option is not turned on by any @option{-O} option besides
10015 @option{-Ofast} since it can result in incorrect output for programs
10016 that depend on an exact implementation of IEEE or ISO rules/specifications
10017 for math functions. It may, however, yield faster code for programs
10018 that do not require the guarantees of these specifications.
10020 @item -fno-math-errno
10021 @opindex fno-math-errno
10022 Do not set @code{errno} after calling math functions that are executed
10023 with a single instruction, e.g., @code{sqrt}.  A program that relies on
10024 IEEE exceptions for math error handling may want to use this flag
10025 for speed while maintaining IEEE arithmetic compatibility.
10027 This option is not turned on by any @option{-O} option since
10028 it can result in incorrect output for programs that depend on
10029 an exact implementation of IEEE or ISO rules/specifications for
10030 math functions. It may, however, yield faster code for programs
10031 that do not require the guarantees of these specifications.
10033 The default is @option{-fmath-errno}.
10035 On Darwin systems, the math library never sets @code{errno}.  There is
10036 therefore no reason for the compiler to consider the possibility that
10037 it might, and @option{-fno-math-errno} is the default.
10039 @item -funsafe-math-optimizations
10040 @opindex funsafe-math-optimizations
10042 Allow optimizations for floating-point arithmetic that (a) assume
10043 that arguments and results are valid and (b) may violate IEEE or
10044 ANSI standards.  When used at link time, it may include libraries
10045 or startup files that change the default FPU control word or other
10046 similar optimizations.
10048 This option is not turned on by any @option{-O} option since
10049 it can result in incorrect output for programs that depend on
10050 an exact implementation of IEEE or ISO rules/specifications for
10051 math functions. It may, however, yield faster code for programs
10052 that do not require the guarantees of these specifications.
10053 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
10054 @option{-fassociative-math} and @option{-freciprocal-math}.
10056 The default is @option{-fno-unsafe-math-optimizations}.
10058 @item -fassociative-math
10059 @opindex fassociative-math
10061 Allow re-association of operands in series of floating-point operations.
10062 This violates the ISO C and C++ language standard by possibly changing
10063 computation result.  NOTE: re-ordering may change the sign of zero as
10064 well as ignore NaNs and inhibit or create underflow or overflow (and
10065 thus cannot be used on code that relies on rounding behavior like
10066 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
10067 and thus may not be used when ordered comparisons are required.
10068 This option requires that both @option{-fno-signed-zeros} and
10069 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
10070 much sense with @option{-frounding-math}. For Fortran the option
10071 is automatically enabled when both @option{-fno-signed-zeros} and
10072 @option{-fno-trapping-math} are in effect.
10074 The default is @option{-fno-associative-math}.
10076 @item -freciprocal-math
10077 @opindex freciprocal-math
10079 Allow the reciprocal of a value to be used instead of dividing by
10080 the value if this enables optimizations.  For example @code{x / y}
10081 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
10082 is subject to common subexpression elimination.  Note that this loses
10083 precision and increases the number of flops operating on the value.
10085 The default is @option{-fno-reciprocal-math}.
10087 @item -ffinite-math-only
10088 @opindex ffinite-math-only
10089 Allow optimizations for floating-point arithmetic that assume
10090 that arguments and results are not NaNs or +-Infs.
10092 This option is not turned on by any @option{-O} option since
10093 it can result in incorrect output for programs that depend on
10094 an exact implementation of IEEE or ISO rules/specifications for
10095 math functions. It may, however, yield faster code for programs
10096 that do not require the guarantees of these specifications.
10098 The default is @option{-fno-finite-math-only}.
10100 @item -fno-signed-zeros
10101 @opindex fno-signed-zeros
10102 Allow optimizations for floating-point arithmetic that ignore the
10103 signedness of zero.  IEEE arithmetic specifies the behavior of
10104 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
10105 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
10106 This option implies that the sign of a zero result isn't significant.
10108 The default is @option{-fsigned-zeros}.
10110 @item -fno-trapping-math
10111 @opindex fno-trapping-math
10112 Compile code assuming that floating-point operations cannot generate
10113 user-visible traps.  These traps include division by zero, overflow,
10114 underflow, inexact result and invalid operation.  This option requires
10115 that @option{-fno-signaling-nans} be in effect.  Setting this option may
10116 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
10118 This option should never be turned on by any @option{-O} option since
10119 it can result in incorrect output for programs that depend on
10120 an exact implementation of IEEE or ISO rules/specifications for
10121 math functions.
10123 The default is @option{-ftrapping-math}.
10125 @item -frounding-math
10126 @opindex frounding-math
10127 Disable transformations and optimizations that assume default floating-point
10128 rounding behavior.  This is round-to-zero for all floating point
10129 to integer conversions, and round-to-nearest for all other arithmetic
10130 truncations.  This option should be specified for programs that change
10131 the FP rounding mode dynamically, or that may be executed with a
10132 non-default rounding mode.  This option disables constant folding of
10133 floating-point expressions at compile time (which may be affected by
10134 rounding mode) and arithmetic transformations that are unsafe in the
10135 presence of sign-dependent rounding modes.
10137 The default is @option{-fno-rounding-math}.
10139 This option is experimental and does not currently guarantee to
10140 disable all GCC optimizations that are affected by rounding mode.
10141 Future versions of GCC may provide finer control of this setting
10142 using C99's @code{FENV_ACCESS} pragma.  This command-line option
10143 will be used to specify the default state for @code{FENV_ACCESS}.
10145 @item -fsignaling-nans
10146 @opindex fsignaling-nans
10147 Compile code assuming that IEEE signaling NaNs may generate user-visible
10148 traps during floating-point operations.  Setting this option disables
10149 optimizations that may change the number of exceptions visible with
10150 signaling NaNs.  This option implies @option{-ftrapping-math}.
10152 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
10153 be defined.
10155 The default is @option{-fno-signaling-nans}.
10157 This option is experimental and does not currently guarantee to
10158 disable all GCC optimizations that affect signaling NaN behavior.
10160 @item -fno-fp-int-builtin-inexact
10161 @opindex fno-fp-int-builtin-inexact
10162 Do not allow the built-in functions @code{ceil}, @code{floor},
10163 @code{round} and @code{trunc}, and their @code{float} and @code{long
10164 double} variants, to generate code that raises the ``inexact''
10165 floating-point exception for noninteger arguments.  ISO C99 and C11
10166 allow these functions to raise the ``inexact'' exception, but ISO/IEC
10167 TS 18661-1:2014, the C bindings to IEEE 754-2008, does not allow these
10168 functions to do so.
10170 The default is @option{-ffp-int-builtin-inexact}, allowing the
10171 exception to be raised.  This option does nothing unless
10172 @option{-ftrapping-math} is in effect.
10174 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
10175 generate a call to a library function then the ``inexact'' exception
10176 may be raised if the library implementation does not follow TS 18661.
10178 @item -fsingle-precision-constant
10179 @opindex fsingle-precision-constant
10180 Treat floating-point constants as single precision instead of
10181 implicitly converting them to double-precision constants.
10183 @item -fcx-limited-range
10184 @opindex fcx-limited-range
10185 When enabled, this option states that a range reduction step is not
10186 needed when performing complex division.  Also, there is no checking
10187 whether the result of a complex multiplication or division is @code{NaN
10188 + I*NaN}, with an attempt to rescue the situation in that case.  The
10189 default is @option{-fno-cx-limited-range}, but is enabled by
10190 @option{-ffast-math}.
10192 This option controls the default setting of the ISO C99
10193 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
10194 all languages.
10196 @item -fcx-fortran-rules
10197 @opindex fcx-fortran-rules
10198 Complex multiplication and division follow Fortran rules.  Range
10199 reduction is done as part of complex division, but there is no checking
10200 whether the result of a complex multiplication or division is @code{NaN
10201 + I*NaN}, with an attempt to rescue the situation in that case.
10203 The default is @option{-fno-cx-fortran-rules}.
10205 @end table
10207 The following options control optimizations that may improve
10208 performance, but are not enabled by any @option{-O} options.  This
10209 section includes experimental options that may produce broken code.
10211 @table @gcctabopt
10212 @item -fbranch-probabilities
10213 @opindex fbranch-probabilities
10214 After running a program compiled with @option{-fprofile-arcs}
10215 (@pxref{Instrumentation Options}),
10216 you can compile it a second time using
10217 @option{-fbranch-probabilities}, to improve optimizations based on
10218 the number of times each branch was taken.  When a program
10219 compiled with @option{-fprofile-arcs} exits, it saves arc execution
10220 counts to a file called @file{@var{sourcename}.gcda} for each source
10221 file.  The information in this data file is very dependent on the
10222 structure of the generated code, so you must use the same source code
10223 and the same optimization options for both compilations.
10225 With @option{-fbranch-probabilities}, GCC puts a
10226 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
10227 These can be used to improve optimization.  Currently, they are only
10228 used in one place: in @file{reorg.c}, instead of guessing which path a
10229 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
10230 exactly determine which path is taken more often.
10232 @item -fprofile-values
10233 @opindex fprofile-values
10234 If combined with @option{-fprofile-arcs}, it adds code so that some
10235 data about values of expressions in the program is gathered.
10237 With @option{-fbranch-probabilities}, it reads back the data gathered
10238 from profiling values of expressions for usage in optimizations.
10240 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
10242 @item -fprofile-reorder-functions
10243 @opindex fprofile-reorder-functions
10244 Function reordering based on profile instrumentation collects
10245 first time of execution of a function and orders these functions
10246 in ascending order.
10248 Enabled with @option{-fprofile-use}.
10250 @item -fvpt
10251 @opindex fvpt
10252 If combined with @option{-fprofile-arcs}, this option instructs the compiler
10253 to add code to gather information about values of expressions.
10255 With @option{-fbranch-probabilities}, it reads back the data gathered
10256 and actually performs the optimizations based on them.
10257 Currently the optimizations include specialization of division operations
10258 using the knowledge about the value of the denominator.
10260 @item -frename-registers
10261 @opindex frename-registers
10262 Attempt to avoid false dependencies in scheduled code by making use
10263 of registers left over after register allocation.  This optimization
10264 most benefits processors with lots of registers.  Depending on the
10265 debug information format adopted by the target, however, it can
10266 make debugging impossible, since variables no longer stay in
10267 a ``home register''.
10269 Enabled by default with @option{-funroll-loops}.
10271 @item -fschedule-fusion
10272 @opindex fschedule-fusion
10273 Performs a target dependent pass over the instruction stream to schedule
10274 instructions of same type together because target machine can execute them
10275 more efficiently if they are adjacent to each other in the instruction flow.
10277 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10279 @item -ftracer
10280 @opindex ftracer
10281 Perform tail duplication to enlarge superblock size.  This transformation
10282 simplifies the control flow of the function allowing other optimizations to do
10283 a better job.
10285 Enabled with @option{-fprofile-use}.
10287 @item -funroll-loops
10288 @opindex funroll-loops
10289 Unroll loops whose number of iterations can be determined at compile time or
10290 upon entry to the loop.  @option{-funroll-loops} implies
10291 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
10292 It also turns on complete loop peeling (i.e.@: complete removal of loops with
10293 a small constant number of iterations).  This option makes code larger, and may
10294 or may not make it run faster.
10296 Enabled with @option{-fprofile-use}.
10298 @item -funroll-all-loops
10299 @opindex funroll-all-loops
10300 Unroll all loops, even if their number of iterations is uncertain when
10301 the loop is entered.  This usually makes programs run more slowly.
10302 @option{-funroll-all-loops} implies the same options as
10303 @option{-funroll-loops}.
10305 @item -fpeel-loops
10306 @opindex fpeel-loops
10307 Peels loops for which there is enough information that they do not
10308 roll much (from profile feedback or static analysis).  It also turns on
10309 complete loop peeling (i.e.@: complete removal of loops with small constant
10310 number of iterations).
10312 Enabled with @option{-O3} and/or @option{-fprofile-use}.
10314 @item -fmove-loop-invariants
10315 @opindex fmove-loop-invariants
10316 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
10317 at level @option{-O1}
10319 @item -fsplit-loops
10320 @opindex fsplit-loops
10321 Split a loop into two if it contains a condition that's always true
10322 for one side of the iteration space and false for the other.
10324 @item -funswitch-loops
10325 @opindex funswitch-loops
10326 Move branches with loop invariant conditions out of the loop, with duplicates
10327 of the loop on both branches (modified according to result of the condition).
10329 @item -ffunction-sections
10330 @itemx -fdata-sections
10331 @opindex ffunction-sections
10332 @opindex fdata-sections
10333 Place each function or data item into its own section in the output
10334 file if the target supports arbitrary sections.  The name of the
10335 function or the name of the data item determines the section's name
10336 in the output file.
10338 Use these options on systems where the linker can perform optimizations to
10339 improve locality of reference in the instruction space.  Most systems using the
10340 ELF object format have linkers with such optimizations.  On AIX, the linker
10341 rearranges sections (CSECTs) based on the call graph.  The performance impact
10342 varies.
10344 Together with a linker garbage collection (linker @option{--gc-sections}
10345 option) these options may lead to smaller statically-linked executables (after
10346 stripping).
10348 On ELF/DWARF systems these options do not degenerate the quality of the debug
10349 information.  There could be issues with other object files/debug info formats.
10351 Only use these options when there are significant benefits from doing so.  When
10352 you specify these options, the assembler and linker create larger object and
10353 executable files and are also slower.  These options affect code generation.
10354 They prevent optimizations by the compiler and assembler using relative
10355 locations inside a translation unit since the locations are unknown until
10356 link time.  An example of such an optimization is relaxing calls to short call
10357 instructions.
10359 @item -fbranch-target-load-optimize
10360 @opindex fbranch-target-load-optimize
10361 Perform branch target register load optimization before prologue / epilogue
10362 threading.
10363 The use of target registers can typically be exposed only during reload,
10364 thus hoisting loads out of loops and doing inter-block scheduling needs
10365 a separate optimization pass.
10367 @item -fbranch-target-load-optimize2
10368 @opindex fbranch-target-load-optimize2
10369 Perform branch target register load optimization after prologue / epilogue
10370 threading.
10372 @item -fbtr-bb-exclusive
10373 @opindex fbtr-bb-exclusive
10374 When performing branch target register load optimization, don't reuse
10375 branch target registers within any basic block.
10377 @item -fstdarg-opt
10378 @opindex fstdarg-opt
10379 Optimize the prologue of variadic argument functions with respect to usage of
10380 those arguments.
10382 @item -fsection-anchors
10383 @opindex fsection-anchors
10384 Try to reduce the number of symbolic address calculations by using
10385 shared ``anchor'' symbols to address nearby objects.  This transformation
10386 can help to reduce the number of GOT entries and GOT accesses on some
10387 targets.
10389 For example, the implementation of the following function @code{foo}:
10391 @smallexample
10392 static int a, b, c;
10393 int foo (void) @{ return a + b + c; @}
10394 @end smallexample
10396 @noindent
10397 usually calculates the addresses of all three variables, but if you
10398 compile it with @option{-fsection-anchors}, it accesses the variables
10399 from a common anchor point instead.  The effect is similar to the
10400 following pseudocode (which isn't valid C):
10402 @smallexample
10403 int foo (void)
10405   register int *xr = &x;
10406   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
10408 @end smallexample
10410 Not all targets support this option.
10412 @item --param @var{name}=@var{value}
10413 @opindex param
10414 In some places, GCC uses various constants to control the amount of
10415 optimization that is done.  For example, GCC does not inline functions
10416 that contain more than a certain number of instructions.  You can
10417 control some of these constants on the command line using the
10418 @option{--param} option.
10420 The names of specific parameters, and the meaning of the values, are
10421 tied to the internals of the compiler, and are subject to change
10422 without notice in future releases.
10424 In each case, the @var{value} is an integer.  The allowable choices for
10425 @var{name} are:
10427 @table @gcctabopt
10428 @item predictable-branch-outcome
10429 When branch is predicted to be taken with probability lower than this threshold
10430 (in percent), then it is considered well predictable. The default is 10.
10432 @item max-rtl-if-conversion-insns
10433 RTL if-conversion tries to remove conditional branches around a block and
10434 replace them with conditionally executed instructions.  This parameter
10435 gives the maximum number of instructions in a block which should be
10436 considered for if-conversion.  The default is 10, though the compiler will
10437 also use other heuristics to decide whether if-conversion is likely to be
10438 profitable.
10440 @item max-rtl-if-conversion-predictable-cost
10441 @itemx max-rtl-if-conversion-unpredictable-cost
10442 RTL if-conversion will try to remove conditional branches around a block
10443 and replace them with conditionally executed instructions.  These parameters
10444 give the maximum permissible cost for the sequence that would be generated
10445 by if-conversion depending on whether the branch is statically determined
10446 to be predictable or not.  The units for this parameter are the same as
10447 those for the GCC internal seq_cost metric.  The compiler will try to
10448 provide a reasonable default for this parameter using the BRANCH_COST
10449 target macro.
10451 @item max-crossjump-edges
10452 The maximum number of incoming edges to consider for cross-jumping.
10453 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
10454 the number of edges incoming to each block.  Increasing values mean
10455 more aggressive optimization, making the compilation time increase with
10456 probably small improvement in executable size.
10458 @item min-crossjump-insns
10459 The minimum number of instructions that must be matched at the end
10460 of two blocks before cross-jumping is performed on them.  This
10461 value is ignored in the case where all instructions in the block being
10462 cross-jumped from are matched.  The default value is 5.
10464 @item max-grow-copy-bb-insns
10465 The maximum code size expansion factor when copying basic blocks
10466 instead of jumping.  The expansion is relative to a jump instruction.
10467 The default value is 8.
10469 @item max-goto-duplication-insns
10470 The maximum number of instructions to duplicate to a block that jumps
10471 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
10472 passes, GCC factors computed gotos early in the compilation process,
10473 and unfactors them as late as possible.  Only computed jumps at the
10474 end of a basic blocks with no more than max-goto-duplication-insns are
10475 unfactored.  The default value is 8.
10477 @item max-delay-slot-insn-search
10478 The maximum number of instructions to consider when looking for an
10479 instruction to fill a delay slot.  If more than this arbitrary number of
10480 instructions are searched, the time savings from filling the delay slot
10481 are minimal, so stop searching.  Increasing values mean more
10482 aggressive optimization, making the compilation time increase with probably
10483 small improvement in execution time.
10485 @item max-delay-slot-live-search
10486 When trying to fill delay slots, the maximum number of instructions to
10487 consider when searching for a block with valid live register
10488 information.  Increasing this arbitrarily chosen value means more
10489 aggressive optimization, increasing the compilation time.  This parameter
10490 should be removed when the delay slot code is rewritten to maintain the
10491 control-flow graph.
10493 @item max-gcse-memory
10494 The approximate maximum amount of memory that can be allocated in
10495 order to perform the global common subexpression elimination
10496 optimization.  If more memory than specified is required, the
10497 optimization is not done.
10499 @item max-gcse-insertion-ratio
10500 If the ratio of expression insertions to deletions is larger than this value
10501 for any expression, then RTL PRE inserts or removes the expression and thus
10502 leaves partially redundant computations in the instruction stream.  The default value is 20.
10504 @item max-pending-list-length
10505 The maximum number of pending dependencies scheduling allows
10506 before flushing the current state and starting over.  Large functions
10507 with few branches or calls can create excessively large lists which
10508 needlessly consume memory and resources.
10510 @item max-modulo-backtrack-attempts
10511 The maximum number of backtrack attempts the scheduler should make
10512 when modulo scheduling a loop.  Larger values can exponentially increase
10513 compilation time.
10515 @item max-inline-insns-single
10516 Several parameters control the tree inliner used in GCC@.
10517 This number sets the maximum number of instructions (counted in GCC's
10518 internal representation) in a single function that the tree inliner
10519 considers for inlining.  This only affects functions declared
10520 inline and methods implemented in a class declaration (C++).
10521 The default value is 400.
10523 @item max-inline-insns-auto
10524 When you use @option{-finline-functions} (included in @option{-O3}),
10525 a lot of functions that would otherwise not be considered for inlining
10526 by the compiler are investigated.  To those functions, a different
10527 (more restrictive) limit compared to functions declared inline can
10528 be applied.
10529 The default value is 30.
10531 @item inline-min-speedup
10532 When estimated performance improvement of caller + callee runtime exceeds this
10533 threshold (in percent), the function can be inlined regardless of the limit on
10534 @option{--param max-inline-insns-single} and @option{--param
10535 max-inline-insns-auto}.
10536 The default value is 15.
10538 @item large-function-insns
10539 The limit specifying really large functions.  For functions larger than this
10540 limit after inlining, inlining is constrained by
10541 @option{--param large-function-growth}.  This parameter is useful primarily
10542 to avoid extreme compilation time caused by non-linear algorithms used by the
10543 back end.
10544 The default value is 2700.
10546 @item large-function-growth
10547 Specifies maximal growth of large function caused by inlining in percents.
10548 The default value is 100 which limits large function growth to 2.0 times
10549 the original size.
10551 @item large-unit-insns
10552 The limit specifying large translation unit.  Growth caused by inlining of
10553 units larger than this limit is limited by @option{--param inline-unit-growth}.
10554 For small units this might be too tight.
10555 For example, consider a unit consisting of function A
10556 that is inline and B that just calls A three times.  If B is small relative to
10557 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
10558 large units consisting of small inlineable functions, however, the overall unit
10559 growth limit is needed to avoid exponential explosion of code size.  Thus for
10560 smaller units, the size is increased to @option{--param large-unit-insns}
10561 before applying @option{--param inline-unit-growth}.  The default is 10000.
10563 @item inline-unit-growth
10564 Specifies maximal overall growth of the compilation unit caused by inlining.
10565 The default value is 20 which limits unit growth to 1.2 times the original
10566 size. Cold functions (either marked cold via an attribute or by profile
10567 feedback) are not accounted into the unit size.
10569 @item ipcp-unit-growth
10570 Specifies maximal overall growth of the compilation unit caused by
10571 interprocedural constant propagation.  The default value is 10 which limits
10572 unit growth to 1.1 times the original size.
10574 @item large-stack-frame
10575 The limit specifying large stack frames.  While inlining the algorithm is trying
10576 to not grow past this limit too much.  The default value is 256 bytes.
10578 @item large-stack-frame-growth
10579 Specifies maximal growth of large stack frames caused by inlining in percents.
10580 The default value is 1000 which limits large stack frame growth to 11 times
10581 the original size.
10583 @item max-inline-insns-recursive
10584 @itemx max-inline-insns-recursive-auto
10585 Specifies the maximum number of instructions an out-of-line copy of a
10586 self-recursive inline
10587 function can grow into by performing recursive inlining.
10589 @option{--param max-inline-insns-recursive} applies to functions
10590 declared inline.
10591 For functions not declared inline, recursive inlining
10592 happens only when @option{-finline-functions} (included in @option{-O3}) is
10593 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
10594 default value is 450.
10596 @item max-inline-recursive-depth
10597 @itemx max-inline-recursive-depth-auto
10598 Specifies the maximum recursion depth used for recursive inlining.
10600 @option{--param max-inline-recursive-depth} applies to functions
10601 declared inline.  For functions not declared inline, recursive inlining
10602 happens only when @option{-finline-functions} (included in @option{-O3}) is
10603 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
10604 default value is 8.
10606 @item min-inline-recursive-probability
10607 Recursive inlining is profitable only for function having deep recursion
10608 in average and can hurt for function having little recursion depth by
10609 increasing the prologue size or complexity of function body to other
10610 optimizers.
10612 When profile feedback is available (see @option{-fprofile-generate}) the actual
10613 recursion depth can be guessed from the probability that function recurses
10614 via a given call expression.  This parameter limits inlining only to call
10615 expressions whose probability exceeds the given threshold (in percents).
10616 The default value is 10.
10618 @item early-inlining-insns
10619 Specify growth that the early inliner can make.  In effect it increases
10620 the amount of inlining for code having a large abstraction penalty.
10621 The default value is 14.
10623 @item max-early-inliner-iterations
10624 Limit of iterations of the early inliner.  This basically bounds
10625 the number of nested indirect calls the early inliner can resolve.
10626 Deeper chains are still handled by late inlining.
10628 @item comdat-sharing-probability
10629 Probability (in percent) that C++ inline function with comdat visibility
10630 are shared across multiple compilation units.  The default value is 20.
10632 @item profile-func-internal-id
10633 A parameter to control whether to use function internal id in profile
10634 database lookup. If the value is 0, the compiler uses an id that
10635 is based on function assembler name and filename, which makes old profile
10636 data more tolerant to source changes such as function reordering etc.
10637 The default value is 0.
10639 @item min-vect-loop-bound
10640 The minimum number of iterations under which loops are not vectorized
10641 when @option{-ftree-vectorize} is used.  The number of iterations after
10642 vectorization needs to be greater than the value specified by this option
10643 to allow vectorization.  The default value is 0.
10645 @item gcse-cost-distance-ratio
10646 Scaling factor in calculation of maximum distance an expression
10647 can be moved by GCSE optimizations.  This is currently supported only in the
10648 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
10649 is with simple expressions, i.e., the expressions that have cost
10650 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
10651 hoisting of simple expressions.  The default value is 10.
10653 @item gcse-unrestricted-cost
10654 Cost, roughly measured as the cost of a single typical machine
10655 instruction, at which GCSE optimizations do not constrain
10656 the distance an expression can travel.  This is currently
10657 supported only in the code hoisting pass.  The lesser the cost,
10658 the more aggressive code hoisting is.  Specifying 0 
10659 allows all expressions to travel unrestricted distances.
10660 The default value is 3.
10662 @item max-hoist-depth
10663 The depth of search in the dominator tree for expressions to hoist.
10664 This is used to avoid quadratic behavior in hoisting algorithm.
10665 The value of 0 does not limit on the search, but may slow down compilation
10666 of huge functions.  The default value is 30.
10668 @item max-tail-merge-comparisons
10669 The maximum amount of similar bbs to compare a bb with.  This is used to
10670 avoid quadratic behavior in tree tail merging.  The default value is 10.
10672 @item max-tail-merge-iterations
10673 The maximum amount of iterations of the pass over the function.  This is used to
10674 limit compilation time in tree tail merging.  The default value is 2.
10676 @item store-merging-allow-unaligned
10677 Allow the store merging pass to introduce unaligned stores if it is legal to
10678 do so.  The default value is 1.
10680 @item max-stores-to-merge
10681 The maximum number of stores to attempt to merge into wider stores in the store
10682 merging pass.  The minimum value is 2 and the default is 64.
10684 @item max-unrolled-insns
10685 The maximum number of instructions that a loop may have to be unrolled.
10686 If a loop is unrolled, this parameter also determines how many times
10687 the loop code is unrolled.
10689 @item max-average-unrolled-insns
10690 The maximum number of instructions biased by probabilities of their execution
10691 that a loop may have to be unrolled.  If a loop is unrolled,
10692 this parameter also determines how many times the loop code is unrolled.
10694 @item max-unroll-times
10695 The maximum number of unrollings of a single loop.
10697 @item max-peeled-insns
10698 The maximum number of instructions that a loop may have to be peeled.
10699 If a loop is peeled, this parameter also determines how many times
10700 the loop code is peeled.
10702 @item max-peel-times
10703 The maximum number of peelings of a single loop.
10705 @item max-peel-branches
10706 The maximum number of branches on the hot path through the peeled sequence.
10708 @item max-completely-peeled-insns
10709 The maximum number of insns of a completely peeled loop.
10711 @item max-completely-peel-times
10712 The maximum number of iterations of a loop to be suitable for complete peeling.
10714 @item max-completely-peel-loop-nest-depth
10715 The maximum depth of a loop nest suitable for complete peeling.
10717 @item max-unswitch-insns
10718 The maximum number of insns of an unswitched loop.
10720 @item max-unswitch-level
10721 The maximum number of branches unswitched in a single loop.
10723 @item max-loop-headers-insns
10724 The maximum number of insns in loop header duplicated by the copy loop headers
10725 pass.
10727 @item lim-expensive
10728 The minimum cost of an expensive expression in the loop invariant motion.
10730 @item iv-consider-all-candidates-bound
10731 Bound on number of candidates for induction variables, below which
10732 all candidates are considered for each use in induction variable
10733 optimizations.  If there are more candidates than this,
10734 only the most relevant ones are considered to avoid quadratic time complexity.
10736 @item iv-max-considered-uses
10737 The induction variable optimizations give up on loops that contain more
10738 induction variable uses.
10740 @item iv-always-prune-cand-set-bound
10741 If the number of candidates in the set is smaller than this value,
10742 always try to remove unnecessary ivs from the set
10743 when adding a new one.
10745 @item avg-loop-niter
10746 Average number of iterations of a loop.
10748 @item dse-max-object-size
10749 Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
10750 Larger values may result in larger compilation times.
10752 @item dse-max-alias-queries-per-store
10753 Maximum number of queries into the alias oracle per store.
10754 Larger values result in larger compilation times and may result in more
10755 removed dead stores.
10757 @item scev-max-expr-size
10758 Bound on size of expressions used in the scalar evolutions analyzer.
10759 Large expressions slow the analyzer.
10761 @item scev-max-expr-complexity
10762 Bound on the complexity of the expressions in the scalar evolutions analyzer.
10763 Complex expressions slow the analyzer.
10765 @item max-tree-if-conversion-phi-args
10766 Maximum number of arguments in a PHI supported by TREE if conversion
10767 unless the loop is marked with simd pragma.
10769 @item vect-max-version-for-alignment-checks
10770 The maximum number of run-time checks that can be performed when
10771 doing loop versioning for alignment in the vectorizer.
10773 @item vect-max-version-for-alias-checks
10774 The maximum number of run-time checks that can be performed when
10775 doing loop versioning for alias in the vectorizer.
10777 @item vect-max-peeling-for-alignment
10778 The maximum number of loop peels to enhance access alignment
10779 for vectorizer. Value -1 means no limit.
10781 @item max-iterations-to-track
10782 The maximum number of iterations of a loop the brute-force algorithm
10783 for analysis of the number of iterations of the loop tries to evaluate.
10785 @item hot-bb-count-ws-permille
10786 A basic block profile count is considered hot if it contributes to 
10787 the given permillage (i.e. 0...1000) of the entire profiled execution.
10789 @item hot-bb-frequency-fraction
10790 Select fraction of the entry block frequency of executions of basic block in
10791 function given basic block needs to have to be considered hot.
10793 @item max-predicted-iterations
10794 The maximum number of loop iterations we predict statically.  This is useful
10795 in cases where a function contains a single loop with known bound and
10796 another loop with unknown bound.
10797 The known number of iterations is predicted correctly, while
10798 the unknown number of iterations average to roughly 10.  This means that the
10799 loop without bounds appears artificially cold relative to the other one.
10801 @item builtin-expect-probability
10802 Control the probability of the expression having the specified value. This
10803 parameter takes a percentage (i.e. 0 ... 100) as input.
10804 The default probability of 90 is obtained empirically.
10806 @item builtin-string-cmp-inline-length
10807 The maximum length of a constant string for a builtin string cmp call 
10808 eligible for inlining.
10809 The default value is 3.
10811 @item align-threshold
10813 Select fraction of the maximal frequency of executions of a basic block in
10814 a function to align the basic block.
10816 @item align-loop-iterations
10818 A loop expected to iterate at least the selected number of iterations is
10819 aligned.
10821 @item tracer-dynamic-coverage
10822 @itemx tracer-dynamic-coverage-feedback
10824 This value is used to limit superblock formation once the given percentage of
10825 executed instructions is covered.  This limits unnecessary code size
10826 expansion.
10828 The @option{tracer-dynamic-coverage-feedback} parameter
10829 is used only when profile
10830 feedback is available.  The real profiles (as opposed to statically estimated
10831 ones) are much less balanced allowing the threshold to be larger value.
10833 @item tracer-max-code-growth
10834 Stop tail duplication once code growth has reached given percentage.  This is
10835 a rather artificial limit, as most of the duplicates are eliminated later in
10836 cross jumping, so it may be set to much higher values than is the desired code
10837 growth.
10839 @item tracer-min-branch-ratio
10841 Stop reverse growth when the reverse probability of best edge is less than this
10842 threshold (in percent).
10844 @item tracer-min-branch-probability
10845 @itemx tracer-min-branch-probability-feedback
10847 Stop forward growth if the best edge has probability lower than this
10848 threshold.
10850 Similarly to @option{tracer-dynamic-coverage} two parameters are
10851 provided.  @option{tracer-min-branch-probability-feedback} is used for
10852 compilation with profile feedback and @option{tracer-min-branch-probability}
10853 compilation without.  The value for compilation with profile feedback
10854 needs to be more conservative (higher) in order to make tracer
10855 effective.
10857 @item stack-clash-protection-guard-size
10858 Specify the size of the operating system provided stack guard as
10859 2 raised to @var{num} bytes.  The default value is 12 (4096 bytes).
10860 Acceptable values are between 12 and 30.  Higher values may reduce the
10861 number of explicit probes, but a value larger than the operating system
10862 provided guard will leave code vulnerable to stack clash style attacks.
10864 @item stack-clash-protection-probe-interval
10865 Stack clash protection involves probing stack space as it is allocated.  This
10866 param controls the maximum distance between probes into the stack as 2 raised
10867 to @var{num} bytes.  Acceptable values are between 10 and 16 and defaults to
10868 12.  Higher values may reduce the number of explicit probes, but a value
10869 larger than the operating system provided guard will leave code vulnerable to
10870 stack clash style attacks.
10872 @item max-cse-path-length
10874 The maximum number of basic blocks on path that CSE considers.
10875 The default is 10.
10877 @item max-cse-insns
10878 The maximum number of instructions CSE processes before flushing.
10879 The default is 1000.
10881 @item ggc-min-expand
10883 GCC uses a garbage collector to manage its own memory allocation.  This
10884 parameter specifies the minimum percentage by which the garbage
10885 collector's heap should be allowed to expand between collections.
10886 Tuning this may improve compilation speed; it has no effect on code
10887 generation.
10889 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
10890 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
10891 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10892 GCC is not able to calculate RAM on a particular platform, the lower
10893 bound of 30% is used.  Setting this parameter and
10894 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10895 every opportunity.  This is extremely slow, but can be useful for
10896 debugging.
10898 @item ggc-min-heapsize
10900 Minimum size of the garbage collector's heap before it begins bothering
10901 to collect garbage.  The first collection occurs after the heap expands
10902 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10903 tuning this may improve compilation speed, and has no effect on code
10904 generation.
10906 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10907 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10908 with a lower bound of 4096 (four megabytes) and an upper bound of
10909 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10910 particular platform, the lower bound is used.  Setting this parameter
10911 very large effectively disables garbage collection.  Setting this
10912 parameter and @option{ggc-min-expand} to zero causes a full collection
10913 to occur at every opportunity.
10915 @item max-reload-search-insns
10916 The maximum number of instruction reload should look backward for equivalent
10917 register.  Increasing values mean more aggressive optimization, making the
10918 compilation time increase with probably slightly better performance.
10919 The default value is 100.
10921 @item max-cselib-memory-locations
10922 The maximum number of memory locations cselib should take into account.
10923 Increasing values mean more aggressive optimization, making the compilation time
10924 increase with probably slightly better performance.  The default value is 500.
10926 @item max-sched-ready-insns
10927 The maximum number of instructions ready to be issued the scheduler should
10928 consider at any given time during the first scheduling pass.  Increasing
10929 values mean more thorough searches, making the compilation time increase
10930 with probably little benefit.  The default value is 100.
10932 @item max-sched-region-blocks
10933 The maximum number of blocks in a region to be considered for
10934 interblock scheduling.  The default value is 10.
10936 @item max-pipeline-region-blocks
10937 The maximum number of blocks in a region to be considered for
10938 pipelining in the selective scheduler.  The default value is 15.
10940 @item max-sched-region-insns
10941 The maximum number of insns in a region to be considered for
10942 interblock scheduling.  The default value is 100.
10944 @item max-pipeline-region-insns
10945 The maximum number of insns in a region to be considered for
10946 pipelining in the selective scheduler.  The default value is 200.
10948 @item min-spec-prob
10949 The minimum probability (in percents) of reaching a source block
10950 for interblock speculative scheduling.  The default value is 40.
10952 @item max-sched-extend-regions-iters
10953 The maximum number of iterations through CFG to extend regions.
10954 A value of 0 (the default) disables region extensions.
10956 @item max-sched-insn-conflict-delay
10957 The maximum conflict delay for an insn to be considered for speculative motion.
10958 The default value is 3.
10960 @item sched-spec-prob-cutoff
10961 The minimal probability of speculation success (in percents), so that
10962 speculative insns are scheduled.
10963 The default value is 40.
10965 @item sched-state-edge-prob-cutoff
10966 The minimum probability an edge must have for the scheduler to save its
10967 state across it.
10968 The default value is 10.
10970 @item sched-mem-true-dep-cost
10971 Minimal distance (in CPU cycles) between store and load targeting same
10972 memory locations.  The default value is 1.
10974 @item selsched-max-lookahead
10975 The maximum size of the lookahead window of selective scheduling.  It is a
10976 depth of search for available instructions.
10977 The default value is 50.
10979 @item selsched-max-sched-times
10980 The maximum number of times that an instruction is scheduled during
10981 selective scheduling.  This is the limit on the number of iterations
10982 through which the instruction may be pipelined.  The default value is 2.
10984 @item selsched-insns-to-rename
10985 The maximum number of best instructions in the ready list that are considered
10986 for renaming in the selective scheduler.  The default value is 2.
10988 @item sms-min-sc
10989 The minimum value of stage count that swing modulo scheduler
10990 generates.  The default value is 2.
10992 @item max-last-value-rtl
10993 The maximum size measured as number of RTLs that can be recorded in an expression
10994 in combiner for a pseudo register as last known value of that register.  The default
10995 is 10000.
10997 @item max-combine-insns
10998 The maximum number of instructions the RTL combiner tries to combine.
10999 The default value is 2 at @option{-Og} and 4 otherwise.
11001 @item integer-share-limit
11002 Small integer constants can use a shared data structure, reducing the
11003 compiler's memory usage and increasing its speed.  This sets the maximum
11004 value of a shared integer constant.  The default value is 256.
11006 @item ssp-buffer-size
11007 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
11008 protection when @option{-fstack-protection} is used.
11010 @item min-size-for-stack-sharing
11011 The minimum size of variables taking part in stack slot sharing when not
11012 optimizing. The default value is 32.
11014 @item max-jump-thread-duplication-stmts
11015 Maximum number of statements allowed in a block that needs to be
11016 duplicated when threading jumps.
11018 @item max-fields-for-field-sensitive
11019 Maximum number of fields in a structure treated in
11020 a field sensitive manner during pointer analysis.  The default is zero
11021 for @option{-O0} and @option{-O1},
11022 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
11024 @item prefetch-latency
11025 Estimate on average number of instructions that are executed before
11026 prefetch finishes.  The distance prefetched ahead is proportional
11027 to this constant.  Increasing this number may also lead to less
11028 streams being prefetched (see @option{simultaneous-prefetches}).
11030 @item simultaneous-prefetches
11031 Maximum number of prefetches that can run at the same time.
11033 @item l1-cache-line-size
11034 The size of cache line in L1 cache, in bytes.
11036 @item l1-cache-size
11037 The size of L1 cache, in kilobytes.
11039 @item l2-cache-size
11040 The size of L2 cache, in kilobytes.
11042 @item prefetch-dynamic-strides
11043 Whether the loop array prefetch pass should issue software prefetch hints
11044 for strides that are non-constant.  In some cases this may be
11045 beneficial, though the fact the stride is non-constant may make it
11046 hard to predict when there is clear benefit to issuing these hints.
11048 Set to 1, the default, if the prefetch hints should be issued for non-constant
11049 strides.  Set to 0 if prefetch hints should be issued only for strides that
11050 are known to be constant and below @option{prefetch-minimum-stride}.
11052 @item prefetch-minimum-stride
11053 Minimum constant stride, in bytes, to start using prefetch hints for.  If
11054 the stride is less than this threshold, prefetch hints will not be issued.
11056 This setting is useful for processors that have hardware prefetchers, in
11057 which case there may be conflicts between the hardware prefetchers and
11058 the software prefetchers.  If the hardware prefetchers have a maximum
11059 stride they can handle, it should be used here to improve the use of
11060 software prefetchers.
11062 A value of -1, the default, means we don't have a threshold and therefore
11063 prefetch hints can be issued for any constant stride.
11065 This setting is only useful for strides that are known and constant.
11067 @item loop-interchange-max-num-stmts
11068 The maximum number of stmts in a loop to be interchanged.
11070 @item loop-interchange-stride-ratio
11071 The minimum ratio between stride of two loops for interchange to be profitable.
11073 @item min-insn-to-prefetch-ratio
11074 The minimum ratio between the number of instructions and the
11075 number of prefetches to enable prefetching in a loop.
11077 @item prefetch-min-insn-to-mem-ratio
11078 The minimum ratio between the number of instructions and the
11079 number of memory references to enable prefetching in a loop.
11081 @item use-canonical-types
11082 Whether the compiler should use the ``canonical'' type system.  By
11083 default, this should always be 1, which uses a more efficient internal
11084 mechanism for comparing types in C++ and Objective-C++.  However, if
11085 bugs in the canonical type system are causing compilation failures,
11086 set this value to 0 to disable canonical types.
11088 @item switch-conversion-max-branch-ratio
11089 Switch initialization conversion refuses to create arrays that are
11090 bigger than @option{switch-conversion-max-branch-ratio} times the number of
11091 branches in the switch.
11093 @item max-partial-antic-length
11094 Maximum length of the partial antic set computed during the tree
11095 partial redundancy elimination optimization (@option{-ftree-pre}) when
11096 optimizing at @option{-O3} and above.  For some sorts of source code
11097 the enhanced partial redundancy elimination optimization can run away,
11098 consuming all of the memory available on the host machine.  This
11099 parameter sets a limit on the length of the sets that are computed,
11100 which prevents the runaway behavior.  Setting a value of 0 for
11101 this parameter allows an unlimited set length.
11103 @item rpo-vn-max-loop-depth
11104 Maximum loop depth that is value-numbered optimistically.  The default
11105 maximum loop depth is three.  When the limit hits the innermost
11106 @var{rpo-vn-max-loop-depth} loops and the outermost loop in the
11107 loop nest are value-numbered optimistically and the remaining ones not.
11108 The default maximum loop depth is seven.
11110 @item sccvn-max-alias-queries-per-access
11111 Maximum number of alias-oracle queries we perform when looking for
11112 redundancies for loads and stores.  If this limit is hit the search
11113 is aborted and the load or store is not considered redundant.  The
11114 number of queries is algorithmically limited to the number of
11115 stores on all paths from the load to the function entry.
11116 The default maximum number of queries is 1000.
11118 @item ira-max-loops-num
11119 IRA uses regional register allocation by default.  If a function
11120 contains more loops than the number given by this parameter, only at most
11121 the given number of the most frequently-executed loops form regions
11122 for regional register allocation.  The default value of the
11123 parameter is 100.
11125 @item ira-max-conflict-table-size 
11126 Although IRA uses a sophisticated algorithm to compress the conflict
11127 table, the table can still require excessive amounts of memory for
11128 huge functions.  If the conflict table for a function could be more
11129 than the size in MB given by this parameter, the register allocator
11130 instead uses a faster, simpler, and lower-quality
11131 algorithm that does not require building a pseudo-register conflict table.  
11132 The default value of the parameter is 2000.
11134 @item ira-loop-reserved-regs
11135 IRA can be used to evaluate more accurate register pressure in loops
11136 for decisions to move loop invariants (see @option{-O3}).  The number
11137 of available registers reserved for some other purposes is given
11138 by this parameter.  The default value of the parameter is 2, which is
11139 the minimal number of registers needed by typical instructions.
11140 This value is the best found from numerous experiments.
11142 @item lra-inheritance-ebb-probability-cutoff
11143 LRA tries to reuse values reloaded in registers in subsequent insns.
11144 This optimization is called inheritance.  EBB is used as a region to
11145 do this optimization.  The parameter defines a minimal fall-through
11146 edge probability in percentage used to add BB to inheritance EBB in
11147 LRA.  The default value of the parameter is 40.  The value was chosen
11148 from numerous runs of SPEC2000 on x86-64.
11150 @item loop-invariant-max-bbs-in-loop
11151 Loop invariant motion can be very expensive, both in compilation time and
11152 in amount of needed compile-time memory, with very large loops.  Loops
11153 with more basic blocks than this parameter won't have loop invariant
11154 motion optimization performed on them.  The default value of the
11155 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
11157 @item loop-max-datarefs-for-datadeps
11158 Building data dependencies is expensive for very large loops.  This
11159 parameter limits the number of data references in loops that are
11160 considered for data dependence analysis.  These large loops are no
11161 handled by the optimizations using loop data dependencies.
11162 The default value is 1000.
11164 @item max-vartrack-size
11165 Sets a maximum number of hash table slots to use during variable
11166 tracking dataflow analysis of any function.  If this limit is exceeded
11167 with variable tracking at assignments enabled, analysis for that
11168 function is retried without it, after removing all debug insns from
11169 the function.  If the limit is exceeded even without debug insns, var
11170 tracking analysis is completely disabled for the function.  Setting
11171 the parameter to zero makes it unlimited.
11173 @item max-vartrack-expr-depth
11174 Sets a maximum number of recursion levels when attempting to map
11175 variable names or debug temporaries to value expressions.  This trades
11176 compilation time for more complete debug information.  If this is set too
11177 low, value expressions that are available and could be represented in
11178 debug information may end up not being used; setting this higher may
11179 enable the compiler to find more complex debug expressions, but compile
11180 time and memory use may grow.  The default is 12.
11182 @item max-debug-marker-count
11183 Sets a threshold on the number of debug markers (e.g. begin stmt
11184 markers) to avoid complexity explosion at inlining or expanding to RTL.
11185 If a function has more such gimple stmts than the set limit, such stmts
11186 will be dropped from the inlined copy of a function, and from its RTL
11187 expansion.  The default is 100000.
11189 @item min-nondebug-insn-uid
11190 Use uids starting at this parameter for nondebug insns.  The range below
11191 the parameter is reserved exclusively for debug insns created by
11192 @option{-fvar-tracking-assignments}, but debug insns may get
11193 (non-overlapping) uids above it if the reserved range is exhausted.
11195 @item ipa-sra-ptr-growth-factor
11196 IPA-SRA replaces a pointer to an aggregate with one or more new
11197 parameters only when their cumulative size is less or equal to
11198 @option{ipa-sra-ptr-growth-factor} times the size of the original
11199 pointer parameter.
11201 @item sra-max-scalarization-size-Ospeed
11202 @itemx sra-max-scalarization-size-Osize
11203 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
11204 replace scalar parts of aggregates with uses of independent scalar
11205 variables.  These parameters control the maximum size, in storage units,
11206 of aggregate which is considered for replacement when compiling for
11207 speed
11208 (@option{sra-max-scalarization-size-Ospeed}) or size
11209 (@option{sra-max-scalarization-size-Osize}) respectively.
11211 @item tm-max-aggregate-size
11212 When making copies of thread-local variables in a transaction, this
11213 parameter specifies the size in bytes after which variables are
11214 saved with the logging functions as opposed to save/restore code
11215 sequence pairs.  This option only applies when using
11216 @option{-fgnu-tm}.
11218 @item graphite-max-nb-scop-params
11219 To avoid exponential effects in the Graphite loop transforms, the
11220 number of parameters in a Static Control Part (SCoP) is bounded.  The
11221 default value is 10 parameters, a value of zero can be used to lift
11222 the bound.  A variable whose value is unknown at compilation time and
11223 defined outside a SCoP is a parameter of the SCoP.
11225 @item loop-block-tile-size
11226 Loop blocking or strip mining transforms, enabled with
11227 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
11228 loop in the loop nest by a given number of iterations.  The strip
11229 length can be changed using the @option{loop-block-tile-size}
11230 parameter.  The default value is 51 iterations.
11232 @item loop-unroll-jam-size
11233 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
11234 default value is 4.
11236 @item loop-unroll-jam-depth
11237 Specify the dimension to be unrolled (counting from the most inner loop)
11238 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
11240 @item ipa-cp-value-list-size
11241 IPA-CP attempts to track all possible values and types passed to a function's
11242 parameter in order to propagate them and perform devirtualization.
11243 @option{ipa-cp-value-list-size} is the maximum number of values and types it
11244 stores per one formal parameter of a function.
11246 @item ipa-cp-eval-threshold
11247 IPA-CP calculates its own score of cloning profitability heuristics
11248 and performs those cloning opportunities with scores that exceed
11249 @option{ipa-cp-eval-threshold}.
11251 @item ipa-cp-recursion-penalty
11252 Percentage penalty the recursive functions will receive when they
11253 are evaluated for cloning.
11255 @item ipa-cp-single-call-penalty
11256 Percentage penalty functions containing a single call to another
11257 function will receive when they are evaluated for cloning.
11260 @item ipa-max-agg-items
11261 IPA-CP is also capable to propagate a number of scalar values passed
11262 in an aggregate. @option{ipa-max-agg-items} controls the maximum
11263 number of such values per one parameter.
11265 @item ipa-cp-loop-hint-bonus
11266 When IPA-CP determines that a cloning candidate would make the number
11267 of iterations of a loop known, it adds a bonus of
11268 @option{ipa-cp-loop-hint-bonus} to the profitability score of
11269 the candidate.
11271 @item ipa-cp-array-index-hint-bonus
11272 When IPA-CP determines that a cloning candidate would make the index of
11273 an array access known, it adds a bonus of
11274 @option{ipa-cp-array-index-hint-bonus} to the profitability
11275 score of the candidate.
11277 @item ipa-max-aa-steps
11278 During its analysis of function bodies, IPA-CP employs alias analysis
11279 in order to track values pointed to by function parameters.  In order
11280 not spend too much time analyzing huge functions, it gives up and
11281 consider all memory clobbered after examining
11282 @option{ipa-max-aa-steps} statements modifying memory.
11284 @item lto-partitions
11285 Specify desired number of partitions produced during WHOPR compilation.
11286 The number of partitions should exceed the number of CPUs used for compilation.
11287 The default value is 32.
11289 @item lto-min-partition
11290 Size of minimal partition for WHOPR (in estimated instructions).
11291 This prevents expenses of splitting very small programs into too many
11292 partitions.
11294 @item lto-max-partition
11295 Size of max partition for WHOPR (in estimated instructions).
11296 to provide an upper bound for individual size of partition.
11297 Meant to be used only with balanced partitioning.
11299 @item cxx-max-namespaces-for-diagnostic-help
11300 The maximum number of namespaces to consult for suggestions when C++
11301 name lookup fails for an identifier.  The default is 1000.
11303 @item sink-frequency-threshold
11304 The maximum relative execution frequency (in percents) of the target block
11305 relative to a statement's original block to allow statement sinking of a
11306 statement.  Larger numbers result in more aggressive statement sinking.
11307 The default value is 75.  A small positive adjustment is applied for
11308 statements with memory operands as those are even more profitable so sink.
11310 @item max-stores-to-sink
11311 The maximum number of conditional store pairs that can be sunk.  Set to 0
11312 if either vectorization (@option{-ftree-vectorize}) or if-conversion
11313 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
11315 @item allow-store-data-races
11316 Allow optimizers to introduce new data races on stores.
11317 Set to 1 to allow, otherwise to 0.  This option is enabled by default
11318 at optimization level @option{-Ofast}.
11320 @item case-values-threshold
11321 The smallest number of different values for which it is best to use a
11322 jump-table instead of a tree of conditional branches.  If the value is
11323 0, use the default for the machine.  The default is 0.
11325 @item tree-reassoc-width
11326 Set the maximum number of instructions executed in parallel in
11327 reassociated tree. This parameter overrides target dependent
11328 heuristics used by default if has non zero value.
11330 @item sched-pressure-algorithm
11331 Choose between the two available implementations of
11332 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
11333 and is the more likely to prevent instructions from being reordered.
11334 Algorithm 2 was designed to be a compromise between the relatively
11335 conservative approach taken by algorithm 1 and the rather aggressive
11336 approach taken by the default scheduler.  It relies more heavily on
11337 having a regular register file and accurate register pressure classes.
11338 See @file{haifa-sched.c} in the GCC sources for more details.
11340 The default choice depends on the target.
11342 @item max-slsr-cand-scan
11343 Set the maximum number of existing candidates that are considered when
11344 seeking a basis for a new straight-line strength reduction candidate.
11346 @item asan-globals
11347 Enable buffer overflow detection for global objects.  This kind
11348 of protection is enabled by default if you are using
11349 @option{-fsanitize=address} option.
11350 To disable global objects protection use @option{--param asan-globals=0}.
11352 @item asan-stack
11353 Enable buffer overflow detection for stack objects.  This kind of
11354 protection is enabled by default when using @option{-fsanitize=address}.
11355 To disable stack protection use @option{--param asan-stack=0} option.
11357 @item asan-instrument-reads
11358 Enable buffer overflow detection for memory reads.  This kind of
11359 protection is enabled by default when using @option{-fsanitize=address}.
11360 To disable memory reads protection use
11361 @option{--param asan-instrument-reads=0}.
11363 @item asan-instrument-writes
11364 Enable buffer overflow detection for memory writes.  This kind of
11365 protection is enabled by default when using @option{-fsanitize=address}.
11366 To disable memory writes protection use
11367 @option{--param asan-instrument-writes=0} option.
11369 @item asan-memintrin
11370 Enable detection for built-in functions.  This kind of protection
11371 is enabled by default when using @option{-fsanitize=address}.
11372 To disable built-in functions protection use
11373 @option{--param asan-memintrin=0}.
11375 @item asan-use-after-return
11376 Enable detection of use-after-return.  This kind of protection
11377 is enabled by default when using the @option{-fsanitize=address} option.
11378 To disable it use @option{--param asan-use-after-return=0}.
11380 Note: By default the check is disabled at run time.  To enable it,
11381 add @code{detect_stack_use_after_return=1} to the environment variable
11382 @env{ASAN_OPTIONS}.
11384 @item asan-instrumentation-with-call-threshold
11385 If number of memory accesses in function being instrumented
11386 is greater or equal to this number, use callbacks instead of inline checks.
11387 E.g. to disable inline code use
11388 @option{--param asan-instrumentation-with-call-threshold=0}.
11390 @item use-after-scope-direct-emission-threshold
11391 If the size of a local variable in bytes is smaller or equal to this
11392 number, directly poison (or unpoison) shadow memory instead of using
11393 run-time callbacks.  The default value is 256.
11395 @item max-fsm-thread-path-insns
11396 Maximum number of instructions to copy when duplicating blocks on a
11397 finite state automaton jump thread path.  The default is 100.
11399 @item max-fsm-thread-length
11400 Maximum number of basic blocks on a finite state automaton jump thread
11401 path.  The default is 10.
11403 @item max-fsm-thread-paths
11404 Maximum number of new jump thread paths to create for a finite state
11405 automaton.  The default is 50.
11407 @item parloops-chunk-size
11408 Chunk size of omp schedule for loops parallelized by parloops.  The default
11409 is 0.
11411 @item parloops-schedule
11412 Schedule type of omp schedule for loops parallelized by parloops (static,
11413 dynamic, guided, auto, runtime).  The default is static.
11415 @item parloops-min-per-thread
11416 The minimum number of iterations per thread of an innermost parallelized
11417 loop for which the parallelized variant is prefered over the single threaded
11418 one.  The default is 100.  Note that for a parallelized loop nest the
11419 minimum number of iterations of the outermost loop per thread is two.
11421 @item max-ssa-name-query-depth
11422 Maximum depth of recursion when querying properties of SSA names in things
11423 like fold routines.  One level of recursion corresponds to following a
11424 use-def chain.
11426 @item hsa-gen-debug-stores
11427 Enable emission of special debug stores within HSA kernels which are
11428 then read and reported by libgomp plugin.  Generation of these stores
11429 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
11430 enable it.
11432 @item max-speculative-devirt-maydefs
11433 The maximum number of may-defs we analyze when looking for a must-def
11434 specifying the dynamic type of an object that invokes a virtual call
11435 we may be able to devirtualize speculatively.
11437 @item max-vrp-switch-assertions
11438 The maximum number of assertions to add along the default edge of a switch
11439 statement during VRP.  The default is 10.
11441 @item unroll-jam-min-percent
11442 The minimum percentage of memory references that must be optimized
11443 away for the unroll-and-jam transformation to be considered profitable.
11445 @item unroll-jam-max-unroll
11446 The maximum number of times the outer loop should be unrolled by
11447 the unroll-and-jam transformation.
11448 @end table
11449 @end table
11451 @node Instrumentation Options
11452 @section Program Instrumentation Options
11453 @cindex instrumentation options
11454 @cindex program instrumentation options
11455 @cindex run-time error checking options
11456 @cindex profiling options
11457 @cindex options, program instrumentation
11458 @cindex options, run-time error checking
11459 @cindex options, profiling
11461 GCC supports a number of command-line options that control adding
11462 run-time instrumentation to the code it normally generates.  
11463 For example, one purpose of instrumentation is collect profiling
11464 statistics for use in finding program hot spots, code coverage
11465 analysis, or profile-guided optimizations.
11466 Another class of program instrumentation is adding run-time checking 
11467 to detect programming errors like invalid pointer
11468 dereferences or out-of-bounds array accesses, as well as deliberately
11469 hostile attacks such as stack smashing or C++ vtable hijacking.
11470 There is also a general hook which can be used to implement other
11471 forms of tracing or function-level instrumentation for debug or
11472 program analysis purposes.
11474 @table @gcctabopt
11475 @cindex @command{prof}
11476 @item -p
11477 @opindex p
11478 Generate extra code to write profile information suitable for the
11479 analysis program @command{prof}.  You must use this option when compiling
11480 the source files you want data about, and you must also use it when
11481 linking.
11483 @cindex @command{gprof}
11484 @item -pg
11485 @opindex pg
11486 Generate extra code to write profile information suitable for the
11487 analysis program @command{gprof}.  You must use this option when compiling
11488 the source files you want data about, and you must also use it when
11489 linking.
11491 @item -fprofile-arcs
11492 @opindex fprofile-arcs
11493 Add code so that program flow @dfn{arcs} are instrumented.  During
11494 execution the program records how many times each branch and call is
11495 executed and how many times it is taken or returns.  On targets that support
11496 constructors with priority support, profiling properly handles constructors,
11497 destructors and C++ constructors (and destructors) of classes which are used
11498 as a type of a global variable.
11500 When the compiled
11501 program exits it saves this data to a file called
11502 @file{@var{auxname}.gcda} for each source file.  The data may be used for
11503 profile-directed optimizations (@option{-fbranch-probabilities}), or for
11504 test coverage analysis (@option{-ftest-coverage}).  Each object file's
11505 @var{auxname} is generated from the name of the output file, if
11506 explicitly specified and it is not the final executable, otherwise it is
11507 the basename of the source file.  In both cases any suffix is removed
11508 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
11509 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
11510 @xref{Cross-profiling}.
11512 @cindex @command{gcov}
11513 @item --coverage
11514 @opindex coverage
11516 This option is used to compile and link code instrumented for coverage
11517 analysis.  The option is a synonym for @option{-fprofile-arcs}
11518 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
11519 linking).  See the documentation for those options for more details.
11521 @itemize
11523 @item
11524 Compile the source files with @option{-fprofile-arcs} plus optimization
11525 and code generation options.  For test coverage analysis, use the
11526 additional @option{-ftest-coverage} option.  You do not need to profile
11527 every source file in a program.
11529 @item
11530 Compile the source files additionally with @option{-fprofile-abs-path}
11531 to create absolute path names in the @file{.gcno} files.  This allows
11532 @command{gcov} to find the correct sources in projects where compilations
11533 occur with different working directories.
11535 @item
11536 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
11537 (the latter implies the former).
11539 @item
11540 Run the program on a representative workload to generate the arc profile
11541 information.  This may be repeated any number of times.  You can run
11542 concurrent instances of your program, and provided that the file system
11543 supports locking, the data files will be correctly updated.  Unless
11544 a strict ISO C dialect option is in effect, @code{fork} calls are
11545 detected and correctly handled without double counting.
11547 @item
11548 For profile-directed optimizations, compile the source files again with
11549 the same optimization and code generation options plus
11550 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
11551 Control Optimization}).
11553 @item
11554 For test coverage analysis, use @command{gcov} to produce human readable
11555 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
11556 @command{gcov} documentation for further information.
11558 @end itemize
11560 With @option{-fprofile-arcs}, for each function of your program GCC
11561 creates a program flow graph, then finds a spanning tree for the graph.
11562 Only arcs that are not on the spanning tree have to be instrumented: the
11563 compiler adds code to count the number of times that these arcs are
11564 executed.  When an arc is the only exit or only entrance to a block, the
11565 instrumentation code can be added to the block; otherwise, a new basic
11566 block must be created to hold the instrumentation code.
11568 @need 2000
11569 @item -ftest-coverage
11570 @opindex ftest-coverage
11571 Produce a notes file that the @command{gcov} code-coverage utility
11572 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
11573 show program coverage.  Each source file's note file is called
11574 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
11575 above for a description of @var{auxname} and instructions on how to
11576 generate test coverage data.  Coverage data matches the source files
11577 more closely if you do not optimize.
11579 @item -fprofile-abs-path
11580 @opindex fprofile-abs-path
11581 Automatically convert relative source file names to absolute path names
11582 in the @file{.gcno} files.  This allows @command{gcov} to find the correct
11583 sources in projects where compilations occur with different working
11584 directories.
11586 @item -fprofile-dir=@var{path}
11587 @opindex fprofile-dir
11589 Set the directory to search for the profile data files in to @var{path}.
11590 This option affects only the profile data generated by
11591 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
11592 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
11593 and its related options.  Both absolute and relative paths can be used.
11594 By default, GCC uses the current directory as @var{path}, thus the
11595 profile data file appears in the same directory as the object file.
11596 In order to prevent the file name clashing, if the object file name is
11597 not an absolute path, we mangle the absolute path of the
11598 @file{@var{sourcename}.gcda} file and use it as the file name of a
11599 @file{.gcda} file.
11601 When an executable is run in a massive parallel environment, it is recommended
11602 to save profile to different folders.  That can be done with variables
11603 in @var{path} that are exported during run-time:
11605 @table @gcctabopt
11607 @item %p
11608 process ID.
11610 @item %q@{VAR@}
11611 value of environment variable @var{VAR}
11613 @end table
11615 @item -fprofile-generate
11616 @itemx -fprofile-generate=@var{path}
11617 @opindex fprofile-generate
11619 Enable options usually used for instrumenting application to produce
11620 profile useful for later recompilation with profile feedback based
11621 optimization.  You must use @option{-fprofile-generate} both when
11622 compiling and when linking your program.
11624 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
11626 If @var{path} is specified, GCC looks at the @var{path} to find
11627 the profile feedback data files. See @option{-fprofile-dir}.
11629 To optimize the program based on the collected profile information, use
11630 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
11632 @item -fprofile-update=@var{method}
11633 @opindex fprofile-update
11635 Alter the update method for an application instrumented for profile
11636 feedback based optimization.  The @var{method} argument should be one of
11637 @samp{single}, @samp{atomic} or @samp{prefer-atomic}.
11638 The first one is useful for single-threaded applications,
11639 while the second one prevents profile corruption by emitting thread-safe code.
11641 @strong{Warning:} When an application does not properly join all threads
11642 (or creates an detached thread), a profile file can be still corrupted.
11644 Using @samp{prefer-atomic} would be transformed either to @samp{atomic},
11645 when supported by a target, or to @samp{single} otherwise.  The GCC driver
11646 automatically selects @samp{prefer-atomic} when @option{-pthread}
11647 is present in the command line.
11649 @item -fsanitize=address
11650 @opindex fsanitize=address
11651 Enable AddressSanitizer, a fast memory error detector.
11652 Memory access instructions are instrumented to detect
11653 out-of-bounds and use-after-free bugs.
11654 The option enables @option{-fsanitize-address-use-after-scope}.
11655 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
11656 more details.  The run-time behavior can be influenced using the
11657 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
11658 the available options are shown at startup of the instrumented program.  See
11659 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
11660 for a list of supported options.
11661 The option cannot be combined with @option{-fsanitize=thread}.
11663 @item -fsanitize=kernel-address
11664 @opindex fsanitize=kernel-address
11665 Enable AddressSanitizer for Linux kernel.
11666 See @uref{https://github.com/google/kasan/wiki} for more details.
11668 @item -fsanitize=pointer-compare
11669 @opindex fsanitize=pointer-compare
11670 Instrument comparison operation (<, <=, >, >=) with pointer operands.
11671 The option must be combined with either @option{-fsanitize=kernel-address} or
11672 @option{-fsanitize=address}
11673 The option cannot be combined with @option{-fsanitize=thread}.
11674 Note: By default the check is disabled at run time.  To enable it,
11675 add @code{detect_invalid_pointer_pairs=2} to the environment variable
11676 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
11677 invalid operation only when both pointers are non-null.
11679 @item -fsanitize=pointer-subtract
11680 @opindex fsanitize=pointer-subtract
11681 Instrument subtraction with pointer operands.
11682 The option must be combined with either @option{-fsanitize=kernel-address} or
11683 @option{-fsanitize=address}
11684 The option cannot be combined with @option{-fsanitize=thread}.
11685 Note: By default the check is disabled at run time.  To enable it,
11686 add @code{detect_invalid_pointer_pairs=2} to the environment variable
11687 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
11688 invalid operation only when both pointers are non-null.
11690 @item -fsanitize=thread
11691 @opindex fsanitize=thread
11692 Enable ThreadSanitizer, a fast data race detector.
11693 Memory access instructions are instrumented to detect
11694 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
11695 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
11696 environment variable; see
11697 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
11698 supported options.
11699 The option cannot be combined with @option{-fsanitize=address},
11700 @option{-fsanitize=leak}.
11702 Note that sanitized atomic builtins cannot throw exceptions when
11703 operating on invalid memory addresses with non-call exceptions
11704 (@option{-fnon-call-exceptions}).
11706 @item -fsanitize=leak
11707 @opindex fsanitize=leak
11708 Enable LeakSanitizer, a memory leak detector.
11709 This option only matters for linking of executables and
11710 the executable is linked against a library that overrides @code{malloc}
11711 and other allocator functions.  See
11712 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
11713 details.  The run-time behavior can be influenced using the
11714 @env{LSAN_OPTIONS} environment variable.
11715 The option cannot be combined with @option{-fsanitize=thread}.
11717 @item -fsanitize=undefined
11718 @opindex fsanitize=undefined
11719 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
11720 Various computations are instrumented to detect undefined behavior
11721 at runtime.  Current suboptions are:
11723 @table @gcctabopt
11725 @item -fsanitize=shift
11726 @opindex fsanitize=shift
11727 This option enables checking that the result of a shift operation is
11728 not undefined.  Note that what exactly is considered undefined differs
11729 slightly between C and C++, as well as between ISO C90 and C99, etc.
11730 This option has two suboptions, @option{-fsanitize=shift-base} and
11731 @option{-fsanitize=shift-exponent}.
11733 @item -fsanitize=shift-exponent
11734 @opindex fsanitize=shift-exponent
11735 This option enables checking that the second argument of a shift operation
11736 is not negative and is smaller than the precision of the promoted first
11737 argument.
11739 @item -fsanitize=shift-base
11740 @opindex fsanitize=shift-base
11741 If the second argument of a shift operation is within range, check that the
11742 result of a shift operation is not undefined.  Note that what exactly is
11743 considered undefined differs slightly between C and C++, as well as between
11744 ISO C90 and C99, etc.
11746 @item -fsanitize=integer-divide-by-zero
11747 @opindex fsanitize=integer-divide-by-zero
11748 Detect integer division by zero as well as @code{INT_MIN / -1} division.
11750 @item -fsanitize=unreachable
11751 @opindex fsanitize=unreachable
11752 With this option, the compiler turns the @code{__builtin_unreachable}
11753 call into a diagnostics message call instead.  When reaching the
11754 @code{__builtin_unreachable} call, the behavior is undefined.
11756 @item -fsanitize=vla-bound
11757 @opindex fsanitize=vla-bound
11758 This option instructs the compiler to check that the size of a variable
11759 length array is positive.
11761 @item -fsanitize=null
11762 @opindex fsanitize=null
11763 This option enables pointer checking.  Particularly, the application
11764 built with this option turned on will issue an error message when it
11765 tries to dereference a NULL pointer, or if a reference (possibly an
11766 rvalue reference) is bound to a NULL pointer, or if a method is invoked
11767 on an object pointed by a NULL pointer.
11769 @item -fsanitize=return
11770 @opindex fsanitize=return
11771 This option enables return statement checking.  Programs
11772 built with this option turned on will issue an error message
11773 when the end of a non-void function is reached without actually
11774 returning a value.  This option works in C++ only.
11776 @item -fsanitize=signed-integer-overflow
11777 @opindex fsanitize=signed-integer-overflow
11778 This option enables signed integer overflow checking.  We check that
11779 the result of @code{+}, @code{*}, and both unary and binary @code{-}
11780 does not overflow in the signed arithmetics.  Note, integer promotion
11781 rules must be taken into account.  That is, the following is not an
11782 overflow:
11783 @smallexample
11784 signed char a = SCHAR_MAX;
11785 a++;
11786 @end smallexample
11788 @item -fsanitize=bounds
11789 @opindex fsanitize=bounds
11790 This option enables instrumentation of array bounds.  Various out of bounds
11791 accesses are detected.  Flexible array members, flexible array member-like
11792 arrays, and initializers of variables with static storage are not instrumented.
11794 @item -fsanitize=bounds-strict
11795 @opindex fsanitize=bounds-strict
11796 This option enables strict instrumentation of array bounds.  Most out of bounds
11797 accesses are detected, including flexible array members and flexible array
11798 member-like arrays.  Initializers of variables with static storage are not
11799 instrumented.
11801 @item -fsanitize=alignment
11802 @opindex fsanitize=alignment
11804 This option enables checking of alignment of pointers when they are
11805 dereferenced, or when a reference is bound to insufficiently aligned target,
11806 or when a method or constructor is invoked on insufficiently aligned object.
11808 @item -fsanitize=object-size
11809 @opindex fsanitize=object-size
11810 This option enables instrumentation of memory references using the
11811 @code{__builtin_object_size} function.  Various out of bounds pointer
11812 accesses are detected.
11814 @item -fsanitize=float-divide-by-zero
11815 @opindex fsanitize=float-divide-by-zero
11816 Detect floating-point division by zero.  Unlike other similar options,
11817 @option{-fsanitize=float-divide-by-zero} is not enabled by
11818 @option{-fsanitize=undefined}, since floating-point division by zero can
11819 be a legitimate way of obtaining infinities and NaNs.
11821 @item -fsanitize=float-cast-overflow
11822 @opindex fsanitize=float-cast-overflow
11823 This option enables floating-point type to integer conversion checking.
11824 We check that the result of the conversion does not overflow.
11825 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
11826 not enabled by @option{-fsanitize=undefined}.
11827 This option does not work well with @code{FE_INVALID} exceptions enabled.
11829 @item -fsanitize=nonnull-attribute
11830 @opindex fsanitize=nonnull-attribute
11832 This option enables instrumentation of calls, checking whether null values
11833 are not passed to arguments marked as requiring a non-null value by the
11834 @code{nonnull} function attribute.
11836 @item -fsanitize=returns-nonnull-attribute
11837 @opindex fsanitize=returns-nonnull-attribute
11839 This option enables instrumentation of return statements in functions
11840 marked with @code{returns_nonnull} function attribute, to detect returning
11841 of null values from such functions.
11843 @item -fsanitize=bool
11844 @opindex fsanitize=bool
11846 This option enables instrumentation of loads from bool.  If a value other
11847 than 0/1 is loaded, a run-time error is issued.
11849 @item -fsanitize=enum
11850 @opindex fsanitize=enum
11852 This option enables instrumentation of loads from an enum type.  If
11853 a value outside the range of values for the enum type is loaded,
11854 a run-time error is issued.
11856 @item -fsanitize=vptr
11857 @opindex fsanitize=vptr
11859 This option enables instrumentation of C++ member function calls, member
11860 accesses and some conversions between pointers to base and derived classes,
11861 to verify the referenced object has the correct dynamic type.
11863 @item -fsanitize=pointer-overflow
11864 @opindex fsanitize=pointer-overflow
11866 This option enables instrumentation of pointer arithmetics.  If the pointer
11867 arithmetics overflows, a run-time error is issued.
11869 @item -fsanitize=builtin
11870 @opindex fsanitize=builtin
11872 This option enables instrumentation of arguments to selected builtin
11873 functions.  If an invalid value is passed to such arguments, a run-time
11874 error is issued.  E.g.@ passing 0 as the argument to @code{__builtin_ctz}
11875 or @code{__builtin_clz} invokes undefined behavior and is diagnosed
11876 by this option.
11878 @end table
11880 While @option{-ftrapv} causes traps for signed overflows to be emitted,
11881 @option{-fsanitize=undefined} gives a diagnostic message.
11882 This currently works only for the C family of languages.
11884 @item -fno-sanitize=all
11885 @opindex fno-sanitize=all
11887 This option disables all previously enabled sanitizers.
11888 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
11889 together.
11891 @item -fasan-shadow-offset=@var{number}
11892 @opindex fasan-shadow-offset
11893 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
11894 It is useful for experimenting with different shadow memory layouts in
11895 Kernel AddressSanitizer.
11897 @item -fsanitize-sections=@var{s1},@var{s2},...
11898 @opindex fsanitize-sections
11899 Sanitize global variables in selected user-defined sections.  @var{si} may
11900 contain wildcards.
11902 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
11903 @opindex fsanitize-recover
11904 @opindex fno-sanitize-recover
11905 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
11906 mentioned in comma-separated list of @var{opts}.  Enabling this option
11907 for a sanitizer component causes it to attempt to continue
11908 running the program as if no error happened.  This means multiple
11909 runtime errors can be reported in a single program run, and the exit
11910 code of the program may indicate success even when errors
11911 have been reported.  The @option{-fno-sanitize-recover=} option
11912 can be used to alter
11913 this behavior: only the first detected error is reported
11914 and program then exits with a non-zero exit code.
11916 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
11917 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
11918 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
11919 @option{-fsanitize=bounds-strict},
11920 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
11921 For these sanitizers error recovery is turned on by default,
11922 except @option{-fsanitize=address}, for which this feature is experimental.
11923 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
11924 accepted, the former enables recovery for all sanitizers that support it,
11925 the latter disables recovery for all sanitizers that support it.
11927 Even if a recovery mode is turned on the compiler side, it needs to be also
11928 enabled on the runtime library side, otherwise the failures are still fatal.
11929 The runtime library defaults to @code{halt_on_error=0} for
11930 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
11931 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
11932 setting the @code{halt_on_error} flag in the corresponding environment variable.
11934 Syntax without an explicit @var{opts} parameter is deprecated.  It is
11935 equivalent to specifying an @var{opts} list of:
11937 @smallexample
11938 undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
11939 @end smallexample
11941 @item -fsanitize-address-use-after-scope
11942 @opindex fsanitize-address-use-after-scope
11943 Enable sanitization of local variables to detect use-after-scope bugs.
11944 The option sets @option{-fstack-reuse} to @samp{none}.
11946 @item -fsanitize-undefined-trap-on-error
11947 @opindex fsanitize-undefined-trap-on-error
11948 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
11949 report undefined behavior using @code{__builtin_trap} rather than
11950 a @code{libubsan} library routine.  The advantage of this is that the
11951 @code{libubsan} library is not needed and is not linked in, so this
11952 is usable even in freestanding environments.
11954 @item -fsanitize-coverage=trace-pc
11955 @opindex fsanitize-coverage=trace-pc
11956 Enable coverage-guided fuzzing code instrumentation.
11957 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
11959 @item -fsanitize-coverage=trace-cmp
11960 @opindex fsanitize-coverage=trace-cmp
11961 Enable dataflow guided fuzzing code instrumentation.
11962 Inserts a call to @code{__sanitizer_cov_trace_cmp1},
11963 @code{__sanitizer_cov_trace_cmp2}, @code{__sanitizer_cov_trace_cmp4} or
11964 @code{__sanitizer_cov_trace_cmp8} for integral comparison with both operands
11965 variable or @code{__sanitizer_cov_trace_const_cmp1},
11966 @code{__sanitizer_cov_trace_const_cmp2},
11967 @code{__sanitizer_cov_trace_const_cmp4} or
11968 @code{__sanitizer_cov_trace_const_cmp8} for integral comparison with one
11969 operand constant, @code{__sanitizer_cov_trace_cmpf} or
11970 @code{__sanitizer_cov_trace_cmpd} for float or double comparisons and
11971 @code{__sanitizer_cov_trace_switch} for switch statements.
11973 @item -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]}
11974 @opindex fcf-protection
11975 Enable code instrumentation of control-flow transfers to increase
11976 program security by checking that target addresses of control-flow
11977 transfer instructions (such as indirect function call, function return,
11978 indirect jump) are valid.  This prevents diverting the flow of control
11979 to an unexpected target.  This is intended to protect against such
11980 threats as Return-oriented Programming (ROP), and similarly
11981 call/jmp-oriented programming (COP/JOP).
11983 The value @code{branch} tells the compiler to implement checking of
11984 validity of control-flow transfer at the point of indirect branch
11985 instructions, i.e. call/jmp instructions.  The value @code{return}
11986 implements checking of validity at the point of returning from a
11987 function.  The value @code{full} is an alias for specifying both
11988 @code{branch} and @code{return}. The value @code{none} turns off
11989 instrumentation.
11991 The macro @code{__CET__} is defined when @option{-fcf-protection} is
11992 used.  The first bit of @code{__CET__} is set to 1 for the value
11993 @code{branch} and the second bit of @code{__CET__} is set to 1 for
11994 the @code{return}.
11996 You can also use the @code{nocf_check} attribute to identify
11997 which functions and calls should be skipped from instrumentation
11998 (@pxref{Function Attributes}).
12000 Currently the x86 GNU/Linux target provides an implementation based
12001 on Intel Control-flow Enforcement Technology (CET).
12003 @item -fstack-protector
12004 @opindex fstack-protector
12005 Emit extra code to check for buffer overflows, such as stack smashing
12006 attacks.  This is done by adding a guard variable to functions with
12007 vulnerable objects.  This includes functions that call @code{alloca}, and
12008 functions with buffers larger than 8 bytes.  The guards are initialized
12009 when a function is entered and then checked when the function exits.
12010 If a guard check fails, an error message is printed and the program exits.
12012 @item -fstack-protector-all
12013 @opindex fstack-protector-all
12014 Like @option{-fstack-protector} except that all functions are protected.
12016 @item -fstack-protector-strong
12017 @opindex fstack-protector-strong
12018 Like @option{-fstack-protector} but includes additional functions to
12019 be protected --- those that have local array definitions, or have
12020 references to local frame addresses.
12022 @item -fstack-protector-explicit
12023 @opindex fstack-protector-explicit
12024 Like @option{-fstack-protector} but only protects those functions which
12025 have the @code{stack_protect} attribute.
12027 @item -fstack-check
12028 @opindex fstack-check
12029 Generate code to verify that you do not go beyond the boundary of the
12030 stack.  You should specify this flag if you are running in an
12031 environment with multiple threads, but you only rarely need to specify it in
12032 a single-threaded environment since stack overflow is automatically
12033 detected on nearly all systems if there is only one stack.
12035 Note that this switch does not actually cause checking to be done; the
12036 operating system or the language runtime must do that.  The switch causes
12037 generation of code to ensure that they see the stack being extended.
12039 You can additionally specify a string parameter: @samp{no} means no
12040 checking, @samp{generic} means force the use of old-style checking,
12041 @samp{specific} means use the best checking method and is equivalent
12042 to bare @option{-fstack-check}.
12044 Old-style checking is a generic mechanism that requires no specific
12045 target support in the compiler but comes with the following drawbacks:
12047 @enumerate
12048 @item
12049 Modified allocation strategy for large objects: they are always
12050 allocated dynamically if their size exceeds a fixed threshold.  Note this
12051 may change the semantics of some code.
12053 @item
12054 Fixed limit on the size of the static frame of functions: when it is
12055 topped by a particular function, stack checking is not reliable and
12056 a warning is issued by the compiler.
12058 @item
12059 Inefficiency: because of both the modified allocation strategy and the
12060 generic implementation, code performance is hampered.
12061 @end enumerate
12063 Note that old-style stack checking is also the fallback method for
12064 @samp{specific} if no target support has been added in the compiler.
12066 @samp{-fstack-check=} is designed for Ada's needs to detect infinite recursion
12067 and stack overflows.  @samp{specific} is an excellent choice when compiling
12068 Ada code.  It is not generally sufficient to protect against stack-clash
12069 attacks.  To protect against those you want @samp{-fstack-clash-protection}.
12071 @item -fstack-clash-protection
12072 @opindex fstack-clash-protection
12073 Generate code to prevent stack clash style attacks.  When this option is
12074 enabled, the compiler will only allocate one page of stack space at a time
12075 and each page is accessed immediately after allocation.  Thus, it prevents
12076 allocations from jumping over any stack guard page provided by the
12077 operating system.
12079 Most targets do not fully support stack clash protection.  However, on
12080 those targets @option{-fstack-clash-protection} will protect dynamic stack
12081 allocations.  @option{-fstack-clash-protection} may also provide limited
12082 protection for static stack allocations if the target supports
12083 @option{-fstack-check=specific}.
12085 @item -fstack-limit-register=@var{reg}
12086 @itemx -fstack-limit-symbol=@var{sym}
12087 @itemx -fno-stack-limit
12088 @opindex fstack-limit-register
12089 @opindex fstack-limit-symbol
12090 @opindex fno-stack-limit
12091 Generate code to ensure that the stack does not grow beyond a certain value,
12092 either the value of a register or the address of a symbol.  If a larger
12093 stack is required, a signal is raised at run time.  For most targets,
12094 the signal is raised before the stack overruns the boundary, so
12095 it is possible to catch the signal without taking special precautions.
12097 For instance, if the stack starts at absolute address @samp{0x80000000}
12098 and grows downwards, you can use the flags
12099 @option{-fstack-limit-symbol=__stack_limit} and
12100 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
12101 of 128KB@.  Note that this may only work with the GNU linker.
12103 You can locally override stack limit checking by using the
12104 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
12106 @item -fsplit-stack
12107 @opindex fsplit-stack
12108 Generate code to automatically split the stack before it overflows.
12109 The resulting program has a discontiguous stack which can only
12110 overflow if the program is unable to allocate any more memory.  This
12111 is most useful when running threaded programs, as it is no longer
12112 necessary to calculate a good stack size to use for each thread.  This
12113 is currently only implemented for the x86 targets running
12114 GNU/Linux.
12116 When code compiled with @option{-fsplit-stack} calls code compiled
12117 without @option{-fsplit-stack}, there may not be much stack space
12118 available for the latter code to run.  If compiling all code,
12119 including library code, with @option{-fsplit-stack} is not an option,
12120 then the linker can fix up these calls so that the code compiled
12121 without @option{-fsplit-stack} always has a large stack.  Support for
12122 this is implemented in the gold linker in GNU binutils release 2.21
12123 and later.
12125 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
12126 @opindex fvtable-verify
12127 This option is only available when compiling C++ code.
12128 It turns on (or off, if using @option{-fvtable-verify=none}) the security
12129 feature that verifies at run time, for every virtual call, that
12130 the vtable pointer through which the call is made is valid for the type of
12131 the object, and has not been corrupted or overwritten.  If an invalid vtable
12132 pointer is detected at run time, an error is reported and execution of the
12133 program is immediately halted.
12135 This option causes run-time data structures to be built at program startup,
12136 which are used for verifying the vtable pointers.  
12137 The options @samp{std} and @samp{preinit}
12138 control the timing of when these data structures are built.  In both cases the
12139 data structures are built before execution reaches @code{main}.  Using
12140 @option{-fvtable-verify=std} causes the data structures to be built after
12141 shared libraries have been loaded and initialized.
12142 @option{-fvtable-verify=preinit} causes them to be built before shared
12143 libraries have been loaded and initialized.
12145 If this option appears multiple times in the command line with different
12146 values specified, @samp{none} takes highest priority over both @samp{std} and
12147 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
12149 @item -fvtv-debug
12150 @opindex fvtv-debug
12151 When used in conjunction with @option{-fvtable-verify=std} or 
12152 @option{-fvtable-verify=preinit}, causes debug versions of the 
12153 runtime functions for the vtable verification feature to be called.  
12154 This flag also causes the compiler to log information about which 
12155 vtable pointers it finds for each class.
12156 This information is written to a file named @file{vtv_set_ptr_data.log} 
12157 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
12158 if that is defined or the current working directory otherwise.
12160 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
12161 file, be sure to delete any existing one.
12163 @item -fvtv-counts
12164 @opindex fvtv-counts
12165 This is a debugging flag.  When used in conjunction with
12166 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
12167 causes the compiler to keep track of the total number of virtual calls
12168 it encounters and the number of verifications it inserts.  It also
12169 counts the number of calls to certain run-time library functions
12170 that it inserts and logs this information for each compilation unit.
12171 The compiler writes this information to a file named
12172 @file{vtv_count_data.log} in the directory named by the environment
12173 variable @env{VTV_LOGS_DIR} if that is defined or the current working
12174 directory otherwise.  It also counts the size of the vtable pointer sets
12175 for each class, and writes this information to @file{vtv_class_set_sizes.log}
12176 in the same directory.
12178 Note:  This feature @emph{appends} data to the log files.  To get fresh log
12179 files, be sure to delete any existing ones.
12181 @item -finstrument-functions
12182 @opindex finstrument-functions
12183 Generate instrumentation calls for entry and exit to functions.  Just
12184 after function entry and just before function exit, the following
12185 profiling functions are called with the address of the current
12186 function and its call site.  (On some platforms,
12187 @code{__builtin_return_address} does not work beyond the current
12188 function, so the call site information may not be available to the
12189 profiling functions otherwise.)
12191 @smallexample
12192 void __cyg_profile_func_enter (void *this_fn,
12193                                void *call_site);
12194 void __cyg_profile_func_exit  (void *this_fn,
12195                                void *call_site);
12196 @end smallexample
12198 The first argument is the address of the start of the current function,
12199 which may be looked up exactly in the symbol table.
12201 This instrumentation is also done for functions expanded inline in other
12202 functions.  The profiling calls indicate where, conceptually, the
12203 inline function is entered and exited.  This means that addressable
12204 versions of such functions must be available.  If all your uses of a
12205 function are expanded inline, this may mean an additional expansion of
12206 code size.  If you use @code{extern inline} in your C code, an
12207 addressable version of such functions must be provided.  (This is
12208 normally the case anyway, but if you get lucky and the optimizer always
12209 expands the functions inline, you might have gotten away without
12210 providing static copies.)
12212 A function may be given the attribute @code{no_instrument_function}, in
12213 which case this instrumentation is not done.  This can be used, for
12214 example, for the profiling functions listed above, high-priority
12215 interrupt routines, and any functions from which the profiling functions
12216 cannot safely be called (perhaps signal handlers, if the profiling
12217 routines generate output or allocate memory).
12219 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
12220 @opindex finstrument-functions-exclude-file-list
12222 Set the list of functions that are excluded from instrumentation (see
12223 the description of @option{-finstrument-functions}).  If the file that
12224 contains a function definition matches with one of @var{file}, then
12225 that function is not instrumented.  The match is done on substrings:
12226 if the @var{file} parameter is a substring of the file name, it is
12227 considered to be a match.
12229 For example:
12231 @smallexample
12232 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
12233 @end smallexample
12235 @noindent
12236 excludes any inline function defined in files whose pathnames
12237 contain @file{/bits/stl} or @file{include/sys}.
12239 If, for some reason, you want to include letter @samp{,} in one of
12240 @var{sym}, write @samp{\,}. For example,
12241 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
12242 (note the single quote surrounding the option).
12244 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
12245 @opindex finstrument-functions-exclude-function-list
12247 This is similar to @option{-finstrument-functions-exclude-file-list},
12248 but this option sets the list of function names to be excluded from
12249 instrumentation.  The function name to be matched is its user-visible
12250 name, such as @code{vector<int> blah(const vector<int> &)}, not the
12251 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
12252 match is done on substrings: if the @var{sym} parameter is a substring
12253 of the function name, it is considered to be a match.  For C99 and C++
12254 extended identifiers, the function name must be given in UTF-8, not
12255 using universal character names.
12257 @item -fpatchable-function-entry=@var{N}[,@var{M}]
12258 @opindex fpatchable-function-entry
12259 Generate @var{N} NOPs right at the beginning
12260 of each function, with the function entry point before the @var{M}th NOP.
12261 If @var{M} is omitted, it defaults to @code{0} so the
12262 function entry points to the address just at the first NOP.
12263 The NOP instructions reserve extra space which can be used to patch in
12264 any desired instrumentation at run time, provided that the code segment
12265 is writable.  The amount of space is controllable indirectly via
12266 the number of NOPs; the NOP instruction used corresponds to the instruction
12267 emitted by the internal GCC back-end interface @code{gen_nop}.  This behavior
12268 is target-specific and may also depend on the architecture variant and/or
12269 other compilation options.
12271 For run-time identification, the starting addresses of these areas,
12272 which correspond to their respective function entries minus @var{M},
12273 are additionally collected in the @code{__patchable_function_entries}
12274 section of the resulting binary.
12276 Note that the value of @code{__attribute__ ((patchable_function_entry
12277 (N,M)))} takes precedence over command-line option
12278 @option{-fpatchable-function-entry=N,M}.  This can be used to increase
12279 the area size or to remove it completely on a single function.
12280 If @code{N=0}, no pad location is recorded.
12282 The NOP instructions are inserted at---and maybe before, depending on
12283 @var{M}---the function entry address, even before the prologue.
12285 @end table
12288 @node Preprocessor Options
12289 @section Options Controlling the Preprocessor
12290 @cindex preprocessor options
12291 @cindex options, preprocessor
12293 These options control the C preprocessor, which is run on each C source
12294 file before actual compilation.
12296 If you use the @option{-E} option, nothing is done except preprocessing.
12297 Some of these options make sense only together with @option{-E} because
12298 they cause the preprocessor output to be unsuitable for actual
12299 compilation.
12301 In addition to the options listed here, there are a number of options 
12302 to control search paths for include files documented in 
12303 @ref{Directory Options}.  
12304 Options to control preprocessor diagnostics are listed in 
12305 @ref{Warning Options}.
12307 @table @gcctabopt
12308 @include cppopts.texi
12310 @item -Wp,@var{option}
12311 @opindex Wp
12312 You can use @option{-Wp,@var{option}} to bypass the compiler driver
12313 and pass @var{option} directly through to the preprocessor.  If
12314 @var{option} contains commas, it is split into multiple options at the
12315 commas.  However, many options are modified, translated or interpreted
12316 by the compiler driver before being passed to the preprocessor, and
12317 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
12318 interface is undocumented and subject to change, so whenever possible
12319 you should avoid using @option{-Wp} and let the driver handle the
12320 options instead.
12322 @item -Xpreprocessor @var{option}
12323 @opindex Xpreprocessor
12324 Pass @var{option} as an option to the preprocessor.  You can use this to
12325 supply system-specific preprocessor options that GCC does not 
12326 recognize.
12328 If you want to pass an option that takes an argument, you must use
12329 @option{-Xpreprocessor} twice, once for the option and once for the argument.
12331 @item -no-integrated-cpp
12332 @opindex no-integrated-cpp
12333 Perform preprocessing as a separate pass before compilation.
12334 By default, GCC performs preprocessing as an integrated part of
12335 input tokenization and parsing.
12336 If this option is provided, the appropriate language front end
12337 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
12338 and Objective-C, respectively) is instead invoked twice,
12339 once for preprocessing only and once for actual compilation
12340 of the preprocessed input.
12341 This option may be useful in conjunction with the @option{-B} or
12342 @option{-wrapper} options to specify an alternate preprocessor or
12343 perform additional processing of the program source between
12344 normal preprocessing and compilation.
12346 @end table
12348 @node Assembler Options
12349 @section Passing Options to the Assembler
12351 @c prevent bad page break with this line
12352 You can pass options to the assembler.
12354 @table @gcctabopt
12355 @item -Wa,@var{option}
12356 @opindex Wa
12357 Pass @var{option} as an option to the assembler.  If @var{option}
12358 contains commas, it is split into multiple options at the commas.
12360 @item -Xassembler @var{option}
12361 @opindex Xassembler
12362 Pass @var{option} as an option to the assembler.  You can use this to
12363 supply system-specific assembler options that GCC does not
12364 recognize.
12366 If you want to pass an option that takes an argument, you must use
12367 @option{-Xassembler} twice, once for the option and once for the argument.
12369 @end table
12371 @node Link Options
12372 @section Options for Linking
12373 @cindex link options
12374 @cindex options, linking
12376 These options come into play when the compiler links object files into
12377 an executable output file.  They are meaningless if the compiler is
12378 not doing a link step.
12380 @table @gcctabopt
12381 @cindex file names
12382 @item @var{object-file-name}
12383 A file name that does not end in a special recognized suffix is
12384 considered to name an object file or library.  (Object files are
12385 distinguished from libraries by the linker according to the file
12386 contents.)  If linking is done, these object files are used as input
12387 to the linker.
12389 @item -c
12390 @itemx -S
12391 @itemx -E
12392 @opindex c
12393 @opindex S
12394 @opindex E
12395 If any of these options is used, then the linker is not run, and
12396 object file names should not be used as arguments.  @xref{Overall
12397 Options}.
12399 @item -flinker-output=@var{type}
12400 @opindex -flinker-output
12401 This option controls the code generation of the link time optimizer.  By
12402 default the linker output is determined by the linker plugin automatically. For
12403 debugging the compiler and in the case of incremental linking to non-lto object
12404 file is desired, it may be useful to control the type manually.
12406 If @var{type} is @samp{exec} the code generation is configured to produce static
12407 binary. In this case @option{-fpic} and @option{-fpie} are both disabled.
12409 If @var{type} is @samp{dyn} the code generation is configured to produce shared
12410 library. In this case @option{-fpic} or @option{-fPIC} is preserved, but not
12411 enabled automatically.  This makes it possible to build shared libraries without
12412 position independent code on architectures this is possible, i.e. on x86.
12414 If @var{type} is @samp{pie} the code generation is configured to produce
12415 @option{-fpie} executable. This result in similar optimizations as @samp{exec}
12416 except that @option{-fpie} is not disabled if specified at compilation time.
12418 If @var{type} is @samp{rel} the compiler assumes that incremental linking is
12419 done.  The sections containing intermediate code for link-time optimization are
12420 merged, pre-optimized, and output to the resulting object file. In addition, if
12421 @option{-ffat-lto-objects} is specified the binary code is produced for future
12422 non-lto linking. The object file produced by incremental linking will be smaller
12423 than a static library produced from the same object files.  At link-time the
12424 result of incremental linking will also load faster to compiler than a static
12425 library assuming that majority of objects in the library are used.
12427 Finally @samp{nolto-rel} configure compiler to for incremental linking where
12428 code generation is forced, final binary is produced and the intermediate code
12429 for later link-time optimization is stripped. When multiple object files are
12430 linked together the resulting code will be optimized better than with link time
12431 optimizations disabled (for example, the cross-module inlining will happen),
12432 most of benefits of whole program optimizations are however lost. 
12434 During the incremental link (by @option{-r}) the linker plugin will default to
12435 @option{rel}. With current interfaces to GNU Binutils it is however not
12436 possible to link incrementally LTO objects and non-LTO objects into a single
12437 mixed object file.  In the case any of object files in incremental link can not
12438 be used for link-time optimization the linker plugin will output warning and
12439 use @samp{nolto-rel}. To maintain the whole program optimization it is
12440 recommended to link such objects into static library instead. Alternatively it
12441 is possible to use H.J. Lu's binutils with support for mixed objects.
12443 @item -fuse-ld=bfd
12444 @opindex fuse-ld=bfd
12445 Use the @command{bfd} linker instead of the default linker.
12447 @item -fuse-ld=gold
12448 @opindex fuse-ld=gold
12449 Use the @command{gold} linker instead of the default linker.
12451 @cindex Libraries
12452 @item -l@var{library}
12453 @itemx -l @var{library}
12454 @opindex l
12455 Search the library named @var{library} when linking.  (The second
12456 alternative with the library as a separate argument is only for
12457 POSIX compliance and is not recommended.)
12459 It makes a difference where in the command you write this option; the
12460 linker searches and processes libraries and object files in the order they
12461 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
12462 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
12463 to functions in @samp{z}, those functions may not be loaded.
12465 The linker searches a standard list of directories for the library,
12466 which is actually a file named @file{lib@var{library}.a}.  The linker
12467 then uses this file as if it had been specified precisely by name.
12469 The directories searched include several standard system directories
12470 plus any that you specify with @option{-L}.
12472 Normally the files found this way are library files---archive files
12473 whose members are object files.  The linker handles an archive file by
12474 scanning through it for members which define symbols that have so far
12475 been referenced but not defined.  But if the file that is found is an
12476 ordinary object file, it is linked in the usual fashion.  The only
12477 difference between using an @option{-l} option and specifying a file name
12478 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
12479 and searches several directories.
12481 @item -lobjc
12482 @opindex lobjc
12483 You need this special case of the @option{-l} option in order to
12484 link an Objective-C or Objective-C++ program.
12486 @item -nostartfiles
12487 @opindex nostartfiles
12488 Do not use the standard system startup files when linking.
12489 The standard system libraries are used normally, unless @option{-nostdlib},
12490 @option{-nolibc}, or @option{-nodefaultlibs} is used.
12492 @item -nodefaultlibs
12493 @opindex nodefaultlibs
12494 Do not use the standard system libraries when linking.
12495 Only the libraries you specify are passed to the linker, and options
12496 specifying linkage of the system libraries, such as @option{-static-libgcc}
12497 or @option{-shared-libgcc}, are ignored.  
12498 The standard startup files are used normally, unless @option{-nostartfiles}
12499 is used.  
12501 The compiler may generate calls to @code{memcmp},
12502 @code{memset}, @code{memcpy} and @code{memmove}.
12503 These entries are usually resolved by entries in
12504 libc.  These entry points should be supplied through some other
12505 mechanism when this option is specified.
12507 @item -nolibc
12508 @opindex nolibc
12509 Do not use the C library or system libraries tightly coupled with it when
12510 linking.  Still link with the startup files, @file{libgcc} or toolchain
12511 provided language support libraries such as @file{libgnat}, @file{libgfortran}
12512 or @file{libstdc++} unless options preventing their inclusion are used as
12513 well.  This typically removes @option{-lc} from the link command line, as well
12514 as system libraries that normally go with it and become meaningless when
12515 absence of a C library is assumed, for example @option{-lpthread} or
12516 @option{-lm} in some configurations.  This is intended for bare-board
12517 targets when there is indeed no C library available.
12519 @item -nostdlib
12520 @opindex nostdlib
12521 Do not use the standard system startup files or libraries when linking.
12522 No startup files and only the libraries you specify are passed to
12523 the linker, and options specifying linkage of the system libraries, such as
12524 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
12526 The compiler may generate calls to @code{memcmp}, @code{memset},
12527 @code{memcpy} and @code{memmove}.
12528 These entries are usually resolved by entries in
12529 libc.  These entry points should be supplied through some other
12530 mechanism when this option is specified.
12532 @cindex @option{-lgcc}, use with @option{-nostdlib}
12533 @cindex @option{-nostdlib} and unresolved references
12534 @cindex unresolved references and @option{-nostdlib}
12535 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
12536 @cindex @option{-nodefaultlibs} and unresolved references
12537 @cindex unresolved references and @option{-nodefaultlibs}
12538 One of the standard libraries bypassed by @option{-nostdlib} and
12539 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
12540 which GCC uses to overcome shortcomings of particular machines, or special
12541 needs for some languages.
12542 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
12543 Collection (GCC) Internals},
12544 for more discussion of @file{libgcc.a}.)
12545 In most cases, you need @file{libgcc.a} even when you want to avoid
12546 other standard libraries.  In other words, when you specify @option{-nostdlib}
12547 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
12548 This ensures that you have no unresolved references to internal GCC
12549 library subroutines.
12550 (An example of such an internal subroutine is @code{__main}, used to ensure C++
12551 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
12552 GNU Compiler Collection (GCC) Internals}.)
12554 @item -pie
12555 @opindex pie
12556 Produce a dynamically linked position independent executable on targets
12557 that support it.  For predictable results, you must also specify the same
12558 set of options used for compilation (@option{-fpie}, @option{-fPIE},
12559 or model suboptions) when you specify this linker option.
12561 @item -no-pie
12562 @opindex no-pie
12563 Don't produce a dynamically linked position independent executable.
12565 @item -static-pie
12566 @opindex static-pie
12567 Produce a static position independent executable on targets that support
12568 it.  A static position independent executable is similar to a static
12569 executable, but can be loaded at any address without a dynamic linker.
12570 For predictable results, you must also specify the same set of options
12571 used for compilation (@option{-fpie}, @option{-fPIE}, or model
12572 suboptions) when you specify this linker option.
12574 @item -pthread
12575 @opindex pthread
12576 Link with the POSIX threads library.  This option is supported on 
12577 GNU/Linux targets, most other Unix derivatives, and also on 
12578 x86 Cygwin and MinGW targets.  On some targets this option also sets 
12579 flags for the preprocessor, so it should be used consistently for both
12580 compilation and linking.
12582 @item -rdynamic
12583 @opindex rdynamic
12584 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
12585 that support it. This instructs the linker to add all symbols, not
12586 only used ones, to the dynamic symbol table. This option is needed
12587 for some uses of @code{dlopen} or to allow obtaining backtraces
12588 from within a program.
12590 @item -s
12591 @opindex s
12592 Remove all symbol table and relocation information from the executable.
12594 @item -static
12595 @opindex static
12596 On systems that support dynamic linking, this overrides @option{-pie}
12597 and prevents linking with the shared libraries.  On other systems, this
12598 option has no effect.
12600 @item -shared
12601 @opindex shared
12602 Produce a shared object which can then be linked with other objects to
12603 form an executable.  Not all systems support this option.  For predictable
12604 results, you must also specify the same set of options used for compilation
12605 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
12606 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
12607 needs to build supplementary stub code for constructors to work.  On
12608 multi-libbed systems, @samp{gcc -shared} must select the correct support
12609 libraries to link against.  Failing to supply the correct flags may lead
12610 to subtle defects.  Supplying them in cases where they are not necessary
12611 is innocuous.}
12613 @item -shared-libgcc
12614 @itemx -static-libgcc
12615 @opindex shared-libgcc
12616 @opindex static-libgcc
12617 On systems that provide @file{libgcc} as a shared library, these options
12618 force the use of either the shared or static version, respectively.
12619 If no shared version of @file{libgcc} was built when the compiler was
12620 configured, these options have no effect.
12622 There are several situations in which an application should use the
12623 shared @file{libgcc} instead of the static version.  The most common
12624 of these is when the application wishes to throw and catch exceptions
12625 across different shared libraries.  In that case, each of the libraries
12626 as well as the application itself should use the shared @file{libgcc}.
12628 Therefore, the G++ driver automatically adds @option{-shared-libgcc}
12629 whenever you build a shared library or a main executable, because C++
12630 programs typically use exceptions, so this is the right thing to do.
12632 If, instead, you use the GCC driver to create shared libraries, you may
12633 find that they are not always linked with the shared @file{libgcc}.
12634 If GCC finds, at its configuration time, that you have a non-GNU linker
12635 or a GNU linker that does not support option @option{--eh-frame-hdr},
12636 it links the shared version of @file{libgcc} into shared libraries
12637 by default.  Otherwise, it takes advantage of the linker and optimizes
12638 away the linking with the shared version of @file{libgcc}, linking with
12639 the static version of libgcc by default.  This allows exceptions to
12640 propagate through such shared libraries, without incurring relocation
12641 costs at library load time.
12643 However, if a library or main executable is supposed to throw or catch
12644 exceptions, you must link it using the G++ driver, or using the option
12645 @option{-shared-libgcc}, such that it is linked with the shared
12646 @file{libgcc}.
12648 @item -static-libasan
12649 @opindex static-libasan
12650 When the @option{-fsanitize=address} option is used to link a program,
12651 the GCC driver automatically links against @option{libasan}.  If
12652 @file{libasan} is available as a shared library, and the @option{-static}
12653 option is not used, then this links against the shared version of
12654 @file{libasan}.  The @option{-static-libasan} option directs the GCC
12655 driver to link @file{libasan} statically, without necessarily linking
12656 other libraries statically.
12658 @item -static-libtsan
12659 @opindex static-libtsan
12660 When the @option{-fsanitize=thread} option is used to link a program,
12661 the GCC driver automatically links against @option{libtsan}.  If
12662 @file{libtsan} is available as a shared library, and the @option{-static}
12663 option is not used, then this links against the shared version of
12664 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
12665 driver to link @file{libtsan} statically, without necessarily linking
12666 other libraries statically.
12668 @item -static-liblsan
12669 @opindex static-liblsan
12670 When the @option{-fsanitize=leak} option is used to link a program,
12671 the GCC driver automatically links against @option{liblsan}.  If
12672 @file{liblsan} is available as a shared library, and the @option{-static}
12673 option is not used, then this links against the shared version of
12674 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
12675 driver to link @file{liblsan} statically, without necessarily linking
12676 other libraries statically.
12678 @item -static-libubsan
12679 @opindex static-libubsan
12680 When the @option{-fsanitize=undefined} option is used to link a program,
12681 the GCC driver automatically links against @option{libubsan}.  If
12682 @file{libubsan} is available as a shared library, and the @option{-static}
12683 option is not used, then this links against the shared version of
12684 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
12685 driver to link @file{libubsan} statically, without necessarily linking
12686 other libraries statically.
12688 @item -static-libstdc++
12689 @opindex static-libstdc++
12690 When the @command{g++} program is used to link a C++ program, it
12691 normally automatically links against @option{libstdc++}.  If
12692 @file{libstdc++} is available as a shared library, and the
12693 @option{-static} option is not used, then this links against the
12694 shared version of @file{libstdc++}.  That is normally fine.  However, it
12695 is sometimes useful to freeze the version of @file{libstdc++} used by
12696 the program without going all the way to a fully static link.  The
12697 @option{-static-libstdc++} option directs the @command{g++} driver to
12698 link @file{libstdc++} statically, without necessarily linking other
12699 libraries statically.
12701 @item -symbolic
12702 @opindex symbolic
12703 Bind references to global symbols when building a shared object.  Warn
12704 about any unresolved references (unless overridden by the link editor
12705 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
12706 this option.
12708 @item -T @var{script}
12709 @opindex T
12710 @cindex linker script
12711 Use @var{script} as the linker script.  This option is supported by most
12712 systems using the GNU linker.  On some targets, such as bare-board
12713 targets without an operating system, the @option{-T} option may be required
12714 when linking to avoid references to undefined symbols.
12716 @item -Xlinker @var{option}
12717 @opindex Xlinker
12718 Pass @var{option} as an option to the linker.  You can use this to
12719 supply system-specific linker options that GCC does not recognize.
12721 If you want to pass an option that takes a separate argument, you must use
12722 @option{-Xlinker} twice, once for the option and once for the argument.
12723 For example, to pass @option{-assert definitions}, you must write
12724 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
12725 @option{-Xlinker "-assert definitions"}, because this passes the entire
12726 string as a single argument, which is not what the linker expects.
12728 When using the GNU linker, it is usually more convenient to pass
12729 arguments to linker options using the @option{@var{option}=@var{value}}
12730 syntax than as separate arguments.  For example, you can specify
12731 @option{-Xlinker -Map=output.map} rather than
12732 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
12733 this syntax for command-line options.
12735 @item -Wl,@var{option}
12736 @opindex Wl
12737 Pass @var{option} as an option to the linker.  If @var{option} contains
12738 commas, it is split into multiple options at the commas.  You can use this
12739 syntax to pass an argument to the option.
12740 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
12741 linker.  When using the GNU linker, you can also get the same effect with
12742 @option{-Wl,-Map=output.map}.
12744 @item -u @var{symbol}
12745 @opindex u
12746 Pretend the symbol @var{symbol} is undefined, to force linking of
12747 library modules to define it.  You can use @option{-u} multiple times with
12748 different symbols to force loading of additional library modules.
12750 @item -z @var{keyword}
12751 @opindex z
12752 @option{-z} is passed directly on to the linker along with the keyword
12753 @var{keyword}. See the section in the documentation of your linker for
12754 permitted values and their meanings.
12755 @end table
12757 @node Directory Options
12758 @section Options for Directory Search
12759 @cindex directory options
12760 @cindex options, directory search
12761 @cindex search path
12763 These options specify directories to search for header files, for
12764 libraries and for parts of the compiler:
12766 @table @gcctabopt
12767 @include cppdiropts.texi
12769 @item -iplugindir=@var{dir}
12770 @opindex iplugindir=
12771 Set the directory to search for plugins that are passed
12772 by @option{-fplugin=@var{name}} instead of
12773 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
12774 to be used by the user, but only passed by the driver.
12776 @item -L@var{dir}
12777 @opindex L
12778 Add directory @var{dir} to the list of directories to be searched
12779 for @option{-l}.
12781 @item -B@var{prefix}
12782 @opindex B
12783 This option specifies where to find the executables, libraries,
12784 include files, and data files of the compiler itself.
12786 The compiler driver program runs one or more of the subprograms
12787 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
12788 @var{prefix} as a prefix for each program it tries to run, both with and
12789 without @samp{@var{machine}/@var{version}/} for the corresponding target
12790 machine and compiler version.
12792 For each subprogram to be run, the compiler driver first tries the
12793 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
12794 is not specified, the driver tries two standard prefixes, 
12795 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
12796 those results in a file name that is found, the unmodified program
12797 name is searched for using the directories specified in your
12798 @env{PATH} environment variable.
12800 The compiler checks to see if the path provided by @option{-B}
12801 refers to a directory, and if necessary it adds a directory
12802 separator character at the end of the path.
12804 @option{-B} prefixes that effectively specify directory names also apply
12805 to libraries in the linker, because the compiler translates these
12806 options into @option{-L} options for the linker.  They also apply to
12807 include files in the preprocessor, because the compiler translates these
12808 options into @option{-isystem} options for the preprocessor.  In this case,
12809 the compiler appends @samp{include} to the prefix.
12811 The runtime support file @file{libgcc.a} can also be searched for using
12812 the @option{-B} prefix, if needed.  If it is not found there, the two
12813 standard prefixes above are tried, and that is all.  The file is left
12814 out of the link if it is not found by those means.
12816 Another way to specify a prefix much like the @option{-B} prefix is to use
12817 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
12818 Variables}.
12820 As a special kludge, if the path provided by @option{-B} is
12821 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
12822 9, then it is replaced by @file{[dir/]include}.  This is to help
12823 with boot-strapping the compiler.
12825 @item -no-canonical-prefixes
12826 @opindex no-canonical-prefixes
12827 Do not expand any symbolic links, resolve references to @samp{/../}
12828 or @samp{/./}, or make the path absolute when generating a relative
12829 prefix.
12831 @item --sysroot=@var{dir}
12832 @opindex sysroot
12833 Use @var{dir} as the logical root directory for headers and libraries.
12834 For example, if the compiler normally searches for headers in
12835 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
12836 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
12838 If you use both this option and the @option{-isysroot} option, then
12839 the @option{--sysroot} option applies to libraries, but the
12840 @option{-isysroot} option applies to header files.
12842 The GNU linker (beginning with version 2.16) has the necessary support
12843 for this option.  If your linker does not support this option, the
12844 header file aspect of @option{--sysroot} still works, but the
12845 library aspect does not.
12847 @item --no-sysroot-suffix
12848 @opindex no-sysroot-suffix
12849 For some targets, a suffix is added to the root directory specified
12850 with @option{--sysroot}, depending on the other options used, so that
12851 headers may for example be found in
12852 @file{@var{dir}/@var{suffix}/usr/include} instead of
12853 @file{@var{dir}/usr/include}.  This option disables the addition of
12854 such a suffix.
12856 @end table
12858 @node Code Gen Options
12859 @section Options for Code Generation Conventions
12860 @cindex code generation conventions
12861 @cindex options, code generation
12862 @cindex run-time options
12864 These machine-independent options control the interface conventions
12865 used in code generation.
12867 Most of them have both positive and negative forms; the negative form
12868 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
12869 one of the forms is listed---the one that is not the default.  You
12870 can figure out the other form by either removing @samp{no-} or adding
12873 @table @gcctabopt
12874 @item -fstack-reuse=@var{reuse-level}
12875 @opindex fstack_reuse
12876 This option controls stack space reuse for user declared local/auto variables
12877 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
12878 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
12879 local variables and temporaries, @samp{named_vars} enables the reuse only for
12880 user defined local variables with names, and @samp{none} disables stack reuse
12881 completely. The default value is @samp{all}. The option is needed when the
12882 program extends the lifetime of a scoped local variable or a compiler generated
12883 temporary beyond the end point defined by the language.  When a lifetime of
12884 a variable ends, and if the variable lives in memory, the optimizing compiler
12885 has the freedom to reuse its stack space with other temporaries or scoped
12886 local variables whose live range does not overlap with it. Legacy code extending
12887 local lifetime is likely to break with the stack reuse optimization.
12889 For example,
12891 @smallexample
12892    int *p;
12893    @{
12894      int local1;
12896      p = &local1;
12897      local1 = 10;
12898      ....
12899    @}
12900    @{
12901       int local2;
12902       local2 = 20;
12903       ...
12904    @}
12906    if (*p == 10)  // out of scope use of local1
12907      @{
12909      @}
12910 @end smallexample
12912 Another example:
12913 @smallexample
12915    struct A
12916    @{
12917        A(int k) : i(k), j(k) @{ @}
12918        int i;
12919        int j;
12920    @};
12922    A *ap;
12924    void foo(const A& ar)
12925    @{
12926       ap = &ar;
12927    @}
12929    void bar()
12930    @{
12931       foo(A(10)); // temp object's lifetime ends when foo returns
12933       @{
12934         A a(20);
12935         ....
12936       @}
12937       ap->i+= 10;  // ap references out of scope temp whose space
12938                    // is reused with a. What is the value of ap->i?
12939    @}
12941 @end smallexample
12943 The lifetime of a compiler generated temporary is well defined by the C++
12944 standard. When a lifetime of a temporary ends, and if the temporary lives
12945 in memory, the optimizing compiler has the freedom to reuse its stack
12946 space with other temporaries or scoped local variables whose live range
12947 does not overlap with it. However some of the legacy code relies on
12948 the behavior of older compilers in which temporaries' stack space is
12949 not reused, the aggressive stack reuse can lead to runtime errors. This
12950 option is used to control the temporary stack reuse optimization.
12952 @item -ftrapv
12953 @opindex ftrapv
12954 This option generates traps for signed overflow on addition, subtraction,
12955 multiplication operations.
12956 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
12957 @option{-ftrapv} @option{-fwrapv} on the command-line results in
12958 @option{-fwrapv} being effective.  Note that only active options override, so
12959 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
12960 results in @option{-ftrapv} being effective.
12962 @item -fwrapv
12963 @opindex fwrapv
12964 This option instructs the compiler to assume that signed arithmetic
12965 overflow of addition, subtraction and multiplication wraps around
12966 using twos-complement representation.  This flag enables some optimizations
12967 and disables others.
12968 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
12969 @option{-ftrapv} @option{-fwrapv} on the command-line results in
12970 @option{-fwrapv} being effective.  Note that only active options override, so
12971 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
12972 results in @option{-ftrapv} being effective.
12974 @item -fwrapv-pointer
12975 @opindex fwrapv-pointer
12976 This option instructs the compiler to assume that pointer arithmetic
12977 overflow on addition and subtraction wraps around using twos-complement
12978 representation.  This flag disables some optimizations which assume
12979 pointer overflow is invalid.
12981 @item -fstrict-overflow
12982 @opindex fstrict-overflow
12983 This option implies @option{-fno-wrapv} @option{-fno-wrapv-pointer} and when
12984 negated implies @option{-fwrapv} @option{-fwrapv-pointer}.
12986 @item -fexceptions
12987 @opindex fexceptions
12988 Enable exception handling.  Generates extra code needed to propagate
12989 exceptions.  For some targets, this implies GCC generates frame
12990 unwind information for all functions, which can produce significant data
12991 size overhead, although it does not affect execution.  If you do not
12992 specify this option, GCC enables it by default for languages like
12993 C++ that normally require exception handling, and disables it for
12994 languages like C that do not normally require it.  However, you may need
12995 to enable this option when compiling C code that needs to interoperate
12996 properly with exception handlers written in C++.  You may also wish to
12997 disable this option if you are compiling older C++ programs that don't
12998 use exception handling.
13000 @item -fnon-call-exceptions
13001 @opindex fnon-call-exceptions
13002 Generate code that allows trapping instructions to throw exceptions.
13003 Note that this requires platform-specific runtime support that does
13004 not exist everywhere.  Moreover, it only allows @emph{trapping}
13005 instructions to throw exceptions, i.e.@: memory references or floating-point
13006 instructions.  It does not allow exceptions to be thrown from
13007 arbitrary signal handlers such as @code{SIGALRM}.
13009 @item -fdelete-dead-exceptions
13010 @opindex fdelete-dead-exceptions
13011 Consider that instructions that may throw exceptions but don't otherwise
13012 contribute to the execution of the program can be optimized away.
13013 This option is enabled by default for the Ada front end, as permitted by
13014 the Ada language specification.
13015 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
13017 @item -funwind-tables
13018 @opindex funwind-tables
13019 Similar to @option{-fexceptions}, except that it just generates any needed
13020 static data, but does not affect the generated code in any other way.
13021 You normally do not need to enable this option; instead, a language processor
13022 that needs this handling enables it on your behalf.
13024 @item -fasynchronous-unwind-tables
13025 @opindex fasynchronous-unwind-tables
13026 Generate unwind table in DWARF format, if supported by target machine.  The
13027 table is exact at each instruction boundary, so it can be used for stack
13028 unwinding from asynchronous events (such as debugger or garbage collector).
13030 @item -fno-gnu-unique
13031 @opindex fno-gnu-unique
13032 On systems with recent GNU assembler and C library, the C++ compiler
13033 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
13034 of template static data members and static local variables in inline
13035 functions are unique even in the presence of @code{RTLD_LOCAL}; this
13036 is necessary to avoid problems with a library used by two different
13037 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
13038 therefore disagreeing with the other one about the binding of the
13039 symbol.  But this causes @code{dlclose} to be ignored for affected
13040 DSOs; if your program relies on reinitialization of a DSO via
13041 @code{dlclose} and @code{dlopen}, you can use
13042 @option{-fno-gnu-unique}.
13044 @item -fpcc-struct-return
13045 @opindex fpcc-struct-return
13046 Return ``short'' @code{struct} and @code{union} values in memory like
13047 longer ones, rather than in registers.  This convention is less
13048 efficient, but it has the advantage of allowing intercallability between
13049 GCC-compiled files and files compiled with other compilers, particularly
13050 the Portable C Compiler (pcc).
13052 The precise convention for returning structures in memory depends
13053 on the target configuration macros.
13055 Short structures and unions are those whose size and alignment match
13056 that of some integer type.
13058 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13059 switch is not binary compatible with code compiled with the
13060 @option{-freg-struct-return} switch.
13061 Use it to conform to a non-default application binary interface.
13063 @item -freg-struct-return
13064 @opindex freg-struct-return
13065 Return @code{struct} and @code{union} values in registers when possible.
13066 This is more efficient for small structures than
13067 @option{-fpcc-struct-return}.
13069 If you specify neither @option{-fpcc-struct-return} nor
13070 @option{-freg-struct-return}, GCC defaults to whichever convention is
13071 standard for the target.  If there is no standard convention, GCC
13072 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
13073 the principal compiler.  In those cases, we can choose the standard, and
13074 we chose the more efficient register return alternative.
13076 @strong{Warning:} code compiled with the @option{-freg-struct-return}
13077 switch is not binary compatible with code compiled with the
13078 @option{-fpcc-struct-return} switch.
13079 Use it to conform to a non-default application binary interface.
13081 @item -fshort-enums
13082 @opindex fshort-enums
13083 Allocate to an @code{enum} type only as many bytes as it needs for the
13084 declared range of possible values.  Specifically, the @code{enum} type
13085 is equivalent to the smallest integer type that has enough room.
13087 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
13088 code that is not binary compatible with code generated without that switch.
13089 Use it to conform to a non-default application binary interface.
13091 @item -fshort-wchar
13092 @opindex fshort-wchar
13093 Override the underlying type for @code{wchar_t} to be @code{short
13094 unsigned int} instead of the default for the target.  This option is
13095 useful for building programs to run under WINE@.
13097 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
13098 code that is not binary compatible with code generated without that switch.
13099 Use it to conform to a non-default application binary interface.
13101 @item -fno-common
13102 @opindex fno-common
13103 @cindex tentative definitions
13104 In C code, this option controls the placement of global variables 
13105 defined without an initializer, known as @dfn{tentative definitions} 
13106 in the C standard.  Tentative definitions are distinct from declarations 
13107 of a variable with the @code{extern} keyword, which do not allocate storage.
13109 Unix C compilers have traditionally allocated storage for
13110 uninitialized global variables in a common block.  This allows the
13111 linker to resolve all tentative definitions of the same variable
13112 in different compilation units to the same object, or to a non-tentative
13113 definition.  
13114 This is the behavior specified by @option{-fcommon}, and is the default for 
13115 GCC on most targets.  
13116 On the other hand, this behavior is not required by ISO
13117 C, and on some targets may carry a speed or code size penalty on
13118 variable references.
13120 The @option{-fno-common} option specifies that the compiler should instead
13121 place uninitialized global variables in the data section of the object file.
13122 This inhibits the merging of tentative definitions by the linker so
13123 you get a multiple-definition error if the same 
13124 variable is defined in more than one compilation unit.
13125 Compiling with @option{-fno-common} is useful on targets for which
13126 it provides better performance, or if you wish to verify that the
13127 program will work on other systems that always treat uninitialized
13128 variable definitions this way.
13130 @item -fno-ident
13131 @opindex fno-ident
13132 Ignore the @code{#ident} directive.
13134 @item -finhibit-size-directive
13135 @opindex finhibit-size-directive
13136 Don't output a @code{.size} assembler directive, or anything else that
13137 would cause trouble if the function is split in the middle, and the
13138 two halves are placed at locations far apart in memory.  This option is
13139 used when compiling @file{crtstuff.c}; you should not need to use it
13140 for anything else.
13142 @item -fverbose-asm
13143 @opindex fverbose-asm
13144 Put extra commentary information in the generated assembly code to
13145 make it more readable.  This option is generally only of use to those
13146 who actually need to read the generated assembly code (perhaps while
13147 debugging the compiler itself).
13149 @option{-fno-verbose-asm}, the default, causes the
13150 extra information to be omitted and is useful when comparing two assembler
13151 files.
13153 The added comments include:
13155 @itemize @bullet
13157 @item
13158 information on the compiler version and command-line options,
13160 @item
13161 the source code lines associated with the assembly instructions,
13162 in the form FILENAME:LINENUMBER:CONTENT OF LINE,
13164 @item
13165 hints on which high-level expressions correspond to
13166 the various assembly instruction operands.
13168 @end itemize
13170 For example, given this C source file:
13172 @smallexample
13173 int test (int n)
13175   int i;
13176   int total = 0;
13178   for (i = 0; i < n; i++)
13179     total += i * i;
13181   return total;
13183 @end smallexample
13185 compiling to (x86_64) assembly via @option{-S} and emitting the result
13186 direct to stdout via @option{-o} @option{-}
13188 @smallexample
13189 gcc -S test.c -fverbose-asm -Os -o -
13190 @end smallexample
13192 gives output similar to this:
13194 @smallexample
13195         .file   "test.c"
13196 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
13197   [...snip...]
13198 # options passed:
13199   [...snip...]
13201         .text
13202         .globl  test
13203         .type   test, @@function
13204 test:
13205 .LFB0:
13206         .cfi_startproc
13207 # test.c:4:   int total = 0;
13208         xorl    %eax, %eax      # <retval>
13209 # test.c:6:   for (i = 0; i < n; i++)
13210         xorl    %edx, %edx      # i
13211 .L2:
13212 # test.c:6:   for (i = 0; i < n; i++)
13213         cmpl    %edi, %edx      # n, i
13214         jge     .L5     #,
13215 # test.c:7:     total += i * i;
13216         movl    %edx, %ecx      # i, tmp92
13217         imull   %edx, %ecx      # i, tmp92
13218 # test.c:6:   for (i = 0; i < n; i++)
13219         incl    %edx    # i
13220 # test.c:7:     total += i * i;
13221         addl    %ecx, %eax      # tmp92, <retval>
13222         jmp     .L2     #
13223 .L5:
13224 # test.c:10: @}
13225         ret
13226         .cfi_endproc
13227 .LFE0:
13228         .size   test, .-test
13229         .ident  "GCC: (GNU) 7.0.0 20160809 (experimental)"
13230         .section        .note.GNU-stack,"",@@progbits
13231 @end smallexample
13233 The comments are intended for humans rather than machines and hence the
13234 precise format of the comments is subject to change.
13236 @item -frecord-gcc-switches
13237 @opindex frecord-gcc-switches
13238 This switch causes the command line used to invoke the
13239 compiler to be recorded into the object file that is being created.
13240 This switch is only implemented on some targets and the exact format
13241 of the recording is target and binary file format dependent, but it
13242 usually takes the form of a section containing ASCII text.  This
13243 switch is related to the @option{-fverbose-asm} switch, but that
13244 switch only records information in the assembler output file as
13245 comments, so it never reaches the object file.
13246 See also @option{-grecord-gcc-switches} for another
13247 way of storing compiler options into the object file.
13249 @item -fpic
13250 @opindex fpic
13251 @cindex global offset table
13252 @cindex PIC
13253 Generate position-independent code (PIC) suitable for use in a shared
13254 library, if supported for the target machine.  Such code accesses all
13255 constant addresses through a global offset table (GOT)@.  The dynamic
13256 loader resolves the GOT entries when the program starts (the dynamic
13257 loader is not part of GCC; it is part of the operating system).  If
13258 the GOT size for the linked executable exceeds a machine-specific
13259 maximum size, you get an error message from the linker indicating that
13260 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
13261 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
13262 on the m68k and RS/6000.  The x86 has no such limit.)
13264 Position-independent code requires special support, and therefore works
13265 only on certain machines.  For the x86, GCC supports PIC for System V
13266 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
13267 position-independent.
13269 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13270 are defined to 1.
13272 @item -fPIC
13273 @opindex fPIC
13274 If supported for the target machine, emit position-independent code,
13275 suitable for dynamic linking and avoiding any limit on the size of the
13276 global offset table.  This option makes a difference on AArch64, m68k,
13277 PowerPC and SPARC@.
13279 Position-independent code requires special support, and therefore works
13280 only on certain machines.
13282 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13283 are defined to 2.
13285 @item -fpie
13286 @itemx -fPIE
13287 @opindex fpie
13288 @opindex fPIE
13289 These options are similar to @option{-fpic} and @option{-fPIC}, but the
13290 generated position-independent code can be only linked into executables.
13291 Usually these options are used to compile code that will be linked using
13292 the @option{-pie} GCC option.
13294 @option{-fpie} and @option{-fPIE} both define the macros
13295 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
13296 for @option{-fpie} and 2 for @option{-fPIE}.
13298 @item -fno-plt
13299 @opindex fno-plt
13300 Do not use the PLT for external function calls in position-independent code.
13301 Instead, load the callee address at call sites from the GOT and branch to it.
13302 This leads to more efficient code by eliminating PLT stubs and exposing
13303 GOT loads to optimizations.  On architectures such as 32-bit x86 where
13304 PLT stubs expect the GOT pointer in a specific register, this gives more
13305 register allocation freedom to the compiler.
13306 Lazy binding requires use of the PLT; 
13307 with @option{-fno-plt} all external symbols are resolved at load time.
13309 Alternatively, the function attribute @code{noplt} can be used to avoid calls
13310 through the PLT for specific external functions.
13312 In position-dependent code, a few targets also convert calls to
13313 functions that are marked to not use the PLT to use the GOT instead.
13315 @item -fno-jump-tables
13316 @opindex fno-jump-tables
13317 Do not use jump tables for switch statements even where it would be
13318 more efficient than other code generation strategies.  This option is
13319 of use in conjunction with @option{-fpic} or @option{-fPIC} for
13320 building code that forms part of a dynamic linker and cannot
13321 reference the address of a jump table.  On some targets, jump tables
13322 do not require a GOT and this option is not needed.
13324 @item -ffixed-@var{reg}
13325 @opindex ffixed
13326 Treat the register named @var{reg} as a fixed register; generated code
13327 should never refer to it (except perhaps as a stack pointer, frame
13328 pointer or in some other fixed role).
13330 @var{reg} must be the name of a register.  The register names accepted
13331 are machine-specific and are defined in the @code{REGISTER_NAMES}
13332 macro in the machine description macro file.
13334 This flag does not have a negative form, because it specifies a
13335 three-way choice.
13337 @item -fcall-used-@var{reg}
13338 @opindex fcall-used
13339 Treat the register named @var{reg} as an allocable register that is
13340 clobbered by function calls.  It may be allocated for temporaries or
13341 variables that do not live across a call.  Functions compiled this way
13342 do not save and restore the register @var{reg}.
13344 It is an error to use this flag with the frame pointer or stack pointer.
13345 Use of this flag for other registers that have fixed pervasive roles in
13346 the machine's execution model produces disastrous results.
13348 This flag does not have a negative form, because it specifies a
13349 three-way choice.
13351 @item -fcall-saved-@var{reg}
13352 @opindex fcall-saved
13353 Treat the register named @var{reg} as an allocable register saved by
13354 functions.  It may be allocated even for temporaries or variables that
13355 live across a call.  Functions compiled this way save and restore
13356 the register @var{reg} if they use it.
13358 It is an error to use this flag with the frame pointer or stack pointer.
13359 Use of this flag for other registers that have fixed pervasive roles in
13360 the machine's execution model produces disastrous results.
13362 A different sort of disaster results from the use of this flag for
13363 a register in which function values may be returned.
13365 This flag does not have a negative form, because it specifies a
13366 three-way choice.
13368 @item -fpack-struct[=@var{n}]
13369 @opindex fpack-struct
13370 Without a value specified, pack all structure members together without
13371 holes.  When a value is specified (which must be a small power of two), pack
13372 structure members according to this value, representing the maximum
13373 alignment (that is, objects with default alignment requirements larger than
13374 this are output potentially unaligned at the next fitting location.
13376 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
13377 code that is not binary compatible with code generated without that switch.
13378 Additionally, it makes the code suboptimal.
13379 Use it to conform to a non-default application binary interface.
13381 @item -fleading-underscore
13382 @opindex fleading-underscore
13383 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
13384 change the way C symbols are represented in the object file.  One use
13385 is to help link with legacy assembly code.
13387 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
13388 generate code that is not binary compatible with code generated without that
13389 switch.  Use it to conform to a non-default application binary interface.
13390 Not all targets provide complete support for this switch.
13392 @item -ftls-model=@var{model}
13393 @opindex ftls-model
13394 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
13395 The @var{model} argument should be one of @samp{global-dynamic},
13396 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
13397 Note that the choice is subject to optimization: the compiler may use
13398 a more efficient model for symbols not visible outside of the translation
13399 unit, or if @option{-fpic} is not given on the command line.
13401 The default without @option{-fpic} is @samp{initial-exec}; with
13402 @option{-fpic} the default is @samp{global-dynamic}.
13404 @item -ftrampolines
13405 @opindex ftrampolines
13406 For targets that normally need trampolines for nested functions, always
13407 generate them instead of using descriptors.  Otherwise, for targets that
13408 do not need them, like for example HP-PA or IA-64, do nothing.
13410 A trampoline is a small piece of code that is created at run time on the
13411 stack when the address of a nested function is taken, and is used to call
13412 the nested function indirectly.  Therefore, it requires the stack to be
13413 made executable in order for the program to work properly.
13415 @option{-fno-trampolines} is enabled by default on a language by language
13416 basis to let the compiler avoid generating them, if it computes that this
13417 is safe, and replace them with descriptors.  Descriptors are made up of data
13418 only, but the generated code must be prepared to deal with them.  As of this
13419 writing, @option{-fno-trampolines} is enabled by default only for Ada.
13421 Moreover, code compiled with @option{-ftrampolines} and code compiled with
13422 @option{-fno-trampolines} are not binary compatible if nested functions are
13423 present.  This option must therefore be used on a program-wide basis and be
13424 manipulated with extreme care.
13426 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
13427 @opindex fvisibility
13428 Set the default ELF image symbol visibility to the specified option---all
13429 symbols are marked with this unless overridden within the code.
13430 Using this feature can very substantially improve linking and
13431 load times of shared object libraries, produce more optimized
13432 code, provide near-perfect API export and prevent symbol clashes.
13433 It is @strong{strongly} recommended that you use this in any shared objects
13434 you distribute.
13436 Despite the nomenclature, @samp{default} always means public; i.e.,
13437 available to be linked against from outside the shared object.
13438 @samp{protected} and @samp{internal} are pretty useless in real-world
13439 usage so the only other commonly used option is @samp{hidden}.
13440 The default if @option{-fvisibility} isn't specified is
13441 @samp{default}, i.e., make every symbol public.
13443 A good explanation of the benefits offered by ensuring ELF
13444 symbols have the correct visibility is given by ``How To Write
13445 Shared Libraries'' by Ulrich Drepper (which can be found at
13446 @w{@uref{https://www.akkadia.org/drepper/}})---however a superior
13447 solution made possible by this option to marking things hidden when
13448 the default is public is to make the default hidden and mark things
13449 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
13450 and @code{__attribute__ ((visibility("default")))} instead of
13451 @code{__declspec(dllexport)} you get almost identical semantics with
13452 identical syntax.  This is a great boon to those working with
13453 cross-platform projects.
13455 For those adding visibility support to existing code, you may find
13456 @code{#pragma GCC visibility} of use.  This works by you enclosing
13457 the declarations you wish to set visibility for with (for example)
13458 @code{#pragma GCC visibility push(hidden)} and
13459 @code{#pragma GCC visibility pop}.
13460 Bear in mind that symbol visibility should be viewed @strong{as
13461 part of the API interface contract} and thus all new code should
13462 always specify visibility when it is not the default; i.e., declarations
13463 only for use within the local DSO should @strong{always} be marked explicitly
13464 as hidden as so to avoid PLT indirection overheads---making this
13465 abundantly clear also aids readability and self-documentation of the code.
13466 Note that due to ISO C++ specification requirements, @code{operator new} and
13467 @code{operator delete} must always be of default visibility.
13469 Be aware that headers from outside your project, in particular system
13470 headers and headers from any other library you use, may not be
13471 expecting to be compiled with visibility other than the default.  You
13472 may need to explicitly say @code{#pragma GCC visibility push(default)}
13473 before including any such headers.
13475 @code{extern} declarations are not affected by @option{-fvisibility}, so
13476 a lot of code can be recompiled with @option{-fvisibility=hidden} with
13477 no modifications.  However, this means that calls to @code{extern}
13478 functions with no explicit visibility use the PLT, so it is more
13479 effective to use @code{__attribute ((visibility))} and/or
13480 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
13481 declarations should be treated as hidden.
13483 Note that @option{-fvisibility} does affect C++ vague linkage
13484 entities. This means that, for instance, an exception class that is
13485 be thrown between DSOs must be explicitly marked with default
13486 visibility so that the @samp{type_info} nodes are unified between
13487 the DSOs.
13489 An overview of these techniques, their benefits and how to use them
13490 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
13492 @item -fstrict-volatile-bitfields
13493 @opindex fstrict-volatile-bitfields
13494 This option should be used if accesses to volatile bit-fields (or other
13495 structure fields, although the compiler usually honors those types
13496 anyway) should use a single access of the width of the
13497 field's type, aligned to a natural alignment if possible.  For
13498 example, targets with memory-mapped peripheral registers might require
13499 all such accesses to be 16 bits wide; with this flag you can
13500 declare all peripheral bit-fields as @code{unsigned short} (assuming short
13501 is 16 bits on these targets) to force GCC to use 16-bit accesses
13502 instead of, perhaps, a more efficient 32-bit access.
13504 If this option is disabled, the compiler uses the most efficient
13505 instruction.  In the previous example, that might be a 32-bit load
13506 instruction, even though that accesses bytes that do not contain
13507 any portion of the bit-field, or memory-mapped registers unrelated to
13508 the one being updated.
13510 In some cases, such as when the @code{packed} attribute is applied to a 
13511 structure field, it may not be possible to access the field with a single
13512 read or write that is correctly aligned for the target machine.  In this
13513 case GCC falls back to generating multiple accesses rather than code that 
13514 will fault or truncate the result at run time.
13516 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
13517 not allowed to touch non bit-field members.  It is therefore recommended
13518 to define all bits of the field's type as bit-field members.
13520 The default value of this option is determined by the application binary
13521 interface for the target processor.
13523 @item -fsync-libcalls
13524 @opindex fsync-libcalls
13525 This option controls whether any out-of-line instance of the @code{__sync}
13526 family of functions may be used to implement the C++11 @code{__atomic}
13527 family of functions.
13529 The default value of this option is enabled, thus the only useful form
13530 of the option is @option{-fno-sync-libcalls}.  This option is used in
13531 the implementation of the @file{libatomic} runtime library.
13533 @end table
13535 @node Developer Options
13536 @section GCC Developer Options
13537 @cindex developer options
13538 @cindex debugging GCC
13539 @cindex debug dump options
13540 @cindex dump options
13541 @cindex compilation statistics
13543 This section describes command-line options that are primarily of
13544 interest to GCC developers, including options to support compiler
13545 testing and investigation of compiler bugs and compile-time
13546 performance problems.  This includes options that produce debug dumps
13547 at various points in the compilation; that print statistics such as
13548 memory use and execution time; and that print information about GCC's
13549 configuration, such as where it searches for libraries.  You should
13550 rarely need to use any of these options for ordinary compilation and
13551 linking tasks.
13553 Many developer options that cause GCC to dump output to a file take an
13554 optional @samp{=@var{filename}} suffix. You can specify @samp{stdout}
13555 or @samp{-} to dump to standard output, and @samp{stderr} for standard
13556 error.
13558 If @samp{=@var{filename}} is omitted, a default dump file name is
13559 constructed by concatenating the base dump file name, a pass number,
13560 phase letter, and pass name.  The base dump file name is the name of
13561 output file produced by the compiler if explicitly specified and not
13562 an executable; otherwise it is the source file name.
13563 The pass number is determined by the order passes are registered with
13564 the compiler's pass manager. 
13565 This is generally the same as the order of execution, but passes
13566 registered by plugins, target-specific passes, or passes that are
13567 otherwise registered late are numbered higher than the pass named
13568 @samp{final}, even if they are executed earlier.  The phase letter is
13569 one of @samp{i} (inter-procedural analysis), @samp{l}
13570 (language-specific), @samp{r} (RTL), or @samp{t} (tree). 
13571 The files are created in the directory of the output file. 
13573 @table @gcctabopt
13575 @item -d@var{letters}
13576 @itemx -fdump-rtl-@var{pass}
13577 @itemx -fdump-rtl-@var{pass}=@var{filename}
13578 @opindex d
13579 @opindex fdump-rtl-@var{pass}
13580 Says to make debugging dumps during compilation at times specified by
13581 @var{letters}.  This is used for debugging the RTL-based passes of the
13582 compiler.
13584 Some @option{-d@var{letters}} switches have different meaning when
13585 @option{-E} is used for preprocessing.  @xref{Preprocessor Options},
13586 for information about preprocessor-specific dump options.
13588 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
13589 @option{-d} option @var{letters}.  Here are the possible
13590 letters for use in @var{pass} and @var{letters}, and their meanings:
13592 @table @gcctabopt
13594 @item -fdump-rtl-alignments
13595 @opindex fdump-rtl-alignments
13596 Dump after branch alignments have been computed.
13598 @item -fdump-rtl-asmcons
13599 @opindex fdump-rtl-asmcons
13600 Dump after fixing rtl statements that have unsatisfied in/out constraints.
13602 @item -fdump-rtl-auto_inc_dec
13603 @opindex fdump-rtl-auto_inc_dec
13604 Dump after auto-inc-dec discovery.  This pass is only run on
13605 architectures that have auto inc or auto dec instructions.
13607 @item -fdump-rtl-barriers
13608 @opindex fdump-rtl-barriers
13609 Dump after cleaning up the barrier instructions.
13611 @item -fdump-rtl-bbpart
13612 @opindex fdump-rtl-bbpart
13613 Dump after partitioning hot and cold basic blocks.
13615 @item -fdump-rtl-bbro
13616 @opindex fdump-rtl-bbro
13617 Dump after block reordering.
13619 @item -fdump-rtl-btl1
13620 @itemx -fdump-rtl-btl2
13621 @opindex fdump-rtl-btl2
13622 @opindex fdump-rtl-btl2
13623 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
13624 after the two branch
13625 target load optimization passes.
13627 @item -fdump-rtl-bypass
13628 @opindex fdump-rtl-bypass
13629 Dump after jump bypassing and control flow optimizations.
13631 @item -fdump-rtl-combine
13632 @opindex fdump-rtl-combine
13633 Dump after the RTL instruction combination pass.
13635 @item -fdump-rtl-compgotos
13636 @opindex fdump-rtl-compgotos
13637 Dump after duplicating the computed gotos.
13639 @item -fdump-rtl-ce1
13640 @itemx -fdump-rtl-ce2
13641 @itemx -fdump-rtl-ce3
13642 @opindex fdump-rtl-ce1
13643 @opindex fdump-rtl-ce2
13644 @opindex fdump-rtl-ce3
13645 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
13646 @option{-fdump-rtl-ce3} enable dumping after the three
13647 if conversion passes.
13649 @item -fdump-rtl-cprop_hardreg
13650 @opindex fdump-rtl-cprop_hardreg
13651 Dump after hard register copy propagation.
13653 @item -fdump-rtl-csa
13654 @opindex fdump-rtl-csa
13655 Dump after combining stack adjustments.
13657 @item -fdump-rtl-cse1
13658 @itemx -fdump-rtl-cse2
13659 @opindex fdump-rtl-cse1
13660 @opindex fdump-rtl-cse2
13661 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
13662 the two common subexpression elimination passes.
13664 @item -fdump-rtl-dce
13665 @opindex fdump-rtl-dce
13666 Dump after the standalone dead code elimination passes.
13668 @item -fdump-rtl-dbr
13669 @opindex fdump-rtl-dbr
13670 Dump after delayed branch scheduling.
13672 @item -fdump-rtl-dce1
13673 @itemx -fdump-rtl-dce2
13674 @opindex fdump-rtl-dce1
13675 @opindex fdump-rtl-dce2
13676 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
13677 the two dead store elimination passes.
13679 @item -fdump-rtl-eh
13680 @opindex fdump-rtl-eh
13681 Dump after finalization of EH handling code.
13683 @item -fdump-rtl-eh_ranges
13684 @opindex fdump-rtl-eh_ranges
13685 Dump after conversion of EH handling range regions.
13687 @item -fdump-rtl-expand
13688 @opindex fdump-rtl-expand
13689 Dump after RTL generation.
13691 @item -fdump-rtl-fwprop1
13692 @itemx -fdump-rtl-fwprop2
13693 @opindex fdump-rtl-fwprop1
13694 @opindex fdump-rtl-fwprop2
13695 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
13696 dumping after the two forward propagation passes.
13698 @item -fdump-rtl-gcse1
13699 @itemx -fdump-rtl-gcse2
13700 @opindex fdump-rtl-gcse1
13701 @opindex fdump-rtl-gcse2
13702 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
13703 after global common subexpression elimination.
13705 @item -fdump-rtl-init-regs
13706 @opindex fdump-rtl-init-regs
13707 Dump after the initialization of the registers.
13709 @item -fdump-rtl-initvals
13710 @opindex fdump-rtl-initvals
13711 Dump after the computation of the initial value sets.
13713 @item -fdump-rtl-into_cfglayout
13714 @opindex fdump-rtl-into_cfglayout
13715 Dump after converting to cfglayout mode.
13717 @item -fdump-rtl-ira
13718 @opindex fdump-rtl-ira
13719 Dump after iterated register allocation.
13721 @item -fdump-rtl-jump
13722 @opindex fdump-rtl-jump
13723 Dump after the second jump optimization.
13725 @item -fdump-rtl-loop2
13726 @opindex fdump-rtl-loop2
13727 @option{-fdump-rtl-loop2} enables dumping after the rtl
13728 loop optimization passes.
13730 @item -fdump-rtl-mach
13731 @opindex fdump-rtl-mach
13732 Dump after performing the machine dependent reorganization pass, if that
13733 pass exists.
13735 @item -fdump-rtl-mode_sw
13736 @opindex fdump-rtl-mode_sw
13737 Dump after removing redundant mode switches.
13739 @item -fdump-rtl-rnreg
13740 @opindex fdump-rtl-rnreg
13741 Dump after register renumbering.
13743 @item -fdump-rtl-outof_cfglayout
13744 @opindex fdump-rtl-outof_cfglayout
13745 Dump after converting from cfglayout mode.
13747 @item -fdump-rtl-peephole2
13748 @opindex fdump-rtl-peephole2
13749 Dump after the peephole pass.
13751 @item -fdump-rtl-postreload
13752 @opindex fdump-rtl-postreload
13753 Dump after post-reload optimizations.
13755 @item -fdump-rtl-pro_and_epilogue
13756 @opindex fdump-rtl-pro_and_epilogue
13757 Dump after generating the function prologues and epilogues.
13759 @item -fdump-rtl-sched1
13760 @itemx -fdump-rtl-sched2
13761 @opindex fdump-rtl-sched1
13762 @opindex fdump-rtl-sched2
13763 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
13764 after the basic block scheduling passes.
13766 @item -fdump-rtl-ree
13767 @opindex fdump-rtl-ree
13768 Dump after sign/zero extension elimination.
13770 @item -fdump-rtl-seqabstr
13771 @opindex fdump-rtl-seqabstr
13772 Dump after common sequence discovery.
13774 @item -fdump-rtl-shorten
13775 @opindex fdump-rtl-shorten
13776 Dump after shortening branches.
13778 @item -fdump-rtl-sibling
13779 @opindex fdump-rtl-sibling
13780 Dump after sibling call optimizations.
13782 @item -fdump-rtl-split1
13783 @itemx -fdump-rtl-split2
13784 @itemx -fdump-rtl-split3
13785 @itemx -fdump-rtl-split4
13786 @itemx -fdump-rtl-split5
13787 @opindex fdump-rtl-split1
13788 @opindex fdump-rtl-split2
13789 @opindex fdump-rtl-split3
13790 @opindex fdump-rtl-split4
13791 @opindex fdump-rtl-split5
13792 These options enable dumping after five rounds of
13793 instruction splitting.
13795 @item -fdump-rtl-sms
13796 @opindex fdump-rtl-sms
13797 Dump after modulo scheduling.  This pass is only run on some
13798 architectures.
13800 @item -fdump-rtl-stack
13801 @opindex fdump-rtl-stack
13802 Dump after conversion from GCC's ``flat register file'' registers to the
13803 x87's stack-like registers.  This pass is only run on x86 variants.
13805 @item -fdump-rtl-subreg1
13806 @itemx -fdump-rtl-subreg2
13807 @opindex fdump-rtl-subreg1
13808 @opindex fdump-rtl-subreg2
13809 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
13810 the two subreg expansion passes.
13812 @item -fdump-rtl-unshare
13813 @opindex fdump-rtl-unshare
13814 Dump after all rtl has been unshared.
13816 @item -fdump-rtl-vartrack
13817 @opindex fdump-rtl-vartrack
13818 Dump after variable tracking.
13820 @item -fdump-rtl-vregs
13821 @opindex fdump-rtl-vregs
13822 Dump after converting virtual registers to hard registers.
13824 @item -fdump-rtl-web
13825 @opindex fdump-rtl-web
13826 Dump after live range splitting.
13828 @item -fdump-rtl-regclass
13829 @itemx -fdump-rtl-subregs_of_mode_init
13830 @itemx -fdump-rtl-subregs_of_mode_finish
13831 @itemx -fdump-rtl-dfinit
13832 @itemx -fdump-rtl-dfinish
13833 @opindex fdump-rtl-regclass
13834 @opindex fdump-rtl-subregs_of_mode_init
13835 @opindex fdump-rtl-subregs_of_mode_finish
13836 @opindex fdump-rtl-dfinit
13837 @opindex fdump-rtl-dfinish
13838 These dumps are defined but always produce empty files.
13840 @item -da
13841 @itemx -fdump-rtl-all
13842 @opindex da
13843 @opindex fdump-rtl-all
13844 Produce all the dumps listed above.
13846 @item -dA
13847 @opindex dA
13848 Annotate the assembler output with miscellaneous debugging information.
13850 @item -dD
13851 @opindex dD
13852 Dump all macro definitions, at the end of preprocessing, in addition to
13853 normal output.
13855 @item -dH
13856 @opindex dH
13857 Produce a core dump whenever an error occurs.
13859 @item -dp
13860 @opindex dp
13861 Annotate the assembler output with a comment indicating which
13862 pattern and alternative is used.  The length and cost of each instruction are
13863 also printed.
13865 @item -dP
13866 @opindex dP
13867 Dump the RTL in the assembler output as a comment before each instruction.
13868 Also turns on @option{-dp} annotation.
13870 @item -dx
13871 @opindex dx
13872 Just generate RTL for a function instead of compiling it.  Usually used
13873 with @option{-fdump-rtl-expand}.
13874 @end table
13876 @item -fdump-debug
13877 @opindex fdump-debug
13878 Dump debugging information generated during the debug
13879 generation phase.
13881 @item -fdump-earlydebug
13882 @opindex fdump-earlydebug
13883 Dump debugging information generated during the early debug
13884 generation phase.
13886 @item -fdump-noaddr
13887 @opindex fdump-noaddr
13888 When doing debugging dumps, suppress address output.  This makes it more
13889 feasible to use diff on debugging dumps for compiler invocations with
13890 different compiler binaries and/or different
13891 text / bss / data / heap / stack / dso start locations.
13893 @item -freport-bug
13894 @opindex freport-bug
13895 Collect and dump debug information into a temporary file if an
13896 internal compiler error (ICE) occurs.
13898 @item -fdump-unnumbered
13899 @opindex fdump-unnumbered
13900 When doing debugging dumps, suppress instruction numbers and address output.
13901 This makes it more feasible to use diff on debugging dumps for compiler
13902 invocations with different options, in particular with and without
13903 @option{-g}.
13905 @item -fdump-unnumbered-links
13906 @opindex fdump-unnumbered-links
13907 When doing debugging dumps (see @option{-d} option above), suppress
13908 instruction numbers for the links to the previous and next instructions
13909 in a sequence.
13911 @item -fdump-ipa-@var{switch}
13912 @opindex fdump-ipa
13913 Control the dumping at various stages of inter-procedural analysis
13914 language tree to a file.  The file name is generated by appending a
13915 switch specific suffix to the source file name, and the file is created
13916 in the same directory as the output file.  The following dumps are
13917 possible:
13919 @table @samp
13920 @item all
13921 Enables all inter-procedural analysis dumps.
13923 @item cgraph
13924 Dumps information about call-graph optimization, unused function removal,
13925 and inlining decisions.
13927 @item inline
13928 Dump after function inlining.
13930 @end table
13932 @item -fdump-lang-all
13933 @itemx -fdump-lang-@var{switch}
13934 @itemx -fdump-lang-@var{switch}-@var{options}
13935 @itemx -fdump-lang-@var{switch}-@var{options}=@var{filename}
13936 @opindex fdump-lang-all
13937 @opindex fdump-lang
13938 Control the dumping of language-specific information.  The @var{options}
13939 and @var{filename} portions behave as described in the
13940 @option{-fdump-tree} option.  The following @var{switch} values are
13941 accepted:
13943 @table @samp
13944 @item all
13946 Enable all language-specific dumps.
13948 @item class
13949 Dump class hierarchy information.  Virtual table information is emitted
13950 unless '@option{slim}' is specified.  This option is applicable to C++ only.
13952 @item raw
13953 Dump the raw internal tree data.  This option is applicable to C++ only.
13955 @end table
13957 @item -fdump-passes
13958 @opindex fdump-passes
13959 Print on @file{stderr} the list of optimization passes that are turned
13960 on and off by the current command-line options.
13962 @item -fdump-statistics-@var{option}
13963 @opindex fdump-statistics
13964 Enable and control dumping of pass statistics in a separate file.  The
13965 file name is generated by appending a suffix ending in
13966 @samp{.statistics} to the source file name, and the file is created in
13967 the same directory as the output file.  If the @samp{-@var{option}}
13968 form is used, @samp{-stats} causes counters to be summed over the
13969 whole compilation unit while @samp{-details} dumps every event as
13970 the passes generate them.  The default with no option is to sum
13971 counters for each function compiled.
13973 @item -fdump-tree-all
13974 @itemx -fdump-tree-@var{switch}
13975 @itemx -fdump-tree-@var{switch}-@var{options}
13976 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
13977 @opindex fdump-tree-all
13978 @opindex fdump-tree
13979 Control the dumping at various stages of processing the intermediate
13980 language tree to a file.  If the @samp{-@var{options}}
13981 form is used, @var{options} is a list of @samp{-} separated options
13982 which control the details of the dump.  Not all options are applicable
13983 to all dumps; those that are not meaningful are ignored.  The
13984 following options are available
13986 @table @samp
13987 @item address
13988 Print the address of each node.  Usually this is not meaningful as it
13989 changes according to the environment and source file.  Its primary use
13990 is for tying up a dump file with a debug environment.
13991 @item asmname
13992 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
13993 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
13994 use working backward from mangled names in the assembly file.
13995 @item slim
13996 When dumping front-end intermediate representations, inhibit dumping
13997 of members of a scope or body of a function merely because that scope
13998 has been reached.  Only dump such items when they are directly reachable
13999 by some other path.
14001 When dumping pretty-printed trees, this option inhibits dumping the
14002 bodies of control structures.
14004 When dumping RTL, print the RTL in slim (condensed) form instead of
14005 the default LISP-like representation.
14006 @item raw
14007 Print a raw representation of the tree.  By default, trees are
14008 pretty-printed into a C-like representation.
14009 @item details
14010 Enable more detailed dumps (not honored by every dump option). Also
14011 include information from the optimization passes.
14012 @item stats
14013 Enable dumping various statistics about the pass (not honored by every dump
14014 option).
14015 @item blocks
14016 Enable showing basic block boundaries (disabled in raw dumps).
14017 @item graph
14018 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
14019 dump a representation of the control flow graph suitable for viewing with
14020 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
14021 the file is pretty-printed as a subgraph, so that GraphViz can render them
14022 all in a single plot.
14024 This option currently only works for RTL dumps, and the RTL is always
14025 dumped in slim form.
14026 @item vops
14027 Enable showing virtual operands for every statement.
14028 @item lineno
14029 Enable showing line numbers for statements.
14030 @item uid
14031 Enable showing the unique ID (@code{DECL_UID}) for each variable.
14032 @item verbose
14033 Enable showing the tree dump for each statement.
14034 @item eh
14035 Enable showing the EH region number holding each statement.
14036 @item scev
14037 Enable showing scalar evolution analysis details.
14038 @item optimized
14039 Enable showing optimization information (only available in certain
14040 passes).
14041 @item missed
14042 Enable showing missed optimization information (only available in certain
14043 passes).
14044 @item note
14045 Enable other detailed optimization information (only available in
14046 certain passes).
14047 @item all
14048 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
14049 and @option{lineno}.
14050 @item optall
14051 Turn on all optimization options, i.e., @option{optimized},
14052 @option{missed}, and @option{note}.
14053 @end table
14055 To determine what tree dumps are available or find the dump for a pass
14056 of interest follow the steps below.
14058 @enumerate
14059 @item
14060 Invoke GCC with @option{-fdump-passes} and in the @file{stderr} output
14061 look for a code that corresponds to the pass you are interested in.
14062 For example, the codes @code{tree-evrp}, @code{tree-vrp1}, and
14063 @code{tree-vrp2} correspond to the three Value Range Propagation passes.
14064 The number at the end distinguishes distinct invocations of the same pass.
14065 @item
14066 To enable the creation of the dump file, append the pass code to
14067 the @option{-fdump-} option prefix and invoke GCC with it.  For example,
14068 to enable the dump from the Early Value Range Propagation pass, invoke
14069 GCC with the @option{-fdump-tree-evrp} option.  Optionally, you may
14070 specify the name of the dump file.  If you don't specify one, GCC
14071 creates as described below.
14072 @item
14073 Find the pass dump in a file whose name is composed of three components
14074 separated by a period: the name of the source file GCC was invoked to
14075 compile, a numeric suffix indicating the pass number followed by the
14076 letter @samp{t} for tree passes (and the letter @samp{r} for RTL passes),
14077 and finally the pass code.  For example, the Early VRP pass dump might
14078 be in a file named @file{myfile.c.038t.evrp} in the current working
14079 directory.  Note that the numeric codes are not stable and may change
14080 from one version of GCC to another.
14081 @end enumerate
14083 @item -fopt-info
14084 @itemx -fopt-info-@var{options}
14085 @itemx -fopt-info-@var{options}=@var{filename}
14086 @opindex fopt-info
14087 Controls optimization dumps from various optimization passes. If the
14088 @samp{-@var{options}} form is used, @var{options} is a list of
14089 @samp{-} separated option keywords to select the dump details and
14090 optimizations.  
14092 The @var{options} can be divided into two groups: options describing the
14093 verbosity of the dump, and options describing which optimizations
14094 should be included. The options from both the groups can be freely
14095 mixed as they are non-overlapping. However, in case of any conflicts,
14096 the later options override the earlier options on the command
14097 line. 
14099 The following options control the dump verbosity:
14101 @table @samp
14102 @item optimized
14103 Print information when an optimization is successfully applied. It is
14104 up to a pass to decide which information is relevant. For example, the
14105 vectorizer passes print the source location of loops which are
14106 successfully vectorized.
14107 @item missed
14108 Print information about missed optimizations. Individual passes
14109 control which information to include in the output. 
14110 @item note
14111 Print verbose information about optimizations, such as certain
14112 transformations, more detailed messages about decisions etc.
14113 @item all
14114 Print detailed optimization information. This includes
14115 @samp{optimized}, @samp{missed}, and @samp{note}.
14116 @end table
14118 One or more of the following option keywords can be used to describe a
14119 group of optimizations:
14121 @table @samp
14122 @item ipa
14123 Enable dumps from all interprocedural optimizations.
14124 @item loop
14125 Enable dumps from all loop optimizations.
14126 @item inline
14127 Enable dumps from all inlining optimizations.
14128 @item omp
14129 Enable dumps from all OMP (Offloading and Multi Processing) optimizations.
14130 @item vec
14131 Enable dumps from all vectorization optimizations.
14132 @item optall
14133 Enable dumps from all optimizations. This is a superset of
14134 the optimization groups listed above.
14135 @end table
14137 If @var{options} is
14138 omitted, it defaults to @samp{optimized-optall}, which means to dump all
14139 info about successful optimizations from all the passes.  
14141 If the @var{filename} is provided, then the dumps from all the
14142 applicable optimizations are concatenated into the @var{filename}.
14143 Otherwise the dump is output onto @file{stderr}. Though multiple
14144 @option{-fopt-info} options are accepted, only one of them can include
14145 a @var{filename}. If other filenames are provided then all but the
14146 first such option are ignored.
14148 Note that the output @var{filename} is overwritten
14149 in case of multiple translation units. If a combined output from
14150 multiple translation units is desired, @file{stderr} should be used
14151 instead.
14153 In the following example, the optimization info is output to
14154 @file{stderr}:
14156 @smallexample
14157 gcc -O3 -fopt-info
14158 @end smallexample
14160 This example:
14161 @smallexample
14162 gcc -O3 -fopt-info-missed=missed.all
14163 @end smallexample
14165 @noindent
14166 outputs missed optimization report from all the passes into
14167 @file{missed.all}, and this one:
14169 @smallexample
14170 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
14171 @end smallexample
14173 @noindent
14174 prints information about missed optimization opportunities from
14175 vectorization passes on @file{stderr}.  
14176 Note that @option{-fopt-info-vec-missed} is equivalent to 
14177 @option{-fopt-info-missed-vec}.  The order of the optimization group
14178 names and message types listed after @option{-fopt-info} does not matter.
14180 As another example,
14181 @smallexample
14182 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
14183 @end smallexample
14185 @noindent
14186 outputs information about missed optimizations as well as
14187 optimized locations from all the inlining passes into
14188 @file{inline.txt}.
14190 Finally, consider:
14192 @smallexample
14193 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
14194 @end smallexample
14196 @noindent
14197 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
14198 in conflict since only one output file is allowed. In this case, only
14199 the first option takes effect and the subsequent options are
14200 ignored. Thus only @file{vec.miss} is produced which contains
14201 dumps from the vectorizer about missed opportunities.
14203 @item -fsave-optimization-record
14204 @opindex fsave-optimization-record
14205 Write a SRCFILE.opt-record.json file detailing what optimizations
14206 were performed, for those optimizations that support @option{-fopt-info}.
14208 This option is experimental and the format of the data within the JSON
14209 file is subject to change.
14211 It is roughly equivalent to a machine-readable version of
14212 @option{-fopt-info-all}, as a collection of messages with source file,
14213 line number and column number, with the following additional data for
14214 each message:
14216 @itemize @bullet
14218 @item
14219 the execution count of the code being optimized, along with metadata about
14220 whether this was from actual profile data, or just an estimate, allowing
14221 consumers to prioritize messages by code hotness,
14223 @item
14224 the function name of the code being optimized, where applicable,
14226 @item
14227 the ``inlining chain'' for the code being optimized, so that when
14228 a function is inlined into several different places (which might
14229 themselves be inlined), the reader can distinguish between the copies,
14231 @item
14232 objects identifying those parts of the message that refer to expressions,
14233 statements or symbol-table nodes, which of these categories they are, and,
14234 when available, their source code location,
14236 @item
14237 the GCC pass that emitted the message, and
14239 @item
14240 the location in GCC's own code from which the message was emitted
14242 @end itemize
14244 Additionally, some messages are logically nested within other
14245 messages, reflecting implementation details of the optimization
14246 passes.
14248 @item -fsched-verbose=@var{n}
14249 @opindex fsched-verbose
14250 On targets that use instruction scheduling, this option controls the
14251 amount of debugging output the scheduler prints to the dump files.
14253 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
14254 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
14255 For @var{n} greater than one, it also output basic block probabilities,
14256 detailed ready list information and unit/insn info.  For @var{n} greater
14257 than two, it includes RTL at abort point, control-flow and regions info.
14258 And for @var{n} over four, @option{-fsched-verbose} also includes
14259 dependence info.
14263 @item -fenable-@var{kind}-@var{pass}
14264 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
14265 @opindex fdisable-
14266 @opindex fenable-
14268 This is a set of options that are used to explicitly disable/enable
14269 optimization passes.  These options are intended for use for debugging GCC.
14270 Compiler users should use regular options for enabling/disabling
14271 passes instead.
14273 @table @gcctabopt
14275 @item -fdisable-ipa-@var{pass}
14276 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
14277 statically invoked in the compiler multiple times, the pass name should be
14278 appended with a sequential number starting from 1.
14280 @item -fdisable-rtl-@var{pass}
14281 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
14282 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
14283 statically invoked in the compiler multiple times, the pass name should be
14284 appended with a sequential number starting from 1.  @var{range-list} is a 
14285 comma-separated list of function ranges or assembler names.  Each range is a number
14286 pair separated by a colon.  The range is inclusive in both ends.  If the range
14287 is trivial, the number pair can be simplified as a single number.  If the
14288 function's call graph node's @var{uid} falls within one of the specified ranges,
14289 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
14290 function header of a dump file, and the pass names can be dumped by using
14291 option @option{-fdump-passes}.
14293 @item -fdisable-tree-@var{pass}
14294 @itemx -fdisable-tree-@var{pass}=@var{range-list}
14295 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
14296 option arguments.
14298 @item -fenable-ipa-@var{pass}
14299 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
14300 statically invoked in the compiler multiple times, the pass name should be
14301 appended with a sequential number starting from 1.
14303 @item -fenable-rtl-@var{pass}
14304 @itemx -fenable-rtl-@var{pass}=@var{range-list}
14305 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
14306 description and examples.
14308 @item -fenable-tree-@var{pass}
14309 @itemx -fenable-tree-@var{pass}=@var{range-list}
14310 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
14311 of option arguments.
14313 @end table
14315 Here are some examples showing uses of these options.
14317 @smallexample
14319 # disable ccp1 for all functions
14320    -fdisable-tree-ccp1
14321 # disable complete unroll for function whose cgraph node uid is 1
14322    -fenable-tree-cunroll=1
14323 # disable gcse2 for functions at the following ranges [1,1],
14324 # [300,400], and [400,1000]
14325 # disable gcse2 for functions foo and foo2
14326    -fdisable-rtl-gcse2=foo,foo2
14327 # disable early inlining
14328    -fdisable-tree-einline
14329 # disable ipa inlining
14330    -fdisable-ipa-inline
14331 # enable tree full unroll
14332    -fenable-tree-unroll
14334 @end smallexample
14336 @item -fchecking
14337 @itemx -fchecking=@var{n}
14338 @opindex fchecking
14339 @opindex fno-checking
14340 Enable internal consistency checking.  The default depends on
14341 the compiler configuration.  @option{-fchecking=2} enables further
14342 internal consistency checking that might affect code generation.
14344 @item -frandom-seed=@var{string}
14345 @opindex frandom-seed
14346 This option provides a seed that GCC uses in place of
14347 random numbers in generating certain symbol names
14348 that have to be different in every compiled file.  It is also used to
14349 place unique stamps in coverage data files and the object files that
14350 produce them.  You can use the @option{-frandom-seed} option to produce
14351 reproducibly identical object files.
14353 The @var{string} can either be a number (decimal, octal or hex) or an
14354 arbitrary string (in which case it's converted to a number by
14355 computing CRC32).
14357 The @var{string} should be different for every file you compile.
14359 @item -save-temps
14360 @itemx -save-temps=cwd
14361 @opindex save-temps
14362 Store the usual ``temporary'' intermediate files permanently; place them
14363 in the current directory and name them based on the source file.  Thus,
14364 compiling @file{foo.c} with @option{-c -save-temps} produces files
14365 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
14366 preprocessed @file{foo.i} output file even though the compiler now
14367 normally uses an integrated preprocessor.
14369 When used in combination with the @option{-x} command-line option,
14370 @option{-save-temps} is sensible enough to avoid over writing an
14371 input source file with the same extension as an intermediate file.
14372 The corresponding intermediate file may be obtained by renaming the
14373 source file before using @option{-save-temps}.
14375 If you invoke GCC in parallel, compiling several different source
14376 files that share a common base name in different subdirectories or the
14377 same source file compiled for multiple output destinations, it is
14378 likely that the different parallel compilers will interfere with each
14379 other, and overwrite the temporary files.  For instance:
14381 @smallexample
14382 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
14383 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
14384 @end smallexample
14386 may result in @file{foo.i} and @file{foo.o} being written to
14387 simultaneously by both compilers.
14389 @item -save-temps=obj
14390 @opindex save-temps=obj
14391 Store the usual ``temporary'' intermediate files permanently.  If the
14392 @option{-o} option is used, the temporary files are based on the
14393 object file.  If the @option{-o} option is not used, the
14394 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
14396 For example:
14398 @smallexample
14399 gcc -save-temps=obj -c foo.c
14400 gcc -save-temps=obj -c bar.c -o dir/xbar.o
14401 gcc -save-temps=obj foobar.c -o dir2/yfoobar
14402 @end smallexample
14404 @noindent
14405 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
14406 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
14407 @file{dir2/yfoobar.o}.
14409 @item -time@r{[}=@var{file}@r{]}
14410 @opindex time
14411 Report the CPU time taken by each subprocess in the compilation
14412 sequence.  For C source files, this is the compiler proper and assembler
14413 (plus the linker if linking is done).
14415 Without the specification of an output file, the output looks like this:
14417 @smallexample
14418 # cc1 0.12 0.01
14419 # as 0.00 0.01
14420 @end smallexample
14422 The first number on each line is the ``user time'', that is time spent
14423 executing the program itself.  The second number is ``system time'',
14424 time spent executing operating system routines on behalf of the program.
14425 Both numbers are in seconds.
14427 With the specification of an output file, the output is appended to the
14428 named file, and it looks like this:
14430 @smallexample
14431 0.12 0.01 cc1 @var{options}
14432 0.00 0.01 as @var{options}
14433 @end smallexample
14435 The ``user time'' and the ``system time'' are moved before the program
14436 name, and the options passed to the program are displayed, so that one
14437 can later tell what file was being compiled, and with which options.
14439 @item -fdump-final-insns@r{[}=@var{file}@r{]}
14440 @opindex fdump-final-insns
14441 Dump the final internal representation (RTL) to @var{file}.  If the
14442 optional argument is omitted (or if @var{file} is @code{.}), the name
14443 of the dump file is determined by appending @code{.gkd} to the
14444 compilation output file name.
14446 @item -fcompare-debug@r{[}=@var{opts}@r{]}
14447 @opindex fcompare-debug
14448 @opindex fno-compare-debug
14449 If no error occurs during compilation, run the compiler a second time,
14450 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
14451 passed to the second compilation.  Dump the final internal
14452 representation in both compilations, and print an error if they differ.
14454 If the equal sign is omitted, the default @option{-gtoggle} is used.
14456 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
14457 and nonzero, implicitly enables @option{-fcompare-debug}.  If
14458 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
14459 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
14460 is used.
14462 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
14463 is equivalent to @option{-fno-compare-debug}, which disables the dumping
14464 of the final representation and the second compilation, preventing even
14465 @env{GCC_COMPARE_DEBUG} from taking effect.
14467 To verify full coverage during @option{-fcompare-debug} testing, set
14468 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
14469 which GCC rejects as an invalid option in any actual compilation
14470 (rather than preprocessing, assembly or linking).  To get just a
14471 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
14472 not overridden} will do.
14474 @item -fcompare-debug-second
14475 @opindex fcompare-debug-second
14476 This option is implicitly passed to the compiler for the second
14477 compilation requested by @option{-fcompare-debug}, along with options to
14478 silence warnings, and omitting other options that would cause the compiler
14479 to produce output to files or to standard output as a side effect.  Dump
14480 files and preserved temporary files are renamed so as to contain the
14481 @code{.gk} additional extension during the second compilation, to avoid
14482 overwriting those generated by the first.
14484 When this option is passed to the compiler driver, it causes the
14485 @emph{first} compilation to be skipped, which makes it useful for little
14486 other than debugging the compiler proper.
14488 @item -gtoggle
14489 @opindex gtoggle
14490 Turn off generation of debug info, if leaving out this option
14491 generates it, or turn it on at level 2 otherwise.  The position of this
14492 argument in the command line does not matter; it takes effect after all
14493 other options are processed, and it does so only once, no matter how
14494 many times it is given.  This is mainly intended to be used with
14495 @option{-fcompare-debug}.
14497 @item -fvar-tracking-assignments-toggle
14498 @opindex fvar-tracking-assignments-toggle
14499 @opindex fno-var-tracking-assignments-toggle
14500 Toggle @option{-fvar-tracking-assignments}, in the same way that
14501 @option{-gtoggle} toggles @option{-g}.
14503 @item -Q
14504 @opindex Q
14505 Makes the compiler print out each function name as it is compiled, and
14506 print some statistics about each pass when it finishes.
14508 @item -ftime-report
14509 @opindex ftime-report
14510 Makes the compiler print some statistics about the time consumed by each
14511 pass when it finishes.
14513 @item -ftime-report-details
14514 @opindex ftime-report-details
14515 Record the time consumed by infrastructure parts separately for each pass.
14517 @item -fira-verbose=@var{n}
14518 @opindex fira-verbose
14519 Control the verbosity of the dump file for the integrated register allocator.
14520 The default value is 5.  If the value @var{n} is greater or equal to 10,
14521 the dump output is sent to stderr using the same format as @var{n} minus 10.
14523 @item -flto-report
14524 @opindex flto-report
14525 Prints a report with internal details on the workings of the link-time
14526 optimizer.  The contents of this report vary from version to version.
14527 It is meant to be useful to GCC developers when processing object
14528 files in LTO mode (via @option{-flto}).
14530 Disabled by default.
14532 @item -flto-report-wpa
14533 @opindex flto-report-wpa
14534 Like @option{-flto-report}, but only print for the WPA phase of Link
14535 Time Optimization.
14537 @item -fmem-report
14538 @opindex fmem-report
14539 Makes the compiler print some statistics about permanent memory
14540 allocation when it finishes.
14542 @item -fmem-report-wpa
14543 @opindex fmem-report-wpa
14544 Makes the compiler print some statistics about permanent memory
14545 allocation for the WPA phase only.
14547 @item -fpre-ipa-mem-report
14548 @opindex fpre-ipa-mem-report
14549 @item -fpost-ipa-mem-report
14550 @opindex fpost-ipa-mem-report
14551 Makes the compiler print some statistics about permanent memory
14552 allocation before or after interprocedural optimization.
14554 @item -fprofile-report
14555 @opindex fprofile-report
14556 Makes the compiler print some statistics about consistency of the
14557 (estimated) profile and effect of individual passes.
14559 @item -fstack-usage
14560 @opindex fstack-usage
14561 Makes the compiler output stack usage information for the program, on a
14562 per-function basis.  The filename for the dump is made by appending
14563 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
14564 the output file, if explicitly specified and it is not an executable,
14565 otherwise it is the basename of the source file.  An entry is made up
14566 of three fields:
14568 @itemize
14569 @item
14570 The name of the function.
14571 @item
14572 A number of bytes.
14573 @item
14574 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
14575 @end itemize
14577 The qualifier @code{static} means that the function manipulates the stack
14578 statically: a fixed number of bytes are allocated for the frame on function
14579 entry and released on function exit; no stack adjustments are otherwise made
14580 in the function.  The second field is this fixed number of bytes.
14582 The qualifier @code{dynamic} means that the function manipulates the stack
14583 dynamically: in addition to the static allocation described above, stack
14584 adjustments are made in the body of the function, for example to push/pop
14585 arguments around function calls.  If the qualifier @code{bounded} is also
14586 present, the amount of these adjustments is bounded at compile time and
14587 the second field is an upper bound of the total amount of stack used by
14588 the function.  If it is not present, the amount of these adjustments is
14589 not bounded at compile time and the second field only represents the
14590 bounded part.
14592 @item -fstats
14593 @opindex fstats
14594 Emit statistics about front-end processing at the end of the compilation.
14595 This option is supported only by the C++ front end, and
14596 the information is generally only useful to the G++ development team.
14598 @item -fdbg-cnt-list
14599 @opindex fdbg-cnt-list
14600 Print the name and the counter upper bound for all debug counters.
14603 @item -fdbg-cnt=@var{counter-value-list}
14604 @opindex fdbg-cnt
14605 Set the internal debug counter lower and upper bound.  @var{counter-value-list}
14606 is a comma-separated list of @var{name}:@var{lower_bound}:@var{upper_bound}
14607 tuples which sets the lower and the upper bound of each debug
14608 counter @var{name}.  The @var{lower_bound} is optional and is zero
14609 initialized if not set.
14610 All debug counters have the initial upper bound of @code{UINT_MAX};
14611 thus @code{dbg_cnt} returns true always unless the upper bound
14612 is set by this option.
14613 For example, with @option{-fdbg-cnt=dce:2:4,tail_call:10},
14614 @code{dbg_cnt(dce)} returns true only for third and fourth invocation.
14615 For @code{dbg_cnt(tail_call)} true is returned for first 10 invocations.
14617 @item -print-file-name=@var{library}
14618 @opindex print-file-name
14619 Print the full absolute name of the library file @var{library} that
14620 would be used when linking---and don't do anything else.  With this
14621 option, GCC does not compile or link anything; it just prints the
14622 file name.
14624 @item -print-multi-directory
14625 @opindex print-multi-directory
14626 Print the directory name corresponding to the multilib selected by any
14627 other switches present in the command line.  This directory is supposed
14628 to exist in @env{GCC_EXEC_PREFIX}.
14630 @item -print-multi-lib
14631 @opindex print-multi-lib
14632 Print the mapping from multilib directory names to compiler switches
14633 that enable them.  The directory name is separated from the switches by
14634 @samp{;}, and each switch starts with an @samp{@@} instead of the
14635 @samp{-}, without spaces between multiple switches.  This is supposed to
14636 ease shell processing.
14638 @item -print-multi-os-directory
14639 @opindex print-multi-os-directory
14640 Print the path to OS libraries for the selected
14641 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
14642 present in the @file{lib} subdirectory and no multilibs are used, this is
14643 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
14644 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
14645 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
14646 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
14648 @item -print-multiarch
14649 @opindex print-multiarch
14650 Print the path to OS libraries for the selected multiarch,
14651 relative to some @file{lib} subdirectory.
14653 @item -print-prog-name=@var{program}
14654 @opindex print-prog-name
14655 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
14657 @item -print-libgcc-file-name
14658 @opindex print-libgcc-file-name
14659 Same as @option{-print-file-name=libgcc.a}.
14661 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
14662 but you do want to link with @file{libgcc.a}.  You can do:
14664 @smallexample
14665 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
14666 @end smallexample
14668 @item -print-search-dirs
14669 @opindex print-search-dirs
14670 Print the name of the configured installation directory and a list of
14671 program and library directories @command{gcc} searches---and don't do anything else.
14673 This is useful when @command{gcc} prints the error message
14674 @samp{installation problem, cannot exec cpp0: No such file or directory}.
14675 To resolve this you either need to put @file{cpp0} and the other compiler
14676 components where @command{gcc} expects to find them, or you can set the environment
14677 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
14678 Don't forget the trailing @samp{/}.
14679 @xref{Environment Variables}.
14681 @item -print-sysroot
14682 @opindex print-sysroot
14683 Print the target sysroot directory that is used during
14684 compilation.  This is the target sysroot specified either at configure
14685 time or using the @option{--sysroot} option, possibly with an extra
14686 suffix that depends on compilation options.  If no target sysroot is
14687 specified, the option prints nothing.
14689 @item -print-sysroot-headers-suffix
14690 @opindex print-sysroot-headers-suffix
14691 Print the suffix added to the target sysroot when searching for
14692 headers, or give an error if the compiler is not configured with such
14693 a suffix---and don't do anything else.
14695 @item -dumpmachine
14696 @opindex dumpmachine
14697 Print the compiler's target machine (for example,
14698 @samp{i686-pc-linux-gnu})---and don't do anything else.
14700 @item -dumpversion
14701 @opindex dumpversion
14702 Print the compiler version (for example, @code{3.0}, @code{6.3.0} or @code{7})---and don't do
14703 anything else.  This is the compiler version used in filesystem paths,
14704 specs, can be depending on how the compiler has been configured just
14705 a single number (major version), two numbers separated by dot (major and
14706 minor version) or three numbers separated by dots (major, minor and patchlevel
14707 version).
14709 @item -dumpfullversion
14710 @opindex dumpfullversion
14711 Print the full compiler version, always 3 numbers separated by dots,
14712 major, minor and patchlevel version.
14714 @item -dumpspecs
14715 @opindex dumpspecs
14716 Print the compiler's built-in specs---and don't do anything else.  (This
14717 is used when GCC itself is being built.)  @xref{Spec Files}.
14718 @end table
14720 @node Submodel Options
14721 @section Machine-Dependent Options
14722 @cindex submodel options
14723 @cindex specifying hardware config
14724 @cindex hardware models and configurations, specifying
14725 @cindex target-dependent options
14726 @cindex machine-dependent options
14728 Each target machine supported by GCC can have its own options---for
14729 example, to allow you to compile for a particular processor variant or
14730 ABI, or to control optimizations specific to that machine.  By
14731 convention, the names of machine-specific options start with
14732 @samp{-m}.
14734 Some configurations of the compiler also support additional target-specific
14735 options, usually for compatibility with other compilers on the same
14736 platform.
14738 @c This list is ordered alphanumerically by subsection name.
14739 @c It should be the same order and spelling as these options are listed
14740 @c in Machine Dependent Options
14742 @menu
14743 * AArch64 Options::
14744 * Adapteva Epiphany Options::
14745 * ARC Options::
14746 * ARM Options::
14747 * AVR Options::
14748 * Blackfin Options::
14749 * C6X Options::
14750 * CRIS Options::
14751 * CR16 Options::
14752 * C-SKY Options::
14753 * Darwin Options::
14754 * DEC Alpha Options::
14755 * FR30 Options::
14756 * FT32 Options::
14757 * FRV Options::
14758 * GNU/Linux Options::
14759 * H8/300 Options::
14760 * HPPA Options::
14761 * IA-64 Options::
14762 * LM32 Options::
14763 * M32C Options::
14764 * M32R/D Options::
14765 * M680x0 Options::
14766 * MCore Options::
14767 * MeP Options::
14768 * MicroBlaze Options::
14769 * MIPS Options::
14770 * MMIX Options::
14771 * MN10300 Options::
14772 * Moxie Options::
14773 * MSP430 Options::
14774 * NDS32 Options::
14775 * Nios II Options::
14776 * Nvidia PTX Options::
14777 * PDP-11 Options::
14778 * picoChip Options::
14779 * PowerPC Options::
14780 * PowerPC SPE Options::
14781 * RISC-V Options::
14782 * RL78 Options::
14783 * RS/6000 and PowerPC Options::
14784 * RX Options::
14785 * S/390 and zSeries Options::
14786 * Score Options::
14787 * SH Options::
14788 * Solaris 2 Options::
14789 * SPARC Options::
14790 * SPU Options::
14791 * System V Options::
14792 * TILE-Gx Options::
14793 * TILEPro Options::
14794 * V850 Options::
14795 * VAX Options::
14796 * Visium Options::
14797 * VMS Options::
14798 * VxWorks Options::
14799 * x86 Options::
14800 * x86 Windows Options::
14801 * Xstormy16 Options::
14802 * Xtensa Options::
14803 * zSeries Options::
14804 @end menu
14806 @node AArch64 Options
14807 @subsection AArch64 Options
14808 @cindex AArch64 Options
14810 These options are defined for AArch64 implementations:
14812 @table @gcctabopt
14814 @item -mabi=@var{name}
14815 @opindex mabi
14816 Generate code for the specified data model.  Permissible values
14817 are @samp{ilp32} for SysV-like data model where int, long int and pointers
14818 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
14819 but long int and pointers are 64 bits.
14821 The default depends on the specific target configuration.  Note that
14822 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
14823 entire program with the same ABI, and link with a compatible set of libraries.
14825 @item -mbig-endian
14826 @opindex mbig-endian
14827 Generate big-endian code.  This is the default when GCC is configured for an
14828 @samp{aarch64_be-*-*} target.
14830 @item -mgeneral-regs-only
14831 @opindex mgeneral-regs-only
14832 Generate code which uses only the general-purpose registers.  This will prevent
14833 the compiler from using floating-point and Advanced SIMD registers but will not
14834 impose any restrictions on the assembler.
14836 @item -mlittle-endian
14837 @opindex mlittle-endian
14838 Generate little-endian code.  This is the default when GCC is configured for an
14839 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
14841 @item -mcmodel=tiny
14842 @opindex mcmodel=tiny
14843 Generate code for the tiny code model.  The program and its statically defined
14844 symbols must be within 1MB of each other.  Programs can be statically or
14845 dynamically linked.
14847 @item -mcmodel=small
14848 @opindex mcmodel=small
14849 Generate code for the small code model.  The program and its statically defined
14850 symbols must be within 4GB of each other.  Programs can be statically or
14851 dynamically linked.  This is the default code model.
14853 @item -mcmodel=large
14854 @opindex mcmodel=large
14855 Generate code for the large code model.  This makes no assumptions about
14856 addresses and sizes of sections.  Programs can be statically linked only.
14858 @item -mstrict-align
14859 @itemx -mno-strict-align
14860 @opindex mstrict-align
14861 @opindex mno-strict-align
14862 Avoid or allow generating memory accesses that may not be aligned on a natural
14863 object boundary as described in the architecture specification.
14865 @item -momit-leaf-frame-pointer
14866 @itemx -mno-omit-leaf-frame-pointer
14867 @opindex momit-leaf-frame-pointer
14868 @opindex mno-omit-leaf-frame-pointer
14869 Omit or keep the frame pointer in leaf functions.  The former behavior is the
14870 default.
14872 @item -mtls-dialect=desc
14873 @opindex mtls-dialect=desc
14874 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
14875 of TLS variables.  This is the default.
14877 @item -mtls-dialect=traditional
14878 @opindex mtls-dialect=traditional
14879 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
14880 of TLS variables.
14882 @item -mtls-size=@var{size}
14883 @opindex mtls-size
14884 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
14885 This option requires binutils 2.26 or newer.
14887 @item -mfix-cortex-a53-835769
14888 @itemx -mno-fix-cortex-a53-835769
14889 @opindex mfix-cortex-a53-835769
14890 @opindex mno-fix-cortex-a53-835769
14891 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
14892 This involves inserting a NOP instruction between memory instructions and
14893 64-bit integer multiply-accumulate instructions.
14895 @item -mfix-cortex-a53-843419
14896 @itemx -mno-fix-cortex-a53-843419
14897 @opindex mfix-cortex-a53-843419
14898 @opindex mno-fix-cortex-a53-843419
14899 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
14900 This erratum workaround is made at link time and this will only pass the
14901 corresponding flag to the linker.
14903 @item -mlow-precision-recip-sqrt
14904 @itemx -mno-low-precision-recip-sqrt
14905 @opindex mlow-precision-recip-sqrt
14906 @opindex mno-low-precision-recip-sqrt
14907 Enable or disable the reciprocal square root approximation.
14908 This option only has an effect if @option{-ffast-math} or
14909 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14910 precision of reciprocal square root results to about 16 bits for
14911 single precision and to 32 bits for double precision.
14913 @item -mlow-precision-sqrt
14914 @itemx -mno-low-precision-sqrt
14915 @opindex -mlow-precision-sqrt
14916 @opindex -mno-low-precision-sqrt
14917 Enable or disable the square root approximation.
14918 This option only has an effect if @option{-ffast-math} or
14919 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14920 precision of square root results to about 16 bits for
14921 single precision and to 32 bits for double precision.
14922 If enabled, it implies @option{-mlow-precision-recip-sqrt}.
14924 @item -mlow-precision-div
14925 @itemx -mno-low-precision-div
14926 @opindex -mlow-precision-div
14927 @opindex -mno-low-precision-div
14928 Enable or disable the division approximation.
14929 This option only has an effect if @option{-ffast-math} or
14930 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14931 precision of division results to about 16 bits for
14932 single precision and to 32 bits for double precision.
14934 @item -mtrack-speculation
14935 @itemx -mno-track-speculation
14936 Enable or disable generation of additional code to track speculative
14937 execution through conditional branches.  The tracking state can then
14938 be used by the compiler when expanding calls to
14939 @code{__builtin_speculation_safe_copy} to permit a more efficient code
14940 sequence to be generated.
14942 @item -march=@var{name}
14943 @opindex march
14944 Specify the name of the target architecture and, optionally, one or
14945 more feature modifiers.  This option has the form
14946 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
14948 The permissible values for @var{arch} are @samp{armv8-a},
14949 @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a} or @samp{armv8.4-a}
14950 or @var{native}.
14952 The value @samp{armv8.4-a} implies @samp{armv8.3-a} and enables compiler
14953 support for the ARMv8.4-A architecture extensions.
14955 The value @samp{armv8.3-a} implies @samp{armv8.2-a} and enables compiler
14956 support for the ARMv8.3-A architecture extensions.
14958 The value @samp{armv8.2-a} implies @samp{armv8.1-a} and enables compiler
14959 support for the ARMv8.2-A architecture extensions.
14961 The value @samp{armv8.1-a} implies @samp{armv8-a} and enables compiler
14962 support for the ARMv8.1-A architecture extension.  In particular, it
14963 enables the @samp{+crc}, @samp{+lse}, and @samp{+rdma} features.
14965 The value @samp{native} is available on native AArch64 GNU/Linux and
14966 causes the compiler to pick the architecture of the host system.  This
14967 option has no effect if the compiler is unable to recognize the
14968 architecture of the host system,
14970 The permissible values for @var{feature} are listed in the sub-section
14971 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
14972 Feature Modifiers}.  Where conflicting feature modifiers are
14973 specified, the right-most feature is used.
14975 GCC uses @var{name} to determine what kind of instructions it can emit
14976 when generating assembly code.  If @option{-march} is specified
14977 without either of @option{-mtune} or @option{-mcpu} also being
14978 specified, the code is tuned to perform well across a range of target
14979 processors implementing the target architecture.
14981 @item -mtune=@var{name}
14982 @opindex mtune
14983 Specify the name of the target processor for which GCC should tune the
14984 performance of the code.  Permissible values for this option are:
14985 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
14986 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
14987 @samp{cortex-a76}, @samp{exynos-m1}, @samp{falkor}, @samp{qdf24xx},
14988 @samp{saphira}, @samp{phecda}, @samp{xgene1}, @samp{vulcan}, @samp{thunderx},
14989 @samp{thunderxt88}, @samp{thunderxt88p1}, @samp{thunderxt81},
14990 @samp{thunderxt83}, @samp{thunderx2t99}, @samp{cortex-a57.cortex-a53},
14991 @samp{cortex-a72.cortex-a53}, @samp{cortex-a73.cortex-a35},
14992 @samp{cortex-a73.cortex-a53}, @samp{cortex-a75.cortex-a55},
14993 @samp{cortex-a76.cortex-a55}
14994 @samp{native}.
14996 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
14997 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
14998 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55} specify that GCC
14999 should tune for a big.LITTLE system.
15001 Additionally on native AArch64 GNU/Linux systems the value
15002 @samp{native} tunes performance to the host system.  This option has no effect
15003 if the compiler is unable to recognize the processor of the host system.
15005 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
15006 are specified, the code is tuned to perform well across a range
15007 of target processors.
15009 This option cannot be suffixed by feature modifiers.
15011 @item -mcpu=@var{name}
15012 @opindex mcpu
15013 Specify the name of the target processor, optionally suffixed by one
15014 or more feature modifiers.  This option has the form
15015 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
15016 the permissible values for @var{cpu} are the same as those available
15017 for @option{-mtune}.  The permissible values for @var{feature} are
15018 documented in the sub-section on
15019 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
15020 Feature Modifiers}.  Where conflicting feature modifiers are
15021 specified, the right-most feature is used.
15023 GCC uses @var{name} to determine what kind of instructions it can emit when
15024 generating assembly code (as if by @option{-march}) and to determine
15025 the target processor for which to tune for performance (as if
15026 by @option{-mtune}).  Where this option is used in conjunction
15027 with @option{-march} or @option{-mtune}, those options take precedence
15028 over the appropriate part of this option.
15030 @item -moverride=@var{string}
15031 @opindex moverride
15032 Override tuning decisions made by the back-end in response to a
15033 @option{-mtune=} switch.  The syntax, semantics, and accepted values
15034 for @var{string} in this option are not guaranteed to be consistent
15035 across releases.
15037 This option is only intended to be useful when developing GCC.
15039 @item -mverbose-cost-dump
15040 @opindex mverbose-cost-dump
15041 Enable verbose cost model dumping in the debug dump files.  This option is
15042 provided for use in debugging the compiler.
15044 @item -mpc-relative-literal-loads
15045 @itemx -mno-pc-relative-literal-loads
15046 @opindex mpc-relative-literal-loads
15047 @opindex mno-pc-relative-literal-loads
15048 Enable or disable PC-relative literal loads.  With this option literal pools are
15049 accessed using a single instruction and emitted after each function.  This
15050 limits the maximum size of functions to 1MB.  This is enabled by default for
15051 @option{-mcmodel=tiny}.
15053 @item -msign-return-address=@var{scope}
15054 @opindex msign-return-address
15055 Select the function scope on which return address signing will be applied.
15056 Permissible values are @samp{none}, which disables return address signing,
15057 @samp{non-leaf}, which enables pointer signing for functions which are not leaf
15058 functions, and @samp{all}, which enables pointer signing for all functions.  The
15059 default value is @samp{none}.
15061 @item -msve-vector-bits=@var{bits}
15062 @opindex msve-vector-bits
15063 Specify the number of bits in an SVE vector register.  This option only has
15064 an effect when SVE is enabled.
15066 GCC supports two forms of SVE code generation: ``vector-length
15067 agnostic'' output that works with any size of vector register and
15068 ``vector-length specific'' output that only works when the vector
15069 registers are a particular size.  Replacing @var{bits} with
15070 @samp{scalable} selects vector-length agnostic output while
15071 replacing it with a number selects vector-length specific output.
15072 The possible lengths in the latter case are: 128, 256, 512, 1024
15073 and 2048.  @samp{scalable} is the default.
15075 At present, @samp{-msve-vector-bits=128} produces the same output
15076 as @samp{-msve-vector-bits=scalable}.
15078 @end table
15080 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
15081 @anchor{aarch64-feature-modifiers}
15082 @cindex @option{-march} feature modifiers
15083 @cindex @option{-mcpu} feature modifiers
15084 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
15085 the following and their inverses @option{no@var{feature}}:
15087 @table @samp
15088 @item crc
15089 Enable CRC extension.  This is on by default for
15090 @option{-march=armv8.1-a}.
15091 @item crypto
15092 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
15093 instructions.
15094 @item fp
15095 Enable floating-point instructions.  This is on by default for all possible
15096 values for options @option{-march} and @option{-mcpu}.
15097 @item simd
15098 Enable Advanced SIMD instructions.  This also enables floating-point
15099 instructions.  This is on by default for all possible values for options
15100 @option{-march} and @option{-mcpu}.
15101 @item sve
15102 Enable Scalable Vector Extension instructions.  This also enables Advanced
15103 SIMD and floating-point instructions.
15104 @item lse
15105 Enable Large System Extension instructions.  This is on by default for
15106 @option{-march=armv8.1-a}.
15107 @item rdma
15108 Enable Round Double Multiply Accumulate instructions.  This is on by default
15109 for @option{-march=armv8.1-a}.
15110 @item fp16
15111 Enable FP16 extension.  This also enables floating-point instructions.
15112 @item fp16fml
15113 Enable FP16 fmla extension.  This also enables FP16 extensions and
15114 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.
15116 @item rcpc
15117 Enable the RcPc extension.  This does not change code generation from GCC,
15118 but is passed on to the assembler, enabling inline asm statements to use
15119 instructions from the RcPc extension.
15120 @item dotprod
15121 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
15122 @item aes
15123 Enable the Armv8-a aes and pmull crypto extension.  This also enables Advanced
15124 SIMD instructions.
15125 @item sha2
15126 Enable the Armv8-a sha2 crypto extension.  This also enables Advanced SIMD instructions.
15127 @item sha3
15128 Enable the sha512 and sha3 crypto extension.  This also enables Advanced SIMD
15129 instructions. Use of this option with architectures prior to Armv8.2-A is not supported.
15130 @item sm4
15131 Enable the sm3 and sm4 crypto extension.  This also enables Advanced SIMD instructions.
15132 Use of this option with architectures prior to Armv8.2-A is not supported.
15133 @item profile
15134 Enable the Statistical Profiling extension.  This option is only to enable the
15135 extension at the assembler level and does not affect code generation.
15137 @end table
15139 Feature @option{crypto} implies @option{aes}, @option{sha2}, and @option{simd},
15140 which implies @option{fp}.
15141 Conversely, @option{nofp} implies @option{nosimd}, which implies
15142 @option{nocrypto}, @option{noaes} and @option{nosha2}.
15144 @node Adapteva Epiphany Options
15145 @subsection Adapteva Epiphany Options
15147 These @samp{-m} options are defined for Adapteva Epiphany:
15149 @table @gcctabopt
15150 @item -mhalf-reg-file
15151 @opindex mhalf-reg-file
15152 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
15153 That allows code to run on hardware variants that lack these registers.
15155 @item -mprefer-short-insn-regs
15156 @opindex mprefer-short-insn-regs
15157 Preferentially allocate registers that allow short instruction generation.
15158 This can result in increased instruction count, so this may either reduce or
15159 increase overall code size.
15161 @item -mbranch-cost=@var{num}
15162 @opindex mbranch-cost
15163 Set the cost of branches to roughly @var{num} ``simple'' instructions.
15164 This cost is only a heuristic and is not guaranteed to produce
15165 consistent results across releases.
15167 @item -mcmove
15168 @opindex mcmove
15169 Enable the generation of conditional moves.
15171 @item -mnops=@var{num}
15172 @opindex mnops
15173 Emit @var{num} NOPs before every other generated instruction.
15175 @item -mno-soft-cmpsf
15176 @opindex mno-soft-cmpsf
15177 For single-precision floating-point comparisons, emit an @code{fsub} instruction
15178 and test the flags.  This is faster than a software comparison, but can
15179 get incorrect results in the presence of NaNs, or when two different small
15180 numbers are compared such that their difference is calculated as zero.
15181 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
15182 software comparisons.
15184 @item -mstack-offset=@var{num}
15185 @opindex mstack-offset
15186 Set the offset between the top of the stack and the stack pointer.
15187 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
15188 can be used by leaf functions without stack allocation.
15189 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
15190 Note also that this option changes the ABI; compiling a program with a
15191 different stack offset than the libraries have been compiled with
15192 generally does not work.
15193 This option can be useful if you want to evaluate if a different stack
15194 offset would give you better code, but to actually use a different stack
15195 offset to build working programs, it is recommended to configure the
15196 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
15198 @item -mno-round-nearest
15199 @opindex mno-round-nearest
15200 Make the scheduler assume that the rounding mode has been set to
15201 truncating.  The default is @option{-mround-nearest}.
15203 @item -mlong-calls
15204 @opindex mlong-calls
15205 If not otherwise specified by an attribute, assume all calls might be beyond
15206 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
15207 function address into a register before performing a (otherwise direct) call.
15208 This is the default.
15210 @item -mshort-calls
15211 @opindex short-calls
15212 If not otherwise specified by an attribute, assume all direct calls are
15213 in the range of the @code{b} / @code{bl} instructions, so use these instructions
15214 for direct calls.  The default is @option{-mlong-calls}.
15216 @item -msmall16
15217 @opindex msmall16
15218 Assume addresses can be loaded as 16-bit unsigned values.  This does not
15219 apply to function addresses for which @option{-mlong-calls} semantics
15220 are in effect.
15222 @item -mfp-mode=@var{mode}
15223 @opindex mfp-mode
15224 Set the prevailing mode of the floating-point unit.
15225 This determines the floating-point mode that is provided and expected
15226 at function call and return time.  Making this mode match the mode you
15227 predominantly need at function start can make your programs smaller and
15228 faster by avoiding unnecessary mode switches.
15230 @var{mode} can be set to one the following values:
15232 @table @samp
15233 @item caller
15234 Any mode at function entry is valid, and retained or restored when
15235 the function returns, and when it calls other functions.
15236 This mode is useful for compiling libraries or other compilation units
15237 you might want to incorporate into different programs with different
15238 prevailing FPU modes, and the convenience of being able to use a single
15239 object file outweighs the size and speed overhead for any extra
15240 mode switching that might be needed, compared with what would be needed
15241 with a more specific choice of prevailing FPU mode.
15243 @item truncate
15244 This is the mode used for floating-point calculations with
15245 truncating (i.e.@: round towards zero) rounding mode.  That includes
15246 conversion from floating point to integer.
15248 @item round-nearest
15249 This is the mode used for floating-point calculations with
15250 round-to-nearest-or-even rounding mode.
15252 @item int
15253 This is the mode used to perform integer calculations in the FPU, e.g.@:
15254 integer multiply, or integer multiply-and-accumulate.
15255 @end table
15257 The default is @option{-mfp-mode=caller}
15259 @item -mnosplit-lohi
15260 @itemx -mno-postinc
15261 @itemx -mno-postmodify
15262 @opindex mnosplit-lohi
15263 @opindex mno-postinc
15264 @opindex mno-postmodify
15265 Code generation tweaks that disable, respectively, splitting of 32-bit
15266 loads, generation of post-increment addresses, and generation of
15267 post-modify addresses.  The defaults are @option{msplit-lohi},
15268 @option{-mpost-inc}, and @option{-mpost-modify}.
15270 @item -mnovect-double
15271 @opindex mno-vect-double
15272 Change the preferred SIMD mode to SImode.  The default is
15273 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
15275 @item -max-vect-align=@var{num}
15276 @opindex max-vect-align
15277 The maximum alignment for SIMD vector mode types.
15278 @var{num} may be 4 or 8.  The default is 8.
15279 Note that this is an ABI change, even though many library function
15280 interfaces are unaffected if they don't use SIMD vector modes
15281 in places that affect size and/or alignment of relevant types.
15283 @item -msplit-vecmove-early
15284 @opindex msplit-vecmove-early
15285 Split vector moves into single word moves before reload.  In theory this
15286 can give better register allocation, but so far the reverse seems to be
15287 generally the case.
15289 @item -m1reg-@var{reg}
15290 @opindex m1reg-
15291 Specify a register to hold the constant @minus{}1, which makes loading small negative
15292 constants and certain bitmasks faster.
15293 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
15294 which specify use of that register as a fixed register,
15295 and @samp{none}, which means that no register is used for this
15296 purpose.  The default is @option{-m1reg-none}.
15298 @end table
15300 @node ARC Options
15301 @subsection ARC Options
15302 @cindex ARC options
15304 The following options control the architecture variant for which code
15305 is being compiled:
15307 @c architecture variants
15308 @table @gcctabopt
15310 @item -mbarrel-shifter
15311 @opindex mbarrel-shifter
15312 Generate instructions supported by barrel shifter.  This is the default
15313 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
15315 @item -mjli-always
15316 @opindex mjli-alawys
15317 Force to call a function using jli_s instruction.  This option is
15318 valid only for ARCv2 architecture.
15320 @item -mcpu=@var{cpu}
15321 @opindex mcpu
15322 Set architecture type, register usage, and instruction scheduling
15323 parameters for @var{cpu}.  There are also shortcut alias options
15324 available for backward compatibility and convenience.  Supported
15325 values for @var{cpu} are
15327 @table @samp
15328 @opindex mA6
15329 @opindex mARC600
15330 @item arc600
15331 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
15333 @item arc601
15334 @opindex mARC601
15335 Compile for ARC601.  Alias: @option{-mARC601}.
15337 @item arc700
15338 @opindex mA7
15339 @opindex mARC700
15340 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
15341 This is the default when configured with @option{--with-cpu=arc700}@.
15343 @item arcem
15344 Compile for ARC EM.
15346 @item archs
15347 Compile for ARC HS.
15349 @item em
15350 Compile for ARC EM CPU with no hardware extensions.
15352 @item em4
15353 Compile for ARC EM4 CPU.
15355 @item em4_dmips
15356 Compile for ARC EM4 DMIPS CPU.
15358 @item em4_fpus
15359 Compile for ARC EM4 DMIPS CPU with the single-precision floating-point
15360 extension.
15362 @item em4_fpuda
15363 Compile for ARC EM4 DMIPS CPU with single-precision floating-point and
15364 double assist instructions.
15366 @item hs
15367 Compile for ARC HS CPU with no hardware extensions except the atomic
15368 instructions.
15370 @item hs34
15371 Compile for ARC HS34 CPU.
15373 @item hs38
15374 Compile for ARC HS38 CPU.
15376 @item hs38_linux
15377 Compile for ARC HS38 CPU with all hardware extensions on.
15379 @item arc600_norm
15380 Compile for ARC 600 CPU with @code{norm} instructions enabled.
15382 @item arc600_mul32x16
15383 Compile for ARC 600 CPU with @code{norm} and 32x16-bit multiply 
15384 instructions enabled.
15386 @item arc600_mul64
15387 Compile for ARC 600 CPU with @code{norm} and @code{mul64}-family 
15388 instructions enabled.
15390 @item arc601_norm
15391 Compile for ARC 601 CPU with @code{norm} instructions enabled.
15393 @item arc601_mul32x16
15394 Compile for ARC 601 CPU with @code{norm} and 32x16-bit multiply
15395 instructions enabled.
15397 @item arc601_mul64
15398 Compile for ARC 601 CPU with @code{norm} and @code{mul64}-family
15399 instructions enabled.
15401 @item nps400
15402 Compile for ARC 700 on NPS400 chip.
15404 @item em_mini
15405 Compile for ARC EM minimalist configuration featuring reduced register
15406 set.
15408 @end table
15410 @item -mdpfp
15411 @opindex mdpfp
15412 @itemx -mdpfp-compact
15413 @opindex mdpfp-compact
15414 Generate double-precision FPX instructions, tuned for the compact
15415 implementation.
15417 @item -mdpfp-fast
15418 @opindex mdpfp-fast
15419 Generate double-precision FPX instructions, tuned for the fast
15420 implementation.
15422 @item -mno-dpfp-lrsr
15423 @opindex mno-dpfp-lrsr
15424 Disable @code{lr} and @code{sr} instructions from using FPX extension
15425 aux registers.
15427 @item -mea
15428 @opindex mea
15429 Generate extended arithmetic instructions.  Currently only
15430 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
15431 supported.  This is always enabled for @option{-mcpu=ARC700}.
15433 @item -mno-mpy
15434 @opindex mno-mpy
15435 Do not generate @code{mpy}-family instructions for ARC700.  This option is
15436 deprecated.
15438 @item -mmul32x16
15439 @opindex mmul32x16
15440 Generate 32x16-bit multiply and multiply-accumulate instructions.
15442 @item -mmul64
15443 @opindex mmul64
15444 Generate @code{mul64} and @code{mulu64} instructions.  
15445 Only valid for @option{-mcpu=ARC600}.
15447 @item -mnorm
15448 @opindex mnorm
15449 Generate @code{norm} instructions.  This is the default if @option{-mcpu=ARC700}
15450 is in effect.
15452 @item -mspfp
15453 @opindex mspfp
15454 @itemx -mspfp-compact
15455 @opindex mspfp-compact
15456 Generate single-precision FPX instructions, tuned for the compact
15457 implementation.
15459 @item -mspfp-fast
15460 @opindex mspfp-fast
15461 Generate single-precision FPX instructions, tuned for the fast
15462 implementation.
15464 @item -msimd
15465 @opindex msimd
15466 Enable generation of ARC SIMD instructions via target-specific
15467 builtins.  Only valid for @option{-mcpu=ARC700}.
15469 @item -msoft-float
15470 @opindex msoft-float
15471 This option ignored; it is provided for compatibility purposes only.
15472 Software floating-point code is emitted by default, and this default
15473 can overridden by FPX options; @option{-mspfp}, @option{-mspfp-compact}, or
15474 @option{-mspfp-fast} for single precision, and @option{-mdpfp},
15475 @option{-mdpfp-compact}, or @option{-mdpfp-fast} for double precision.
15477 @item -mswap
15478 @opindex mswap
15479 Generate @code{swap} instructions.
15481 @item -matomic
15482 @opindex matomic
15483 This enables use of the locked load/store conditional extension to implement
15484 atomic memory built-in functions.  Not available for ARC 6xx or ARC
15485 EM cores.
15487 @item -mdiv-rem
15488 @opindex mdiv-rem
15489 Enable @code{div} and @code{rem} instructions for ARCv2 cores.
15491 @item -mcode-density
15492 @opindex mcode-density
15493 Enable code density instructions for ARC EM.  
15494 This option is on by default for ARC HS.
15496 @item -mll64
15497 @opindex mll64
15498 Enable double load/store operations for ARC HS cores.
15500 @item -mtp-regno=@var{regno}
15501 @opindex mtp-regno
15502 Specify thread pointer register number.
15504 @item -mmpy-option=@var{multo}
15505 @opindex mmpy-option
15506 Compile ARCv2 code with a multiplier design option.  You can specify 
15507 the option using either a string or numeric value for @var{multo}.  
15508 @samp{wlh1} is the default value.  The recognized values are:
15510 @table @samp
15511 @item 0
15512 @itemx none
15513 No multiplier available.
15515 @item 1
15516 @itemx w
15517 16x16 multiplier, fully pipelined.
15518 The following instructions are enabled: @code{mpyw} and @code{mpyuw}.
15520 @item 2
15521 @itemx wlh1
15522 32x32 multiplier, fully
15523 pipelined (1 stage).  The following instructions are additionally
15524 enabled: @code{mpy}, @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15526 @item 3
15527 @itemx wlh2
15528 32x32 multiplier, fully pipelined
15529 (2 stages).  The following instructions are additionally enabled: @code{mpy},
15530 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15532 @item 4
15533 @itemx wlh3
15534 Two 16x16 multipliers, blocking,
15535 sequential.  The following instructions are additionally enabled: @code{mpy},
15536 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15538 @item 5
15539 @itemx wlh4
15540 One 16x16 multiplier, blocking,
15541 sequential.  The following instructions are additionally enabled: @code{mpy},
15542 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15544 @item 6
15545 @itemx wlh5
15546 One 32x4 multiplier, blocking,
15547 sequential.  The following instructions are additionally enabled: @code{mpy},
15548 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15550 @item 7
15551 @itemx plus_dmpy
15552 ARC HS SIMD support.
15554 @item 8
15555 @itemx plus_macd
15556 ARC HS SIMD support.
15558 @item 9
15559 @itemx plus_qmacw
15560 ARC HS SIMD support.
15562 @end table
15564 This option is only available for ARCv2 cores@.
15566 @item -mfpu=@var{fpu}
15567 @opindex mfpu
15568 Enables support for specific floating-point hardware extensions for ARCv2
15569 cores.  Supported values for @var{fpu} are:
15571 @table @samp
15573 @item fpus
15574 Enables support for single-precision floating-point hardware
15575 extensions@.
15577 @item fpud
15578 Enables support for double-precision floating-point hardware
15579 extensions.  The single-precision floating-point extension is also
15580 enabled.  Not available for ARC EM@.
15582 @item fpuda
15583 Enables support for double-precision floating-point hardware
15584 extensions using double-precision assist instructions.  The single-precision
15585 floating-point extension is also enabled.  This option is
15586 only available for ARC EM@.
15588 @item fpuda_div
15589 Enables support for double-precision floating-point hardware
15590 extensions using double-precision assist instructions.
15591 The single-precision floating-point, square-root, and divide 
15592 extensions are also enabled.  This option is
15593 only available for ARC EM@.
15595 @item fpuda_fma
15596 Enables support for double-precision floating-point hardware
15597 extensions using double-precision assist instructions.
15598 The single-precision floating-point and fused multiply and add 
15599 hardware extensions are also enabled.  This option is
15600 only available for ARC EM@.
15602 @item fpuda_all
15603 Enables support for double-precision floating-point hardware
15604 extensions using double-precision assist instructions.
15605 All single-precision floating-point hardware extensions are also
15606 enabled.  This option is only available for ARC EM@.
15608 @item fpus_div
15609 Enables support for single-precision floating-point, square-root and divide 
15610 hardware extensions@.
15612 @item fpud_div
15613 Enables support for double-precision floating-point, square-root and divide 
15614 hardware extensions.  This option
15615 includes option @samp{fpus_div}. Not available for ARC EM@.
15617 @item fpus_fma
15618 Enables support for single-precision floating-point and 
15619 fused multiply and add hardware extensions@.
15621 @item fpud_fma
15622 Enables support for double-precision floating-point and 
15623 fused multiply and add hardware extensions.  This option
15624 includes option @samp{fpus_fma}.  Not available for ARC EM@.
15626 @item fpus_all
15627 Enables support for all single-precision floating-point hardware
15628 extensions@.
15630 @item fpud_all
15631 Enables support for all single- and double-precision floating-point
15632 hardware extensions.  Not available for ARC EM@.
15634 @end table
15636 @item -mirq-ctrl-saved=@var{register-range}, @var{blink}, @var{lp_count}
15637 @opindex mirq-ctrl-saved
15638 Specifies general-purposes registers that the processor automatically
15639 saves/restores on interrupt entry and exit.  @var{register-range} is
15640 specified as two registers separated by a dash.  The register range
15641 always starts with @code{r0}, the upper limit is @code{fp} register.
15642 @var{blink} and @var{lp_count} are optional.  This option is only
15643 valid for ARC EM and ARC HS cores.
15645 @item -mrgf-banked-regs=@var{number}
15646 @opindex mrgf-banked-regs
15647 Specifies the number of registers replicated in second register bank
15648 on entry to fast interrupt.  Fast interrupts are interrupts with the
15649 highest priority level P0.  These interrupts save only PC and STATUS32
15650 registers to avoid memory transactions during interrupt entry and exit
15651 sequences.  Use this option when you are using fast interrupts in an
15652 ARC V2 family processor.  Permitted values are 4, 8, 16, and 32.
15654 @item -mlpc-width=@var{width}
15655 @opindex mlpc-width
15656 Specify the width of the @code{lp_count} register.  Valid values for
15657 @var{width} are 8, 16, 20, 24, 28 and 32 bits.  The default width is
15658 fixed to 32 bits.  If the width is less than 32, the compiler does not
15659 attempt to transform loops in your program to use the zero-delay loop
15660 mechanism unless it is known that the @code{lp_count} register can
15661 hold the required loop-counter value.  Depending on the width
15662 specified, the compiler and run-time library might continue to use the
15663 loop mechanism for various needs.  This option defines macro
15664 @code{__ARC_LPC_WIDTH__} with the value of @var{width}.
15666 @item -mrf16
15667 @opindex mrf16
15668 This option instructs the compiler to generate code for a 16-entry
15669 register file.  This option defines the @code{__ARC_RF16__}
15670 preprocessor macro.
15672 @end table
15674 The following options are passed through to the assembler, and also
15675 define preprocessor macro symbols.
15677 @c Flags used by the assembler, but for which we define preprocessor
15678 @c macro symbols as well.
15679 @table @gcctabopt
15680 @item -mdsp-packa
15681 @opindex mdsp-packa
15682 Passed down to the assembler to enable the DSP Pack A extensions.
15683 Also sets the preprocessor symbol @code{__Xdsp_packa}.  This option is
15684 deprecated.
15686 @item -mdvbf
15687 @opindex mdvbf
15688 Passed down to the assembler to enable the dual Viterbi butterfly
15689 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.  This
15690 option is deprecated.
15692 @c ARC700 4.10 extension instruction
15693 @item -mlock
15694 @opindex mlock
15695 Passed down to the assembler to enable the locked load/store
15696 conditional extension.  Also sets the preprocessor symbol
15697 @code{__Xlock}.
15699 @item -mmac-d16
15700 @opindex mmac-d16
15701 Passed down to the assembler.  Also sets the preprocessor symbol
15702 @code{__Xxmac_d16}.  This option is deprecated.
15704 @item -mmac-24
15705 @opindex mmac-24
15706 Passed down to the assembler.  Also sets the preprocessor symbol
15707 @code{__Xxmac_24}.  This option is deprecated.
15709 @c ARC700 4.10 extension instruction
15710 @item -mrtsc
15711 @opindex mrtsc
15712 Passed down to the assembler to enable the 64-bit time-stamp counter
15713 extension instruction.  Also sets the preprocessor symbol
15714 @code{__Xrtsc}.  This option is deprecated.
15716 @c ARC700 4.10 extension instruction
15717 @item -mswape
15718 @opindex mswape
15719 Passed down to the assembler to enable the swap byte ordering
15720 extension instruction.  Also sets the preprocessor symbol
15721 @code{__Xswape}.
15723 @item -mtelephony
15724 @opindex mtelephony
15725 Passed down to the assembler to enable dual- and single-operand
15726 instructions for telephony.  Also sets the preprocessor symbol
15727 @code{__Xtelephony}.  This option is deprecated.
15729 @item -mxy
15730 @opindex mxy
15731 Passed down to the assembler to enable the XY memory extension.  Also
15732 sets the preprocessor symbol @code{__Xxy}.
15734 @end table
15736 The following options control how the assembly code is annotated:
15738 @c Assembly annotation options
15739 @table @gcctabopt
15740 @item -misize
15741 @opindex misize
15742 Annotate assembler instructions with estimated addresses.
15744 @item -mannotate-align
15745 @opindex mannotate-align
15746 Explain what alignment considerations lead to the decision to make an
15747 instruction short or long.
15749 @end table
15751 The following options are passed through to the linker:
15753 @c options passed through to the linker
15754 @table @gcctabopt
15755 @item -marclinux
15756 @opindex marclinux
15757 Passed through to the linker, to specify use of the @code{arclinux} emulation.
15758 This option is enabled by default in tool chains built for
15759 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
15760 when profiling is not requested.
15762 @item -marclinux_prof
15763 @opindex marclinux_prof
15764 Passed through to the linker, to specify use of the
15765 @code{arclinux_prof} emulation.  This option is enabled by default in
15766 tool chains built for @w{@code{arc-linux-uclibc}} and
15767 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
15769 @end table
15771 The following options control the semantics of generated code:
15773 @c semantically relevant code generation options
15774 @table @gcctabopt
15775 @item -mlong-calls
15776 @opindex mlong-calls
15777 Generate calls as register indirect calls, thus providing access
15778 to the full 32-bit address range.
15780 @item -mmedium-calls
15781 @opindex mmedium-calls
15782 Don't use less than 25-bit addressing range for calls, which is the
15783 offset available for an unconditional branch-and-link
15784 instruction.  Conditional execution of function calls is suppressed, to
15785 allow use of the 25-bit range, rather than the 21-bit range with
15786 conditional branch-and-link.  This is the default for tool chains built
15787 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
15789 @item -G @var{num}
15790 @opindex G
15791 Put definitions of externally-visible data in a small data section if
15792 that data is no bigger than @var{num} bytes.  The default value of
15793 @var{num} is 4 for any ARC configuration, or 8 when we have double
15794 load/store operations.
15796 @item -mno-sdata
15797 @opindex mno-sdata
15798 Do not generate sdata references.  This is the default for tool chains
15799 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
15800 targets.
15802 @item -mvolatile-cache
15803 @opindex mvolatile-cache
15804 Use ordinarily cached memory accesses for volatile references.  This is the
15805 default.
15807 @item -mno-volatile-cache
15808 @opindex mno-volatile-cache
15809 Enable cache bypass for volatile references.
15811 @end table
15813 The following options fine tune code generation:
15814 @c code generation tuning options
15815 @table @gcctabopt
15816 @item -malign-call
15817 @opindex malign-call
15818 Do alignment optimizations for call instructions.
15820 @item -mauto-modify-reg
15821 @opindex mauto-modify-reg
15822 Enable the use of pre/post modify with register displacement.
15824 @item -mbbit-peephole
15825 @opindex mbbit-peephole
15826 Enable bbit peephole2.
15828 @item -mno-brcc
15829 @opindex mno-brcc
15830 This option disables a target-specific pass in @file{arc_reorg} to
15831 generate compare-and-branch (@code{br@var{cc}}) instructions.  
15832 It has no effect on
15833 generation of these instructions driven by the combiner pass.
15835 @item -mcase-vector-pcrel
15836 @opindex mcase-vector-pcrel
15837 Use PC-relative switch case tables to enable case table shortening.
15838 This is the default for @option{-Os}.
15840 @item -mcompact-casesi
15841 @opindex mcompact-casesi
15842 Enable compact @code{casesi} pattern.  This is the default for @option{-Os},
15843 and only available for ARCv1 cores.
15845 @item -mno-cond-exec
15846 @opindex mno-cond-exec
15847 Disable the ARCompact-specific pass to generate conditional 
15848 execution instructions.
15850 Due to delay slot scheduling and interactions between operand numbers,
15851 literal sizes, instruction lengths, and the support for conditional execution,
15852 the target-independent pass to generate conditional execution is often lacking,
15853 so the ARC port has kept a special pass around that tries to find more
15854 conditional execution generation opportunities after register allocation,
15855 branch shortening, and delay slot scheduling have been done.  This pass
15856 generally, but not always, improves performance and code size, at the cost of
15857 extra compilation time, which is why there is an option to switch it off.
15858 If you have a problem with call instructions exceeding their allowable
15859 offset range because they are conditionalized, you should consider using
15860 @option{-mmedium-calls} instead.
15862 @item -mearly-cbranchsi
15863 @opindex mearly-cbranchsi
15864 Enable pre-reload use of the @code{cbranchsi} pattern.
15866 @item -mexpand-adddi
15867 @opindex mexpand-adddi
15868 Expand @code{adddi3} and @code{subdi3} at RTL generation time into
15869 @code{add.f}, @code{adc} etc.  This option is deprecated.
15871 @item -mindexed-loads
15872 @opindex mindexed-loads
15873 Enable the use of indexed loads.  This can be problematic because some
15874 optimizers then assume that indexed stores exist, which is not
15875 the case.
15877 @item -mlra
15878 @opindex mlra
15879 Enable Local Register Allocation.  This is still experimental for ARC,
15880 so by default the compiler uses standard reload
15881 (i.e. @option{-mno-lra}).
15883 @item -mlra-priority-none
15884 @opindex mlra-priority-none
15885 Don't indicate any priority for target registers.
15887 @item -mlra-priority-compact
15888 @opindex mlra-priority-compact
15889 Indicate target register priority for r0..r3 / r12..r15.
15891 @item -mlra-priority-noncompact
15892 @opindex mlra-priority-noncompact
15893 Reduce target register priority for r0..r3 / r12..r15.
15895 @item -mno-millicode
15896 @opindex mno-millicode
15897 When optimizing for size (using @option{-Os}), prologues and epilogues
15898 that have to save or restore a large number of registers are often
15899 shortened by using call to a special function in libgcc; this is
15900 referred to as a @emph{millicode} call.  As these calls can pose
15901 performance issues, and/or cause linking issues when linking in a
15902 nonstandard way, this option is provided to turn off millicode call
15903 generation.
15905 @item -mmixed-code
15906 @opindex mmixed-code
15907 Tweak register allocation to help 16-bit instruction generation.
15908 This generally has the effect of decreasing the average instruction size
15909 while increasing the instruction count.
15911 @item -mq-class
15912 @opindex mq-class
15913 Enable @samp{q} instruction alternatives.
15914 This is the default for @option{-Os}.
15916 @item -mRcq
15917 @opindex mRcq
15918 Enable @samp{Rcq} constraint handling.  
15919 Most short code generation depends on this.
15920 This is the default.
15922 @item -mRcw
15923 @opindex mRcw
15924 Enable @samp{Rcw} constraint handling.  
15925 Most ccfsm condexec mostly depends on this.
15926 This is the default.
15928 @item -msize-level=@var{level}
15929 @opindex msize-level
15930 Fine-tune size optimization with regards to instruction lengths and alignment.
15931 The recognized values for @var{level} are:
15932 @table @samp
15933 @item 0
15934 No size optimization.  This level is deprecated and treated like @samp{1}.
15936 @item 1
15937 Short instructions are used opportunistically.
15939 @item 2
15940 In addition, alignment of loops and of code after barriers are dropped.
15942 @item 3
15943 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
15945 @end table
15947 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
15948 the behavior when this is not set is equivalent to level @samp{1}.
15950 @item -mtune=@var{cpu}
15951 @opindex mtune
15952 Set instruction scheduling parameters for @var{cpu}, overriding any implied
15953 by @option{-mcpu=}.
15955 Supported values for @var{cpu} are
15957 @table @samp
15958 @item ARC600
15959 Tune for ARC600 CPU.
15961 @item ARC601
15962 Tune for ARC601 CPU.
15964 @item ARC700
15965 Tune for ARC700 CPU with standard multiplier block.
15967 @item ARC700-xmac
15968 Tune for ARC700 CPU with XMAC block.
15970 @item ARC725D
15971 Tune for ARC725D CPU.
15973 @item ARC750D
15974 Tune for ARC750D CPU.
15976 @end table
15978 @item -mmultcost=@var{num}
15979 @opindex mmultcost
15980 Cost to assume for a multiply instruction, with @samp{4} being equal to a
15981 normal instruction.
15983 @item -munalign-prob-threshold=@var{probability}
15984 @opindex munalign-prob-threshold
15985 Set probability threshold for unaligning branches.
15986 When tuning for @samp{ARC700} and optimizing for speed, branches without
15987 filled delay slot are preferably emitted unaligned and long, unless
15988 profiling indicates that the probability for the branch to be taken
15989 is below @var{probability}.  @xref{Cross-profiling}.
15990 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
15992 @end table
15994 The following options are maintained for backward compatibility, but
15995 are now deprecated and will be removed in a future release:
15997 @c Deprecated options
15998 @table @gcctabopt
16000 @item -margonaut
16001 @opindex margonaut
16002 Obsolete FPX.
16004 @item -mbig-endian
16005 @opindex mbig-endian
16006 @itemx -EB
16007 @opindex EB
16008 Compile code for big-endian targets.  Use of these options is now
16009 deprecated.  Big-endian code is supported by configuring GCC to build
16010 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets,
16011 for which big endian is the default.
16013 @item -mlittle-endian
16014 @opindex mlittle-endian
16015 @itemx -EL
16016 @opindex EL
16017 Compile code for little-endian targets.  Use of these options is now
16018 deprecated.  Little-endian code is supported by configuring GCC to build 
16019 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets,
16020 for which little endian is the default.
16022 @item -mbarrel_shifter
16023 @opindex mbarrel_shifter
16024 Replaced by @option{-mbarrel-shifter}.
16026 @item -mdpfp_compact
16027 @opindex mdpfp_compact
16028 Replaced by @option{-mdpfp-compact}.
16030 @item -mdpfp_fast
16031 @opindex mdpfp_fast
16032 Replaced by @option{-mdpfp-fast}.
16034 @item -mdsp_packa
16035 @opindex mdsp_packa
16036 Replaced by @option{-mdsp-packa}.
16038 @item -mEA
16039 @opindex mEA
16040 Replaced by @option{-mea}.
16042 @item -mmac_24
16043 @opindex mmac_24
16044 Replaced by @option{-mmac-24}.
16046 @item -mmac_d16
16047 @opindex mmac_d16
16048 Replaced by @option{-mmac-d16}.
16050 @item -mspfp_compact
16051 @opindex mspfp_compact
16052 Replaced by @option{-mspfp-compact}.
16054 @item -mspfp_fast
16055 @opindex mspfp_fast
16056 Replaced by @option{-mspfp-fast}.
16058 @item -mtune=@var{cpu}
16059 @opindex mtune
16060 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
16061 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
16062 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively.
16064 @item -multcost=@var{num}
16065 @opindex multcost
16066 Replaced by @option{-mmultcost}.
16068 @end table
16070 @node ARM Options
16071 @subsection ARM Options
16072 @cindex ARM options
16074 These @samp{-m} options are defined for the ARM port:
16076 @table @gcctabopt
16077 @item -mabi=@var{name}
16078 @opindex mabi
16079 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
16080 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
16082 @item -mapcs-frame
16083 @opindex mapcs-frame
16084 Generate a stack frame that is compliant with the ARM Procedure Call
16085 Standard for all functions, even if this is not strictly necessary for
16086 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
16087 with this option causes the stack frames not to be generated for
16088 leaf functions.  The default is @option{-mno-apcs-frame}.
16089 This option is deprecated.
16091 @item -mapcs
16092 @opindex mapcs
16093 This is a synonym for @option{-mapcs-frame} and is deprecated.
16095 @ignore
16096 @c not currently implemented
16097 @item -mapcs-stack-check
16098 @opindex mapcs-stack-check
16099 Generate code to check the amount of stack space available upon entry to
16100 every function (that actually uses some stack space).  If there is
16101 insufficient space available then either the function
16102 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
16103 called, depending upon the amount of stack space required.  The runtime
16104 system is required to provide these functions.  The default is
16105 @option{-mno-apcs-stack-check}, since this produces smaller code.
16107 @c not currently implemented
16108 @item -mapcs-reentrant
16109 @opindex mapcs-reentrant
16110 Generate reentrant, position-independent code.  The default is
16111 @option{-mno-apcs-reentrant}.
16112 @end ignore
16114 @item -mthumb-interwork
16115 @opindex mthumb-interwork
16116 Generate code that supports calling between the ARM and Thumb
16117 instruction sets.  Without this option, on pre-v5 architectures, the
16118 two instruction sets cannot be reliably used inside one program.  The
16119 default is @option{-mno-thumb-interwork}, since slightly larger code
16120 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
16121 configurations this option is meaningless.
16123 @item -mno-sched-prolog
16124 @opindex mno-sched-prolog
16125 Prevent the reordering of instructions in the function prologue, or the
16126 merging of those instruction with the instructions in the function's
16127 body.  This means that all functions start with a recognizable set
16128 of instructions (or in fact one of a choice from a small set of
16129 different function prologues), and this information can be used to
16130 locate the start of functions inside an executable piece of code.  The
16131 default is @option{-msched-prolog}.
16133 @item -mfloat-abi=@var{name}
16134 @opindex mfloat-abi
16135 Specifies which floating-point ABI to use.  Permissible values
16136 are: @samp{soft}, @samp{softfp} and @samp{hard}.
16138 Specifying @samp{soft} causes GCC to generate output containing
16139 library calls for floating-point operations.
16140 @samp{softfp} allows the generation of code using hardware floating-point
16141 instructions, but still uses the soft-float calling conventions.
16142 @samp{hard} allows generation of floating-point instructions
16143 and uses FPU-specific calling conventions.
16145 The default depends on the specific target configuration.  Note that
16146 the hard-float and soft-float ABIs are not link-compatible; you must
16147 compile your entire program with the same ABI, and link with a
16148 compatible set of libraries.
16150 @item -mlittle-endian
16151 @opindex mlittle-endian
16152 Generate code for a processor running in little-endian mode.  This is
16153 the default for all standard configurations.
16155 @item -mbig-endian
16156 @opindex mbig-endian
16157 Generate code for a processor running in big-endian mode; the default is
16158 to compile code for a little-endian processor.
16160 @item -mbe8
16161 @itemx -mbe32
16162 @opindex mbe8
16163 When linking a big-endian image select between BE8 and BE32 formats.
16164 The option has no effect for little-endian images and is ignored.  The
16165 default is dependent on the selected target architecture.  For ARMv6
16166 and later architectures the default is BE8, for older architectures
16167 the default is BE32.  BE32 format has been deprecated by ARM.
16169 @item -march=@var{name}@r{[}+extension@dots{}@r{]}
16170 @opindex march
16171 This specifies the name of the target ARM architecture.  GCC uses this
16172 name to determine what kind of instructions it can emit when generating
16173 assembly code.  This option can be used in conjunction with or instead
16174 of the @option{-mcpu=} option.
16176 Permissible names are:
16177 @samp{armv4t},
16178 @samp{armv5t}, @samp{armv5te},
16179 @samp{armv6}, @samp{armv6j}, @samp{armv6k}, @samp{armv6kz}, @samp{armv6t2},
16180 @samp{armv6z}, @samp{armv6zk},
16181 @samp{armv7}, @samp{armv7-a}, @samp{armv7ve}, 
16182 @samp{armv8-a}, @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a},
16183 @samp{armv8.4-a},
16184 @samp{armv7-r},
16185 @samp{armv8-r},
16186 @samp{armv6-m}, @samp{armv6s-m},
16187 @samp{armv7-m}, @samp{armv7e-m},
16188 @samp{armv8-m.base}, @samp{armv8-m.main},
16189 @samp{iwmmxt} and @samp{iwmmxt2}.
16191 Additionally, the following architectures, which lack support for the
16192 Thumb execution state, are recognized but support is deprecated: @samp{armv4}.
16194 Many of the architectures support extensions.  These can be added by
16195 appending @samp{+@var{extension}} to the architecture name.  Extension
16196 options are processed in order and capabilities accumulate.  An extension
16197 will also enable any necessary base extensions
16198 upon which it depends.  For example, the @samp{+crypto} extension
16199 will always enable the @samp{+simd} extension.  The exception to the
16200 additive construction is for extensions that are prefixed with
16201 @samp{+no@dots{}}: these extensions disable the specified option and
16202 any other extensions that may depend on the presence of that
16203 extension.
16205 For example, @samp{-march=armv7-a+simd+nofp+vfpv4} is equivalent to
16206 writing @samp{-march=armv7-a+vfpv4} since the @samp{+simd} option is
16207 entirely disabled by the @samp{+nofp} option that follows it.
16209 Most extension names are generically named, but have an effect that is
16210 dependent upon the architecture to which it is applied.  For example,
16211 the @samp{+simd} option can be applied to both @samp{armv7-a} and
16212 @samp{armv8-a} architectures, but will enable the original ARMv7-A
16213 Advanced SIMD (Neon) extensions for @samp{armv7-a} and the ARMv8-A
16214 variant for @samp{armv8-a}.
16216 The table below lists the supported extensions for each architecture.
16217 Architectures not mentioned do not support any extensions.
16219 @table @samp
16220 @item armv5te
16221 @itemx armv6
16222 @itemx armv6j
16223 @itemx armv6k
16224 @itemx armv6kz
16225 @itemx armv6t2
16226 @itemx armv6z
16227 @itemx armv6zk
16228 @table @samp
16229 @item +fp
16230 The VFPv2 floating-point instructions.  The extension @samp{+vfpv2} can be
16231 used as an alias for this extension.
16233 @item +nofp
16234 Disable the floating-point instructions.
16235 @end table
16237 @item armv7
16238 The common subset of the ARMv7-A, ARMv7-R and ARMv7-M architectures.
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.  Note that floating-point is not supported by the
16244 base ARMv7-M architecture, but is compatible with both the ARMv7-A and
16245 ARMv7-R architectures.
16247 @item +nofp
16248 Disable the floating-point instructions.
16249 @end table
16251 @item armv7-a
16252 @table @samp
16253 @item +fp
16254 The VFPv3 floating-point instructions, with 16 double-precision
16255 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
16256 for this extension.
16258 @item +simd
16259 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
16260 The extensions @samp{+neon} and @samp{+neon-vfpv3} can be used as aliases
16261 for this extension.
16263 @item +vfpv3
16264 The VFPv3 floating-point instructions, with 32 double-precision
16265 registers.
16267 @item +vfpv3-d16-fp16
16268 The VFPv3 floating-point instructions, with 16 double-precision
16269 registers and the half-precision floating-point conversion operations.
16271 @item +vfpv3-fp16
16272 The VFPv3 floating-point instructions, with 32 double-precision
16273 registers and the half-precision floating-point conversion operations.
16275 @item +vfpv4-d16
16276 The VFPv4 floating-point instructions, with 16 double-precision
16277 registers.
16279 @item +vfpv4
16280 The VFPv4 floating-point instructions, with 32 double-precision
16281 registers.
16283 @item +neon-fp16
16284 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
16285 the half-precision floating-point conversion operations.
16287 @item +neon-vfpv4
16288 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.
16290 @item +nosimd
16291 Disable the Advanced SIMD instructions (does not disable floating point).
16293 @item +nofp
16294 Disable the floating-point and Advanced SIMD instructions.
16295 @end table
16297 @item armv7ve
16298 The extended version of the ARMv7-A architecture with support for
16299 virtualization.
16300 @table @samp
16301 @item +fp
16302 The VFPv4 floating-point instructions, with 16 double-precision registers.
16303 The extension @samp{+vfpv4-d16} can be used as an alias for this extension.
16305 @item +simd
16306 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.  The
16307 extension @samp{+neon-vfpv4} can be used as an alias for this extension.
16309 @item +vfpv3-d16
16310 The VFPv3 floating-point instructions, with 16 double-precision
16311 registers.
16313 @item +vfpv3
16314 The VFPv3 floating-point instructions, with 32 double-precision
16315 registers.
16317 @item +vfpv3-d16-fp16
16318 The VFPv3 floating-point instructions, with 16 double-precision
16319 registers and the half-precision floating-point conversion operations.
16321 @item +vfpv3-fp16
16322 The VFPv3 floating-point instructions, with 32 double-precision
16323 registers and the half-precision floating-point conversion operations.
16325 @item +vfpv4-d16
16326 The VFPv4 floating-point instructions, with 16 double-precision
16327 registers.
16329 @item +vfpv4
16330 The VFPv4 floating-point instructions, with 32 double-precision
16331 registers.
16333 @item +neon
16334 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
16335 The extension @samp{+neon-vfpv3} can be used as an alias for this extension.
16337 @item +neon-fp16
16338 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
16339 the half-precision floating-point conversion operations.
16341 @item +nosimd
16342 Disable the Advanced SIMD instructions (does not disable floating point).
16344 @item +nofp
16345 Disable the floating-point and Advanced SIMD instructions.
16346 @end table
16348 @item armv8-a
16349 @table @samp
16350 @item +crc
16351 The Cyclic Redundancy Check (CRC) instructions.
16352 @item +simd
16353 The ARMv8-A Advanced SIMD and floating-point instructions.
16354 @item +crypto
16355 The cryptographic instructions.
16356 @item +nocrypto
16357 Disable the cryptographic instructions.
16358 @item +nofp
16359 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16360 @end table
16362 @item armv8.1-a
16363 @table @samp
16364 @item +simd
16365 The ARMv8.1-A Advanced SIMD and floating-point instructions.
16367 @item +crypto
16368 The cryptographic instructions.  This also enables the Advanced SIMD and
16369 floating-point instructions.
16371 @item +nocrypto
16372 Disable the cryptographic instructions.
16374 @item +nofp
16375 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16376 @end table
16378 @item armv8.2-a
16379 @itemx armv8.3-a
16380 @table @samp
16381 @item +fp16
16382 The half-precision floating-point data processing instructions.
16383 This also enables the Advanced SIMD and floating-point instructions.
16385 @item +fp16fml
16386 The half-precision floating-point fmla extension.  This also enables
16387 the half-precision floating-point extension and Advanced SIMD and
16388 floating-point instructions.
16390 @item +simd
16391 The ARMv8.1-A Advanced SIMD and floating-point instructions.
16393 @item +crypto
16394 The cryptographic instructions.  This also enables the Advanced SIMD and
16395 floating-point instructions.
16397 @item +dotprod
16398 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
16400 @item +nocrypto
16401 Disable the cryptographic extension.
16403 @item +nofp
16404 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16405 @end table
16407 @item armv8.4-a
16408 @table @samp
16409 @item +fp16
16410 The half-precision floating-point data processing instructions.
16411 This also enables the Advanced SIMD and floating-point instructions as well
16412 as the Dot Product extension and the half-precision floating-point fmla
16413 extension.
16415 @item +simd
16416 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
16417 Dot Product extension.
16419 @item +crypto
16420 The cryptographic instructions.  This also enables the Advanced SIMD and
16421 floating-point instructions as well as the Dot Product extension.
16423 @item +nocrypto
16424 Disable the cryptographic extension.
16426 @item +nofp
16427 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16428 @end table
16430 @item armv7-r
16431 @table @samp
16432 @item +fp.sp
16433 The single-precision VFPv3 floating-point instructions.  The extension
16434 @samp{+vfpv3xd} can be used as an alias for this extension.
16436 @item +fp
16437 The VFPv3 floating-point instructions with 16 double-precision registers.
16438 The extension +vfpv3-d16 can be used as an alias for this extension.
16440 @item +nofp
16441 Disable the floating-point extension.
16443 @item +idiv
16444 The ARM-state integer division instructions.
16446 @item +noidiv
16447 Disable the ARM-state integer division extension.
16448 @end table
16450 @item armv7e-m
16451 @table @samp
16452 @item +fp
16453 The single-precision VFPv4 floating-point instructions.
16455 @item +fpv5
16456 The single-precision FPv5 floating-point instructions.
16458 @item +fp.dp
16459 The single- and double-precision FPv5 floating-point instructions.
16461 @item +nofp
16462 Disable the floating-point extensions.
16463 @end table
16465 @item  armv8-m.main
16466 @table @samp
16467 @item +dsp
16468 The DSP instructions.
16470 @item +nodsp
16471 Disable the DSP extension.
16473 @item +fp
16474 The single-precision floating-point instructions.
16476 @item +fp.dp
16477 The single- and double-precision floating-point instructions.
16479 @item +nofp
16480 Disable the floating-point extension.
16481 @end table
16483 @item armv8-r
16484 @table @samp
16485 @item +crc
16486 The Cyclic Redundancy Check (CRC) instructions.
16487 @item +fp.sp
16488 The single-precision FPv5 floating-point instructions.
16489 @item +simd
16490 The ARMv8-A Advanced SIMD and floating-point instructions.
16491 @item +crypto
16492 The cryptographic instructions.
16493 @item +nocrypto
16494 Disable the cryptographic instructions.
16495 @item +nofp
16496 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16497 @end table
16499 @end table
16501 @option{-march=native} causes the compiler to auto-detect the architecture
16502 of the build computer.  At present, this feature is only supported on
16503 GNU/Linux, and not all architectures are recognized.  If the auto-detect
16504 is unsuccessful the option has no effect.
16506 @item -mtune=@var{name}
16507 @opindex mtune
16508 This option specifies the name of the target ARM processor for
16509 which GCC should tune the performance of the code.
16510 For some ARM implementations better performance can be obtained by using
16511 this option.
16512 Permissible names are: @samp{arm2}, @samp{arm250},
16513 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
16514 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
16515 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
16516 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
16517 @samp{arm720},
16518 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
16519 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
16520 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
16521 @samp{strongarm1110},
16522 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
16523 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
16524 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
16525 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
16526 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
16527 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
16528 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
16529 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
16530 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
16531 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
16532 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
16533 @samp{cortex-a76}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
16534 @samp{cortex-r7}, @samp{cortex-r8}, @samp{cortex-r52},
16535 @samp{cortex-m33},
16536 @samp{cortex-m23},
16537 @samp{cortex-m7},
16538 @samp{cortex-m4},
16539 @samp{cortex-m3},
16540 @samp{cortex-m1},
16541 @samp{cortex-m0},
16542 @samp{cortex-m0plus},
16543 @samp{cortex-m1.small-multiply},
16544 @samp{cortex-m0.small-multiply},
16545 @samp{cortex-m0plus.small-multiply},
16546 @samp{exynos-m1},
16547 @samp{marvell-pj4},
16548 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
16549 @samp{fa526}, @samp{fa626},
16550 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
16551 @samp{xgene1}.
16553 Additionally, this option can specify that GCC should tune the performance
16554 of the code for a big.LITTLE system.  Permissible names are:
16555 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
16556 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
16557 @samp{cortex-a72.cortex-a35}, @samp{cortex-a73.cortex-a53},
16558 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55}.
16560 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
16561 performance for a blend of processors within architecture @var{arch}.
16562 The aim is to generate code that run well on the current most popular
16563 processors, balancing between optimizations that benefit some CPUs in the
16564 range, and avoiding performance pitfalls of other CPUs.  The effects of
16565 this option may change in future GCC versions as CPU models come and go.
16567 @option{-mtune} permits the same extension options as @option{-mcpu}, but
16568 the extension options do not affect the tuning of the generated code.
16570 @option{-mtune=native} causes the compiler to auto-detect the CPU
16571 of the build computer.  At present, this feature is only supported on
16572 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
16573 unsuccessful the option has no effect.
16575 @item -mcpu=@var{name}@r{[}+extension@dots{}@r{]}
16576 @opindex mcpu
16577 This specifies the name of the target ARM processor.  GCC uses this name
16578 to derive the name of the target ARM architecture (as if specified
16579 by @option{-march}) and the ARM processor type for which to tune for
16580 performance (as if specified by @option{-mtune}).  Where this option
16581 is used in conjunction with @option{-march} or @option{-mtune},
16582 those options take precedence over the appropriate part of this option.
16584 Many of the supported CPUs implement optional architectural
16585 extensions.  Where this is so the architectural extensions are
16586 normally enabled by default.  If implementations that lack the
16587 extension exist, then the extension syntax can be used to disable
16588 those extensions that have been omitted.  For floating-point and
16589 Advanced SIMD (Neon) instructions, the settings of the options
16590 @option{-mfloat-abi} and @option{-mfpu} must also be considered:
16591 floating-point and Advanced SIMD instructions will only be used if
16592 @option{-mfloat-abi} is not set to @samp{soft}; and any setting of
16593 @option{-mfpu} other than @samp{auto} will override the available
16594 floating-point and SIMD extension instructions.
16596 For example, @samp{cortex-a9} can be found in three major
16597 configurations: integer only, with just a floating-point unit or with
16598 floating-point and Advanced SIMD.  The default is to enable all the
16599 instructions, but the extensions @samp{+nosimd} and @samp{+nofp} can
16600 be used to disable just the SIMD or both the SIMD and floating-point
16601 instructions respectively.
16603 Permissible names for this option are the same as those for
16604 @option{-mtune}.
16606 The following extension options are common to the listed CPUs:
16608 @table @samp
16609 @item +nodsp
16610 Disable the DSP instructions on @samp{cortex-m33}.
16612 @item  +nofp
16613 Disables the floating-point instructions on @samp{arm9e},
16614 @samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm10e},
16615 @samp{arm1020e}, @samp{arm1022e}, @samp{arm926ej-s},
16616 @samp{arm1026ej-s}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
16617 @samp{cortex-m4}, @samp{cortex-m7} and @samp{cortex-m33}.
16618 Disables the floating-point and SIMD instructions on
16619 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7},
16620 @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a12},
16621 @samp{cortex-a15}, @samp{cortex-a17}, @samp{cortex-a15.cortex-a7},
16622 @samp{cortex-a17.cortex-a7}, @samp{cortex-a32}, @samp{cortex-a35},
16623 @samp{cortex-a53} and @samp{cortex-a55}.
16625 @item +nofp.dp
16626 Disables the double-precision component of the floating-point instructions
16627 on @samp{cortex-r5}, @samp{cortex-r52} and @samp{cortex-m7}.
16629 @item +nosimd
16630 Disables the SIMD (but not floating-point) instructions on
16631 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}
16632 and @samp{cortex-a9}.
16634 @item +crypto
16635 Enables the cryptographic instructions on @samp{cortex-a32},
16636 @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55}, @samp{cortex-a57},
16637 @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75}, @samp{exynos-m1},
16638 @samp{xgene1}, @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
16639 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53} and
16640 @samp{cortex-a75.cortex-a55}.
16641 @end table
16643 Additionally the @samp{generic-armv7-a} pseudo target defaults to
16644 VFPv3 with 16 double-precision registers.  It supports the following
16645 extension options: @samp{vfpv3-d16}, @samp{vfpv3},
16646 @samp{vfpv3-d16-fp16}, @samp{vfpv3-fp16}, @samp{vfpv4-d16},
16647 @samp{vfpv4}, @samp{neon}, @samp{neon-vfpv3}, @samp{neon-fp16},
16648 @samp{neon-vfpv4}.  The meanings are the same as for the extensions to
16649 @option{-march=armv7-a}.
16651 @option{-mcpu=generic-@var{arch}} is also permissible, and is
16652 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
16653 See @option{-mtune} for more information.
16655 @option{-mcpu=native} causes the compiler to auto-detect the CPU
16656 of the build computer.  At present, this feature is only supported on
16657 GNU/Linux, and not all architectures are recognized.  If the auto-detect
16658 is unsuccessful the option has no effect.
16660 @item -mfpu=@var{name}
16661 @opindex mfpu
16662 This specifies what floating-point hardware (or hardware emulation) is
16663 available on the target.  Permissible names are: @samp{auto}, @samp{vfpv2},
16664 @samp{vfpv3},
16665 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
16666 @samp{vfpv3xd-fp16}, @samp{neon-vfpv3}, @samp{neon-fp16}, @samp{vfpv4},
16667 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
16668 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
16669 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
16670 Note that @samp{neon} is an alias for @samp{neon-vfpv3} and @samp{vfp}
16671 is an alias for @samp{vfpv2}.
16673 The setting @samp{auto} is the default and is special.  It causes the
16674 compiler to select the floating-point and Advanced SIMD instructions
16675 based on the settings of @option{-mcpu} and @option{-march}.
16677 If the selected floating-point hardware includes the NEON extension
16678 (e.g. @option{-mfpu=neon}), note that floating-point
16679 operations are not generated by GCC's auto-vectorization pass unless
16680 @option{-funsafe-math-optimizations} is also specified.  This is
16681 because NEON hardware does not fully implement the IEEE 754 standard for
16682 floating-point arithmetic (in particular denormal values are treated as
16683 zero), so the use of NEON instructions may lead to a loss of precision.
16685 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}).
16687 @item -mfp16-format=@var{name}
16688 @opindex mfp16-format
16689 Specify the format of the @code{__fp16} half-precision floating-point type.
16690 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
16691 the default is @samp{none}, in which case the @code{__fp16} type is not
16692 defined.  @xref{Half-Precision}, for more information.
16694 @item -mstructure-size-boundary=@var{n}
16695 @opindex mstructure-size-boundary
16696 The sizes of all structures and unions are rounded up to a multiple
16697 of the number of bits set by this option.  Permissible values are 8, 32
16698 and 64.  The default value varies for different toolchains.  For the COFF
16699 targeted toolchain the default value is 8.  A value of 64 is only allowed
16700 if the underlying ABI supports it.
16702 Specifying a larger number can produce faster, more efficient code, but
16703 can also increase the size of the program.  Different values are potentially
16704 incompatible.  Code compiled with one value cannot necessarily expect to
16705 work with code or libraries compiled with another value, if they exchange
16706 information using structures or unions.
16708 This option is deprecated.
16710 @item -mabort-on-noreturn
16711 @opindex mabort-on-noreturn
16712 Generate a call to the function @code{abort} at the end of a
16713 @code{noreturn} function.  It is executed if the function tries to
16714 return.
16716 @item -mlong-calls
16717 @itemx -mno-long-calls
16718 @opindex mlong-calls
16719 @opindex mno-long-calls
16720 Tells the compiler to perform function calls by first loading the
16721 address of the function into a register and then performing a subroutine
16722 call on this register.  This switch is needed if the target function
16723 lies outside of the 64-megabyte addressing range of the offset-based
16724 version of subroutine call instruction.
16726 Even if this switch is enabled, not all function calls are turned
16727 into long calls.  The heuristic is that static functions, functions
16728 that have the @code{short_call} attribute, functions that are inside
16729 the scope of a @code{#pragma no_long_calls} directive, and functions whose
16730 definitions have already been compiled within the current compilation
16731 unit are not turned into long calls.  The exceptions to this rule are
16732 that weak function definitions, functions with the @code{long_call}
16733 attribute or the @code{section} attribute, and functions that are within
16734 the scope of a @code{#pragma long_calls} directive are always
16735 turned into long calls.
16737 This feature is not enabled by default.  Specifying
16738 @option{-mno-long-calls} restores the default behavior, as does
16739 placing the function calls within the scope of a @code{#pragma
16740 long_calls_off} directive.  Note these switches have no effect on how
16741 the compiler generates code to handle function calls via function
16742 pointers.
16744 @item -msingle-pic-base
16745 @opindex msingle-pic-base
16746 Treat the register used for PIC addressing as read-only, rather than
16747 loading it in the prologue for each function.  The runtime system is
16748 responsible for initializing this register with an appropriate value
16749 before execution begins.
16751 @item -mpic-register=@var{reg}
16752 @opindex mpic-register
16753 Specify the register to be used for PIC addressing.
16754 For standard PIC base case, the default is any suitable register
16755 determined by compiler.  For single PIC base case, the default is
16756 @samp{R9} if target is EABI based or stack-checking is enabled,
16757 otherwise the default is @samp{R10}.
16759 @item -mpic-data-is-text-relative
16760 @opindex mpic-data-is-text-relative
16761 Assume that the displacement between the text and data segments is fixed
16762 at static link time.  This permits using PC-relative addressing
16763 operations to access data known to be in the data segment.  For
16764 non-VxWorks RTP targets, this option is enabled by default.  When
16765 disabled on such targets, it will enable @option{-msingle-pic-base} by
16766 default.
16768 @item -mpoke-function-name
16769 @opindex mpoke-function-name
16770 Write the name of each function into the text section, directly
16771 preceding the function prologue.  The generated code is similar to this:
16773 @smallexample
16774      t0
16775          .ascii "arm_poke_function_name", 0
16776          .align
16777      t1
16778          .word 0xff000000 + (t1 - t0)
16779      arm_poke_function_name
16780          mov     ip, sp
16781          stmfd   sp!, @{fp, ip, lr, pc@}
16782          sub     fp, ip, #4
16783 @end smallexample
16785 When performing a stack backtrace, code can inspect the value of
16786 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
16787 location @code{pc - 12} and the top 8 bits are set, then we know that
16788 there is a function name embedded immediately preceding this location
16789 and has length @code{((pc[-3]) & 0xff000000)}.
16791 @item -mthumb
16792 @itemx -marm
16793 @opindex marm
16794 @opindex mthumb
16796 Select between generating code that executes in ARM and Thumb
16797 states.  The default for most configurations is to generate code
16798 that executes in ARM state, but the default can be changed by
16799 configuring GCC with the @option{--with-mode=}@var{state}
16800 configure option.
16802 You can also override the ARM and Thumb mode for each function
16803 by using the @code{target("thumb")} and @code{target("arm")} function attributes
16804 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
16806 @item -mflip-thumb 
16807 @opindex mflip-thumb
16808 Switch ARM/Thumb modes on alternating functions.
16809 This option is provided for regression testing of mixed Thumb/ARM code
16810 generation, and is not intended for ordinary use in compiling code.
16812 @item -mtpcs-frame
16813 @opindex mtpcs-frame
16814 Generate a stack frame that is compliant with the Thumb Procedure Call
16815 Standard for all non-leaf functions.  (A leaf function is one that does
16816 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
16818 @item -mtpcs-leaf-frame
16819 @opindex mtpcs-leaf-frame
16820 Generate a stack frame that is compliant with the Thumb Procedure Call
16821 Standard for all leaf functions.  (A leaf function is one that does
16822 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
16824 @item -mcallee-super-interworking
16825 @opindex mcallee-super-interworking
16826 Gives all externally visible functions in the file being compiled an ARM
16827 instruction set header which switches to Thumb mode before executing the
16828 rest of the function.  This allows these functions to be called from
16829 non-interworking code.  This option is not valid in AAPCS configurations
16830 because interworking is enabled by default.
16832 @item -mcaller-super-interworking
16833 @opindex mcaller-super-interworking
16834 Allows calls via function pointers (including virtual functions) to
16835 execute correctly regardless of whether the target code has been
16836 compiled for interworking or not.  There is a small overhead in the cost
16837 of executing a function pointer if this option is enabled.  This option
16838 is not valid in AAPCS configurations because interworking is enabled
16839 by default.
16841 @item -mtp=@var{name}
16842 @opindex mtp
16843 Specify the access model for the thread local storage pointer.  The valid
16844 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
16845 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
16846 (supported in the arm6k architecture), and @samp{auto}, which uses the
16847 best available method for the selected processor.  The default setting is
16848 @samp{auto}.
16850 @item -mtls-dialect=@var{dialect}
16851 @opindex mtls-dialect
16852 Specify the dialect to use for accessing thread local storage.  Two
16853 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
16854 @samp{gnu} dialect selects the original GNU scheme for supporting
16855 local and global dynamic TLS models.  The @samp{gnu2} dialect
16856 selects the GNU descriptor scheme, which provides better performance
16857 for shared libraries.  The GNU descriptor scheme is compatible with
16858 the original scheme, but does require new assembler, linker and
16859 library support.  Initial and local exec TLS models are unaffected by
16860 this option and always use the original scheme.
16862 @item -mword-relocations
16863 @opindex mword-relocations
16864 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
16865 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
16866 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
16867 is specified.
16869 @item -mfix-cortex-m3-ldrd
16870 @opindex mfix-cortex-m3-ldrd
16871 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
16872 with overlapping destination and base registers are used.  This option avoids
16873 generating these instructions.  This option is enabled by default when
16874 @option{-mcpu=cortex-m3} is specified.
16876 @item -munaligned-access
16877 @itemx -mno-unaligned-access
16878 @opindex munaligned-access
16879 @opindex mno-unaligned-access
16880 Enables (or disables) reading and writing of 16- and 32- bit values
16881 from addresses that are not 16- or 32- bit aligned.  By default
16882 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
16883 ARMv8-M Baseline architectures, and enabled for all other
16884 architectures.  If unaligned access is not enabled then words in packed
16885 data structures are accessed a byte at a time.
16887 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
16888 generated object file to either true or false, depending upon the
16889 setting of this option.  If unaligned access is enabled then the
16890 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
16891 defined.
16893 @item -mneon-for-64bits
16894 @opindex mneon-for-64bits
16895 Enables using Neon to handle scalar 64-bits operations. This is
16896 disabled by default since the cost of moving data from core registers
16897 to Neon is high.
16899 @item -mslow-flash-data
16900 @opindex mslow-flash-data
16901 Assume loading data from flash is slower than fetching instruction.
16902 Therefore literal load is minimized for better performance.
16903 This option is only supported when compiling for ARMv7 M-profile and
16904 off by default.
16906 @item -masm-syntax-unified
16907 @opindex masm-syntax-unified
16908 Assume inline assembler is using unified asm syntax.  The default is
16909 currently off which implies divided syntax.  This option has no impact
16910 on Thumb2. However, this may change in future releases of GCC.
16911 Divided syntax should be considered deprecated.
16913 @item -mrestrict-it
16914 @opindex mrestrict-it
16915 Restricts generation of IT blocks to conform to the rules of ARMv8-A.
16916 IT blocks can only contain a single 16-bit instruction from a select
16917 set of instructions. This option is on by default for ARMv8-A Thumb mode.
16919 @item -mprint-tune-info
16920 @opindex mprint-tune-info
16921 Print CPU tuning information as comment in assembler file.  This is
16922 an option used only for regression testing of the compiler and not
16923 intended for ordinary use in compiling code.  This option is disabled
16924 by default.
16926 @item -mverbose-cost-dump
16927 @opindex mverbose-cost-dump
16928 Enable verbose cost model dumping in the debug dump files.  This option is
16929 provided for use in debugging the compiler.
16931 @item -mpure-code
16932 @opindex mpure-code
16933 Do not allow constant data to be placed in code sections.
16934 Additionally, when compiling for ELF object format give all text sections the
16935 ELF processor-specific section attribute @code{SHF_ARM_PURECODE}.  This option
16936 is only available when generating non-pic code for M-profile targets with the
16937 MOVT instruction.
16939 @item -mcmse
16940 @opindex mcmse
16941 Generate secure code as per the "ARMv8-M Security Extensions: Requirements on
16942 Development Tools Engineering Specification", which can be found on
16943 @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}.
16944 @end table
16946 @node AVR Options
16947 @subsection AVR Options
16948 @cindex AVR Options
16950 These options are defined for AVR implementations:
16952 @table @gcctabopt
16953 @item -mmcu=@var{mcu}
16954 @opindex mmcu
16955 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
16957 The default for this option is@tie{}@samp{avr2}.
16959 GCC supports the following AVR devices and ISAs:
16961 @include avr-mmcu.texi
16963 @item -mabsdata
16964 @opindex mabsdata
16966 Assume that all data in static storage can be accessed by LDS / STS
16967 instructions.  This option has only an effect on reduced Tiny devices like
16968 ATtiny40.  See also the @code{absdata}
16969 @ref{AVR Variable Attributes,variable attribute}.
16971 @item -maccumulate-args
16972 @opindex maccumulate-args
16973 Accumulate outgoing function arguments and acquire/release the needed
16974 stack space for outgoing function arguments once in function
16975 prologue/epilogue.  Without this option, outgoing arguments are pushed
16976 before calling a function and popped afterwards.
16978 Popping the arguments after the function call can be expensive on
16979 AVR so that accumulating the stack space might lead to smaller
16980 executables because arguments need not be removed from the
16981 stack after such a function call.
16983 This option can lead to reduced code size for functions that perform
16984 several calls to functions that get their arguments on the stack like
16985 calls to printf-like functions.
16987 @item -mbranch-cost=@var{cost}
16988 @opindex mbranch-cost
16989 Set the branch costs for conditional branch instructions to
16990 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
16991 integers. The default branch cost is 0.
16993 @item -mcall-prologues
16994 @opindex mcall-prologues
16995 Functions prologues/epilogues are expanded as calls to appropriate
16996 subroutines.  Code size is smaller.
16998 @item -mgas-isr-prologues
16999 @opindex mgas-isr-prologues
17000 Interrupt service routines (ISRs) may use the @code{__gcc_isr} pseudo
17001 instruction supported by GNU Binutils.
17002 If this option is on, the feature can still be disabled for individual
17003 ISRs by means of the @ref{AVR Function Attributes,,@code{no_gccisr}}
17004 function attribute.  This feature is activated per default
17005 if optimization is on (but not with @option{-Og}, @pxref{Optimize Options}),
17006 and if GNU Binutils support @w{@uref{https://sourceware.org/PR21683,PR21683}}.
17008 @item -mint8
17009 @opindex mint8
17010 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
17011 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
17012 and @code{long long} is 4 bytes.  Please note that this option does not
17013 conform to the C standards, but it results in smaller code
17014 size.
17016 @item -mmain-is-OS_task
17017 @opindex mmain-is-OS_task
17018 Do not save registers in @code{main}.  The effect is the same like
17019 attaching attribute @ref{AVR Function Attributes,,@code{OS_task}}
17020 to @code{main}. It is activated per default if optimization is on.
17022 @item -mn-flash=@var{num}
17023 @opindex mn-flash
17024 Assume that the flash memory has a size of 
17025 @var{num} times 64@tie{}KiB.
17027 @item -mno-interrupts
17028 @opindex mno-interrupts
17029 Generated code is not compatible with hardware interrupts.
17030 Code size is smaller.
17032 @item -mrelax
17033 @opindex mrelax
17034 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
17035 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
17036 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
17037 the assembler's command line and the @option{--relax} option to the
17038 linker's command line.
17040 Jump relaxing is performed by the linker because jump offsets are not
17041 known before code is located. Therefore, the assembler code generated by the
17042 compiler is the same, but the instructions in the executable may
17043 differ from instructions in the assembler code.
17045 Relaxing must be turned on if linker stubs are needed, see the
17046 section on @code{EIND} and linker stubs below.
17048 @item -mrmw
17049 @opindex mrmw
17050 Assume that the device supports the Read-Modify-Write
17051 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
17053 @item -mshort-calls
17054 @opindex mshort-calls
17056 Assume that @code{RJMP} and @code{RCALL} can target the whole
17057 program memory.
17059 This option is used internally for multilib selection.  It is
17060 not an optimization option, and you don't need to set it by hand.
17062 @item -msp8
17063 @opindex msp8
17064 Treat the stack pointer register as an 8-bit register,
17065 i.e.@: assume the high byte of the stack pointer is zero.
17066 In general, you don't need to set this option by hand.
17068 This option is used internally by the compiler to select and
17069 build multilibs for architectures @code{avr2} and @code{avr25}.
17070 These architectures mix devices with and without @code{SPH}.
17071 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
17072 the compiler driver adds or removes this option from the compiler
17073 proper's command line, because the compiler then knows if the device
17074 or architecture has an 8-bit stack pointer and thus no @code{SPH}
17075 register or not.
17077 @item -mstrict-X
17078 @opindex mstrict-X
17079 Use address register @code{X} in a way proposed by the hardware.  This means
17080 that @code{X} is only used in indirect, post-increment or
17081 pre-decrement addressing.
17083 Without this option, the @code{X} register may be used in the same way
17084 as @code{Y} or @code{Z} which then is emulated by additional
17085 instructions.  
17086 For example, loading a value with @code{X+const} addressing with a
17087 small non-negative @code{const < 64} to a register @var{Rn} is
17088 performed as
17090 @example
17091 adiw r26, const   ; X += const
17092 ld   @var{Rn}, X        ; @var{Rn} = *X
17093 sbiw r26, const   ; X -= const
17094 @end example
17096 @item -mtiny-stack
17097 @opindex mtiny-stack
17098 Only change the lower 8@tie{}bits of the stack pointer.
17100 @item -mfract-convert-truncate
17101 @opindex mfract-convert-truncate
17102 Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
17104 @item -nodevicelib
17105 @opindex nodevicelib
17106 Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
17108 @item -Waddr-space-convert
17109 @opindex Waddr-space-convert
17110 @opindex Wno-addr-space-convert
17111 Warn about conversions between address spaces in the case where the
17112 resulting address space is not contained in the incoming address space.
17114 @item -Wmisspelled-isr
17115 @opindex Wmisspelled-isr
17116 @opindex Wno-misspelled-isr
17117 Warn if the ISR is misspelled, i.e. without __vector prefix.
17118 Enabled by default.
17119 @end table
17121 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
17122 @cindex @code{EIND}
17123 Pointers in the implementation are 16@tie{}bits wide.
17124 The address of a function or label is represented as word address so
17125 that indirect jumps and calls can target any code address in the
17126 range of 64@tie{}Ki words.
17128 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
17129 bytes of program memory space, there is a special function register called
17130 @code{EIND} that serves as most significant part of the target address
17131 when @code{EICALL} or @code{EIJMP} instructions are used.
17133 Indirect jumps and calls on these devices are handled as follows by
17134 the compiler and are subject to some limitations:
17136 @itemize @bullet
17138 @item
17139 The compiler never sets @code{EIND}.
17141 @item
17142 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
17143 instructions or might read @code{EIND} directly in order to emulate an
17144 indirect call/jump by means of a @code{RET} instruction.
17146 @item
17147 The compiler assumes that @code{EIND} never changes during the startup
17148 code or during the application. In particular, @code{EIND} is not
17149 saved/restored in function or interrupt service routine
17150 prologue/epilogue.
17152 @item
17153 For indirect calls to functions and computed goto, the linker
17154 generates @emph{stubs}. Stubs are jump pads sometimes also called
17155 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
17156 The stub contains a direct jump to the desired address.
17158 @item
17159 Linker relaxation must be turned on so that the linker generates
17160 the stubs correctly in all situations. See the compiler option
17161 @option{-mrelax} and the linker option @option{--relax}.
17162 There are corner cases where the linker is supposed to generate stubs
17163 but aborts without relaxation and without a helpful error message.
17165 @item
17166 The default linker script is arranged for code with @code{EIND = 0}.
17167 If code is supposed to work for a setup with @code{EIND != 0}, a custom
17168 linker script has to be used in order to place the sections whose
17169 name start with @code{.trampolines} into the segment where @code{EIND}
17170 points to.
17172 @item
17173 The startup code from libgcc never sets @code{EIND}.
17174 Notice that startup code is a blend of code from libgcc and AVR-LibC.
17175 For the impact of AVR-LibC on @code{EIND}, see the
17176 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
17178 @item
17179 It is legitimate for user-specific startup code to set up @code{EIND}
17180 early, for example by means of initialization code located in
17181 section @code{.init3}. Such code runs prior to general startup code
17182 that initializes RAM and calls constructors, but after the bit
17183 of startup code from AVR-LibC that sets @code{EIND} to the segment
17184 where the vector table is located.
17185 @example
17186 #include <avr/io.h>
17188 static void
17189 __attribute__((section(".init3"),naked,used,no_instrument_function))
17190 init3_set_eind (void)
17192   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
17193                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
17195 @end example
17197 @noindent
17198 The @code{__trampolines_start} symbol is defined in the linker script.
17200 @item
17201 Stubs are generated automatically by the linker if
17202 the following two conditions are met:
17203 @itemize @minus
17205 @item The address of a label is taken by means of the @code{gs} modifier
17206 (short for @emph{generate stubs}) like so:
17207 @example
17208 LDI r24, lo8(gs(@var{func}))
17209 LDI r25, hi8(gs(@var{func}))
17210 @end example
17211 @item The final location of that label is in a code segment
17212 @emph{outside} the segment where the stubs are located.
17213 @end itemize
17215 @item
17216 The compiler emits such @code{gs} modifiers for code labels in the
17217 following situations:
17218 @itemize @minus
17219 @item Taking address of a function or code label.
17220 @item Computed goto.
17221 @item If prologue-save function is used, see @option{-mcall-prologues}
17222 command-line option.
17223 @item Switch/case dispatch tables. If you do not want such dispatch
17224 tables you can specify the @option{-fno-jump-tables} command-line option.
17225 @item C and C++ constructors/destructors called during startup/shutdown.
17226 @item If the tools hit a @code{gs()} modifier explained above.
17227 @end itemize
17229 @item
17230 Jumping to non-symbolic addresses like so is @emph{not} supported:
17232 @example
17233 int main (void)
17235     /* Call function at word address 0x2 */
17236     return ((int(*)(void)) 0x2)();
17238 @end example
17240 Instead, a stub has to be set up, i.e.@: the function has to be called
17241 through a symbol (@code{func_4} in the example):
17243 @example
17244 int main (void)
17246     extern int func_4 (void);
17248     /* Call function at byte address 0x4 */
17249     return func_4();
17251 @end example
17253 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
17254 Alternatively, @code{func_4} can be defined in the linker script.
17255 @end itemize
17257 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
17258 @cindex @code{RAMPD}
17259 @cindex @code{RAMPX}
17260 @cindex @code{RAMPY}
17261 @cindex @code{RAMPZ}
17262 Some AVR devices support memories larger than the 64@tie{}KiB range
17263 that can be accessed with 16-bit pointers.  To access memory locations
17264 outside this 64@tie{}KiB range, the content of a @code{RAMP}
17265 register is used as high part of the address:
17266 The @code{X}, @code{Y}, @code{Z} address register is concatenated
17267 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
17268 register, respectively, to get a wide address. Similarly,
17269 @code{RAMPD} is used together with direct addressing.
17271 @itemize
17272 @item
17273 The startup code initializes the @code{RAMP} special function
17274 registers with zero.
17276 @item
17277 If a @ref{AVR Named Address Spaces,named address space} other than
17278 generic or @code{__flash} is used, then @code{RAMPZ} is set
17279 as needed before the operation.
17281 @item
17282 If the device supports RAM larger than 64@tie{}KiB and the compiler
17283 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
17284 is reset to zero after the operation.
17286 @item
17287 If the device comes with a specific @code{RAMP} register, the ISR
17288 prologue/epilogue saves/restores that SFR and initializes it with
17289 zero in case the ISR code might (implicitly) use it.
17291 @item
17292 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
17293 If you use inline assembler to read from locations outside the
17294 16-bit address range and change one of the @code{RAMP} registers,
17295 you must reset it to zero after the access.
17297 @end itemize
17299 @subsubsection AVR Built-in Macros
17301 GCC defines several built-in macros so that the user code can test
17302 for the presence or absence of features.  Almost any of the following
17303 built-in macros are deduced from device capabilities and thus
17304 triggered by the @option{-mmcu=} command-line option.
17306 For even more AVR-specific built-in macros see
17307 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
17309 @table @code
17311 @item __AVR_ARCH__
17312 Build-in macro that resolves to a decimal number that identifies the
17313 architecture and depends on the @option{-mmcu=@var{mcu}} option.
17314 Possible values are:
17316 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
17317 @code{4}, @code{5}, @code{51}, @code{6}
17319 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
17320 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
17322 respectively and
17324 @code{100},
17325 @code{102}, @code{103}, @code{104},
17326 @code{105}, @code{106}, @code{107}
17328 for @var{mcu}=@code{avrtiny},
17329 @code{avrxmega2}, @code{avrxmega3}, @code{avrxmega4},
17330 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
17331 If @var{mcu} specifies a device, this built-in macro is set
17332 accordingly. For example, with @option{-mmcu=atmega8} the macro is
17333 defined to @code{4}.
17335 @item __AVR_@var{Device}__
17336 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
17337 the device's name. For example, @option{-mmcu=atmega8} defines the
17338 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
17339 @code{__AVR_ATtiny261A__}, etc.
17341 The built-in macros' names follow
17342 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
17343 the device name as from the AVR user manual. The difference between
17344 @var{Device} in the built-in macro and @var{device} in
17345 @option{-mmcu=@var{device}} is that the latter is always lowercase.
17347 If @var{device} is not a device but only a core architecture like
17348 @samp{avr51}, this macro is not defined.
17350 @item __AVR_DEVICE_NAME__
17351 Setting @option{-mmcu=@var{device}} defines this built-in macro to
17352 the device's name. For example, with @option{-mmcu=atmega8} the macro
17353 is defined to @code{atmega8}.
17355 If @var{device} is not a device but only a core architecture like
17356 @samp{avr51}, this macro is not defined.
17358 @item __AVR_XMEGA__
17359 The device / architecture belongs to the XMEGA family of devices.
17361 @item __AVR_HAVE_ELPM__
17362 The device has the @code{ELPM} instruction.
17364 @item __AVR_HAVE_ELPMX__
17365 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
17366 R@var{n},Z+} instructions.
17368 @item __AVR_HAVE_MOVW__
17369 The device has the @code{MOVW} instruction to perform 16-bit
17370 register-register moves.
17372 @item __AVR_HAVE_LPMX__
17373 The device has the @code{LPM R@var{n},Z} and
17374 @code{LPM R@var{n},Z+} instructions.
17376 @item __AVR_HAVE_MUL__
17377 The device has a hardware multiplier. 
17379 @item __AVR_HAVE_JMP_CALL__
17380 The device has the @code{JMP} and @code{CALL} instructions.
17381 This is the case for devices with more than 8@tie{}KiB of program
17382 memory.
17384 @item __AVR_HAVE_EIJMP_EICALL__
17385 @itemx __AVR_3_BYTE_PC__
17386 The device has the @code{EIJMP} and @code{EICALL} instructions.
17387 This is the case for devices with more than 128@tie{}KiB of program memory.
17388 This also means that the program counter
17389 (PC) is 3@tie{}bytes wide.
17391 @item __AVR_2_BYTE_PC__
17392 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
17393 with up to 128@tie{}KiB of program memory.
17395 @item __AVR_HAVE_8BIT_SP__
17396 @itemx __AVR_HAVE_16BIT_SP__
17397 The stack pointer (SP) register is treated as 8-bit respectively
17398 16-bit register by the compiler.
17399 The definition of these macros is affected by @option{-mtiny-stack}.
17401 @item __AVR_HAVE_SPH__
17402 @itemx __AVR_SP8__
17403 The device has the SPH (high part of stack pointer) special function
17404 register or has an 8-bit stack pointer, respectively.
17405 The definition of these macros is affected by @option{-mmcu=} and
17406 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
17407 by @option{-msp8}.
17409 @item __AVR_HAVE_RAMPD__
17410 @itemx __AVR_HAVE_RAMPX__
17411 @itemx __AVR_HAVE_RAMPY__
17412 @itemx __AVR_HAVE_RAMPZ__
17413 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
17414 @code{RAMPZ} special function register, respectively.
17416 @item __NO_INTERRUPTS__
17417 This macro reflects the @option{-mno-interrupts} command-line option.
17419 @item __AVR_ERRATA_SKIP__
17420 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
17421 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
17422 instructions because of a hardware erratum.  Skip instructions are
17423 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
17424 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
17425 set.
17427 @item __AVR_ISA_RMW__
17428 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
17430 @item __AVR_SFR_OFFSET__=@var{offset}
17431 Instructions that can address I/O special function registers directly
17432 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
17433 address as if addressed by an instruction to access RAM like @code{LD}
17434 or @code{STS}. This offset depends on the device architecture and has
17435 to be subtracted from the RAM address in order to get the
17436 respective I/O@tie{}address.
17438 @item __AVR_SHORT_CALLS__
17439 The @option{-mshort-calls} command line option is set.
17441 @item __AVR_PM_BASE_ADDRESS__=@var{addr}
17442 Some devices support reading from flash memory by means of @code{LD*}
17443 instructions.  The flash memory is seen in the data address space
17444 at an offset of @code{__AVR_PM_BASE_ADDRESS__}.  If this macro
17445 is not defined, this feature is not available.  If defined,
17446 the address space is linear and there is no need to put
17447 @code{.rodata} into RAM.  This is handled by the default linker
17448 description file, and is currently available for
17449 @code{avrtiny} and @code{avrxmega3}.  Even more convenient,
17450 there is no need to use address spaces like @code{__flash} or
17451 features like attribute @code{progmem} and @code{pgm_read_*}.
17453 @item __WITH_AVRLIBC__
17454 The compiler is configured to be used together with AVR-Libc.
17455 See the @option{--with-avrlibc} configure option.
17457 @end table
17459 @node Blackfin Options
17460 @subsection Blackfin Options
17461 @cindex Blackfin Options
17463 @table @gcctabopt
17464 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
17465 @opindex mcpu=
17466 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
17467 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
17468 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
17469 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
17470 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
17471 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
17472 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
17473 @samp{bf561}, @samp{bf592}.
17475 The optional @var{sirevision} specifies the silicon revision of the target
17476 Blackfin processor.  Any workarounds available for the targeted silicon revision
17477 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
17478 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
17479 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
17480 hexadecimal digits representing the major and minor numbers in the silicon
17481 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
17482 is not defined.  If @var{sirevision} is @samp{any}, the
17483 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
17484 If this optional @var{sirevision} is not used, GCC assumes the latest known
17485 silicon revision of the targeted Blackfin processor.
17487 GCC defines a preprocessor macro for the specified @var{cpu}.
17488 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
17489 provided by libgloss to be linked in if @option{-msim} is not given.
17491 Without this option, @samp{bf532} is used as the processor by default.
17493 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
17494 only the preprocessor macro is defined.
17496 @item -msim
17497 @opindex msim
17498 Specifies that the program will be run on the simulator.  This causes
17499 the simulator BSP provided by libgloss to be linked in.  This option
17500 has effect only for @samp{bfin-elf} toolchain.
17501 Certain other options, such as @option{-mid-shared-library} and
17502 @option{-mfdpic}, imply @option{-msim}.
17504 @item -momit-leaf-frame-pointer
17505 @opindex momit-leaf-frame-pointer
17506 Don't keep the frame pointer in a register for leaf functions.  This
17507 avoids the instructions to save, set up and restore frame pointers and
17508 makes an extra register available in leaf functions.
17510 @item -mspecld-anomaly
17511 @opindex mspecld-anomaly
17512 When enabled, the compiler ensures that the generated code does not
17513 contain speculative loads after jump instructions. If this option is used,
17514 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
17516 @item -mno-specld-anomaly
17517 @opindex mno-specld-anomaly
17518 Don't generate extra code to prevent speculative loads from occurring.
17520 @item -mcsync-anomaly
17521 @opindex mcsync-anomaly
17522 When enabled, the compiler ensures that the generated code does not
17523 contain CSYNC or SSYNC instructions too soon after conditional branches.
17524 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
17526 @item -mno-csync-anomaly
17527 @opindex mno-csync-anomaly
17528 Don't generate extra code to prevent CSYNC or SSYNC instructions from
17529 occurring too soon after a conditional branch.
17531 @item -mlow-64k
17532 @opindex mlow-64k
17533 When enabled, the compiler is free to take advantage of the knowledge that
17534 the entire program fits into the low 64k of memory.
17536 @item -mno-low-64k
17537 @opindex mno-low-64k
17538 Assume that the program is arbitrarily large.  This is the default.
17540 @item -mstack-check-l1
17541 @opindex mstack-check-l1
17542 Do stack checking using information placed into L1 scratchpad memory by the
17543 uClinux kernel.
17545 @item -mid-shared-library
17546 @opindex mid-shared-library
17547 Generate code that supports shared libraries via the library ID method.
17548 This allows for execute in place and shared libraries in an environment
17549 without virtual memory management.  This option implies @option{-fPIC}.
17550 With a @samp{bfin-elf} target, this option implies @option{-msim}.
17552 @item -mno-id-shared-library
17553 @opindex mno-id-shared-library
17554 Generate code that doesn't assume ID-based shared libraries are being used.
17555 This is the default.
17557 @item -mleaf-id-shared-library
17558 @opindex mleaf-id-shared-library
17559 Generate code that supports shared libraries via the library ID method,
17560 but assumes that this library or executable won't link against any other
17561 ID shared libraries.  That allows the compiler to use faster code for jumps
17562 and calls.
17564 @item -mno-leaf-id-shared-library
17565 @opindex mno-leaf-id-shared-library
17566 Do not assume that the code being compiled won't link against any ID shared
17567 libraries.  Slower code is generated for jump and call insns.
17569 @item -mshared-library-id=n
17570 @opindex mshared-library-id
17571 Specifies the identification number of the ID-based shared library being
17572 compiled.  Specifying a value of 0 generates more compact code; specifying
17573 other values forces the allocation of that number to the current
17574 library but is no more space- or time-efficient than omitting this option.
17576 @item -msep-data
17577 @opindex msep-data
17578 Generate code that allows the data segment to be located in a different
17579 area of memory from the text segment.  This allows for execute in place in
17580 an environment without virtual memory management by eliminating relocations
17581 against the text section.
17583 @item -mno-sep-data
17584 @opindex mno-sep-data
17585 Generate code that assumes that the data segment follows the text segment.
17586 This is the default.
17588 @item -mlong-calls
17589 @itemx -mno-long-calls
17590 @opindex mlong-calls
17591 @opindex mno-long-calls
17592 Tells the compiler to perform function calls by first loading the
17593 address of the function into a register and then performing a subroutine
17594 call on this register.  This switch is needed if the target function
17595 lies outside of the 24-bit addressing range of the offset-based
17596 version of subroutine call instruction.
17598 This feature is not enabled by default.  Specifying
17599 @option{-mno-long-calls} restores the default behavior.  Note these
17600 switches have no effect on how the compiler generates code to handle
17601 function calls via function pointers.
17603 @item -mfast-fp
17604 @opindex mfast-fp
17605 Link with the fast floating-point library. This library relaxes some of
17606 the IEEE floating-point standard's rules for checking inputs against
17607 Not-a-Number (NAN), in the interest of performance.
17609 @item -minline-plt
17610 @opindex minline-plt
17611 Enable inlining of PLT entries in function calls to functions that are
17612 not known to bind locally.  It has no effect without @option{-mfdpic}.
17614 @item -mmulticore
17615 @opindex mmulticore
17616 Build a standalone application for multicore Blackfin processors. 
17617 This option causes proper start files and link scripts supporting 
17618 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
17619 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
17621 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
17622 selects the one-application-per-core programming model.  Without
17623 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
17624 programming model is used. In this model, the main function of Core B
17625 should be named as @code{coreb_main}.
17627 If this option is not used, the single-core application programming
17628 model is used.
17630 @item -mcorea
17631 @opindex mcorea
17632 Build a standalone application for Core A of BF561 when using
17633 the one-application-per-core programming model. Proper start files
17634 and link scripts are used to support Core A, and the macro
17635 @code{__BFIN_COREA} is defined.
17636 This option can only be used in conjunction with @option{-mmulticore}.
17638 @item -mcoreb
17639 @opindex mcoreb
17640 Build a standalone application for Core B of BF561 when using
17641 the one-application-per-core programming model. Proper start files
17642 and link scripts are used to support Core B, and the macro
17643 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
17644 should be used instead of @code{main}. 
17645 This option can only be used in conjunction with @option{-mmulticore}.
17647 @item -msdram
17648 @opindex msdram
17649 Build a standalone application for SDRAM. Proper start files and
17650 link scripts are used to put the application into SDRAM, and the macro
17651 @code{__BFIN_SDRAM} is defined.
17652 The loader should initialize SDRAM before loading the application.
17654 @item -micplb
17655 @opindex micplb
17656 Assume that ICPLBs are enabled at run time.  This has an effect on certain
17657 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
17658 are enabled; for standalone applications the default is off.
17659 @end table
17661 @node C6X Options
17662 @subsection C6X Options
17663 @cindex C6X Options
17665 @table @gcctabopt
17666 @item -march=@var{name}
17667 @opindex march
17668 This specifies the name of the target architecture.  GCC uses this
17669 name to determine what kind of instructions it can emit when generating
17670 assembly code.  Permissible names are: @samp{c62x},
17671 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
17673 @item -mbig-endian
17674 @opindex mbig-endian
17675 Generate code for a big-endian target.
17677 @item -mlittle-endian
17678 @opindex mlittle-endian
17679 Generate code for a little-endian target.  This is the default.
17681 @item -msim
17682 @opindex msim
17683 Choose startup files and linker script suitable for the simulator.
17685 @item -msdata=default
17686 @opindex msdata=default
17687 Put small global and static data in the @code{.neardata} section,
17688 which is pointed to by register @code{B14}.  Put small uninitialized
17689 global and static data in the @code{.bss} section, which is adjacent
17690 to the @code{.neardata} section.  Put small read-only data into the
17691 @code{.rodata} section.  The corresponding sections used for large
17692 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
17694 @item -msdata=all
17695 @opindex msdata=all
17696 Put all data, not just small objects, into the sections reserved for
17697 small data, and use addressing relative to the @code{B14} register to
17698 access them.
17700 @item -msdata=none
17701 @opindex msdata=none
17702 Make no use of the sections reserved for small data, and use absolute
17703 addresses to access all data.  Put all initialized global and static
17704 data in the @code{.fardata} section, and all uninitialized data in the
17705 @code{.far} section.  Put all constant data into the @code{.const}
17706 section.
17707 @end table
17709 @node CRIS Options
17710 @subsection CRIS Options
17711 @cindex CRIS Options
17713 These options are defined specifically for the CRIS ports.
17715 @table @gcctabopt
17716 @item -march=@var{architecture-type}
17717 @itemx -mcpu=@var{architecture-type}
17718 @opindex march
17719 @opindex mcpu
17720 Generate code for the specified architecture.  The choices for
17721 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
17722 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
17723 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
17724 @samp{v10}.
17726 @item -mtune=@var{architecture-type}
17727 @opindex mtune
17728 Tune to @var{architecture-type} everything applicable about the generated
17729 code, except for the ABI and the set of available instructions.  The
17730 choices for @var{architecture-type} are the same as for
17731 @option{-march=@var{architecture-type}}.
17733 @item -mmax-stack-frame=@var{n}
17734 @opindex mmax-stack-frame
17735 Warn when the stack frame of a function exceeds @var{n} bytes.
17737 @item -metrax4
17738 @itemx -metrax100
17739 @opindex metrax4
17740 @opindex metrax100
17741 The options @option{-metrax4} and @option{-metrax100} are synonyms for
17742 @option{-march=v3} and @option{-march=v8} respectively.
17744 @item -mmul-bug-workaround
17745 @itemx -mno-mul-bug-workaround
17746 @opindex mmul-bug-workaround
17747 @opindex mno-mul-bug-workaround
17748 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
17749 models where it applies.  This option is active by default.
17751 @item -mpdebug
17752 @opindex mpdebug
17753 Enable CRIS-specific verbose debug-related information in the assembly
17754 code.  This option also has the effect of turning off the @samp{#NO_APP}
17755 formatted-code indicator to the assembler at the beginning of the
17756 assembly file.
17758 @item -mcc-init
17759 @opindex mcc-init
17760 Do not use condition-code results from previous instruction; always emit
17761 compare and test instructions before use of condition codes.
17763 @item -mno-side-effects
17764 @opindex mno-side-effects
17765 Do not emit instructions with side effects in addressing modes other than
17766 post-increment.
17768 @item -mstack-align
17769 @itemx -mno-stack-align
17770 @itemx -mdata-align
17771 @itemx -mno-data-align
17772 @itemx -mconst-align
17773 @itemx -mno-const-align
17774 @opindex mstack-align
17775 @opindex mno-stack-align
17776 @opindex mdata-align
17777 @opindex mno-data-align
17778 @opindex mconst-align
17779 @opindex mno-const-align
17780 These options (@samp{no-} options) arrange (eliminate arrangements) for the
17781 stack frame, individual data and constants to be aligned for the maximum
17782 single data access size for the chosen CPU model.  The default is to
17783 arrange for 32-bit alignment.  ABI details such as structure layout are
17784 not affected by these options.
17786 @item -m32-bit
17787 @itemx -m16-bit
17788 @itemx -m8-bit
17789 @opindex m32-bit
17790 @opindex m16-bit
17791 @opindex m8-bit
17792 Similar to the stack- data- and const-align options above, these options
17793 arrange for stack frame, writable data and constants to all be 32-bit,
17794 16-bit or 8-bit aligned.  The default is 32-bit alignment.
17796 @item -mno-prologue-epilogue
17797 @itemx -mprologue-epilogue
17798 @opindex mno-prologue-epilogue
17799 @opindex mprologue-epilogue
17800 With @option{-mno-prologue-epilogue}, the normal function prologue and
17801 epilogue which set up the stack frame are omitted and no return
17802 instructions or return sequences are generated in the code.  Use this
17803 option only together with visual inspection of the compiled code: no
17804 warnings or errors are generated when call-saved registers must be saved,
17805 or storage for local variables needs to be allocated.
17807 @item -mno-gotplt
17808 @itemx -mgotplt
17809 @opindex mno-gotplt
17810 @opindex mgotplt
17811 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
17812 instruction sequences that load addresses for functions from the PLT part
17813 of the GOT rather than (traditional on other architectures) calls to the
17814 PLT@.  The default is @option{-mgotplt}.
17816 @item -melf
17817 @opindex melf
17818 Legacy no-op option only recognized with the cris-axis-elf and
17819 cris-axis-linux-gnu targets.
17821 @item -mlinux
17822 @opindex mlinux
17823 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
17825 @item -sim
17826 @opindex sim
17827 This option, recognized for the cris-axis-elf, arranges
17828 to link with input-output functions from a simulator library.  Code,
17829 initialized data and zero-initialized data are allocated consecutively.
17831 @item -sim2
17832 @opindex sim2
17833 Like @option{-sim}, but pass linker options to locate initialized data at
17834 0x40000000 and zero-initialized data at 0x80000000.
17835 @end table
17837 @node CR16 Options
17838 @subsection CR16 Options
17839 @cindex CR16 Options
17841 These options are defined specifically for the CR16 ports.
17843 @table @gcctabopt
17845 @item -mmac
17846 @opindex mmac
17847 Enable the use of multiply-accumulate instructions. Disabled by default.
17849 @item -mcr16cplus
17850 @itemx -mcr16c
17851 @opindex mcr16cplus
17852 @opindex mcr16c
17853 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
17854 is default.
17856 @item -msim
17857 @opindex msim
17858 Links the library libsim.a which is in compatible with simulator. Applicable
17859 to ELF compiler only.
17861 @item -mint32
17862 @opindex mint32
17863 Choose integer type as 32-bit wide.
17865 @item -mbit-ops
17866 @opindex mbit-ops
17867 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
17869 @item -mdata-model=@var{model}
17870 @opindex mdata-model
17871 Choose a data model. The choices for @var{model} are @samp{near},
17872 @samp{far} or @samp{medium}. @samp{medium} is default.
17873 However, @samp{far} is not valid with @option{-mcr16c}, as the
17874 CR16C architecture does not support the far data model.
17875 @end table
17877 @node C-SKY Options
17878 @subsection C-SKY Options
17879 @cindex C-SKY Options
17881 GCC supports these options when compiling for C-SKY V2 processors.
17883 @table @gcctabopt
17885 @item -march=@var{arch}
17886 @opindex march=
17887 Specify the C-SKY target architecture.  Valid values for @var{arch} are:
17888 @samp{ck801}, @samp{ck802}, @samp{ck803}, @samp{ck807}, and @samp{ck810}.
17889 The default is @samp{ck810}.
17891 @item -mcpu=@var{cpu}
17892 @opindex mcpu=
17893 Specify the C-SKY target processor.  Valid values for @var{cpu} are:
17894 @samp{ck801}, @samp{ck801t},
17895 @samp{ck802}, @samp{ck802t}, @samp{ck802j},
17896 @samp{ck803}, @samp{ck803h}, @samp{ck803t}, @samp{ck803ht},
17897 @samp{ck803f}, @samp{ck803fh}, @samp{ck803e}, @samp{ck803eh},
17898 @samp{ck803et}, @samp{ck803eht}, @samp{ck803ef}, @samp{ck803efh},
17899 @samp{ck803ft}, @samp{ck803eft}, @samp{ck803efht}, @samp{ck803r1},
17900 @samp{ck803hr1}, @samp{ck803tr1}, @samp{ck803htr1}, @samp{ck803fr1},
17901 @samp{ck803fhr1}, @samp{ck803er1}, @samp{ck803ehr1}, @samp{ck803etr1},
17902 @samp{ck803ehtr1}, @samp{ck803efr1}, @samp{ck803efhr1}, @samp{ck803ftr1},
17903 @samp{ck803eftr1}, @samp{ck803efhtr1},
17904 @samp{ck803s}, @samp{ck803st}, @samp{ck803se}, @samp{ck803sf},
17905 @samp{ck803sef}, @samp{ck803seft},
17906 @samp{ck807e}, @samp{ck807ef}, @samp{ck807}, @samp{ck807f},
17907 @samp{ck810e}, @samp{ck810et}, @samp{ck810ef}, @samp{ck810eft},
17908 @samp{ck810}, @samp{ck810v}, @samp{ck810f}, @samp{ck810t}, @samp{ck810fv},
17909 @samp{ck810tv}, @samp{ck810ft}, and @samp{ck810ftv}.
17911 @item -mbig-endian
17912 @opindex mbig-endian
17913 @itemx -EB
17914 @opindex -EB
17915 @itemx -mlittle-endian
17916 @opindex mlittle-endian
17917 @itemx -EL
17918 @opindex -EL
17920 Select big- or little-endian code.  The default is little-endian.
17922 @item -mhard-float
17923 @opindex mhard-float
17924 @itemx -msoft-float
17925 @opindex msoft-float
17927 Select hardware or software floating-point implementations.
17928 The default is soft float.
17930 @item -mdouble-float
17931 @itemx -mno-double-float
17932 @opindex mdouble-float
17933 When @option{-mhard-float} is in effect, enable generation of
17934 double-precision float instructions.  This is the default except
17935 when compiling for CK803.
17937 @item -mfdivdu
17938 @itemx -mno-fdivdu
17939 @opindex mfdivdu
17940 When @option{-mhard-float} is in effect, enable generation of
17941 @code{frecipd}, @code{fsqrtd}, and @code{fdivd} instructions.
17942 This is the default except when compiling for CK803.
17944 @item -mfpu=@var{fpu}
17945 @opindex mfpu=
17946 Select the floating-point processor.  This option can only be used with
17947 @option{-mhard-float}.
17948 Values for @var{fpu} are
17949 @samp{fpv2_sf} (equivalent to @samp{-mno-double-float -mno-fdivdu}),
17950 @samp{fpv2} (@samp{-mdouble-float -mno-divdu}), and
17951 @samp{fpv2_divd} (@samp{-mdouble-float -mdivdu}).
17953 @item -melrw
17954 @itemx -mno-elrw
17955 @opindex melrw
17956 Enable the extended @code{lrw} instruction.  This option defaults to on
17957 for CK801 and off otherwise.
17959 @item -mistack
17960 @itemx -mno-istack
17961 @opindex mistack
17962 Enable interrupt stack instructions; the default is off.
17964 The @option{-mistack} option is required to handle the
17965 @code{interrupt} and @code{isr} function attributes
17966 (@pxref{C-SKY Function Attributes}).
17968 @item -mmp
17969 @opindex mmp
17970 Enable multiprocessor instructions; the default is off.
17972 @item -mcp
17973 @opindex mcp
17974 Enable coprocessor instructions; the default is off.
17976 @item -mcache
17977 @opindex mcache
17978 Enable coprocessor instructions; the default is off.
17980 @item -msecurity
17981 @opindex msecurity
17982 Enable C-SKY security instructions; the default is off.
17984 @item -mtrust
17985 @opindex mtrust
17986 Enable C-SKY trust instructions; the default is off.
17988 @item -mdsp
17989 @opindex mdsp
17990 @itemx -medsp
17991 @opindex medsp
17992 @itemx -mvdsp
17993 @opindex mvdsp
17994 Enable C-SKY DSP, Enhanced DSP, or Vector DSP instructions, respectively.
17995 All of these options default to off.
17997 @item -mdiv
17998 @itemx -mno-div
17999 @opindex mdiv
18000 Generate divide instructions.  Default is off.
18002 @item -msmart
18003 @itemx -mno-smart
18004 @opindex msmart
18005 Generate code for Smart Mode, using only registers numbered 0-7 to allow
18006 use of 16-bit instructions.  This option is ignored for CK801 where this
18007 is the required behavior, and it defaults to on for CK802.
18008 For other targets, the default is off.
18010 @item -mhigh-registers
18011 @itemx -mno-high-registers
18012 @opindex mhigh-registers
18013 Generate code using the high registers numbered 16-31.  This option
18014 is not supported on CK801, CK802, or CK803, and is enabled by default
18015 for other processors.
18017 @item -manchor
18018 @itemx -mno-anchor
18019 @opindex manchor
18020 Generate code using global anchor symbol addresses.
18022 @item -mpushpop
18023 @itemx -mno-pushpop
18024 @opindex mpushpop
18025 Generate code using @code{push} and @code{pop} instructions.  This option
18026 defaults to on.
18028 @item -mmultiple-stld
18029 @itemx -mstm
18030 @itemx -mno-multiple-stld
18031 @itemx -mno-stm
18032 @opindex mmultiple-stld
18033 Generate code using @code{stm} and @code{ldm} instructions.  This option
18034 isn't supported on CK801 but is enabled by default on other processors.
18036 @item -mconstpool
18037 @itemx -mno-constpool
18038 @opindex mconstpool
18039 Create constant pools in the compiler instead of deferring it to the
18040 assembler.  This option is the default and required for correct code
18041 generation on CK801 and CK802, and is optional on other processors.
18043 @item -mstack-size
18044 @item -mno-stack-size
18045 @opindex mstack-size
18046 Emit @code{.stack_size} directives for each function in the assembly
18047 output.  This option defaults to off.
18049 @item -mccrt
18050 @itemx -mno-ccrt
18051 @opindex mccrt
18052 Generate code for the C-SKY compiler runtime instead of libgcc.  This
18053 option defaults to off.
18055 @item -mbranch-cost=@var{n}
18056 @opindex mbranch-cost=
18057 Set the branch costs to roughly @code{n} instructions.  The default is 1.
18059 @item -msched-prolog
18060 @itemx -mno-sched-prolog
18061 @opindex msched-prolog
18062 Permit scheduling of function prologue and epilogue sequences.  Using
18063 this option can result in code that is not compliant with the C-SKY V2 ABI
18064 prologue requirements and that cannot be debugged or backtraced.
18065 It is disabled by default.
18067 @end table
18069 @node Darwin Options
18070 @subsection Darwin Options
18071 @cindex Darwin options
18073 These options are defined for all architectures running the Darwin operating
18074 system.
18076 FSF GCC on Darwin does not create ``fat'' object files; it creates
18077 an object file for the single architecture that GCC was built to
18078 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
18079 @option{-arch} options are used; it does so by running the compiler or
18080 linker multiple times and joining the results together with
18081 @file{lipo}.
18083 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
18084 @samp{i686}) is determined by the flags that specify the ISA
18085 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
18086 @option{-force_cpusubtype_ALL} option can be used to override this.
18088 The Darwin tools vary in their behavior when presented with an ISA
18089 mismatch.  The assembler, @file{as}, only permits instructions to
18090 be used that are valid for the subtype of the file it is generating,
18091 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
18092 The linker for shared libraries, @file{/usr/bin/libtool}, fails
18093 and prints an error if asked to create a shared library with a less
18094 restrictive subtype than its input files (for instance, trying to put
18095 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
18096 for executables, @command{ld}, quietly gives the executable the most
18097 restrictive subtype of any of its input files.
18099 @table @gcctabopt
18100 @item -F@var{dir}
18101 @opindex F
18102 Add the framework directory @var{dir} to the head of the list of
18103 directories to be searched for header files.  These directories are
18104 interleaved with those specified by @option{-I} options and are
18105 scanned in a left-to-right order.
18107 A framework directory is a directory with frameworks in it.  A
18108 framework is a directory with a @file{Headers} and/or
18109 @file{PrivateHeaders} directory contained directly in it that ends
18110 in @file{.framework}.  The name of a framework is the name of this
18111 directory excluding the @file{.framework}.  Headers associated with
18112 the framework are found in one of those two directories, with
18113 @file{Headers} being searched first.  A subframework is a framework
18114 directory that is in a framework's @file{Frameworks} directory.
18115 Includes of subframework headers can only appear in a header of a
18116 framework that contains the subframework, or in a sibling subframework
18117 header.  Two subframeworks are siblings if they occur in the same
18118 framework.  A subframework should not have the same name as a
18119 framework; a warning is issued if this is violated.  Currently a
18120 subframework cannot have subframeworks; in the future, the mechanism
18121 may be extended to support this.  The standard frameworks can be found
18122 in @file{/System/Library/Frameworks} and
18123 @file{/Library/Frameworks}.  An example include looks like
18124 @code{#include <Framework/header.h>}, where @file{Framework} denotes
18125 the name of the framework and @file{header.h} is found in the
18126 @file{PrivateHeaders} or @file{Headers} directory.
18128 @item -iframework@var{dir}
18129 @opindex iframework
18130 Like @option{-F} except the directory is a treated as a system
18131 directory.  The main difference between this @option{-iframework} and
18132 @option{-F} is that with @option{-iframework} the compiler does not
18133 warn about constructs contained within header files found via
18134 @var{dir}.  This option is valid only for the C family of languages.
18136 @item -gused
18137 @opindex gused
18138 Emit debugging information for symbols that are used.  For stabs
18139 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
18140 This is by default ON@.
18142 @item -gfull
18143 @opindex gfull
18144 Emit debugging information for all symbols and types.
18146 @item -mmacosx-version-min=@var{version}
18147 The earliest version of MacOS X that this executable will run on
18148 is @var{version}.  Typical values of @var{version} include @code{10.1},
18149 @code{10.2}, and @code{10.3.9}.
18151 If the compiler was built to use the system's headers by default,
18152 then the default for this option is the system version on which the
18153 compiler is running, otherwise the default is to make choices that
18154 are compatible with as many systems and code bases as possible.
18156 @item -mkernel
18157 @opindex mkernel
18158 Enable kernel development mode.  The @option{-mkernel} option sets
18159 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
18160 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
18161 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
18162 applicable.  This mode also sets @option{-mno-altivec},
18163 @option{-msoft-float}, @option{-fno-builtin} and
18164 @option{-mlong-branch} for PowerPC targets.
18166 @item -mone-byte-bool
18167 @opindex mone-byte-bool
18168 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
18169 By default @code{sizeof(bool)} is @code{4} when compiling for
18170 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
18171 option has no effect on x86.
18173 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
18174 to generate code that is not binary compatible with code generated
18175 without that switch.  Using this switch may require recompiling all
18176 other modules in a program, including system libraries.  Use this
18177 switch to conform to a non-default data model.
18179 @item -mfix-and-continue
18180 @itemx -ffix-and-continue
18181 @itemx -findirect-data
18182 @opindex mfix-and-continue
18183 @opindex ffix-and-continue
18184 @opindex findirect-data
18185 Generate code suitable for fast turnaround development, such as to
18186 allow GDB to dynamically load @file{.o} files into already-running
18187 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
18188 are provided for backwards compatibility.
18190 @item -all_load
18191 @opindex all_load
18192 Loads all members of static archive libraries.
18193 See man ld(1) for more information.
18195 @item -arch_errors_fatal
18196 @opindex arch_errors_fatal
18197 Cause the errors having to do with files that have the wrong architecture
18198 to be fatal.
18200 @item -bind_at_load
18201 @opindex bind_at_load
18202 Causes the output file to be marked such that the dynamic linker will
18203 bind all undefined references when the file is loaded or launched.
18205 @item -bundle
18206 @opindex bundle
18207 Produce a Mach-o bundle format file.
18208 See man ld(1) for more information.
18210 @item -bundle_loader @var{executable}
18211 @opindex bundle_loader
18212 This option specifies the @var{executable} that will load the build
18213 output file being linked.  See man ld(1) for more information.
18215 @item -dynamiclib
18216 @opindex dynamiclib
18217 When passed this option, GCC produces a dynamic library instead of
18218 an executable when linking, using the Darwin @file{libtool} command.
18220 @item -force_cpusubtype_ALL
18221 @opindex force_cpusubtype_ALL
18222 This causes GCC's output file to have the @samp{ALL} subtype, instead of
18223 one controlled by the @option{-mcpu} or @option{-march} option.
18225 @item -allowable_client  @var{client_name}
18226 @itemx -client_name
18227 @itemx -compatibility_version
18228 @itemx -current_version
18229 @itemx -dead_strip
18230 @itemx -dependency-file
18231 @itemx -dylib_file
18232 @itemx -dylinker_install_name
18233 @itemx -dynamic
18234 @itemx -exported_symbols_list
18235 @itemx -filelist
18236 @need 800
18237 @itemx -flat_namespace
18238 @itemx -force_flat_namespace
18239 @itemx -headerpad_max_install_names
18240 @itemx -image_base
18241 @itemx -init
18242 @itemx -install_name
18243 @itemx -keep_private_externs
18244 @itemx -multi_module
18245 @itemx -multiply_defined
18246 @itemx -multiply_defined_unused
18247 @need 800
18248 @itemx -noall_load
18249 @itemx -no_dead_strip_inits_and_terms
18250 @itemx -nofixprebinding
18251 @itemx -nomultidefs
18252 @itemx -noprebind
18253 @itemx -noseglinkedit
18254 @itemx -pagezero_size
18255 @itemx -prebind
18256 @itemx -prebind_all_twolevel_modules
18257 @itemx -private_bundle
18258 @need 800
18259 @itemx -read_only_relocs
18260 @itemx -sectalign
18261 @itemx -sectobjectsymbols
18262 @itemx -whyload
18263 @itemx -seg1addr
18264 @itemx -sectcreate
18265 @itemx -sectobjectsymbols
18266 @itemx -sectorder
18267 @itemx -segaddr
18268 @itemx -segs_read_only_addr
18269 @need 800
18270 @itemx -segs_read_write_addr
18271 @itemx -seg_addr_table
18272 @itemx -seg_addr_table_filename
18273 @itemx -seglinkedit
18274 @itemx -segprot
18275 @itemx -segs_read_only_addr
18276 @itemx -segs_read_write_addr
18277 @itemx -single_module
18278 @itemx -static
18279 @itemx -sub_library
18280 @need 800
18281 @itemx -sub_umbrella
18282 @itemx -twolevel_namespace
18283 @itemx -umbrella
18284 @itemx -undefined
18285 @itemx -unexported_symbols_list
18286 @itemx -weak_reference_mismatches
18287 @itemx -whatsloaded
18288 @opindex allowable_client
18289 @opindex client_name
18290 @opindex compatibility_version
18291 @opindex current_version
18292 @opindex dead_strip
18293 @opindex dependency-file
18294 @opindex dylib_file
18295 @opindex dylinker_install_name
18296 @opindex dynamic
18297 @opindex exported_symbols_list
18298 @opindex filelist
18299 @opindex flat_namespace
18300 @opindex force_flat_namespace
18301 @opindex headerpad_max_install_names
18302 @opindex image_base
18303 @opindex init
18304 @opindex install_name
18305 @opindex keep_private_externs
18306 @opindex multi_module
18307 @opindex multiply_defined
18308 @opindex multiply_defined_unused
18309 @opindex noall_load
18310 @opindex no_dead_strip_inits_and_terms
18311 @opindex nofixprebinding
18312 @opindex nomultidefs
18313 @opindex noprebind
18314 @opindex noseglinkedit
18315 @opindex pagezero_size
18316 @opindex prebind
18317 @opindex prebind_all_twolevel_modules
18318 @opindex private_bundle
18319 @opindex read_only_relocs
18320 @opindex sectalign
18321 @opindex sectobjectsymbols
18322 @opindex whyload
18323 @opindex seg1addr
18324 @opindex sectcreate
18325 @opindex sectobjectsymbols
18326 @opindex sectorder
18327 @opindex segaddr
18328 @opindex segs_read_only_addr
18329 @opindex segs_read_write_addr
18330 @opindex seg_addr_table
18331 @opindex seg_addr_table_filename
18332 @opindex seglinkedit
18333 @opindex segprot
18334 @opindex segs_read_only_addr
18335 @opindex segs_read_write_addr
18336 @opindex single_module
18337 @opindex static
18338 @opindex sub_library
18339 @opindex sub_umbrella
18340 @opindex twolevel_namespace
18341 @opindex umbrella
18342 @opindex undefined
18343 @opindex unexported_symbols_list
18344 @opindex weak_reference_mismatches
18345 @opindex whatsloaded
18346 These options are passed to the Darwin linker.  The Darwin linker man page
18347 describes them in detail.
18348 @end table
18350 @node DEC Alpha Options
18351 @subsection DEC Alpha Options
18353 These @samp{-m} options are defined for the DEC Alpha implementations:
18355 @table @gcctabopt
18356 @item -mno-soft-float
18357 @itemx -msoft-float
18358 @opindex mno-soft-float
18359 @opindex msoft-float
18360 Use (do not use) the hardware floating-point instructions for
18361 floating-point operations.  When @option{-msoft-float} is specified,
18362 functions in @file{libgcc.a} are used to perform floating-point
18363 operations.  Unless they are replaced by routines that emulate the
18364 floating-point operations, or compiled in such a way as to call such
18365 emulations routines, these routines issue floating-point
18366 operations.   If you are compiling for an Alpha without floating-point
18367 operations, you must ensure that the library is built so as not to call
18368 them.
18370 Note that Alpha implementations without floating-point operations are
18371 required to have floating-point registers.
18373 @item -mfp-reg
18374 @itemx -mno-fp-regs
18375 @opindex mfp-reg
18376 @opindex mno-fp-regs
18377 Generate code that uses (does not use) the floating-point register set.
18378 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
18379 register set is not used, floating-point operands are passed in integer
18380 registers as if they were integers and floating-point results are passed
18381 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
18382 so any function with a floating-point argument or return value called by code
18383 compiled with @option{-mno-fp-regs} must also be compiled with that
18384 option.
18386 A typical use of this option is building a kernel that does not use,
18387 and hence need not save and restore, any floating-point registers.
18389 @item -mieee
18390 @opindex mieee
18391 The Alpha architecture implements floating-point hardware optimized for
18392 maximum performance.  It is mostly compliant with the IEEE floating-point
18393 standard.  However, for full compliance, software assistance is
18394 required.  This option generates code fully IEEE-compliant code
18395 @emph{except} that the @var{inexact-flag} is not maintained (see below).
18396 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
18397 defined during compilation.  The resulting code is less efficient but is
18398 able to correctly support denormalized numbers and exceptional IEEE
18399 values such as not-a-number and plus/minus infinity.  Other Alpha
18400 compilers call this option @option{-ieee_with_no_inexact}.
18402 @item -mieee-with-inexact
18403 @opindex mieee-with-inexact
18404 This is like @option{-mieee} except the generated code also maintains
18405 the IEEE @var{inexact-flag}.  Turning on this option causes the
18406 generated code to implement fully-compliant IEEE math.  In addition to
18407 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
18408 macro.  On some Alpha implementations the resulting code may execute
18409 significantly slower than the code generated by default.  Since there is
18410 very little code that depends on the @var{inexact-flag}, you should
18411 normally not specify this option.  Other Alpha compilers call this
18412 option @option{-ieee_with_inexact}.
18414 @item -mfp-trap-mode=@var{trap-mode}
18415 @opindex mfp-trap-mode
18416 This option controls what floating-point related traps are enabled.
18417 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
18418 The trap mode can be set to one of four values:
18420 @table @samp
18421 @item n
18422 This is the default (normal) setting.  The only traps that are enabled
18423 are the ones that cannot be disabled in software (e.g., division by zero
18424 trap).
18426 @item u
18427 In addition to the traps enabled by @samp{n}, underflow traps are enabled
18428 as well.
18430 @item su
18431 Like @samp{u}, but the instructions are marked to be safe for software
18432 completion (see Alpha architecture manual for details).
18434 @item sui
18435 Like @samp{su}, but inexact traps are enabled as well.
18436 @end table
18438 @item -mfp-rounding-mode=@var{rounding-mode}
18439 @opindex mfp-rounding-mode
18440 Selects the IEEE rounding mode.  Other Alpha compilers call this option
18441 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
18444 @table @samp
18445 @item n
18446 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
18447 the nearest machine number or towards the even machine number in case
18448 of a tie.
18450 @item m
18451 Round towards minus infinity.
18453 @item c
18454 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
18456 @item d
18457 Dynamic rounding mode.  A field in the floating-point control register
18458 (@var{fpcr}, see Alpha architecture reference manual) controls the
18459 rounding mode in effect.  The C library initializes this register for
18460 rounding towards plus infinity.  Thus, unless your program modifies the
18461 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
18462 @end table
18464 @item -mtrap-precision=@var{trap-precision}
18465 @opindex mtrap-precision
18466 In the Alpha architecture, floating-point traps are imprecise.  This
18467 means without software assistance it is impossible to recover from a
18468 floating trap and program execution normally needs to be terminated.
18469 GCC can generate code that can assist operating system trap handlers
18470 in determining the exact location that caused a floating-point trap.
18471 Depending on the requirements of an application, different levels of
18472 precisions can be selected:
18474 @table @samp
18475 @item p
18476 Program precision.  This option is the default and means a trap handler
18477 can only identify which program caused a floating-point exception.
18479 @item f
18480 Function precision.  The trap handler can determine the function that
18481 caused a floating-point exception.
18483 @item i
18484 Instruction precision.  The trap handler can determine the exact
18485 instruction that caused a floating-point exception.
18486 @end table
18488 Other Alpha compilers provide the equivalent options called
18489 @option{-scope_safe} and @option{-resumption_safe}.
18491 @item -mieee-conformant
18492 @opindex mieee-conformant
18493 This option marks the generated code as IEEE conformant.  You must not
18494 use this option unless you also specify @option{-mtrap-precision=i} and either
18495 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
18496 is to emit the line @samp{.eflag 48} in the function prologue of the
18497 generated assembly file.
18499 @item -mbuild-constants
18500 @opindex mbuild-constants
18501 Normally GCC examines a 32- or 64-bit integer constant to
18502 see if it can construct it from smaller constants in two or three
18503 instructions.  If it cannot, it outputs the constant as a literal and
18504 generates code to load it from the data segment at run time.
18506 Use this option to require GCC to construct @emph{all} integer constants
18507 using code, even if it takes more instructions (the maximum is six).
18509 You typically use this option to build a shared library dynamic
18510 loader.  Itself a shared library, it must relocate itself in memory
18511 before it can find the variables and constants in its own data segment.
18513 @item -mbwx
18514 @itemx -mno-bwx
18515 @itemx -mcix
18516 @itemx -mno-cix
18517 @itemx -mfix
18518 @itemx -mno-fix
18519 @itemx -mmax
18520 @itemx -mno-max
18521 @opindex mbwx
18522 @opindex mno-bwx
18523 @opindex mcix
18524 @opindex mno-cix
18525 @opindex mfix
18526 @opindex mno-fix
18527 @opindex mmax
18528 @opindex mno-max
18529 Indicate whether GCC should generate code to use the optional BWX,
18530 CIX, FIX and MAX instruction sets.  The default is to use the instruction
18531 sets supported by the CPU type specified via @option{-mcpu=} option or that
18532 of the CPU on which GCC was built if none is specified.
18534 @item -mfloat-vax
18535 @itemx -mfloat-ieee
18536 @opindex mfloat-vax
18537 @opindex mfloat-ieee
18538 Generate code that uses (does not use) VAX F and G floating-point
18539 arithmetic instead of IEEE single and double precision.
18541 @item -mexplicit-relocs
18542 @itemx -mno-explicit-relocs
18543 @opindex mexplicit-relocs
18544 @opindex mno-explicit-relocs
18545 Older Alpha assemblers provided no way to generate symbol relocations
18546 except via assembler macros.  Use of these macros does not allow
18547 optimal instruction scheduling.  GNU binutils as of version 2.12
18548 supports a new syntax that allows the compiler to explicitly mark
18549 which relocations should apply to which instructions.  This option
18550 is mostly useful for debugging, as GCC detects the capabilities of
18551 the assembler when it is built and sets the default accordingly.
18553 @item -msmall-data
18554 @itemx -mlarge-data
18555 @opindex msmall-data
18556 @opindex mlarge-data
18557 When @option{-mexplicit-relocs} is in effect, static data is
18558 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
18559 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
18560 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
18561 16-bit relocations off of the @code{$gp} register.  This limits the
18562 size of the small data area to 64KB, but allows the variables to be
18563 directly accessed via a single instruction.
18565 The default is @option{-mlarge-data}.  With this option the data area
18566 is limited to just below 2GB@.  Programs that require more than 2GB of
18567 data must use @code{malloc} or @code{mmap} to allocate the data in the
18568 heap instead of in the program's data segment.
18570 When generating code for shared libraries, @option{-fpic} implies
18571 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
18573 @item -msmall-text
18574 @itemx -mlarge-text
18575 @opindex msmall-text
18576 @opindex mlarge-text
18577 When @option{-msmall-text} is used, the compiler assumes that the
18578 code of the entire program (or shared library) fits in 4MB, and is
18579 thus reachable with a branch instruction.  When @option{-msmall-data}
18580 is used, the compiler can assume that all local symbols share the
18581 same @code{$gp} value, and thus reduce the number of instructions
18582 required for a function call from 4 to 1.
18584 The default is @option{-mlarge-text}.
18586 @item -mcpu=@var{cpu_type}
18587 @opindex mcpu
18588 Set the instruction set and instruction scheduling parameters for
18589 machine type @var{cpu_type}.  You can specify either the @samp{EV}
18590 style name or the corresponding chip number.  GCC supports scheduling
18591 parameters for the EV4, EV5 and EV6 family of processors and
18592 chooses the default values for the instruction set from the processor
18593 you specify.  If you do not specify a processor type, GCC defaults
18594 to the processor on which the compiler was built.
18596 Supported values for @var{cpu_type} are
18598 @table @samp
18599 @item ev4
18600 @itemx ev45
18601 @itemx 21064
18602 Schedules as an EV4 and has no instruction set extensions.
18604 @item ev5
18605 @itemx 21164
18606 Schedules as an EV5 and has no instruction set extensions.
18608 @item ev56
18609 @itemx 21164a
18610 Schedules as an EV5 and supports the BWX extension.
18612 @item pca56
18613 @itemx 21164pc
18614 @itemx 21164PC
18615 Schedules as an EV5 and supports the BWX and MAX extensions.
18617 @item ev6
18618 @itemx 21264
18619 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
18621 @item ev67
18622 @itemx 21264a
18623 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
18624 @end table
18626 Native toolchains also support the value @samp{native},
18627 which selects the best architecture option for the host processor.
18628 @option{-mcpu=native} has no effect if GCC does not recognize
18629 the processor.
18631 @item -mtune=@var{cpu_type}
18632 @opindex mtune
18633 Set only the instruction scheduling parameters for machine type
18634 @var{cpu_type}.  The instruction set is not changed.
18636 Native toolchains also support the value @samp{native},
18637 which selects the best architecture option for the host processor.
18638 @option{-mtune=native} has no effect if GCC does not recognize
18639 the processor.
18641 @item -mmemory-latency=@var{time}
18642 @opindex mmemory-latency
18643 Sets the latency the scheduler should assume for typical memory
18644 references as seen by the application.  This number is highly
18645 dependent on the memory access patterns used by the application
18646 and the size of the external cache on the machine.
18648 Valid options for @var{time} are
18650 @table @samp
18651 @item @var{number}
18652 A decimal number representing clock cycles.
18654 @item L1
18655 @itemx L2
18656 @itemx L3
18657 @itemx main
18658 The compiler contains estimates of the number of clock cycles for
18659 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
18660 (also called Dcache, Scache, and Bcache), as well as to main memory.
18661 Note that L3 is only valid for EV5.
18663 @end table
18664 @end table
18666 @node FR30 Options
18667 @subsection FR30 Options
18668 @cindex FR30 Options
18670 These options are defined specifically for the FR30 port.
18672 @table @gcctabopt
18674 @item -msmall-model
18675 @opindex msmall-model
18676 Use the small address space model.  This can produce smaller code, but
18677 it does assume that all symbolic values and addresses fit into a
18678 20-bit range.
18680 @item -mno-lsim
18681 @opindex mno-lsim
18682 Assume that runtime support has been provided and so there is no need
18683 to include the simulator library (@file{libsim.a}) on the linker
18684 command line.
18686 @end table
18688 @node FT32 Options
18689 @subsection FT32 Options
18690 @cindex FT32 Options
18692 These options are defined specifically for the FT32 port.
18694 @table @gcctabopt
18696 @item -msim
18697 @opindex msim
18698 Specifies that the program will be run on the simulator.  This causes
18699 an alternate runtime startup and library to be linked.
18700 You must not use this option when generating programs that will run on
18701 real hardware; you must provide your own runtime library for whatever
18702 I/O functions are needed.
18704 @item -mlra
18705 @opindex mlra
18706 Enable Local Register Allocation.  This is still experimental for FT32,
18707 so by default the compiler uses standard reload.
18709 @item -mnodiv
18710 @opindex mnodiv
18711 Do not use div and mod instructions.
18713 @item -mft32b
18714 @opindex mft32b
18715 Enable use of the extended instructions of the FT32B processor.
18717 @item -mcompress
18718 @opindex mcompress
18719 Compress all code using the Ft32B code compression scheme.
18721 @item -mnopm
18722 @opindex  mnopm
18723 Do not generate code that reads program memory.
18725 @end table
18727 @node FRV Options
18728 @subsection FRV Options
18729 @cindex FRV Options
18731 @table @gcctabopt
18732 @item -mgpr-32
18733 @opindex mgpr-32
18735 Only use the first 32 general-purpose registers.
18737 @item -mgpr-64
18738 @opindex mgpr-64
18740 Use all 64 general-purpose registers.
18742 @item -mfpr-32
18743 @opindex mfpr-32
18745 Use only the first 32 floating-point registers.
18747 @item -mfpr-64
18748 @opindex mfpr-64
18750 Use all 64 floating-point registers.
18752 @item -mhard-float
18753 @opindex mhard-float
18755 Use hardware instructions for floating-point operations.
18757 @item -msoft-float
18758 @opindex msoft-float
18760 Use library routines for floating-point operations.
18762 @item -malloc-cc
18763 @opindex malloc-cc
18765 Dynamically allocate condition code registers.
18767 @item -mfixed-cc
18768 @opindex mfixed-cc
18770 Do not try to dynamically allocate condition code registers, only
18771 use @code{icc0} and @code{fcc0}.
18773 @item -mdword
18774 @opindex mdword
18776 Change ABI to use double word insns.
18778 @item -mno-dword
18779 @opindex mno-dword
18781 Do not use double word instructions.
18783 @item -mdouble
18784 @opindex mdouble
18786 Use floating-point double instructions.
18788 @item -mno-double
18789 @opindex mno-double
18791 Do not use floating-point double instructions.
18793 @item -mmedia
18794 @opindex mmedia
18796 Use media instructions.
18798 @item -mno-media
18799 @opindex mno-media
18801 Do not use media instructions.
18803 @item -mmuladd
18804 @opindex mmuladd
18806 Use multiply and add/subtract instructions.
18808 @item -mno-muladd
18809 @opindex mno-muladd
18811 Do not use multiply and add/subtract instructions.
18813 @item -mfdpic
18814 @opindex mfdpic
18816 Select the FDPIC ABI, which uses function descriptors to represent
18817 pointers to functions.  Without any PIC/PIE-related options, it
18818 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
18819 assumes GOT entries and small data are within a 12-bit range from the
18820 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
18821 are computed with 32 bits.
18822 With a @samp{bfin-elf} target, this option implies @option{-msim}.
18824 @item -minline-plt
18825 @opindex minline-plt
18827 Enable inlining of PLT entries in function calls to functions that are
18828 not known to bind locally.  It has no effect without @option{-mfdpic}.
18829 It's enabled by default if optimizing for speed and compiling for
18830 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
18831 optimization option such as @option{-O3} or above is present in the
18832 command line.
18834 @item -mTLS
18835 @opindex mTLS
18837 Assume a large TLS segment when generating thread-local code.
18839 @item -mtls
18840 @opindex mtls
18842 Do not assume a large TLS segment when generating thread-local code.
18844 @item -mgprel-ro
18845 @opindex mgprel-ro
18847 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
18848 that is known to be in read-only sections.  It's enabled by default,
18849 except for @option{-fpic} or @option{-fpie}: even though it may help
18850 make the global offset table smaller, it trades 1 instruction for 4.
18851 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
18852 one of which may be shared by multiple symbols, and it avoids the need
18853 for a GOT entry for the referenced symbol, so it's more likely to be a
18854 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
18856 @item -multilib-library-pic
18857 @opindex multilib-library-pic
18859 Link with the (library, not FD) pic libraries.  It's implied by
18860 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
18861 @option{-fpic} without @option{-mfdpic}.  You should never have to use
18862 it explicitly.
18864 @item -mlinked-fp
18865 @opindex mlinked-fp
18867 Follow the EABI requirement of always creating a frame pointer whenever
18868 a stack frame is allocated.  This option is enabled by default and can
18869 be disabled with @option{-mno-linked-fp}.
18871 @item -mlong-calls
18872 @opindex mlong-calls
18874 Use indirect addressing to call functions outside the current
18875 compilation unit.  This allows the functions to be placed anywhere
18876 within the 32-bit address space.
18878 @item -malign-labels
18879 @opindex malign-labels
18881 Try to align labels to an 8-byte boundary by inserting NOPs into the
18882 previous packet.  This option only has an effect when VLIW packing
18883 is enabled.  It doesn't create new packets; it merely adds NOPs to
18884 existing ones.
18886 @item -mlibrary-pic
18887 @opindex mlibrary-pic
18889 Generate position-independent EABI code.
18891 @item -macc-4
18892 @opindex macc-4
18894 Use only the first four media accumulator registers.
18896 @item -macc-8
18897 @opindex macc-8
18899 Use all eight media accumulator registers.
18901 @item -mpack
18902 @opindex mpack
18904 Pack VLIW instructions.
18906 @item -mno-pack
18907 @opindex mno-pack
18909 Do not pack VLIW instructions.
18911 @item -mno-eflags
18912 @opindex mno-eflags
18914 Do not mark ABI switches in e_flags.
18916 @item -mcond-move
18917 @opindex mcond-move
18919 Enable the use of conditional-move instructions (default).
18921 This switch is mainly for debugging the compiler and will likely be removed
18922 in a future version.
18924 @item -mno-cond-move
18925 @opindex mno-cond-move
18927 Disable the use of conditional-move instructions.
18929 This switch is mainly for debugging the compiler and will likely be removed
18930 in a future version.
18932 @item -mscc
18933 @opindex mscc
18935 Enable the use of conditional set instructions (default).
18937 This switch is mainly for debugging the compiler and will likely be removed
18938 in a future version.
18940 @item -mno-scc
18941 @opindex mno-scc
18943 Disable the use of conditional set instructions.
18945 This switch is mainly for debugging the compiler and will likely be removed
18946 in a future version.
18948 @item -mcond-exec
18949 @opindex mcond-exec
18951 Enable the use of conditional execution (default).
18953 This switch is mainly for debugging the compiler and will likely be removed
18954 in a future version.
18956 @item -mno-cond-exec
18957 @opindex mno-cond-exec
18959 Disable the use of conditional execution.
18961 This switch is mainly for debugging the compiler and will likely be removed
18962 in a future version.
18964 @item -mvliw-branch
18965 @opindex mvliw-branch
18967 Run a pass to pack branches into VLIW instructions (default).
18969 This switch is mainly for debugging the compiler and will likely be removed
18970 in a future version.
18972 @item -mno-vliw-branch
18973 @opindex mno-vliw-branch
18975 Do not run a pass to pack branches into VLIW instructions.
18977 This switch is mainly for debugging the compiler and will likely be removed
18978 in a future version.
18980 @item -mmulti-cond-exec
18981 @opindex mmulti-cond-exec
18983 Enable optimization of @code{&&} and @code{||} in conditional execution
18984 (default).
18986 This switch is mainly for debugging the compiler and will likely be removed
18987 in a future version.
18989 @item -mno-multi-cond-exec
18990 @opindex mno-multi-cond-exec
18992 Disable optimization of @code{&&} and @code{||} in conditional execution.
18994 This switch is mainly for debugging the compiler and will likely be removed
18995 in a future version.
18997 @item -mnested-cond-exec
18998 @opindex mnested-cond-exec
19000 Enable nested conditional execution optimizations (default).
19002 This switch is mainly for debugging the compiler and will likely be removed
19003 in a future version.
19005 @item -mno-nested-cond-exec
19006 @opindex mno-nested-cond-exec
19008 Disable nested conditional execution optimizations.
19010 This switch is mainly for debugging the compiler and will likely be removed
19011 in a future version.
19013 @item -moptimize-membar
19014 @opindex moptimize-membar
19016 This switch removes redundant @code{membar} instructions from the
19017 compiler-generated code.  It is enabled by default.
19019 @item -mno-optimize-membar
19020 @opindex mno-optimize-membar
19022 This switch disables the automatic removal of redundant @code{membar}
19023 instructions from the generated code.
19025 @item -mtomcat-stats
19026 @opindex mtomcat-stats
19028 Cause gas to print out tomcat statistics.
19030 @item -mcpu=@var{cpu}
19031 @opindex mcpu
19033 Select the processor type for which to generate code.  Possible values are
19034 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
19035 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
19037 @end table
19039 @node GNU/Linux Options
19040 @subsection GNU/Linux Options
19042 These @samp{-m} options are defined for GNU/Linux targets:
19044 @table @gcctabopt
19045 @item -mglibc
19046 @opindex mglibc
19047 Use the GNU C library.  This is the default except
19048 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
19049 @samp{*-*-linux-*android*} targets.
19051 @item -muclibc
19052 @opindex muclibc
19053 Use uClibc C library.  This is the default on
19054 @samp{*-*-linux-*uclibc*} targets.
19056 @item -mmusl
19057 @opindex mmusl
19058 Use the musl C library.  This is the default on
19059 @samp{*-*-linux-*musl*} targets.
19061 @item -mbionic
19062 @opindex mbionic
19063 Use Bionic C library.  This is the default on
19064 @samp{*-*-linux-*android*} targets.
19066 @item -mandroid
19067 @opindex mandroid
19068 Compile code compatible with Android platform.  This is the default on
19069 @samp{*-*-linux-*android*} targets.
19071 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
19072 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
19073 this option makes the GCC driver pass Android-specific options to the linker.
19074 Finally, this option causes the preprocessor macro @code{__ANDROID__}
19075 to be defined.
19077 @item -tno-android-cc
19078 @opindex tno-android-cc
19079 Disable compilation effects of @option{-mandroid}, i.e., do not enable
19080 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
19081 @option{-fno-rtti} by default.
19083 @item -tno-android-ld
19084 @opindex tno-android-ld
19085 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
19086 linking options to the linker.
19088 @end table
19090 @node H8/300 Options
19091 @subsection H8/300 Options
19093 These @samp{-m} options are defined for the H8/300 implementations:
19095 @table @gcctabopt
19096 @item -mrelax
19097 @opindex mrelax
19098 Shorten some address references at link time, when possible; uses the
19099 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
19100 ld, Using ld}, for a fuller description.
19102 @item -mh
19103 @opindex mh
19104 Generate code for the H8/300H@.
19106 @item -ms
19107 @opindex ms
19108 Generate code for the H8S@.
19110 @item -mn
19111 @opindex mn
19112 Generate code for the H8S and H8/300H in the normal mode.  This switch
19113 must be used either with @option{-mh} or @option{-ms}.
19115 @item -ms2600
19116 @opindex ms2600
19117 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
19119 @item -mexr
19120 @opindex mexr
19121 Extended registers are stored on stack before execution of function
19122 with monitor attribute. Default option is @option{-mexr}.
19123 This option is valid only for H8S targets.
19125 @item -mno-exr
19126 @opindex mno-exr
19127 Extended registers are not stored on stack before execution of function 
19128 with monitor attribute. Default option is @option{-mno-exr}. 
19129 This option is valid only for H8S targets.
19131 @item -mint32
19132 @opindex mint32
19133 Make @code{int} data 32 bits by default.
19135 @item -malign-300
19136 @opindex malign-300
19137 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
19138 The default for the H8/300H and H8S is to align longs and floats on
19139 4-byte boundaries.
19140 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
19141 This option has no effect on the H8/300.
19142 @end table
19144 @node HPPA Options
19145 @subsection HPPA Options
19146 @cindex HPPA Options
19148 These @samp{-m} options are defined for the HPPA family of computers:
19150 @table @gcctabopt
19151 @item -march=@var{architecture-type}
19152 @opindex march
19153 Generate code for the specified architecture.  The choices for
19154 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
19155 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
19156 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
19157 architecture option for your machine.  Code compiled for lower numbered
19158 architectures runs on higher numbered architectures, but not the
19159 other way around.
19161 @item -mpa-risc-1-0
19162 @itemx -mpa-risc-1-1
19163 @itemx -mpa-risc-2-0
19164 @opindex mpa-risc-1-0
19165 @opindex mpa-risc-1-1
19166 @opindex mpa-risc-2-0
19167 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
19169 @item -mcaller-copies
19170 @opindex mcaller-copies
19171 The caller copies function arguments passed by hidden reference.  This
19172 option should be used with care as it is not compatible with the default
19173 32-bit runtime.  However, only aggregates larger than eight bytes are
19174 passed by hidden reference and the option provides better compatibility
19175 with OpenMP.
19177 @item -mjump-in-delay
19178 @opindex mjump-in-delay
19179 This option is ignored and provided for compatibility purposes only.
19181 @item -mdisable-fpregs
19182 @opindex mdisable-fpregs
19183 Prevent floating-point registers from being used in any manner.  This is
19184 necessary for compiling kernels that perform lazy context switching of
19185 floating-point registers.  If you use this option and attempt to perform
19186 floating-point operations, the compiler aborts.
19188 @item -mdisable-indexing
19189 @opindex mdisable-indexing
19190 Prevent the compiler from using indexing address modes.  This avoids some
19191 rather obscure problems when compiling MIG generated code under MACH@.
19193 @item -mno-space-regs
19194 @opindex mno-space-regs
19195 Generate code that assumes the target has no space registers.  This allows
19196 GCC to generate faster indirect calls and use unscaled index address modes.
19198 Such code is suitable for level 0 PA systems and kernels.
19200 @item -mfast-indirect-calls
19201 @opindex mfast-indirect-calls
19202 Generate code that assumes calls never cross space boundaries.  This
19203 allows GCC to emit code that performs faster indirect calls.
19205 This option does not work in the presence of shared libraries or nested
19206 functions.
19208 @item -mfixed-range=@var{register-range}
19209 @opindex mfixed-range
19210 Generate code treating the given register range as fixed registers.
19211 A fixed register is one that the register allocator cannot use.  This is
19212 useful when compiling kernel code.  A register range is specified as
19213 two registers separated by a dash.  Multiple register ranges can be
19214 specified separated by a comma.
19216 @item -mlong-load-store
19217 @opindex mlong-load-store
19218 Generate 3-instruction load and store sequences as sometimes required by
19219 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
19220 the HP compilers.
19222 @item -mportable-runtime
19223 @opindex mportable-runtime
19224 Use the portable calling conventions proposed by HP for ELF systems.
19226 @item -mgas
19227 @opindex mgas
19228 Enable the use of assembler directives only GAS understands.
19230 @item -mschedule=@var{cpu-type}
19231 @opindex mschedule
19232 Schedule code according to the constraints for the machine type
19233 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
19234 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
19235 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
19236 proper scheduling option for your machine.  The default scheduling is
19237 @samp{8000}.
19239 @item -mlinker-opt
19240 @opindex mlinker-opt
19241 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
19242 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
19243 linkers in which they give bogus error messages when linking some programs.
19245 @item -msoft-float
19246 @opindex msoft-float
19247 Generate output containing library calls for floating point.
19248 @strong{Warning:} the requisite libraries are not available for all HPPA
19249 targets.  Normally the facilities of the machine's usual C compiler are
19250 used, but this cannot be done directly in cross-compilation.  You must make
19251 your own arrangements to provide suitable library functions for
19252 cross-compilation.
19254 @option{-msoft-float} changes the calling convention in the output file;
19255 therefore, it is only useful if you compile @emph{all} of a program with
19256 this option.  In particular, you need to compile @file{libgcc.a}, the
19257 library that comes with GCC, with @option{-msoft-float} in order for
19258 this to work.
19260 @item -msio
19261 @opindex msio
19262 Generate the predefine, @code{_SIO}, for server IO@.  The default is
19263 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
19264 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
19265 options are available under HP-UX and HI-UX@.
19267 @item -mgnu-ld
19268 @opindex mgnu-ld
19269 Use options specific to GNU @command{ld}.
19270 This passes @option{-shared} to @command{ld} when
19271 building a shared library.  It is the default when GCC is configured,
19272 explicitly or implicitly, with the GNU linker.  This option does not
19273 affect which @command{ld} is called; it only changes what parameters
19274 are passed to that @command{ld}.
19275 The @command{ld} that is called is determined by the
19276 @option{--with-ld} configure option, GCC's program search path, and
19277 finally by the user's @env{PATH}.  The linker used by GCC can be printed
19278 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
19279 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
19281 @item -mhp-ld
19282 @opindex mhp-ld
19283 Use options specific to HP @command{ld}.
19284 This passes @option{-b} to @command{ld} when building
19285 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
19286 links.  It is the default when GCC is configured, explicitly or
19287 implicitly, with the HP linker.  This option does not affect
19288 which @command{ld} is called; it only changes what parameters are passed to that
19289 @command{ld}.
19290 The @command{ld} that is called is determined by the @option{--with-ld}
19291 configure option, GCC's program search path, and finally by the user's
19292 @env{PATH}.  The linker used by GCC can be printed using @samp{which
19293 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
19294 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
19296 @item -mlong-calls
19297 @opindex mno-long-calls
19298 Generate code that uses long call sequences.  This ensures that a call
19299 is always able to reach linker generated stubs.  The default is to generate
19300 long calls only when the distance from the call site to the beginning
19301 of the function or translation unit, as the case may be, exceeds a
19302 predefined limit set by the branch type being used.  The limits for
19303 normal calls are 7,600,000 and 240,000 bytes, respectively for the
19304 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
19305 240,000 bytes.
19307 Distances are measured from the beginning of functions when using the
19308 @option{-ffunction-sections} option, or when using the @option{-mgas}
19309 and @option{-mno-portable-runtime} options together under HP-UX with
19310 the SOM linker.
19312 It is normally not desirable to use this option as it degrades
19313 performance.  However, it may be useful in large applications,
19314 particularly when partial linking is used to build the application.
19316 The types of long calls used depends on the capabilities of the
19317 assembler and linker, and the type of code being generated.  The
19318 impact on systems that support long absolute calls, and long pic
19319 symbol-difference or pc-relative calls should be relatively small.
19320 However, an indirect call is used on 32-bit ELF systems in pic code
19321 and it is quite long.
19323 @item -munix=@var{unix-std}
19324 @opindex march
19325 Generate compiler predefines and select a startfile for the specified
19326 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
19327 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
19328 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
19329 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
19330 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
19331 and later.
19333 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
19334 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
19335 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
19336 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
19337 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
19338 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
19340 It is @emph{important} to note that this option changes the interfaces
19341 for various library routines.  It also affects the operational behavior
19342 of the C library.  Thus, @emph{extreme} care is needed in using this
19343 option.
19345 Library code that is intended to operate with more than one UNIX
19346 standard must test, set and restore the variable @code{__xpg4_extended_mask}
19347 as appropriate.  Most GNU software doesn't provide this capability.
19349 @item -nolibdld
19350 @opindex nolibdld
19351 Suppress the generation of link options to search libdld.sl when the
19352 @option{-static} option is specified on HP-UX 10 and later.
19354 @item -static
19355 @opindex static
19356 The HP-UX implementation of setlocale in libc has a dependency on
19357 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
19358 when the @option{-static} option is specified, special link options
19359 are needed to resolve this dependency.
19361 On HP-UX 10 and later, the GCC driver adds the necessary options to
19362 link with libdld.sl when the @option{-static} option is specified.
19363 This causes the resulting binary to be dynamic.  On the 64-bit port,
19364 the linkers generate dynamic binaries by default in any case.  The
19365 @option{-nolibdld} option can be used to prevent the GCC driver from
19366 adding these link options.
19368 @item -threads
19369 @opindex threads
19370 Add support for multithreading with the @dfn{dce thread} library
19371 under HP-UX@.  This option sets flags for both the preprocessor and
19372 linker.
19373 @end table
19375 @node IA-64 Options
19376 @subsection IA-64 Options
19377 @cindex IA-64 Options
19379 These are the @samp{-m} options defined for the Intel IA-64 architecture.
19381 @table @gcctabopt
19382 @item -mbig-endian
19383 @opindex mbig-endian
19384 Generate code for a big-endian target.  This is the default for HP-UX@.
19386 @item -mlittle-endian
19387 @opindex mlittle-endian
19388 Generate code for a little-endian target.  This is the default for AIX5
19389 and GNU/Linux.
19391 @item -mgnu-as
19392 @itemx -mno-gnu-as
19393 @opindex mgnu-as
19394 @opindex mno-gnu-as
19395 Generate (or don't) code for the GNU assembler.  This is the default.
19396 @c Also, this is the default if the configure option @option{--with-gnu-as}
19397 @c is used.
19399 @item -mgnu-ld
19400 @itemx -mno-gnu-ld
19401 @opindex mgnu-ld
19402 @opindex mno-gnu-ld
19403 Generate (or don't) code for the GNU linker.  This is the default.
19404 @c Also, this is the default if the configure option @option{--with-gnu-ld}
19405 @c is used.
19407 @item -mno-pic
19408 @opindex mno-pic
19409 Generate code that does not use a global pointer register.  The result
19410 is not position independent code, and violates the IA-64 ABI@.
19412 @item -mvolatile-asm-stop
19413 @itemx -mno-volatile-asm-stop
19414 @opindex mvolatile-asm-stop
19415 @opindex mno-volatile-asm-stop
19416 Generate (or don't) a stop bit immediately before and after volatile asm
19417 statements.
19419 @item -mregister-names
19420 @itemx -mno-register-names
19421 @opindex mregister-names
19422 @opindex mno-register-names
19423 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
19424 the stacked registers.  This may make assembler output more readable.
19426 @item -mno-sdata
19427 @itemx -msdata
19428 @opindex mno-sdata
19429 @opindex msdata
19430 Disable (or enable) optimizations that use the small data section.  This may
19431 be useful for working around optimizer bugs.
19433 @item -mconstant-gp
19434 @opindex mconstant-gp
19435 Generate code that uses a single constant global pointer value.  This is
19436 useful when compiling kernel code.
19438 @item -mauto-pic
19439 @opindex mauto-pic
19440 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
19441 This is useful when compiling firmware code.
19443 @item -minline-float-divide-min-latency
19444 @opindex minline-float-divide-min-latency
19445 Generate code for inline divides of floating-point values
19446 using the minimum latency algorithm.
19448 @item -minline-float-divide-max-throughput
19449 @opindex minline-float-divide-max-throughput
19450 Generate code for inline divides of floating-point values
19451 using the maximum throughput algorithm.
19453 @item -mno-inline-float-divide
19454 @opindex mno-inline-float-divide
19455 Do not generate inline code for divides of floating-point values.
19457 @item -minline-int-divide-min-latency
19458 @opindex minline-int-divide-min-latency
19459 Generate code for inline divides of integer values
19460 using the minimum latency algorithm.
19462 @item -minline-int-divide-max-throughput
19463 @opindex minline-int-divide-max-throughput
19464 Generate code for inline divides of integer values
19465 using the maximum throughput algorithm.
19467 @item -mno-inline-int-divide
19468 @opindex mno-inline-int-divide
19469 Do not generate inline code for divides of integer values.
19471 @item -minline-sqrt-min-latency
19472 @opindex minline-sqrt-min-latency
19473 Generate code for inline square roots
19474 using the minimum latency algorithm.
19476 @item -minline-sqrt-max-throughput
19477 @opindex minline-sqrt-max-throughput
19478 Generate code for inline square roots
19479 using the maximum throughput algorithm.
19481 @item -mno-inline-sqrt
19482 @opindex mno-inline-sqrt
19483 Do not generate inline code for @code{sqrt}.
19485 @item -mfused-madd
19486 @itemx -mno-fused-madd
19487 @opindex mfused-madd
19488 @opindex mno-fused-madd
19489 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
19490 instructions.  The default is to use these instructions.
19492 @item -mno-dwarf2-asm
19493 @itemx -mdwarf2-asm
19494 @opindex mno-dwarf2-asm
19495 @opindex mdwarf2-asm
19496 Don't (or do) generate assembler code for the DWARF line number debugging
19497 info.  This may be useful when not using the GNU assembler.
19499 @item -mearly-stop-bits
19500 @itemx -mno-early-stop-bits
19501 @opindex mearly-stop-bits
19502 @opindex mno-early-stop-bits
19503 Allow stop bits to be placed earlier than immediately preceding the
19504 instruction that triggered the stop bit.  This can improve instruction
19505 scheduling, but does not always do so.
19507 @item -mfixed-range=@var{register-range}
19508 @opindex mfixed-range
19509 Generate code treating the given register range as fixed registers.
19510 A fixed register is one that the register allocator cannot use.  This is
19511 useful when compiling kernel code.  A register range is specified as
19512 two registers separated by a dash.  Multiple register ranges can be
19513 specified separated by a comma.
19515 @item -mtls-size=@var{tls-size}
19516 @opindex mtls-size
19517 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
19520 @item -mtune=@var{cpu-type}
19521 @opindex mtune
19522 Tune the instruction scheduling for a particular CPU, Valid values are
19523 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
19524 and @samp{mckinley}.
19526 @item -milp32
19527 @itemx -mlp64
19528 @opindex milp32
19529 @opindex mlp64
19530 Generate code for a 32-bit or 64-bit environment.
19531 The 32-bit environment sets int, long and pointer to 32 bits.
19532 The 64-bit environment sets int to 32 bits and long and pointer
19533 to 64 bits.  These are HP-UX specific flags.
19535 @item -mno-sched-br-data-spec
19536 @itemx -msched-br-data-spec
19537 @opindex mno-sched-br-data-spec
19538 @opindex msched-br-data-spec
19539 (Dis/En)able data speculative scheduling before reload.
19540 This results in generation of @code{ld.a} instructions and
19541 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
19542 The default setting is disabled.
19544 @item -msched-ar-data-spec
19545 @itemx -mno-sched-ar-data-spec
19546 @opindex msched-ar-data-spec
19547 @opindex mno-sched-ar-data-spec
19548 (En/Dis)able data speculative scheduling after reload.
19549 This results in generation of @code{ld.a} instructions and
19550 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
19551 The default setting is enabled.
19553 @item -mno-sched-control-spec
19554 @itemx -msched-control-spec
19555 @opindex mno-sched-control-spec
19556 @opindex msched-control-spec
19557 (Dis/En)able control speculative scheduling.  This feature is
19558 available only during region scheduling (i.e.@: before reload).
19559 This results in generation of the @code{ld.s} instructions and
19560 the corresponding check instructions @code{chk.s}.
19561 The default setting is disabled.
19563 @item -msched-br-in-data-spec
19564 @itemx -mno-sched-br-in-data-spec
19565 @opindex msched-br-in-data-spec
19566 @opindex mno-sched-br-in-data-spec
19567 (En/Dis)able speculative scheduling of the instructions that
19568 are dependent on the data speculative loads before reload.
19569 This is effective only with @option{-msched-br-data-spec} enabled.
19570 The default setting is enabled.
19572 @item -msched-ar-in-data-spec
19573 @itemx -mno-sched-ar-in-data-spec
19574 @opindex msched-ar-in-data-spec
19575 @opindex mno-sched-ar-in-data-spec
19576 (En/Dis)able speculative scheduling of the instructions that
19577 are dependent on the data speculative loads after reload.
19578 This is effective only with @option{-msched-ar-data-spec} enabled.
19579 The default setting is enabled.
19581 @item -msched-in-control-spec
19582 @itemx -mno-sched-in-control-spec
19583 @opindex msched-in-control-spec
19584 @opindex mno-sched-in-control-spec
19585 (En/Dis)able speculative scheduling of the instructions that
19586 are dependent on the control speculative loads.
19587 This is effective only with @option{-msched-control-spec} enabled.
19588 The default setting is enabled.
19590 @item -mno-sched-prefer-non-data-spec-insns
19591 @itemx -msched-prefer-non-data-spec-insns
19592 @opindex mno-sched-prefer-non-data-spec-insns
19593 @opindex msched-prefer-non-data-spec-insns
19594 If enabled, data-speculative instructions are chosen for schedule
19595 only if there are no other choices at the moment.  This makes
19596 the use of the data speculation much more conservative.
19597 The default setting is disabled.
19599 @item -mno-sched-prefer-non-control-spec-insns
19600 @itemx -msched-prefer-non-control-spec-insns
19601 @opindex mno-sched-prefer-non-control-spec-insns
19602 @opindex msched-prefer-non-control-spec-insns
19603 If enabled, control-speculative instructions are chosen for schedule
19604 only if there are no other choices at the moment.  This makes
19605 the use of the control speculation much more conservative.
19606 The default setting is disabled.
19608 @item -mno-sched-count-spec-in-critical-path
19609 @itemx -msched-count-spec-in-critical-path
19610 @opindex mno-sched-count-spec-in-critical-path
19611 @opindex msched-count-spec-in-critical-path
19612 If enabled, speculative dependencies are considered during
19613 computation of the instructions priorities.  This makes the use of the
19614 speculation a bit more conservative.
19615 The default setting is disabled.
19617 @item -msched-spec-ldc
19618 @opindex msched-spec-ldc
19619 Use a simple data speculation check.  This option is on by default.
19621 @item -msched-control-spec-ldc
19622 @opindex msched-spec-ldc
19623 Use a simple check for control speculation.  This option is on by default.
19625 @item -msched-stop-bits-after-every-cycle
19626 @opindex msched-stop-bits-after-every-cycle
19627 Place a stop bit after every cycle when scheduling.  This option is on
19628 by default.
19630 @item -msched-fp-mem-deps-zero-cost
19631 @opindex msched-fp-mem-deps-zero-cost
19632 Assume that floating-point stores and loads are not likely to cause a conflict
19633 when placed into the same instruction group.  This option is disabled by
19634 default.
19636 @item -msel-sched-dont-check-control-spec
19637 @opindex msel-sched-dont-check-control-spec
19638 Generate checks for control speculation in selective scheduling.
19639 This flag is disabled by default.
19641 @item -msched-max-memory-insns=@var{max-insns}
19642 @opindex msched-max-memory-insns
19643 Limit on the number of memory insns per instruction group, giving lower
19644 priority to subsequent memory insns attempting to schedule in the same
19645 instruction group. Frequently useful to prevent cache bank conflicts.
19646 The default value is 1.
19648 @item -msched-max-memory-insns-hard-limit
19649 @opindex msched-max-memory-insns-hard-limit
19650 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
19651 disallowing more than that number in an instruction group.
19652 Otherwise, the limit is ``soft'', meaning that non-memory operations
19653 are preferred when the limit is reached, but memory operations may still
19654 be scheduled.
19656 @end table
19658 @node LM32 Options
19659 @subsection LM32 Options
19660 @cindex LM32 options
19662 These @option{-m} options are defined for the LatticeMico32 architecture:
19664 @table @gcctabopt
19665 @item -mbarrel-shift-enabled
19666 @opindex mbarrel-shift-enabled
19667 Enable barrel-shift instructions.
19669 @item -mdivide-enabled
19670 @opindex mdivide-enabled
19671 Enable divide and modulus instructions.
19673 @item -mmultiply-enabled
19674 @opindex multiply-enabled
19675 Enable multiply instructions.
19677 @item -msign-extend-enabled
19678 @opindex msign-extend-enabled
19679 Enable sign extend instructions.
19681 @item -muser-enabled
19682 @opindex muser-enabled
19683 Enable user-defined instructions.
19685 @end table
19687 @node M32C Options
19688 @subsection M32C Options
19689 @cindex M32C options
19691 @table @gcctabopt
19692 @item -mcpu=@var{name}
19693 @opindex mcpu=
19694 Select the CPU for which code is generated.  @var{name} may be one of
19695 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
19696 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
19697 the M32C/80 series.
19699 @item -msim
19700 @opindex msim
19701 Specifies that the program will be run on the simulator.  This causes
19702 an alternate runtime library to be linked in which supports, for
19703 example, file I/O@.  You must not use this option when generating
19704 programs that will run on real hardware; you must provide your own
19705 runtime library for whatever I/O functions are needed.
19707 @item -memregs=@var{number}
19708 @opindex memregs=
19709 Specifies the number of memory-based pseudo-registers GCC uses
19710 during code generation.  These pseudo-registers are used like real
19711 registers, so there is a tradeoff between GCC's ability to fit the
19712 code into available registers, and the performance penalty of using
19713 memory instead of registers.  Note that all modules in a program must
19714 be compiled with the same value for this option.  Because of that, you
19715 must not use this option with GCC's default runtime libraries.
19717 @end table
19719 @node M32R/D Options
19720 @subsection M32R/D Options
19721 @cindex M32R/D options
19723 These @option{-m} options are defined for Renesas M32R/D architectures:
19725 @table @gcctabopt
19726 @item -m32r2
19727 @opindex m32r2
19728 Generate code for the M32R/2@.
19730 @item -m32rx
19731 @opindex m32rx
19732 Generate code for the M32R/X@.
19734 @item -m32r
19735 @opindex m32r
19736 Generate code for the M32R@.  This is the default.
19738 @item -mmodel=small
19739 @opindex mmodel=small
19740 Assume all objects live in the lower 16MB of memory (so that their addresses
19741 can be loaded with the @code{ld24} instruction), and assume all subroutines
19742 are reachable with the @code{bl} instruction.
19743 This is the default.
19745 The addressability of a particular object can be set with the
19746 @code{model} attribute.
19748 @item -mmodel=medium
19749 @opindex mmodel=medium
19750 Assume objects may be anywhere in the 32-bit address space (the compiler
19751 generates @code{seth/add3} instructions to load their addresses), and
19752 assume all subroutines are reachable with the @code{bl} instruction.
19754 @item -mmodel=large
19755 @opindex mmodel=large
19756 Assume objects may be anywhere in the 32-bit address space (the compiler
19757 generates @code{seth/add3} instructions to load their addresses), and
19758 assume subroutines may not be reachable with the @code{bl} instruction
19759 (the compiler generates the much slower @code{seth/add3/jl}
19760 instruction sequence).
19762 @item -msdata=none
19763 @opindex msdata=none
19764 Disable use of the small data area.  Variables are put into
19765 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
19766 @code{section} attribute has been specified).
19767 This is the default.
19769 The small data area consists of sections @code{.sdata} and @code{.sbss}.
19770 Objects may be explicitly put in the small data area with the
19771 @code{section} attribute using one of these sections.
19773 @item -msdata=sdata
19774 @opindex msdata=sdata
19775 Put small global and static data in the small data area, but do not
19776 generate special code to reference them.
19778 @item -msdata=use
19779 @opindex msdata=use
19780 Put small global and static data in the small data area, and generate
19781 special instructions to reference them.
19783 @item -G @var{num}
19784 @opindex G
19785 @cindex smaller data references
19786 Put global and static objects less than or equal to @var{num} bytes
19787 into the small data or BSS sections instead of the normal data or BSS
19788 sections.  The default value of @var{num} is 8.
19789 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
19790 for this option to have any effect.
19792 All modules should be compiled with the same @option{-G @var{num}} value.
19793 Compiling with different values of @var{num} may or may not work; if it
19794 doesn't the linker gives an error message---incorrect code is not
19795 generated.
19797 @item -mdebug
19798 @opindex mdebug
19799 Makes the M32R-specific code in the compiler display some statistics
19800 that might help in debugging programs.
19802 @item -malign-loops
19803 @opindex malign-loops
19804 Align all loops to a 32-byte boundary.
19806 @item -mno-align-loops
19807 @opindex mno-align-loops
19808 Do not enforce a 32-byte alignment for loops.  This is the default.
19810 @item -missue-rate=@var{number}
19811 @opindex missue-rate=@var{number}
19812 Issue @var{number} instructions per cycle.  @var{number} can only be 1
19813 or 2.
19815 @item -mbranch-cost=@var{number}
19816 @opindex mbranch-cost=@var{number}
19817 @var{number} can only be 1 or 2.  If it is 1 then branches are
19818 preferred over conditional code, if it is 2, then the opposite applies.
19820 @item -mflush-trap=@var{number}
19821 @opindex mflush-trap=@var{number}
19822 Specifies the trap number to use to flush the cache.  The default is
19823 12.  Valid numbers are between 0 and 15 inclusive.
19825 @item -mno-flush-trap
19826 @opindex mno-flush-trap
19827 Specifies that the cache cannot be flushed by using a trap.
19829 @item -mflush-func=@var{name}
19830 @opindex mflush-func=@var{name}
19831 Specifies the name of the operating system function to call to flush
19832 the cache.  The default is @samp{_flush_cache}, but a function call
19833 is only used if a trap is not available.
19835 @item -mno-flush-func
19836 @opindex mno-flush-func
19837 Indicates that there is no OS function for flushing the cache.
19839 @end table
19841 @node M680x0 Options
19842 @subsection M680x0 Options
19843 @cindex M680x0 options
19845 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
19846 The default settings depend on which architecture was selected when
19847 the compiler was configured; the defaults for the most common choices
19848 are given below.
19850 @table @gcctabopt
19851 @item -march=@var{arch}
19852 @opindex march
19853 Generate code for a specific M680x0 or ColdFire instruction set
19854 architecture.  Permissible values of @var{arch} for M680x0
19855 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
19856 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
19857 architectures are selected according to Freescale's ISA classification
19858 and the permissible values are: @samp{isaa}, @samp{isaaplus},
19859 @samp{isab} and @samp{isac}.
19861 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
19862 code for a ColdFire target.  The @var{arch} in this macro is one of the
19863 @option{-march} arguments given above.
19865 When used together, @option{-march} and @option{-mtune} select code
19866 that runs on a family of similar processors but that is optimized
19867 for a particular microarchitecture.
19869 @item -mcpu=@var{cpu}
19870 @opindex mcpu
19871 Generate code for a specific M680x0 or ColdFire processor.
19872 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
19873 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
19874 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
19875 below, which also classifies the CPUs into families:
19877 @multitable @columnfractions 0.20 0.80
19878 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
19879 @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}
19880 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
19881 @item @samp{5206e} @tab @samp{5206e}
19882 @item @samp{5208} @tab @samp{5207} @samp{5208}
19883 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
19884 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
19885 @item @samp{5216} @tab @samp{5214} @samp{5216}
19886 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
19887 @item @samp{5225} @tab @samp{5224} @samp{5225}
19888 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
19889 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
19890 @item @samp{5249} @tab @samp{5249}
19891 @item @samp{5250} @tab @samp{5250}
19892 @item @samp{5271} @tab @samp{5270} @samp{5271}
19893 @item @samp{5272} @tab @samp{5272}
19894 @item @samp{5275} @tab @samp{5274} @samp{5275}
19895 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
19896 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
19897 @item @samp{5307} @tab @samp{5307}
19898 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
19899 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
19900 @item @samp{5407} @tab @samp{5407}
19901 @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}
19902 @end multitable
19904 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
19905 @var{arch} is compatible with @var{cpu}.  Other combinations of
19906 @option{-mcpu} and @option{-march} are rejected.
19908 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
19909 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
19910 where the value of @var{family} is given by the table above.
19912 @item -mtune=@var{tune}
19913 @opindex mtune
19914 Tune the code for a particular microarchitecture within the
19915 constraints set by @option{-march} and @option{-mcpu}.
19916 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
19917 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
19918 and @samp{cpu32}.  The ColdFire microarchitectures
19919 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
19921 You can also use @option{-mtune=68020-40} for code that needs
19922 to run relatively well on 68020, 68030 and 68040 targets.
19923 @option{-mtune=68020-60} is similar but includes 68060 targets
19924 as well.  These two options select the same tuning decisions as
19925 @option{-m68020-40} and @option{-m68020-60} respectively.
19927 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
19928 when tuning for 680x0 architecture @var{arch}.  It also defines
19929 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
19930 option is used.  If GCC is tuning for a range of architectures,
19931 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
19932 it defines the macros for every architecture in the range.
19934 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
19935 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
19936 of the arguments given above.
19938 @item -m68000
19939 @itemx -mc68000
19940 @opindex m68000
19941 @opindex mc68000
19942 Generate output for a 68000.  This is the default
19943 when the compiler is configured for 68000-based systems.
19944 It is equivalent to @option{-march=68000}.
19946 Use this option for microcontrollers with a 68000 or EC000 core,
19947 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
19949 @item -m68010
19950 @opindex m68010
19951 Generate output for a 68010.  This is the default
19952 when the compiler is configured for 68010-based systems.
19953 It is equivalent to @option{-march=68010}.
19955 @item -m68020
19956 @itemx -mc68020
19957 @opindex m68020
19958 @opindex mc68020
19959 Generate output for a 68020.  This is the default
19960 when the compiler is configured for 68020-based systems.
19961 It is equivalent to @option{-march=68020}.
19963 @item -m68030
19964 @opindex m68030
19965 Generate output for a 68030.  This is the default when the compiler is
19966 configured for 68030-based systems.  It is equivalent to
19967 @option{-march=68030}.
19969 @item -m68040
19970 @opindex m68040
19971 Generate output for a 68040.  This is the default when the compiler is
19972 configured for 68040-based systems.  It is equivalent to
19973 @option{-march=68040}.
19975 This option inhibits the use of 68881/68882 instructions that have to be
19976 emulated by software on the 68040.  Use this option if your 68040 does not
19977 have code to emulate those instructions.
19979 @item -m68060
19980 @opindex m68060
19981 Generate output for a 68060.  This is the default when the compiler is
19982 configured for 68060-based systems.  It is equivalent to
19983 @option{-march=68060}.
19985 This option inhibits the use of 68020 and 68881/68882 instructions that
19986 have to be emulated by software on the 68060.  Use this option if your 68060
19987 does not have code to emulate those instructions.
19989 @item -mcpu32
19990 @opindex mcpu32
19991 Generate output for a CPU32.  This is the default
19992 when the compiler is configured for CPU32-based systems.
19993 It is equivalent to @option{-march=cpu32}.
19995 Use this option for microcontrollers with a
19996 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
19997 68336, 68340, 68341, 68349 and 68360.
19999 @item -m5200
20000 @opindex m5200
20001 Generate output for a 520X ColdFire CPU@.  This is the default
20002 when the compiler is configured for 520X-based systems.
20003 It is equivalent to @option{-mcpu=5206}, and is now deprecated
20004 in favor of that option.
20006 Use this option for microcontroller with a 5200 core, including
20007 the MCF5202, MCF5203, MCF5204 and MCF5206.
20009 @item -m5206e
20010 @opindex m5206e
20011 Generate output for a 5206e ColdFire CPU@.  The option is now
20012 deprecated in favor of the equivalent @option{-mcpu=5206e}.
20014 @item -m528x
20015 @opindex m528x
20016 Generate output for a member of the ColdFire 528X family.
20017 The option is now deprecated in favor of the equivalent
20018 @option{-mcpu=528x}.
20020 @item -m5307
20021 @opindex m5307
20022 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
20023 in favor of the equivalent @option{-mcpu=5307}.
20025 @item -m5407
20026 @opindex m5407
20027 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
20028 in favor of the equivalent @option{-mcpu=5407}.
20030 @item -mcfv4e
20031 @opindex mcfv4e
20032 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
20033 This includes use of hardware floating-point instructions.
20034 The option is equivalent to @option{-mcpu=547x}, and is now
20035 deprecated in favor of that option.
20037 @item -m68020-40
20038 @opindex m68020-40
20039 Generate output for a 68040, without using any of the new instructions.
20040 This results in code that can run relatively efficiently on either a
20041 68020/68881 or a 68030 or a 68040.  The generated code does use the
20042 68881 instructions that are emulated on the 68040.
20044 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
20046 @item -m68020-60
20047 @opindex m68020-60
20048 Generate output for a 68060, without using any of the new instructions.
20049 This results in code that can run relatively efficiently on either a
20050 68020/68881 or a 68030 or a 68040.  The generated code does use the
20051 68881 instructions that are emulated on the 68060.
20053 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
20055 @item -mhard-float
20056 @itemx -m68881
20057 @opindex mhard-float
20058 @opindex m68881
20059 Generate floating-point instructions.  This is the default for 68020
20060 and above, and for ColdFire devices that have an FPU@.  It defines the
20061 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
20062 on ColdFire targets.
20064 @item -msoft-float
20065 @opindex msoft-float
20066 Do not generate floating-point instructions; use library calls instead.
20067 This is the default for 68000, 68010, and 68832 targets.  It is also
20068 the default for ColdFire devices that have no FPU.
20070 @item -mdiv
20071 @itemx -mno-div
20072 @opindex mdiv
20073 @opindex mno-div
20074 Generate (do not generate) ColdFire hardware divide and remainder
20075 instructions.  If @option{-march} is used without @option{-mcpu},
20076 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
20077 architectures.  Otherwise, the default is taken from the target CPU
20078 (either the default CPU, or the one specified by @option{-mcpu}).  For
20079 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
20080 @option{-mcpu=5206e}.
20082 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
20084 @item -mshort
20085 @opindex mshort
20086 Consider type @code{int} to be 16 bits wide, like @code{short int}.
20087 Additionally, parameters passed on the stack are also aligned to a
20088 16-bit boundary even on targets whose API mandates promotion to 32-bit.
20090 @item -mno-short
20091 @opindex mno-short
20092 Do not consider type @code{int} to be 16 bits wide.  This is the default.
20094 @item -mnobitfield
20095 @itemx -mno-bitfield
20096 @opindex mnobitfield
20097 @opindex mno-bitfield
20098 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
20099 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
20101 @item -mbitfield
20102 @opindex mbitfield
20103 Do use the bit-field instructions.  The @option{-m68020} option implies
20104 @option{-mbitfield}.  This is the default if you use a configuration
20105 designed for a 68020.
20107 @item -mrtd
20108 @opindex mrtd
20109 Use a different function-calling convention, in which functions
20110 that take a fixed number of arguments return with the @code{rtd}
20111 instruction, which pops their arguments while returning.  This
20112 saves one instruction in the caller since there is no need to pop
20113 the arguments there.
20115 This calling convention is incompatible with the one normally
20116 used on Unix, so you cannot use it if you need to call libraries
20117 compiled with the Unix compiler.
20119 Also, you must provide function prototypes for all functions that
20120 take variable numbers of arguments (including @code{printf});
20121 otherwise incorrect code is generated for calls to those
20122 functions.
20124 In addition, seriously incorrect code results if you call a
20125 function with too many arguments.  (Normally, extra arguments are
20126 harmlessly ignored.)
20128 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
20129 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
20131 @item -mno-rtd
20132 @opindex mno-rtd
20133 Do not use the calling conventions selected by @option{-mrtd}.
20134 This is the default.
20136 @item -malign-int
20137 @itemx -mno-align-int
20138 @opindex malign-int
20139 @opindex mno-align-int
20140 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
20141 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
20142 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
20143 Aligning variables on 32-bit boundaries produces code that runs somewhat
20144 faster on processors with 32-bit busses at the expense of more memory.
20146 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
20147 aligns structures containing the above types differently than
20148 most published application binary interface specifications for the m68k.
20150 @item -mpcrel
20151 @opindex mpcrel
20152 Use the pc-relative addressing mode of the 68000 directly, instead of
20153 using a global offset table.  At present, this option implies @option{-fpic},
20154 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
20155 not presently supported with @option{-mpcrel}, though this could be supported for
20156 68020 and higher processors.
20158 @item -mno-strict-align
20159 @itemx -mstrict-align
20160 @opindex mno-strict-align
20161 @opindex mstrict-align
20162 Do not (do) assume that unaligned memory references are handled by
20163 the system.
20165 @item -msep-data
20166 Generate code that allows the data segment to be located in a different
20167 area of memory from the text segment.  This allows for execute-in-place in
20168 an environment without virtual memory management.  This option implies
20169 @option{-fPIC}.
20171 @item -mno-sep-data
20172 Generate code that assumes that the data segment follows the text segment.
20173 This is the default.
20175 @item -mid-shared-library
20176 Generate code that supports shared libraries via the library ID method.
20177 This allows for execute-in-place and shared libraries in an environment
20178 without virtual memory management.  This option implies @option{-fPIC}.
20180 @item -mno-id-shared-library
20181 Generate code that doesn't assume ID-based shared libraries are being used.
20182 This is the default.
20184 @item -mshared-library-id=n
20185 Specifies the identification number of the ID-based shared library being
20186 compiled.  Specifying a value of 0 generates more compact code; specifying
20187 other values forces the allocation of that number to the current
20188 library, but is no more space- or time-efficient than omitting this option.
20190 @item -mxgot
20191 @itemx -mno-xgot
20192 @opindex mxgot
20193 @opindex mno-xgot
20194 When generating position-independent code for ColdFire, generate code
20195 that works if the GOT has more than 8192 entries.  This code is
20196 larger and slower than code generated without this option.  On M680x0
20197 processors, this option is not needed; @option{-fPIC} suffices.
20199 GCC normally uses a single instruction to load values from the GOT@.
20200 While this is relatively efficient, it only works if the GOT
20201 is smaller than about 64k.  Anything larger causes the linker
20202 to report an error such as:
20204 @cindex relocation truncated to fit (ColdFire)
20205 @smallexample
20206 relocation truncated to fit: R_68K_GOT16O foobar
20207 @end smallexample
20209 If this happens, you should recompile your code with @option{-mxgot}.
20210 It should then work with very large GOTs.  However, code generated with
20211 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
20212 the value of a global symbol.
20214 Note that some linkers, including newer versions of the GNU linker,
20215 can create multiple GOTs and sort GOT entries.  If you have such a linker,
20216 you should only need to use @option{-mxgot} when compiling a single
20217 object file that accesses more than 8192 GOT entries.  Very few do.
20219 These options have no effect unless GCC is generating
20220 position-independent code.
20222 @item -mlong-jump-table-offsets
20223 @opindex mlong-jump-table-offsets
20224 Use 32-bit offsets in @code{switch} tables.  The default is to use
20225 16-bit offsets.
20227 @end table
20229 @node MCore Options
20230 @subsection MCore Options
20231 @cindex MCore options
20233 These are the @samp{-m} options defined for the Motorola M*Core
20234 processors.
20236 @table @gcctabopt
20238 @item -mhardlit
20239 @itemx -mno-hardlit
20240 @opindex mhardlit
20241 @opindex mno-hardlit
20242 Inline constants into the code stream if it can be done in two
20243 instructions or less.
20245 @item -mdiv
20246 @itemx -mno-div
20247 @opindex mdiv
20248 @opindex mno-div
20249 Use the divide instruction.  (Enabled by default).
20251 @item -mrelax-immediate
20252 @itemx -mno-relax-immediate
20253 @opindex mrelax-immediate
20254 @opindex mno-relax-immediate
20255 Allow arbitrary-sized immediates in bit operations.
20257 @item -mwide-bitfields
20258 @itemx -mno-wide-bitfields
20259 @opindex mwide-bitfields
20260 @opindex mno-wide-bitfields
20261 Always treat bit-fields as @code{int}-sized.
20263 @item -m4byte-functions
20264 @itemx -mno-4byte-functions
20265 @opindex m4byte-functions
20266 @opindex mno-4byte-functions
20267 Force all functions to be aligned to a 4-byte boundary.
20269 @item -mcallgraph-data
20270 @itemx -mno-callgraph-data
20271 @opindex mcallgraph-data
20272 @opindex mno-callgraph-data
20273 Emit callgraph information.
20275 @item -mslow-bytes
20276 @itemx -mno-slow-bytes
20277 @opindex mslow-bytes
20278 @opindex mno-slow-bytes
20279 Prefer word access when reading byte quantities.
20281 @item -mlittle-endian
20282 @itemx -mbig-endian
20283 @opindex mlittle-endian
20284 @opindex mbig-endian
20285 Generate code for a little-endian target.
20287 @item -m210
20288 @itemx -m340
20289 @opindex m210
20290 @opindex m340
20291 Generate code for the 210 processor.
20293 @item -mno-lsim
20294 @opindex mno-lsim
20295 Assume that runtime support has been provided and so omit the
20296 simulator library (@file{libsim.a)} from the linker command line.
20298 @item -mstack-increment=@var{size}
20299 @opindex mstack-increment
20300 Set the maximum amount for a single stack increment operation.  Large
20301 values can increase the speed of programs that contain functions
20302 that need a large amount of stack space, but they can also trigger a
20303 segmentation fault if the stack is extended too much.  The default
20304 value is 0x1000.
20306 @end table
20308 @node MeP Options
20309 @subsection MeP Options
20310 @cindex MeP options
20312 @table @gcctabopt
20314 @item -mabsdiff
20315 @opindex mabsdiff
20316 Enables the @code{abs} instruction, which is the absolute difference
20317 between two registers.
20319 @item -mall-opts
20320 @opindex mall-opts
20321 Enables all the optional instructions---average, multiply, divide, bit
20322 operations, leading zero, absolute difference, min/max, clip, and
20323 saturation.
20326 @item -maverage
20327 @opindex maverage
20328 Enables the @code{ave} instruction, which computes the average of two
20329 registers.
20331 @item -mbased=@var{n}
20332 @opindex mbased=
20333 Variables of size @var{n} bytes or smaller are placed in the
20334 @code{.based} section by default.  Based variables use the @code{$tp}
20335 register as a base register, and there is a 128-byte limit to the
20336 @code{.based} section.
20338 @item -mbitops
20339 @opindex mbitops
20340 Enables the bit operation instructions---bit test (@code{btstm}), set
20341 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
20342 test-and-set (@code{tas}).
20344 @item -mc=@var{name}
20345 @opindex mc=
20346 Selects which section constant data is placed in.  @var{name} may
20347 be @samp{tiny}, @samp{near}, or @samp{far}.
20349 @item -mclip
20350 @opindex mclip
20351 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
20352 useful unless you also provide @option{-mminmax}.
20354 @item -mconfig=@var{name}
20355 @opindex mconfig=
20356 Selects one of the built-in core configurations.  Each MeP chip has
20357 one or more modules in it; each module has a core CPU and a variety of
20358 coprocessors, optional instructions, and peripherals.  The
20359 @code{MeP-Integrator} tool, not part of GCC, provides these
20360 configurations through this option; using this option is the same as
20361 using all the corresponding command-line options.  The default
20362 configuration is @samp{default}.
20364 @item -mcop
20365 @opindex mcop
20366 Enables the coprocessor instructions.  By default, this is a 32-bit
20367 coprocessor.  Note that the coprocessor is normally enabled via the
20368 @option{-mconfig=} option.
20370 @item -mcop32
20371 @opindex mcop32
20372 Enables the 32-bit coprocessor's instructions.
20374 @item -mcop64
20375 @opindex mcop64
20376 Enables the 64-bit coprocessor's instructions.
20378 @item -mivc2
20379 @opindex mivc2
20380 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
20382 @item -mdc
20383 @opindex mdc
20384 Causes constant variables to be placed in the @code{.near} section.
20386 @item -mdiv
20387 @opindex mdiv
20388 Enables the @code{div} and @code{divu} instructions.
20390 @item -meb
20391 @opindex meb
20392 Generate big-endian code.
20394 @item -mel
20395 @opindex mel
20396 Generate little-endian code.
20398 @item -mio-volatile
20399 @opindex mio-volatile
20400 Tells the compiler that any variable marked with the @code{io}
20401 attribute is to be considered volatile.
20403 @item -ml
20404 @opindex ml
20405 Causes variables to be assigned to the @code{.far} section by default.
20407 @item -mleadz
20408 @opindex mleadz
20409 Enables the @code{leadz} (leading zero) instruction.
20411 @item -mm
20412 @opindex mm
20413 Causes variables to be assigned to the @code{.near} section by default.
20415 @item -mminmax
20416 @opindex mminmax
20417 Enables the @code{min} and @code{max} instructions.
20419 @item -mmult
20420 @opindex mmult
20421 Enables the multiplication and multiply-accumulate instructions.
20423 @item -mno-opts
20424 @opindex mno-opts
20425 Disables all the optional instructions enabled by @option{-mall-opts}.
20427 @item -mrepeat
20428 @opindex mrepeat
20429 Enables the @code{repeat} and @code{erepeat} instructions, used for
20430 low-overhead looping.
20432 @item -ms
20433 @opindex ms
20434 Causes all variables to default to the @code{.tiny} section.  Note
20435 that there is a 65536-byte limit to this section.  Accesses to these
20436 variables use the @code{%gp} base register.
20438 @item -msatur
20439 @opindex msatur
20440 Enables the saturation instructions.  Note that the compiler does not
20441 currently generate these itself, but this option is included for
20442 compatibility with other tools, like @code{as}.
20444 @item -msdram
20445 @opindex msdram
20446 Link the SDRAM-based runtime instead of the default ROM-based runtime.
20448 @item -msim
20449 @opindex msim
20450 Link the simulator run-time libraries.
20452 @item -msimnovec
20453 @opindex msimnovec
20454 Link the simulator runtime libraries, excluding built-in support
20455 for reset and exception vectors and tables.
20457 @item -mtf
20458 @opindex mtf
20459 Causes all functions to default to the @code{.far} section.  Without
20460 this option, functions default to the @code{.near} section.
20462 @item -mtiny=@var{n}
20463 @opindex mtiny=
20464 Variables that are @var{n} bytes or smaller are allocated to the
20465 @code{.tiny} section.  These variables use the @code{$gp} base
20466 register.  The default for this option is 4, but note that there's a
20467 65536-byte limit to the @code{.tiny} section.
20469 @end table
20471 @node MicroBlaze Options
20472 @subsection MicroBlaze Options
20473 @cindex MicroBlaze Options
20475 @table @gcctabopt
20477 @item -msoft-float
20478 @opindex msoft-float
20479 Use software emulation for floating point (default).
20481 @item -mhard-float
20482 @opindex mhard-float
20483 Use hardware floating-point instructions.
20485 @item -mmemcpy
20486 @opindex mmemcpy
20487 Do not optimize block moves, use @code{memcpy}.
20489 @item -mno-clearbss
20490 @opindex mno-clearbss
20491 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
20493 @item -mcpu=@var{cpu-type}
20494 @opindex mcpu=
20495 Use features of, and schedule code for, the given CPU.
20496 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
20497 where @var{X} is a major version, @var{YY} is the minor version, and
20498 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
20499 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v6.00.a}.
20501 @item -mxl-soft-mul
20502 @opindex mxl-soft-mul
20503 Use software multiply emulation (default).
20505 @item -mxl-soft-div
20506 @opindex mxl-soft-div
20507 Use software emulation for divides (default).
20509 @item -mxl-barrel-shift
20510 @opindex mxl-barrel-shift
20511 Use the hardware barrel shifter.
20513 @item -mxl-pattern-compare
20514 @opindex mxl-pattern-compare
20515 Use pattern compare instructions.
20517 @item -msmall-divides
20518 @opindex msmall-divides
20519 Use table lookup optimization for small signed integer divisions.
20521 @item -mxl-stack-check
20522 @opindex mxl-stack-check
20523 This option is deprecated.  Use @option{-fstack-check} instead.
20525 @item -mxl-gp-opt
20526 @opindex mxl-gp-opt
20527 Use GP-relative @code{.sdata}/@code{.sbss} sections.
20529 @item -mxl-multiply-high
20530 @opindex mxl-multiply-high
20531 Use multiply high instructions for high part of 32x32 multiply.
20533 @item -mxl-float-convert
20534 @opindex mxl-float-convert
20535 Use hardware floating-point conversion instructions.
20537 @item -mxl-float-sqrt
20538 @opindex mxl-float-sqrt
20539 Use hardware floating-point square root instruction.
20541 @item -mbig-endian
20542 @opindex mbig-endian
20543 Generate code for a big-endian target.
20545 @item -mlittle-endian
20546 @opindex mlittle-endian
20547 Generate code for a little-endian target.
20549 @item -mxl-reorder
20550 @opindex mxl-reorder
20551 Use reorder instructions (swap and byte reversed load/store).
20553 @item -mxl-mode-@var{app-model}
20554 Select application model @var{app-model}.  Valid models are
20555 @table @samp
20556 @item executable
20557 normal executable (default), uses startup code @file{crt0.o}.
20559 @item -mpic-data-is-text-relative
20560 @opindex mpic-data-is-text-relative
20561 Assume that the displacement between the text and data segments is fixed
20562 at static link time.  This allows data to be referenced by offset from start of
20563 text address instead of GOT since PC-relative addressing is not supported.
20565 @item xmdstub
20566 for use with Xilinx Microprocessor Debugger (XMD) based
20567 software intrusive debug agent called xmdstub. This uses startup file
20568 @file{crt1.o} and sets the start address of the program to 0x800.
20570 @item bootstrap
20571 for applications that are loaded using a bootloader.
20572 This model uses startup file @file{crt2.o} which does not contain a processor
20573 reset vector handler. This is suitable for transferring control on a
20574 processor reset to the bootloader rather than the application.
20576 @item novectors
20577 for applications that do not require any of the
20578 MicroBlaze vectors. This option may be useful for applications running
20579 within a monitoring application. This model uses @file{crt3.o} as a startup file.
20580 @end table
20582 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
20583 @option{-mxl-mode-@var{app-model}}.
20585 @end table
20587 @node MIPS Options
20588 @subsection MIPS Options
20589 @cindex MIPS options
20591 @table @gcctabopt
20593 @item -EB
20594 @opindex EB
20595 Generate big-endian code.
20597 @item -EL
20598 @opindex EL
20599 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
20600 configurations.
20602 @item -march=@var{arch}
20603 @opindex march
20604 Generate code that runs on @var{arch}, which can be the name of a
20605 generic MIPS ISA, or the name of a particular processor.
20606 The ISA names are:
20607 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
20608 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
20609 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
20610 @samp{mips64r5} and @samp{mips64r6}.
20611 The processor names are:
20612 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
20613 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
20614 @samp{5kc}, @samp{5kf},
20615 @samp{20kc},
20616 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
20617 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
20618 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
20619 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
20620 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
20621 @samp{i6400}, @samp{i6500},
20622 @samp{interaptiv},
20623 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
20624 @samp{m4k},
20625 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
20626 @samp{m5100}, @samp{m5101},
20627 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
20628 @samp{orion},
20629 @samp{p5600}, @samp{p6600},
20630 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
20631 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
20632 @samp{rm7000}, @samp{rm9000},
20633 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
20634 @samp{sb1},
20635 @samp{sr71000},
20636 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
20637 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
20638 @samp{xlr} and @samp{xlp}.
20639 The special value @samp{from-abi} selects the
20640 most compatible architecture for the selected ABI (that is,
20641 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
20643 The native Linux/GNU toolchain also supports the value @samp{native},
20644 which selects the best architecture option for the host processor.
20645 @option{-march=native} has no effect if GCC does not recognize
20646 the processor.
20648 In processor names, a final @samp{000} can be abbreviated as @samp{k}
20649 (for example, @option{-march=r2k}).  Prefixes are optional, and
20650 @samp{vr} may be written @samp{r}.
20652 Names of the form @samp{@var{n}f2_1} refer to processors with
20653 FPUs clocked at half the rate of the core, names of the form
20654 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
20655 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
20656 processors with FPUs clocked a ratio of 3:2 with respect to the core.
20657 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
20658 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
20659 accepted as synonyms for @samp{@var{n}f1_1}.
20661 GCC defines two macros based on the value of this option.  The first
20662 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
20663 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
20664 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
20665 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
20666 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
20668 Note that the @code{_MIPS_ARCH} macro uses the processor names given
20669 above.  In other words, it has the full prefix and does not
20670 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
20671 the macro names the resolved architecture (either @code{"mips1"} or
20672 @code{"mips3"}).  It names the default architecture when no
20673 @option{-march} option is given.
20675 @item -mtune=@var{arch}
20676 @opindex mtune
20677 Optimize for @var{arch}.  Among other things, this option controls
20678 the way instructions are scheduled, and the perceived cost of arithmetic
20679 operations.  The list of @var{arch} values is the same as for
20680 @option{-march}.
20682 When this option is not used, GCC optimizes for the processor
20683 specified by @option{-march}.  By using @option{-march} and
20684 @option{-mtune} together, it is possible to generate code that
20685 runs on a family of processors, but optimize the code for one
20686 particular member of that family.
20688 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
20689 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
20690 @option{-march} ones described above.
20692 @item -mips1
20693 @opindex mips1
20694 Equivalent to @option{-march=mips1}.
20696 @item -mips2
20697 @opindex mips2
20698 Equivalent to @option{-march=mips2}.
20700 @item -mips3
20701 @opindex mips3
20702 Equivalent to @option{-march=mips3}.
20704 @item -mips4
20705 @opindex mips4
20706 Equivalent to @option{-march=mips4}.
20708 @item -mips32
20709 @opindex mips32
20710 Equivalent to @option{-march=mips32}.
20712 @item -mips32r3
20713 @opindex mips32r3
20714 Equivalent to @option{-march=mips32r3}.
20716 @item -mips32r5
20717 @opindex mips32r5
20718 Equivalent to @option{-march=mips32r5}.
20720 @item -mips32r6
20721 @opindex mips32r6
20722 Equivalent to @option{-march=mips32r6}.
20724 @item -mips64
20725 @opindex mips64
20726 Equivalent to @option{-march=mips64}.
20728 @item -mips64r2
20729 @opindex mips64r2
20730 Equivalent to @option{-march=mips64r2}.
20732 @item -mips64r3
20733 @opindex mips64r3
20734 Equivalent to @option{-march=mips64r3}.
20736 @item -mips64r5
20737 @opindex mips64r5
20738 Equivalent to @option{-march=mips64r5}.
20740 @item -mips64r6
20741 @opindex mips64r6
20742 Equivalent to @option{-march=mips64r6}.
20744 @item -mips16
20745 @itemx -mno-mips16
20746 @opindex mips16
20747 @opindex mno-mips16
20748 Generate (do not generate) MIPS16 code.  If GCC is targeting a
20749 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
20751 MIPS16 code generation can also be controlled on a per-function basis
20752 by means of @code{mips16} and @code{nomips16} attributes.
20753 @xref{Function Attributes}, for more information.
20755 @item -mflip-mips16
20756 @opindex mflip-mips16
20757 Generate MIPS16 code on alternating functions.  This option is provided
20758 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
20759 not intended for ordinary use in compiling user code.
20761 @item -minterlink-compressed
20762 @itemx -mno-interlink-compressed
20763 @opindex minterlink-compressed
20764 @opindex mno-interlink-compressed
20765 Require (do not require) that code using the standard (uncompressed) MIPS ISA
20766 be link-compatible with MIPS16 and microMIPS code, and vice versa.
20768 For example, code using the standard ISA encoding cannot jump directly
20769 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
20770 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
20771 knows that the target of the jump is not compressed.
20773 @item -minterlink-mips16
20774 @itemx -mno-interlink-mips16
20775 @opindex minterlink-mips16
20776 @opindex mno-interlink-mips16
20777 Aliases of @option{-minterlink-compressed} and
20778 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
20779 and are retained for backwards compatibility.
20781 @item -mabi=32
20782 @itemx -mabi=o64
20783 @itemx -mabi=n32
20784 @itemx -mabi=64
20785 @itemx -mabi=eabi
20786 @opindex mabi=32
20787 @opindex mabi=o64
20788 @opindex mabi=n32
20789 @opindex mabi=64
20790 @opindex mabi=eabi
20791 Generate code for the given ABI@.
20793 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
20794 generates 64-bit code when you select a 64-bit architecture, but you
20795 can use @option{-mgp32} to get 32-bit code instead.
20797 For information about the O64 ABI, see
20798 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
20800 GCC supports a variant of the o32 ABI in which floating-point registers
20801 are 64 rather than 32 bits wide.  You can select this combination with
20802 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
20803 and @code{mfhc1} instructions and is therefore only supported for
20804 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
20806 The register assignments for arguments and return values remain the
20807 same, but each scalar value is passed in a single 64-bit register
20808 rather than a pair of 32-bit registers.  For example, scalar
20809 floating-point values are returned in @samp{$f0} only, not a
20810 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
20811 remains the same in that the even-numbered double-precision registers
20812 are saved.
20814 Two additional variants of the o32 ABI are supported to enable
20815 a transition from 32-bit to 64-bit registers.  These are FPXX
20816 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
20817 The FPXX extension mandates that all code must execute correctly
20818 when run using 32-bit or 64-bit registers.  The code can be interlinked
20819 with either FP32 or FP64, but not both.
20820 The FP64A extension is similar to the FP64 extension but forbids the
20821 use of odd-numbered single-precision registers.  This can be used
20822 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
20823 processors and allows both FP32 and FP64A code to interlink and
20824 run in the same process without changing FPU modes.
20826 @item -mabicalls
20827 @itemx -mno-abicalls
20828 @opindex mabicalls
20829 @opindex mno-abicalls
20830 Generate (do not generate) code that is suitable for SVR4-style
20831 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
20832 systems.
20834 @item -mshared
20835 @itemx -mno-shared
20836 Generate (do not generate) code that is fully position-independent,
20837 and that can therefore be linked into shared libraries.  This option
20838 only affects @option{-mabicalls}.
20840 All @option{-mabicalls} code has traditionally been position-independent,
20841 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
20842 as an extension, the GNU toolchain allows executables to use absolute
20843 accesses for locally-binding symbols.  It can also use shorter GP
20844 initialization sequences and generate direct calls to locally-defined
20845 functions.  This mode is selected by @option{-mno-shared}.
20847 @option{-mno-shared} depends on binutils 2.16 or higher and generates
20848 objects that can only be linked by the GNU linker.  However, the option
20849 does not affect the ABI of the final executable; it only affects the ABI
20850 of relocatable objects.  Using @option{-mno-shared} generally makes
20851 executables both smaller and quicker.
20853 @option{-mshared} is the default.
20855 @item -mplt
20856 @itemx -mno-plt
20857 @opindex mplt
20858 @opindex mno-plt
20859 Assume (do not assume) that the static and dynamic linkers
20860 support PLTs and copy relocations.  This option only affects
20861 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
20862 has no effect without @option{-msym32}.
20864 You can make @option{-mplt} the default by configuring
20865 GCC with @option{--with-mips-plt}.  The default is
20866 @option{-mno-plt} otherwise.
20868 @item -mxgot
20869 @itemx -mno-xgot
20870 @opindex mxgot
20871 @opindex mno-xgot
20872 Lift (do not lift) the usual restrictions on the size of the global
20873 offset table.
20875 GCC normally uses a single instruction to load values from the GOT@.
20876 While this is relatively efficient, it only works if the GOT
20877 is smaller than about 64k.  Anything larger causes the linker
20878 to report an error such as:
20880 @cindex relocation truncated to fit (MIPS)
20881 @smallexample
20882 relocation truncated to fit: R_MIPS_GOT16 foobar
20883 @end smallexample
20885 If this happens, you should recompile your code with @option{-mxgot}.
20886 This works with very large GOTs, although the code is also
20887 less efficient, since it takes three instructions to fetch the
20888 value of a global symbol.
20890 Note that some linkers can create multiple GOTs.  If you have such a
20891 linker, you should only need to use @option{-mxgot} when a single object
20892 file accesses more than 64k's worth of GOT entries.  Very few do.
20894 These options have no effect unless GCC is generating position
20895 independent code.
20897 @item -mgp32
20898 @opindex mgp32
20899 Assume that general-purpose registers are 32 bits wide.
20901 @item -mgp64
20902 @opindex mgp64
20903 Assume that general-purpose registers are 64 bits wide.
20905 @item -mfp32
20906 @opindex mfp32
20907 Assume that floating-point registers are 32 bits wide.
20909 @item -mfp64
20910 @opindex mfp64
20911 Assume that floating-point registers are 64 bits wide.
20913 @item -mfpxx
20914 @opindex mfpxx
20915 Do not assume the width of floating-point registers.
20917 @item -mhard-float
20918 @opindex mhard-float
20919 Use floating-point coprocessor instructions.
20921 @item -msoft-float
20922 @opindex msoft-float
20923 Do not use floating-point coprocessor instructions.  Implement
20924 floating-point calculations using library calls instead.
20926 @item -mno-float
20927 @opindex mno-float
20928 Equivalent to @option{-msoft-float}, but additionally asserts that the
20929 program being compiled does not perform any floating-point operations.
20930 This option is presently supported only by some bare-metal MIPS
20931 configurations, where it may select a special set of libraries
20932 that lack all floating-point support (including, for example, the
20933 floating-point @code{printf} formats).  
20934 If code compiled with @option{-mno-float} accidentally contains
20935 floating-point operations, it is likely to suffer a link-time
20936 or run-time failure.
20938 @item -msingle-float
20939 @opindex msingle-float
20940 Assume that the floating-point coprocessor only supports single-precision
20941 operations.
20943 @item -mdouble-float
20944 @opindex mdouble-float
20945 Assume that the floating-point coprocessor supports double-precision
20946 operations.  This is the default.
20948 @item -modd-spreg
20949 @itemx -mno-odd-spreg
20950 @opindex modd-spreg
20951 @opindex mno-odd-spreg
20952 Enable the use of odd-numbered single-precision floating-point registers
20953 for the o32 ABI.  This is the default for processors that are known to
20954 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
20955 is set by default.
20957 @item -mabs=2008
20958 @itemx -mabs=legacy
20959 @opindex mabs=2008
20960 @opindex mabs=legacy
20961 These options control the treatment of the special not-a-number (NaN)
20962 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
20963 @code{neg.@i{fmt}} machine instructions.
20965 By default or when @option{-mabs=legacy} is used the legacy
20966 treatment is selected.  In this case these instructions are considered
20967 arithmetic and avoided where correct operation is required and the
20968 input operand might be a NaN.  A longer sequence of instructions that
20969 manipulate the sign bit of floating-point datum manually is used
20970 instead unless the @option{-ffinite-math-only} option has also been
20971 specified.
20973 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
20974 this case these instructions are considered non-arithmetic and therefore
20975 operating correctly in all cases, including in particular where the
20976 input operand is a NaN.  These instructions are therefore always used
20977 for the respective operations.
20979 @item -mnan=2008
20980 @itemx -mnan=legacy
20981 @opindex mnan=2008
20982 @opindex mnan=legacy
20983 These options control the encoding of the special not-a-number (NaN)
20984 IEEE 754 floating-point data.
20986 The @option{-mnan=legacy} option selects the legacy encoding.  In this
20987 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
20988 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
20989 by the first bit of their trailing significand field being 1.
20991 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
20992 this case qNaNs are denoted by the first bit of their trailing
20993 significand field being 1, whereas sNaNs are denoted by the first bit of
20994 their trailing significand field being 0.
20996 The default is @option{-mnan=legacy} unless GCC has been configured with
20997 @option{--with-nan=2008}.
20999 @item -mllsc
21000 @itemx -mno-llsc
21001 @opindex mllsc
21002 @opindex mno-llsc
21003 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
21004 implement atomic memory built-in functions.  When neither option is
21005 specified, GCC uses the instructions if the target architecture
21006 supports them.
21008 @option{-mllsc} is useful if the runtime environment can emulate the
21009 instructions and @option{-mno-llsc} can be useful when compiling for
21010 nonstandard ISAs.  You can make either option the default by
21011 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
21012 respectively.  @option{--with-llsc} is the default for some
21013 configurations; see the installation documentation for details.
21015 @item -mdsp
21016 @itemx -mno-dsp
21017 @opindex mdsp
21018 @opindex mno-dsp
21019 Use (do not use) revision 1 of the MIPS DSP ASE@.
21020 @xref{MIPS DSP Built-in Functions}.  This option defines the
21021 preprocessor macro @code{__mips_dsp}.  It also defines
21022 @code{__mips_dsp_rev} to 1.
21024 @item -mdspr2
21025 @itemx -mno-dspr2
21026 @opindex mdspr2
21027 @opindex mno-dspr2
21028 Use (do not use) revision 2 of the MIPS DSP ASE@.
21029 @xref{MIPS DSP Built-in Functions}.  This option defines the
21030 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
21031 It also defines @code{__mips_dsp_rev} to 2.
21033 @item -msmartmips
21034 @itemx -mno-smartmips
21035 @opindex msmartmips
21036 @opindex mno-smartmips
21037 Use (do not use) the MIPS SmartMIPS ASE.
21039 @item -mpaired-single
21040 @itemx -mno-paired-single
21041 @opindex mpaired-single
21042 @opindex mno-paired-single
21043 Use (do not use) paired-single floating-point instructions.
21044 @xref{MIPS Paired-Single Support}.  This option requires
21045 hardware floating-point support to be enabled.
21047 @item -mdmx
21048 @itemx -mno-mdmx
21049 @opindex mdmx
21050 @opindex mno-mdmx
21051 Use (do not use) MIPS Digital Media Extension instructions.
21052 This option can only be used when generating 64-bit code and requires
21053 hardware floating-point support to be enabled.
21055 @item -mips3d
21056 @itemx -mno-mips3d
21057 @opindex mips3d
21058 @opindex mno-mips3d
21059 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
21060 The option @option{-mips3d} implies @option{-mpaired-single}.
21062 @item -mmicromips
21063 @itemx -mno-micromips
21064 @opindex mmicromips
21065 @opindex mno-mmicromips
21066 Generate (do not generate) microMIPS code.
21068 MicroMIPS code generation can also be controlled on a per-function basis
21069 by means of @code{micromips} and @code{nomicromips} attributes.
21070 @xref{Function Attributes}, for more information.
21072 @item -mmt
21073 @itemx -mno-mt
21074 @opindex mmt
21075 @opindex mno-mt
21076 Use (do not use) MT Multithreading instructions.
21078 @item -mmcu
21079 @itemx -mno-mcu
21080 @opindex mmcu
21081 @opindex mno-mcu
21082 Use (do not use) the MIPS MCU ASE instructions.
21084 @item -meva
21085 @itemx -mno-eva
21086 @opindex meva
21087 @opindex mno-eva
21088 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
21090 @item -mvirt
21091 @itemx -mno-virt
21092 @opindex mvirt
21093 @opindex mno-virt
21094 Use (do not use) the MIPS Virtualization (VZ) instructions.
21096 @item -mxpa
21097 @itemx -mno-xpa
21098 @opindex mxpa
21099 @opindex mno-xpa
21100 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
21102 @item -mcrc
21103 @itemx -mno-crc
21104 @opindex mcrc
21105 @opindex mno-crc
21106 Use (do not use) the MIPS Cyclic Redundancy Check (CRC) instructions.
21108 @item -mginv
21109 @itemx -mno-ginv
21110 @opindex mginv
21111 @opindex mno-ginv
21112 Use (do not use) the MIPS Global INValidate (GINV) instructions.
21114 @item -mlong64
21115 @opindex mlong64
21116 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
21117 an explanation of the default and the way that the pointer size is
21118 determined.
21120 @item -mlong32
21121 @opindex mlong32
21122 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
21124 The default size of @code{int}s, @code{long}s and pointers depends on
21125 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
21126 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
21127 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
21128 or the same size as integer registers, whichever is smaller.
21130 @item -msym32
21131 @itemx -mno-sym32
21132 @opindex msym32
21133 @opindex mno-sym32
21134 Assume (do not assume) that all symbols have 32-bit values, regardless
21135 of the selected ABI@.  This option is useful in combination with
21136 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
21137 to generate shorter and faster references to symbolic addresses.
21139 @item -G @var{num}
21140 @opindex G
21141 Put definitions of externally-visible data in a small data section
21142 if that data is no bigger than @var{num} bytes.  GCC can then generate
21143 more efficient accesses to the data; see @option{-mgpopt} for details.
21145 The default @option{-G} option depends on the configuration.
21147 @item -mlocal-sdata
21148 @itemx -mno-local-sdata
21149 @opindex mlocal-sdata
21150 @opindex mno-local-sdata
21151 Extend (do not extend) the @option{-G} behavior to local data too,
21152 such as to static variables in C@.  @option{-mlocal-sdata} is the
21153 default for all configurations.
21155 If the linker complains that an application is using too much small data,
21156 you might want to try rebuilding the less performance-critical parts with
21157 @option{-mno-local-sdata}.  You might also want to build large
21158 libraries with @option{-mno-local-sdata}, so that the libraries leave
21159 more room for the main program.
21161 @item -mextern-sdata
21162 @itemx -mno-extern-sdata
21163 @opindex mextern-sdata
21164 @opindex mno-extern-sdata
21165 Assume (do not assume) that externally-defined data is in
21166 a small data section if the size of that data is within the @option{-G} limit.
21167 @option{-mextern-sdata} is the default for all configurations.
21169 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
21170 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
21171 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
21172 is placed in a small data section.  If @var{Var} is defined by another
21173 module, you must either compile that module with a high-enough
21174 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
21175 definition.  If @var{Var} is common, you must link the application
21176 with a high-enough @option{-G} setting.
21178 The easiest way of satisfying these restrictions is to compile
21179 and link every module with the same @option{-G} option.  However,
21180 you may wish to build a library that supports several different
21181 small data limits.  You can do this by compiling the library with
21182 the highest supported @option{-G} setting and additionally using
21183 @option{-mno-extern-sdata} to stop the library from making assumptions
21184 about externally-defined data.
21186 @item -mgpopt
21187 @itemx -mno-gpopt
21188 @opindex mgpopt
21189 @opindex mno-gpopt
21190 Use (do not use) GP-relative accesses for symbols that are known to be
21191 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
21192 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
21193 configurations.
21195 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
21196 might not hold the value of @code{_gp}.  For example, if the code is
21197 part of a library that might be used in a boot monitor, programs that
21198 call boot monitor routines pass an unknown value in @code{$gp}.
21199 (In such situations, the boot monitor itself is usually compiled
21200 with @option{-G0}.)
21202 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
21203 @option{-mno-extern-sdata}.
21205 @item -membedded-data
21206 @itemx -mno-embedded-data
21207 @opindex membedded-data
21208 @opindex mno-embedded-data
21209 Allocate variables to the read-only data section first if possible, then
21210 next in the small data section if possible, otherwise in data.  This gives
21211 slightly slower code than the default, but reduces the amount of RAM required
21212 when executing, and thus may be preferred for some embedded systems.
21214 @item -muninit-const-in-rodata
21215 @itemx -mno-uninit-const-in-rodata
21216 @opindex muninit-const-in-rodata
21217 @opindex mno-uninit-const-in-rodata
21218 Put uninitialized @code{const} variables in the read-only data section.
21219 This option is only meaningful in conjunction with @option{-membedded-data}.
21221 @item -mcode-readable=@var{setting}
21222 @opindex mcode-readable
21223 Specify whether GCC may generate code that reads from executable sections.
21224 There are three possible settings:
21226 @table @gcctabopt
21227 @item -mcode-readable=yes
21228 Instructions may freely access executable sections.  This is the
21229 default setting.
21231 @item -mcode-readable=pcrel
21232 MIPS16 PC-relative load instructions can access executable sections,
21233 but other instructions must not do so.  This option is useful on 4KSc
21234 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
21235 It is also useful on processors that can be configured to have a dual
21236 instruction/data SRAM interface and that, like the M4K, automatically
21237 redirect PC-relative loads to the instruction RAM.
21239 @item -mcode-readable=no
21240 Instructions must not access executable sections.  This option can be
21241 useful on targets that are configured to have a dual instruction/data
21242 SRAM interface but that (unlike the M4K) do not automatically redirect
21243 PC-relative loads to the instruction RAM.
21244 @end table
21246 @item -msplit-addresses
21247 @itemx -mno-split-addresses
21248 @opindex msplit-addresses
21249 @opindex mno-split-addresses
21250 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
21251 relocation operators.  This option has been superseded by
21252 @option{-mexplicit-relocs} but is retained for backwards compatibility.
21254 @item -mexplicit-relocs
21255 @itemx -mno-explicit-relocs
21256 @opindex mexplicit-relocs
21257 @opindex mno-explicit-relocs
21258 Use (do not use) assembler relocation operators when dealing with symbolic
21259 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
21260 is to use assembler macros instead.
21262 @option{-mexplicit-relocs} is the default if GCC was configured
21263 to use an assembler that supports relocation operators.
21265 @item -mcheck-zero-division
21266 @itemx -mno-check-zero-division
21267 @opindex mcheck-zero-division
21268 @opindex mno-check-zero-division
21269 Trap (do not trap) on integer division by zero.
21271 The default is @option{-mcheck-zero-division}.
21273 @item -mdivide-traps
21274 @itemx -mdivide-breaks
21275 @opindex mdivide-traps
21276 @opindex mdivide-breaks
21277 MIPS systems check for division by zero by generating either a
21278 conditional trap or a break instruction.  Using traps results in
21279 smaller code, but is only supported on MIPS II and later.  Also, some
21280 versions of the Linux kernel have a bug that prevents trap from
21281 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
21282 allow conditional traps on architectures that support them and
21283 @option{-mdivide-breaks} to force the use of breaks.
21285 The default is usually @option{-mdivide-traps}, but this can be
21286 overridden at configure time using @option{--with-divide=breaks}.
21287 Divide-by-zero checks can be completely disabled using
21288 @option{-mno-check-zero-division}.
21290 @item -mload-store-pairs
21291 @itemx -mno-load-store-pairs
21292 @opindex mload-store-pairs
21293 @opindex mno-load-store-pairs
21294 Enable (disable) an optimization that pairs consecutive load or store
21295 instructions to enable load/store bonding.  This option is enabled by
21296 default but only takes effect when the selected architecture is known
21297 to support bonding.
21299 @item -mmemcpy
21300 @itemx -mno-memcpy
21301 @opindex mmemcpy
21302 @opindex mno-memcpy
21303 Force (do not force) the use of @code{memcpy} for non-trivial block
21304 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
21305 most constant-sized copies.
21307 @item -mlong-calls
21308 @itemx -mno-long-calls
21309 @opindex mlong-calls
21310 @opindex mno-long-calls
21311 Disable (do not disable) use of the @code{jal} instruction.  Calling
21312 functions using @code{jal} is more efficient but requires the caller
21313 and callee to be in the same 256 megabyte segment.
21315 This option has no effect on abicalls code.  The default is
21316 @option{-mno-long-calls}.
21318 @item -mmad
21319 @itemx -mno-mad
21320 @opindex mmad
21321 @opindex mno-mad
21322 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
21323 instructions, as provided by the R4650 ISA@.
21325 @item -mimadd
21326 @itemx -mno-imadd
21327 @opindex mimadd
21328 @opindex mno-imadd
21329 Enable (disable) use of the @code{madd} and @code{msub} integer
21330 instructions.  The default is @option{-mimadd} on architectures
21331 that support @code{madd} and @code{msub} except for the 74k 
21332 architecture where it was found to generate slower code.
21334 @item -mfused-madd
21335 @itemx -mno-fused-madd
21336 @opindex mfused-madd
21337 @opindex mno-fused-madd
21338 Enable (disable) use of the floating-point multiply-accumulate
21339 instructions, when they are available.  The default is
21340 @option{-mfused-madd}.
21342 On the R8000 CPU when multiply-accumulate instructions are used,
21343 the intermediate product is calculated to infinite precision
21344 and is not subject to the FCSR Flush to Zero bit.  This may be
21345 undesirable in some circumstances.  On other processors the result
21346 is numerically identical to the equivalent computation using
21347 separate multiply, add, subtract and negate instructions.
21349 @item -nocpp
21350 @opindex nocpp
21351 Tell the MIPS assembler to not run its preprocessor over user
21352 assembler files (with a @samp{.s} suffix) when assembling them.
21354 @item -mfix-24k
21355 @itemx -mno-fix-24k
21356 @opindex mfix-24k
21357 @opindex mno-fix-24k
21358 Work around the 24K E48 (lost data on stores during refill) errata.
21359 The workarounds are implemented by the assembler rather than by GCC@.
21361 @item -mfix-r4000
21362 @itemx -mno-fix-r4000
21363 @opindex mfix-r4000
21364 @opindex mno-fix-r4000
21365 Work around certain R4000 CPU errata:
21366 @itemize @minus
21367 @item
21368 A double-word or a variable shift may give an incorrect result if executed
21369 immediately after starting an integer division.
21370 @item
21371 A double-word or a variable shift may give an incorrect result if executed
21372 while an integer multiplication is in progress.
21373 @item
21374 An integer division may give an incorrect result if started in a delay slot
21375 of a taken branch or a jump.
21376 @end itemize
21378 @item -mfix-r4400
21379 @itemx -mno-fix-r4400
21380 @opindex mfix-r4400
21381 @opindex mno-fix-r4400
21382 Work around certain R4400 CPU errata:
21383 @itemize @minus
21384 @item
21385 A double-word or a variable shift may give an incorrect result if executed
21386 immediately after starting an integer division.
21387 @end itemize
21389 @item -mfix-r10000
21390 @itemx -mno-fix-r10000
21391 @opindex mfix-r10000
21392 @opindex mno-fix-r10000
21393 Work around certain R10000 errata:
21394 @itemize @minus
21395 @item
21396 @code{ll}/@code{sc} sequences may not behave atomically on revisions
21397 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
21398 @end itemize
21400 This option can only be used if the target architecture supports
21401 branch-likely instructions.  @option{-mfix-r10000} is the default when
21402 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
21403 otherwise.
21405 @item -mfix-rm7000
21406 @itemx -mno-fix-rm7000
21407 @opindex mfix-rm7000
21408 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
21409 workarounds are implemented by the assembler rather than by GCC@.
21411 @item -mfix-vr4120
21412 @itemx -mno-fix-vr4120
21413 @opindex mfix-vr4120
21414 Work around certain VR4120 errata:
21415 @itemize @minus
21416 @item
21417 @code{dmultu} does not always produce the correct result.
21418 @item
21419 @code{div} and @code{ddiv} do not always produce the correct result if one
21420 of the operands is negative.
21421 @end itemize
21422 The workarounds for the division errata rely on special functions in
21423 @file{libgcc.a}.  At present, these functions are only provided by
21424 the @code{mips64vr*-elf} configurations.
21426 Other VR4120 errata require a NOP to be inserted between certain pairs of
21427 instructions.  These errata are handled by the assembler, not by GCC itself.
21429 @item -mfix-vr4130
21430 @opindex mfix-vr4130
21431 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
21432 workarounds are implemented by the assembler rather than by GCC,
21433 although GCC avoids using @code{mflo} and @code{mfhi} if the
21434 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
21435 instructions are available instead.
21437 @item -mfix-sb1
21438 @itemx -mno-fix-sb1
21439 @opindex mfix-sb1
21440 Work around certain SB-1 CPU core errata.
21441 (This flag currently works around the SB-1 revision 2
21442 ``F1'' and ``F2'' floating-point errata.)
21444 @item -mr10k-cache-barrier=@var{setting}
21445 @opindex mr10k-cache-barrier
21446 Specify whether GCC should insert cache barriers to avoid the
21447 side effects of speculation on R10K processors.
21449 In common with many processors, the R10K tries to predict the outcome
21450 of a conditional branch and speculatively executes instructions from
21451 the ``taken'' branch.  It later aborts these instructions if the
21452 predicted outcome is wrong.  However, on the R10K, even aborted
21453 instructions can have side effects.
21455 This problem only affects kernel stores and, depending on the system,
21456 kernel loads.  As an example, a speculatively-executed store may load
21457 the target memory into cache and mark the cache line as dirty, even if
21458 the store itself is later aborted.  If a DMA operation writes to the
21459 same area of memory before the ``dirty'' line is flushed, the cached
21460 data overwrites the DMA-ed data.  See the R10K processor manual
21461 for a full description, including other potential problems.
21463 One workaround is to insert cache barrier instructions before every memory
21464 access that might be speculatively executed and that might have side
21465 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
21466 controls GCC's implementation of this workaround.  It assumes that
21467 aborted accesses to any byte in the following regions does not have
21468 side effects:
21470 @enumerate
21471 @item
21472 the memory occupied by the current function's stack frame;
21474 @item
21475 the memory occupied by an incoming stack argument;
21477 @item
21478 the memory occupied by an object with a link-time-constant address.
21479 @end enumerate
21481 It is the kernel's responsibility to ensure that speculative
21482 accesses to these regions are indeed safe.
21484 If the input program contains a function declaration such as:
21486 @smallexample
21487 void foo (void);
21488 @end smallexample
21490 then the implementation of @code{foo} must allow @code{j foo} and
21491 @code{jal foo} to be executed speculatively.  GCC honors this
21492 restriction for functions it compiles itself.  It expects non-GCC
21493 functions (such as hand-written assembly code) to do the same.
21495 The option has three forms:
21497 @table @gcctabopt
21498 @item -mr10k-cache-barrier=load-store
21499 Insert a cache barrier before a load or store that might be
21500 speculatively executed and that might have side effects even
21501 if aborted.
21503 @item -mr10k-cache-barrier=store
21504 Insert a cache barrier before a store that might be speculatively
21505 executed and that might have side effects even if aborted.
21507 @item -mr10k-cache-barrier=none
21508 Disable the insertion of cache barriers.  This is the default setting.
21509 @end table
21511 @item -mflush-func=@var{func}
21512 @itemx -mno-flush-func
21513 @opindex mflush-func
21514 Specifies the function to call to flush the I and D caches, or to not
21515 call any such function.  If called, the function must take the same
21516 arguments as the common @code{_flush_func}, that is, the address of the
21517 memory range for which the cache is being flushed, the size of the
21518 memory range, and the number 3 (to flush both caches).  The default
21519 depends on the target GCC was configured for, but commonly is either
21520 @code{_flush_func} or @code{__cpu_flush}.
21522 @item mbranch-cost=@var{num}
21523 @opindex mbranch-cost
21524 Set the cost of branches to roughly @var{num} ``simple'' instructions.
21525 This cost is only a heuristic and is not guaranteed to produce
21526 consistent results across releases.  A zero cost redundantly selects
21527 the default, which is based on the @option{-mtune} setting.
21529 @item -mbranch-likely
21530 @itemx -mno-branch-likely
21531 @opindex mbranch-likely
21532 @opindex mno-branch-likely
21533 Enable or disable use of Branch Likely instructions, regardless of the
21534 default for the selected architecture.  By default, Branch Likely
21535 instructions may be generated if they are supported by the selected
21536 architecture.  An exception is for the MIPS32 and MIPS64 architectures
21537 and processors that implement those architectures; for those, Branch
21538 Likely instructions are not be generated by default because the MIPS32
21539 and MIPS64 architectures specifically deprecate their use.
21541 @item -mcompact-branches=never
21542 @itemx -mcompact-branches=optimal
21543 @itemx -mcompact-branches=always
21544 @opindex mcompact-branches=never
21545 @opindex mcompact-branches=optimal
21546 @opindex mcompact-branches=always
21547 These options control which form of branches will be generated.  The
21548 default is @option{-mcompact-branches=optimal}.
21550 The @option{-mcompact-branches=never} option ensures that compact branch
21551 instructions will never be generated.
21553 The @option{-mcompact-branches=always} option ensures that a compact
21554 branch instruction will be generated if available.  If a compact branch
21555 instruction is not available, a delay slot form of the branch will be
21556 used instead.
21558 This option is supported from MIPS Release 6 onwards.
21560 The @option{-mcompact-branches=optimal} option will cause a delay slot
21561 branch to be used if one is available in the current ISA and the delay
21562 slot is successfully filled.  If the delay slot is not filled, a compact
21563 branch will be chosen if one is available.
21565 @item -mfp-exceptions
21566 @itemx -mno-fp-exceptions
21567 @opindex mfp-exceptions
21568 Specifies whether FP exceptions are enabled.  This affects how
21569 FP instructions are scheduled for some processors.
21570 The default is that FP exceptions are
21571 enabled.
21573 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
21574 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
21575 FP pipe.
21577 @item -mvr4130-align
21578 @itemx -mno-vr4130-align
21579 @opindex mvr4130-align
21580 The VR4130 pipeline is two-way superscalar, but can only issue two
21581 instructions together if the first one is 8-byte aligned.  When this
21582 option is enabled, GCC aligns pairs of instructions that it
21583 thinks should execute in parallel.
21585 This option only has an effect when optimizing for the VR4130.
21586 It normally makes code faster, but at the expense of making it bigger.
21587 It is enabled by default at optimization level @option{-O3}.
21589 @item -msynci
21590 @itemx -mno-synci
21591 @opindex msynci
21592 Enable (disable) generation of @code{synci} instructions on
21593 architectures that support it.  The @code{synci} instructions (if
21594 enabled) are generated when @code{__builtin___clear_cache} is
21595 compiled.
21597 This option defaults to @option{-mno-synci}, but the default can be
21598 overridden by configuring GCC with @option{--with-synci}.
21600 When compiling code for single processor systems, it is generally safe
21601 to use @code{synci}.  However, on many multi-core (SMP) systems, it
21602 does not invalidate the instruction caches on all cores and may lead
21603 to undefined behavior.
21605 @item -mrelax-pic-calls
21606 @itemx -mno-relax-pic-calls
21607 @opindex mrelax-pic-calls
21608 Try to turn PIC calls that are normally dispatched via register
21609 @code{$25} into direct calls.  This is only possible if the linker can
21610 resolve the destination at link time and if the destination is within
21611 range for a direct call.
21613 @option{-mrelax-pic-calls} is the default if GCC was configured to use
21614 an assembler and a linker that support the @code{.reloc} assembly
21615 directive and @option{-mexplicit-relocs} is in effect.  With
21616 @option{-mno-explicit-relocs}, this optimization can be performed by the
21617 assembler and the linker alone without help from the compiler.
21619 @item -mmcount-ra-address
21620 @itemx -mno-mcount-ra-address
21621 @opindex mmcount-ra-address
21622 @opindex mno-mcount-ra-address
21623 Emit (do not emit) code that allows @code{_mcount} to modify the
21624 calling function's return address.  When enabled, this option extends
21625 the usual @code{_mcount} interface with a new @var{ra-address}
21626 parameter, which has type @code{intptr_t *} and is passed in register
21627 @code{$12}.  @code{_mcount} can then modify the return address by
21628 doing both of the following:
21629 @itemize
21630 @item
21631 Returning the new address in register @code{$31}.
21632 @item
21633 Storing the new address in @code{*@var{ra-address}},
21634 if @var{ra-address} is nonnull.
21635 @end itemize
21637 The default is @option{-mno-mcount-ra-address}.
21639 @item -mframe-header-opt
21640 @itemx -mno-frame-header-opt
21641 @opindex mframe-header-opt
21642 Enable (disable) frame header optimization in the o32 ABI.  When using the
21643 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
21644 function to write out register arguments.  When enabled, this optimization
21645 will suppress the allocation of the frame header if it can be determined that
21646 it is unused.
21648 This optimization is off by default at all optimization levels.
21650 @item -mlxc1-sxc1
21651 @itemx -mno-lxc1-sxc1
21652 @opindex mlxc1-sxc1
21653 When applicable, enable (disable) the generation of @code{lwxc1},
21654 @code{swxc1}, @code{ldxc1}, @code{sdxc1} instructions.  Enabled by default.
21656 @item -mmadd4
21657 @itemx -mno-madd4
21658 @opindex mmadd4
21659 When applicable, enable (disable) the generation of 4-operand @code{madd.s},
21660 @code{madd.d} and related instructions.  Enabled by default.
21662 @end table
21664 @node MMIX Options
21665 @subsection MMIX Options
21666 @cindex MMIX Options
21668 These options are defined for the MMIX:
21670 @table @gcctabopt
21671 @item -mlibfuncs
21672 @itemx -mno-libfuncs
21673 @opindex mlibfuncs
21674 @opindex mno-libfuncs
21675 Specify that intrinsic library functions are being compiled, passing all
21676 values in registers, no matter the size.
21678 @item -mepsilon
21679 @itemx -mno-epsilon
21680 @opindex mepsilon
21681 @opindex mno-epsilon
21682 Generate floating-point comparison instructions that compare with respect
21683 to the @code{rE} epsilon register.
21685 @item -mabi=mmixware
21686 @itemx -mabi=gnu
21687 @opindex mabi=mmixware
21688 @opindex mabi=gnu
21689 Generate code that passes function parameters and return values that (in
21690 the called function) are seen as registers @code{$0} and up, as opposed to
21691 the GNU ABI which uses global registers @code{$231} and up.
21693 @item -mzero-extend
21694 @itemx -mno-zero-extend
21695 @opindex mzero-extend
21696 @opindex mno-zero-extend
21697 When reading data from memory in sizes shorter than 64 bits, use (do not
21698 use) zero-extending load instructions by default, rather than
21699 sign-extending ones.
21701 @item -mknuthdiv
21702 @itemx -mno-knuthdiv
21703 @opindex mknuthdiv
21704 @opindex mno-knuthdiv
21705 Make the result of a division yielding a remainder have the same sign as
21706 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
21707 remainder follows the sign of the dividend.  Both methods are
21708 arithmetically valid, the latter being almost exclusively used.
21710 @item -mtoplevel-symbols
21711 @itemx -mno-toplevel-symbols
21712 @opindex mtoplevel-symbols
21713 @opindex mno-toplevel-symbols
21714 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
21715 code can be used with the @code{PREFIX} assembly directive.
21717 @item -melf
21718 @opindex melf
21719 Generate an executable in the ELF format, rather than the default
21720 @samp{mmo} format used by the @command{mmix} simulator.
21722 @item -mbranch-predict
21723 @itemx -mno-branch-predict
21724 @opindex mbranch-predict
21725 @opindex mno-branch-predict
21726 Use (do not use) the probable-branch instructions, when static branch
21727 prediction indicates a probable branch.
21729 @item -mbase-addresses
21730 @itemx -mno-base-addresses
21731 @opindex mbase-addresses
21732 @opindex mno-base-addresses
21733 Generate (do not generate) code that uses @emph{base addresses}.  Using a
21734 base address automatically generates a request (handled by the assembler
21735 and the linker) for a constant to be set up in a global register.  The
21736 register is used for one or more base address requests within the range 0
21737 to 255 from the value held in the register.  The generally leads to short
21738 and fast code, but the number of different data items that can be
21739 addressed is limited.  This means that a program that uses lots of static
21740 data may require @option{-mno-base-addresses}.
21742 @item -msingle-exit
21743 @itemx -mno-single-exit
21744 @opindex msingle-exit
21745 @opindex mno-single-exit
21746 Force (do not force) generated code to have a single exit point in each
21747 function.
21748 @end table
21750 @node MN10300 Options
21751 @subsection MN10300 Options
21752 @cindex MN10300 options
21754 These @option{-m} options are defined for Matsushita MN10300 architectures:
21756 @table @gcctabopt
21757 @item -mmult-bug
21758 @opindex mmult-bug
21759 Generate code to avoid bugs in the multiply instructions for the MN10300
21760 processors.  This is the default.
21762 @item -mno-mult-bug
21763 @opindex mno-mult-bug
21764 Do not generate code to avoid bugs in the multiply instructions for the
21765 MN10300 processors.
21767 @item -mam33
21768 @opindex mam33
21769 Generate code using features specific to the AM33 processor.
21771 @item -mno-am33
21772 @opindex mno-am33
21773 Do not generate code using features specific to the AM33 processor.  This
21774 is the default.
21776 @item -mam33-2
21777 @opindex mam33-2
21778 Generate code using features specific to the AM33/2.0 processor.
21780 @item -mam34
21781 @opindex mam34
21782 Generate code using features specific to the AM34 processor.
21784 @item -mtune=@var{cpu-type}
21785 @opindex mtune
21786 Use the timing characteristics of the indicated CPU type when
21787 scheduling instructions.  This does not change the targeted processor
21788 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
21789 @samp{am33-2} or @samp{am34}.
21791 @item -mreturn-pointer-on-d0
21792 @opindex mreturn-pointer-on-d0
21793 When generating a function that returns a pointer, return the pointer
21794 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
21795 only in @code{a0}, and attempts to call such functions without a prototype
21796 result in errors.  Note that this option is on by default; use
21797 @option{-mno-return-pointer-on-d0} to disable it.
21799 @item -mno-crt0
21800 @opindex mno-crt0
21801 Do not link in the C run-time initialization object file.
21803 @item -mrelax
21804 @opindex mrelax
21805 Indicate to the linker that it should perform a relaxation optimization pass
21806 to shorten branches, calls and absolute memory addresses.  This option only
21807 has an effect when used on the command line for the final link step.
21809 This option makes symbolic debugging impossible.
21811 @item -mliw
21812 @opindex mliw
21813 Allow the compiler to generate @emph{Long Instruction Word}
21814 instructions if the target is the @samp{AM33} or later.  This is the
21815 default.  This option defines the preprocessor macro @code{__LIW__}.
21817 @item -mnoliw
21818 @opindex mnoliw
21819 Do not allow the compiler to generate @emph{Long Instruction Word}
21820 instructions.  This option defines the preprocessor macro
21821 @code{__NO_LIW__}.
21823 @item -msetlb
21824 @opindex msetlb
21825 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
21826 instructions if the target is the @samp{AM33} or later.  This is the
21827 default.  This option defines the preprocessor macro @code{__SETLB__}.
21829 @item -mnosetlb
21830 @opindex mnosetlb
21831 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
21832 instructions.  This option defines the preprocessor macro
21833 @code{__NO_SETLB__}.
21835 @end table
21837 @node Moxie Options
21838 @subsection Moxie Options
21839 @cindex Moxie Options
21841 @table @gcctabopt
21843 @item -meb
21844 @opindex meb
21845 Generate big-endian code.  This is the default for @samp{moxie-*-*}
21846 configurations.
21848 @item -mel
21849 @opindex mel
21850 Generate little-endian code.
21852 @item -mmul.x
21853 @opindex mmul.x
21854 Generate mul.x and umul.x instructions.  This is the default for
21855 @samp{moxiebox-*-*} configurations.
21857 @item -mno-crt0
21858 @opindex mno-crt0
21859 Do not link in the C run-time initialization object file.
21861 @end table
21863 @node MSP430 Options
21864 @subsection MSP430 Options
21865 @cindex MSP430 Options
21867 These options are defined for the MSP430:
21869 @table @gcctabopt
21871 @item -masm-hex
21872 @opindex masm-hex
21873 Force assembly output to always use hex constants.  Normally such
21874 constants are signed decimals, but this option is available for
21875 testsuite and/or aesthetic purposes.
21877 @item -mmcu=
21878 @opindex mmcu=
21879 Select the MCU to target.  This is used to create a C preprocessor
21880 symbol based upon the MCU name, converted to upper case and pre- and
21881 post-fixed with @samp{__}.  This in turn is used by the
21882 @file{msp430.h} header file to select an MCU-specific supplementary
21883 header file.
21885 The option also sets the ISA to use.  If the MCU name is one that is
21886 known to only support the 430 ISA then that is selected, otherwise the
21887 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
21888 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
21889 name selects the 430X ISA.
21891 In addition an MCU-specific linker script is added to the linker
21892 command line.  The script's name is the name of the MCU with
21893 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
21894 command line defines the C preprocessor symbol @code{__XXX__} and
21895 cause the linker to search for a script called @file{xxx.ld}.
21897 This option is also passed on to the assembler.
21899 @item -mwarn-mcu
21900 @itemx -mno-warn-mcu
21901 @opindex mwarn-mcu
21902 @opindex mno-warn-mcu
21903 This option enables or disables warnings about conflicts between the
21904 MCU name specified by the @option{-mmcu} option and the ISA set by the
21905 @option{-mcpu} option and/or the hardware multiply support set by the
21906 @option{-mhwmult} option.  It also toggles warnings about unrecognized
21907 MCU names.  This option is on by default.
21909 @item -mcpu=
21910 @opindex mcpu=
21911 Specifies the ISA to use.  Accepted values are @samp{msp430},
21912 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
21913 @option{-mmcu=} option should be used to select the ISA.
21915 @item -msim
21916 @opindex msim
21917 Link to the simulator runtime libraries and linker script.  Overrides
21918 any scripts that would be selected by the @option{-mmcu=} option.
21920 @item -mlarge
21921 @opindex mlarge
21922 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
21924 @item -msmall
21925 @opindex msmall
21926 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
21928 @item -mrelax
21929 @opindex mrelax
21930 This option is passed to the assembler and linker, and allows the
21931 linker to perform certain optimizations that cannot be done until
21932 the final link.
21934 @item mhwmult=
21935 @opindex mhwmult=
21936 Describes the type of hardware multiply supported by the target.
21937 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
21938 for the original 16-bit-only multiply supported by early MCUs.
21939 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
21940 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
21941 A value of @samp{auto} can also be given.  This tells GCC to deduce
21942 the hardware multiply support based upon the MCU name provided by the
21943 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
21944 the MCU name is not recognized then no hardware multiply support is
21945 assumed.  @code{auto} is the default setting.
21947 Hardware multiplies are normally performed by calling a library
21948 routine.  This saves space in the generated code.  When compiling at
21949 @option{-O3} or higher however the hardware multiplier is invoked
21950 inline.  This makes for bigger, but faster code.
21952 The hardware multiply routines disable interrupts whilst running and
21953 restore the previous interrupt state when they finish.  This makes
21954 them safe to use inside interrupt handlers as well as in normal code.
21956 @item -minrt
21957 @opindex minrt
21958 Enable the use of a minimum runtime environment - no static
21959 initializers or constructors.  This is intended for memory-constrained
21960 devices.  The compiler includes special symbols in some objects
21961 that tell the linker and runtime which code fragments are required.
21963 @item -mcode-region=
21964 @itemx -mdata-region=
21965 @opindex mcode-region
21966 @opindex mdata-region
21967 These options tell the compiler where to place functions and data that
21968 do not have one of the @code{lower}, @code{upper}, @code{either} or
21969 @code{section} attributes.  Possible values are @code{lower},
21970 @code{upper}, @code{either} or @code{any}.  The first three behave
21971 like the corresponding attribute.  The fourth possible value -
21972 @code{any} - is the default.  It leaves placement entirely up to the
21973 linker script and how it assigns the standard sections
21974 (@code{.text}, @code{.data}, etc) to the memory regions.
21976 @item -msilicon-errata=
21977 @opindex msilicon-errata
21978 This option passes on a request to assembler to enable the fixes for
21979 the named silicon errata.
21981 @item -msilicon-errata-warn=
21982 @opindex msilicon-errata-warn
21983 This option passes on a request to the assembler to enable warning
21984 messages when a silicon errata might need to be applied.
21986 @end table
21988 @node NDS32 Options
21989 @subsection NDS32 Options
21990 @cindex NDS32 Options
21992 These options are defined for NDS32 implementations:
21994 @table @gcctabopt
21996 @item -mbig-endian
21997 @opindex mbig-endian
21998 Generate code in big-endian mode.
22000 @item -mlittle-endian
22001 @opindex mlittle-endian
22002 Generate code in little-endian mode.
22004 @item -mreduced-regs
22005 @opindex mreduced-regs
22006 Use reduced-set registers for register allocation.
22008 @item -mfull-regs
22009 @opindex mfull-regs
22010 Use full-set registers for register allocation.
22012 @item -mcmov
22013 @opindex mcmov
22014 Generate conditional move instructions.
22016 @item -mno-cmov
22017 @opindex mno-cmov
22018 Do not generate conditional move instructions.
22020 @item -mext-perf
22021 @opindex mperf-ext
22022 Generate performance extension instructions.
22024 @item -mno-ext-perf
22025 @opindex mno-perf-ext
22026 Do not generate performance extension instructions.
22028 @item -mext-perf2
22029 @opindex mperf-ext
22030 Generate performance extension 2 instructions.
22032 @item -mno-ext-perf2
22033 @opindex mno-perf-ext
22034 Do not generate performance extension 2 instructions.
22036 @item -mext-string
22037 @opindex mperf-ext
22038 Generate string extension instructions.
22040 @item -mno-ext-string
22041 @opindex mno-perf-ext
22042 Do not generate string extension instructions.
22044 @item -mv3push
22045 @opindex mv3push
22046 Generate v3 push25/pop25 instructions.
22048 @item -mno-v3push
22049 @opindex mno-v3push
22050 Do not generate v3 push25/pop25 instructions.
22052 @item -m16-bit
22053 @opindex m16-bit
22054 Generate 16-bit instructions.
22056 @item -mno-16-bit
22057 @opindex mno-16-bit
22058 Do not generate 16-bit instructions.
22060 @item -misr-vector-size=@var{num}
22061 @opindex misr-vector-size
22062 Specify the size of each interrupt vector, which must be 4 or 16.
22064 @item -mcache-block-size=@var{num}
22065 @opindex mcache-block-size
22066 Specify the size of each cache block,
22067 which must be a power of 2 between 4 and 512.
22069 @item -march=@var{arch}
22070 @opindex march
22071 Specify the name of the target architecture.
22073 @item -mcmodel=@var{code-model}
22074 @opindex mcmodel
22075 Set the code model to one of
22076 @table @asis
22077 @item @samp{small}
22078 All the data and read-only data segments must be within 512KB addressing space.
22079 The text segment must be within 16MB addressing space.
22080 @item @samp{medium}
22081 The data segment must be within 512KB while the read-only data segment can be
22082 within 4GB addressing space.  The text segment should be still within 16MB
22083 addressing space.
22084 @item @samp{large}
22085 All the text and data segments can be within 4GB addressing space.
22086 @end table
22088 @item -mctor-dtor
22089 @opindex mctor-dtor
22090 Enable constructor/destructor feature.
22092 @item -mrelax
22093 @opindex mrelax
22094 Guide linker to relax instructions.
22096 @end table
22098 @node Nios II Options
22099 @subsection Nios II Options
22100 @cindex Nios II options
22101 @cindex Altera Nios II options
22103 These are the options defined for the Altera Nios II processor.
22105 @table @gcctabopt
22107 @item -G @var{num}
22108 @opindex G
22109 @cindex smaller data references
22110 Put global and static objects less than or equal to @var{num} bytes
22111 into the small data or BSS sections instead of the normal data or BSS
22112 sections.  The default value of @var{num} is 8.
22114 @item -mgpopt=@var{option}
22115 @itemx -mgpopt
22116 @itemx -mno-gpopt
22117 @opindex mgpopt
22118 @opindex mno-gpopt
22119 Generate (do not generate) GP-relative accesses.  The following 
22120 @var{option} names are recognized:
22122 @table @samp
22124 @item none
22125 Do not generate GP-relative accesses.
22127 @item local
22128 Generate GP-relative accesses for small data objects that are not 
22129 external, weak, or uninitialized common symbols.  
22130 Also use GP-relative addressing for objects that
22131 have been explicitly placed in a small data section via a @code{section}
22132 attribute.
22134 @item global
22135 As for @samp{local}, but also generate GP-relative accesses for
22136 small data objects that are external, weak, or common.  If you use this option,
22137 you must ensure that all parts of your program (including libraries) are
22138 compiled with the same @option{-G} setting.
22140 @item data
22141 Generate GP-relative accesses for all data objects in the program.  If you
22142 use this option, the entire data and BSS segments
22143 of your program must fit in 64K of memory and you must use an appropriate
22144 linker script to allocate them within the addressable range of the
22145 global pointer.
22147 @item all
22148 Generate GP-relative addresses for function pointers as well as data
22149 pointers.  If you use this option, the entire text, data, and BSS segments
22150 of your program must fit in 64K of memory and you must use an appropriate
22151 linker script to allocate them within the addressable range of the
22152 global pointer.
22154 @end table
22156 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
22157 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
22159 The default is @option{-mgpopt} except when @option{-fpic} or
22160 @option{-fPIC} is specified to generate position-independent code.
22161 Note that the Nios II ABI does not permit GP-relative accesses from
22162 shared libraries.
22164 You may need to specify @option{-mno-gpopt} explicitly when building
22165 programs that include large amounts of small data, including large
22166 GOT data sections.  In this case, the 16-bit offset for GP-relative
22167 addressing may not be large enough to allow access to the entire 
22168 small data section.
22170 @item -mgprel-sec=@var{regexp}
22171 @opindex mgprel-sec
22172 This option specifies additional section names that can be accessed via
22173 GP-relative addressing.  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 This option does not affect the behavior of the @option{-G} option, and 
22179 the specified sections are in addition to the standard @code{.sdata}
22180 and @code{.sbss} small-data sections that are recognized by @option{-mgpopt}.
22182 @item -mr0rel-sec=@var{regexp}
22183 @opindex mr0rel-sec
22184 This option specifies names of sections that can be accessed via a 
22185 16-bit offset from @code{r0}; that is, in the low 32K or high 32K 
22186 of the 32-bit address space.  It is most useful in conjunction with 
22187 @code{section} attributes on variable declarations 
22188 (@pxref{Common Variable Attributes}) and a custom linker script.  
22189 The @var{regexp} is a POSIX Extended Regular Expression.
22191 In contrast to the use of GP-relative addressing for small data, 
22192 zero-based addressing is never generated by default and there are no 
22193 conventional section names used in standard linker scripts for sections
22194 in the low or high areas of memory.
22196 @item -mel
22197 @itemx -meb
22198 @opindex mel
22199 @opindex meb
22200 Generate little-endian (default) or big-endian (experimental) code,
22201 respectively.
22203 @item -march=@var{arch}
22204 @opindex march
22205 This specifies the name of the target Nios II architecture.  GCC uses this
22206 name to determine what kind of instructions it can emit when generating
22207 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
22209 The preprocessor macro @code{__nios2_arch__} is available to programs,
22210 with value 1 or 2, indicating the targeted ISA level.
22212 @item -mbypass-cache
22213 @itemx -mno-bypass-cache
22214 @opindex mno-bypass-cache
22215 @opindex mbypass-cache
22216 Force all load and store instructions to always bypass cache by 
22217 using I/O variants of the instructions. The default is not to
22218 bypass the cache.
22220 @item -mno-cache-volatile 
22221 @itemx -mcache-volatile       
22222 @opindex mcache-volatile 
22223 @opindex mno-cache-volatile
22224 Volatile memory access bypass the cache using the I/O variants of 
22225 the load and store instructions. The default is not to bypass the cache.
22227 @item -mno-fast-sw-div
22228 @itemx -mfast-sw-div
22229 @opindex mno-fast-sw-div
22230 @opindex mfast-sw-div
22231 Do not use table-based fast divide for small numbers. The default 
22232 is to use the fast divide at @option{-O3} and above.
22234 @item -mno-hw-mul
22235 @itemx -mhw-mul
22236 @itemx -mno-hw-mulx
22237 @itemx -mhw-mulx
22238 @itemx -mno-hw-div
22239 @itemx -mhw-div
22240 @opindex mno-hw-mul
22241 @opindex mhw-mul
22242 @opindex mno-hw-mulx
22243 @opindex mhw-mulx
22244 @opindex mno-hw-div
22245 @opindex mhw-div
22246 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
22247 instructions by the compiler. The default is to emit @code{mul}
22248 and not emit @code{div} and @code{mulx}.
22250 @item -mbmx
22251 @itemx -mno-bmx
22252 @itemx -mcdx
22253 @itemx -mno-cdx
22254 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
22255 CDX (code density) instructions.  Enabling these instructions also
22256 requires @option{-march=r2}.  Since these instructions are optional
22257 extensions to the R2 architecture, the default is not to emit them.
22259 @item -mcustom-@var{insn}=@var{N}
22260 @itemx -mno-custom-@var{insn}
22261 @opindex mcustom-@var{insn}
22262 @opindex mno-custom-@var{insn}
22263 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
22264 custom instruction with encoding @var{N} when generating code that uses 
22265 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
22266 instruction 253 for single-precision floating-point add operations instead
22267 of the default behavior of using a library call.
22269 The following values of @var{insn} are supported.  Except as otherwise
22270 noted, floating-point operations are expected to be implemented with
22271 normal IEEE 754 semantics and correspond directly to the C operators or the
22272 equivalent GCC built-in functions (@pxref{Other Builtins}).
22274 Single-precision floating point:
22275 @table @asis
22277 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
22278 Binary arithmetic operations.
22280 @item @samp{fnegs}
22281 Unary negation.
22283 @item @samp{fabss}
22284 Unary absolute value.
22286 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
22287 Comparison operations.
22289 @item @samp{fmins}, @samp{fmaxs}
22290 Floating-point minimum and maximum.  These instructions are only
22291 generated if @option{-ffinite-math-only} is specified.
22293 @item @samp{fsqrts}
22294 Unary square root operation.
22296 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
22297 Floating-point trigonometric and exponential functions.  These instructions
22298 are only generated if @option{-funsafe-math-optimizations} is also specified.
22300 @end table
22302 Double-precision floating point:
22303 @table @asis
22305 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
22306 Binary arithmetic operations.
22308 @item @samp{fnegd}
22309 Unary negation.
22311 @item @samp{fabsd}
22312 Unary absolute value.
22314 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
22315 Comparison operations.
22317 @item @samp{fmind}, @samp{fmaxd}
22318 Double-precision minimum and maximum.  These instructions are only
22319 generated if @option{-ffinite-math-only} is specified.
22321 @item @samp{fsqrtd}
22322 Unary square root operation.
22324 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
22325 Double-precision trigonometric and exponential functions.  These instructions
22326 are only generated if @option{-funsafe-math-optimizations} is also specified.
22328 @end table
22330 Conversions:
22331 @table @asis
22332 @item @samp{fextsd}
22333 Conversion from single precision to double precision.
22335 @item @samp{ftruncds}
22336 Conversion from double precision to single precision.
22338 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
22339 Conversion from floating point to signed or unsigned integer types, with
22340 truncation towards zero.
22342 @item @samp{round}
22343 Conversion from single-precision floating point to signed integer,
22344 rounding to the nearest integer and ties away from zero.
22345 This corresponds to the @code{__builtin_lroundf} function when
22346 @option{-fno-math-errno} is used.
22348 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
22349 Conversion from signed or unsigned integer types to floating-point types.
22351 @end table
22353 In addition, all of the following transfer instructions for internal
22354 registers X and Y must be provided to use any of the double-precision
22355 floating-point instructions.  Custom instructions taking two
22356 double-precision source operands expect the first operand in the
22357 64-bit register X.  The other operand (or only operand of a unary
22358 operation) is given to the custom arithmetic instruction with the
22359 least significant half in source register @var{src1} and the most
22360 significant half in @var{src2}.  A custom instruction that returns a
22361 double-precision result returns the most significant 32 bits in the
22362 destination register and the other half in 32-bit register Y.  
22363 GCC automatically generates the necessary code sequences to write
22364 register X and/or read register Y when double-precision floating-point
22365 instructions are used.
22367 @table @asis
22369 @item @samp{fwrx}
22370 Write @var{src1} into the least significant half of X and @var{src2} into
22371 the most significant half of X.
22373 @item @samp{fwry}
22374 Write @var{src1} into Y.
22376 @item @samp{frdxhi}, @samp{frdxlo}
22377 Read the most or least (respectively) significant half of X and store it in
22378 @var{dest}.
22380 @item @samp{frdy}
22381 Read the value of Y and store it into @var{dest}.
22382 @end table
22384 Note that you can gain more local control over generation of Nios II custom
22385 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
22386 and @code{target("no-custom-@var{insn}")} function attributes
22387 (@pxref{Function Attributes})
22388 or pragmas (@pxref{Function Specific Option Pragmas}).
22390 @item -mcustom-fpu-cfg=@var{name}
22391 @opindex mcustom-fpu-cfg
22393 This option enables a predefined, named set of custom instruction encodings
22394 (see @option{-mcustom-@var{insn}} above).  
22395 Currently, the following sets are defined:
22397 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
22398 @gccoptlist{-mcustom-fmuls=252 @gol
22399 -mcustom-fadds=253 @gol
22400 -mcustom-fsubs=254 @gol
22401 -fsingle-precision-constant}
22403 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
22404 @gccoptlist{-mcustom-fmuls=252 @gol
22405 -mcustom-fadds=253 @gol
22406 -mcustom-fsubs=254 @gol
22407 -mcustom-fdivs=255 @gol
22408 -fsingle-precision-constant}
22410 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
22411 @gccoptlist{-mcustom-floatus=243 @gol
22412 -mcustom-fixsi=244 @gol
22413 -mcustom-floatis=245 @gol
22414 -mcustom-fcmpgts=246 @gol
22415 -mcustom-fcmples=249 @gol
22416 -mcustom-fcmpeqs=250 @gol
22417 -mcustom-fcmpnes=251 @gol
22418 -mcustom-fmuls=252 @gol
22419 -mcustom-fadds=253 @gol
22420 -mcustom-fsubs=254 @gol
22421 -mcustom-fdivs=255 @gol
22422 -fsingle-precision-constant}
22424 Custom instruction assignments given by individual
22425 @option{-mcustom-@var{insn}=} options override those given by
22426 @option{-mcustom-fpu-cfg=}, regardless of the
22427 order of the options on the command line.
22429 Note that you can gain more local control over selection of a FPU
22430 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
22431 function attribute (@pxref{Function Attributes})
22432 or pragma (@pxref{Function Specific Option Pragmas}).
22434 @end table
22436 These additional @samp{-m} options are available for the Altera Nios II
22437 ELF (bare-metal) target:
22439 @table @gcctabopt
22441 @item -mhal
22442 @opindex mhal
22443 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
22444 startup and termination code, and is typically used in conjunction with
22445 @option{-msys-crt0=} to specify the location of the alternate startup code
22446 provided by the HAL BSP.
22448 @item -msmallc
22449 @opindex msmallc
22450 Link with a limited version of the C library, @option{-lsmallc}, rather than
22451 Newlib.
22453 @item -msys-crt0=@var{startfile}
22454 @opindex msys-crt0
22455 @var{startfile} is the file name of the startfile (crt0) to use 
22456 when linking.  This option is only useful in conjunction with @option{-mhal}.
22458 @item -msys-lib=@var{systemlib}
22459 @opindex msys-lib
22460 @var{systemlib} is the library name of the library that provides
22461 low-level system calls required by the C library,
22462 e.g. @code{read} and @code{write}.
22463 This option is typically used to link with a library provided by a HAL BSP.
22465 @end table
22467 @node Nvidia PTX Options
22468 @subsection Nvidia PTX Options
22469 @cindex Nvidia PTX options
22470 @cindex nvptx options
22472 These options are defined for Nvidia PTX:
22474 @table @gcctabopt
22476 @item -m32
22477 @itemx -m64
22478 @opindex m32
22479 @opindex m64
22480 Generate code for 32-bit or 64-bit ABI.
22482 @item -misa=@var{ISA-string}
22483 @opindex march
22484 Generate code for given the specified PTX ISA (e.g.@ @samp{sm_35}).  ISA
22485 strings must be lower-case.  Valid ISA strings include @samp{sm_30} and
22486 @samp{sm_35}.  The default ISA is sm_30.
22488 @item -mmainkernel
22489 @opindex mmainkernel
22490 Link in code for a __main kernel.  This is for stand-alone instead of
22491 offloading execution.
22493 @item -moptimize
22494 @opindex moptimize
22495 Apply partitioned execution optimizations.  This is the default when any
22496 level of optimization is selected.
22498 @item -msoft-stack
22499 @opindex msoft-stack
22500 Generate code that does not use @code{.local} memory
22501 directly for stack storage. Instead, a per-warp stack pointer is
22502 maintained explicitly. This enables variable-length stack allocation (with
22503 variable-length arrays or @code{alloca}), and when global memory is used for
22504 underlying storage, makes it possible to access automatic variables from other
22505 threads, or with atomic instructions. This code generation variant is used
22506 for OpenMP offloading, but the option is exposed on its own for the purpose
22507 of testing the compiler; to generate code suitable for linking into programs
22508 using OpenMP offloading, use option @option{-mgomp}.
22510 @item -muniform-simt
22511 @opindex muniform-simt
22512 Switch to code generation variant that allows to execute all threads in each
22513 warp, while maintaining memory state and side effects as if only one thread
22514 in each warp was active outside of OpenMP SIMD regions.  All atomic operations
22515 and calls to runtime (malloc, free, vprintf) are conditionally executed (iff
22516 current lane index equals the master lane index), and the register being
22517 assigned is copied via a shuffle instruction from the master lane.  Outside of
22518 SIMD regions lane 0 is the master; inside, each thread sees itself as the
22519 master.  Shared memory array @code{int __nvptx_uni[]} stores all-zeros or
22520 all-ones bitmasks for each warp, indicating current mode (0 outside of SIMD
22521 regions).  Each thread can bitwise-and the bitmask at position @code{tid.y}
22522 with current lane index to compute the master lane index.
22524 @item -mgomp
22525 @opindex mgomp
22526 Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and
22527 @option{-muniform-simt} options, and selects corresponding multilib variant.
22529 @end table
22531 @node PDP-11 Options
22532 @subsection PDP-11 Options
22533 @cindex PDP-11 Options
22535 These options are defined for the PDP-11:
22537 @table @gcctabopt
22538 @item -mfpu
22539 @opindex mfpu
22540 Use hardware FPP floating point.  This is the default.  (FIS floating
22541 point on the PDP-11/40 is not supported.)  Implies -m45.
22543 @item -msoft-float
22544 @opindex msoft-float
22545 Do not use hardware floating point.
22547 @item -mac0
22548 @opindex mac0
22549 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
22551 @item -mno-ac0
22552 @opindex mno-ac0
22553 Return floating-point results in memory.  This is the default.
22555 @item -m40
22556 @opindex m40
22557 Generate code for a PDP-11/40.  Implies -msoft-float -mno-split.
22559 @item -m45
22560 @opindex m45
22561 Generate code for a PDP-11/45.  This is the default.
22563 @item -m10
22564 @opindex m10
22565 Generate code for a PDP-11/10.  Implies -msoft-float -mno-split.
22567 @item -mint16
22568 @itemx -mno-int32
22569 @opindex mint16
22570 @opindex mno-int32
22571 Use 16-bit @code{int}.  This is the default.
22573 @item -mint32
22574 @itemx -mno-int16
22575 @opindex mint32
22576 @opindex mno-int16
22577 Use 32-bit @code{int}.
22579 @item -mfloat64
22580 @itemx -mno-float32
22581 @opindex mfloat64
22582 @opindex mno-float32
22583 Use 64-bit @code{float}.  This is the default.
22585 @item -mfloat32
22586 @itemx -mno-float64
22587 @opindex mfloat32
22588 @opindex mno-float64
22589 Use 32-bit @code{float}.
22591 @item -msplit
22592 @opindex msplit
22593 Target has split instruction and data space.  Implies -m45.
22595 @item -munix-asm
22596 @opindex munix-asm
22597 Use Unix assembler syntax.
22599 @item -mdec-asm
22600 @opindex mdec-asm
22601 Use DEC assembler syntax.
22603 @item -mgnu-asm
22604 @opindex mgnu-asm
22605 Use GNU assembler syntax.  This is the default.
22606 @end table
22608 @node picoChip Options
22609 @subsection picoChip Options
22610 @cindex picoChip options
22612 These @samp{-m} options are defined for picoChip implementations:
22614 @table @gcctabopt
22616 @item -mae=@var{ae_type}
22617 @opindex mcpu
22618 Set the instruction set, register set, and instruction scheduling
22619 parameters for array element type @var{ae_type}.  Supported values
22620 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
22622 @option{-mae=ANY} selects a completely generic AE type.  Code
22623 generated with this option runs on any of the other AE types.  The
22624 code is not as efficient as it would be if compiled for a specific
22625 AE type, and some types of operation (e.g., multiplication) do not
22626 work properly on all types of AE.
22628 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
22629 for compiled code, and is the default.
22631 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
22632 option may suffer from poor performance of byte (char) manipulation,
22633 since the DSP AE does not provide hardware support for byte load/stores.
22635 @item -msymbol-as-address
22636 Enable the compiler to directly use a symbol name as an address in a
22637 load/store instruction, without first loading it into a
22638 register.  Typically, the use of this option generates larger
22639 programs, which run faster than when the option isn't used.  However, the
22640 results vary from program to program, so it is left as a user option,
22641 rather than being permanently enabled.
22643 @item -mno-inefficient-warnings
22644 Disables warnings about the generation of inefficient code.  These
22645 warnings can be generated, for example, when compiling code that
22646 performs byte-level memory operations on the MAC AE type.  The MAC AE has
22647 no hardware support for byte-level memory operations, so all byte
22648 load/stores must be synthesized from word load/store operations.  This is
22649 inefficient and a warning is generated to indicate
22650 that you should rewrite the code to avoid byte operations, or to target
22651 an AE type that has the necessary hardware support.  This option disables
22652 these warnings.
22654 @end table
22656 @node PowerPC Options
22657 @subsection PowerPC Options
22658 @cindex PowerPC options
22660 These are listed under @xref{RS/6000 and PowerPC Options}.
22662 @node PowerPC SPE Options
22663 @subsection PowerPC SPE Options
22664 @cindex PowerPC SPE options
22666 These @samp{-m} options are defined for PowerPC SPE:
22667 @table @gcctabopt
22668 @item -mmfcrf
22669 @itemx -mno-mfcrf
22670 @itemx -mpopcntb
22671 @itemx -mno-popcntb
22672 @opindex mmfcrf
22673 @opindex mno-mfcrf
22674 @opindex mpopcntb
22675 @opindex mno-popcntb
22676 You use these options to specify which instructions are available on the
22677 processor you are using.  The default value of these options is
22678 determined when configuring GCC@.  Specifying the
22679 @option{-mcpu=@var{cpu_type}} overrides the specification of these
22680 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
22681 rather than the options listed above.
22683 The @option{-mmfcrf} option allows GCC to generate the move from
22684 condition register field instruction implemented on the POWER4
22685 processor and other processors that support the PowerPC V2.01
22686 architecture.
22687 The @option{-mpopcntb} option allows GCC to generate the popcount and
22688 double-precision FP reciprocal estimate instruction implemented on the
22689 POWER5 processor and other processors that support the PowerPC V2.02
22690 architecture.
22692 @item -mcpu=@var{cpu_type}
22693 @opindex mcpu
22694 Set architecture type, register usage, and
22695 instruction scheduling parameters for machine type @var{cpu_type}.
22696 Supported values for @var{cpu_type} are @samp{8540}, @samp{8548},
22697 and @samp{native}.
22699 @option{-mcpu=powerpc} specifies pure 32-bit PowerPC (either
22700 endian), with an appropriate, generic processor model assumed for
22701 scheduling purposes.
22703 Specifying @samp{native} as cpu type detects and selects the
22704 architecture option that corresponds to the host processor of the
22705 system performing the compilation.
22706 @option{-mcpu=native} has no effect if GCC does not recognize the
22707 processor.
22709 The other options specify a specific processor.  Code generated under
22710 those options runs best on that processor, and may not run at all on
22711 others.
22713 The @option{-mcpu} options automatically enable or disable the
22714 following options:
22716 @gccoptlist{-mhard-float  -mmfcrf  -mmultiple @gol
22717 -mpopcntb -mpopcntd @gol
22718 -msingle-float -mdouble-float @gol
22719 -mfloat128}
22721 The particular options set for any particular CPU varies between
22722 compiler versions, depending on what setting seems to produce optimal
22723 code for that CPU; it doesn't necessarily reflect the actual hardware's
22724 capabilities.  If you wish to set an individual option to a particular
22725 value, you may specify it after the @option{-mcpu} option, like
22726 @option{-mcpu=8548}.
22728 @item -mtune=@var{cpu_type}
22729 @opindex mtune
22730 Set the instruction scheduling parameters for machine type
22731 @var{cpu_type}, but do not set the architecture type or register usage,
22732 as @option{-mcpu=@var{cpu_type}} does.  The same
22733 values for @var{cpu_type} are used for @option{-mtune} as for
22734 @option{-mcpu}.  If both are specified, the code generated uses the
22735 architecture and registers set by @option{-mcpu}, but the
22736 scheduling parameters set by @option{-mtune}.
22738 @item -msecure-plt
22739 @opindex msecure-plt
22740 Generate code that allows @command{ld} and @command{ld.so}
22741 to build executables and shared
22742 libraries with non-executable @code{.plt} and @code{.got} sections.
22743 This is a PowerPC
22744 32-bit SYSV ABI option.
22746 @item -mbss-plt
22747 @opindex mbss-plt
22748 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
22749 fills in, and
22750 requires @code{.plt} and @code{.got}
22751 sections that are both writable and executable.
22752 This is a PowerPC 32-bit SYSV ABI option.
22754 @item -misel
22755 @itemx -mno-isel
22756 @opindex misel
22757 @opindex mno-isel
22758 This switch enables or disables the generation of ISEL instructions.
22760 @item -misel=@var{yes/no}
22761 This switch has been deprecated.  Use @option{-misel} and
22762 @option{-mno-isel} instead.
22764 @item -mspe
22765 @itemx -mno-spe
22766 @opindex mspe
22767 @opindex mno-spe
22768 This switch enables or disables the generation of SPE simd
22769 instructions.
22771 @item -mspe=@var{yes/no}
22772 This option has been deprecated.  Use @option{-mspe} and
22773 @option{-mno-spe} instead.
22775 @item -mfloat128
22776 @itemx -mno-float128
22777 @opindex mfloat128
22778 @opindex mno-float128
22779 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
22780 and use either software emulation for IEEE 128-bit floating point or
22781 hardware instructions.
22783 @item -mfloat-gprs=@var{yes/single/double/no}
22784 @itemx -mfloat-gprs
22785 @opindex mfloat-gprs
22786 This switch enables or disables the generation of floating-point
22787 operations on the general-purpose registers for architectures that
22788 support it.
22790 The argument @samp{yes} or @samp{single} enables the use of
22791 single-precision floating-point operations.
22793 The argument @samp{double} enables the use of single and
22794 double-precision floating-point operations.
22796 The argument @samp{no} disables floating-point operations on the
22797 general-purpose registers.
22799 This option is currently only available on the MPC854x.
22801 @item -mfull-toc
22802 @itemx -mno-fp-in-toc
22803 @itemx -mno-sum-in-toc
22804 @itemx -mminimal-toc
22805 @opindex mfull-toc
22806 @opindex mno-fp-in-toc
22807 @opindex mno-sum-in-toc
22808 @opindex mminimal-toc
22809 Modify generation of the TOC (Table Of Contents), which is created for
22810 every executable file.  The @option{-mfull-toc} option is selected by
22811 default.  In that case, GCC allocates at least one TOC entry for
22812 each unique non-automatic variable reference in your program.  GCC
22813 also places floating-point constants in the TOC@.  However, only
22814 16,384 entries are available in the TOC@.
22816 If you receive a linker error message that saying you have overflowed
22817 the available TOC space, you can reduce the amount of TOC space used
22818 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
22819 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
22820 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
22821 generate code to calculate the sum of an address and a constant at
22822 run time instead of putting that sum into the TOC@.  You may specify one
22823 or both of these options.  Each causes GCC to produce very slightly
22824 slower and larger code at the expense of conserving TOC space.
22826 If you still run out of space in the TOC even when you specify both of
22827 these options, specify @option{-mminimal-toc} instead.  This option causes
22828 GCC to make only one TOC entry for every file.  When you specify this
22829 option, GCC produces code that is slower and larger but which
22830 uses extremely little TOC space.  You may wish to use this option
22831 only on files that contain less frequently-executed code.
22833 @item -maix32
22834 @opindex maix32
22835 Disables the 64-bit ABI.  GCC defaults to @option{-maix32}.
22837 @item -mxl-compat
22838 @itemx -mno-xl-compat
22839 @opindex mxl-compat
22840 @opindex mno-xl-compat
22841 Produce code that conforms more closely to IBM XL compiler semantics
22842 when using AIX-compatible ABI@.  Pass floating-point arguments to
22843 prototyped functions beyond the register save area (RSA) on the stack
22844 in addition to argument FPRs.  Do not assume that most significant
22845 double in 128-bit long double value is properly rounded when comparing
22846 values and converting to double.  Use XL symbol names for long double
22847 support routines.
22849 The AIX calling convention was extended but not initially documented to
22850 handle an obscure K&R C case of calling a function that takes the
22851 address of its arguments with fewer arguments than declared.  IBM XL
22852 compilers access floating-point arguments that do not fit in the
22853 RSA from the stack when a subroutine is compiled without
22854 optimization.  Because always storing floating-point arguments on the
22855 stack is inefficient and rarely needed, this option is not enabled by
22856 default and only is necessary when calling subroutines compiled by IBM
22857 XL compilers without optimization.
22859 @item -malign-natural
22860 @itemx -malign-power
22861 @opindex malign-natural
22862 @opindex malign-power
22863 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
22864 @option{-malign-natural} overrides the ABI-defined alignment of larger
22865 types, such as floating-point doubles, on their natural size-based boundary.
22866 The option @option{-malign-power} instructs GCC to follow the ABI-specified
22867 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
22869 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
22870 is not supported.
22872 @item -msoft-float
22873 @itemx -mhard-float
22874 @opindex msoft-float
22875 @opindex mhard-float
22876 Generate code that does not use (uses) the floating-point register set.
22877 Software floating-point emulation is provided if you use the
22878 @option{-msoft-float} option, and pass the option to GCC when linking.
22880 @item -msingle-float
22881 @itemx -mdouble-float
22882 @opindex msingle-float
22883 @opindex mdouble-float
22884 Generate code for single- or double-precision floating-point operations.
22885 @option{-mdouble-float} implies @option{-msingle-float}.
22887 @item -mmultiple
22888 @itemx -mno-multiple
22889 @opindex mmultiple
22890 @opindex mno-multiple
22891 Generate code that uses (does not use) the load multiple word
22892 instructions and the store multiple word instructions.  These
22893 instructions are generated by default on POWER systems, and not
22894 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
22895 PowerPC systems, since those instructions do not work when the
22896 processor is in little-endian mode.  The exceptions are PPC740 and
22897 PPC750 which permit these instructions in little-endian mode.
22899 @item -mupdate
22900 @itemx -mno-update
22901 @opindex mupdate
22902 @opindex mno-update
22903 Generate code that uses (does not use) the load or store instructions
22904 that update the base register to the address of the calculated memory
22905 location.  These instructions are generated by default.  If you use
22906 @option{-mno-update}, there is a small window between the time that the
22907 stack pointer is updated and the address of the previous frame is
22908 stored, which means code that walks the stack frame across interrupts or
22909 signals may get corrupted data.
22911 @item -mavoid-indexed-addresses
22912 @itemx -mno-avoid-indexed-addresses
22913 @opindex mavoid-indexed-addresses
22914 @opindex mno-avoid-indexed-addresses
22915 Generate code that tries to avoid (not avoid) the use of indexed load
22916 or store instructions. These instructions can incur a performance
22917 penalty on Power6 processors in certain situations, such as when
22918 stepping through large arrays that cross a 16M boundary.  This option
22919 is enabled by default when targeting Power6 and disabled otherwise.
22921 @item -mfused-madd
22922 @itemx -mno-fused-madd
22923 @opindex mfused-madd
22924 @opindex mno-fused-madd
22925 Generate code that uses (does not use) the floating-point multiply and
22926 accumulate instructions.  These instructions are generated by default
22927 if hardware floating point is used.  The machine-dependent
22928 @option{-mfused-madd} option is now mapped to the machine-independent
22929 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
22930 mapped to @option{-ffp-contract=off}.
22932 @item -mno-strict-align
22933 @itemx -mstrict-align
22934 @opindex mno-strict-align
22935 @opindex mstrict-align
22936 On System V.4 and embedded PowerPC systems do not (do) assume that
22937 unaligned memory references are handled by the system.
22939 @item -mrelocatable
22940 @itemx -mno-relocatable
22941 @opindex mrelocatable
22942 @opindex mno-relocatable
22943 Generate code that allows (does not allow) a static executable to be
22944 relocated to a different address at run time.  A simple embedded
22945 PowerPC system loader should relocate the entire contents of
22946 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
22947 a table of 32-bit addresses generated by this option.  For this to
22948 work, all objects linked together must be compiled with
22949 @option{-mrelocatable} or @option{-mrelocatable-lib}.
22950 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
22952 @item -mrelocatable-lib
22953 @itemx -mno-relocatable-lib
22954 @opindex mrelocatable-lib
22955 @opindex mno-relocatable-lib
22956 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
22957 @code{.fixup} section to allow static executables to be relocated at
22958 run time, but @option{-mrelocatable-lib} does not use the smaller stack
22959 alignment of @option{-mrelocatable}.  Objects compiled with
22960 @option{-mrelocatable-lib} may be linked with objects compiled with
22961 any combination of the @option{-mrelocatable} options.
22963 @item -mno-toc
22964 @itemx -mtoc
22965 @opindex mno-toc
22966 @opindex mtoc
22967 On System V.4 and embedded PowerPC systems do not (do) assume that
22968 register 2 contains a pointer to a global area pointing to the addresses
22969 used in the program.
22971 @item -mlittle
22972 @itemx -mlittle-endian
22973 @opindex mlittle
22974 @opindex mlittle-endian
22975 On System V.4 and embedded PowerPC systems compile code for the
22976 processor in little-endian mode.  The @option{-mlittle-endian} option is
22977 the same as @option{-mlittle}.
22979 @item -mbig
22980 @itemx -mbig-endian
22981 @opindex mbig
22982 @opindex mbig-endian
22983 On System V.4 and embedded PowerPC systems compile code for the
22984 processor in big-endian mode.  The @option{-mbig-endian} option is
22985 the same as @option{-mbig}.
22987 @item -mdynamic-no-pic
22988 @opindex mdynamic-no-pic
22989 On Darwin and Mac OS X systems, compile code so that it is not
22990 relocatable, but that its external references are relocatable.  The
22991 resulting code is suitable for applications, but not shared
22992 libraries.
22994 @item -msingle-pic-base
22995 @opindex msingle-pic-base
22996 Treat the register used for PIC addressing as read-only, rather than
22997 loading it in the prologue for each function.  The runtime system is
22998 responsible for initializing this register with an appropriate value
22999 before execution begins.
23001 @item -mprioritize-restricted-insns=@var{priority}
23002 @opindex mprioritize-restricted-insns
23003 This option controls the priority that is assigned to
23004 dispatch-slot restricted instructions during the second scheduling
23005 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
23006 or @samp{2} to assign no, highest, or second-highest (respectively)
23007 priority to dispatch-slot restricted
23008 instructions.
23010 @item -msched-costly-dep=@var{dependence_type}
23011 @opindex msched-costly-dep
23012 This option controls which dependences are considered costly
23013 by the target during instruction scheduling.  The argument
23014 @var{dependence_type} takes one of the following values:
23016 @table @asis
23017 @item @samp{no}
23018 No dependence is costly.
23020 @item @samp{all}
23021 All dependences are costly.
23023 @item @samp{true_store_to_load}
23024 A true dependence from store to load is costly.
23026 @item @samp{store_to_load}
23027 Any dependence from store to load is costly.
23029 @item @var{number}
23030 Any dependence for which the latency is greater than or equal to
23031 @var{number} is costly.
23032 @end table
23034 @item -minsert-sched-nops=@var{scheme}
23035 @opindex minsert-sched-nops
23036 This option controls which NOP insertion scheme is used during
23037 the second scheduling pass.  The argument @var{scheme} takes one of the
23038 following values:
23040 @table @asis
23041 @item @samp{no}
23042 Don't insert NOPs.
23044 @item @samp{pad}
23045 Pad with NOPs any dispatch group that has vacant issue slots,
23046 according to the scheduler's grouping.
23048 @item @samp{regroup_exact}
23049 Insert NOPs to force costly dependent insns into
23050 separate groups.  Insert exactly as many NOPs as needed to force an insn
23051 to a new group, according to the estimated processor grouping.
23053 @item @var{number}
23054 Insert NOPs to force costly dependent insns into
23055 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
23056 @end table
23058 @item -mcall-sysv
23059 @opindex mcall-sysv
23060 On System V.4 and embedded PowerPC systems compile code using calling
23061 conventions that adhere to the March 1995 draft of the System V
23062 Application Binary Interface, PowerPC processor supplement.  This is the
23063 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
23065 @item -mcall-sysv-eabi
23066 @itemx -mcall-eabi
23067 @opindex mcall-sysv-eabi
23068 @opindex mcall-eabi
23069 Specify both @option{-mcall-sysv} and @option{-meabi} options.
23071 @item -mcall-sysv-noeabi
23072 @opindex mcall-sysv-noeabi
23073 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
23075 @item -mcall-aixdesc
23076 @opindex m
23077 On System V.4 and embedded PowerPC systems compile code for the AIX
23078 operating system.
23080 @item -mcall-linux
23081 @opindex mcall-linux
23082 On System V.4 and embedded PowerPC systems compile code for the
23083 Linux-based GNU system.
23085 @item -mcall-freebsd
23086 @opindex mcall-freebsd
23087 On System V.4 and embedded PowerPC systems compile code for the
23088 FreeBSD operating system.
23090 @item -mcall-netbsd
23091 @opindex mcall-netbsd
23092 On System V.4 and embedded PowerPC systems compile code for the
23093 NetBSD operating system.
23095 @item -mcall-openbsd
23096 @opindex mcall-netbsd
23097 On System V.4 and embedded PowerPC systems compile code for the
23098 OpenBSD operating system.
23100 @item -maix-struct-return
23101 @opindex maix-struct-return
23102 Return all structures in memory (as specified by the AIX ABI)@.
23104 @item -msvr4-struct-return
23105 @opindex msvr4-struct-return
23106 Return structures smaller than 8 bytes in registers (as specified by the
23107 SVR4 ABI)@.
23109 @item -mabi=@var{abi-type}
23110 @opindex mabi
23111 Extend the current ABI with a particular extension, or remove such extension.
23112 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
23113 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
23114 @samp{elfv1}, @samp{elfv2}@.
23116 @item -mabi=spe
23117 @opindex mabi=spe
23118 Extend the current ABI with SPE ABI extensions.  This does not change
23119 the default ABI, instead it adds the SPE ABI extensions to the current
23120 ABI@.
23122 @item -mabi=no-spe
23123 @opindex mabi=no-spe
23124 Disable Book-E SPE ABI extensions for the current ABI@.
23126 @item -mabi=ibmlongdouble
23127 @opindex mabi=ibmlongdouble
23128 Change the current ABI to use IBM extended-precision long double.
23129 This is not likely to work if your system defaults to using IEEE
23130 extended-precision long double.  If you change the long double type
23131 from IEEE extended-precision, the compiler will issue a warning unless
23132 you use the @option{-Wno-psabi} option.
23134 @item -mabi=ieeelongdouble
23135 @opindex mabi=ieeelongdouble
23136 Change the current ABI to use IEEE extended-precision long double.
23137 This is not likely to work if your system defaults to using IBM
23138 extended-precision long double.  If you change the long double type
23139 from IBM extended-precision, the compiler will issue a warning unless
23140 you use the @option{-Wno-psabi} option.
23142 @item -mabi=elfv1
23143 @opindex mabi=elfv1
23144 Change the current ABI to use the ELFv1 ABI.
23145 This is the default ABI for big-endian PowerPC 64-bit Linux.
23146 Overriding the default ABI requires special system support and is
23147 likely to fail in spectacular ways.
23149 @item -mabi=elfv2
23150 @opindex mabi=elfv2
23151 Change the current ABI to use the ELFv2 ABI.
23152 This is the default ABI for little-endian PowerPC 64-bit Linux.
23153 Overriding the default ABI requires special system support and is
23154 likely to fail in spectacular ways.
23156 @item -mgnu-attribute
23157 @itemx -mno-gnu-attribute
23158 @opindex mgnu-attribute
23159 @opindex mno-gnu-attribute
23160 Emit .gnu_attribute assembly directives to set tag/value pairs in a
23161 .gnu.attributes section that specify ABI variations in function
23162 parameters or return values.
23164 @item -mprototype
23165 @itemx -mno-prototype
23166 @opindex mprototype
23167 @opindex mno-prototype
23168 On System V.4 and embedded PowerPC systems assume that all calls to
23169 variable argument functions are properly prototyped.  Otherwise, the
23170 compiler must insert an instruction before every non-prototyped call to
23171 set or clear bit 6 of the condition code register (@code{CR}) to
23172 indicate whether floating-point values are passed in the floating-point
23173 registers in case the function takes variable arguments.  With
23174 @option{-mprototype}, only calls to prototyped variable argument functions
23175 set or clear the bit.
23177 @item -msim
23178 @opindex msim
23179 On embedded PowerPC systems, assume that the startup module is called
23180 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
23181 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
23182 configurations.
23184 @item -mmvme
23185 @opindex mmvme
23186 On embedded PowerPC systems, assume that the startup module is called
23187 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
23188 @file{libc.a}.
23190 @item -mads
23191 @opindex mads
23192 On embedded PowerPC systems, assume that the startup module is called
23193 @file{crt0.o} and the standard C libraries are @file{libads.a} and
23194 @file{libc.a}.
23196 @item -myellowknife
23197 @opindex myellowknife
23198 On embedded PowerPC systems, assume that the startup module is called
23199 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
23200 @file{libc.a}.
23202 @item -mvxworks
23203 @opindex mvxworks
23204 On System V.4 and embedded PowerPC systems, specify that you are
23205 compiling for a VxWorks system.
23207 @item -memb
23208 @opindex memb
23209 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
23210 header to indicate that @samp{eabi} extended relocations are used.
23212 @item -meabi
23213 @itemx -mno-eabi
23214 @opindex meabi
23215 @opindex mno-eabi
23216 On System V.4 and embedded PowerPC systems do (do not) adhere to the
23217 Embedded Applications Binary Interface (EABI), which is a set of
23218 modifications to the System V.4 specifications.  Selecting @option{-meabi}
23219 means that the stack is aligned to an 8-byte boundary, a function
23220 @code{__eabi} is called from @code{main} to set up the EABI
23221 environment, and the @option{-msdata} option can use both @code{r2} and
23222 @code{r13} to point to two separate small data areas.  Selecting
23223 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
23224 no EABI initialization function is called from @code{main}, and the
23225 @option{-msdata} option only uses @code{r13} to point to a single
23226 small data area.  The @option{-meabi} option is on by default if you
23227 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
23229 @item -msdata=eabi
23230 @opindex msdata=eabi
23231 On System V.4 and embedded PowerPC systems, put small initialized
23232 @code{const} global and static data in the @code{.sdata2} section, which
23233 is pointed to by register @code{r2}.  Put small initialized
23234 non-@code{const} global and static data in the @code{.sdata} section,
23235 which is pointed to by register @code{r13}.  Put small uninitialized
23236 global and static data in the @code{.sbss} section, which is adjacent to
23237 the @code{.sdata} section.  The @option{-msdata=eabi} option is
23238 incompatible with the @option{-mrelocatable} option.  The
23239 @option{-msdata=eabi} option also sets the @option{-memb} option.
23241 @item -msdata=sysv
23242 @opindex msdata=sysv
23243 On System V.4 and embedded PowerPC systems, put small global and static
23244 data in the @code{.sdata} section, which is pointed to by register
23245 @code{r13}.  Put small uninitialized global and static data in the
23246 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
23247 The @option{-msdata=sysv} option is incompatible with the
23248 @option{-mrelocatable} option.
23250 @item -msdata=default
23251 @itemx -msdata
23252 @opindex msdata=default
23253 @opindex msdata
23254 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
23255 compile code the same as @option{-msdata=eabi}, otherwise compile code the
23256 same as @option{-msdata=sysv}.
23258 @item -msdata=data
23259 @opindex msdata=data
23260 On System V.4 and embedded PowerPC systems, put small global
23261 data in the @code{.sdata} section.  Put small uninitialized global
23262 data in the @code{.sbss} section.  Do not use register @code{r13}
23263 to address small data however.  This is the default behavior unless
23264 other @option{-msdata} options are used.
23266 @item -msdata=none
23267 @itemx -mno-sdata
23268 @opindex msdata=none
23269 @opindex mno-sdata
23270 On embedded PowerPC systems, put all initialized global and static data
23271 in the @code{.data} section, and all uninitialized data in the
23272 @code{.bss} section.
23274 @item -mblock-move-inline-limit=@var{num}
23275 @opindex mblock-move-inline-limit
23276 Inline all block moves (such as calls to @code{memcpy} or structure
23277 copies) less than or equal to @var{num} bytes.  The minimum value for
23278 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
23279 targets.  The default value is target-specific.
23281 @item -G @var{num}
23282 @opindex G
23283 @cindex smaller data references (PowerPC)
23284 @cindex .sdata/.sdata2 references (PowerPC)
23285 On embedded PowerPC systems, put global and static items less than or
23286 equal to @var{num} bytes into the small data or BSS sections instead of
23287 the normal data or BSS section.  By default, @var{num} is 8.  The
23288 @option{-G @var{num}} switch is also passed to the linker.
23289 All modules should be compiled with the same @option{-G @var{num}} value.
23291 @item -mregnames
23292 @itemx -mno-regnames
23293 @opindex mregnames
23294 @opindex mno-regnames
23295 On System V.4 and embedded PowerPC systems do (do not) emit register
23296 names in the assembly language output using symbolic forms.
23298 @item -mlongcall
23299 @itemx -mno-longcall
23300 @opindex mlongcall
23301 @opindex mno-longcall
23302 By default assume that all calls are far away so that a longer and more
23303 expensive calling sequence is required.  This is required for calls
23304 farther than 32 megabytes (33,554,432 bytes) from the current location.
23305 A short call is generated if the compiler knows
23306 the call cannot be that far away.  This setting can be overridden by
23307 the @code{shortcall} function attribute, or by @code{#pragma
23308 longcall(0)}.
23310 Some linkers are capable of detecting out-of-range calls and generating
23311 glue code on the fly.  On these systems, long calls are unnecessary and
23312 generate slower code.  As of this writing, the AIX linker can do this,
23313 as can the GNU linker for PowerPC/64.  It is planned to add this feature
23314 to the GNU linker for 32-bit PowerPC systems as well.
23316 In the future, GCC may ignore all longcall specifications
23317 when the linker is known to generate glue.
23319 @item -mtls-markers
23320 @itemx -mno-tls-markers
23321 @opindex mtls-markers
23322 @opindex mno-tls-markers
23323 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
23324 specifying the function argument.  The relocation allows the linker to
23325 reliably associate function call with argument setup instructions for
23326 TLS optimization, which in turn allows GCC to better schedule the
23327 sequence.
23329 @item -mrecip
23330 @itemx -mno-recip
23331 @opindex mrecip
23332 This option enables use of the reciprocal estimate and
23333 reciprocal square root estimate instructions with additional
23334 Newton-Raphson steps to increase precision instead of doing a divide or
23335 square root and divide for floating-point arguments.  You should use
23336 the @option{-ffast-math} option when using @option{-mrecip} (or at
23337 least @option{-funsafe-math-optimizations},
23338 @option{-ffinite-math-only}, @option{-freciprocal-math} and
23339 @option{-fno-trapping-math}).  Note that while the throughput of the
23340 sequence is generally higher than the throughput of the non-reciprocal
23341 instruction, the precision of the sequence can be decreased by up to 2
23342 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
23343 roots.
23345 @item -mrecip=@var{opt}
23346 @opindex mrecip=opt
23347 This option controls which reciprocal estimate instructions
23348 may be used.  @var{opt} is a comma-separated list of options, which may
23349 be preceded by a @code{!} to invert the option:
23351 @table @samp
23353 @item all
23354 Enable all estimate instructions.
23356 @item default
23357 Enable the default instructions, equivalent to @option{-mrecip}.
23359 @item none
23360 Disable all estimate instructions, equivalent to @option{-mno-recip}.
23362 @item div
23363 Enable the reciprocal approximation instructions for both
23364 single and double precision.
23366 @item divf
23367 Enable the single-precision reciprocal approximation instructions.
23369 @item divd
23370 Enable the double-precision reciprocal approximation instructions.
23372 @item rsqrt
23373 Enable the reciprocal square root approximation instructions for both
23374 single and double precision.
23376 @item rsqrtf
23377 Enable the single-precision reciprocal square root approximation instructions.
23379 @item rsqrtd
23380 Enable the double-precision reciprocal square root approximation instructions.
23382 @end table
23384 So, for example, @option{-mrecip=all,!rsqrtd} enables
23385 all of the reciprocal estimate instructions, except for the
23386 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
23387 which handle the double-precision reciprocal square root calculations.
23389 @item -mrecip-precision
23390 @itemx -mno-recip-precision
23391 @opindex mrecip-precision
23392 Assume (do not assume) that the reciprocal estimate instructions
23393 provide higher-precision estimates than is mandated by the PowerPC
23394 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
23395 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
23396 The double-precision square root estimate instructions are not generated by
23397 default on low-precision machines, since they do not provide an
23398 estimate that converges after three steps.
23400 @item -mpointers-to-nested-functions
23401 @itemx -mno-pointers-to-nested-functions
23402 @opindex mpointers-to-nested-functions
23403 Generate (do not generate) code to load up the static chain register
23404 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
23405 systems where a function pointer points to a 3-word descriptor giving
23406 the function address, TOC value to be loaded in register @code{r2}, and
23407 static chain value to be loaded in register @code{r11}.  The
23408 @option{-mpointers-to-nested-functions} is on by default.  You cannot
23409 call through pointers to nested functions or pointers
23410 to functions compiled in other languages that use the static chain if
23411 you use @option{-mno-pointers-to-nested-functions}.
23413 @item -msave-toc-indirect
23414 @itemx -mno-save-toc-indirect
23415 @opindex msave-toc-indirect
23416 Generate (do not generate) code to save the TOC value in the reserved
23417 stack location in the function prologue if the function calls through
23418 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
23419 saved in the prologue, it is saved just before the call through the
23420 pointer.  The @option{-mno-save-toc-indirect} option is the default.
23422 @item -mcompat-align-parm
23423 @itemx -mno-compat-align-parm
23424 @opindex mcompat-align-parm
23425 Generate (do not generate) code to pass structure parameters with a
23426 maximum alignment of 64 bits, for compatibility with older versions
23427 of GCC.
23429 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
23430 structure parameter on a 128-bit boundary when that structure contained
23431 a member requiring 128-bit alignment.  This is corrected in more
23432 recent versions of GCC.  This option may be used to generate code
23433 that is compatible with functions compiled with older versions of
23434 GCC.
23436 The @option{-mno-compat-align-parm} option is the default.
23438 @item -mstack-protector-guard=@var{guard}
23439 @itemx -mstack-protector-guard-reg=@var{reg}
23440 @itemx -mstack-protector-guard-offset=@var{offset}
23441 @itemx -mstack-protector-guard-symbol=@var{symbol}
23442 @opindex mstack-protector-guard
23443 @opindex mstack-protector-guard-reg
23444 @opindex mstack-protector-guard-offset
23445 @opindex mstack-protector-guard-symbol
23446 Generate stack protection code using canary at @var{guard}.  Supported
23447 locations are @samp{global} for global canary or @samp{tls} for per-thread
23448 canary in the TLS block (the default with GNU libc version 2.4 or later).
23450 With the latter choice the options
23451 @option{-mstack-protector-guard-reg=@var{reg}} and
23452 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
23453 which register to use as base register for reading the canary, and from what
23454 offset from that base register. The default for those is as specified in the
23455 relevant ABI.  @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
23456 the offset with a symbol reference to a canary in the TLS block.
23457 @end table
23460 @node RISC-V Options
23461 @subsection RISC-V Options
23462 @cindex RISC-V Options
23464 These command-line options are defined for RISC-V targets:
23466 @table @gcctabopt
23467 @item -mbranch-cost=@var{n}
23468 @opindex mbranch-cost
23469 Set the cost of branches to roughly @var{n} instructions.
23471 @item -mplt
23472 @itemx -mno-plt
23473 @opindex plt
23474 When generating PIC code, do or don't allow the use of PLTs. Ignored for
23475 non-PIC.  The default is @option{-mplt}.
23477 @item -mabi=@var{ABI-string}
23478 @opindex mabi
23479 Specify integer and floating-point calling convention.  @var{ABI-string}
23480 contains two parts: the size of integer types and the registers used for
23481 floating-point types.  For example @samp{-march=rv64ifd -mabi=lp64d} means that
23482 @samp{long} and pointers are 64-bit (implicitly defining @samp{int} to be
23483 32-bit), and that floating-point values up to 64 bits wide are passed in F
23484 registers.  Contrast this with @samp{-march=rv64ifd -mabi=lp64f}, which still
23485 allows the compiler to generate code that uses the F and D extensions but only
23486 allows floating-point values up to 32 bits long to be passed in registers; or
23487 @samp{-march=rv64ifd -mabi=lp64}, in which no floating-point arguments will be
23488 passed in registers.
23490 The default for this argument is system dependent, users who want a specific
23491 calling convention should specify one explicitly.  The valid calling
23492 conventions are: @samp{ilp32}, @samp{ilp32f}, @samp{ilp32d}, @samp{lp64},
23493 @samp{lp64f}, and @samp{lp64d}.  Some calling conventions are impossible to
23494 implement on some ISAs: for example, @samp{-march=rv32if -mabi=ilp32d} is
23495 invalid because the ABI requires 64-bit values be passed in F registers, but F
23496 registers are only 32 bits wide.  There is also the @samp{ilp32e} ABI that can
23497 only be used with the @samp{rv32e} architecture.  This ABI is not well
23498 specified at present, and is subject to change.
23500 @item -mfdiv
23501 @itemx -mno-fdiv
23502 @opindex mfdiv
23503 Do or don't use hardware floating-point divide and square root instructions.
23504 This requires the F or D extensions for floating-point registers.  The default
23505 is to use them if the specified architecture has these instructions.
23507 @item -mdiv
23508 @itemx -mno-div
23509 @opindex mdiv
23510 Do or don't use hardware instructions for integer division.  This requires the
23511 M extension.  The default is to use them if the specified architecture has
23512 these instructions.
23514 @item -march=@var{ISA-string}
23515 @opindex march
23516 Generate code for given RISC-V ISA (e.g.@ @samp{rv64im}).  ISA strings must be
23517 lower-case.  Examples include @samp{rv64i}, @samp{rv32g}, @samp{rv32e}, and
23518 @samp{rv32imaf}.
23520 @item -mtune=@var{processor-string}
23521 @opindex mtune
23522 Optimize the output for the given processor, specified by microarchitecture
23523 name.
23525 @item -mpreferred-stack-boundary=@var{num}
23526 @opindex mpreferred-stack-boundary
23527 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
23528 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
23529 the default is 4 (16 bytes or 128-bits).
23531 @strong{Warning:} If you use this switch, then you must build all modules with
23532 the same value, including any libraries.  This includes the system libraries
23533 and startup modules.
23535 @item -msmall-data-limit=@var{n}
23536 @opindex msmall-data-limit
23537 Put global and static data smaller than @var{n} bytes into a special section
23538 (on some targets).
23540 @item -msave-restore
23541 @itemx -mno-save-restore
23542 @opindex msave-restore
23543 Do or don't use smaller but slower prologue and epilogue code that uses
23544 library function calls.  The default is to use fast inline prologues and
23545 epilogues.
23547 @item -mstrict-align
23548 @itemx -mno-strict-align
23549 @opindex mstrict-align
23550 Do not or do generate unaligned memory accesses.  The default is set depending
23551 on whether the processor we are optimizing for supports fast unaligned access
23552 or not.
23554 @item -mcmodel=medlow
23555 @opindex mcmodel=medlow
23556 Generate code for the medium-low code model. The program and its statically
23557 defined symbols must lie within a single 2 GiB address range and must lie
23558 between absolute addresses @minus{}2 GiB and +2 GiB. Programs can be
23559 statically or dynamically linked. This is the default code model.
23561 @item -mcmodel=medany
23562 @opindex mcmodel=medany
23563 Generate code for the medium-any code model. The program and its statically
23564 defined symbols must be within any single 2 GiB address range. Programs can be
23565 statically or dynamically linked.
23567 @item -mexplicit-relocs
23568 @itemx -mno-exlicit-relocs
23569 Use or do not use assembler relocation operators when dealing with symbolic
23570 addresses.  The alternative is to use assembler macros instead, which may
23571 limit optimization.
23573 @item -mrelax
23574 @itemx -mno-relax
23575 Take advantage of linker relaxations to reduce the number of instructions
23576 required to materialize symbol addresses. The default is to take advantage of
23577 linker relaxations.
23579 @end table
23581 @node RL78 Options
23582 @subsection RL78 Options
23583 @cindex RL78 Options
23585 @table @gcctabopt
23587 @item -msim
23588 @opindex msim
23589 Links in additional target libraries to support operation within a
23590 simulator.
23592 @item -mmul=none
23593 @itemx -mmul=g10
23594 @itemx -mmul=g13
23595 @itemx -mmul=g14
23596 @itemx -mmul=rl78
23597 @opindex mmul
23598 Specifies the type of hardware multiplication and division support to
23599 be used.  The simplest is @code{none}, which uses software for both
23600 multiplication and division.  This is the default.  The @code{g13}
23601 value is for the hardware multiply/divide peripheral found on the
23602 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
23603 the multiplication and division instructions supported by the RL78/G14
23604 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
23605 the value @code{mg10} is an alias for @code{none}.
23607 In addition a C preprocessor macro is defined, based upon the setting
23608 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
23609 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
23611 @item -mcpu=g10
23612 @itemx -mcpu=g13
23613 @itemx -mcpu=g14
23614 @itemx -mcpu=rl78
23615 @opindex mcpu
23616 Specifies the RL78 core to target.  The default is the G14 core, also
23617 known as an S3 core or just RL78.  The G13 or S2 core does not have
23618 multiply or divide instructions, instead it uses a hardware peripheral
23619 for these operations.  The G10 or S1 core does not have register
23620 banks, so it uses a different calling convention.
23622 If this option is set it also selects the type of hardware multiply
23623 support to use, unless this is overridden by an explicit
23624 @option{-mmul=none} option on the command line.  Thus specifying
23625 @option{-mcpu=g13} enables the use of the G13 hardware multiply
23626 peripheral and specifying @option{-mcpu=g10} disables the use of
23627 hardware multiplications altogether.
23629 Note, although the RL78/G14 core is the default target, specifying
23630 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
23631 change the behavior of the toolchain since it also enables G14
23632 hardware multiply support.  If these options are not specified on the
23633 command line then software multiplication routines will be used even
23634 though the code targets the RL78 core.  This is for backwards
23635 compatibility with older toolchains which did not have hardware
23636 multiply and divide support.
23638 In addition a C preprocessor macro is defined, based upon the setting
23639 of this option.  Possible values are: @code{__RL78_G10__},
23640 @code{__RL78_G13__} or @code{__RL78_G14__}.
23642 @item -mg10
23643 @itemx -mg13
23644 @itemx -mg14
23645 @itemx -mrl78
23646 @opindex mg10
23647 @opindex mg13
23648 @opindex mg14
23649 @opindex mrl78
23650 These are aliases for the corresponding @option{-mcpu=} option.  They
23651 are provided for backwards compatibility.
23653 @item -mallregs
23654 @opindex mallregs
23655 Allow the compiler to use all of the available registers.  By default
23656 registers @code{r24..r31} are reserved for use in interrupt handlers.
23657 With this option enabled these registers can be used in ordinary
23658 functions as well.
23660 @item -m64bit-doubles
23661 @itemx -m32bit-doubles
23662 @opindex m64bit-doubles
23663 @opindex m32bit-doubles
23664 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
23665 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
23666 @option{-m32bit-doubles}.
23668 @item -msave-mduc-in-interrupts
23669 @itemx -mno-save-mduc-in-interrupts
23670 @opindex msave-mduc-in-interrupts
23671 @opindex mno-save-mduc-in-interrupts
23672 Specifies that interrupt handler functions should preserve the
23673 MDUC registers.  This is only necessary if normal code might use
23674 the MDUC registers, for example because it performs multiplication
23675 and division operations.  The default is to ignore the MDUC registers
23676 as this makes the interrupt handlers faster.  The target option -mg13
23677 needs to be passed for this to work as this feature is only available
23678 on the G13 target (S2 core).  The MDUC registers will only be saved
23679 if the interrupt handler performs a multiplication or division
23680 operation or it calls another function.
23682 @end table
23684 @node RS/6000 and PowerPC Options
23685 @subsection IBM RS/6000 and PowerPC Options
23686 @cindex RS/6000 and PowerPC Options
23687 @cindex IBM RS/6000 and PowerPC Options
23689 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
23690 @table @gcctabopt
23691 @item -mpowerpc-gpopt
23692 @itemx -mno-powerpc-gpopt
23693 @itemx -mpowerpc-gfxopt
23694 @itemx -mno-powerpc-gfxopt
23695 @need 800
23696 @itemx -mpowerpc64
23697 @itemx -mno-powerpc64
23698 @itemx -mmfcrf
23699 @itemx -mno-mfcrf
23700 @itemx -mpopcntb
23701 @itemx -mno-popcntb
23702 @itemx -mpopcntd
23703 @itemx -mno-popcntd
23704 @itemx -mfprnd
23705 @itemx -mno-fprnd
23706 @need 800
23707 @itemx -mcmpb
23708 @itemx -mno-cmpb
23709 @itemx -mmfpgpr
23710 @itemx -mno-mfpgpr
23711 @itemx -mhard-dfp
23712 @itemx -mno-hard-dfp
23713 @opindex mpowerpc-gpopt
23714 @opindex mno-powerpc-gpopt
23715 @opindex mpowerpc-gfxopt
23716 @opindex mno-powerpc-gfxopt
23717 @opindex mpowerpc64
23718 @opindex mno-powerpc64
23719 @opindex mmfcrf
23720 @opindex mno-mfcrf
23721 @opindex mpopcntb
23722 @opindex mno-popcntb
23723 @opindex mpopcntd
23724 @opindex mno-popcntd
23725 @opindex mfprnd
23726 @opindex mno-fprnd
23727 @opindex mcmpb
23728 @opindex mno-cmpb
23729 @opindex mmfpgpr
23730 @opindex mno-mfpgpr
23731 @opindex mhard-dfp
23732 @opindex mno-hard-dfp
23733 You use these options to specify which instructions are available on the
23734 processor you are using.  The default value of these options is
23735 determined when configuring GCC@.  Specifying the
23736 @option{-mcpu=@var{cpu_type}} overrides the specification of these
23737 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
23738 rather than the options listed above.
23740 Specifying @option{-mpowerpc-gpopt} allows
23741 GCC to use the optional PowerPC architecture instructions in the
23742 General Purpose group, including floating-point square root.  Specifying
23743 @option{-mpowerpc-gfxopt} allows GCC to
23744 use the optional PowerPC architecture instructions in the Graphics
23745 group, including floating-point select.
23747 The @option{-mmfcrf} option allows GCC to generate the move from
23748 condition register field instruction implemented on the POWER4
23749 processor and other processors that support the PowerPC V2.01
23750 architecture.
23751 The @option{-mpopcntb} option allows GCC to generate the popcount and
23752 double-precision FP reciprocal estimate instruction implemented on the
23753 POWER5 processor and other processors that support the PowerPC V2.02
23754 architecture.
23755 The @option{-mpopcntd} option allows GCC to generate the popcount
23756 instruction implemented on the POWER7 processor and other processors
23757 that support the PowerPC V2.06 architecture.
23758 The @option{-mfprnd} option allows GCC to generate the FP round to
23759 integer instructions implemented on the POWER5+ processor and other
23760 processors that support the PowerPC V2.03 architecture.
23761 The @option{-mcmpb} option allows GCC to generate the compare bytes
23762 instruction implemented on the POWER6 processor and other processors
23763 that support the PowerPC V2.05 architecture.
23764 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
23765 general-purpose register instructions implemented on the POWER6X
23766 processor and other processors that support the extended PowerPC V2.05
23767 architecture.
23768 The @option{-mhard-dfp} option allows GCC to generate the decimal
23769 floating-point instructions implemented on some POWER processors.
23771 The @option{-mpowerpc64} option allows GCC to generate the additional
23772 64-bit instructions that are found in the full PowerPC64 architecture
23773 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
23774 @option{-mno-powerpc64}.
23776 @item -mcpu=@var{cpu_type}
23777 @opindex mcpu
23778 Set architecture type, register usage, and
23779 instruction scheduling parameters for machine type @var{cpu_type}.
23780 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
23781 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
23782 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
23783 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
23784 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
23785 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
23786 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
23787 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
23788 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
23789 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
23790 @samp{power9}, @samp{powerpc}, @samp{powerpc64}, @samp{powerpc64le},
23791 @samp{rs64}, and @samp{native}.
23793 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
23794 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
23795 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
23796 architecture machine types, with an appropriate, generic processor
23797 model assumed for scheduling purposes.
23799 Specifying @samp{native} as cpu type detects and selects the
23800 architecture option that corresponds to the host processor of the
23801 system performing the compilation.
23802 @option{-mcpu=native} has no effect if GCC does not recognize the
23803 processor.
23805 The other options specify a specific processor.  Code generated under
23806 those options runs best on that processor, and may not run at all on
23807 others.
23809 The @option{-mcpu} options automatically enable or disable the
23810 following options:
23812 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
23813 -mpopcntb -mpopcntd  -mpowerpc64 @gol
23814 -mpowerpc-gpopt  -mpowerpc-gfxopt @gol
23815 -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
23816 -mcrypto -mhtm -mpower8-fusion -mpower8-vector @gol
23817 -mquad-memory -mquad-memory-atomic -mfloat128 -mfloat128-hardware}
23819 The particular options set for any particular CPU varies between
23820 compiler versions, depending on what setting seems to produce optimal
23821 code for that CPU; it doesn't necessarily reflect the actual hardware's
23822 capabilities.  If you wish to set an individual option to a particular
23823 value, you may specify it after the @option{-mcpu} option, like
23824 @option{-mcpu=970 -mno-altivec}.
23826 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
23827 not enabled or disabled by the @option{-mcpu} option at present because
23828 AIX does not have full support for these options.  You may still
23829 enable or disable them individually if you're sure it'll work in your
23830 environment.
23832 @item -mtune=@var{cpu_type}
23833 @opindex mtune
23834 Set the instruction scheduling parameters for machine type
23835 @var{cpu_type}, but do not set the architecture type or register usage,
23836 as @option{-mcpu=@var{cpu_type}} does.  The same
23837 values for @var{cpu_type} are used for @option{-mtune} as for
23838 @option{-mcpu}.  If both are specified, the code generated uses the
23839 architecture and registers set by @option{-mcpu}, but the
23840 scheduling parameters set by @option{-mtune}.
23842 @item -mcmodel=small
23843 @opindex mcmodel=small
23844 Generate PowerPC64 code for the small model: The TOC is limited to
23845 64k.
23847 @item -mcmodel=medium
23848 @opindex mcmodel=medium
23849 Generate PowerPC64 code for the medium model: The TOC and other static
23850 data may be up to a total of 4G in size.  This is the default for 64-bit
23851 Linux.
23853 @item -mcmodel=large
23854 @opindex mcmodel=large
23855 Generate PowerPC64 code for the large model: The TOC may be up to 4G
23856 in size.  Other data and code is only limited by the 64-bit address
23857 space.
23859 @item -maltivec
23860 @itemx -mno-altivec
23861 @opindex maltivec
23862 @opindex mno-altivec
23863 Generate code that uses (does not use) AltiVec instructions, and also
23864 enable the use of built-in functions that allow more direct access to
23865 the AltiVec instruction set.  You may also need to set
23866 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
23867 enhancements.
23869 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
23870 @option{-maltivec=be}, the element order for AltiVec intrinsics such
23871 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
23872 match array element order corresponding to the endianness of the
23873 target.  That is, element zero identifies the leftmost element in a
23874 vector register when targeting a big-endian platform, and identifies
23875 the rightmost element in a vector register when targeting a
23876 little-endian platform.
23878 @item -maltivec=be
23879 @opindex maltivec=be
23880 Generate AltiVec instructions using big-endian element order,
23881 regardless of whether the target is big- or little-endian.  This is
23882 the default when targeting a big-endian platform.  Using this option
23883 is currently deprecated.  Support for this feature will be removed in
23884 GCC 9.
23886 The element order is used to interpret element numbers in AltiVec
23887 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
23888 @code{vec_insert}.  By default, these match array element order
23889 corresponding to the endianness for the target.
23891 @item -maltivec=le
23892 @opindex maltivec=le
23893 Generate AltiVec instructions using little-endian element order,
23894 regardless of whether the target is big- or little-endian.  This is
23895 the default when targeting a little-endian platform.  This option is
23896 currently ignored when targeting a big-endian platform.
23898 The element order is used to interpret element numbers in AltiVec
23899 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
23900 @code{vec_insert}.  By default, these match array element order
23901 corresponding to the endianness for the target.
23903 @item -mvrsave
23904 @itemx -mno-vrsave
23905 @opindex mvrsave
23906 @opindex mno-vrsave
23907 Generate VRSAVE instructions when generating AltiVec code.
23909 @item -msecure-plt
23910 @opindex msecure-plt
23911 Generate code that allows @command{ld} and @command{ld.so}
23912 to build executables and shared
23913 libraries with non-executable @code{.plt} and @code{.got} sections.
23914 This is a PowerPC
23915 32-bit SYSV ABI option.
23917 @item -mbss-plt
23918 @opindex mbss-plt
23919 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
23920 fills in, and
23921 requires @code{.plt} and @code{.got}
23922 sections that are both writable and executable.
23923 This is a PowerPC 32-bit SYSV ABI option.
23925 @item -misel
23926 @itemx -mno-isel
23927 @opindex misel
23928 @opindex mno-isel
23929 This switch enables or disables the generation of ISEL instructions.
23931 @item -misel=@var{yes/no}
23932 This switch has been deprecated.  Use @option{-misel} and
23933 @option{-mno-isel} instead.
23935 @item -mvsx
23936 @itemx -mno-vsx
23937 @opindex mvsx
23938 @opindex mno-vsx
23939 Generate code that uses (does not use) vector/scalar (VSX)
23940 instructions, and also enable the use of built-in functions that allow
23941 more direct access to the VSX instruction set.
23943 @item -mcrypto
23944 @itemx -mno-crypto
23945 @opindex mcrypto
23946 @opindex mno-crypto
23947 Enable the use (disable) of the built-in functions that allow direct
23948 access to the cryptographic instructions that were added in version
23949 2.07 of the PowerPC ISA.
23951 @item -mhtm
23952 @itemx -mno-htm
23953 @opindex mhtm
23954 @opindex mno-htm
23955 Enable (disable) the use of the built-in functions that allow direct
23956 access to the Hardware Transactional Memory (HTM) instructions that
23957 were added in version 2.07 of the PowerPC ISA.
23959 @item -mpower8-fusion
23960 @itemx -mno-power8-fusion
23961 @opindex mpower8-fusion
23962 @opindex mno-power8-fusion
23963 Generate code that keeps (does not keeps) some integer operations
23964 adjacent so that the instructions can be fused together on power8 and
23965 later processors.
23967 @item -mpower8-vector
23968 @itemx -mno-power8-vector
23969 @opindex mpower8-vector
23970 @opindex mno-power8-vector
23971 Generate code that uses (does not use) the vector and scalar
23972 instructions that were added in version 2.07 of the PowerPC ISA.  Also
23973 enable the use of built-in functions that allow more direct access to
23974 the vector instructions.
23976 @item -mquad-memory
23977 @itemx -mno-quad-memory
23978 @opindex mquad-memory
23979 @opindex mno-quad-memory
23980 Generate code that uses (does not use) the non-atomic quad word memory
23981 instructions.  The @option{-mquad-memory} option requires use of
23982 64-bit mode.
23984 @item -mquad-memory-atomic
23985 @itemx -mno-quad-memory-atomic
23986 @opindex mquad-memory-atomic
23987 @opindex mno-quad-memory-atomic
23988 Generate code that uses (does not use) the atomic quad word memory
23989 instructions.  The @option{-mquad-memory-atomic} option requires use of
23990 64-bit mode.
23992 @item -mfloat128
23993 @itemx -mno-float128
23994 @opindex mfloat128
23995 @opindex mno-float128
23996 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
23997 and use either software emulation for IEEE 128-bit floating point or
23998 hardware instructions.
24000 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7},
24001 @option{-mcpu=power8}), or @option{-mcpu=power9} must be enabled to
24002 use the IEEE 128-bit floating point support.  The IEEE 128-bit
24003 floating point support only works on PowerPC Linux systems.
24005 The default for @option{-mfloat128} is enabled on PowerPC Linux
24006 systems using the VSX instruction set, and disabled on other systems.
24008 If you use the ISA 3.0 instruction set (@option{-mpower9-vector} or
24009 @option{-mcpu=power9}) on a 64-bit system, the IEEE 128-bit floating
24010 point support will also enable the generation of ISA 3.0 IEEE 128-bit
24011 floating point instructions.  Otherwise, if you do not specify to
24012 generate ISA 3.0 instructions or you are targeting a 32-bit big endian
24013 system, IEEE 128-bit floating point will be done with software
24014 emulation.
24016 @item -mfloat128-hardware
24017 @itemx -mno-float128-hardware
24018 @opindex mfloat128-hardware
24019 @opindex mno-float128-hardware
24020 Enable/disable using ISA 3.0 hardware instructions to support the
24021 @var{__float128} data type.
24023 The default for @option{-mfloat128-hardware} is enabled on PowerPC
24024 Linux systems using the ISA 3.0 instruction set, and disabled on other
24025 systems.
24027 @item -m32
24028 @itemx -m64
24029 @opindex m32
24030 @opindex m64
24031 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
24032 targets (including GNU/Linux).  The 32-bit environment sets int, long
24033 and pointer to 32 bits and generates code that runs on any PowerPC
24034 variant.  The 64-bit environment sets int to 32 bits and long and
24035 pointer to 64 bits, and generates code for PowerPC64, as for
24036 @option{-mpowerpc64}.
24038 @item -mfull-toc
24039 @itemx -mno-fp-in-toc
24040 @itemx -mno-sum-in-toc
24041 @itemx -mminimal-toc
24042 @opindex mfull-toc
24043 @opindex mno-fp-in-toc
24044 @opindex mno-sum-in-toc
24045 @opindex mminimal-toc
24046 Modify generation of the TOC (Table Of Contents), which is created for
24047 every executable file.  The @option{-mfull-toc} option is selected by
24048 default.  In that case, GCC allocates at least one TOC entry for
24049 each unique non-automatic variable reference in your program.  GCC
24050 also places floating-point constants in the TOC@.  However, only
24051 16,384 entries are available in the TOC@.
24053 If you receive a linker error message that saying you have overflowed
24054 the available TOC space, you can reduce the amount of TOC space used
24055 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
24056 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
24057 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
24058 generate code to calculate the sum of an address and a constant at
24059 run time instead of putting that sum into the TOC@.  You may specify one
24060 or both of these options.  Each causes GCC to produce very slightly
24061 slower and larger code at the expense of conserving TOC space.
24063 If you still run out of space in the TOC even when you specify both of
24064 these options, specify @option{-mminimal-toc} instead.  This option causes
24065 GCC to make only one TOC entry for every file.  When you specify this
24066 option, GCC produces code that is slower and larger but which
24067 uses extremely little TOC space.  You may wish to use this option
24068 only on files that contain less frequently-executed code.
24070 @item -maix64
24071 @itemx -maix32
24072 @opindex maix64
24073 @opindex maix32
24074 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
24075 @code{long} type, and the infrastructure needed to support them.
24076 Specifying @option{-maix64} implies @option{-mpowerpc64},
24077 while @option{-maix32} disables the 64-bit ABI and
24078 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
24080 @item -mxl-compat
24081 @itemx -mno-xl-compat
24082 @opindex mxl-compat
24083 @opindex mno-xl-compat
24084 Produce code that conforms more closely to IBM XL compiler semantics
24085 when using AIX-compatible ABI@.  Pass floating-point arguments to
24086 prototyped functions beyond the register save area (RSA) on the stack
24087 in addition to argument FPRs.  Do not assume that most significant
24088 double in 128-bit long double value is properly rounded when comparing
24089 values and converting to double.  Use XL symbol names for long double
24090 support routines.
24092 The AIX calling convention was extended but not initially documented to
24093 handle an obscure K&R C case of calling a function that takes the
24094 address of its arguments with fewer arguments than declared.  IBM XL
24095 compilers access floating-point arguments that do not fit in the
24096 RSA from the stack when a subroutine is compiled without
24097 optimization.  Because always storing floating-point arguments on the
24098 stack is inefficient and rarely needed, this option is not enabled by
24099 default and only is necessary when calling subroutines compiled by IBM
24100 XL compilers without optimization.
24102 @item -mpe
24103 @opindex mpe
24104 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
24105 application written to use message passing with special startup code to
24106 enable the application to run.  The system must have PE installed in the
24107 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
24108 must be overridden with the @option{-specs=} option to specify the
24109 appropriate directory location.  The Parallel Environment does not
24110 support threads, so the @option{-mpe} option and the @option{-pthread}
24111 option are incompatible.
24113 @item -malign-natural
24114 @itemx -malign-power
24115 @opindex malign-natural
24116 @opindex malign-power
24117 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
24118 @option{-malign-natural} overrides the ABI-defined alignment of larger
24119 types, such as floating-point doubles, on their natural size-based boundary.
24120 The option @option{-malign-power} instructs GCC to follow the ABI-specified
24121 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
24123 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
24124 is not supported.
24126 @item -msoft-float
24127 @itemx -mhard-float
24128 @opindex msoft-float
24129 @opindex mhard-float
24130 Generate code that does not use (uses) the floating-point register set.
24131 Software floating-point emulation is provided if you use the
24132 @option{-msoft-float} option, and pass the option to GCC when linking.
24134 @item -mmultiple
24135 @itemx -mno-multiple
24136 @opindex mmultiple
24137 @opindex mno-multiple
24138 Generate code that uses (does not use) the load multiple word
24139 instructions and the store multiple word instructions.  These
24140 instructions are generated by default on POWER systems, and not
24141 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
24142 PowerPC systems, since those instructions do not work when the
24143 processor is in little-endian mode.  The exceptions are PPC740 and
24144 PPC750 which permit these instructions in little-endian mode.
24146 @item -mupdate
24147 @itemx -mno-update
24148 @opindex mupdate
24149 @opindex mno-update
24150 Generate code that uses (does not use) the load or store instructions
24151 that update the base register to the address of the calculated memory
24152 location.  These instructions are generated by default.  If you use
24153 @option{-mno-update}, there is a small window between the time that the
24154 stack pointer is updated and the address of the previous frame is
24155 stored, which means code that walks the stack frame across interrupts or
24156 signals may get corrupted data.
24158 @item -mavoid-indexed-addresses
24159 @itemx -mno-avoid-indexed-addresses
24160 @opindex mavoid-indexed-addresses
24161 @opindex mno-avoid-indexed-addresses
24162 Generate code that tries to avoid (not avoid) the use of indexed load
24163 or store instructions. These instructions can incur a performance
24164 penalty on Power6 processors in certain situations, such as when
24165 stepping through large arrays that cross a 16M boundary.  This option
24166 is enabled by default when targeting Power6 and disabled otherwise.
24168 @item -mfused-madd
24169 @itemx -mno-fused-madd
24170 @opindex mfused-madd
24171 @opindex mno-fused-madd
24172 Generate code that uses (does not use) the floating-point multiply and
24173 accumulate instructions.  These instructions are generated by default
24174 if hardware floating point is used.  The machine-dependent
24175 @option{-mfused-madd} option is now mapped to the machine-independent
24176 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
24177 mapped to @option{-ffp-contract=off}.
24179 @item -mmulhw
24180 @itemx -mno-mulhw
24181 @opindex mmulhw
24182 @opindex mno-mulhw
24183 Generate code that uses (does not use) the half-word multiply and
24184 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
24185 These instructions are generated by default when targeting those
24186 processors.
24188 @item -mdlmzb
24189 @itemx -mno-dlmzb
24190 @opindex mdlmzb
24191 @opindex mno-dlmzb
24192 Generate code that uses (does not use) the string-search @samp{dlmzb}
24193 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
24194 generated by default when targeting those processors.
24196 @item -mno-bit-align
24197 @itemx -mbit-align
24198 @opindex mno-bit-align
24199 @opindex mbit-align
24200 On System V.4 and embedded PowerPC systems do not (do) force structures
24201 and unions that contain bit-fields to be aligned to the base type of the
24202 bit-field.
24204 For example, by default a structure containing nothing but 8
24205 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
24206 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
24207 the structure is aligned to a 1-byte boundary and is 1 byte in
24208 size.
24210 @item -mno-strict-align
24211 @itemx -mstrict-align
24212 @opindex mno-strict-align
24213 @opindex mstrict-align
24214 On System V.4 and embedded PowerPC systems do not (do) assume that
24215 unaligned memory references are handled by the system.
24217 @item -mrelocatable
24218 @itemx -mno-relocatable
24219 @opindex mrelocatable
24220 @opindex mno-relocatable
24221 Generate code that allows (does not allow) a static executable to be
24222 relocated to a different address at run time.  A simple embedded
24223 PowerPC system loader should relocate the entire contents of
24224 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
24225 a table of 32-bit addresses generated by this option.  For this to
24226 work, all objects linked together must be compiled with
24227 @option{-mrelocatable} or @option{-mrelocatable-lib}.
24228 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
24230 @item -mrelocatable-lib
24231 @itemx -mno-relocatable-lib
24232 @opindex mrelocatable-lib
24233 @opindex mno-relocatable-lib
24234 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
24235 @code{.fixup} section to allow static executables to be relocated at
24236 run time, but @option{-mrelocatable-lib} does not use the smaller stack
24237 alignment of @option{-mrelocatable}.  Objects compiled with
24238 @option{-mrelocatable-lib} may be linked with objects compiled with
24239 any combination of the @option{-mrelocatable} options.
24241 @item -mno-toc
24242 @itemx -mtoc
24243 @opindex mno-toc
24244 @opindex mtoc
24245 On System V.4 and embedded PowerPC systems do not (do) assume that
24246 register 2 contains a pointer to a global area pointing to the addresses
24247 used in the program.
24249 @item -mlittle
24250 @itemx -mlittle-endian
24251 @opindex mlittle
24252 @opindex mlittle-endian
24253 On System V.4 and embedded PowerPC systems compile code for the
24254 processor in little-endian mode.  The @option{-mlittle-endian} option is
24255 the same as @option{-mlittle}.
24257 @item -mbig
24258 @itemx -mbig-endian
24259 @opindex mbig
24260 @opindex mbig-endian
24261 On System V.4 and embedded PowerPC systems compile code for the
24262 processor in big-endian mode.  The @option{-mbig-endian} option is
24263 the same as @option{-mbig}.
24265 @item -mdynamic-no-pic
24266 @opindex mdynamic-no-pic
24267 On Darwin and Mac OS X systems, compile code so that it is not
24268 relocatable, but that its external references are relocatable.  The
24269 resulting code is suitable for applications, but not shared
24270 libraries.
24272 @item -msingle-pic-base
24273 @opindex msingle-pic-base
24274 Treat the register used for PIC addressing as read-only, rather than
24275 loading it in the prologue for each function.  The runtime system is
24276 responsible for initializing this register with an appropriate value
24277 before execution begins.
24279 @item -mprioritize-restricted-insns=@var{priority}
24280 @opindex mprioritize-restricted-insns
24281 This option controls the priority that is assigned to
24282 dispatch-slot restricted instructions during the second scheduling
24283 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
24284 or @samp{2} to assign no, highest, or second-highest (respectively) 
24285 priority to dispatch-slot restricted
24286 instructions.
24288 @item -msched-costly-dep=@var{dependence_type}
24289 @opindex msched-costly-dep
24290 This option controls which dependences are considered costly
24291 by the target during instruction scheduling.  The argument
24292 @var{dependence_type} takes one of the following values:
24294 @table @asis
24295 @item @samp{no}
24296 No dependence is costly.
24298 @item @samp{all}
24299 All dependences are costly.
24301 @item @samp{true_store_to_load}
24302 A true dependence from store to load is costly.
24304 @item @samp{store_to_load}
24305 Any dependence from store to load is costly.
24307 @item @var{number}
24308 Any dependence for which the latency is greater than or equal to 
24309 @var{number} is costly.
24310 @end table
24312 @item -minsert-sched-nops=@var{scheme}
24313 @opindex minsert-sched-nops
24314 This option controls which NOP insertion scheme is used during
24315 the second scheduling pass.  The argument @var{scheme} takes one of the
24316 following values:
24318 @table @asis
24319 @item @samp{no}
24320 Don't insert NOPs.
24322 @item @samp{pad}
24323 Pad with NOPs any dispatch group that has vacant issue slots,
24324 according to the scheduler's grouping.
24326 @item @samp{regroup_exact}
24327 Insert NOPs to force costly dependent insns into
24328 separate groups.  Insert exactly as many NOPs as needed to force an insn
24329 to a new group, according to the estimated processor grouping.
24331 @item @var{number}
24332 Insert NOPs to force costly dependent insns into
24333 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
24334 @end table
24336 @item -mcall-sysv
24337 @opindex mcall-sysv
24338 On System V.4 and embedded PowerPC systems compile code using calling
24339 conventions that adhere to the March 1995 draft of the System V
24340 Application Binary Interface, PowerPC processor supplement.  This is the
24341 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
24343 @item -mcall-sysv-eabi
24344 @itemx -mcall-eabi
24345 @opindex mcall-sysv-eabi
24346 @opindex mcall-eabi
24347 Specify both @option{-mcall-sysv} and @option{-meabi} options.
24349 @item -mcall-sysv-noeabi
24350 @opindex mcall-sysv-noeabi
24351 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
24353 @item -mcall-aixdesc
24354 @opindex m
24355 On System V.4 and embedded PowerPC systems compile code for the AIX
24356 operating system.
24358 @item -mcall-linux
24359 @opindex mcall-linux
24360 On System V.4 and embedded PowerPC systems compile code for the
24361 Linux-based GNU system.
24363 @item -mcall-freebsd
24364 @opindex mcall-freebsd
24365 On System V.4 and embedded PowerPC systems compile code for the
24366 FreeBSD operating system.
24368 @item -mcall-netbsd
24369 @opindex mcall-netbsd
24370 On System V.4 and embedded PowerPC systems compile code for the
24371 NetBSD operating system.
24373 @item -mcall-openbsd
24374 @opindex mcall-netbsd
24375 On System V.4 and embedded PowerPC systems compile code for the
24376 OpenBSD operating system.
24378 @item -mtraceback=@var{traceback_type}
24379 @opindex mtraceback
24380 Select the type of traceback table. Valid values for @var{traceback_type}
24381 are @samp{full}, @samp{part}, and @samp{no}.
24383 @item -maix-struct-return
24384 @opindex maix-struct-return
24385 Return all structures in memory (as specified by the AIX ABI)@.
24387 @item -msvr4-struct-return
24388 @opindex msvr4-struct-return
24389 Return structures smaller than 8 bytes in registers (as specified by the
24390 SVR4 ABI)@.
24392 @item -mabi=@var{abi-type}
24393 @opindex mabi
24394 Extend the current ABI with a particular extension, or remove such extension.
24395 Valid values are @samp{altivec}, @samp{no-altivec},
24396 @samp{ibmlongdouble}, @samp{ieeelongdouble},
24397 @samp{elfv1}, @samp{elfv2}@.
24399 @item -mabi=ibmlongdouble
24400 @opindex mabi=ibmlongdouble
24401 Change the current ABI to use IBM extended-precision long double.
24402 This is not likely to work if your system defaults to using IEEE
24403 extended-precision long double.  If you change the long double type
24404 from IEEE extended-precision, the compiler will issue a warning unless
24405 you use the @option{-Wno-psabi} option.
24407 @item -mabi=ieeelongdouble
24408 @opindex mabi=ieeelongdouble
24409 Change the current ABI to use IEEE extended-precision long double.
24410 This is not likely to work if your system defaults to using IBM
24411 extended-precision long double.  If you change the long double type
24412 from IBM extended-precision, the compiler will issue a warning unless
24413 you use the @option{-Wno-psabi} option.
24415 @item -mabi=elfv1
24416 @opindex mabi=elfv1
24417 Change the current ABI to use the ELFv1 ABI.
24418 This is the default ABI for big-endian PowerPC 64-bit Linux.
24419 Overriding the default ABI requires special system support and is
24420 likely to fail in spectacular ways.
24422 @item -mabi=elfv2
24423 @opindex mabi=elfv2
24424 Change the current ABI to use the ELFv2 ABI.
24425 This is the default ABI for little-endian PowerPC 64-bit Linux.
24426 Overriding the default ABI requires special system support and is
24427 likely to fail in spectacular ways.
24429 @item -mgnu-attribute
24430 @itemx -mno-gnu-attribute
24431 @opindex mgnu-attribute
24432 @opindex mno-gnu-attribute
24433 Emit .gnu_attribute assembly directives to set tag/value pairs in a
24434 .gnu.attributes section that specify ABI variations in function
24435 parameters or return values.
24437 @item -mprototype
24438 @itemx -mno-prototype
24439 @opindex mprototype
24440 @opindex mno-prototype
24441 On System V.4 and embedded PowerPC systems assume that all calls to
24442 variable argument functions are properly prototyped.  Otherwise, the
24443 compiler must insert an instruction before every non-prototyped call to
24444 set or clear bit 6 of the condition code register (@code{CR}) to
24445 indicate whether floating-point values are passed in the floating-point
24446 registers in case the function takes variable arguments.  With
24447 @option{-mprototype}, only calls to prototyped variable argument functions
24448 set or clear the bit.
24450 @item -msim
24451 @opindex msim
24452 On embedded PowerPC systems, assume that the startup module is called
24453 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
24454 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
24455 configurations.
24457 @item -mmvme
24458 @opindex mmvme
24459 On embedded PowerPC systems, assume that the startup module is called
24460 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
24461 @file{libc.a}.
24463 @item -mads
24464 @opindex mads
24465 On embedded PowerPC systems, assume that the startup module is called
24466 @file{crt0.o} and the standard C libraries are @file{libads.a} and
24467 @file{libc.a}.
24469 @item -myellowknife
24470 @opindex myellowknife
24471 On embedded PowerPC systems, assume that the startup module is called
24472 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
24473 @file{libc.a}.
24475 @item -mvxworks
24476 @opindex mvxworks
24477 On System V.4 and embedded PowerPC systems, specify that you are
24478 compiling for a VxWorks system.
24480 @item -memb
24481 @opindex memb
24482 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
24483 header to indicate that @samp{eabi} extended relocations are used.
24485 @item -meabi
24486 @itemx -mno-eabi
24487 @opindex meabi
24488 @opindex mno-eabi
24489 On System V.4 and embedded PowerPC systems do (do not) adhere to the
24490 Embedded Applications Binary Interface (EABI), which is a set of
24491 modifications to the System V.4 specifications.  Selecting @option{-meabi}
24492 means that the stack is aligned to an 8-byte boundary, a function
24493 @code{__eabi} is called from @code{main} to set up the EABI
24494 environment, and the @option{-msdata} option can use both @code{r2} and
24495 @code{r13} to point to two separate small data areas.  Selecting
24496 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
24497 no EABI initialization function is called from @code{main}, and the
24498 @option{-msdata} option only uses @code{r13} to point to a single
24499 small data area.  The @option{-meabi} option is on by default if you
24500 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
24502 @item -msdata=eabi
24503 @opindex msdata=eabi
24504 On System V.4 and embedded PowerPC systems, put small initialized
24505 @code{const} global and static data in the @code{.sdata2} section, which
24506 is pointed to by register @code{r2}.  Put small initialized
24507 non-@code{const} global and static data in the @code{.sdata} section,
24508 which is pointed to by register @code{r13}.  Put small uninitialized
24509 global and static data in the @code{.sbss} section, which is adjacent to
24510 the @code{.sdata} section.  The @option{-msdata=eabi} option is
24511 incompatible with the @option{-mrelocatable} option.  The
24512 @option{-msdata=eabi} option also sets the @option{-memb} option.
24514 @item -msdata=sysv
24515 @opindex msdata=sysv
24516 On System V.4 and embedded PowerPC systems, put small global and static
24517 data in the @code{.sdata} section, which is pointed to by register
24518 @code{r13}.  Put small uninitialized global and static data in the
24519 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
24520 The @option{-msdata=sysv} option is incompatible with the
24521 @option{-mrelocatable} option.
24523 @item -msdata=default
24524 @itemx -msdata
24525 @opindex msdata=default
24526 @opindex msdata
24527 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
24528 compile code the same as @option{-msdata=eabi}, otherwise compile code the
24529 same as @option{-msdata=sysv}.
24531 @item -msdata=data
24532 @opindex msdata=data
24533 On System V.4 and embedded PowerPC systems, put small global
24534 data in the @code{.sdata} section.  Put small uninitialized global
24535 data in the @code{.sbss} section.  Do not use register @code{r13}
24536 to address small data however.  This is the default behavior unless
24537 other @option{-msdata} options are used.
24539 @item -msdata=none
24540 @itemx -mno-sdata
24541 @opindex msdata=none
24542 @opindex mno-sdata
24543 On embedded PowerPC systems, put all initialized global and static data
24544 in the @code{.data} section, and all uninitialized data in the
24545 @code{.bss} section.
24547 @item -mreadonly-in-sdata
24548 @opindex mreadonly-in-sdata
24549 @opindex mno-readonly-in-sdata
24550 Put read-only objects in the @code{.sdata} section as well.  This is the
24551 default.
24553 @item -mblock-move-inline-limit=@var{num}
24554 @opindex mblock-move-inline-limit
24555 Inline all block moves (such as calls to @code{memcpy} or structure
24556 copies) less than or equal to @var{num} bytes.  The minimum value for
24557 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
24558 targets.  The default value is target-specific.
24560 @item -mblock-compare-inline-limit=@var{num}
24561 @opindex mblock-compare-inline-limit
24562 Generate non-looping inline code for all block compares (such as calls
24563 to @code{memcmp} or structure compares) less than or equal to @var{num}
24564 bytes. If @var{num} is 0, all inline expansion (non-loop and loop) of
24565 block compare is disabled. The default value is target-specific.
24567 @item -mblock-compare-inline-loop-limit=@var{num}
24568 @opindex mblock-compare-inline-loop-limit
24569 Generate an inline expansion using loop code for all block compares that
24570 are less than or equal to @var{num} bytes, but greater than the limit
24571 for non-loop inline block compare expansion. If the block length is not
24572 constant, at most @var{num} bytes will be compared before @code{memcmp}
24573 is called to compare the remainder of the block. The default value is
24574 target-specific.
24576 @item -mstring-compare-inline-limit=@var{num}
24577 @opindex mstring-compare-inline-limit
24578 Compare at most @var{num} string bytes with inline code.
24579 If the difference or end of string is not found at the
24580 end of the inline compare a call to @code{strcmp} or @code{strncmp} will
24581 take care of the rest of the comparison. The default is 64 bytes.
24583 @item -G @var{num}
24584 @opindex G
24585 @cindex smaller data references (PowerPC)
24586 @cindex .sdata/.sdata2 references (PowerPC)
24587 On embedded PowerPC systems, put global and static items less than or
24588 equal to @var{num} bytes into the small data or BSS sections instead of
24589 the normal data or BSS section.  By default, @var{num} is 8.  The
24590 @option{-G @var{num}} switch is also passed to the linker.
24591 All modules should be compiled with the same @option{-G @var{num}} value.
24593 @item -mregnames
24594 @itemx -mno-regnames
24595 @opindex mregnames
24596 @opindex mno-regnames
24597 On System V.4 and embedded PowerPC systems do (do not) emit register
24598 names in the assembly language output using symbolic forms.
24600 @item -mlongcall
24601 @itemx -mno-longcall
24602 @opindex mlongcall
24603 @opindex mno-longcall
24604 By default assume that all calls are far away so that a longer and more
24605 expensive calling sequence is required.  This is required for calls
24606 farther than 32 megabytes (33,554,432 bytes) from the current location.
24607 A short call is generated if the compiler knows
24608 the call cannot be that far away.  This setting can be overridden by
24609 the @code{shortcall} function attribute, or by @code{#pragma
24610 longcall(0)}.
24612 Some linkers are capable of detecting out-of-range calls and generating
24613 glue code on the fly.  On these systems, long calls are unnecessary and
24614 generate slower code.  As of this writing, the AIX linker can do this,
24615 as can the GNU linker for PowerPC/64.  It is planned to add this feature
24616 to the GNU linker for 32-bit PowerPC systems as well.
24618 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
24619 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
24620 addresses represent the callee and the branch island.  The
24621 Darwin/PPC linker prefers the first address and generates a @code{bl
24622 callee} if the PPC @code{bl} instruction reaches the callee directly;
24623 otherwise, the linker generates @code{bl L42} to call the branch
24624 island.  The branch island is appended to the body of the
24625 calling function; it computes the full 32-bit address of the callee
24626 and jumps to it.
24628 On Mach-O (Darwin) systems, this option directs the compiler emit to
24629 the glue for every direct call, and the Darwin linker decides whether
24630 to use or discard it.
24632 In the future, GCC may ignore all longcall specifications
24633 when the linker is known to generate glue.
24635 @item -mtls-markers
24636 @itemx -mno-tls-markers
24637 @opindex mtls-markers
24638 @opindex mno-tls-markers
24639 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
24640 specifying the function argument.  The relocation allows the linker to
24641 reliably associate function call with argument setup instructions for
24642 TLS optimization, which in turn allows GCC to better schedule the
24643 sequence.
24645 @item -mrecip
24646 @itemx -mno-recip
24647 @opindex mrecip
24648 This option enables use of the reciprocal estimate and
24649 reciprocal square root estimate instructions with additional
24650 Newton-Raphson steps to increase precision instead of doing a divide or
24651 square root and divide for floating-point arguments.  You should use
24652 the @option{-ffast-math} option when using @option{-mrecip} (or at
24653 least @option{-funsafe-math-optimizations},
24654 @option{-ffinite-math-only}, @option{-freciprocal-math} and
24655 @option{-fno-trapping-math}).  Note that while the throughput of the
24656 sequence is generally higher than the throughput of the non-reciprocal
24657 instruction, the precision of the sequence can be decreased by up to 2
24658 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
24659 roots.
24661 @item -mrecip=@var{opt}
24662 @opindex mrecip=opt
24663 This option controls which reciprocal estimate instructions
24664 may be used.  @var{opt} is a comma-separated list of options, which may
24665 be preceded by a @code{!} to invert the option:
24667 @table @samp
24669 @item all
24670 Enable all estimate instructions.
24672 @item default 
24673 Enable the default instructions, equivalent to @option{-mrecip}.
24675 @item none 
24676 Disable all estimate instructions, equivalent to @option{-mno-recip}.
24678 @item div 
24679 Enable the reciprocal approximation instructions for both 
24680 single and double precision.
24682 @item divf 
24683 Enable the single-precision reciprocal approximation instructions.
24685 @item divd 
24686 Enable the double-precision reciprocal approximation instructions.
24688 @item rsqrt 
24689 Enable the reciprocal square root approximation instructions for both
24690 single and double precision.
24692 @item rsqrtf 
24693 Enable the single-precision reciprocal square root approximation instructions.
24695 @item rsqrtd 
24696 Enable the double-precision reciprocal square root approximation instructions.
24698 @end table
24700 So, for example, @option{-mrecip=all,!rsqrtd} enables
24701 all of the reciprocal estimate instructions, except for the
24702 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
24703 which handle the double-precision reciprocal square root calculations.
24705 @item -mrecip-precision
24706 @itemx -mno-recip-precision
24707 @opindex mrecip-precision
24708 Assume (do not assume) that the reciprocal estimate instructions
24709 provide higher-precision estimates than is mandated by the PowerPC
24710 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
24711 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
24712 The double-precision square root estimate instructions are not generated by
24713 default on low-precision machines, since they do not provide an
24714 estimate that converges after three steps.
24716 @item -mveclibabi=@var{type}
24717 @opindex mveclibabi
24718 Specifies the ABI type to use for vectorizing intrinsics using an
24719 external library.  The only type supported at present is @samp{mass},
24720 which specifies to use IBM's Mathematical Acceleration Subsystem
24721 (MASS) libraries for vectorizing intrinsics using external libraries.
24722 GCC currently emits calls to @code{acosd2}, @code{acosf4},
24723 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
24724 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
24725 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
24726 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
24727 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
24728 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
24729 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
24730 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
24731 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
24732 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
24733 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
24734 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
24735 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
24736 for power7.  Both @option{-ftree-vectorize} and
24737 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
24738 libraries must be specified at link time.
24740 @item -mfriz
24741 @itemx -mno-friz
24742 @opindex mfriz
24743 Generate (do not generate) the @code{friz} instruction when the
24744 @option{-funsafe-math-optimizations} option is used to optimize
24745 rounding of floating-point values to 64-bit integer and back to floating
24746 point.  The @code{friz} instruction does not return the same value if
24747 the floating-point number is too large to fit in an integer.
24749 @item -mpointers-to-nested-functions
24750 @itemx -mno-pointers-to-nested-functions
24751 @opindex mpointers-to-nested-functions
24752 Generate (do not generate) code to load up the static chain register
24753 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
24754 systems where a function pointer points to a 3-word descriptor giving
24755 the function address, TOC value to be loaded in register @code{r2}, and
24756 static chain value to be loaded in register @code{r11}.  The
24757 @option{-mpointers-to-nested-functions} is on by default.  You cannot
24758 call through pointers to nested functions or pointers
24759 to functions compiled in other languages that use the static chain if
24760 you use @option{-mno-pointers-to-nested-functions}.
24762 @item -msave-toc-indirect
24763 @itemx -mno-save-toc-indirect
24764 @opindex msave-toc-indirect
24765 Generate (do not generate) code to save the TOC value in the reserved
24766 stack location in the function prologue if the function calls through
24767 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
24768 saved in the prologue, it is saved just before the call through the
24769 pointer.  The @option{-mno-save-toc-indirect} option is the default.
24771 @item -mcompat-align-parm
24772 @itemx -mno-compat-align-parm
24773 @opindex mcompat-align-parm
24774 Generate (do not generate) code to pass structure parameters with a
24775 maximum alignment of 64 bits, for compatibility with older versions
24776 of GCC.
24778 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
24779 structure parameter on a 128-bit boundary when that structure contained
24780 a member requiring 128-bit alignment.  This is corrected in more
24781 recent versions of GCC.  This option may be used to generate code
24782 that is compatible with functions compiled with older versions of
24783 GCC.
24785 The @option{-mno-compat-align-parm} option is the default.
24787 @item -mstack-protector-guard=@var{guard}
24788 @itemx -mstack-protector-guard-reg=@var{reg}
24789 @itemx -mstack-protector-guard-offset=@var{offset}
24790 @itemx -mstack-protector-guard-symbol=@var{symbol}
24791 @opindex mstack-protector-guard
24792 @opindex mstack-protector-guard-reg
24793 @opindex mstack-protector-guard-offset
24794 @opindex mstack-protector-guard-symbol
24795 Generate stack protection code using canary at @var{guard}.  Supported
24796 locations are @samp{global} for global canary or @samp{tls} for per-thread
24797 canary in the TLS block (the default with GNU libc version 2.4 or later).
24799 With the latter choice the options
24800 @option{-mstack-protector-guard-reg=@var{reg}} and
24801 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
24802 which register to use as base register for reading the canary, and from what
24803 offset from that base register. The default for those is as specified in the
24804 relevant ABI.  @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
24805 the offset with a symbol reference to a canary in the TLS block.
24806 @end table
24808 @node RX Options
24809 @subsection RX Options
24810 @cindex RX Options
24812 These command-line options are defined for RX targets:
24814 @table @gcctabopt
24815 @item -m64bit-doubles
24816 @itemx -m32bit-doubles
24817 @opindex m64bit-doubles
24818 @opindex m32bit-doubles
24819 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
24820 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
24821 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
24822 works on 32-bit values, which is why the default is
24823 @option{-m32bit-doubles}.
24825 @item -fpu
24826 @itemx -nofpu
24827 @opindex fpu
24828 @opindex nofpu
24829 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
24830 floating-point hardware.  The default is enabled for the RX600
24831 series and disabled for the RX200 series.
24833 Floating-point instructions are only generated for 32-bit floating-point 
24834 values, however, so the FPU hardware is not used for doubles if the
24835 @option{-m64bit-doubles} option is used.
24837 @emph{Note} If the @option{-fpu} option is enabled then
24838 @option{-funsafe-math-optimizations} is also enabled automatically.
24839 This is because the RX FPU instructions are themselves unsafe.
24841 @item -mcpu=@var{name}
24842 @opindex mcpu
24843 Selects the type of RX CPU to be targeted.  Currently three types are
24844 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
24845 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
24847 The only difference between @samp{RX600} and @samp{RX610} is that the
24848 @samp{RX610} does not support the @code{MVTIPL} instruction.
24850 The @samp{RX200} series does not have a hardware floating-point unit
24851 and so @option{-nofpu} is enabled by default when this type is
24852 selected.
24854 @item -mbig-endian-data
24855 @itemx -mlittle-endian-data
24856 @opindex mbig-endian-data
24857 @opindex mlittle-endian-data
24858 Store data (but not code) in the big-endian format.  The default is
24859 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
24860 format.
24862 @item -msmall-data-limit=@var{N}
24863 @opindex msmall-data-limit
24864 Specifies the maximum size in bytes of global and static variables
24865 which can be placed into the small data area.  Using the small data
24866 area can lead to smaller and faster code, but the size of area is
24867 limited and it is up to the programmer to ensure that the area does
24868 not overflow.  Also when the small data area is used one of the RX's
24869 registers (usually @code{r13}) is reserved for use pointing to this
24870 area, so it is no longer available for use by the compiler.  This
24871 could result in slower and/or larger code if variables are pushed onto
24872 the stack instead of being held in this register.
24874 Note, common variables (variables that have not been initialized) and
24875 constants are not placed into the small data area as they are assigned
24876 to other sections in the output executable.
24878 The default value is zero, which disables this feature.  Note, this
24879 feature is not enabled by default with higher optimization levels
24880 (@option{-O2} etc) because of the potentially detrimental effects of
24881 reserving a register.  It is up to the programmer to experiment and
24882 discover whether this feature is of benefit to their program.  See the
24883 description of the @option{-mpid} option for a description of how the
24884 actual register to hold the small data area pointer is chosen.
24886 @item -msim
24887 @itemx -mno-sim
24888 @opindex msim
24889 @opindex mno-sim
24890 Use the simulator runtime.  The default is to use the libgloss
24891 board-specific runtime.
24893 @item -mas100-syntax
24894 @itemx -mno-as100-syntax
24895 @opindex mas100-syntax
24896 @opindex mno-as100-syntax
24897 When generating assembler output use a syntax that is compatible with
24898 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
24899 assembler, but it has some restrictions so it is not generated by default.
24901 @item -mmax-constant-size=@var{N}
24902 @opindex mmax-constant-size
24903 Specifies the maximum size, in bytes, of a constant that can be used as
24904 an operand in a RX instruction.  Although the RX instruction set does
24905 allow constants of up to 4 bytes in length to be used in instructions,
24906 a longer value equates to a longer instruction.  Thus in some
24907 circumstances it can be beneficial to restrict the size of constants
24908 that are used in instructions.  Constants that are too big are instead
24909 placed into a constant pool and referenced via register indirection.
24911 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
24912 or 4 means that constants of any size are allowed.
24914 @item -mrelax
24915 @opindex mrelax
24916 Enable linker relaxation.  Linker relaxation is a process whereby the
24917 linker attempts to reduce the size of a program by finding shorter
24918 versions of various instructions.  Disabled by default.
24920 @item -mint-register=@var{N}
24921 @opindex mint-register
24922 Specify the number of registers to reserve for fast interrupt handler
24923 functions.  The value @var{N} can be between 0 and 4.  A value of 1
24924 means that register @code{r13} is reserved for the exclusive use
24925 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
24926 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
24927 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
24928 A value of 0, the default, does not reserve any registers.
24930 @item -msave-acc-in-interrupts
24931 @opindex msave-acc-in-interrupts
24932 Specifies that interrupt handler functions should preserve the
24933 accumulator register.  This is only necessary if normal code might use
24934 the accumulator register, for example because it performs 64-bit
24935 multiplications.  The default is to ignore the accumulator as this
24936 makes the interrupt handlers faster.
24938 @item -mpid
24939 @itemx -mno-pid
24940 @opindex mpid
24941 @opindex mno-pid
24942 Enables the generation of position independent data.  When enabled any
24943 access to constant data is done via an offset from a base address
24944 held in a register.  This allows the location of constant data to be
24945 determined at run time without requiring the executable to be
24946 relocated, which is a benefit to embedded applications with tight
24947 memory constraints.  Data that can be modified is not affected by this
24948 option.
24950 Note, using this feature reserves a register, usually @code{r13}, for
24951 the constant data base address.  This can result in slower and/or
24952 larger code, especially in complicated functions.
24954 The actual register chosen to hold the constant data base address
24955 depends upon whether the @option{-msmall-data-limit} and/or the
24956 @option{-mint-register} command-line options are enabled.  Starting
24957 with register @code{r13} and proceeding downwards, registers are
24958 allocated first to satisfy the requirements of @option{-mint-register},
24959 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
24960 is possible for the small data area register to be @code{r8} if both
24961 @option{-mint-register=4} and @option{-mpid} are specified on the
24962 command line.
24964 By default this feature is not enabled.  The default can be restored
24965 via the @option{-mno-pid} command-line option.
24967 @item -mno-warn-multiple-fast-interrupts
24968 @itemx -mwarn-multiple-fast-interrupts
24969 @opindex mno-warn-multiple-fast-interrupts
24970 @opindex mwarn-multiple-fast-interrupts
24971 Prevents GCC from issuing a warning message if it finds more than one
24972 fast interrupt handler when it is compiling a file.  The default is to
24973 issue a warning for each extra fast interrupt handler found, as the RX
24974 only supports one such interrupt.
24976 @item -mallow-string-insns
24977 @itemx -mno-allow-string-insns
24978 @opindex mallow-string-insns
24979 @opindex mno-allow-string-insns
24980 Enables or disables the use of the string manipulation instructions
24981 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
24982 @code{SWHILE} and also the @code{RMPA} instruction.  These
24983 instructions may prefetch data, which is not safe to do if accessing
24984 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
24985 for more information).
24987 The default is to allow these instructions, but it is not possible for
24988 GCC to reliably detect all circumstances where a string instruction
24989 might be used to access an I/O register, so their use cannot be
24990 disabled automatically.  Instead it is reliant upon the programmer to
24991 use the @option{-mno-allow-string-insns} option if their program
24992 accesses I/O space.
24994 When the instructions are enabled GCC defines the C preprocessor
24995 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
24996 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
24998 @item -mjsr
24999 @itemx -mno-jsr
25000 @opindex mjsr
25001 @opindex mno-jsr
25002 Use only (or not only) @code{JSR} instructions to access functions.
25003 This option can be used when code size exceeds the range of @code{BSR}
25004 instructions.  Note that @option{-mno-jsr} does not mean to not use
25005 @code{JSR} but instead means that any type of branch may be used.
25006 @end table
25008 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
25009 has special significance to the RX port when used with the
25010 @code{interrupt} function attribute.  This attribute indicates a
25011 function intended to process fast interrupts.  GCC ensures
25012 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
25013 and/or @code{r13} and only provided that the normal use of the
25014 corresponding registers have been restricted via the
25015 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
25016 options.
25018 @node S/390 and zSeries Options
25019 @subsection S/390 and zSeries Options
25020 @cindex S/390 and zSeries Options
25022 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
25024 @table @gcctabopt
25025 @item -mhard-float
25026 @itemx -msoft-float
25027 @opindex mhard-float
25028 @opindex msoft-float
25029 Use (do not use) the hardware floating-point instructions and registers
25030 for floating-point operations.  When @option{-msoft-float} is specified,
25031 functions in @file{libgcc.a} are used to perform floating-point
25032 operations.  When @option{-mhard-float} is specified, the compiler
25033 generates IEEE floating-point instructions.  This is the default.
25035 @item -mhard-dfp
25036 @itemx -mno-hard-dfp
25037 @opindex mhard-dfp
25038 @opindex mno-hard-dfp
25039 Use (do not use) the hardware decimal-floating-point instructions for
25040 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
25041 specified, functions in @file{libgcc.a} are used to perform
25042 decimal-floating-point operations.  When @option{-mhard-dfp} is
25043 specified, the compiler generates decimal-floating-point hardware
25044 instructions.  This is the default for @option{-march=z9-ec} or higher.
25046 @item -mlong-double-64
25047 @itemx -mlong-double-128
25048 @opindex mlong-double-64
25049 @opindex mlong-double-128
25050 These switches control the size of @code{long double} type. A size
25051 of 64 bits makes the @code{long double} type equivalent to the @code{double}
25052 type. This is the default.
25054 @item -mbackchain
25055 @itemx -mno-backchain
25056 @opindex mbackchain
25057 @opindex mno-backchain
25058 Store (do not store) the address of the caller's frame as backchain pointer
25059 into the callee's stack frame.
25060 A backchain may be needed to allow debugging using tools that do not understand
25061 DWARF call frame information.
25062 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
25063 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
25064 the backchain is placed into the topmost word of the 96/160 byte register
25065 save area.
25067 In general, code compiled with @option{-mbackchain} is call-compatible with
25068 code compiled with @option{-mmo-backchain}; however, use of the backchain
25069 for debugging purposes usually requires that the whole binary is built with
25070 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
25071 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
25072 to build a linux kernel use @option{-msoft-float}.
25074 The default is to not maintain the backchain.
25076 @item -mpacked-stack
25077 @itemx -mno-packed-stack
25078 @opindex mpacked-stack
25079 @opindex mno-packed-stack
25080 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
25081 specified, the compiler uses the all fields of the 96/160 byte register save
25082 area only for their default purpose; unused fields still take up stack space.
25083 When @option{-mpacked-stack} is specified, register save slots are densely
25084 packed at the top of the register save area; unused space is reused for other
25085 purposes, allowing for more efficient use of the available stack space.
25086 However, when @option{-mbackchain} is also in effect, the topmost word of
25087 the save area is always used to store the backchain, and the return address
25088 register is always saved two words below the backchain.
25090 As long as the stack frame backchain is not used, code generated with
25091 @option{-mpacked-stack} is call-compatible with code generated with
25092 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
25093 S/390 or zSeries generated code that uses the stack frame backchain at run
25094 time, not just for debugging purposes.  Such code is not call-compatible
25095 with code compiled with @option{-mpacked-stack}.  Also, note that the
25096 combination of @option{-mbackchain},
25097 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
25098 to build a linux kernel use @option{-msoft-float}.
25100 The default is to not use the packed stack layout.
25102 @item -msmall-exec
25103 @itemx -mno-small-exec
25104 @opindex msmall-exec
25105 @opindex mno-small-exec
25106 Generate (or do not generate) code using the @code{bras} instruction
25107 to do subroutine calls.
25108 This only works reliably if the total executable size does not
25109 exceed 64k.  The default is to use the @code{basr} instruction instead,
25110 which does not have this limitation.
25112 @item -m64
25113 @itemx -m31
25114 @opindex m64
25115 @opindex m31
25116 When @option{-m31} is specified, generate code compliant to the
25117 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
25118 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
25119 particular to generate 64-bit instructions.  For the @samp{s390}
25120 targets, the default is @option{-m31}, while the @samp{s390x}
25121 targets default to @option{-m64}.
25123 @item -mzarch
25124 @itemx -mesa
25125 @opindex mzarch
25126 @opindex mesa
25127 When @option{-mzarch} is specified, generate code using the
25128 instructions available on z/Architecture.
25129 When @option{-mesa} is specified, generate code using the
25130 instructions available on ESA/390.  Note that @option{-mesa} is
25131 not possible with @option{-m64}.
25132 When generating code compliant to the GNU/Linux for S/390 ABI,
25133 the default is @option{-mesa}.  When generating code compliant
25134 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
25136 @item -mhtm
25137 @itemx -mno-htm
25138 @opindex mhtm
25139 @opindex mno-htm
25140 The @option{-mhtm} option enables a set of builtins making use of
25141 instructions available with the transactional execution facility
25142 introduced with the IBM zEnterprise EC12 machine generation
25143 @ref{S/390 System z Built-in Functions}.
25144 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
25146 @item -mvx
25147 @itemx -mno-vx
25148 @opindex mvx
25149 @opindex mno-vx
25150 When @option{-mvx} is specified, generate code using the instructions
25151 available with the vector extension facility introduced with the IBM
25152 z13 machine generation.
25153 This option changes the ABI for some vector type values with regard to
25154 alignment and calling conventions.  In case vector type values are
25155 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
25156 command will be added to mark the resulting binary with the ABI used.
25157 @option{-mvx} is enabled by default when using @option{-march=z13}.
25159 @item -mzvector
25160 @itemx -mno-zvector
25161 @opindex mzvector
25162 @opindex mno-zvector
25163 The @option{-mzvector} option enables vector language extensions and
25164 builtins using instructions available with the vector extension
25165 facility introduced with the IBM z13 machine generation.
25166 This option adds support for @samp{vector} to be used as a keyword to
25167 define vector type variables and arguments.  @samp{vector} is only
25168 available when GNU extensions are enabled.  It will not be expanded
25169 when requesting strict standard compliance e.g. with @option{-std=c99}.
25170 In addition to the GCC low-level builtins @option{-mzvector} enables
25171 a set of builtins added for compatibility with AltiVec-style
25172 implementations like Power and Cell.  In order to make use of these
25173 builtins the header file @file{vecintrin.h} needs to be included.
25174 @option{-mzvector} is disabled by default.
25176 @item -mmvcle
25177 @itemx -mno-mvcle
25178 @opindex mmvcle
25179 @opindex mno-mvcle
25180 Generate (or do not generate) code using the @code{mvcle} instruction
25181 to perform block moves.  When @option{-mno-mvcle} is specified,
25182 use a @code{mvc} loop instead.  This is the default unless optimizing for
25183 size.
25185 @item -mdebug
25186 @itemx -mno-debug
25187 @opindex mdebug
25188 @opindex mno-debug
25189 Print (or do not print) additional debug information when compiling.
25190 The default is to not print debug information.
25192 @item -march=@var{cpu-type}
25193 @opindex march
25194 Generate code that runs on @var{cpu-type}, which is the name of a
25195 system representing a certain processor type.  Possible values for
25196 @var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
25197 @samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
25198 @samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11}, and
25199 @samp{native}.
25201 The default is @option{-march=z900}.
25203 Specifying @samp{native} as cpu type can be used to select the best
25204 architecture option for the host processor.
25205 @option{-march=native} has no effect if GCC does not recognize the
25206 processor.
25208 @item -mtune=@var{cpu-type}
25209 @opindex mtune
25210 Tune to @var{cpu-type} everything applicable about the generated code,
25211 except for the ABI and the set of available instructions.
25212 The list of @var{cpu-type} values is the same as for @option{-march}.
25213 The default is the value used for @option{-march}.
25215 @item -mtpf-trace
25216 @itemx -mno-tpf-trace
25217 @opindex mtpf-trace
25218 @opindex mno-tpf-trace
25219 Generate code that adds (does not add) in TPF OS specific branches to trace
25220 routines in the operating system.  This option is off by default, even
25221 when compiling for the TPF OS@.
25223 @item -mfused-madd
25224 @itemx -mno-fused-madd
25225 @opindex mfused-madd
25226 @opindex mno-fused-madd
25227 Generate code that uses (does not use) the floating-point multiply and
25228 accumulate instructions.  These instructions are generated by default if
25229 hardware floating point is used.
25231 @item -mwarn-framesize=@var{framesize}
25232 @opindex mwarn-framesize
25233 Emit a warning if the current function exceeds the given frame size.  Because
25234 this is a compile-time check it doesn't need to be a real problem when the program
25235 runs.  It is intended to identify functions that most probably cause
25236 a stack overflow.  It is useful to be used in an environment with limited stack
25237 size e.g.@: the linux kernel.
25239 @item -mwarn-dynamicstack
25240 @opindex mwarn-dynamicstack
25241 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
25242 arrays.  This is generally a bad idea with a limited stack size.
25244 @item -mstack-guard=@var{stack-guard}
25245 @itemx -mstack-size=@var{stack-size}
25246 @opindex mstack-guard
25247 @opindex mstack-size
25248 If these options are provided the S/390 back end emits additional instructions in
25249 the function prologue that trigger a trap if the stack size is @var{stack-guard}
25250 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
25251 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
25252 the frame size of the compiled function is chosen.
25253 These options are intended to be used to help debugging stack overflow problems.
25254 The additionally emitted code causes only little overhead and hence can also be
25255 used in production-like systems without greater performance degradation.  The given
25256 values have to be exact powers of 2 and @var{stack-size} has to be greater than
25257 @var{stack-guard} without exceeding 64k.
25258 In order to be efficient the extra code makes the assumption that the stack starts
25259 at an address aligned to the value given by @var{stack-size}.
25260 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
25262 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
25263 @opindex mhotpatch
25264 If the hotpatch option is enabled, a ``hot-patching'' function
25265 prologue is generated for all functions in the compilation unit.
25266 The funtion label is prepended with the given number of two-byte
25267 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
25268 the label, 2 * @var{post-halfwords} bytes are appended, using the
25269 largest NOP like instructions the architecture allows (maximum
25270 1000000).
25272 If both arguments are zero, hotpatching is disabled.
25274 This option can be overridden for individual functions with the
25275 @code{hotpatch} attribute.
25276 @end table
25278 @node Score Options
25279 @subsection Score Options
25280 @cindex Score Options
25282 These options are defined for Score implementations:
25284 @table @gcctabopt
25285 @item -meb
25286 @opindex meb
25287 Compile code for big-endian mode.  This is the default.
25289 @item -mel
25290 @opindex mel
25291 Compile code for little-endian mode.
25293 @item -mnhwloop
25294 @opindex mnhwloop
25295 Disable generation of @code{bcnz} instructions.
25297 @item -muls
25298 @opindex muls
25299 Enable generation of unaligned load and store instructions.
25301 @item -mmac
25302 @opindex mmac
25303 Enable the use of multiply-accumulate instructions. Disabled by default.
25305 @item -mscore5
25306 @opindex mscore5
25307 Specify the SCORE5 as the target architecture.
25309 @item -mscore5u
25310 @opindex mscore5u
25311 Specify the SCORE5U of the target architecture.
25313 @item -mscore7
25314 @opindex mscore7
25315 Specify the SCORE7 as the target architecture. This is the default.
25317 @item -mscore7d
25318 @opindex mscore7d
25319 Specify the SCORE7D as the target architecture.
25320 @end table
25322 @node SH Options
25323 @subsection SH Options
25325 These @samp{-m} options are defined for the SH implementations:
25327 @table @gcctabopt
25328 @item -m1
25329 @opindex m1
25330 Generate code for the SH1.
25332 @item -m2
25333 @opindex m2
25334 Generate code for the SH2.
25336 @item -m2e
25337 Generate code for the SH2e.
25339 @item -m2a-nofpu
25340 @opindex m2a-nofpu
25341 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
25342 that the floating-point unit is not used.
25344 @item -m2a-single-only
25345 @opindex m2a-single-only
25346 Generate code for the SH2a-FPU, in such a way that no double-precision
25347 floating-point operations are used.
25349 @item -m2a-single
25350 @opindex m2a-single
25351 Generate code for the SH2a-FPU assuming the floating-point unit is in
25352 single-precision mode by default.
25354 @item -m2a
25355 @opindex m2a
25356 Generate code for the SH2a-FPU assuming the floating-point unit is in
25357 double-precision mode by default.
25359 @item -m3
25360 @opindex m3
25361 Generate code for the SH3.
25363 @item -m3e
25364 @opindex m3e
25365 Generate code for the SH3e.
25367 @item -m4-nofpu
25368 @opindex m4-nofpu
25369 Generate code for the SH4 without a floating-point unit.
25371 @item -m4-single-only
25372 @opindex m4-single-only
25373 Generate code for the SH4 with a floating-point unit that only
25374 supports single-precision arithmetic.
25376 @item -m4-single
25377 @opindex m4-single
25378 Generate code for the SH4 assuming the floating-point unit is in
25379 single-precision mode by default.
25381 @item -m4
25382 @opindex m4
25383 Generate code for the SH4.
25385 @item -m4-100
25386 @opindex m4-100
25387 Generate code for SH4-100.
25389 @item -m4-100-nofpu
25390 @opindex m4-100-nofpu
25391 Generate code for SH4-100 in such a way that the
25392 floating-point unit is not used.
25394 @item -m4-100-single
25395 @opindex m4-100-single
25396 Generate code for SH4-100 assuming the floating-point unit is in
25397 single-precision mode by default.
25399 @item -m4-100-single-only
25400 @opindex m4-100-single-only
25401 Generate code for SH4-100 in such a way that no double-precision
25402 floating-point operations are used.
25404 @item -m4-200
25405 @opindex m4-200
25406 Generate code for SH4-200.
25408 @item -m4-200-nofpu
25409 @opindex m4-200-nofpu
25410 Generate code for SH4-200 without in such a way that the
25411 floating-point unit is not used.
25413 @item -m4-200-single
25414 @opindex m4-200-single
25415 Generate code for SH4-200 assuming the floating-point unit is in
25416 single-precision mode by default.
25418 @item -m4-200-single-only
25419 @opindex m4-200-single-only
25420 Generate code for SH4-200 in such a way that no double-precision
25421 floating-point operations are used.
25423 @item -m4-300
25424 @opindex m4-300
25425 Generate code for SH4-300.
25427 @item -m4-300-nofpu
25428 @opindex m4-300-nofpu
25429 Generate code for SH4-300 without in such a way that the
25430 floating-point unit is not used.
25432 @item -m4-300-single
25433 @opindex m4-300-single
25434 Generate code for SH4-300 in such a way that no double-precision
25435 floating-point operations are used.
25437 @item -m4-300-single-only
25438 @opindex m4-300-single-only
25439 Generate code for SH4-300 in such a way that no double-precision
25440 floating-point operations are used.
25442 @item -m4-340
25443 @opindex m4-340
25444 Generate code for SH4-340 (no MMU, no FPU).
25446 @item -m4-500
25447 @opindex m4-500
25448 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
25449 assembler.
25451 @item -m4a-nofpu
25452 @opindex m4a-nofpu
25453 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
25454 floating-point unit is not used.
25456 @item -m4a-single-only
25457 @opindex m4a-single-only
25458 Generate code for the SH4a, in such a way that no double-precision
25459 floating-point operations are used.
25461 @item -m4a-single
25462 @opindex m4a-single
25463 Generate code for the SH4a assuming the floating-point unit is in
25464 single-precision mode by default.
25466 @item -m4a
25467 @opindex m4a
25468 Generate code for the SH4a.
25470 @item -m4al
25471 @opindex m4al
25472 Same as @option{-m4a-nofpu}, except that it implicitly passes
25473 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
25474 instructions at the moment.
25476 @item -mb
25477 @opindex mb
25478 Compile code for the processor in big-endian mode.
25480 @item -ml
25481 @opindex ml
25482 Compile code for the processor in little-endian mode.
25484 @item -mdalign
25485 @opindex mdalign
25486 Align doubles at 64-bit boundaries.  Note that this changes the calling
25487 conventions, and thus some functions from the standard C library do
25488 not work unless you recompile it first with @option{-mdalign}.
25490 @item -mrelax
25491 @opindex mrelax
25492 Shorten some address references at link time, when possible; uses the
25493 linker option @option{-relax}.
25495 @item -mbigtable
25496 @opindex mbigtable
25497 Use 32-bit offsets in @code{switch} tables.  The default is to use
25498 16-bit offsets.
25500 @item -mbitops
25501 @opindex mbitops
25502 Enable the use of bit manipulation instructions on SH2A.
25504 @item -mfmovd
25505 @opindex mfmovd
25506 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
25507 alignment constraints.
25509 @item -mrenesas
25510 @opindex mrenesas
25511 Comply with the calling conventions defined by Renesas.
25513 @item -mno-renesas
25514 @opindex mno-renesas
25515 Comply with the calling conventions defined for GCC before the Renesas
25516 conventions were available.  This option is the default for all
25517 targets of the SH toolchain.
25519 @item -mnomacsave
25520 @opindex mnomacsave
25521 Mark the @code{MAC} register as call-clobbered, even if
25522 @option{-mrenesas} is given.
25524 @item -mieee
25525 @itemx -mno-ieee
25526 @opindex mieee
25527 @opindex mno-ieee
25528 Control the IEEE compliance of floating-point comparisons, which affects the
25529 handling of cases where the result of a comparison is unordered.  By default
25530 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
25531 enabled @option{-mno-ieee} is implicitly set, which results in faster
25532 floating-point greater-equal and less-equal comparisons.  The implicit settings
25533 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
25535 @item -minline-ic_invalidate
25536 @opindex minline-ic_invalidate
25537 Inline code to invalidate instruction cache entries after setting up
25538 nested function trampolines.
25539 This option has no effect if @option{-musermode} is in effect and the selected
25540 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
25541 instruction.
25542 If the selected code generation option does not allow the use of the @code{icbi}
25543 instruction, and @option{-musermode} is not in effect, the inlined code
25544 manipulates the instruction cache address array directly with an associative
25545 write.  This not only requires privileged mode at run time, but it also
25546 fails if the cache line had been mapped via the TLB and has become unmapped.
25548 @item -misize
25549 @opindex misize
25550 Dump instruction size and location in the assembly code.
25552 @item -mpadstruct
25553 @opindex mpadstruct
25554 This option is deprecated.  It pads structures to multiple of 4 bytes,
25555 which is incompatible with the SH ABI@.
25557 @item -matomic-model=@var{model}
25558 @opindex matomic-model=@var{model}
25559 Sets the model of atomic operations and additional parameters as a comma
25560 separated list.  For details on the atomic built-in functions see
25561 @ref{__atomic Builtins}.  The following models and parameters are supported:
25563 @table @samp
25565 @item none
25566 Disable compiler generated atomic sequences and emit library calls for atomic
25567 operations.  This is the default if the target is not @code{sh*-*-linux*}.
25569 @item soft-gusa
25570 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
25571 built-in functions.  The generated atomic sequences require additional support
25572 from the interrupt/exception handling code of the system and are only suitable
25573 for SH3* and SH4* single-core systems.  This option is enabled by default when
25574 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
25575 this option also partially utilizes the hardware atomic instructions
25576 @code{movli.l} and @code{movco.l} to create more efficient code, unless
25577 @samp{strict} is specified.  
25579 @item soft-tcb
25580 Generate software atomic sequences that use a variable in the thread control
25581 block.  This is a variation of the gUSA sequences which can also be used on
25582 SH1* and SH2* targets.  The generated atomic sequences require additional
25583 support from the interrupt/exception handling code of the system and are only
25584 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
25585 parameter has to be specified as well.
25587 @item soft-imask
25588 Generate software atomic sequences that temporarily disable interrupts by
25589 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
25590 in privileged mode and is only suitable for single-core systems.  Additional
25591 support from the interrupt/exception handling code of the system is not
25592 required.  This model is enabled by default when the target is
25593 @code{sh*-*-linux*} and SH1* or SH2*.
25595 @item hard-llcs
25596 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
25597 instructions only.  This is only available on SH4A and is suitable for
25598 multi-core systems.  Since the hardware instructions support only 32 bit atomic
25599 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
25600 Code compiled with this option is also compatible with other software
25601 atomic model interrupt/exception handling systems if executed on an SH4A
25602 system.  Additional support from the interrupt/exception handling code of the
25603 system is not required for this model.
25605 @item gbr-offset=
25606 This parameter specifies the offset in bytes of the variable in the thread
25607 control block structure that should be used by the generated atomic sequences
25608 when the @samp{soft-tcb} model has been selected.  For other models this
25609 parameter is ignored.  The specified value must be an integer multiple of four
25610 and in the range 0-1020.
25612 @item strict
25613 This parameter prevents mixed usage of multiple atomic models, even if they
25614 are compatible, and makes the compiler generate atomic sequences of the
25615 specified model only.
25617 @end table
25619 @item -mtas
25620 @opindex mtas
25621 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
25622 Notice that depending on the particular hardware and software configuration
25623 this can degrade overall performance due to the operand cache line flushes
25624 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
25625 processors the @code{tas.b} instruction must be used with caution since it
25626 can result in data corruption for certain cache configurations.
25628 @item -mprefergot
25629 @opindex mprefergot
25630 When generating position-independent code, emit function calls using
25631 the Global Offset Table instead of the Procedure Linkage Table.
25633 @item -musermode
25634 @itemx -mno-usermode
25635 @opindex musermode
25636 @opindex mno-usermode
25637 Don't allow (allow) the compiler generating privileged mode code.  Specifying
25638 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
25639 inlined code would not work in user mode.  @option{-musermode} is the default
25640 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
25641 @option{-musermode} has no effect, since there is no user mode.
25643 @item -multcost=@var{number}
25644 @opindex multcost=@var{number}
25645 Set the cost to assume for a multiply insn.
25647 @item -mdiv=@var{strategy}
25648 @opindex mdiv=@var{strategy}
25649 Set the division strategy to be used for integer division operations.
25650 @var{strategy} can be one of: 
25652 @table @samp
25654 @item call-div1
25655 Calls a library function that uses the single-step division instruction
25656 @code{div1} to perform the operation.  Division by zero calculates an
25657 unspecified result and does not trap.  This is the default except for SH4,
25658 SH2A and SHcompact.
25660 @item call-fp
25661 Calls a library function that performs the operation in double precision
25662 floating point.  Division by zero causes a floating-point exception.  This is
25663 the default for SHcompact with FPU.  Specifying this for targets that do not
25664 have a double precision FPU defaults to @code{call-div1}.
25666 @item call-table
25667 Calls a library function that uses a lookup table for small divisors and
25668 the @code{div1} instruction with case distinction for larger divisors.  Division
25669 by zero calculates an unspecified result and does not trap.  This is the default
25670 for SH4.  Specifying this for targets that do not have dynamic shift
25671 instructions defaults to @code{call-div1}.
25673 @end table
25675 When a division strategy has not been specified the default strategy is
25676 selected based on the current target.  For SH2A the default strategy is to
25677 use the @code{divs} and @code{divu} instructions instead of library function
25678 calls.
25680 @item -maccumulate-outgoing-args
25681 @opindex maccumulate-outgoing-args
25682 Reserve space once for outgoing arguments in the function prologue rather
25683 than around each call.  Generally beneficial for performance and size.  Also
25684 needed for unwinding to avoid changing the stack frame around conditional code.
25686 @item -mdivsi3_libfunc=@var{name}
25687 @opindex mdivsi3_libfunc=@var{name}
25688 Set the name of the library function used for 32-bit signed division to
25689 @var{name}.
25690 This only affects the name used in the @samp{call} division strategies, and
25691 the compiler still expects the same sets of input/output/clobbered registers as
25692 if this option were not present.
25694 @item -mfixed-range=@var{register-range}
25695 @opindex mfixed-range
25696 Generate code treating the given register range as fixed registers.
25697 A fixed register is one that the register allocator can not use.  This is
25698 useful when compiling kernel code.  A register range is specified as
25699 two registers separated by a dash.  Multiple register ranges can be
25700 specified separated by a comma.
25702 @item -mbranch-cost=@var{num}
25703 @opindex mbranch-cost=@var{num}
25704 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
25705 make the compiler try to generate more branch-free code if possible.  
25706 If not specified the value is selected depending on the processor type that
25707 is being compiled for.
25709 @item -mzdcbranch
25710 @itemx -mno-zdcbranch
25711 @opindex mzdcbranch
25712 @opindex mno-zdcbranch
25713 Assume (do not assume) that zero displacement conditional branch instructions
25714 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
25715 compiler prefers zero displacement branch code sequences.  This is
25716 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
25717 disabled by specifying @option{-mno-zdcbranch}.
25719 @item -mcbranch-force-delay-slot
25720 @opindex mcbranch-force-delay-slot
25721 Force the usage of delay slots for conditional branches, which stuffs the delay
25722 slot with a @code{nop} if a suitable instruction cannot be found.  By default
25723 this option is disabled.  It can be enabled to work around hardware bugs as
25724 found in the original SH7055.
25726 @item -mfused-madd
25727 @itemx -mno-fused-madd
25728 @opindex mfused-madd
25729 @opindex mno-fused-madd
25730 Generate code that uses (does not use) the floating-point multiply and
25731 accumulate instructions.  These instructions are generated by default
25732 if hardware floating point is used.  The machine-dependent
25733 @option{-mfused-madd} option is now mapped to the machine-independent
25734 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
25735 mapped to @option{-ffp-contract=off}.
25737 @item -mfsca
25738 @itemx -mno-fsca
25739 @opindex mfsca
25740 @opindex mno-fsca
25741 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
25742 and cosine approximations.  The option @option{-mfsca} must be used in
25743 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
25744 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
25745 approximations even if @option{-funsafe-math-optimizations} is in effect.
25747 @item -mfsrra
25748 @itemx -mno-fsrra
25749 @opindex mfsrra
25750 @opindex mno-fsrra
25751 Allow or disallow the compiler to emit the @code{fsrra} instruction for
25752 reciprocal square root approximations.  The option @option{-mfsrra} must be used
25753 in combination with @option{-funsafe-math-optimizations} and
25754 @option{-ffinite-math-only}.  It is enabled by default when generating code for
25755 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
25756 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
25757 in effect.
25759 @item -mpretend-cmove
25760 @opindex mpretend-cmove
25761 Prefer zero-displacement conditional branches for conditional move instruction
25762 patterns.  This can result in faster code on the SH4 processor.
25764 @item -mfdpic
25765 @opindex fdpic
25766 Generate code using the FDPIC ABI.
25768 @end table
25770 @node Solaris 2 Options
25771 @subsection Solaris 2 Options
25772 @cindex Solaris 2 options
25774 These @samp{-m} options are supported on Solaris 2:
25776 @table @gcctabopt
25777 @item -mclear-hwcap
25778 @opindex mclear-hwcap
25779 @option{-mclear-hwcap} tells the compiler to remove the hardware
25780 capabilities generated by the Solaris assembler.  This is only necessary
25781 when object files use ISA extensions not supported by the current
25782 machine, but check at runtime whether or not to use them.
25784 @item -mimpure-text
25785 @opindex mimpure-text
25786 @option{-mimpure-text}, used in addition to @option{-shared}, tells
25787 the compiler to not pass @option{-z text} to the linker when linking a
25788 shared object.  Using this option, you can link position-dependent
25789 code into a shared object.
25791 @option{-mimpure-text} suppresses the ``relocations remain against
25792 allocatable but non-writable sections'' linker error message.
25793 However, the necessary relocations trigger copy-on-write, and the
25794 shared object is not actually shared across processes.  Instead of
25795 using @option{-mimpure-text}, you should compile all source code with
25796 @option{-fpic} or @option{-fPIC}.
25798 @end table
25800 These switches are supported in addition to the above on Solaris 2:
25802 @table @gcctabopt
25803 @item -pthreads
25804 @opindex pthreads
25805 This is a synonym for @option{-pthread}.
25806 @end table
25808 @node SPARC Options
25809 @subsection SPARC Options
25810 @cindex SPARC options
25812 These @samp{-m} options are supported on the SPARC:
25814 @table @gcctabopt
25815 @item -mno-app-regs
25816 @itemx -mapp-regs
25817 @opindex mno-app-regs
25818 @opindex mapp-regs
25819 Specify @option{-mapp-regs} to generate output using the global registers
25820 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
25821 global register 1, each global register 2 through 4 is then treated as an
25822 allocable register that is clobbered by function calls.  This is the default.
25824 To be fully SVR4 ABI-compliant at the cost of some performance loss,
25825 specify @option{-mno-app-regs}.  You should compile libraries and system
25826 software with this option.
25828 @item -mflat
25829 @itemx -mno-flat
25830 @opindex mflat
25831 @opindex mno-flat
25832 With @option{-mflat}, the compiler does not generate save/restore instructions
25833 and uses a ``flat'' or single register window model.  This model is compatible
25834 with the regular register window model.  The local registers and the input
25835 registers (0--5) are still treated as ``call-saved'' registers and are
25836 saved on the stack as needed.
25838 With @option{-mno-flat} (the default), the compiler generates save/restore
25839 instructions (except for leaf functions).  This is the normal operating mode.
25841 @item -mfpu
25842 @itemx -mhard-float
25843 @opindex mfpu
25844 @opindex mhard-float
25845 Generate output containing floating-point instructions.  This is the
25846 default.
25848 @item -mno-fpu
25849 @itemx -msoft-float
25850 @opindex mno-fpu
25851 @opindex msoft-float
25852 Generate output containing library calls for floating point.
25853 @strong{Warning:} the requisite libraries are not available for all SPARC
25854 targets.  Normally the facilities of the machine's usual C compiler are
25855 used, but this cannot be done directly in cross-compilation.  You must make
25856 your own arrangements to provide suitable library functions for
25857 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
25858 @samp{sparclite-*-*} do provide software floating-point support.
25860 @option{-msoft-float} changes the calling convention in the output file;
25861 therefore, it is only useful if you compile @emph{all} of a program with
25862 this option.  In particular, you need to compile @file{libgcc.a}, the
25863 library that comes with GCC, with @option{-msoft-float} in order for
25864 this to work.
25866 @item -mhard-quad-float
25867 @opindex mhard-quad-float
25868 Generate output containing quad-word (long double) floating-point
25869 instructions.
25871 @item -msoft-quad-float
25872 @opindex msoft-quad-float
25873 Generate output containing library calls for quad-word (long double)
25874 floating-point instructions.  The functions called are those specified
25875 in the SPARC ABI@.  This is the default.
25877 As of this writing, there are no SPARC implementations that have hardware
25878 support for the quad-word floating-point instructions.  They all invoke
25879 a trap handler for one of these instructions, and then the trap handler
25880 emulates the effect of the instruction.  Because of the trap handler overhead,
25881 this is much slower than calling the ABI library routines.  Thus the
25882 @option{-msoft-quad-float} option is the default.
25884 @item -mno-unaligned-doubles
25885 @itemx -munaligned-doubles
25886 @opindex mno-unaligned-doubles
25887 @opindex munaligned-doubles
25888 Assume that doubles have 8-byte alignment.  This is the default.
25890 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
25891 alignment only if they are contained in another type, or if they have an
25892 absolute address.  Otherwise, it assumes they have 4-byte alignment.
25893 Specifying this option avoids some rare compatibility problems with code
25894 generated by other compilers.  It is not the default because it results
25895 in a performance loss, especially for floating-point code.
25897 @item -muser-mode
25898 @itemx -mno-user-mode
25899 @opindex muser-mode
25900 @opindex mno-user-mode
25901 Do not generate code that can only run in supervisor mode.  This is relevant
25902 only for the @code{casa} instruction emitted for the LEON3 processor.  This
25903 is the default.
25905 @item -mfaster-structs
25906 @itemx -mno-faster-structs
25907 @opindex mfaster-structs
25908 @opindex mno-faster-structs
25909 With @option{-mfaster-structs}, the compiler assumes that structures
25910 should have 8-byte alignment.  This enables the use of pairs of
25911 @code{ldd} and @code{std} instructions for copies in structure
25912 assignment, in place of twice as many @code{ld} and @code{st} pairs.
25913 However, the use of this changed alignment directly violates the SPARC
25914 ABI@.  Thus, it's intended only for use on targets where the developer
25915 acknowledges that their resulting code is not directly in line with
25916 the rules of the ABI@.
25918 @item -mstd-struct-return
25919 @itemx -mno-std-struct-return
25920 @opindex mstd-struct-return
25921 @opindex mno-std-struct-return
25922 With @option{-mstd-struct-return}, the compiler generates checking code
25923 in functions returning structures or unions to detect size mismatches
25924 between the two sides of function calls, as per the 32-bit ABI@.
25926 The default is @option{-mno-std-struct-return}.  This option has no effect
25927 in 64-bit mode.
25929 @item -mlra
25930 @itemx -mno-lra
25931 @opindex mlra
25932 @opindex mno-lra
25933 Enable Local Register Allocation.  This is the default for SPARC since GCC 7
25934 so @option{-mno-lra} needs to be passed to get old Reload.
25936 @item -mcpu=@var{cpu_type}
25937 @opindex mcpu
25938 Set the instruction set, register set, and instruction scheduling parameters
25939 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
25940 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
25941 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
25942 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
25943 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
25944 @samp{niagara3}, @samp{niagara4}, @samp{niagara7} and @samp{m8}.
25946 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
25947 which selects the best architecture option for the host processor.
25948 @option{-mcpu=native} has no effect if GCC does not recognize
25949 the processor.
25951 Default instruction scheduling parameters are used for values that select
25952 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
25953 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
25955 Here is a list of each supported architecture and their supported
25956 implementations.
25958 @table @asis
25959 @item v7
25960 cypress, leon3v7
25962 @item v8
25963 supersparc, hypersparc, leon, leon3
25965 @item sparclite
25966 f930, f934, sparclite86x
25968 @item sparclet
25969 tsc701
25971 @item v9
25972 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
25973 niagara7, m8
25974 @end table
25976 By default (unless configured otherwise), GCC generates code for the V7
25977 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
25978 additionally optimizes it for the Cypress CY7C602 chip, as used in the
25979 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
25980 SPARCStation 1, 2, IPX etc.
25982 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
25983 architecture.  The only difference from V7 code is that the compiler emits
25984 the integer multiply and integer divide instructions which exist in SPARC-V8
25985 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
25986 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
25987 2000 series.
25989 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
25990 the SPARC architecture.  This adds the integer multiply, integer divide step
25991 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
25992 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
25993 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
25994 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
25995 MB86934 chip, which is the more recent SPARClite with FPU@.
25997 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
25998 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
25999 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
26000 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
26001 optimizes it for the TEMIC SPARClet chip.
26003 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
26004 architecture.  This adds 64-bit integer and floating-point move instructions,
26005 3 additional floating-point condition code registers and conditional move
26006 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
26007 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
26008 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
26009 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
26010 @option{-mcpu=niagara}, the compiler additionally optimizes it for
26011 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
26012 additionally optimizes it for Sun UltraSPARC T2 chips. With
26013 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
26014 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
26015 additionally optimizes it for Sun UltraSPARC T4 chips.  With
26016 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
26017 Oracle SPARC M7 chips.  With @option{-mcpu=m8}, the compiler
26018 additionally optimizes it for Oracle M8 chips.
26020 @item -mtune=@var{cpu_type}
26021 @opindex mtune
26022 Set the instruction scheduling parameters for machine type
26023 @var{cpu_type}, but do not set the instruction set or register set that the
26024 option @option{-mcpu=@var{cpu_type}} does.
26026 The same values for @option{-mcpu=@var{cpu_type}} can be used for
26027 @option{-mtune=@var{cpu_type}}, but the only useful values are those
26028 that select a particular CPU implementation.  Those are
26029 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
26030 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
26031 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
26032 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
26033 @samp{niagara4}, @samp{niagara7} and @samp{m8}.  With native Solaris
26034 and GNU/Linux toolchains, @samp{native} can also be used.
26036 @item -mv8plus
26037 @itemx -mno-v8plus
26038 @opindex mv8plus
26039 @opindex mno-v8plus
26040 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
26041 difference from the V8 ABI is that the global and out registers are
26042 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
26043 mode for all SPARC-V9 processors.
26045 @item -mvis
26046 @itemx -mno-vis
26047 @opindex mvis
26048 @opindex mno-vis
26049 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
26050 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
26052 @item -mvis2
26053 @itemx -mno-vis2
26054 @opindex mvis2
26055 @opindex mno-vis2
26056 With @option{-mvis2}, GCC generates code that takes advantage of
26057 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
26058 default is @option{-mvis2} when targeting a cpu that supports such
26059 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
26060 also sets @option{-mvis}.
26062 @item -mvis3
26063 @itemx -mno-vis3
26064 @opindex mvis3
26065 @opindex mno-vis3
26066 With @option{-mvis3}, GCC generates code that takes advantage of
26067 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
26068 default is @option{-mvis3} when targeting a cpu that supports such
26069 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
26070 also sets @option{-mvis2} and @option{-mvis}.
26072 @item -mvis4
26073 @itemx -mno-vis4
26074 @opindex mvis4
26075 @opindex mno-vis4
26076 With @option{-mvis4}, GCC generates code that takes advantage of
26077 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
26078 default is @option{-mvis4} when targeting a cpu that supports such
26079 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
26080 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
26082 @item -mvis4b
26083 @itemx -mno-vis4b
26084 @opindex mvis4b
26085 @opindex mno-vis4b
26086 With @option{-mvis4b}, GCC generates code that takes advantage of
26087 version 4.0 of the UltraSPARC Visual Instruction Set extensions, plus
26088 the additional VIS instructions introduced in the Oracle SPARC
26089 Architecture 2017.  The default is @option{-mvis4b} when targeting a
26090 cpu that supports such instructions, such as m8 and later.  Setting
26091 @option{-mvis4b} also sets @option{-mvis4}, @option{-mvis3},
26092 @option{-mvis2} and @option{-mvis}.
26094 @item -mcbcond
26095 @itemx -mno-cbcond
26096 @opindex mcbcond
26097 @opindex mno-cbcond
26098 With @option{-mcbcond}, GCC generates code that takes advantage of the UltraSPARC
26099 Compare-and-Branch-on-Condition instructions.  The default is @option{-mcbcond}
26100 when targeting a CPU that supports such instructions, such as Niagara-4 and
26101 later.
26103 @item -mfmaf
26104 @itemx -mno-fmaf
26105 @opindex mfmaf
26106 @opindex mno-fmaf
26107 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
26108 Fused Multiply-Add Floating-point instructions.  The default is @option{-mfmaf}
26109 when targeting a CPU that supports such instructions, such as Niagara-3 and
26110 later.
26112 @item -mfsmuld
26113 @itemx -mno-fsmuld
26114 @opindex mfsmuld
26115 @opindex mno-fsmuld
26116 With @option{-mfsmuld}, GCC generates code that takes advantage of the
26117 Floating-point Multiply Single to Double (FsMULd) instruction.  The default is
26118 @option{-mfsmuld} when targeting a CPU supporting the architecture versions V8
26119 or V9 with FPU except @option{-mcpu=leon}.
26121 @item -mpopc
26122 @itemx -mno-popc
26123 @opindex mpopc
26124 @opindex mno-popc
26125 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
26126 Population Count instruction.  The default is @option{-mpopc}
26127 when targeting a CPU that supports such an instruction, such as Niagara-2 and
26128 later.
26130 @item -msubxc
26131 @itemx -mno-subxc
26132 @opindex msubxc
26133 @opindex mno-subxc
26134 With @option{-msubxc}, GCC generates code that takes advantage of the UltraSPARC
26135 Subtract-Extended-with-Carry instruction.  The default is @option{-msubxc}
26136 when targeting a CPU that supports such an instruction, such as Niagara-7 and
26137 later.
26139 @item -mfix-at697f
26140 @opindex mfix-at697f
26141 Enable the documented workaround for the single erratum of the Atmel AT697F
26142 processor (which corresponds to erratum #13 of the AT697E processor).
26144 @item -mfix-ut699
26145 @opindex mfix-ut699
26146 Enable the documented workarounds for the floating-point errata and the data
26147 cache nullify errata of the UT699 processor.
26149 @item -mfix-ut700
26150 @opindex mfix-ut700
26151 Enable the documented workaround for the back-to-back store errata of
26152 the UT699E/UT700 processor.
26154 @item -mfix-gr712rc
26155 @opindex mfix-gr712rc
26156 Enable the documented workaround for the back-to-back store errata of
26157 the GR712RC processor.
26158 @end table
26160 These @samp{-m} options are supported in addition to the above
26161 on SPARC-V9 processors in 64-bit environments:
26163 @table @gcctabopt
26164 @item -m32
26165 @itemx -m64
26166 @opindex m32
26167 @opindex m64
26168 Generate code for a 32-bit or 64-bit environment.
26169 The 32-bit environment sets int, long and pointer to 32 bits.
26170 The 64-bit environment sets int to 32 bits and long and pointer
26171 to 64 bits.
26173 @item -mcmodel=@var{which}
26174 @opindex mcmodel
26175 Set the code model to one of
26177 @table @samp
26178 @item medlow
26179 The Medium/Low code model: 64-bit addresses, programs
26180 must be linked in the low 32 bits of memory.  Programs can be statically
26181 or dynamically linked.
26183 @item medmid
26184 The Medium/Middle code model: 64-bit addresses, programs
26185 must be linked in the low 44 bits of memory, the text and data segments must
26186 be less than 2GB in size and the data segment must be located within 2GB of
26187 the text segment.
26189 @item medany
26190 The Medium/Anywhere code model: 64-bit addresses, programs
26191 may be linked anywhere in memory, the text and data segments must be less
26192 than 2GB in size and the data segment must be located within 2GB of the
26193 text segment.
26195 @item embmedany
26196 The Medium/Anywhere code model for embedded systems:
26197 64-bit addresses, the text and data segments must be less than 2GB in
26198 size, both starting anywhere in memory (determined at link time).  The
26199 global register %g4 points to the base of the data segment.  Programs
26200 are statically linked and PIC is not supported.
26201 @end table
26203 @item -mmemory-model=@var{mem-model}
26204 @opindex mmemory-model
26205 Set the memory model in force on the processor to one of
26207 @table @samp
26208 @item default
26209 The default memory model for the processor and operating system.
26211 @item rmo
26212 Relaxed Memory Order
26214 @item pso
26215 Partial Store Order
26217 @item tso
26218 Total Store Order
26220 @item sc
26221 Sequential Consistency
26222 @end table
26224 These memory models are formally defined in Appendix D of the SPARC-V9
26225 architecture manual, as set in the processor's @code{PSTATE.MM} field.
26227 @item -mstack-bias
26228 @itemx -mno-stack-bias
26229 @opindex mstack-bias
26230 @opindex mno-stack-bias
26231 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
26232 frame pointer if present, are offset by @minus{}2047 which must be added back
26233 when making stack frame references.  This is the default in 64-bit mode.
26234 Otherwise, assume no such offset is present.
26235 @end table
26237 @node SPU Options
26238 @subsection SPU Options
26239 @cindex SPU options
26241 These @samp{-m} options are supported on the SPU:
26243 @table @gcctabopt
26244 @item -mwarn-reloc
26245 @itemx -merror-reloc
26246 @opindex mwarn-reloc
26247 @opindex merror-reloc
26249 The loader for SPU does not handle dynamic relocations.  By default, GCC
26250 gives an error when it generates code that requires a dynamic
26251 relocation.  @option{-mno-error-reloc} disables the error,
26252 @option{-mwarn-reloc} generates a warning instead.
26254 @item -msafe-dma
26255 @itemx -munsafe-dma
26256 @opindex msafe-dma
26257 @opindex munsafe-dma
26259 Instructions that initiate or test completion of DMA must not be
26260 reordered with respect to loads and stores of the memory that is being
26261 accessed.
26262 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
26263 memory accesses, but that can lead to inefficient code in places where the
26264 memory is known to not change.  Rather than mark the memory as volatile,
26265 you can use @option{-msafe-dma} to tell the compiler to treat
26266 the DMA instructions as potentially affecting all memory.  
26268 @item -mbranch-hints
26269 @opindex mbranch-hints
26271 By default, GCC generates a branch hint instruction to avoid
26272 pipeline stalls for always-taken or probably-taken branches.  A hint
26273 is not generated closer than 8 instructions away from its branch.
26274 There is little reason to disable them, except for debugging purposes,
26275 or to make an object a little bit smaller.
26277 @item -msmall-mem
26278 @itemx -mlarge-mem
26279 @opindex msmall-mem
26280 @opindex mlarge-mem
26282 By default, GCC generates code assuming that addresses are never larger
26283 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
26284 a full 32-bit address.
26286 @item -mstdmain
26287 @opindex mstdmain
26289 By default, GCC links against startup code that assumes the SPU-style
26290 main function interface (which has an unconventional parameter list).
26291 With @option{-mstdmain}, GCC links your program against startup
26292 code that assumes a C99-style interface to @code{main}, including a
26293 local copy of @code{argv} strings.
26295 @item -mfixed-range=@var{register-range}
26296 @opindex mfixed-range
26297 Generate code treating the given register range as fixed registers.
26298 A fixed register is one that the register allocator cannot use.  This is
26299 useful when compiling kernel code.  A register range is specified as
26300 two registers separated by a dash.  Multiple register ranges can be
26301 specified separated by a comma.
26303 @item -mea32
26304 @itemx -mea64
26305 @opindex mea32
26306 @opindex mea64
26307 Compile code assuming that pointers to the PPU address space accessed
26308 via the @code{__ea} named address space qualifier are either 32 or 64
26309 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
26310 all object code in an executable must be compiled with the same setting.
26312 @item -maddress-space-conversion
26313 @itemx -mno-address-space-conversion
26314 @opindex maddress-space-conversion
26315 @opindex mno-address-space-conversion
26316 Allow/disallow treating the @code{__ea} address space as superset
26317 of the generic address space.  This enables explicit type casts
26318 between @code{__ea} and generic pointer as well as implicit
26319 conversions of generic pointers to @code{__ea} pointers.  The
26320 default is to allow address space pointer conversions.
26322 @item -mcache-size=@var{cache-size}
26323 @opindex mcache-size
26324 This option controls the version of libgcc that the compiler links to an
26325 executable and selects a software-managed cache for accessing variables
26326 in the @code{__ea} address space with a particular cache size.  Possible
26327 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
26328 and @samp{128}.  The default cache size is 64KB.
26330 @item -matomic-updates
26331 @itemx -mno-atomic-updates
26332 @opindex matomic-updates
26333 @opindex mno-atomic-updates
26334 This option controls the version of libgcc that the compiler links to an
26335 executable and selects whether atomic updates to the software-managed
26336 cache of PPU-side variables are used.  If you use atomic updates, changes
26337 to a PPU variable from SPU code using the @code{__ea} named address space
26338 qualifier do not interfere with changes to other PPU variables residing
26339 in the same cache line from PPU code.  If you do not use atomic updates,
26340 such interference may occur; however, writing back cache lines is
26341 more efficient.  The default behavior is to use atomic updates.
26343 @item -mdual-nops
26344 @itemx -mdual-nops=@var{n}
26345 @opindex mdual-nops
26346 By default, GCC inserts NOPs to increase dual issue when it expects
26347 it to increase performance.  @var{n} can be a value from 0 to 10.  A
26348 smaller @var{n} inserts fewer NOPs.  10 is the default, 0 is the
26349 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
26351 @item -mhint-max-nops=@var{n}
26352 @opindex mhint-max-nops
26353 Maximum number of NOPs to insert for a branch hint.  A branch hint must
26354 be at least 8 instructions away from the branch it is affecting.  GCC
26355 inserts up to @var{n} NOPs to enforce this, otherwise it does not
26356 generate the branch hint.
26358 @item -mhint-max-distance=@var{n}
26359 @opindex mhint-max-distance
26360 The encoding of the branch hint instruction limits the hint to be within
26361 256 instructions of the branch it is affecting.  By default, GCC makes
26362 sure it is within 125.
26364 @item -msafe-hints
26365 @opindex msafe-hints
26366 Work around a hardware bug that causes the SPU to stall indefinitely.
26367 By default, GCC inserts the @code{hbrp} instruction to make sure
26368 this stall won't happen.
26370 @end table
26372 @node System V Options
26373 @subsection Options for System V
26375 These additional options are available on System V Release 4 for
26376 compatibility with other compilers on those systems:
26378 @table @gcctabopt
26379 @item -G
26380 @opindex G
26381 Create a shared object.
26382 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
26384 @item -Qy
26385 @opindex Qy
26386 Identify the versions of each tool used by the compiler, in a
26387 @code{.ident} assembler directive in the output.
26389 @item -Qn
26390 @opindex Qn
26391 Refrain from adding @code{.ident} directives to the output file (this is
26392 the default).
26394 @item -YP,@var{dirs}
26395 @opindex YP
26396 Search the directories @var{dirs}, and no others, for libraries
26397 specified with @option{-l}.
26399 @item -Ym,@var{dir}
26400 @opindex Ym
26401 Look in the directory @var{dir} to find the M4 preprocessor.
26402 The assembler uses this option.
26403 @c This is supposed to go with a -Yd for predefined M4 macro files, but
26404 @c the generic assembler that comes with Solaris takes just -Ym.
26405 @end table
26407 @node TILE-Gx Options
26408 @subsection TILE-Gx Options
26409 @cindex TILE-Gx options
26411 These @samp{-m} options are supported on the TILE-Gx:
26413 @table @gcctabopt
26414 @item -mcmodel=small
26415 @opindex mcmodel=small
26416 Generate code for the small model.  The distance for direct calls is
26417 limited to 500M in either direction.  PC-relative addresses are 32
26418 bits.  Absolute addresses support the full address range.
26420 @item -mcmodel=large
26421 @opindex mcmodel=large
26422 Generate code for the large model.  There is no limitation on call
26423 distance, pc-relative addresses, or absolute addresses.
26425 @item -mcpu=@var{name}
26426 @opindex mcpu
26427 Selects the type of CPU to be targeted.  Currently the only supported
26428 type is @samp{tilegx}.
26430 @item -m32
26431 @itemx -m64
26432 @opindex m32
26433 @opindex m64
26434 Generate code for a 32-bit or 64-bit environment.  The 32-bit
26435 environment sets int, long, and pointer to 32 bits.  The 64-bit
26436 environment sets int to 32 bits and long and pointer to 64 bits.
26438 @item -mbig-endian
26439 @itemx -mlittle-endian
26440 @opindex mbig-endian
26441 @opindex mlittle-endian
26442 Generate code in big/little endian mode, respectively.
26443 @end table
26445 @node TILEPro Options
26446 @subsection TILEPro Options
26447 @cindex TILEPro options
26449 These @samp{-m} options are supported on the TILEPro:
26451 @table @gcctabopt
26452 @item -mcpu=@var{name}
26453 @opindex mcpu
26454 Selects the type of CPU to be targeted.  Currently the only supported
26455 type is @samp{tilepro}.
26457 @item -m32
26458 @opindex m32
26459 Generate code for a 32-bit environment, which sets int, long, and
26460 pointer to 32 bits.  This is the only supported behavior so the flag
26461 is essentially ignored.
26462 @end table
26464 @node V850 Options
26465 @subsection V850 Options
26466 @cindex V850 Options
26468 These @samp{-m} options are defined for V850 implementations:
26470 @table @gcctabopt
26471 @item -mlong-calls
26472 @itemx -mno-long-calls
26473 @opindex mlong-calls
26474 @opindex mno-long-calls
26475 Treat all calls as being far away (near).  If calls are assumed to be
26476 far away, the compiler always loads the function's address into a
26477 register, and calls indirect through the pointer.
26479 @item -mno-ep
26480 @itemx -mep
26481 @opindex mno-ep
26482 @opindex mep
26483 Do not optimize (do optimize) basic blocks that use the same index
26484 pointer 4 or more times to copy pointer into the @code{ep} register, and
26485 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
26486 option is on by default if you optimize.
26488 @item -mno-prolog-function
26489 @itemx -mprolog-function
26490 @opindex mno-prolog-function
26491 @opindex mprolog-function
26492 Do not use (do use) external functions to save and restore registers
26493 at the prologue and epilogue of a function.  The external functions
26494 are slower, but use less code space if more than one function saves
26495 the same number of registers.  The @option{-mprolog-function} option
26496 is on by default if you optimize.
26498 @item -mspace
26499 @opindex mspace
26500 Try to make the code as small as possible.  At present, this just turns
26501 on the @option{-mep} and @option{-mprolog-function} options.
26503 @item -mtda=@var{n}
26504 @opindex mtda
26505 Put static or global variables whose size is @var{n} bytes or less into
26506 the tiny data area that register @code{ep} points to.  The tiny data
26507 area can hold up to 256 bytes in total (128 bytes for byte references).
26509 @item -msda=@var{n}
26510 @opindex msda
26511 Put static or global variables whose size is @var{n} bytes or less into
26512 the small data area that register @code{gp} points to.  The small data
26513 area can hold up to 64 kilobytes.
26515 @item -mzda=@var{n}
26516 @opindex mzda
26517 Put static or global variables whose size is @var{n} bytes or less into
26518 the first 32 kilobytes of memory.
26520 @item -mv850
26521 @opindex mv850
26522 Specify that the target processor is the V850.
26524 @item -mv850e3v5
26525 @opindex mv850e3v5
26526 Specify that the target processor is the V850E3V5.  The preprocessor
26527 constant @code{__v850e3v5__} is defined if this option is used.
26529 @item -mv850e2v4
26530 @opindex mv850e2v4
26531 Specify that the target processor is the V850E3V5.  This is an alias for
26532 the @option{-mv850e3v5} option.
26534 @item -mv850e2v3
26535 @opindex mv850e2v3
26536 Specify that the target processor is the V850E2V3.  The preprocessor
26537 constant @code{__v850e2v3__} is defined if this option is used.
26539 @item -mv850e2
26540 @opindex mv850e2
26541 Specify that the target processor is the V850E2.  The preprocessor
26542 constant @code{__v850e2__} is defined if this option is used.
26544 @item -mv850e1
26545 @opindex mv850e1
26546 Specify that the target processor is the V850E1.  The preprocessor
26547 constants @code{__v850e1__} and @code{__v850e__} are defined if
26548 this option is used.
26550 @item -mv850es
26551 @opindex mv850es
26552 Specify that the target processor is the V850ES.  This is an alias for
26553 the @option{-mv850e1} option.
26555 @item -mv850e
26556 @opindex mv850e
26557 Specify that the target processor is the V850E@.  The preprocessor
26558 constant @code{__v850e__} is defined if this option is used.
26560 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
26561 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
26562 are defined then a default target processor is chosen and the
26563 relevant @samp{__v850*__} preprocessor constant is defined.
26565 The preprocessor constants @code{__v850} and @code{__v851__} are always
26566 defined, regardless of which processor variant is the target.
26568 @item -mdisable-callt
26569 @itemx -mno-disable-callt
26570 @opindex mdisable-callt
26571 @opindex mno-disable-callt
26572 This option suppresses generation of the @code{CALLT} instruction for the
26573 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
26574 architecture.
26576 This option is enabled by default when the RH850 ABI is
26577 in use (see @option{-mrh850-abi}), and disabled by default when the
26578 GCC ABI is in use.  If @code{CALLT} instructions are being generated
26579 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
26581 @item -mrelax
26582 @itemx -mno-relax
26583 @opindex mrelax
26584 @opindex mno-relax
26585 Pass on (or do not pass on) the @option{-mrelax} command-line option
26586 to the assembler.
26588 @item -mlong-jumps
26589 @itemx -mno-long-jumps
26590 @opindex mlong-jumps
26591 @opindex mno-long-jumps
26592 Disable (or re-enable) the generation of PC-relative jump instructions.
26594 @item -msoft-float
26595 @itemx -mhard-float
26596 @opindex msoft-float
26597 @opindex mhard-float
26598 Disable (or re-enable) the generation of hardware floating point
26599 instructions.  This option is only significant when the target
26600 architecture is @samp{V850E2V3} or higher.  If hardware floating point
26601 instructions are being generated then the C preprocessor symbol
26602 @code{__FPU_OK__} is defined, otherwise the symbol
26603 @code{__NO_FPU__} is defined.
26605 @item -mloop
26606 @opindex mloop
26607 Enables the use of the e3v5 LOOP instruction.  The use of this
26608 instruction is not enabled by default when the e3v5 architecture is
26609 selected because its use is still experimental.
26611 @item -mrh850-abi
26612 @itemx -mghs
26613 @opindex mrh850-abi
26614 @opindex mghs
26615 Enables support for the RH850 version of the V850 ABI.  This is the
26616 default.  With this version of the ABI the following rules apply:
26618 @itemize
26619 @item
26620 Integer sized structures and unions are returned via a memory pointer
26621 rather than a register.
26623 @item
26624 Large structures and unions (more than 8 bytes in size) are passed by
26625 value.
26627 @item
26628 Functions are aligned to 16-bit boundaries.
26630 @item
26631 The @option{-m8byte-align} command-line option is supported.
26633 @item
26634 The @option{-mdisable-callt} command-line option is enabled by
26635 default.  The @option{-mno-disable-callt} command-line option is not
26636 supported.
26637 @end itemize
26639 When this version of the ABI is enabled the C preprocessor symbol
26640 @code{__V850_RH850_ABI__} is defined.
26642 @item -mgcc-abi
26643 @opindex mgcc-abi
26644 Enables support for the old GCC version of the V850 ABI.  With this
26645 version of the ABI the following rules apply:
26647 @itemize
26648 @item
26649 Integer sized structures and unions are returned in register @code{r10}.
26651 @item
26652 Large structures and unions (more than 8 bytes in size) are passed by
26653 reference.
26655 @item
26656 Functions are aligned to 32-bit boundaries, unless optimizing for
26657 size.
26659 @item
26660 The @option{-m8byte-align} command-line option is not supported.
26662 @item
26663 The @option{-mdisable-callt} command-line option is supported but not
26664 enabled by default.
26665 @end itemize
26667 When this version of the ABI is enabled the C preprocessor symbol
26668 @code{__V850_GCC_ABI__} is defined.
26670 @item -m8byte-align
26671 @itemx -mno-8byte-align
26672 @opindex m8byte-align
26673 @opindex mno-8byte-align
26674 Enables support for @code{double} and @code{long long} types to be
26675 aligned on 8-byte boundaries.  The default is to restrict the
26676 alignment of all objects to at most 4-bytes.  When
26677 @option{-m8byte-align} is in effect the C preprocessor symbol
26678 @code{__V850_8BYTE_ALIGN__} is defined.
26680 @item -mbig-switch
26681 @opindex mbig-switch
26682 Generate code suitable for big switch tables.  Use this option only if
26683 the assembler/linker complain about out of range branches within a switch
26684 table.
26686 @item -mapp-regs
26687 @opindex mapp-regs
26688 This option causes r2 and r5 to be used in the code generated by
26689 the compiler.  This setting is the default.
26691 @item -mno-app-regs
26692 @opindex mno-app-regs
26693 This option causes r2 and r5 to be treated as fixed registers.
26695 @end table
26697 @node VAX Options
26698 @subsection VAX Options
26699 @cindex VAX options
26701 These @samp{-m} options are defined for the VAX:
26703 @table @gcctabopt
26704 @item -munix
26705 @opindex munix
26706 Do not output certain jump instructions (@code{aobleq} and so on)
26707 that the Unix assembler for the VAX cannot handle across long
26708 ranges.
26710 @item -mgnu
26711 @opindex mgnu
26712 Do output those jump instructions, on the assumption that the
26713 GNU assembler is being used.
26715 @item -mg
26716 @opindex mg
26717 Output code for G-format floating-point numbers instead of D-format.
26718 @end table
26720 @node Visium Options
26721 @subsection Visium Options
26722 @cindex Visium options
26724 @table @gcctabopt
26726 @item -mdebug
26727 @opindex mdebug
26728 A program which performs file I/O and is destined to run on an MCM target
26729 should be linked with this option.  It causes the libraries libc.a and
26730 libdebug.a to be linked.  The program should be run on the target under
26731 the control of the GDB remote debugging stub.
26733 @item -msim
26734 @opindex msim
26735 A program which performs file I/O and is destined to run on the simulator
26736 should be linked with option.  This causes libraries libc.a and libsim.a to
26737 be linked.
26739 @item -mfpu
26740 @itemx -mhard-float
26741 @opindex mfpu
26742 @opindex mhard-float
26743 Generate code containing floating-point instructions.  This is the
26744 default.
26746 @item -mno-fpu
26747 @itemx -msoft-float
26748 @opindex mno-fpu
26749 @opindex msoft-float
26750 Generate code containing library calls for floating-point.
26752 @option{-msoft-float} changes the calling convention in the output file;
26753 therefore, it is only useful if you compile @emph{all} of a program with
26754 this option.  In particular, you need to compile @file{libgcc.a}, the
26755 library that comes with GCC, with @option{-msoft-float} in order for
26756 this to work.
26758 @item -mcpu=@var{cpu_type}
26759 @opindex mcpu
26760 Set the instruction set, register set, and instruction scheduling parameters
26761 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
26762 @samp{mcm}, @samp{gr5} and @samp{gr6}.
26764 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
26766 By default (unless configured otherwise), GCC generates code for the GR5
26767 variant of the Visium architecture.  
26769 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
26770 architecture.  The only difference from GR5 code is that the compiler will
26771 generate block move instructions.
26773 @item -mtune=@var{cpu_type}
26774 @opindex mtune
26775 Set the instruction scheduling parameters for machine type @var{cpu_type},
26776 but do not set the instruction set or register set that the option
26777 @option{-mcpu=@var{cpu_type}} would.
26779 @item -msv-mode
26780 @opindex msv-mode
26781 Generate code for the supervisor mode, where there are no restrictions on
26782 the access to general registers.  This is the default.
26784 @item -muser-mode
26785 @opindex muser-mode
26786 Generate code for the user mode, where the access to some general registers
26787 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
26788 mode; on the GR6, only registers r29 to r31 are affected.
26789 @end table
26791 @node VMS Options
26792 @subsection VMS Options
26794 These @samp{-m} options are defined for the VMS implementations:
26796 @table @gcctabopt
26797 @item -mvms-return-codes
26798 @opindex mvms-return-codes
26799 Return VMS condition codes from @code{main}. The default is to return POSIX-style
26800 condition (e.g.@ error) codes.
26802 @item -mdebug-main=@var{prefix}
26803 @opindex mdebug-main=@var{prefix}
26804 Flag the first routine whose name starts with @var{prefix} as the main
26805 routine for the debugger.
26807 @item -mmalloc64
26808 @opindex mmalloc64
26809 Default to 64-bit memory allocation routines.
26811 @item -mpointer-size=@var{size}
26812 @opindex mpointer-size=@var{size}
26813 Set the default size of pointers. Possible options for @var{size} are
26814 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
26815 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
26816 The later option disables @code{pragma pointer_size}.
26817 @end table
26819 @node VxWorks Options
26820 @subsection VxWorks Options
26821 @cindex VxWorks Options
26823 The options in this section are defined for all VxWorks targets.
26824 Options specific to the target hardware are listed with the other
26825 options for that target.
26827 @table @gcctabopt
26828 @item -mrtp
26829 @opindex mrtp
26830 GCC can generate code for both VxWorks kernels and real time processes
26831 (RTPs).  This option switches from the former to the latter.  It also
26832 defines the preprocessor macro @code{__RTP__}.
26834 @item -non-static
26835 @opindex non-static
26836 Link an RTP executable against shared libraries rather than static
26837 libraries.  The options @option{-static} and @option{-shared} can
26838 also be used for RTPs (@pxref{Link Options}); @option{-static}
26839 is the default.
26841 @item -Bstatic
26842 @itemx -Bdynamic
26843 @opindex Bstatic
26844 @opindex Bdynamic
26845 These options are passed down to the linker.  They are defined for
26846 compatibility with Diab.
26848 @item -Xbind-lazy
26849 @opindex Xbind-lazy
26850 Enable lazy binding of function calls.  This option is equivalent to
26851 @option{-Wl,-z,now} and is defined for compatibility with Diab.
26853 @item -Xbind-now
26854 @opindex Xbind-now
26855 Disable lazy binding of function calls.  This option is the default and
26856 is defined for compatibility with Diab.
26857 @end table
26859 @node x86 Options
26860 @subsection x86 Options
26861 @cindex x86 Options
26863 These @samp{-m} options are defined for the x86 family of computers.
26865 @table @gcctabopt
26867 @item -march=@var{cpu-type}
26868 @opindex march
26869 Generate instructions for the machine type @var{cpu-type}.  In contrast to
26870 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
26871 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
26872 to generate code that may not run at all on processors other than the one
26873 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
26874 @option{-mtune=@var{cpu-type}}.
26876 The choices for @var{cpu-type} are:
26878 @table @samp
26879 @item native
26880 This selects the CPU to generate code for at compilation time by determining
26881 the processor type of the compiling machine.  Using @option{-march=native}
26882 enables all instruction subsets supported by the local machine (hence
26883 the result might not run on different machines).  Using @option{-mtune=native}
26884 produces code optimized for the local machine under the constraints
26885 of the selected instruction set.  
26887 @item x86-64
26888 A generic CPU with 64-bit extensions.
26890 @item i386
26891 Original Intel i386 CPU@.
26893 @item i486
26894 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
26896 @item i586
26897 @itemx pentium
26898 Intel Pentium CPU with no MMX support.
26900 @item lakemont
26901 Intel Lakemont MCU, based on Intel Pentium CPU.
26903 @item pentium-mmx
26904 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
26906 @item pentiumpro
26907 Intel Pentium Pro CPU@.
26909 @item i686
26910 When used with @option{-march}, the Pentium Pro
26911 instruction set is used, so the code runs on all i686 family chips.
26912 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
26914 @item pentium2
26915 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
26916 support.
26918 @item pentium3
26919 @itemx pentium3m
26920 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
26921 set support.
26923 @item pentium-m
26924 Intel Pentium M; low-power version of Intel Pentium III CPU
26925 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
26927 @item pentium4
26928 @itemx pentium4m
26929 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
26931 @item prescott
26932 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
26933 set support.
26935 @item nocona
26936 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
26937 SSE2 and SSE3 instruction set support.
26939 @item core2
26940 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
26941 instruction set support.
26943 @item nehalem
26944 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
26945 SSE4.1, SSE4.2 and POPCNT instruction set support.
26947 @item westmere
26948 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
26949 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
26951 @item sandybridge
26952 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
26953 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
26955 @item ivybridge
26956 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
26957 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
26958 instruction set support.
26960 @item haswell
26961 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26962 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
26963 BMI, BMI2 and F16C instruction set support.
26965 @item broadwell
26966 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26967 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
26968 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
26970 @item skylake
26971 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26972 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
26973 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
26974 XSAVES instruction set support.
26976 @item bonnell
26977 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
26978 instruction set support.
26980 @item silvermont
26981 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26982 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
26984 @item goldmont
26985 Intel Goldmont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26986 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT and FSGSBASE
26987 instruction set support.
26989 @item goldmont-plus
26990 Intel Goldmont Plus CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
26991 SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE,
26992 PTWRITE, RDPID, SGX and UMIP instruction set support.
26994 @item tremont
26995 Intel Tremont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
26996 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE, PTWRITE,
26997 RDPID, SGX, UMIP, GFNI-SSE, CLWB and ENCLV instruction set support.
26999 @item knl
27000 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27001 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27002 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
27003 AVX512CD instruction set support.
27005 @item knm
27006 Intel Knights Mill CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27007 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27008 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER, AVX512CD,
27009 AVX5124VNNIW, AVX5124FMAPS and AVX512VPOPCNTDQ instruction set support.
27011 @item skylake-avx512
27012 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27013 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27014 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
27015 CLWB, AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
27017 @item cannonlake
27018 Intel Cannonlake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27019 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27020 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27021 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27022 AVX512IFMA, SHA and UMIP instruction set support.
27024 @item icelake-client
27025 Intel Icelake Client CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27026 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27027 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27028 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27029 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
27030 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES instruction set support.
27032 @item icelake-server
27033 Intel Icelake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27034 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27035 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27036 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27037 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
27038 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES, PCONFIG and WBNOINVD instruction
27039 set support.
27041 @item k6
27042 AMD K6 CPU with MMX instruction set support.
27044 @item k6-2
27045 @itemx k6-3
27046 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
27048 @item athlon
27049 @itemx athlon-tbird
27050 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
27051 support.
27053 @item athlon-4
27054 @itemx athlon-xp
27055 @itemx athlon-mp
27056 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
27057 instruction set support.
27059 @item k8
27060 @itemx opteron
27061 @itemx athlon64
27062 @itemx athlon-fx
27063 Processors based on the AMD K8 core with x86-64 instruction set support,
27064 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
27065 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
27066 instruction set extensions.)
27068 @item k8-sse3
27069 @itemx opteron-sse3
27070 @itemx athlon64-sse3
27071 Improved versions of AMD K8 cores with SSE3 instruction set support.
27073 @item amdfam10
27074 @itemx barcelona
27075 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
27076 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
27077 instruction set extensions.)
27079 @item bdver1
27080 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
27081 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
27082 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
27083 @item bdver2
27084 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27085 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
27086 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
27087 extensions.)
27088 @item bdver3
27089 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27090 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
27091 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
27092 64-bit instruction set extensions.
27093 @item bdver4
27094 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27095 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
27096 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
27097 SSE4.2, ABM and 64-bit instruction set extensions.
27099 @item znver1
27100 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
27101 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
27102 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
27103 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
27104 instruction set extensions.
27106 @item btver1
27107 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
27108 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
27109 instruction set extensions.)
27111 @item btver2
27112 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
27113 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
27114 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
27116 @item winchip-c6
27117 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
27118 set support.
27120 @item winchip2
27121 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
27122 instruction set support.
27124 @item c3
27125 VIA C3 CPU with MMX and 3DNow!@: instruction set support.
27126 (No scheduling is implemented for this chip.)
27128 @item c3-2
27129 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
27130 (No scheduling is implemented for this chip.)
27132 @item c7
27133 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
27134 (No scheduling is implemented for this chip.)
27136 @item samuel-2
27137 VIA Eden Samuel 2 CPU with MMX and 3DNow!@: instruction set support.
27138 (No scheduling is implemented for this chip.)
27140 @item nehemiah
27141 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
27142 (No scheduling is implemented for this chip.)
27144 @item esther
27145 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
27146 (No scheduling is implemented for this chip.)
27148 @item eden-x2
27149 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3 instruction set support.
27150 (No scheduling is implemented for this chip.)
27152 @item eden-x4
27153 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
27154 AVX and AVX2 instruction set support.
27155 (No scheduling is implemented for this chip.)
27157 @item nano
27158 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27159 instruction set support.
27160 (No scheduling is implemented for this chip.)
27162 @item nano-1000
27163 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27164 instruction set support.
27165 (No scheduling is implemented for this chip.)
27167 @item nano-2000
27168 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27169 instruction set support.
27170 (No scheduling is implemented for this chip.)
27172 @item nano-3000
27173 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27174 instruction set support.
27175 (No scheduling is implemented for this chip.)
27177 @item nano-x2
27178 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27179 instruction set support.
27180 (No scheduling is implemented for this chip.)
27182 @item nano-x4
27183 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27184 instruction set support.
27185 (No scheduling is implemented for this chip.)
27187 @item geode
27188 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
27189 @end table
27191 @item -mtune=@var{cpu-type}
27192 @opindex mtune
27193 Tune to @var{cpu-type} everything applicable about the generated code, except
27194 for the ABI and the set of available instructions.  
27195 While picking a specific @var{cpu-type} schedules things appropriately
27196 for that particular chip, the compiler does not generate any code that
27197 cannot run on the default machine type unless you use a
27198 @option{-march=@var{cpu-type}} option.
27199 For example, if GCC is configured for i686-pc-linux-gnu
27200 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
27201 but still runs on i686 machines.
27203 The choices for @var{cpu-type} are the same as for @option{-march}.
27204 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
27206 @table @samp
27207 @item generic
27208 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
27209 If you know the CPU on which your code will run, then you should use
27210 the corresponding @option{-mtune} or @option{-march} option instead of
27211 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
27212 of your application will have, then you should use this option.
27214 As new processors are deployed in the marketplace, the behavior of this
27215 option will change.  Therefore, if you upgrade to a newer version of
27216 GCC, code generation controlled by this option will change to reflect
27217 the processors
27218 that are most common at the time that version of GCC is released.
27220 There is no @option{-march=generic} option because @option{-march}
27221 indicates the instruction set the compiler can use, and there is no
27222 generic instruction set applicable to all processors.  In contrast,
27223 @option{-mtune} indicates the processor (or, in this case, collection of
27224 processors) for which the code is optimized.
27226 @item intel
27227 Produce code optimized for the most current Intel processors, which are
27228 Haswell and Silvermont for this version of GCC.  If you know the CPU
27229 on which your code will run, then you should use the corresponding
27230 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
27231 But, if you want your application performs better on both Haswell and
27232 Silvermont, then you should use this option.
27234 As new Intel processors are deployed in the marketplace, the behavior of
27235 this option will change.  Therefore, if you upgrade to a newer version of
27236 GCC, code generation controlled by this option will change to reflect
27237 the most current Intel processors at the time that version of GCC is
27238 released.
27240 There is no @option{-march=intel} option because @option{-march} indicates
27241 the instruction set the compiler can use, and there is no common
27242 instruction set applicable to all processors.  In contrast,
27243 @option{-mtune} indicates the processor (or, in this case, collection of
27244 processors) for which the code is optimized.
27245 @end table
27247 @item -mcpu=@var{cpu-type}
27248 @opindex mcpu
27249 A deprecated synonym for @option{-mtune}.
27251 @item -mfpmath=@var{unit}
27252 @opindex mfpmath
27253 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
27254 for @var{unit} are:
27256 @table @samp
27257 @item 387
27258 Use the standard 387 floating-point coprocessor present on the majority of chips and
27259 emulated otherwise.  Code compiled with this option runs almost everywhere.
27260 The temporary results are computed in 80-bit precision instead of the precision
27261 specified by the type, resulting in slightly different results compared to most
27262 of other chips.  See @option{-ffloat-store} for more detailed description.
27264 This is the default choice for non-Darwin x86-32 targets.
27266 @item sse
27267 Use scalar floating-point instructions present in the SSE instruction set.
27268 This instruction set is supported by Pentium III and newer chips,
27269 and in the AMD line
27270 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
27271 instruction set supports only single-precision arithmetic, thus the double and
27272 extended-precision arithmetic are still done using 387.  A later version, present
27273 only in Pentium 4 and AMD x86-64 chips, supports double-precision
27274 arithmetic too.
27276 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
27277 or @option{-msse2} switches to enable SSE extensions and make this option
27278 effective.  For the x86-64 compiler, these extensions are enabled by default.
27280 The resulting code should be considerably faster in the majority of cases and avoid
27281 the numerical instability problems of 387 code, but may break some existing
27282 code that expects temporaries to be 80 bits.
27284 This is the default choice for the x86-64 compiler, Darwin x86-32 targets,
27285 and the default choice for x86-32 targets with the SSE2 instruction set
27286 when @option{-ffast-math} is enabled.
27288 @item sse,387
27289 @itemx sse+387
27290 @itemx both
27291 Attempt to utilize both instruction sets at once.  This effectively doubles the
27292 amount of available registers, and on chips with separate execution units for
27293 387 and SSE the execution resources too.  Use this option with care, as it is
27294 still experimental, because the GCC register allocator does not model separate
27295 functional units well, resulting in unstable performance.
27296 @end table
27298 @item -masm=@var{dialect}
27299 @opindex masm=@var{dialect}
27300 Output assembly instructions using selected @var{dialect}.  Also affects
27301 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
27302 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
27303 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
27304 not support @samp{intel}.
27306 @item -mieee-fp
27307 @itemx -mno-ieee-fp
27308 @opindex mieee-fp
27309 @opindex mno-ieee-fp
27310 Control whether or not the compiler uses IEEE floating-point
27311 comparisons.  These correctly handle the case where the result of a
27312 comparison is unordered.
27314 @item -m80387
27315 @itemx -mhard-float
27316 @opindex 80387
27317 @opindex mhard-float
27318 Generate output containing 80387 instructions for floating point.
27320 @item -mno-80387
27321 @itemx -msoft-float
27322 @opindex no-80387
27323 @opindex msoft-float
27324 Generate output containing library calls for floating point.
27326 @strong{Warning:} the requisite libraries are not part of GCC@.
27327 Normally the facilities of the machine's usual C compiler are used, but
27328 this cannot be done directly in cross-compilation.  You must make your
27329 own arrangements to provide suitable library functions for
27330 cross-compilation.
27332 On machines where a function returns floating-point results in the 80387
27333 register stack, some floating-point opcodes may be emitted even if
27334 @option{-msoft-float} is used.
27336 @item -mno-fp-ret-in-387
27337 @opindex mno-fp-ret-in-387
27338 Do not use the FPU registers for return values of functions.
27340 The usual calling convention has functions return values of types
27341 @code{float} and @code{double} in an FPU register, even if there
27342 is no FPU@.  The idea is that the operating system should emulate
27343 an FPU@.
27345 The option @option{-mno-fp-ret-in-387} causes such values to be returned
27346 in ordinary CPU registers instead.
27348 @item -mno-fancy-math-387
27349 @opindex mno-fancy-math-387
27350 Some 387 emulators do not support the @code{sin}, @code{cos} and
27351 @code{sqrt} instructions for the 387.  Specify this option to avoid
27352 generating those instructions.
27353 This option is overridden when @option{-march}
27354 indicates that the target CPU always has an FPU and so the
27355 instruction does not need emulation.  These
27356 instructions are not generated unless you also use the
27357 @option{-funsafe-math-optimizations} switch.
27359 @item -malign-double
27360 @itemx -mno-align-double
27361 @opindex malign-double
27362 @opindex mno-align-double
27363 Control whether GCC aligns @code{double}, @code{long double}, and
27364 @code{long long} variables on a two-word boundary or a one-word
27365 boundary.  Aligning @code{double} variables on a two-word boundary
27366 produces code that runs somewhat faster on a Pentium at the
27367 expense of more memory.
27369 On x86-64, @option{-malign-double} is enabled by default.
27371 @strong{Warning:} if you use the @option{-malign-double} switch,
27372 structures containing the above types are aligned differently than
27373 the published application binary interface specifications for the x86-32
27374 and are not binary compatible with structures in code compiled
27375 without that switch.
27377 @item -m96bit-long-double
27378 @itemx -m128bit-long-double
27379 @opindex m96bit-long-double
27380 @opindex m128bit-long-double
27381 These switches control the size of @code{long double} type.  The x86-32
27382 application binary interface specifies the size to be 96 bits,
27383 so @option{-m96bit-long-double} is the default in 32-bit mode.
27385 Modern architectures (Pentium and newer) prefer @code{long double}
27386 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
27387 conforming to the ABI, this is not possible.  So specifying
27388 @option{-m128bit-long-double} aligns @code{long double}
27389 to a 16-byte boundary by padding the @code{long double} with an additional
27390 32-bit zero.
27392 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
27393 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
27395 Notice that neither of these options enable any extra precision over the x87
27396 standard of 80 bits for a @code{long double}.
27398 @strong{Warning:} if you override the default value for your target ABI, this
27399 changes the size of 
27400 structures and arrays containing @code{long double} variables,
27401 as well as modifying the function calling convention for functions taking
27402 @code{long double}.  Hence they are not binary-compatible
27403 with code compiled without that switch.
27405 @item -mlong-double-64
27406 @itemx -mlong-double-80
27407 @itemx -mlong-double-128
27408 @opindex mlong-double-64
27409 @opindex mlong-double-80
27410 @opindex mlong-double-128
27411 These switches control the size of @code{long double} type. A size
27412 of 64 bits makes the @code{long double} type equivalent to the @code{double}
27413 type. This is the default for 32-bit Bionic C library.  A size
27414 of 128 bits makes the @code{long double} type equivalent to the
27415 @code{__float128} type. This is the default for 64-bit Bionic C library.
27417 @strong{Warning:} if you override the default value for your target ABI, this
27418 changes the size of
27419 structures and arrays containing @code{long double} variables,
27420 as well as modifying the function calling convention for functions taking
27421 @code{long double}.  Hence they are not binary-compatible
27422 with code compiled without that switch.
27424 @item -malign-data=@var{type}
27425 @opindex malign-data
27426 Control how GCC aligns variables.  Supported values for @var{type} are
27427 @samp{compat} uses increased alignment value compatible uses GCC 4.8
27428 and earlier, @samp{abi} uses alignment value as specified by the
27429 psABI, and @samp{cacheline} uses increased alignment value to match
27430 the cache line size.  @samp{compat} is the default.
27432 @item -mlarge-data-threshold=@var{threshold}
27433 @opindex mlarge-data-threshold
27434 When @option{-mcmodel=medium} is specified, data objects larger than
27435 @var{threshold} are placed in the large data section.  This value must be the
27436 same across all objects linked into the binary, and defaults to 65535.
27438 @item -mrtd
27439 @opindex mrtd
27440 Use a different function-calling convention, in which functions that
27441 take a fixed number of arguments return with the @code{ret @var{num}}
27442 instruction, which pops their arguments while returning.  This saves one
27443 instruction in the caller since there is no need to pop the arguments
27444 there.
27446 You can specify that an individual function is called with this calling
27447 sequence with the function attribute @code{stdcall}.  You can also
27448 override the @option{-mrtd} option by using the function attribute
27449 @code{cdecl}.  @xref{Function Attributes}.
27451 @strong{Warning:} this calling convention is incompatible with the one
27452 normally used on Unix, so you cannot use it if you need to call
27453 libraries compiled with the Unix compiler.
27455 Also, you must provide function prototypes for all functions that
27456 take variable numbers of arguments (including @code{printf});
27457 otherwise incorrect code is generated for calls to those
27458 functions.
27460 In addition, seriously incorrect code results if you call a
27461 function with too many arguments.  (Normally, extra arguments are
27462 harmlessly ignored.)
27464 @item -mregparm=@var{num}
27465 @opindex mregparm
27466 Control how many registers are used to pass integer arguments.  By
27467 default, no registers are used to pass arguments, and at most 3
27468 registers can be used.  You can control this behavior for a specific
27469 function by using the function attribute @code{regparm}.
27470 @xref{Function Attributes}.
27472 @strong{Warning:} if you use this switch, and
27473 @var{num} is nonzero, then you must build all modules with the same
27474 value, including any libraries.  This includes the system libraries and
27475 startup modules.
27477 @item -msseregparm
27478 @opindex msseregparm
27479 Use SSE register passing conventions for float and double arguments
27480 and return values.  You can control this behavior for a specific
27481 function by using the function attribute @code{sseregparm}.
27482 @xref{Function Attributes}.
27484 @strong{Warning:} if you use this switch then you must build all
27485 modules with the same value, including any libraries.  This includes
27486 the system libraries and startup modules.
27488 @item -mvect8-ret-in-mem
27489 @opindex mvect8-ret-in-mem
27490 Return 8-byte vectors in memory instead of MMX registers.  This is the
27491 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
27492 Studio compilers until version 12.  Later compiler versions (starting
27493 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
27494 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
27495 you need to remain compatible with existing code produced by those
27496 previous compiler versions or older versions of GCC@.
27498 @item -mpc32
27499 @itemx -mpc64
27500 @itemx -mpc80
27501 @opindex mpc32
27502 @opindex mpc64
27503 @opindex mpc80
27505 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
27506 is specified, the significands of results of floating-point operations are
27507 rounded to 24 bits (single precision); @option{-mpc64} rounds the
27508 significands of results of floating-point operations to 53 bits (double
27509 precision) and @option{-mpc80} rounds the significands of results of
27510 floating-point operations to 64 bits (extended double precision), which is
27511 the default.  When this option is used, floating-point operations in higher
27512 precisions are not available to the programmer without setting the FPU
27513 control word explicitly.
27515 Setting the rounding of floating-point operations to less than the default
27516 80 bits can speed some programs by 2% or more.  Note that some mathematical
27517 libraries assume that extended-precision (80-bit) floating-point operations
27518 are enabled by default; routines in such libraries could suffer significant
27519 loss of accuracy, typically through so-called ``catastrophic cancellation'',
27520 when this option is used to set the precision to less than extended precision.
27522 @item -mstackrealign
27523 @opindex mstackrealign
27524 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
27525 option generates an alternate prologue and epilogue that realigns the
27526 run-time stack if necessary.  This supports mixing legacy codes that keep
27527 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
27528 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
27529 applicable to individual functions.
27531 @item -mpreferred-stack-boundary=@var{num}
27532 @opindex mpreferred-stack-boundary
27533 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
27534 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
27535 the default is 4 (16 bytes or 128 bits).
27537 @strong{Warning:} When generating code for the x86-64 architecture with
27538 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
27539 used to keep the stack boundary aligned to 8 byte boundary.  Since
27540 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
27541 intended to be used in controlled environment where stack space is
27542 important limitation.  This option leads to wrong code when functions
27543 compiled with 16 byte stack alignment (such as functions from a standard
27544 library) are called with misaligned stack.  In this case, SSE
27545 instructions may lead to misaligned memory access traps.  In addition,
27546 variable arguments are handled incorrectly for 16 byte aligned
27547 objects (including x87 long double and __int128), leading to wrong
27548 results.  You must build all modules with
27549 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
27550 includes the system libraries and startup modules.
27552 @item -mincoming-stack-boundary=@var{num}
27553 @opindex mincoming-stack-boundary
27554 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
27555 boundary.  If @option{-mincoming-stack-boundary} is not specified,
27556 the one specified by @option{-mpreferred-stack-boundary} is used.
27558 On Pentium and Pentium Pro, @code{double} and @code{long double} values
27559 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
27560 suffer significant run time performance penalties.  On Pentium III, the
27561 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
27562 properly if it is not 16-byte aligned.
27564 To ensure proper alignment of this values on the stack, the stack boundary
27565 must be as aligned as that required by any value stored on the stack.
27566 Further, every function must be generated such that it keeps the stack
27567 aligned.  Thus calling a function compiled with a higher preferred
27568 stack boundary from a function compiled with a lower preferred stack
27569 boundary most likely misaligns the stack.  It is recommended that
27570 libraries that use callbacks always use the default setting.
27572 This extra alignment does consume extra stack space, and generally
27573 increases code size.  Code that is sensitive to stack space usage, such
27574 as embedded systems and operating system kernels, may want to reduce the
27575 preferred alignment to @option{-mpreferred-stack-boundary=2}.
27577 @need 200
27578 @item -mmmx
27579 @opindex mmmx
27580 @need 200
27581 @itemx -msse
27582 @opindex msse
27583 @need 200
27584 @itemx -msse2
27585 @opindex msse2
27586 @need 200
27587 @itemx -msse3
27588 @opindex msse3
27589 @need 200
27590 @itemx -mssse3
27591 @opindex mssse3
27592 @need 200
27593 @itemx -msse4
27594 @opindex msse4
27595 @need 200
27596 @itemx -msse4a
27597 @opindex msse4a
27598 @need 200
27599 @itemx -msse4.1
27600 @opindex msse4.1
27601 @need 200
27602 @itemx -msse4.2
27603 @opindex msse4.2
27604 @need 200
27605 @itemx -mavx
27606 @opindex mavx
27607 @need 200
27608 @itemx -mavx2
27609 @opindex mavx2
27610 @need 200
27611 @itemx -mavx512f
27612 @opindex mavx512f
27613 @need 200
27614 @itemx -mavx512pf
27615 @opindex mavx512pf
27616 @need 200
27617 @itemx -mavx512er
27618 @opindex mavx512er
27619 @need 200
27620 @itemx -mavx512cd
27621 @opindex mavx512cd
27622 @need 200
27623 @itemx -mavx512vl
27624 @opindex mavx512vl
27625 @need 200
27626 @itemx -mavx512bw
27627 @opindex mavx512bw
27628 @need 200
27629 @itemx -mavx512dq
27630 @opindex mavx512dq
27631 @need 200
27632 @itemx -mavx512ifma
27633 @opindex mavx512ifma
27634 @need 200
27635 @itemx -mavx512vbmi
27636 @opindex mavx512vbmi
27637 @need 200
27638 @itemx -msha
27639 @opindex msha
27640 @need 200
27641 @itemx -maes
27642 @opindex maes
27643 @need 200
27644 @itemx -mpclmul
27645 @opindex mpclmul
27646 @need 200
27647 @itemx -mclflushopt
27648 @opindex mclflushopt
27649 @need 200
27650 @itemx -mfsgsbase
27651 @opindex mfsgsbase
27652 @need 200
27653 @itemx -mrdrnd
27654 @opindex mrdrnd
27655 @need 200
27656 @itemx -mf16c
27657 @opindex mf16c
27658 @need 200
27659 @itemx -mfma
27660 @opindex mfma
27661 @need 200
27662 @itemx -mpconfig
27663 @opindex mpconfig
27664 @need 200
27665 @itemx -mwbnoinvd
27666 @opindex mwbnoinvd
27667 @need 200
27668 @itemx -mfma4
27669 @opindex mfma4
27670 @need 200
27671 @itemx -mprefetchwt1
27672 @opindex mprefetchwt1
27673 @need 200
27674 @itemx -mxop
27675 @opindex mxop
27676 @need 200
27677 @itemx -mlwp
27678 @opindex mlwp
27679 @need 200
27680 @itemx -m3dnow
27681 @opindex m3dnow
27682 @need 200
27683 @itemx -m3dnowa
27684 @opindex m3dnowa
27685 @need 200
27686 @itemx -mpopcnt
27687 @opindex mpopcnt
27688 @need 200
27689 @itemx -mabm
27690 @opindex mabm
27691 @need 200
27692 @itemx -mbmi
27693 @opindex mbmi
27694 @need 200
27695 @itemx -mbmi2
27696 @need 200
27697 @itemx -mlzcnt
27698 @opindex mlzcnt
27699 @need 200
27700 @itemx -mfxsr
27701 @opindex mfxsr
27702 @need 200
27703 @itemx -mxsave
27704 @opindex mxsave
27705 @need 200
27706 @itemx -mxsaveopt
27707 @opindex mxsaveopt
27708 @need 200
27709 @itemx -mxsavec
27710 @opindex mxsavec
27711 @need 200
27712 @itemx -mxsaves
27713 @opindex mxsaves
27714 @need 200
27715 @itemx -mrtm
27716 @opindex mrtm
27717 @need 200
27718 @itemx -mtbm
27719 @opindex mtbm
27720 @need 200
27721 @itemx -mmwaitx
27722 @opindex mmwaitx
27723 @need 200
27724 @itemx -mclzero
27725 @opindex mclzero
27726 @need 200
27727 @itemx -mpku
27728 @opindex mpku
27729 @need 200
27730 @itemx -mavx512vbmi2
27731 @opindex mavx512vbmi2
27732 @need 200
27733 @itemx -mgfni
27734 @opindex mgfni
27735 @need 200
27736 @itemx -mvaes
27737 @opindex mvaes
27738 @need 200
27739 @itemx -mwaitpkg
27740 @opindex -mwaitpkg
27741 @need 200
27742 @itemx -mvpclmulqdq
27743 @opindex mvpclmulqdq
27744 @need 200
27745 @itemx -mavx512bitalg
27746 @opindex mavx512bitalg
27747 @need 200
27748 @itemx -mmovdiri
27749 @opindex mmovdiri
27750 @need 200
27751 @itemx -mmovdir64b
27752 @opindex mmovdir64b
27753 @need 200
27754 @itemx -mavx512vpopcntdq
27755 @opindex mavx512vpopcntdq
27756 @need 200
27757 @itemx -mcldemote
27758 @opindex mcldemote
27759 These switches enable the use of instructions in the MMX, SSE,
27760 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
27761 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
27762 AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA, AVX512VBMI, BMI, BMI2, VAES, WAITPKG,
27763 FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, MWAITX, PKU, IBT, SHSTK, AVX512VBMI2,
27764 GFNI, VPCLMULQDQ, AVX512BITALG, MOVDIRI, MOVDIR64B,
27765 AVX512VPOPCNTDQ, CLDEMOTE, 3DNow!@: or enhanced 3DNow!@: extended instruction
27766 sets. Each has a corresponding @option{-mno-} option to disable use of these
27767 instructions.
27769 These extensions are also available as built-in functions: see
27770 @ref{x86 Built-in Functions}, for details of the functions enabled and
27771 disabled by these switches.
27773 To generate SSE/SSE2 instructions automatically from floating-point
27774 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
27776 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
27777 generates new AVX instructions or AVX equivalence for all SSEx instructions
27778 when needed.
27780 These options enable GCC to use these extended instructions in
27781 generated code, even without @option{-mfpmath=sse}.  Applications that
27782 perform run-time CPU detection must compile separate files for each
27783 supported architecture, using the appropriate flags.  In particular,
27784 the file containing the CPU detection code should be compiled without
27785 these options.
27787 @item -mdump-tune-features
27788 @opindex mdump-tune-features
27789 This option instructs GCC to dump the names of the x86 performance 
27790 tuning features and default settings. The names can be used in 
27791 @option{-mtune-ctrl=@var{feature-list}}.
27793 @item -mtune-ctrl=@var{feature-list}
27794 @opindex mtune-ctrl=@var{feature-list}
27795 This option is used to do fine grain control of x86 code generation features.
27796 @var{feature-list} is a comma separated list of @var{feature} names. See also
27797 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
27798 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
27799 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
27800 developers. Using it may lead to code paths not covered by testing and can
27801 potentially result in compiler ICEs or runtime errors.
27803 @item -mno-default
27804 @opindex mno-default
27805 This option instructs GCC to turn off all tunable features. See also 
27806 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
27808 @item -mcld
27809 @opindex mcld
27810 This option instructs GCC to emit a @code{cld} instruction in the prologue
27811 of functions that use string instructions.  String instructions depend on
27812 the DF flag to select between autoincrement or autodecrement mode.  While the
27813 ABI specifies the DF flag to be cleared on function entry, some operating
27814 systems violate this specification by not clearing the DF flag in their
27815 exception dispatchers.  The exception handler can be invoked with the DF flag
27816 set, which leads to wrong direction mode when string instructions are used.
27817 This option can be enabled by default on 32-bit x86 targets by configuring
27818 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
27819 instructions can be suppressed with the @option{-mno-cld} compiler option
27820 in this case.
27822 @item -mvzeroupper
27823 @opindex mvzeroupper
27824 This option instructs GCC to emit a @code{vzeroupper} instruction
27825 before a transfer of control flow out of the function to minimize
27826 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
27827 intrinsics.
27829 @item -mprefer-avx128
27830 @opindex mprefer-avx128
27831 This option instructs GCC to use 128-bit AVX instructions instead of
27832 256-bit AVX instructions in the auto-vectorizer.
27834 @item -mprefer-vector-width=@var{opt}
27835 @opindex mprefer-vector-width
27836 This option instructs GCC to use @var{opt}-bit vector width in instructions
27837 instead of default on the selected platform.
27839 @table @samp
27840 @item none
27841 No extra limitations applied to GCC other than defined by the selected platform.
27843 @item 128
27844 Prefer 128-bit vector width for instructions.
27846 @item 256
27847 Prefer 256-bit vector width for instructions.
27849 @item 512
27850 Prefer 512-bit vector width for instructions.
27851 @end table
27853 @item -mcx16
27854 @opindex mcx16
27855 This option enables GCC to generate @code{CMPXCHG16B} instructions in 64-bit
27856 code to implement compare-and-exchange operations on 16-byte aligned 128-bit
27857 objects.  This is useful for atomic updates of data structures exceeding one
27858 machine word in size.  The compiler uses this instruction to implement
27859 @ref{__sync Builtins}.  However, for @ref{__atomic Builtins} operating on
27860 128-bit integers, a library call is always used.
27862 @item -msahf
27863 @opindex msahf
27864 This option enables generation of @code{SAHF} instructions in 64-bit code.
27865 Early Intel Pentium 4 CPUs with Intel 64 support,
27866 prior to the introduction of Pentium 4 G1 step in December 2005,
27867 lacked the @code{LAHF} and @code{SAHF} instructions
27868 which are supported by AMD64.
27869 These are load and store instructions, respectively, for certain status flags.
27870 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
27871 @code{drem}, and @code{remainder} built-in functions;
27872 see @ref{Other Builtins} for details.
27874 @item -mmovbe
27875 @opindex mmovbe
27876 This option enables use of the @code{movbe} instruction to implement
27877 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
27879 @item -mshstk
27880 @opindex mshstk
27881 The @option{-mshstk} option enables shadow stack built-in functions
27882 from x86 Control-flow Enforcement Technology (CET).
27884 @item -mcrc32
27885 @opindex mcrc32
27886 This option enables built-in functions @code{__builtin_ia32_crc32qi},
27887 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
27888 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
27890 @item -mrecip
27891 @opindex mrecip
27892 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
27893 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
27894 with an additional Newton-Raphson step
27895 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
27896 (and their vectorized
27897 variants) for single-precision floating-point arguments.  These instructions
27898 are generated only when @option{-funsafe-math-optimizations} is enabled
27899 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
27900 Note that while the throughput of the sequence is higher than the throughput
27901 of the non-reciprocal instruction, the precision of the sequence can be
27902 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
27904 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
27905 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
27906 combination), and doesn't need @option{-mrecip}.
27908 Also note that GCC emits the above sequence with additional Newton-Raphson step
27909 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
27910 already with @option{-ffast-math} (or the above option combination), and
27911 doesn't need @option{-mrecip}.
27913 @item -mrecip=@var{opt}
27914 @opindex mrecip=opt
27915 This option controls which reciprocal estimate instructions
27916 may be used.  @var{opt} is a comma-separated list of options, which may
27917 be preceded by a @samp{!} to invert the option:
27919 @table @samp
27920 @item all
27921 Enable all estimate instructions.
27923 @item default
27924 Enable the default instructions, equivalent to @option{-mrecip}.
27926 @item none
27927 Disable all estimate instructions, equivalent to @option{-mno-recip}.
27929 @item div
27930 Enable the approximation for scalar division.
27932 @item vec-div
27933 Enable the approximation for vectorized division.
27935 @item sqrt
27936 Enable the approximation for scalar square root.
27938 @item vec-sqrt
27939 Enable the approximation for vectorized square root.
27940 @end table
27942 So, for example, @option{-mrecip=all,!sqrt} enables
27943 all of the reciprocal approximations, except for square root.
27945 @item -mveclibabi=@var{type}
27946 @opindex mveclibabi
27947 Specifies the ABI type to use for vectorizing intrinsics using an
27948 external library.  Supported values for @var{type} are @samp{svml} 
27949 for the Intel short
27950 vector math library and @samp{acml} for the AMD math core library.
27951 To use this option, both @option{-ftree-vectorize} and
27952 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
27953 ABI-compatible library must be specified at link time.
27955 GCC currently emits calls to @code{vmldExp2},
27956 @code{vmldLn2}, @code{vmldLog102}, @code{vmldPow2},
27957 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
27958 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
27959 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
27960 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4},
27961 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
27962 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
27963 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
27964 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
27965 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
27966 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
27967 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
27968 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
27969 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
27970 when @option{-mveclibabi=acml} is used.  
27972 @item -mabi=@var{name}
27973 @opindex mabi
27974 Generate code for the specified calling convention.  Permissible values
27975 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
27976 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
27977 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
27978 You can control this behavior for specific functions by
27979 using the function attributes @code{ms_abi} and @code{sysv_abi}.
27980 @xref{Function Attributes}.
27982 @item -mforce-indirect-call
27983 @opindex mforce-indirect-call
27984 Force all calls to functions to be indirect. This is useful
27985 when using Intel Processor Trace where it generates more precise timing
27986 information for function calls.
27988 @item -mcall-ms2sysv-xlogues
27989 @opindex mcall-ms2sysv-xlogues
27990 @opindex mno-call-ms2sysv-xlogues
27991 Due to differences in 64-bit ABIs, any Microsoft ABI function that calls a
27992 System V ABI function must consider RSI, RDI and XMM6-15 as clobbered.  By
27993 default, the code for saving and restoring these registers is emitted inline,
27994 resulting in fairly lengthy prologues and epilogues.  Using
27995 @option{-mcall-ms2sysv-xlogues} emits prologues and epilogues that
27996 use stubs in the static portion of libgcc to perform these saves and restores,
27997 thus reducing function size at the cost of a few extra instructions.
27999 @item -mtls-dialect=@var{type}
28000 @opindex mtls-dialect
28001 Generate code to access thread-local storage using the @samp{gnu} or
28002 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
28003 @samp{gnu2} is more efficient, but it may add compile- and run-time
28004 requirements that cannot be satisfied on all systems.
28006 @item -mpush-args
28007 @itemx -mno-push-args
28008 @opindex mpush-args
28009 @opindex mno-push-args
28010 Use PUSH operations to store outgoing parameters.  This method is shorter
28011 and usually equally fast as method using SUB/MOV operations and is enabled
28012 by default.  In some cases disabling it may improve performance because of
28013 improved scheduling and reduced dependencies.
28015 @item -maccumulate-outgoing-args
28016 @opindex maccumulate-outgoing-args
28017 If enabled, the maximum amount of space required for outgoing arguments is
28018 computed in the function prologue.  This is faster on most modern CPUs
28019 because of reduced dependencies, improved scheduling and reduced stack usage
28020 when the preferred stack boundary is not equal to 2.  The drawback is a notable
28021 increase in code size.  This switch implies @option{-mno-push-args}.
28023 @item -mthreads
28024 @opindex mthreads
28025 Support thread-safe exception handling on MinGW.  Programs that rely
28026 on thread-safe exception handling must compile and link all code with the
28027 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
28028 @option{-D_MT}; when linking, it links in a special thread helper library
28029 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
28031 @item -mms-bitfields
28032 @itemx -mno-ms-bitfields
28033 @opindex mms-bitfields
28034 @opindex mno-ms-bitfields
28036 Enable/disable bit-field layout compatible with the native Microsoft
28037 Windows compiler.  
28039 If @code{packed} is used on a structure, or if bit-fields are used,
28040 it may be that the Microsoft ABI lays out the structure differently
28041 than the way GCC normally does.  Particularly when moving packed
28042 data between functions compiled with GCC and the native Microsoft compiler
28043 (either via function call or as data in a file), it may be necessary to access
28044 either format.
28046 This option is enabled by default for Microsoft Windows
28047 targets.  This behavior can also be controlled locally by use of variable
28048 or type attributes.  For more information, see @ref{x86 Variable Attributes}
28049 and @ref{x86 Type Attributes}.
28051 The Microsoft structure layout algorithm is fairly simple with the exception
28052 of the bit-field packing.  
28053 The padding and alignment of members of structures and whether a bit-field 
28054 can straddle a storage-unit boundary are determine by these rules:
28056 @enumerate
28057 @item Structure members are stored sequentially in the order in which they are
28058 declared: the first member has the lowest memory address and the last member
28059 the highest.
28061 @item Every data object has an alignment requirement.  The alignment requirement
28062 for all data except structures, unions, and arrays is either the size of the
28063 object or the current packing size (specified with either the
28064 @code{aligned} attribute or the @code{pack} pragma),
28065 whichever is less.  For structures, unions, and arrays,
28066 the alignment requirement is the largest alignment requirement of its members.
28067 Every object is allocated an offset so that:
28069 @smallexample
28070 offset % alignment_requirement == 0
28071 @end smallexample
28073 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
28074 unit if the integral types are the same size and if the next bit-field fits
28075 into the current allocation unit without crossing the boundary imposed by the
28076 common alignment requirements of the bit-fields.
28077 @end enumerate
28079 MSVC interprets zero-length bit-fields in the following ways:
28081 @enumerate
28082 @item If a zero-length bit-field is inserted between two bit-fields that
28083 are normally coalesced, the bit-fields are not coalesced.
28085 For example:
28087 @smallexample
28088 struct
28089  @{
28090    unsigned long bf_1 : 12;
28091    unsigned long : 0;
28092    unsigned long bf_2 : 12;
28093  @} t1;
28094 @end smallexample
28096 @noindent
28097 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
28098 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
28100 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
28101 alignment of the zero-length bit-field is greater than the member that follows it,
28102 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
28104 For example:
28106 @smallexample
28107 struct
28108  @{
28109    char foo : 4;
28110    short : 0;
28111    char bar;
28112  @} t2;
28114 struct
28115  @{
28116    char foo : 4;
28117    short : 0;
28118    double bar;
28119  @} t3;
28120 @end smallexample
28122 @noindent
28123 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
28124 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
28125 bit-field does not affect the alignment of @code{bar} or, as a result, the size
28126 of the structure.
28128 Taking this into account, it is important to note the following:
28130 @enumerate
28131 @item If a zero-length bit-field follows a normal bit-field, the type of the
28132 zero-length bit-field may affect the alignment of the structure as whole. For
28133 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
28134 normal bit-field, and is of type short.
28136 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
28137 still affect the alignment of the structure:
28139 @smallexample
28140 struct
28141  @{
28142    char foo : 6;
28143    long : 0;
28144  @} t4;
28145 @end smallexample
28147 @noindent
28148 Here, @code{t4} takes up 4 bytes.
28149 @end enumerate
28151 @item Zero-length bit-fields following non-bit-field members are ignored:
28153 @smallexample
28154 struct
28155  @{
28156    char foo;
28157    long : 0;
28158    char bar;
28159  @} t5;
28160 @end smallexample
28162 @noindent
28163 Here, @code{t5} takes up 2 bytes.
28164 @end enumerate
28167 @item -mno-align-stringops
28168 @opindex mno-align-stringops
28169 Do not align the destination of inlined string operations.  This switch reduces
28170 code size and improves performance in case the destination is already aligned,
28171 but GCC doesn't know about it.
28173 @item -minline-all-stringops
28174 @opindex minline-all-stringops
28175 By default GCC inlines string operations only when the destination is 
28176 known to be aligned to least a 4-byte boundary.  
28177 This enables more inlining and increases code
28178 size, but may improve performance of code that depends on fast
28179 @code{memcpy}, @code{strlen},
28180 and @code{memset} for short lengths.
28182 @item -minline-stringops-dynamically
28183 @opindex minline-stringops-dynamically
28184 For string operations of unknown size, use run-time checks with
28185 inline code for small blocks and a library call for large blocks.
28187 @item -mstringop-strategy=@var{alg}
28188 @opindex mstringop-strategy=@var{alg}
28189 Override the internal decision heuristic for the particular algorithm to use
28190 for inlining string operations.  The allowed values for @var{alg} are:
28192 @table @samp
28193 @item rep_byte
28194 @itemx rep_4byte
28195 @itemx rep_8byte
28196 Expand using i386 @code{rep} prefix of the specified size.
28198 @item byte_loop
28199 @itemx loop
28200 @itemx unrolled_loop
28201 Expand into an inline loop.
28203 @item libcall
28204 Always use a library call.
28205 @end table
28207 @item -mmemcpy-strategy=@var{strategy}
28208 @opindex mmemcpy-strategy=@var{strategy}
28209 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
28210 should be inlined and what inline algorithm to use when the expected size
28211 of the copy operation is known. @var{strategy} 
28212 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
28213 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
28214 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
28215 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
28216 in the list must be specified in increasing order.  The minimal byte size for 
28217 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
28218 preceding range.
28220 @item -mmemset-strategy=@var{strategy}
28221 @opindex mmemset-strategy=@var{strategy}
28222 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
28223 @code{__builtin_memset} expansion.
28225 @item -momit-leaf-frame-pointer
28226 @opindex momit-leaf-frame-pointer
28227 Don't keep the frame pointer in a register for leaf functions.  This
28228 avoids the instructions to save, set up, and restore frame pointers and
28229 makes an extra register available in leaf functions.  The option
28230 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
28231 which might make debugging harder.
28233 @item -mtls-direct-seg-refs
28234 @itemx -mno-tls-direct-seg-refs
28235 @opindex mtls-direct-seg-refs
28236 Controls whether TLS variables may be accessed with offsets from the
28237 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
28238 or whether the thread base pointer must be added.  Whether or not this
28239 is valid depends on the operating system, and whether it maps the
28240 segment to cover the entire TLS area.
28242 For systems that use the GNU C Library, the default is on.
28244 @item -msse2avx
28245 @itemx -mno-sse2avx
28246 @opindex msse2avx
28247 Specify that the assembler should encode SSE instructions with VEX
28248 prefix.  The option @option{-mavx} turns this on by default.
28250 @item -mfentry
28251 @itemx -mno-fentry
28252 @opindex mfentry
28253 If profiling is active (@option{-pg}), put the profiling
28254 counter call before the prologue.
28255 Note: On x86 architectures the attribute @code{ms_hook_prologue}
28256 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
28258 @item -mrecord-mcount
28259 @itemx -mno-record-mcount
28260 @opindex mrecord-mcount
28261 If profiling is active (@option{-pg}), generate a __mcount_loc section
28262 that contains pointers to each profiling call. This is useful for
28263 automatically patching and out calls.
28265 @item -mnop-mcount
28266 @itemx -mno-nop-mcount
28267 @opindex mnop-mcount
28268 If profiling is active (@option{-pg}), generate the calls to
28269 the profiling functions as NOPs. This is useful when they
28270 should be patched in later dynamically. This is likely only
28271 useful together with @option{-mrecord-mcount}.
28273 @item -mskip-rax-setup
28274 @itemx -mno-skip-rax-setup
28275 @opindex mskip-rax-setup
28276 When generating code for the x86-64 architecture with SSE extensions
28277 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
28278 register when there are no variable arguments passed in vector registers.
28280 @strong{Warning:} Since RAX register is used to avoid unnecessarily
28281 saving vector registers on stack when passing variable arguments, the
28282 impacts of this option are callees may waste some stack space,
28283 misbehave or jump to a random location.  GCC 4.4 or newer don't have
28284 those issues, regardless the RAX register value.
28286 @item -m8bit-idiv
28287 @itemx -mno-8bit-idiv
28288 @opindex m8bit-idiv
28289 On some processors, like Intel Atom, 8-bit unsigned integer divide is
28290 much faster than 32-bit/64-bit integer divide.  This option generates a
28291 run-time check.  If both dividend and divisor are within range of 0
28292 to 255, 8-bit unsigned integer divide is used instead of
28293 32-bit/64-bit integer divide.
28295 @item -mavx256-split-unaligned-load
28296 @itemx -mavx256-split-unaligned-store
28297 @opindex mavx256-split-unaligned-load
28298 @opindex mavx256-split-unaligned-store
28299 Split 32-byte AVX unaligned load and store.
28301 @item -mstack-protector-guard=@var{guard}
28302 @itemx -mstack-protector-guard-reg=@var{reg}
28303 @itemx -mstack-protector-guard-offset=@var{offset}
28304 @opindex mstack-protector-guard
28305 @opindex mstack-protector-guard-reg
28306 @opindex mstack-protector-guard-offset
28307 Generate stack protection code using canary at @var{guard}.  Supported
28308 locations are @samp{global} for global canary or @samp{tls} for per-thread
28309 canary in the TLS block (the default).  This option has effect only when
28310 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
28312 With the latter choice the options
28313 @option{-mstack-protector-guard-reg=@var{reg}} and
28314 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
28315 which segment register (@code{%fs} or @code{%gs}) to use as base register
28316 for reading the canary, and from what offset from that base register.
28317 The default for those is as specified in the relevant ABI.
28319 @item -mgeneral-regs-only
28320 @opindex mgeneral-regs-only
28321 Generate code that uses only the general-purpose registers.  This
28322 prevents the compiler from using floating-point, vector, mask and bound
28323 registers.
28325 @item -mindirect-branch=@var{choice}
28326 @opindex -mindirect-branch
28327 Convert indirect call and jump with @var{choice}.  The default is
28328 @samp{keep}, which keeps indirect call and jump unmodified.
28329 @samp{thunk} converts indirect call and jump to call and return thunk.
28330 @samp{thunk-inline} converts indirect call and jump to inlined call
28331 and return thunk.  @samp{thunk-extern} converts indirect call and jump
28332 to external call and return thunk provided in a separate object file.
28333 You can control this behavior for a specific function by using the
28334 function attribute @code{indirect_branch}.  @xref{Function Attributes}.
28336 Note that @option{-mcmodel=large} is incompatible with
28337 @option{-mindirect-branch=thunk} and
28338 @option{-mindirect-branch=thunk-extern} since the thunk function may
28339 not be reachable in the large code model.
28341 Note that @option{-mindirect-branch=thunk-extern} is incompatible with
28342 @option{-fcf-protection=branch} since the external thunk can not be modified
28343 to disable control-flow check.
28345 @item -mfunction-return=@var{choice}
28346 @opindex -mfunction-return
28347 Convert function return with @var{choice}.  The default is @samp{keep},
28348 which keeps function return unmodified.  @samp{thunk} converts function
28349 return to call and return thunk.  @samp{thunk-inline} converts function
28350 return to inlined call and return thunk.  @samp{thunk-extern} converts
28351 function return to external call and return thunk provided in a separate
28352 object file.  You can control this behavior for a specific function by
28353 using the function attribute @code{function_return}.
28354 @xref{Function Attributes}.
28356 Note that @option{-mcmodel=large} is incompatible with
28357 @option{-mfunction-return=thunk} and
28358 @option{-mfunction-return=thunk-extern} since the thunk function may
28359 not be reachable in the large code model.
28362 @item -mindirect-branch-register
28363 @opindex -mindirect-branch-register
28364 Force indirect call and jump via register.
28366 @end table
28368 These @samp{-m} switches are supported in addition to the above
28369 on x86-64 processors in 64-bit environments.
28371 @table @gcctabopt
28372 @item -m32
28373 @itemx -m64
28374 @itemx -mx32
28375 @itemx -m16
28376 @itemx -miamcu
28377 @opindex m32
28378 @opindex m64
28379 @opindex mx32
28380 @opindex m16
28381 @opindex miamcu
28382 Generate code for a 16-bit, 32-bit or 64-bit environment.
28383 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
28384 to 32 bits, and
28385 generates code that runs on any i386 system.
28387 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
28388 types to 64 bits, and generates code for the x86-64 architecture.
28389 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
28390 and @option{-mdynamic-no-pic} options.
28392 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
28393 to 32 bits, and
28394 generates code for the x86-64 architecture.
28396 The @option{-m16} option is the same as @option{-m32}, except for that
28397 it outputs the @code{.code16gcc} assembly directive at the beginning of
28398 the assembly output so that the binary can run in 16-bit mode.
28400 The @option{-miamcu} option generates code which conforms to Intel MCU
28401 psABI.  It requires the @option{-m32} option to be turned on.
28403 @item -mno-red-zone
28404 @opindex mno-red-zone
28405 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
28406 by the x86-64 ABI; it is a 128-byte area beyond the location of the
28407 stack pointer that is not modified by signal or interrupt handlers
28408 and therefore can be used for temporary data without adjusting the stack
28409 pointer.  The flag @option{-mno-red-zone} disables this red zone.
28411 @item -mcmodel=small
28412 @opindex mcmodel=small
28413 Generate code for the small code model: the program and its symbols must
28414 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
28415 Programs can be statically or dynamically linked.  This is the default
28416 code model.
28418 @item -mcmodel=kernel
28419 @opindex mcmodel=kernel
28420 Generate code for the kernel code model.  The kernel runs in the
28421 negative 2 GB of the address space.
28422 This model has to be used for Linux kernel code.
28424 @item -mcmodel=medium
28425 @opindex mcmodel=medium
28426 Generate code for the medium model: the program is linked in the lower 2
28427 GB of the address space.  Small symbols are also placed there.  Symbols
28428 with sizes larger than @option{-mlarge-data-threshold} are put into
28429 large data or BSS sections and can be located above 2GB.  Programs can
28430 be statically or dynamically linked.
28432 @item -mcmodel=large
28433 @opindex mcmodel=large
28434 Generate code for the large model.  This model makes no assumptions
28435 about addresses and sizes of sections.
28437 @item -maddress-mode=long
28438 @opindex maddress-mode=long
28439 Generate code for long address mode.  This is only supported for 64-bit
28440 and x32 environments.  It is the default address mode for 64-bit
28441 environments.
28443 @item -maddress-mode=short
28444 @opindex maddress-mode=short
28445 Generate code for short address mode.  This is only supported for 32-bit
28446 and x32 environments.  It is the default address mode for 32-bit and
28447 x32 environments.
28448 @end table
28450 @node x86 Windows Options
28451 @subsection x86 Windows Options
28452 @cindex x86 Windows Options
28453 @cindex Windows Options for x86
28455 These additional options are available for Microsoft Windows targets:
28457 @table @gcctabopt
28458 @item -mconsole
28459 @opindex mconsole
28460 This option
28461 specifies that a console application is to be generated, by
28462 instructing the linker to set the PE header subsystem type
28463 required for console applications.
28464 This option is available for Cygwin and MinGW targets and is
28465 enabled by default on those targets.
28467 @item -mdll
28468 @opindex mdll
28469 This option is available for Cygwin and MinGW targets.  It
28470 specifies that a DLL---a dynamic link library---is to be
28471 generated, enabling the selection of the required runtime
28472 startup object and entry point.
28474 @item -mnop-fun-dllimport
28475 @opindex mnop-fun-dllimport
28476 This option is available for Cygwin and MinGW targets.  It
28477 specifies that the @code{dllimport} attribute should be ignored.
28479 @item -mthread
28480 @opindex mthread
28481 This option is available for MinGW targets. It specifies
28482 that MinGW-specific thread support is to be used.
28484 @item -municode
28485 @opindex municode
28486 This option is available for MinGW-w64 targets.  It causes
28487 the @code{UNICODE} preprocessor macro to be predefined, and
28488 chooses Unicode-capable runtime startup code.
28490 @item -mwin32
28491 @opindex mwin32
28492 This option is available for Cygwin and MinGW targets.  It
28493 specifies that the typical Microsoft Windows predefined macros are to
28494 be set in the pre-processor, but does not influence the choice
28495 of runtime library/startup code.
28497 @item -mwindows
28498 @opindex mwindows
28499 This option is available for Cygwin and MinGW targets.  It
28500 specifies that a GUI application is to be generated by
28501 instructing the linker to set the PE header subsystem type
28502 appropriately.
28504 @item -fno-set-stack-executable
28505 @opindex fno-set-stack-executable
28506 This option is available for MinGW targets. It specifies that
28507 the executable flag for the stack used by nested functions isn't
28508 set. This is necessary for binaries running in kernel mode of
28509 Microsoft Windows, as there the User32 API, which is used to set executable
28510 privileges, isn't available.
28512 @item -fwritable-relocated-rdata
28513 @opindex fno-writable-relocated-rdata
28514 This option is available for MinGW and Cygwin targets.  It specifies
28515 that relocated-data in read-only section is put into the @code{.data}
28516 section.  This is a necessary for older runtimes not supporting
28517 modification of @code{.rdata} sections for pseudo-relocation.
28519 @item -mpe-aligned-commons
28520 @opindex mpe-aligned-commons
28521 This option is available for Cygwin and MinGW targets.  It
28522 specifies that the GNU extension to the PE file format that
28523 permits the correct alignment of COMMON variables should be
28524 used when generating code.  It is enabled by default if
28525 GCC detects that the target assembler found during configuration
28526 supports the feature.
28527 @end table
28529 See also under @ref{x86 Options} for standard options.
28531 @node Xstormy16 Options
28532 @subsection Xstormy16 Options
28533 @cindex Xstormy16 Options
28535 These options are defined for Xstormy16:
28537 @table @gcctabopt
28538 @item -msim
28539 @opindex msim
28540 Choose startup files and linker script suitable for the simulator.
28541 @end table
28543 @node Xtensa Options
28544 @subsection Xtensa Options
28545 @cindex Xtensa Options
28547 These options are supported for Xtensa targets:
28549 @table @gcctabopt
28550 @item -mconst16
28551 @itemx -mno-const16
28552 @opindex mconst16
28553 @opindex mno-const16
28554 Enable or disable use of @code{CONST16} instructions for loading
28555 constant values.  The @code{CONST16} instruction is currently not a
28556 standard option from Tensilica.  When enabled, @code{CONST16}
28557 instructions are always used in place of the standard @code{L32R}
28558 instructions.  The use of @code{CONST16} is enabled by default only if
28559 the @code{L32R} instruction is not available.
28561 @item -mfused-madd
28562 @itemx -mno-fused-madd
28563 @opindex mfused-madd
28564 @opindex mno-fused-madd
28565 Enable or disable use of fused multiply/add and multiply/subtract
28566 instructions in the floating-point option.  This has no effect if the
28567 floating-point option is not also enabled.  Disabling fused multiply/add
28568 and multiply/subtract instructions forces the compiler to use separate
28569 instructions for the multiply and add/subtract operations.  This may be
28570 desirable in some cases where strict IEEE 754-compliant results are
28571 required: the fused multiply add/subtract instructions do not round the
28572 intermediate result, thereby producing results with @emph{more} bits of
28573 precision than specified by the IEEE standard.  Disabling fused multiply
28574 add/subtract instructions also ensures that the program output is not
28575 sensitive to the compiler's ability to combine multiply and add/subtract
28576 operations.
28578 @item -mserialize-volatile
28579 @itemx -mno-serialize-volatile
28580 @opindex mserialize-volatile
28581 @opindex mno-serialize-volatile
28582 When this option is enabled, GCC inserts @code{MEMW} instructions before
28583 @code{volatile} memory references to guarantee sequential consistency.
28584 The default is @option{-mserialize-volatile}.  Use
28585 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
28587 @item -mforce-no-pic
28588 @opindex mforce-no-pic
28589 For targets, like GNU/Linux, where all user-mode Xtensa code must be
28590 position-independent code (PIC), this option disables PIC for compiling
28591 kernel code.
28593 @item -mtext-section-literals
28594 @itemx -mno-text-section-literals
28595 @opindex mtext-section-literals
28596 @opindex mno-text-section-literals
28597 These options control the treatment of literal pools.  The default is
28598 @option{-mno-text-section-literals}, which places literals in a separate
28599 section in the output file.  This allows the literal pool to be placed
28600 in a data RAM/ROM, and it also allows the linker to combine literal
28601 pools from separate object files to remove redundant literals and
28602 improve code size.  With @option{-mtext-section-literals}, the literals
28603 are interspersed in the text section in order to keep them as close as
28604 possible to their references.  This may be necessary for large assembly
28605 files.  Literals for each function are placed right before that function.
28607 @item -mauto-litpools
28608 @itemx -mno-auto-litpools
28609 @opindex mauto-litpools
28610 @opindex mno-auto-litpools
28611 These options control the treatment of literal pools.  The default is
28612 @option{-mno-auto-litpools}, which places literals in a separate
28613 section in the output file unless @option{-mtext-section-literals} is
28614 used.  With @option{-mauto-litpools} the literals are interspersed in
28615 the text section by the assembler.  Compiler does not produce explicit
28616 @code{.literal} directives and loads literals into registers with
28617 @code{MOVI} instructions instead of @code{L32R} to let the assembler
28618 do relaxation and place literals as necessary.  This option allows
28619 assembler to create several literal pools per function and assemble
28620 very big functions, which may not be possible with
28621 @option{-mtext-section-literals}.
28623 @item -mtarget-align
28624 @itemx -mno-target-align
28625 @opindex mtarget-align
28626 @opindex mno-target-align
28627 When this option is enabled, GCC instructs the assembler to
28628 automatically align instructions to reduce branch penalties at the
28629 expense of some code density.  The assembler attempts to widen density
28630 instructions to align branch targets and the instructions following call
28631 instructions.  If there are not enough preceding safe density
28632 instructions to align a target, no widening is performed.  The
28633 default is @option{-mtarget-align}.  These options do not affect the
28634 treatment of auto-aligned instructions like @code{LOOP}, which the
28635 assembler always aligns, either by widening density instructions or
28636 by inserting NOP instructions.
28638 @item -mlongcalls
28639 @itemx -mno-longcalls
28640 @opindex mlongcalls
28641 @opindex mno-longcalls
28642 When this option is enabled, GCC instructs the assembler to translate
28643 direct calls to indirect calls unless it can determine that the target
28644 of a direct call is in the range allowed by the call instruction.  This
28645 translation typically occurs for calls to functions in other source
28646 files.  Specifically, the assembler translates a direct @code{CALL}
28647 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
28648 The default is @option{-mno-longcalls}.  This option should be used in
28649 programs where the call target can potentially be out of range.  This
28650 option is implemented in the assembler, not the compiler, so the
28651 assembly code generated by GCC still shows direct call
28652 instructions---look at the disassembled object code to see the actual
28653 instructions.  Note that the assembler uses an indirect call for
28654 every cross-file call, not just those that really are out of range.
28655 @end table
28657 @node zSeries Options
28658 @subsection zSeries Options
28659 @cindex zSeries options
28661 These are listed under @xref{S/390 and zSeries Options}.
28664 @c man end
28666 @node Spec Files
28667 @section Specifying Subprocesses and the Switches to Pass to Them
28668 @cindex Spec Files
28670 @command{gcc} is a driver program.  It performs its job by invoking a
28671 sequence of other programs to do the work of compiling, assembling and
28672 linking.  GCC interprets its command-line parameters and uses these to
28673 deduce which programs it should invoke, and which command-line options
28674 it ought to place on their command lines.  This behavior is controlled
28675 by @dfn{spec strings}.  In most cases there is one spec string for each
28676 program that GCC can invoke, but a few programs have multiple spec
28677 strings to control their behavior.  The spec strings built into GCC can
28678 be overridden by using the @option{-specs=} command-line switch to specify
28679 a spec file.
28681 @dfn{Spec files} are plain-text files that are used to construct spec
28682 strings.  They consist of a sequence of directives separated by blank
28683 lines.  The type of directive is determined by the first non-whitespace
28684 character on the line, which can be one of the following:
28686 @table @code
28687 @item %@var{command}
28688 Issues a @var{command} to the spec file processor.  The commands that can
28689 appear here are:
28691 @table @code
28692 @item %include <@var{file}>
28693 @cindex @code{%include}
28694 Search for @var{file} and insert its text at the current point in the
28695 specs file.
28697 @item %include_noerr <@var{file}>
28698 @cindex @code{%include_noerr}
28699 Just like @samp{%include}, but do not generate an error message if the include
28700 file cannot be found.
28702 @item %rename @var{old_name} @var{new_name}
28703 @cindex @code{%rename}
28704 Rename the spec string @var{old_name} to @var{new_name}.
28706 @end table
28708 @item *[@var{spec_name}]:
28709 This tells the compiler to create, override or delete the named spec
28710 string.  All lines after this directive up to the next directive or
28711 blank line are considered to be the text for the spec string.  If this
28712 results in an empty string then the spec is deleted.  (Or, if the
28713 spec did not exist, then nothing happens.)  Otherwise, if the spec
28714 does not currently exist a new spec is created.  If the spec does
28715 exist then its contents are overridden by the text of this
28716 directive, unless the first character of that text is the @samp{+}
28717 character, in which case the text is appended to the spec.
28719 @item [@var{suffix}]:
28720 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
28721 and up to the next directive or blank line are considered to make up the
28722 spec string for the indicated suffix.  When the compiler encounters an
28723 input file with the named suffix, it processes the spec string in
28724 order to work out how to compile that file.  For example:
28726 @smallexample
28727 .ZZ:
28728 z-compile -input %i
28729 @end smallexample
28731 This says that any input file whose name ends in @samp{.ZZ} should be
28732 passed to the program @samp{z-compile}, which should be invoked with the
28733 command-line switch @option{-input} and with the result of performing the
28734 @samp{%i} substitution.  (See below.)
28736 As an alternative to providing a spec string, the text following a
28737 suffix directive can be one of the following:
28739 @table @code
28740 @item @@@var{language}
28741 This says that the suffix is an alias for a known @var{language}.  This is
28742 similar to using the @option{-x} command-line switch to GCC to specify a
28743 language explicitly.  For example:
28745 @smallexample
28746 .ZZ:
28747 @@c++
28748 @end smallexample
28750 Says that .ZZ files are, in fact, C++ source files.
28752 @item #@var{name}
28753 This causes an error messages saying:
28755 @smallexample
28756 @var{name} compiler not installed on this system.
28757 @end smallexample
28758 @end table
28760 GCC already has an extensive list of suffixes built into it.
28761 This directive adds an entry to the end of the list of suffixes, but
28762 since the list is searched from the end backwards, it is effectively
28763 possible to override earlier entries using this technique.
28765 @end table
28767 GCC has the following spec strings built into it.  Spec files can
28768 override these strings or create their own.  Note that individual
28769 targets can also add their own spec strings to this list.
28771 @smallexample
28772 asm          Options to pass to the assembler
28773 asm_final    Options to pass to the assembler post-processor
28774 cpp          Options to pass to the C preprocessor
28775 cc1          Options to pass to the C compiler
28776 cc1plus      Options to pass to the C++ compiler
28777 endfile      Object files to include at the end of the link
28778 link         Options to pass to the linker
28779 lib          Libraries to include on the command line to the linker
28780 libgcc       Decides which GCC support library to pass to the linker
28781 linker       Sets the name of the linker
28782 predefines   Defines to be passed to the C preprocessor
28783 signed_char  Defines to pass to CPP to say whether @code{char} is signed
28784              by default
28785 startfile    Object files to include at the start of the link
28786 @end smallexample
28788 Here is a small example of a spec file:
28790 @smallexample
28791 %rename lib                 old_lib
28793 *lib:
28794 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
28795 @end smallexample
28797 This example renames the spec called @samp{lib} to @samp{old_lib} and
28798 then overrides the previous definition of @samp{lib} with a new one.
28799 The new definition adds in some extra command-line options before
28800 including the text of the old definition.
28802 @dfn{Spec strings} are a list of command-line options to be passed to their
28803 corresponding program.  In addition, the spec strings can contain
28804 @samp{%}-prefixed sequences to substitute variable text or to
28805 conditionally insert text into the command line.  Using these constructs
28806 it is possible to generate quite complex command lines.
28808 Here is a table of all defined @samp{%}-sequences for spec
28809 strings.  Note that spaces are not generated automatically around the
28810 results of expanding these sequences.  Therefore you can concatenate them
28811 together or combine them with constant text in a single argument.
28813 @table @code
28814 @item %%
28815 Substitute one @samp{%} into the program name or argument.
28817 @item %i
28818 Substitute the name of the input file being processed.
28820 @item %b
28821 Substitute the basename of the input file being processed.
28822 This is the substring up to (and not including) the last period
28823 and not including the directory.
28825 @item %B
28826 This is the same as @samp{%b}, but include the file suffix (text after
28827 the last period).
28829 @item %d
28830 Marks the argument containing or following the @samp{%d} as a
28831 temporary file name, so that that file is deleted if GCC exits
28832 successfully.  Unlike @samp{%g}, this contributes no text to the
28833 argument.
28835 @item %g@var{suffix}
28836 Substitute a file name that has suffix @var{suffix} and is chosen
28837 once per compilation, and mark the argument in the same way as
28838 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
28839 name is now chosen in a way that is hard to predict even when previously
28840 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
28841 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
28842 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
28843 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
28844 was simply substituted with a file name chosen once per compilation,
28845 without regard to any appended suffix (which was therefore treated
28846 just like ordinary text), making such attacks more likely to succeed.
28848 @item %u@var{suffix}
28849 Like @samp{%g}, but generates a new temporary file name
28850 each time it appears instead of once per compilation.
28852 @item %U@var{suffix}
28853 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
28854 new one if there is no such last file name.  In the absence of any
28855 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
28856 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
28857 involves the generation of two distinct file names, one
28858 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
28859 simply substituted with a file name chosen for the previous @samp{%u},
28860 without regard to any appended suffix.
28862 @item %j@var{suffix}
28863 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
28864 writable, and if @option{-save-temps} is not used; 
28865 otherwise, substitute the name
28866 of a temporary file, just like @samp{%u}.  This temporary file is not
28867 meant for communication between processes, but rather as a junk
28868 disposal mechanism.
28870 @item %|@var{suffix}
28871 @itemx %m@var{suffix}
28872 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
28873 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
28874 all.  These are the two most common ways to instruct a program that it
28875 should read from standard input or write to standard output.  If you
28876 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
28877 construct: see for example @file{f/lang-specs.h}.
28879 @item %.@var{SUFFIX}
28880 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
28881 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
28882 terminated by the next space or %.
28884 @item %w
28885 Marks the argument containing or following the @samp{%w} as the
28886 designated output file of this compilation.  This puts the argument
28887 into the sequence of arguments that @samp{%o} substitutes.
28889 @item %o
28890 Substitutes the names of all the output files, with spaces
28891 automatically placed around them.  You should write spaces
28892 around the @samp{%o} as well or the results are undefined.
28893 @samp{%o} is for use in the specs for running the linker.
28894 Input files whose names have no recognized suffix are not compiled
28895 at all, but they are included among the output files, so they are
28896 linked.
28898 @item %O
28899 Substitutes the suffix for object files.  Note that this is
28900 handled specially when it immediately follows @samp{%g, %u, or %U},
28901 because of the need for those to form complete file names.  The
28902 handling is such that @samp{%O} is treated exactly as if it had already
28903 been substituted, except that @samp{%g, %u, and %U} do not currently
28904 support additional @var{suffix} characters following @samp{%O} as they do
28905 following, for example, @samp{.o}.
28907 @item %p
28908 Substitutes the standard macro predefinitions for the
28909 current target machine.  Use this when running @command{cpp}.
28911 @item %P
28912 Like @samp{%p}, but puts @samp{__} before and after the name of each
28913 predefined macro, except for macros that start with @samp{__} or with
28914 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
28917 @item %I
28918 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
28919 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
28920 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
28921 and @option{-imultilib} as necessary.
28923 @item %s
28924 Current argument is the name of a library or startup file of some sort.
28925 Search for that file in a standard list of directories and substitute
28926 the full name found.  The current working directory is included in the
28927 list of directories scanned.
28929 @item %T
28930 Current argument is the name of a linker script.  Search for that file
28931 in the current list of directories to scan for libraries. If the file
28932 is located insert a @option{--script} option into the command line
28933 followed by the full path name found.  If the file is not found then
28934 generate an error message.  Note: the current working directory is not
28935 searched.
28937 @item %e@var{str}
28938 Print @var{str} as an error message.  @var{str} is terminated by a newline.
28939 Use this when inconsistent options are detected.
28941 @item %(@var{name})
28942 Substitute the contents of spec string @var{name} at this point.
28944 @item %x@{@var{option}@}
28945 Accumulate an option for @samp{%X}.
28947 @item %X
28948 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
28949 spec string.
28951 @item %Y
28952 Output the accumulated assembler options specified by @option{-Wa}.
28954 @item %Z
28955 Output the accumulated preprocessor options specified by @option{-Wp}.
28957 @item %a
28958 Process the @code{asm} spec.  This is used to compute the
28959 switches to be passed to the assembler.
28961 @item %A
28962 Process the @code{asm_final} spec.  This is a spec string for
28963 passing switches to an assembler post-processor, if such a program is
28964 needed.
28966 @item %l
28967 Process the @code{link} spec.  This is the spec for computing the
28968 command line passed to the linker.  Typically it makes use of the
28969 @samp{%L %G %S %D and %E} sequences.
28971 @item %D
28972 Dump out a @option{-L} option for each directory that GCC believes might
28973 contain startup files.  If the target supports multilibs then the
28974 current multilib directory is prepended to each of these paths.
28976 @item %L
28977 Process the @code{lib} spec.  This is a spec string for deciding which
28978 libraries are included on the command line to the linker.
28980 @item %G
28981 Process the @code{libgcc} spec.  This is a spec string for deciding
28982 which GCC support library is included on the command line to the linker.
28984 @item %S
28985 Process the @code{startfile} spec.  This is a spec for deciding which
28986 object files are the first ones passed to the linker.  Typically
28987 this might be a file named @file{crt0.o}.
28989 @item %E
28990 Process the @code{endfile} spec.  This is a spec string that specifies
28991 the last object files that are passed to the linker.
28993 @item %C
28994 Process the @code{cpp} spec.  This is used to construct the arguments
28995 to be passed to the C preprocessor.
28997 @item %1
28998 Process the @code{cc1} spec.  This is used to construct the options to be
28999 passed to the actual C compiler (@command{cc1}).
29001 @item %2
29002 Process the @code{cc1plus} spec.  This is used to construct the options to be
29003 passed to the actual C++ compiler (@command{cc1plus}).
29005 @item %*
29006 Substitute the variable part of a matched option.  See below.
29007 Note that each comma in the substituted string is replaced by
29008 a single space.
29010 @item %<S
29011 Remove all occurrences of @code{-S} from the command line.  Note---this
29012 command is position dependent.  @samp{%} commands in the spec string
29013 before this one see @code{-S}, @samp{%} commands in the spec string
29014 after this one do not.
29016 @item %:@var{function}(@var{args})
29017 Call the named function @var{function}, passing it @var{args}.
29018 @var{args} is first processed as a nested spec string, then split
29019 into an argument vector in the usual fashion.  The function returns
29020 a string which is processed as if it had appeared literally as part
29021 of the current spec.
29023 The following built-in spec functions are provided:
29025 @table @code
29026 @item @code{getenv}
29027 The @code{getenv} spec function takes two arguments: an environment
29028 variable name and a string.  If the environment variable is not
29029 defined, a fatal error is issued.  Otherwise, the return value is the
29030 value of the environment variable concatenated with the string.  For
29031 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
29033 @smallexample
29034 %:getenv(TOPDIR /include)
29035 @end smallexample
29037 expands to @file{/path/to/top/include}.
29039 @item @code{if-exists}
29040 The @code{if-exists} spec function takes one argument, an absolute
29041 pathname to a file.  If the file exists, @code{if-exists} returns the
29042 pathname.  Here is a small example of its usage:
29044 @smallexample
29045 *startfile:
29046 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
29047 @end smallexample
29049 @item @code{if-exists-else}
29050 The @code{if-exists-else} spec function is similar to the @code{if-exists}
29051 spec function, except that it takes two arguments.  The first argument is
29052 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
29053 returns the pathname.  If it does not exist, it returns the second argument.
29054 This way, @code{if-exists-else} can be used to select one file or another,
29055 based on the existence of the first.  Here is a small example of its usage:
29057 @smallexample
29058 *startfile:
29059 crt0%O%s %:if-exists(crti%O%s) \
29060 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
29061 @end smallexample
29063 @item @code{replace-outfile}
29064 The @code{replace-outfile} spec function takes two arguments.  It looks for the
29065 first argument in the outfiles array and replaces it with the second argument.  Here
29066 is a small example of its usage:
29068 @smallexample
29069 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
29070 @end smallexample
29072 @item @code{remove-outfile}
29073 The @code{remove-outfile} spec function takes one argument.  It looks for the
29074 first argument in the outfiles array and removes it.  Here is a small example
29075 its usage:
29077 @smallexample
29078 %:remove-outfile(-lm)
29079 @end smallexample
29081 @item @code{pass-through-libs}
29082 The @code{pass-through-libs} spec function takes any number of arguments.  It
29083 finds any @option{-l} options and any non-options ending in @file{.a} (which it
29084 assumes are the names of linker input library archive files) and returns a
29085 result containing all the found arguments each prepended by
29086 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
29087 intended to be passed to the LTO linker plugin.
29089 @smallexample
29090 %:pass-through-libs(%G %L %G)
29091 @end smallexample
29093 @item @code{print-asm-header}
29094 The @code{print-asm-header} function takes no arguments and simply
29095 prints a banner like:
29097 @smallexample
29098 Assembler options
29099 =================
29101 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
29102 @end smallexample
29104 It is used to separate compiler options from assembler options
29105 in the @option{--target-help} output.
29106 @end table
29108 @item %@{S@}
29109 Substitutes the @code{-S} switch, if that switch is given to GCC@.
29110 If that switch is not specified, this substitutes nothing.  Note that
29111 the leading dash is omitted when specifying this option, and it is
29112 automatically inserted if the substitution is performed.  Thus the spec
29113 string @samp{%@{foo@}} matches the command-line option @option{-foo}
29114 and outputs the command-line option @option{-foo}.
29116 @item %W@{S@}
29117 Like %@{@code{S}@} but mark last argument supplied within as a file to be
29118 deleted on failure.
29120 @item %@{S*@}
29121 Substitutes all the switches specified to GCC whose names start
29122 with @code{-S}, but which also take an argument.  This is used for
29123 switches like @option{-o}, @option{-D}, @option{-I}, etc.
29124 GCC considers @option{-o foo} as being
29125 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
29126 text, including the space.  Thus two arguments are generated.
29128 @item %@{S*&T*@}
29129 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
29130 (the order of @code{S} and @code{T} in the spec is not significant).
29131 There can be any number of ampersand-separated variables; for each the
29132 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
29134 @item %@{S:X@}
29135 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
29137 @item %@{!S:X@}
29138 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
29140 @item %@{S*:X@}
29141 Substitutes @code{X} if one or more switches whose names start with
29142 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
29143 once, no matter how many such switches appeared.  However, if @code{%*}
29144 appears somewhere in @code{X}, then @code{X} is substituted once
29145 for each matching switch, with the @code{%*} replaced by the part of
29146 that switch matching the @code{*}.
29148 If @code{%*} appears as the last part of a spec sequence then a space
29149 is added after the end of the last substitution.  If there is more
29150 text in the sequence, however, then a space is not generated.  This
29151 allows the @code{%*} substitution to be used as part of a larger
29152 string.  For example, a spec string like this:
29154 @smallexample
29155 %@{mcu=*:--script=%*/memory.ld@}
29156 @end smallexample
29158 @noindent
29159 when matching an option like @option{-mcu=newchip} produces:
29161 @smallexample
29162 --script=newchip/memory.ld
29163 @end smallexample
29165 @item %@{.S:X@}
29166 Substitutes @code{X}, if processing a file with suffix @code{S}.
29168 @item %@{!.S:X@}
29169 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
29171 @item %@{,S:X@}
29172 Substitutes @code{X}, if processing a file for language @code{S}.
29174 @item %@{!,S:X@}
29175 Substitutes @code{X}, if not processing a file for language @code{S}.
29177 @item %@{S|P:X@}
29178 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
29179 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
29180 @code{*} sequences as well, although they have a stronger binding than
29181 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
29182 alternatives must be starred, and only the first matching alternative
29183 is substituted.
29185 For example, a spec string like this:
29187 @smallexample
29188 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
29189 @end smallexample
29191 @noindent
29192 outputs the following command-line options from the following input
29193 command-line options:
29195 @smallexample
29196 fred.c        -foo -baz
29197 jim.d         -bar -boggle
29198 -d fred.c     -foo -baz -boggle
29199 -d jim.d      -bar -baz -boggle
29200 @end smallexample
29202 @item %@{S:X; T:Y; :D@}
29204 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
29205 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
29206 be as many clauses as you need.  This may be combined with @code{.},
29207 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
29210 @end table
29212 The switch matching text @code{S} in a @samp{%@{S@}}, @samp{%@{S:X@}}
29213 or similar construct can use a backslash to ignore the special meaning
29214 of the character following it, thus allowing literal matching of a
29215 character that is otherwise specially treated.  For example,
29216 @samp{%@{std=iso9899\:1999:X@}} substitutes @code{X} if the
29217 @option{-std=iso9899:1999} option is given.
29219 The conditional text @code{X} in a @samp{%@{S:X@}} or similar
29220 construct may contain other nested @samp{%} constructs or spaces, or
29221 even newlines.  They are processed as usual, as described above.
29222 Trailing white space in @code{X} is ignored.  White space may also
29223 appear anywhere on the left side of the colon in these constructs,
29224 except between @code{.} or @code{*} and the corresponding word.
29226 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
29227 handled specifically in these constructs.  If another value of
29228 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
29229 @option{-W} switch is found later in the command line, the earlier
29230 switch value is ignored, except with @{@code{S}*@} where @code{S} is
29231 just one letter, which passes all matching options.
29233 The character @samp{|} at the beginning of the predicate text is used to
29234 indicate that a command should be piped to the following command, but
29235 only if @option{-pipe} is specified.
29237 It is built into GCC which switches take arguments and which do not.
29238 (You might think it would be useful to generalize this to allow each
29239 compiler's spec to say which switches take arguments.  But this cannot
29240 be done in a consistent fashion.  GCC cannot even decide which input
29241 files have been specified without knowing which switches take arguments,
29242 and it must know which input files to compile in order to tell which
29243 compilers to run).
29245 GCC also knows implicitly that arguments starting in @option{-l} are to be
29246 treated as compiler output files, and passed to the linker in their
29247 proper position among the other output files.
29249 @node Environment Variables
29250 @section Environment Variables Affecting GCC
29251 @cindex environment variables
29253 @c man begin ENVIRONMENT
29254 This section describes several environment variables that affect how GCC
29255 operates.  Some of them work by specifying directories or prefixes to use
29256 when searching for various kinds of files.  Some are used to specify other
29257 aspects of the compilation environment.
29259 Note that you can also specify places to search using options such as
29260 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
29261 take precedence over places specified using environment variables, which
29262 in turn take precedence over those specified by the configuration of GCC@.
29263 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
29264 GNU Compiler Collection (GCC) Internals}.
29266 @table @env
29267 @item LANG
29268 @itemx LC_CTYPE
29269 @c @itemx LC_COLLATE
29270 @itemx LC_MESSAGES
29271 @c @itemx LC_MONETARY
29272 @c @itemx LC_NUMERIC
29273 @c @itemx LC_TIME
29274 @itemx LC_ALL
29275 @findex LANG
29276 @findex LC_CTYPE
29277 @c @findex LC_COLLATE
29278 @findex LC_MESSAGES
29279 @c @findex LC_MONETARY
29280 @c @findex LC_NUMERIC
29281 @c @findex LC_TIME
29282 @findex LC_ALL
29283 @cindex locale
29284 These environment variables control the way that GCC uses
29285 localization information which allows GCC to work with different
29286 national conventions.  GCC inspects the locale categories
29287 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
29288 so.  These locale categories can be set to any value supported by your
29289 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
29290 Kingdom encoded in UTF-8.
29292 The @env{LC_CTYPE} environment variable specifies character
29293 classification.  GCC uses it to determine the character boundaries in
29294 a string; this is needed for some multibyte encodings that contain quote
29295 and escape characters that are otherwise interpreted as a string
29296 end or escape.
29298 The @env{LC_MESSAGES} environment variable specifies the language to
29299 use in diagnostic messages.
29301 If the @env{LC_ALL} environment variable is set, it overrides the value
29302 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
29303 and @env{LC_MESSAGES} default to the value of the @env{LANG}
29304 environment variable.  If none of these variables are set, GCC
29305 defaults to traditional C English behavior.
29307 @item TMPDIR
29308 @findex TMPDIR
29309 If @env{TMPDIR} is set, it specifies the directory to use for temporary
29310 files.  GCC uses temporary files to hold the output of one stage of
29311 compilation which is to be used as input to the next stage: for example,
29312 the output of the preprocessor, which is the input to the compiler
29313 proper.
29315 @item GCC_COMPARE_DEBUG
29316 @findex GCC_COMPARE_DEBUG
29317 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
29318 @option{-fcompare-debug} to the compiler driver.  See the documentation
29319 of this option for more details.
29321 @item GCC_EXEC_PREFIX
29322 @findex GCC_EXEC_PREFIX
29323 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
29324 names of the subprograms executed by the compiler.  No slash is added
29325 when this prefix is combined with the name of a subprogram, but you can
29326 specify a prefix that ends with a slash if you wish.
29328 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
29329 an appropriate prefix to use based on the pathname it is invoked with.
29331 If GCC cannot find the subprogram using the specified prefix, it
29332 tries looking in the usual places for the subprogram.
29334 The default value of @env{GCC_EXEC_PREFIX} is
29335 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
29336 the installed compiler. In many cases @var{prefix} is the value
29337 of @code{prefix} when you ran the @file{configure} script.
29339 Other prefixes specified with @option{-B} take precedence over this prefix.
29341 This prefix is also used for finding files such as @file{crt0.o} that are
29342 used for linking.
29344 In addition, the prefix is used in an unusual way in finding the
29345 directories to search for header files.  For each of the standard
29346 directories whose name normally begins with @samp{/usr/local/lib/gcc}
29347 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
29348 replacing that beginning with the specified prefix to produce an
29349 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
29350 @file{foo/bar} just before it searches the standard directory 
29351 @file{/usr/local/lib/bar}.
29352 If a standard directory begins with the configured
29353 @var{prefix} then the value of @var{prefix} is replaced by
29354 @env{GCC_EXEC_PREFIX} when looking for header files.
29356 @item COMPILER_PATH
29357 @findex COMPILER_PATH
29358 The value of @env{COMPILER_PATH} is a colon-separated list of
29359 directories, much like @env{PATH}.  GCC tries the directories thus
29360 specified when searching for subprograms, if it cannot find the
29361 subprograms using @env{GCC_EXEC_PREFIX}.
29363 @item LIBRARY_PATH
29364 @findex LIBRARY_PATH
29365 The value of @env{LIBRARY_PATH} is a colon-separated list of
29366 directories, much like @env{PATH}.  When configured as a native compiler,
29367 GCC tries the directories thus specified when searching for special
29368 linker files, if it cannot find them using @env{GCC_EXEC_PREFIX}.  Linking
29369 using GCC also uses these directories when searching for ordinary
29370 libraries for the @option{-l} option (but directories specified with
29371 @option{-L} come first).
29373 @item LANG
29374 @findex LANG
29375 @cindex locale definition
29376 This variable is used to pass locale information to the compiler.  One way in
29377 which this information is used is to determine the character set to be used
29378 when character literals, string literals and comments are parsed in C and C++.
29379 When the compiler is configured to allow multibyte characters,
29380 the following values for @env{LANG} are recognized:
29382 @table @samp
29383 @item C-JIS
29384 Recognize JIS characters.
29385 @item C-SJIS
29386 Recognize SJIS characters.
29387 @item C-EUCJP
29388 Recognize EUCJP characters.
29389 @end table
29391 If @env{LANG} is not defined, or if it has some other value, then the
29392 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
29393 recognize and translate multibyte characters.
29394 @end table
29396 @noindent
29397 Some additional environment variables affect the behavior of the
29398 preprocessor.
29400 @include cppenv.texi
29402 @c man end
29404 @node Precompiled Headers
29405 @section Using Precompiled Headers
29406 @cindex precompiled headers
29407 @cindex speed of compilation
29409 Often large projects have many header files that are included in every
29410 source file.  The time the compiler takes to process these header files
29411 over and over again can account for nearly all of the time required to
29412 build the project.  To make builds faster, GCC allows you to
29413 @dfn{precompile} a header file.
29415 To create a precompiled header file, simply compile it as you would any
29416 other file, if necessary using the @option{-x} option to make the driver
29417 treat it as a C or C++ header file.  You may want to use a
29418 tool like @command{make} to keep the precompiled header up-to-date when
29419 the headers it contains change.
29421 A precompiled header file is searched for when @code{#include} is
29422 seen in the compilation.  As it searches for the included file
29423 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
29424 compiler looks for a precompiled header in each directory just before it
29425 looks for the include file in that directory.  The name searched for is
29426 the name specified in the @code{#include} with @samp{.gch} appended.  If
29427 the precompiled header file cannot be used, it is ignored.
29429 For instance, if you have @code{#include "all.h"}, and you have
29430 @file{all.h.gch} in the same directory as @file{all.h}, then the
29431 precompiled header file is used if possible, and the original
29432 header is used otherwise.
29434 Alternatively, you might decide to put the precompiled header file in a
29435 directory and use @option{-I} to ensure that directory is searched
29436 before (or instead of) the directory containing the original header.
29437 Then, if you want to check that the precompiled header file is always
29438 used, you can put a file of the same name as the original header in this
29439 directory containing an @code{#error} command.
29441 This also works with @option{-include}.  So yet another way to use
29442 precompiled headers, good for projects not designed with precompiled
29443 header files in mind, is to simply take most of the header files used by
29444 a project, include them from another header file, precompile that header
29445 file, and @option{-include} the precompiled header.  If the header files
29446 have guards against multiple inclusion, they are skipped because
29447 they've already been included (in the precompiled header).
29449 If you need to precompile the same header file for different
29450 languages, targets, or compiler options, you can instead make a
29451 @emph{directory} named like @file{all.h.gch}, and put each precompiled
29452 header in the directory, perhaps using @option{-o}.  It doesn't matter
29453 what you call the files in the directory; every precompiled header in
29454 the directory is considered.  The first precompiled header
29455 encountered in the directory that is valid for this compilation is
29456 used; they're searched in no particular order.
29458 There are many other possibilities, limited only by your imagination,
29459 good sense, and the constraints of your build system.
29461 A precompiled header file can be used only when these conditions apply:
29463 @itemize
29464 @item
29465 Only one precompiled header can be used in a particular compilation.
29467 @item
29468 A precompiled header cannot be used once the first C token is seen.  You
29469 can have preprocessor directives before a precompiled header; you cannot
29470 include a precompiled header from inside another header.
29472 @item
29473 The precompiled header file must be produced for the same language as
29474 the current compilation.  You cannot use a C precompiled header for a C++
29475 compilation.
29477 @item
29478 The precompiled header file must have been produced by the same compiler
29479 binary as the current compilation is using.
29481 @item
29482 Any macros defined before the precompiled header is included must
29483 either be defined in the same way as when the precompiled header was
29484 generated, or must not affect the precompiled header, which usually
29485 means that they don't appear in the precompiled header at all.
29487 The @option{-D} option is one way to define a macro before a
29488 precompiled header is included; using a @code{#define} can also do it.
29489 There are also some options that define macros implicitly, like
29490 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
29491 defined this way.
29493 @item If debugging information is output when using the precompiled
29494 header, using @option{-g} or similar, the same kind of debugging information
29495 must have been output when building the precompiled header.  However,
29496 a precompiled header built using @option{-g} can be used in a compilation
29497 when no debugging information is being output.
29499 @item The same @option{-m} options must generally be used when building
29500 and using the precompiled header.  @xref{Submodel Options},
29501 for any cases where this rule is relaxed.
29503 @item Each of the following options must be the same when building and using
29504 the precompiled header:
29506 @gccoptlist{-fexceptions}
29508 @item
29509 Some other command-line options starting with @option{-f},
29510 @option{-p}, or @option{-O} must be defined in the same way as when
29511 the precompiled header was generated.  At present, it's not clear
29512 which options are safe to change and which are not; the safest choice
29513 is to use exactly the same options when generating and using the
29514 precompiled header.  The following are known to be safe:
29516 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
29517 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
29518 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
29519 -pedantic-errors}
29521 @end itemize
29523 For all of these except the last, the compiler automatically
29524 ignores the precompiled header if the conditions aren't met.  If you
29525 find an option combination that doesn't work and doesn't cause the
29526 precompiled header to be ignored, please consider filing a bug report,
29527 see @ref{Bugs}.
29529 If you do use differing options when generating and using the
29530 precompiled header, the actual behavior is a mixture of the
29531 behavior for the options.  For instance, if you use @option{-g} to
29532 generate the precompiled header but not when using it, you may or may
29533 not get debugging information for routines in the precompiled header.