* asan.c (initialize_sanitizer_builtins): Add
[official-gcc.git] / gcc / doc / invoke.texi
blob88edc937d862e959883c7f2d08cd833469c347c4
1 @c Copyright (C) 1988-2017 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-2017 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), adb(1), dbx(1), sdb(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 @c man end
126 @xref{Option Index}, for an index to GCC's options.
128 @menu
129 * Option Summary::      Brief list of all options, without explanations.
130 * Overall Options::     Controlling the kind of output:
131                         an executable, object files, assembler files,
132                         or preprocessed source.
133 * Invoking G++::        Compiling C++ programs.
134 * C Dialect Options::   Controlling the variant of C language compiled.
135 * C++ Dialect Options:: Variations on C++.
136 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
137                         and Objective-C++.
138 * Diagnostic Message Formatting Options:: Controlling how diagnostics should
139                         be formatted.
140 * Warning Options::     How picky should the compiler be?
141 * Debugging Options::   Producing debuggable code.
142 * Optimize Options::    How much optimization?
143 * Instrumentation Options:: Enabling profiling and extra run-time error checking.
144 * Preprocessor Options:: Controlling header files and macro definitions.
145                          Also, getting dependency information for Make.
146 * Assembler Options::   Passing options to the assembler.
147 * Link Options::        Specifying libraries and so on.
148 * Directory Options::   Where to find header files and libraries.
149                         Where to find the compiler executable files.
150 * Code Gen Options::    Specifying conventions for function calls, data layout
151                         and register usage.
152 * Developer Options::   Printing GCC configuration info, statistics, and
153                         debugging dumps.
154 * Submodel Options::    Target-specific options, such as compiling for a
155                         specific processor variant.
156 * Spec Files::          How to pass switches to sub-processes.
157 * Environment Variables:: Env vars that affect GCC.
158 * Precompiled Headers:: Compiling a header once, and using it many times.
159 @end menu
161 @c man begin OPTIONS
163 @node Option Summary
164 @section Option Summary
166 Here is a summary of all the options, grouped by type.  Explanations are
167 in the following sections.
169 @table @emph
170 @item Overall Options
171 @xref{Overall Options,,Options Controlling the Kind of Output}.
172 @gccoptlist{-c  -S  -E  -o @var{file}  -x @var{language}  @gol
173 -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  --version @gol
174 -pass-exit-codes  -pipe  -specs=@var{file}  -wrapper  @gol
175 @@@var{file}  -fplugin=@var{file}  -fplugin-arg-@var{name}=@var{arg}  @gol
176 -fdump-ada-spec@r{[}-slim@r{]}  -fada-spec-parent=@var{unit}  -fdump-go-spec=@var{file}}
178 @item C Language Options
179 @xref{C Dialect Options,,Options Controlling C Dialect}.
180 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
181 -fpermitted-flt-eval-methods=@var{standard} @gol
182 -aux-info @var{filename}  -fallow-parameterless-variadic-functions @gol
183 -fno-asm  -fno-builtin  -fno-builtin-@var{function}  -fgimple@gol
184 -fhosted  -ffreestanding  -fopenacc  -fopenmp  -fopenmp-simd @gol
185 -fms-extensions  -fplan9-extensions  -fsso-struct=@var{endianness} @gol
186 -fallow-single-precision  -fcond-mismatch  -flax-vector-conversions @gol
187 -fsigned-bitfields  -fsigned-char @gol
188 -funsigned-bitfields  -funsigned-char}
190 @item C++ Language Options
191 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
192 @gccoptlist{-fabi-version=@var{n}  -fno-access-control @gol
193 -faligned-new=@var{n}  -fargs-in-order=@var{n}  -fcheck-new @gol
194 -fconstexpr-depth=@var{n}  -fconstexpr-loop-limit=@var{n} @gol
195 -ffriend-injection @gol
196 -fno-elide-constructors @gol
197 -fno-enforce-eh-specs @gol
198 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
199 -fno-implicit-templates @gol
200 -fno-implicit-inline-templates @gol
201 -fno-implement-inlines  -fms-extensions @gol
202 -fnew-inheriting-ctors @gol
203 -fnew-ttp-matching @gol
204 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
205 -fno-optional-diags  -fpermissive @gol
206 -fno-pretty-templates @gol
207 -frepo  -fno-rtti  -fsized-deallocation @gol
208 -ftemplate-backtrace-limit=@var{n} @gol
209 -ftemplate-depth=@var{n} @gol
210 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
211 -fno-weak  -nostdinc++ @gol
212 -fvisibility-inlines-hidden @gol
213 -fvisibility-ms-compat @gol
214 -fext-numeric-literals @gol
215 -Wabi=@var{n}  -Wabi-tag  -Wconversion-null  -Wctor-dtor-privacy @gol
216 -Wdelete-non-virtual-dtor  -Wliteral-suffix  -Wmultiple-inheritance @gol
217 -Wnamespaces  -Wnarrowing @gol
218 -Wnoexcept  -Wnoexcept-type  -Wclass-memaccess @gol
219 -Wnon-virtual-dtor  -Wreorder  -Wregister @gol
220 -Weffc++  -Wstrict-null-sentinel  -Wtemplates @gol
221 -Wno-non-template-friend  -Wold-style-cast @gol
222 -Woverloaded-virtual  -Wno-pmf-conversions @gol
223 -Wsign-promo  -Wvirtual-inheritance}
225 @item Objective-C and Objective-C++ Language Options
226 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
227 Objective-C and Objective-C++ Dialects}.
228 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
229 -fgnu-runtime  -fnext-runtime @gol
230 -fno-nil-receivers @gol
231 -fobjc-abi-version=@var{n} @gol
232 -fobjc-call-cxx-cdtors @gol
233 -fobjc-direct-dispatch @gol
234 -fobjc-exceptions @gol
235 -fobjc-gc @gol
236 -fobjc-nilcheck @gol
237 -fobjc-std=objc1 @gol
238 -fno-local-ivars @gol
239 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
240 -freplace-objc-classes @gol
241 -fzero-link @gol
242 -gen-decls @gol
243 -Wassign-intercept @gol
244 -Wno-protocol  -Wselector @gol
245 -Wstrict-selector-match @gol
246 -Wundeclared-selector}
248 @item Diagnostic Message Formatting Options
249 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
250 @gccoptlist{-fmessage-length=@var{n}  @gol
251 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
252 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
253 -fno-diagnostics-show-option  -fno-diagnostics-show-caret @gol
254 -fdiagnostics-parseable-fixits  -fdiagnostics-generate-patch @gol
255 -fdiagnostics-show-template-tree -fno-elide-type @gol
256 -fno-show-column}
258 @item Warning Options
259 @xref{Warning Options,,Options to Request or Suppress Warnings}.
260 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
261 -pedantic-errors @gol
262 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
263 -Walloc-zero  -Walloc-size-larger-than=@var{n}
264 -Walloca  -Walloca-larger-than=@var{n} @gol
265 -Wno-aggressive-loop-optimizations  -Warray-bounds  -Warray-bounds=@var{n} @gol
266 -Wno-attributes  -Wbool-compare  -Wbool-operation @gol
267 -Wno-builtin-declaration-mismatch @gol
268 -Wno-builtin-macro-redefined  -Wc90-c99-compat  -Wc99-c11-compat @gol
269 -Wc++-compat  -Wc++11-compat  -Wc++14-compat  -Wcast-align  -Wcast-qual  @gol
270 -Wchar-subscripts  -Wchkp  -Wcatch-value  -Wcatch-value=@var{n} @gol
271 -Wclobbered  -Wcomment  -Wconditionally-supported @gol
272 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wdangling-else  -Wdate-time @gol
273 -Wdelete-incomplete @gol
274 -Wno-deprecated  -Wno-deprecated-declarations  -Wno-designated-init @gol
275 -Wdisabled-optimization @gol
276 -Wno-discarded-qualifiers  -Wno-discarded-array-qualifiers @gol
277 -Wno-div-by-zero  -Wdouble-promotion @gol
278 -Wduplicated-branches  -Wduplicated-cond @gol
279 -Wempty-body  -Wenum-compare  -Wno-endif-labels  -Wexpansion-to-defined @gol
280 -Werror  -Werror=*  -Wextra-semi  -Wfatal-errors @gol
281 -Wfloat-equal  -Wformat  -Wformat=2 @gol
282 -Wno-format-contains-nul  -Wno-format-extra-args  @gol
283 -Wformat-nonliteral -Wformat-overflow=@var{n} @gol
284 -Wformat-security  -Wformat-signedness  -Wformat-truncation=@var{n} @gol
285 -Wformat-y2k  -Wframe-address @gol
286 -Wframe-larger-than=@var{len}  -Wno-free-nonheap-object  -Wjump-misses-init @gol
287 -Wif-not-aligned @gol
288 -Wignored-qualifiers  -Wignored-attributes  -Wincompatible-pointer-types @gol
289 -Wimplicit  -Wimplicit-fallthrough  -Wimplicit-fallthrough=@var{n} @gol
290 -Wimplicit-function-declaration  -Wimplicit-int @gol
291 -Winit-self  -Winline  -Wno-int-conversion  -Wint-in-bool-context @gol
292 -Wno-int-to-pointer-cast  -Winvalid-memory-model  -Wno-invalid-offsetof @gol
293 -Winvalid-pch  -Wlarger-than=@var{len} @gol
294 -Wlogical-op  -Wlogical-not-parentheses  -Wlong-long @gol
295 -Wmain  -Wmaybe-uninitialized  -Wmemset-elt-size  -Wmemset-transposed-args @gol
296 -Wmisleading-indentation  -Wmissing-braces @gol
297 -Wmissing-field-initializers  -Wmissing-include-dirs @gol
298 -Wno-multichar  -Wmultistatement-macros  -Wnonnull  -Wnonnull-compare @gol
299 -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
300 -Wnull-dereference  -Wodr  -Wno-overflow  -Wopenmp-simd  @gol
301 -Woverride-init-side-effects  -Woverlength-strings @gol
302 -Wpacked  -Wpacked-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
303 -Wparentheses  -Wno-pedantic-ms-format @gol
304 -Wplacement-new  -Wplacement-new=@var{n} @gol
305 -Wpointer-arith  -Wpointer-compare  -Wno-pointer-to-int-cast @gol
306 -Wno-pragmas  -Wredundant-decls  -Wrestrict  -Wno-return-local-addr @gol
307 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
308 -Wshadow=global,  -Wshadow=local,  -Wshadow=compatible-local @gol
309 -Wshift-overflow  -Wshift-overflow=@var{n} @gol
310 -Wshift-count-negative  -Wshift-count-overflow  -Wshift-negative-value @gol
311 -Wsign-compare  -Wsign-conversion  -Wfloat-conversion @gol
312 -Wno-scalar-storage-order  -Wsizeof-pointer-div @gol
313 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
314 -Wstack-protector  -Wstack-usage=@var{len}  -Wstrict-aliasing @gol
315 -Wstrict-aliasing=n  -Wstrict-overflow  -Wstrict-overflow=@var{n} @gol
316 -Wstringop-overflow=@var{n} @gol
317 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
318 -Wsuggest-final-types @gol  -Wsuggest-final-methods  -Wsuggest-override @gol
319 -Wmissing-format-attribute  -Wsubobject-linkage @gol
320 -Wswitch  -Wswitch-bool  -Wswitch-default  -Wswitch-enum @gol
321 -Wswitch-unreachable  -Wsync-nand @gol
322 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
323 -Wtype-limits  -Wundef @gol
324 -Wuninitialized  -Wunknown-pragmas  -Wunsafe-loop-optimizations @gol
325 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
326 -Wunused-label  -Wunused-local-typedefs  -Wunused-macros @gol
327 -Wunused-parameter  -Wno-unused-result @gol
328 -Wunused-value  -Wunused-variable @gol
329 -Wunused-const-variable  -Wunused-const-variable=@var{n} @gol
330 -Wunused-but-set-parameter  -Wunused-but-set-variable @gol
331 -Wuseless-cast  -Wvariadic-macros  -Wvector-operation-performance @gol
332 -Wvla  -Wvla-larger-than=@var{n}  -Wvolatile-register-var  -Wwrite-strings @gol
333 -Wzero-as-null-pointer-constant  -Whsa}
335 @item C and Objective-C-only Warning Options
336 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
337 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
338 -Wold-style-declaration  -Wold-style-definition @gol
339 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
340 -Wdeclaration-after-statement  -Wpointer-sign}
342 @item Debugging Options
343 @xref{Debugging Options,,Options for Debugging Your Program}.
344 @gccoptlist{-g  -g@var{level}  -gcoff  -gdwarf  -gdwarf-@var{version} @gol
345 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
346 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
347 -gcolumn-info  -gno-column-info @gol
348 -gvms  -gxcoff  -gxcoff+  -gz@r{[}=@var{type}@r{]} @gol
349 -fdebug-prefix-map=@var{old}=@var{new}  -fdebug-types-section @gol
350 -fno-eliminate-unused-debug-types @gol
351 -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
352 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
353 -feliminate-unused-debug-symbols  -femit-class-debug-always @gol
354 -fno-merge-debug-strings  -fno-dwarf2-cfi-asm @gol
355 -fvar-tracking  -fvar-tracking-assignments}
357 @item Optimization Options
358 @xref{Optimize Options,,Options that Control Optimization}.
359 @gccoptlist{-faggressive-loop-optimizations  -falign-functions[=@var{n}] @gol
360 -falign-jumps[=@var{n}] @gol
361 -falign-labels[=@var{n}]  -falign-loops[=@var{n}] @gol
362 -fassociative-math  -fauto-profile  -fauto-profile[=@var{path}] @gol
363 -fauto-inc-dec  -fbranch-probabilities @gol
364 -fbranch-target-load-optimize  -fbranch-target-load-optimize2 @gol
365 -fbtr-bb-exclusive  -fcaller-saves @gol
366 -fcombine-stack-adjustments  -fconserve-stack @gol
367 -fcompare-elim  -fcprop-registers  -fcrossjumping @gol
368 -fcse-follow-jumps  -fcse-skip-blocks  -fcx-fortran-rules @gol
369 -fcx-limited-range @gol
370 -fdata-sections  -fdce  -fdelayed-branch @gol
371 -fdelete-null-pointer-checks  -fdevirtualize  -fdevirtualize-speculatively @gol
372 -fdevirtualize-at-ltrans  -fdse @gol
373 -fearly-inlining  -fipa-sra  -fexpensive-optimizations  -ffat-lto-objects @gol
374 -ffast-math  -ffinite-math-only  -ffloat-store  -fexcess-precision=@var{style} @gol
375 -fforward-propagate  -ffp-contract=@var{style}  -ffunction-sections @gol
376 -fgcse  -fgcse-after-reload  -fgcse-las  -fgcse-lm  -fgraphite-identity @gol
377 -fgcse-sm  -fhoist-adjacent-loads  -fif-conversion @gol
378 -fif-conversion2  -findirect-inlining @gol
379 -finline-functions  -finline-functions-called-once  -finline-limit=@var{n} @gol
380 -finline-small-functions  -fipa-cp  -fipa-cp-clone @gol
381 -fipa-bit-cp -fipa-vrp @gol
382 -fipa-pta  -fipa-profile  -fipa-pure-const  -fipa-reference  -fipa-icf @gol
383 -fira-algorithm=@var{algorithm} @gol
384 -fira-region=@var{region}  -fira-hoist-pressure @gol
385 -fira-loop-pressure  -fno-ira-share-save-slots @gol
386 -fno-ira-share-spill-slots @gol
387 -fisolate-erroneous-paths-dereference  -fisolate-erroneous-paths-attribute @gol
388 -fivopts  -fkeep-inline-functions  -fkeep-static-functions @gol
389 -fkeep-static-consts  -flimit-function-alignment  -flive-range-shrinkage @gol
390 -floop-block  -floop-interchange  -floop-strip-mine @gol
391 -floop-unroll-and-jam  -floop-nest-optimize @gol
392 -floop-parallelize-all  -flra-remat  -flto  -flto-compression-level @gol
393 -flto-partition=@var{alg}  -fmerge-all-constants @gol
394 -fmerge-constants  -fmodulo-sched  -fmodulo-sched-allow-regmoves @gol
395 -fmove-loop-invariants  -fno-branch-count-reg @gol
396 -fno-defer-pop  -fno-fp-int-builtin-inexact  -fno-function-cse @gol
397 -fno-guess-branch-probability  -fno-inline  -fno-math-errno  -fno-peephole @gol
398 -fno-peephole2  -fno-printf-return-value  -fno-sched-interblock @gol
399 -fno-sched-spec  -fno-signed-zeros @gol
400 -fno-toplevel-reorder  -fno-trapping-math  -fno-zero-initialized-in-bss @gol
401 -fomit-frame-pointer  -foptimize-sibling-calls @gol
402 -fpartial-inlining  -fpeel-loops  -fpredictive-commoning @gol
403 -fprefetch-loop-arrays @gol
404 -fprofile-correction @gol
405 -fprofile-use  -fprofile-use=@var{path}  -fprofile-values @gol
406 -fprofile-reorder-functions @gol
407 -freciprocal-math  -free  -frename-registers  -freorder-blocks @gol
408 -freorder-blocks-algorithm=@var{algorithm} @gol
409 -freorder-blocks-and-partition  -freorder-functions @gol
410 -frerun-cse-after-loop  -freschedule-modulo-scheduled-loops @gol
411 -frounding-math  -fsched2-use-superblocks  -fsched-pressure @gol
412 -fsched-spec-load  -fsched-spec-load-dangerous @gol
413 -fsched-stalled-insns-dep[=@var{n}]  -fsched-stalled-insns[=@var{n}] @gol
414 -fsched-group-heuristic  -fsched-critical-path-heuristic @gol
415 -fsched-spec-insn-heuristic  -fsched-rank-heuristic @gol
416 -fsched-last-insn-heuristic  -fsched-dep-count-heuristic @gol
417 -fschedule-fusion @gol
418 -fschedule-insns  -fschedule-insns2  -fsection-anchors @gol
419 -fselective-scheduling  -fselective-scheduling2 @gol
420 -fsel-sched-pipelining  -fsel-sched-pipelining-outer-loops @gol
421 -fsemantic-interposition  -fshrink-wrap  -fshrink-wrap-separate @gol
422 -fsignaling-nans @gol
423 -fsingle-precision-constant  -fsplit-ivs-in-unroller  -fsplit-loops@gol
424 -fsplit-paths @gol
425 -fsplit-wide-types  -fssa-backprop  -fssa-phiopt @gol
426 -fstdarg-opt  -fstore-merging  -fstrict-aliasing @gol
427 -fthread-jumps  -ftracer  -ftree-bit-ccp @gol
428 -ftree-builtin-call-dce  -ftree-ccp  -ftree-ch @gol
429 -ftree-coalesce-vars  -ftree-copy-prop  -ftree-dce  -ftree-dominator-opts @gol
430 -ftree-dse  -ftree-forwprop  -ftree-fre  -fcode-hoisting @gol
431 -ftree-loop-if-convert  -ftree-loop-im @gol
432 -ftree-phiprop  -ftree-loop-distribution  -ftree-loop-distribute-patterns @gol
433 -ftree-loop-ivcanon  -ftree-loop-linear  -ftree-loop-optimize @gol
434 -ftree-loop-vectorize @gol
435 -ftree-parallelize-loops=@var{n}  -ftree-pre  -ftree-partial-pre  -ftree-pta @gol
436 -ftree-reassoc  -ftree-sink  -ftree-slsr  -ftree-sra @gol
437 -ftree-switch-conversion  -ftree-tail-merge @gol
438 -ftree-ter  -ftree-vectorize  -ftree-vrp  -funconstrained-commons @gol
439 -funit-at-a-time  -funroll-all-loops  -funroll-loops @gol
440 -funsafe-math-optimizations  -funswitch-loops @gol
441 -fipa-ra  -fvariable-expansion-in-unroller  -fvect-cost-model  -fvpt @gol
442 -fweb  -fwhole-program  -fwpa  -fuse-linker-plugin @gol
443 --param @var{name}=@var{value}
444 -O  -O0  -O1  -O2  -O3  -Os  -Ofast  -Og}
446 @item Program Instrumentation Options
447 @xref{Instrumentation Options,,Program Instrumentation Options}.
448 @gccoptlist{-p  -pg  -fprofile-arcs  --coverage  -ftest-coverage @gol
449 -fprofile-abs-path @gol
450 -fprofile-dir=@var{path}  -fprofile-generate  -fprofile-generate=@var{path} @gol
451 -fsanitize=@var{style}  -fsanitize-recover  -fsanitize-recover=@var{style} @gol
452 -fasan-shadow-offset=@var{number}  -fsanitize-sections=@var{s1},@var{s2},... @gol
453 -fsanitize-undefined-trap-on-error  -fbounds-check @gol
454 -fcheck-pointer-bounds  -fchkp-check-incomplete-type @gol
455 -fchkp-first-field-has-own-bounds  -fchkp-narrow-bounds @gol
456 -fchkp-narrow-to-innermost-array  -fchkp-optimize @gol
457 -fchkp-use-fast-string-functions  -fchkp-use-nochk-string-functions @gol
458 -fchkp-use-static-bounds  -fchkp-use-static-const-bounds @gol
459 -fchkp-treat-zero-dynamic-size-as-infinite  -fchkp-check-read @gol
460 -fchkp-check-read  -fchkp-check-write  -fchkp-store-bounds @gol
461 -fchkp-instrument-calls  -fchkp-instrument-marked-only @gol
462 -fchkp-use-wrappers  -fchkp-flexible-struct-trailing-arrays@gol
463 -fstack-protector  -fstack-protector-all  -fstack-protector-strong @gol
464 -fstack-protector-explicit  -fstack-check @gol
465 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
466 -fno-stack-limit  -fsplit-stack @gol
467 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
468 -fvtv-counts  -fvtv-debug @gol
469 -finstrument-functions @gol
470 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
471 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}}
473 @item Preprocessor Options
474 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
475 @gccoptlist{-A@var{question}=@var{answer} @gol
476 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
477 -C  -CC  -D@var{macro}@r{[}=@var{defn}@r{]} @gol
478 -dD  -dI  -dM  -dN  -dU @gol
479 -fdebug-cpp  -fdirectives-only  -fdollars-in-identifiers  @gol
480 -fexec-charset=@var{charset}  -fextended-identifiers  @gol
481 -finput-charset=@var{charset}  -fno-canonical-system-headers @gol
482 -fpch-deps  -fpch-preprocess  -fpreprocessed @gol
483 -ftabstop=@var{width}  -ftrack-macro-expansion  @gol
484 -fwide-exec-charset=@var{charset}  -fworking-directory @gol
485 -H  -imacros @var{file}  -include @var{file} @gol
486 -M  -MD  -MF  -MG  -MM  -MMD  -MP  -MQ  -MT @gol
487 -no-integrated-cpp  -P  -pthread  -remap @gol
488 -traditional  -traditional-cpp  -trigraphs @gol
489 -U@var{macro}  -undef  @gol
490 -Wp,@var{option}  -Xpreprocessor @var{option}}
492 @item Assembler Options
493 @xref{Assembler Options,,Passing Options to the Assembler}.
494 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
496 @item Linker Options
497 @xref{Link Options,,Options for Linking}.
498 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker}  -l@var{library} @gol
499 -nostartfiles  -nodefaultlibs  -nostdlib  -pie  -pthread  -rdynamic @gol
500 -s  -static  -static-libgcc  -static-libstdc++ @gol
501 -static-libasan  -static-libtsan  -static-liblsan  -static-libubsan @gol
502 -static-libmpx  -static-libmpxwrappers @gol
503 -shared  -shared-libgcc  -symbolic @gol
504 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
505 -u @var{symbol}  -z @var{keyword}}
507 @item Directory Options
508 @xref{Directory Options,,Options for Directory Search}.
509 @gccoptlist{-B@var{prefix}  -I@var{dir}  -I- @gol
510 -idirafter @var{dir} @gol
511 -imacros @var{file}  -imultilib @var{dir} @gol
512 -iplugindir=@var{dir}  -iprefix @var{file} @gol
513 -iquote @var{dir}  -isysroot @var{dir}  -isystem @var{dir} @gol
514 -iwithprefix @var{dir}  -iwithprefixbefore @var{dir}  @gol
515 -L@var{dir}  -no-canonical-prefixes  --no-sysroot-suffix @gol
516 -nostdinc  -nostdinc++  --sysroot=@var{dir}}
518 @item Code Generation Options
519 @xref{Code Gen Options,,Options for Code Generation Conventions}.
520 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
521 -ffixed-@var{reg}  -fexceptions @gol
522 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
523 -fasynchronous-unwind-tables @gol
524 -fno-gnu-unique @gol
525 -finhibit-size-directive  -fno-common  -fno-ident @gol
526 -fpcc-struct-return  -fpic  -fPIC  -fpie  -fPIE  -fno-plt @gol
527 -fno-jump-tables @gol
528 -frecord-gcc-switches @gol
529 -freg-struct-return  -fshort-enums  -fshort-wchar @gol
530 -fverbose-asm  -fpack-struct[=@var{n}]  @gol
531 -fleading-underscore  -ftls-model=@var{model} @gol
532 -fstack-reuse=@var{reuse_level} @gol
533 -ftrampolines  -ftrapv  -fwrapv @gol
534 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
535 -fstrict-volatile-bitfields  -fsync-libcalls}
537 @item Developer Options
538 @xref{Developer Options,,GCC Developer Options}.
539 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
540 -dumpfullversion  -fchecking  -fchecking=@var{n}  -fdbg-cnt-list @gol
541 -fdbg-cnt=@var{counter-value-list} @gol
542 -fdisable-ipa-@var{pass_name} @gol
543 -fdisable-rtl-@var{pass_name} @gol
544 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
545 -fdisable-tree-@var{pass_name} @gol
546 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
547 -fdump-noaddr  -fdump-unnumbered  -fdump-unnumbered-links @gol
548 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
549 -fdump-final-insns@r{[}=@var{file}@r{]}
550 -fdump-ipa-all  -fdump-ipa-cgraph  -fdump-ipa-inline @gol
551 -fdump-lang-all @gol
552 -fdump-lang-@var{switch} @gol
553 -fdump-lang-@var{switch}-@var{options} @gol
554 -fdump-lang-@var{switch}-@var{options}=@var{filename} @gol
555 -fdump-passes @gol
556 -fdump-rtl-@var{pass}  -fdump-rtl-@var{pass}=@var{filename} @gol
557 -fdump-statistics @gol
558 -fdump-tree-all @gol
559 -fdump-tree-@var{switch} @gol
560 -fdump-tree-@var{switch}-@var{options} @gol
561 -fdump-tree-@var{switch}-@var{options}=@var{filename} @gol
562 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
563 -fenable-@var{kind}-@var{pass} @gol
564 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
565 -fira-verbose=@var{n} @gol
566 -flto-report  -flto-report-wpa  -fmem-report-wpa @gol
567 -fmem-report  -fpre-ipa-mem-report  -fpost-ipa-mem-report @gol
568 -fopt-info  -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
569 -fprofile-report @gol
570 -frandom-seed=@var{string}  -fsched-verbose=@var{n} @gol
571 -fsel-sched-verbose  -fsel-sched-dump-cfg  -fsel-sched-pipelining-verbose @gol
572 -fstats  -fstack-usage  -ftime-report  -ftime-report-details @gol
573 -fvar-tracking-assignments-toggle  -gtoggle @gol
574 -print-file-name=@var{library}  -print-libgcc-file-name @gol
575 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
576 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
577 -print-sysroot  -print-sysroot-headers-suffix @gol
578 -save-temps  -save-temps=cwd  -save-temps=obj  -time@r{[}=@var{file}@r{]}}
580 @item Machine-Dependent Options
581 @xref{Submodel Options,,Machine-Dependent Options}.
582 @c This list is ordered alphanumerically by subsection name.
583 @c Try and put the significant identifier (CPU or system) first,
584 @c so users have a clue at guessing where the ones they want will be.
586 @emph{AArch64 Options}
587 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
588 -mgeneral-regs-only @gol
589 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
590 -mstrict-align @gol
591 -momit-leaf-frame-pointer @gol
592 -mtls-dialect=desc  -mtls-dialect=traditional @gol
593 -mtls-size=@var{size} @gol
594 -mfix-cortex-a53-835769  -mfix-cortex-a53-843419 @gol
595 -mlow-precision-recip-sqrt  -mlow-precision-sqrt  -mlow-precision-div @gol
596 -mpc-relative-literal-loads @gol
597 -msign-return-address=@var{scope} @gol
598 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}  -moverride=@var{string}}
600 @emph{Adapteva Epiphany Options}
601 @gccoptlist{-mhalf-reg-file  -mprefer-short-insn-regs @gol
602 -mbranch-cost=@var{num}  -mcmove  -mnops=@var{num}  -msoft-cmpsf @gol
603 -msplit-lohi  -mpost-inc  -mpost-modify  -mstack-offset=@var{num} @gol
604 -mround-nearest  -mlong-calls  -mshort-calls  -msmall16 @gol
605 -mfp-mode=@var{mode}  -mvect-double  -max-vect-align=@var{num} @gol
606 -msplit-vecmove-early  -m1reg-@var{reg}}
608 @emph{ARC Options}
609 @gccoptlist{-mbarrel-shifter @gol
610 -mcpu=@var{cpu}  -mA6  -mARC600  -mA7  -mARC700 @gol
611 -mdpfp  -mdpfp-compact  -mdpfp-fast  -mno-dpfp-lrsr @gol
612 -mea  -mno-mpy  -mmul32x16  -mmul64  -matomic @gol
613 -mnorm  -mspfp  -mspfp-compact  -mspfp-fast  -msimd  -msoft-float  -mswap @gol
614 -mcrc  -mdsp-packa  -mdvbf  -mlock  -mmac-d16  -mmac-24  -mrtsc  -mswape @gol
615 -mtelephony  -mxy  -misize  -mannotate-align  -marclinux  -marclinux_prof @gol
616 -mlong-calls  -mmedium-calls  -msdata -mirq-ctrl-saved @gol
617 -mrgf-banked-regs -mlpc-width=@var{width} -G @var{num} @gol
618 -mvolatile-cache  -mtp-regno=@var{regno} @gol
619 -malign-call  -mauto-modify-reg  -mbbit-peephole  -mno-brcc @gol
620 -mcase-vector-pcrel  -mcompact-casesi  -mno-cond-exec  -mearly-cbranchsi @gol
621 -mexpand-adddi  -mindexed-loads  -mlra  -mlra-priority-none @gol
622 -mlra-priority-compact mlra-priority-noncompact  -mno-millicode @gol
623 -mmixed-code  -mq-class  -mRcq  -mRcw  -msize-level=@var{level} @gol
624 -mtune=@var{cpu}  -mmultcost=@var{num} @gol
625 -munalign-prob-threshold=@var{probability}  -mmpy-option=@var{multo} @gol
626 -mdiv-rem  -mcode-density  -mll64  -mfpu=@var{fpu}}
628 @emph{ARM Options}
629 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
630 -mabi=@var{name} @gol
631 -mapcs-stack-check  -mno-apcs-stack-check @gol
632 -mapcs-reentrant  -mno-apcs-reentrant @gol
633 -msched-prolog  -mno-sched-prolog @gol
634 -mlittle-endian  -mbig-endian @gol
635 -mbe8 -mbe32 @gol
636 -mfloat-abi=@var{name} @gol
637 -mfp16-format=@var{name}
638 -mthumb-interwork  -mno-thumb-interwork @gol
639 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
640 -mtune=@var{name}  -mprint-tune-info @gol
641 -mstructure-size-boundary=@var{n} @gol
642 -mabort-on-noreturn @gol
643 -mlong-calls  -mno-long-calls @gol
644 -msingle-pic-base  -mno-single-pic-base @gol
645 -mpic-register=@var{reg} @gol
646 -mnop-fun-dllimport @gol
647 -mpoke-function-name @gol
648 -mthumb  -marm @gol
649 -mtpcs-frame  -mtpcs-leaf-frame @gol
650 -mcaller-super-interworking  -mcallee-super-interworking @gol
651 -mtp=@var{name}  -mtls-dialect=@var{dialect} @gol
652 -mword-relocations @gol
653 -mfix-cortex-m3-ldrd @gol
654 -munaligned-access @gol
655 -mneon-for-64bits @gol
656 -mslow-flash-data @gol
657 -masm-syntax-unified @gol
658 -mrestrict-it @gol
659 -mpure-code @gol
660 -mcmse}
662 @emph{AVR Options}
663 @gccoptlist{-mmcu=@var{mcu}  -mabsdata  -maccumulate-args @gol
664 -mbranch-cost=@var{cost} @gol
665 -mcall-prologues  -mgas-isr-prologues  -mint8 @gol
666 -mn_flash=@var{size}  -mno-interrupts @gol
667 -mrelax  -mrmw  -mstrict-X  -mtiny-stack  -mfract-convert-truncate @gol
668 -mshort-calls  -nodevicelib @gol
669 -Waddr-space-convert  -Wmisspelled-isr}
671 @emph{Blackfin Options}
672 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
673 -msim  -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
674 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
675 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
676 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
677 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
678 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
679 -mfast-fp  -minline-plt  -mmulticore  -mcorea  -mcoreb  -msdram @gol
680 -micplb}
682 @emph{C6X Options}
683 @gccoptlist{-mbig-endian  -mlittle-endian  -march=@var{cpu} @gol
684 -msim  -msdata=@var{sdata-type}}
686 @emph{CRIS Options}
687 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
688 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
689 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
690 -mstack-align  -mdata-align  -mconst-align @gol
691 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
692 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
693 -mmul-bug-workaround  -mno-mul-bug-workaround}
695 @emph{CR16 Options}
696 @gccoptlist{-mmac @gol
697 -mcr16cplus  -mcr16c @gol
698 -msim  -mint32  -mbit-ops
699 -mdata-model=@var{model}}
701 @emph{Darwin Options}
702 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
703 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
704 -client_name  -compatibility_version  -current_version @gol
705 -dead_strip @gol
706 -dependency-file  -dylib_file  -dylinker_install_name @gol
707 -dynamic  -dynamiclib  -exported_symbols_list @gol
708 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
709 -force_flat_namespace  -headerpad_max_install_names @gol
710 -iframework @gol
711 -image_base  -init  -install_name  -keep_private_externs @gol
712 -multi_module  -multiply_defined  -multiply_defined_unused @gol
713 -noall_load   -no_dead_strip_inits_and_terms @gol
714 -nofixprebinding  -nomultidefs  -noprebind  -noseglinkedit @gol
715 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
716 -private_bundle  -read_only_relocs  -sectalign @gol
717 -sectobjectsymbols  -whyload  -seg1addr @gol
718 -sectcreate  -sectobjectsymbols  -sectorder @gol
719 -segaddr  -segs_read_only_addr  -segs_read_write_addr @gol
720 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
721 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
722 -single_module  -static  -sub_library  -sub_umbrella @gol
723 -twolevel_namespace  -umbrella  -undefined @gol
724 -unexported_symbols_list  -weak_reference_mismatches @gol
725 -whatsloaded  -F  -gused  -gfull  -mmacosx-version-min=@var{version} @gol
726 -mkernel  -mone-byte-bool}
728 @emph{DEC Alpha Options}
729 @gccoptlist{-mno-fp-regs  -msoft-float @gol
730 -mieee  -mieee-with-inexact  -mieee-conformant @gol
731 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
732 -mtrap-precision=@var{mode}  -mbuild-constants @gol
733 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
734 -mbwx  -mmax  -mfix  -mcix @gol
735 -mfloat-vax  -mfloat-ieee @gol
736 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
737 -msmall-text  -mlarge-text @gol
738 -mmemory-latency=@var{time}}
740 @emph{FR30 Options}
741 @gccoptlist{-msmall-model  -mno-lsim}
743 @emph{FT32 Options}
744 @gccoptlist{-msim  -mlra  -mnodiv}
746 @emph{FRV Options}
747 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
748 -mhard-float  -msoft-float @gol
749 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
750 -mdouble  -mno-double @gol
751 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
752 -mfdpic  -minline-plt  -mgprel-ro  -multilib-library-pic @gol
753 -mlinked-fp  -mlong-calls  -malign-labels @gol
754 -mlibrary-pic  -macc-4  -macc-8 @gol
755 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
756 -moptimize-membar  -mno-optimize-membar @gol
757 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
758 -mvliw-branch  -mno-vliw-branch @gol
759 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
760 -mno-nested-cond-exec  -mtomcat-stats @gol
761 -mTLS  -mtls @gol
762 -mcpu=@var{cpu}}
764 @emph{GNU/Linux Options}
765 @gccoptlist{-mglibc  -muclibc  -mmusl  -mbionic  -mandroid @gol
766 -tno-android-cc  -tno-android-ld}
768 @emph{H8/300 Options}
769 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr  -mno-exr  -mint32  -malign-300}
771 @emph{HPPA Options}
772 @gccoptlist{-march=@var{architecture-type} @gol
773 -mcaller-copies  -mdisable-fpregs  -mdisable-indexing @gol
774 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
775 -mfixed-range=@var{register-range} @gol
776 -mjump-in-delay  -mlinker-opt  -mlong-calls @gol
777 -mlong-load-store  -mno-disable-fpregs @gol
778 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
779 -mno-jump-in-delay  -mno-long-load-store @gol
780 -mno-portable-runtime  -mno-soft-float @gol
781 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
782 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
783 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
784 -munix=@var{unix-std}  -nolibdld  -static  -threads}
786 @emph{IA-64 Options}
787 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
788 -mvolatile-asm-stop  -mregister-names  -msdata  -mno-sdata @gol
789 -mconstant-gp  -mauto-pic  -mfused-madd @gol
790 -minline-float-divide-min-latency @gol
791 -minline-float-divide-max-throughput @gol
792 -mno-inline-float-divide @gol
793 -minline-int-divide-min-latency @gol
794 -minline-int-divide-max-throughput  @gol
795 -mno-inline-int-divide @gol
796 -minline-sqrt-min-latency  -minline-sqrt-max-throughput @gol
797 -mno-inline-sqrt @gol
798 -mdwarf2-asm  -mearly-stop-bits @gol
799 -mfixed-range=@var{register-range}  -mtls-size=@var{tls-size} @gol
800 -mtune=@var{cpu-type}  -milp32  -mlp64 @gol
801 -msched-br-data-spec  -msched-ar-data-spec  -msched-control-spec @gol
802 -msched-br-in-data-spec  -msched-ar-in-data-spec  -msched-in-control-spec @gol
803 -msched-spec-ldc  -msched-spec-control-ldc @gol
804 -msched-prefer-non-data-spec-insns  -msched-prefer-non-control-spec-insns @gol
805 -msched-stop-bits-after-every-cycle  -msched-count-spec-in-critical-path @gol
806 -msel-sched-dont-check-control-spec  -msched-fp-mem-deps-zero-cost @gol
807 -msched-max-memory-insns-hard-limit  -msched-max-memory-insns=@var{max-insns}}
809 @emph{LM32 Options}
810 @gccoptlist{-mbarrel-shift-enabled  -mdivide-enabled  -mmultiply-enabled @gol
811 -msign-extend-enabled  -muser-enabled}
813 @emph{M32R/D Options}
814 @gccoptlist{-m32r2  -m32rx  -m32r @gol
815 -mdebug @gol
816 -malign-loops  -mno-align-loops @gol
817 -missue-rate=@var{number} @gol
818 -mbranch-cost=@var{number} @gol
819 -mmodel=@var{code-size-model-type} @gol
820 -msdata=@var{sdata-type} @gol
821 -mno-flush-func  -mflush-func=@var{name} @gol
822 -mno-flush-trap  -mflush-trap=@var{number} @gol
823 -G @var{num}}
825 @emph{M32C Options}
826 @gccoptlist{-mcpu=@var{cpu}  -msim  -memregs=@var{number}}
828 @emph{M680x0 Options}
829 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
830 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
831 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
832 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
833 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
834 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
835 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
836 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
837 -mxgot  -mno-xgot  -mlong-jump-table-offsets}
839 @emph{MCore Options}
840 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
841 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
842 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
843 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
844 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
846 @emph{MeP Options}
847 @gccoptlist{-mabsdiff  -mall-opts  -maverage  -mbased=@var{n}  -mbitops @gol
848 -mc=@var{n}  -mclip  -mconfig=@var{name}  -mcop  -mcop32  -mcop64  -mivc2 @gol
849 -mdc  -mdiv  -meb  -mel  -mio-volatile  -ml  -mleadz  -mm  -mminmax @gol
850 -mmult  -mno-opts  -mrepeat  -ms  -msatur  -msdram  -msim  -msimnovec  -mtf @gol
851 -mtiny=@var{n}}
853 @emph{MicroBlaze Options}
854 @gccoptlist{-msoft-float  -mhard-float  -msmall-divides  -mcpu=@var{cpu} @gol
855 -mmemcpy  -mxl-soft-mul  -mxl-soft-div  -mxl-barrel-shift @gol
856 -mxl-pattern-compare  -mxl-stack-check  -mxl-gp-opt  -mno-clearbss @gol
857 -mxl-multiply-high  -mxl-float-convert  -mxl-float-sqrt @gol
858 -mbig-endian  -mlittle-endian  -mxl-reorder  -mxl-mode-@var{app-model}}
860 @emph{MIPS Options}
861 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
862 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
863 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
864 -mips16  -mno-mips16  -mflip-mips16 @gol
865 -minterlink-compressed  -mno-interlink-compressed @gol
866 -minterlink-mips16  -mno-interlink-mips16 @gol
867 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
868 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
869 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
870 -mno-float  -msingle-float  -mdouble-float @gol
871 -modd-spreg  -mno-odd-spreg @gol
872 -mabs=@var{mode}  -mnan=@var{encoding} @gol
873 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
874 -mmcu  -mmno-mcu @gol
875 -meva  -mno-eva @gol
876 -mvirt  -mno-virt @gol
877 -mxpa  -mno-xpa @gol
878 -mmicromips  -mno-micromips @gol
879 -mmsa  -mno-msa @gol
880 -mfpu=@var{fpu-type} @gol
881 -msmartmips  -mno-smartmips @gol
882 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
883 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
884 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
885 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
886 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
887 -membedded-data  -mno-embedded-data @gol
888 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
889 -mcode-readable=@var{setting} @gol
890 -msplit-addresses  -mno-split-addresses @gol
891 -mexplicit-relocs  -mno-explicit-relocs @gol
892 -mcheck-zero-division  -mno-check-zero-division @gol
893 -mdivide-traps  -mdivide-breaks @gol
894 -mload-store-pairs  -mno-load-store-pairs @gol
895 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
896 -mmad  -mno-mad  -mimadd  -mno-imadd  -mfused-madd  -mno-fused-madd  -nocpp @gol
897 -mfix-24k  -mno-fix-24k @gol
898 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
899 -mfix-r10000  -mno-fix-r10000  -mfix-rm7000  -mno-fix-rm7000 @gol
900 -mfix-vr4120  -mno-fix-vr4120 @gol
901 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
902 -mflush-func=@var{func}  -mno-flush-func @gol
903 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
904 -mcompact-branches=@var{policy} @gol
905 -mfp-exceptions  -mno-fp-exceptions @gol
906 -mvr4130-align  -mno-vr4130-align  -msynci  -mno-synci @gol
907 -mlxc1-sxc1 -mno-lxc1-sxc1 -mmadd4 -mno-madd4 @gol
908 -mrelax-pic-calls  -mno-relax-pic-calls  -mmcount-ra-address @gol
909 -mframe-header-opt  -mno-frame-header-opt}
911 @emph{MMIX Options}
912 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
913 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
914 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
915 -mno-base-addresses  -msingle-exit  -mno-single-exit}
917 @emph{MN10300 Options}
918 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
919 -mno-am33  -mam33  -mam33-2  -mam34 @gol
920 -mtune=@var{cpu-type} @gol
921 -mreturn-pointer-on-d0 @gol
922 -mno-crt0  -mrelax  -mliw  -msetlb}
924 @emph{Moxie Options}
925 @gccoptlist{-meb  -mel  -mmul.x  -mno-crt0}
927 @emph{MSP430 Options}
928 @gccoptlist{-msim  -masm-hex  -mmcu=  -mcpu=  -mlarge  -msmall  -mrelax @gol
929 -mwarn-mcu @gol
930 -mcode-region=  -mdata-region= @gol
931 -msilicon-errata=  -msilicon-errata-warn= @gol
932 -mhwmult=  -minrt}
934 @emph{NDS32 Options}
935 @gccoptlist{-mbig-endian  -mlittle-endian @gol
936 -mreduced-regs  -mfull-regs @gol
937 -mcmov  -mno-cmov @gol
938 -mperf-ext  -mno-perf-ext @gol
939 -mv3push  -mno-v3push @gol
940 -m16bit  -mno-16bit @gol
941 -misr-vector-size=@var{num} @gol
942 -mcache-block-size=@var{num} @gol
943 -march=@var{arch} @gol
944 -mcmodel=@var{code-model} @gol
945 -mctor-dtor  -mrelax}
947 @emph{Nios II Options}
948 @gccoptlist{-G @var{num}  -mgpopt=@var{option}  -mgpopt  -mno-gpopt @gol
949 -mel  -meb @gol
950 -mno-bypass-cache  -mbypass-cache @gol
951 -mno-cache-volatile  -mcache-volatile @gol
952 -mno-fast-sw-div  -mfast-sw-div @gol
953 -mhw-mul  -mno-hw-mul  -mhw-mulx  -mno-hw-mulx  -mno-hw-div  -mhw-div @gol
954 -mcustom-@var{insn}=@var{N}  -mno-custom-@var{insn} @gol
955 -mcustom-fpu-cfg=@var{name} @gol
956 -mhal  -msmallc  -msys-crt0=@var{name}  -msys-lib=@var{name} @gol
957 -march=@var{arch}  -mbmx  -mno-bmx  -mcdx  -mno-cdx}
959 @emph{Nvidia PTX Options}
960 @gccoptlist{-m32  -m64  -mmainkernel  -moptimize}
962 @emph{PDP-11 Options}
963 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
964 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
965 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
966 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
967 -mbranch-expensive  -mbranch-cheap @gol
968 -munix-asm  -mdec-asm}
970 @emph{picoChip Options}
971 @gccoptlist{-mae=@var{ae_type}  -mvliw-lookahead=@var{N} @gol
972 -msymbol-as-address  -mno-inefficient-warnings}
974 @emph{PowerPC Options}
975 See RS/6000 and PowerPC Options.
977 @emph{RISC-V Options}
978 @gccoptlist{-mbranch-cost=@var{N-instruction} @gol
979 -mmemcpy  -mno-memcpy @gol
980 -mplt  -mno-plt @gol
981 -mabi=@var{ABI-string} @gol
982 -mfdiv  -mno-fdiv @gol
983 -mdiv  -mno-div @gol
984 -march=@var{ISA-string} @gol
985 -mtune=@var{processor-string} @gol
986 -msmall-data-limit=@var{N-bytes} @gol
987 -msave-restore  -mno-save-restore @gol
988 -mstrict-align -mno-strict-align @gol
989 -mcmodel=@var{code-model} @gol
990 -mexplicit-relocs  -mno-explicit-relocs @gol}
992 @emph{RL78 Options}
993 @gccoptlist{-msim  -mmul=none  -mmul=g13  -mmul=g14  -mallregs @gol
994 -mcpu=g10  -mcpu=g13  -mcpu=g14  -mg10  -mg13  -mg14 @gol
995 -m64bit-doubles  -m32bit-doubles  -msave-mduc-in-interrupts}
997 @emph{RS/6000 and PowerPC Options}
998 @gccoptlist{-mcpu=@var{cpu-type} @gol
999 -mtune=@var{cpu-type} @gol
1000 -mcmodel=@var{code-model} @gol
1001 -mpowerpc64 @gol
1002 -maltivec  -mno-altivec @gol
1003 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
1004 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
1005 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mpopcntd  -mno-popcntd @gol
1006 -mfprnd  -mno-fprnd @gol
1007 -mcmpb  -mno-cmpb  -mmfpgpr  -mno-mfpgpr  -mhard-dfp  -mno-hard-dfp @gol
1008 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
1009 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
1010 -malign-power  -malign-natural @gol
1011 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
1012 -msingle-float  -mdouble-float  -msimple-fpu @gol
1013 -mstring  -mno-string  -mupdate  -mno-update @gol
1014 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
1015 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
1016 -mstrict-align  -mno-strict-align  -mrelocatable @gol
1017 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
1018 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
1019 -mdynamic-no-pic  -maltivec  -mswdiv  -msingle-pic-base @gol
1020 -mprioritize-restricted-insns=@var{priority} @gol
1021 -msched-costly-dep=@var{dependence_type} @gol
1022 -minsert-sched-nops=@var{scheme} @gol
1023 -mcall-sysv  -mcall-netbsd @gol
1024 -maix-struct-return  -msvr4-struct-return @gol
1025 -mabi=@var{abi-type}  -msecure-plt  -mbss-plt @gol
1026 -mblock-move-inline-limit=@var{num} @gol
1027 -misel  -mno-isel @gol
1028 -misel=yes  -misel=no @gol
1029 -mspe  -mno-spe @gol
1030 -mspe=yes  -mspe=no @gol
1031 -mpaired @gol
1032 -mvrsave  -mno-vrsave @gol
1033 -mmulhw  -mno-mulhw @gol
1034 -mdlmzb  -mno-dlmzb @gol
1035 -mfloat-gprs=yes  -mfloat-gprs=no  -mfloat-gprs=single  -mfloat-gprs=double @gol
1036 -mprototype  -mno-prototype @gol
1037 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
1038 -msdata=@var{opt}  -mvxworks  -G @var{num} @gol
1039 -mrecip  -mrecip=@var{opt}  -mno-recip  -mrecip-precision @gol
1040 -mno-recip-precision @gol
1041 -mveclibabi=@var{type}  -mfriz  -mno-friz @gol
1042 -mpointers-to-nested-functions  -mno-pointers-to-nested-functions @gol
1043 -msave-toc-indirect  -mno-save-toc-indirect @gol
1044 -mpower8-fusion  -mno-mpower8-fusion  -mpower8-vector  -mno-power8-vector @gol
1045 -mcrypto  -mno-crypto  -mhtm  -mno-htm  -mdirect-move  -mno-direct-move @gol
1046 -mquad-memory  -mno-quad-memory @gol
1047 -mquad-memory-atomic  -mno-quad-memory-atomic @gol
1048 -mcompat-align-parm  -mno-compat-align-parm @gol
1049 -mfloat128  -mno-float128  -mfloat128-hardware  -mno-float128-hardware @gol
1050 -mgnu-attribute  -mno-gnu-attribute @gol
1051 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
1052 -mstack-protector-guard-offset=@var{offset}}
1054 @emph{RX Options}
1055 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
1056 -mcpu=@gol
1057 -mbig-endian-data  -mlittle-endian-data @gol
1058 -msmall-data @gol
1059 -msim  -mno-sim@gol
1060 -mas100-syntax  -mno-as100-syntax@gol
1061 -mrelax@gol
1062 -mmax-constant-size=@gol
1063 -mint-register=@gol
1064 -mpid@gol
1065 -mallow-string-insns  -mno-allow-string-insns@gol
1066 -mjsr@gol
1067 -mno-warn-multiple-fast-interrupts@gol
1068 -msave-acc-in-interrupts}
1070 @emph{S/390 and zSeries Options}
1071 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1072 -mhard-float  -msoft-float  -mhard-dfp  -mno-hard-dfp @gol
1073 -mlong-double-64  -mlong-double-128 @gol
1074 -mbackchain  -mno-backchain  -mpacked-stack  -mno-packed-stack @gol
1075 -msmall-exec  -mno-small-exec  -mmvcle  -mno-mvcle @gol
1076 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
1077 -mhtm  -mvx  -mzvector @gol
1078 -mtpf-trace  -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
1079 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size  -mstack-guard @gol
1080 -mhotpatch=@var{halfwords},@var{halfwords}}
1082 @emph{Score Options}
1083 @gccoptlist{-meb  -mel @gol
1084 -mnhwloop @gol
1085 -muls @gol
1086 -mmac @gol
1087 -mscore5  -mscore5u  -mscore7  -mscore7d}
1089 @emph{SH Options}
1090 @gccoptlist{-m1  -m2  -m2e @gol
1091 -m2a-nofpu  -m2a-single-only  -m2a-single  -m2a @gol
1092 -m3  -m3e @gol
1093 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
1094 -m4a-nofpu  -m4a-single-only  -m4a-single  -m4a  -m4al @gol
1095 -mb  -ml  -mdalign  -mrelax @gol
1096 -mbigtable  -mfmovd  -mrenesas  -mno-renesas  -mnomacsave @gol
1097 -mieee  -mno-ieee  -mbitops  -misize  -minline-ic_invalidate  -mpadstruct @gol
1098 -mprefergot  -musermode  -multcost=@var{number}  -mdiv=@var{strategy} @gol
1099 -mdivsi3_libfunc=@var{name}  -mfixed-range=@var{register-range} @gol
1100 -maccumulate-outgoing-args @gol
1101 -matomic-model=@var{atomic-model} @gol
1102 -mbranch-cost=@var{num}  -mzdcbranch  -mno-zdcbranch @gol
1103 -mcbranch-force-delay-slot @gol
1104 -mfused-madd  -mno-fused-madd  -mfsca  -mno-fsca  -mfsrra  -mno-fsrra @gol
1105 -mpretend-cmove  -mtas}
1107 @emph{Solaris 2 Options}
1108 @gccoptlist{-mclear-hwcap  -mno-clear-hwcap  -mimpure-text  -mno-impure-text @gol
1109 -pthreads}
1111 @emph{SPARC Options}
1112 @gccoptlist{-mcpu=@var{cpu-type} @gol
1113 -mtune=@var{cpu-type} @gol
1114 -mcmodel=@var{code-model} @gol
1115 -mmemory-model=@var{mem-model} @gol
1116 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1117 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1118 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1119 -mhard-quad-float  -msoft-quad-float @gol
1120 -mstack-bias  -mno-stack-bias @gol
1121 -mstd-struct-return  -mno-std-struct-return @gol
1122 -munaligned-doubles  -mno-unaligned-doubles @gol
1123 -muser-mode  -mno-user-mode @gol
1124 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1125 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1126 -mvis4 -mno-vis4 -mvis4b -mno-vis4b @gol
1127 -mcbcond  -mno-cbcond  -mfmaf  -mno-fmaf  -mfsmuld  -mno-fsmuld  @gol
1128 -mpopc  -mno-popc  -msubxc  -mno-subxc @gol
1129 -mfix-at697f  -mfix-ut699  -mfix-ut700  -mfix-gr712rc @gol
1130 -mlra  -mno-lra}
1132 @emph{SPU Options}
1133 @gccoptlist{-mwarn-reloc  -merror-reloc @gol
1134 -msafe-dma  -munsafe-dma @gol
1135 -mbranch-hints @gol
1136 -msmall-mem  -mlarge-mem  -mstdmain @gol
1137 -mfixed-range=@var{register-range} @gol
1138 -mea32  -mea64 @gol
1139 -maddress-space-conversion  -mno-address-space-conversion @gol
1140 -mcache-size=@var{cache-size} @gol
1141 -matomic-updates  -mno-atomic-updates}
1143 @emph{System V Options}
1144 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1146 @emph{TILE-Gx Options}
1147 @gccoptlist{-mcpu=CPU  -m32  -m64  -mbig-endian  -mlittle-endian @gol
1148 -mcmodel=@var{code-model}}
1150 @emph{TILEPro Options}
1151 @gccoptlist{-mcpu=@var{cpu}  -m32}
1153 @emph{V850 Options}
1154 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1155 -mprolog-function  -mno-prolog-function  -mspace @gol
1156 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1157 -mapp-regs  -mno-app-regs @gol
1158 -mdisable-callt  -mno-disable-callt @gol
1159 -mv850e2v3  -mv850e2  -mv850e1  -mv850es @gol
1160 -mv850e  -mv850  -mv850e3v5 @gol
1161 -mloop @gol
1162 -mrelax @gol
1163 -mlong-jumps @gol
1164 -msoft-float @gol
1165 -mhard-float @gol
1166 -mgcc-abi @gol
1167 -mrh850-abi @gol
1168 -mbig-switch}
1170 @emph{VAX Options}
1171 @gccoptlist{-mg  -mgnu  -munix}
1173 @emph{Visium Options}
1174 @gccoptlist{-mdebug  -msim  -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1175 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type}  -msv-mode  -muser-mode}
1177 @emph{VMS Options}
1178 @gccoptlist{-mvms-return-codes  -mdebug-main=@var{prefix}  -mmalloc64 @gol
1179 -mpointer-size=@var{size}}
1181 @emph{VxWorks Options}
1182 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1183 -Xbind-lazy  -Xbind-now}
1185 @emph{x86 Options}
1186 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1187 -mtune-ctrl=@var{feature-list}  -mdump-tune-features  -mno-default @gol
1188 -mfpmath=@var{unit} @gol
1189 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1190 -mno-fp-ret-in-387  -m80387  -mhard-float  -msoft-float @gol
1191 -mno-wide-multiply  -mrtd  -malign-double @gol
1192 -mpreferred-stack-boundary=@var{num} @gol
1193 -mincoming-stack-boundary=@var{num} @gol
1194 -mcld  -mcx16  -msahf  -mmovbe  -mcrc32 @gol
1195 -mrecip  -mrecip=@var{opt} @gol
1196 -mvzeroupper  -mprefer-avx128 @gol
1197 -mmmx  -msse  -msse2  -msse3  -mssse3  -msse4.1  -msse4.2  -msse4  -mavx @gol
1198 -mavx2  -mavx512f  -mavx512pf  -mavx512er  -mavx512cd  -mavx512vl @gol
1199 -mavx512bw  -mavx512dq  -mavx512ifma  -mavx512vbmi  -msha  -maes @gol
1200 -mpclmul  -mfsgsbase  -mrdrnd  -mf16c  -mfma @gol
1201 -mprefetchwt1  -mclflushopt  -mxsavec  -mxsaves @gol
1202 -msse4a  -m3dnow  -m3dnowa  -mpopcnt  -mabm  -mbmi  -mtbm  -mfma4  -mxop @gol
1203 -mlzcnt  -mbmi2  -mfxsr  -mxsave  -mxsaveopt  -mrtm  -mlwp  -mmpx  @gol
1204 -mmwaitx  -mclzero  -mpku  -mthreads @gol
1205 -mms-bitfields  -mno-align-stringops  -minline-all-stringops @gol
1206 -minline-stringops-dynamically  -mstringop-strategy=@var{alg} @gol
1207 -mmemcpy-strategy=@var{strategy}  -mmemset-strategy=@var{strategy} @gol
1208 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1209 -m96bit-long-double  -mlong-double-64  -mlong-double-80  -mlong-double-128 @gol
1210 -mregparm=@var{num}  -msseregparm @gol
1211 -mveclibabi=@var{type}  -mvect8-ret-in-mem @gol
1212 -mpc32  -mpc64  -mpc80  -mstackrealign @gol
1213 -momit-leaf-frame-pointer  -mno-red-zone  -mno-tls-direct-seg-refs @gol
1214 -mcmodel=@var{code-model}  -mabi=@var{name}  -maddress-mode=@var{mode} @gol
1215 -m32  -m64  -mx32  -m16  -miamcu  -mlarge-data-threshold=@var{num} @gol
1216 -msse2avx  -mfentry  -mrecord-mcount  -mnop-mcount  -m8bit-idiv @gol
1217 -mavx256-split-unaligned-load  -mavx256-split-unaligned-store @gol
1218 -malign-data=@var{type}  -mstack-protector-guard=@var{guard} @gol
1219 -mstack-protector-guard-reg=@var{reg} @gol
1220 -mstack-protector-guard-offset=@var{offset} @gol
1221 -mstack-protector-guard-symbol=@var{symbol} -mmitigate-rop @gol
1222 -mgeneral-regs-only  -mcall-ms2sysv-xlogues}
1224 @emph{x86 Windows Options}
1225 @gccoptlist{-mconsole  -mcygwin  -mno-cygwin  -mdll @gol
1226 -mnop-fun-dllimport  -mthread @gol
1227 -municode  -mwin32  -mwindows  -fno-set-stack-executable}
1229 @emph{Xstormy16 Options}
1230 @gccoptlist{-msim}
1232 @emph{Xtensa Options}
1233 @gccoptlist{-mconst16  -mno-const16 @gol
1234 -mfused-madd  -mno-fused-madd @gol
1235 -mforce-no-pic @gol
1236 -mserialize-volatile  -mno-serialize-volatile @gol
1237 -mtext-section-literals  -mno-text-section-literals @gol
1238 -mauto-litpools  -mno-auto-litpools @gol
1239 -mtarget-align  -mno-target-align @gol
1240 -mlongcalls  -mno-longcalls}
1242 @emph{zSeries Options}
1243 See S/390 and zSeries Options.
1244 @end table
1247 @node Overall Options
1248 @section Options Controlling the Kind of Output
1250 Compilation can involve up to four stages: preprocessing, compilation
1251 proper, assembly and linking, always in that order.  GCC is capable of
1252 preprocessing and compiling several files either into several
1253 assembler input files, or into one assembler input file; then each
1254 assembler input file produces an object file, and linking combines all
1255 the object files (those newly compiled, and those specified as input)
1256 into an executable file.
1258 @cindex file name suffix
1259 For any given input file, the file name suffix determines what kind of
1260 compilation is done:
1262 @table @gcctabopt
1263 @item @var{file}.c
1264 C source code that must be preprocessed.
1266 @item @var{file}.i
1267 C source code that should not be preprocessed.
1269 @item @var{file}.ii
1270 C++ source code that should not be preprocessed.
1272 @item @var{file}.m
1273 Objective-C source code.  Note that you must link with the @file{libobjc}
1274 library to make an Objective-C program work.
1276 @item @var{file}.mi
1277 Objective-C source code that should not be preprocessed.
1279 @item @var{file}.mm
1280 @itemx @var{file}.M
1281 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1282 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1283 to a literal capital M@.
1285 @item @var{file}.mii
1286 Objective-C++ source code that should not be preprocessed.
1288 @item @var{file}.h
1289 C, C++, Objective-C or Objective-C++ header file to be turned into a
1290 precompiled header (default), or C, C++ header file to be turned into an
1291 Ada spec (via the @option{-fdump-ada-spec} switch).
1293 @item @var{file}.cc
1294 @itemx @var{file}.cp
1295 @itemx @var{file}.cxx
1296 @itemx @var{file}.cpp
1297 @itemx @var{file}.CPP
1298 @itemx @var{file}.c++
1299 @itemx @var{file}.C
1300 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1301 the last two letters must both be literally @samp{x}.  Likewise,
1302 @samp{.C} refers to a literal capital C@.
1304 @item @var{file}.mm
1305 @itemx @var{file}.M
1306 Objective-C++ source code that must be preprocessed.
1308 @item @var{file}.mii
1309 Objective-C++ source code that should not be preprocessed.
1311 @item @var{file}.hh
1312 @itemx @var{file}.H
1313 @itemx @var{file}.hp
1314 @itemx @var{file}.hxx
1315 @itemx @var{file}.hpp
1316 @itemx @var{file}.HPP
1317 @itemx @var{file}.h++
1318 @itemx @var{file}.tcc
1319 C++ header file to be turned into a precompiled header or Ada spec.
1321 @item @var{file}.f
1322 @itemx @var{file}.for
1323 @itemx @var{file}.ftn
1324 Fixed form Fortran source code that should not be preprocessed.
1326 @item @var{file}.F
1327 @itemx @var{file}.FOR
1328 @itemx @var{file}.fpp
1329 @itemx @var{file}.FPP
1330 @itemx @var{file}.FTN
1331 Fixed form Fortran source code that must be preprocessed (with the traditional
1332 preprocessor).
1334 @item @var{file}.f90
1335 @itemx @var{file}.f95
1336 @itemx @var{file}.f03
1337 @itemx @var{file}.f08
1338 Free form Fortran source code that should not be preprocessed.
1340 @item @var{file}.F90
1341 @itemx @var{file}.F95
1342 @itemx @var{file}.F03
1343 @itemx @var{file}.F08
1344 Free form Fortran source code that must be preprocessed (with the
1345 traditional preprocessor).
1347 @item @var{file}.go
1348 Go source code.
1350 @item @var{file}.brig
1351 BRIG files (binary representation of HSAIL).
1353 @item @var{file}.ads
1354 Ada source code file that contains a library unit declaration (a
1355 declaration of a package, subprogram, or generic, or a generic
1356 instantiation), or a library unit renaming declaration (a package,
1357 generic, or subprogram renaming declaration).  Such files are also
1358 called @dfn{specs}.
1360 @item @var{file}.adb
1361 Ada source code file containing a library unit body (a subprogram or
1362 package body).  Such files are also called @dfn{bodies}.
1364 @c GCC also knows about some suffixes for languages not yet included:
1365 @c Pascal:
1366 @c @var{file}.p
1367 @c @var{file}.pas
1368 @c Ratfor:
1369 @c @var{file}.r
1371 @item @var{file}.s
1372 Assembler code.
1374 @item @var{file}.S
1375 @itemx @var{file}.sx
1376 Assembler code that must be preprocessed.
1378 @item @var{other}
1379 An object file to be fed straight into linking.
1380 Any file name with no recognized suffix is treated this way.
1381 @end table
1383 @opindex x
1384 You can specify the input language explicitly with the @option{-x} option:
1386 @table @gcctabopt
1387 @item -x @var{language}
1388 Specify explicitly the @var{language} for the following input files
1389 (rather than letting the compiler choose a default based on the file
1390 name suffix).  This option applies to all following input files until
1391 the next @option{-x} option.  Possible values for @var{language} are:
1392 @smallexample
1393 c  c-header  cpp-output
1394 c++  c++-header  c++-cpp-output
1395 objective-c  objective-c-header  objective-c-cpp-output
1396 objective-c++ objective-c++-header objective-c++-cpp-output
1397 assembler  assembler-with-cpp
1399 f77  f77-cpp-input f95  f95-cpp-input
1401 brig
1402 @end smallexample
1404 @item -x none
1405 Turn off any specification of a language, so that subsequent files are
1406 handled according to their file name suffixes (as they are if @option{-x}
1407 has not been used at all).
1408 @end table
1410 If you only want some of the stages of compilation, you can use
1411 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1412 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1413 @command{gcc} is to stop.  Note that some combinations (for example,
1414 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1416 @table @gcctabopt
1417 @item -c
1418 @opindex c
1419 Compile or assemble the source files, but do not link.  The linking
1420 stage simply is not done.  The ultimate output is in the form of an
1421 object file for each source file.
1423 By default, the object file name for a source file is made by replacing
1424 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1426 Unrecognized input files, not requiring compilation or assembly, are
1427 ignored.
1429 @item -S
1430 @opindex S
1431 Stop after the stage of compilation proper; do not assemble.  The output
1432 is in the form of an assembler code file for each non-assembler input
1433 file specified.
1435 By default, the assembler file name for a source file is made by
1436 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1438 Input files that don't require compilation are ignored.
1440 @item -E
1441 @opindex E
1442 Stop after the preprocessing stage; do not run the compiler proper.  The
1443 output is in the form of preprocessed source code, which is sent to the
1444 standard output.
1446 Input files that don't require preprocessing are ignored.
1448 @cindex output file option
1449 @item -o @var{file}
1450 @opindex o
1451 Place output in file @var{file}.  This applies to whatever
1452 sort of output is being produced, whether it be an executable file,
1453 an object file, an assembler file or preprocessed C code.
1455 If @option{-o} is not specified, the default is to put an executable
1456 file in @file{a.out}, the object file for
1457 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1458 assembler file in @file{@var{source}.s}, a precompiled header file in
1459 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1460 standard output.
1462 @item -v
1463 @opindex v
1464 Print (on standard error output) the commands executed to run the stages
1465 of compilation.  Also print the version number of the compiler driver
1466 program and of the preprocessor and the compiler proper.
1468 @item -###
1469 @opindex ###
1470 Like @option{-v} except the commands are not executed and arguments
1471 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1472 This is useful for shell scripts to capture the driver-generated command lines.
1474 @item --help
1475 @opindex help
1476 Print (on the standard output) a description of the command-line options
1477 understood by @command{gcc}.  If the @option{-v} option is also specified
1478 then @option{--help} is also passed on to the various processes
1479 invoked by @command{gcc}, so that they can display the command-line options
1480 they accept.  If the @option{-Wextra} option has also been specified
1481 (prior to the @option{--help} option), then command-line options that
1482 have no documentation associated with them are also displayed.
1484 @item --target-help
1485 @opindex target-help
1486 Print (on the standard output) a description of target-specific command-line
1487 options for each tool.  For some targets extra target-specific
1488 information may also be printed.
1490 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1491 Print (on the standard output) a description of the command-line
1492 options understood by the compiler that fit into all specified classes
1493 and qualifiers.  These are the supported classes:
1495 @table @asis
1496 @item @samp{optimizers}
1497 Display all of the optimization options supported by the
1498 compiler.
1500 @item @samp{warnings}
1501 Display all of the options controlling warning messages
1502 produced by the compiler.
1504 @item @samp{target}
1505 Display target-specific options.  Unlike the
1506 @option{--target-help} option however, target-specific options of the
1507 linker and assembler are not displayed.  This is because those
1508 tools do not currently support the extended @option{--help=} syntax.
1510 @item @samp{params}
1511 Display the values recognized by the @option{--param}
1512 option.
1514 @item @var{language}
1515 Display the options supported for @var{language}, where
1516 @var{language} is the name of one of the languages supported in this
1517 version of GCC@.
1519 @item @samp{common}
1520 Display the options that are common to all languages.
1521 @end table
1523 These are the supported qualifiers:
1525 @table @asis
1526 @item @samp{undocumented}
1527 Display only those options that are undocumented.
1529 @item @samp{joined}
1530 Display options taking an argument that appears after an equal
1531 sign in the same continuous piece of text, such as:
1532 @samp{--help=target}.
1534 @item @samp{separate}
1535 Display options taking an argument that appears as a separate word
1536 following the original option, such as: @samp{-o output-file}.
1537 @end table
1539 Thus for example to display all the undocumented target-specific
1540 switches supported by the compiler, use:
1542 @smallexample
1543 --help=target,undocumented
1544 @end smallexample
1546 The sense of a qualifier can be inverted by prefixing it with the
1547 @samp{^} character, so for example to display all binary warning
1548 options (i.e., ones that are either on or off and that do not take an
1549 argument) that have a description, use:
1551 @smallexample
1552 --help=warnings,^joined,^undocumented
1553 @end smallexample
1555 The argument to @option{--help=} should not consist solely of inverted
1556 qualifiers.
1558 Combining several classes is possible, although this usually
1559 restricts the output so much that there is nothing to display.  One
1560 case where it does work, however, is when one of the classes is
1561 @var{target}.  For example, to display all the target-specific
1562 optimization options, use:
1564 @smallexample
1565 --help=target,optimizers
1566 @end smallexample
1568 The @option{--help=} option can be repeated on the command line.  Each
1569 successive use displays its requested class of options, skipping
1570 those that have already been displayed.
1572 If the @option{-Q} option appears on the command line before the
1573 @option{--help=} option, then the descriptive text displayed by
1574 @option{--help=} is changed.  Instead of describing the displayed
1575 options, an indication is given as to whether the option is enabled,
1576 disabled or set to a specific value (assuming that the compiler
1577 knows this at the point where the @option{--help=} option is used).
1579 Here is a truncated example from the ARM port of @command{gcc}:
1581 @smallexample
1582   % gcc -Q -mabi=2 --help=target -c
1583   The following options are target specific:
1584   -mabi=                                2
1585   -mabort-on-noreturn                   [disabled]
1586   -mapcs                                [disabled]
1587 @end smallexample
1589 The output is sensitive to the effects of previous command-line
1590 options, so for example it is possible to find out which optimizations
1591 are enabled at @option{-O2} by using:
1593 @smallexample
1594 -Q -O2 --help=optimizers
1595 @end smallexample
1597 Alternatively you can discover which binary optimizations are enabled
1598 by @option{-O3} by using:
1600 @smallexample
1601 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1602 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1603 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1604 @end smallexample
1606 @item --version
1607 @opindex version
1608 Display the version number and copyrights of the invoked GCC@.
1610 @item -pass-exit-codes
1611 @opindex pass-exit-codes
1612 Normally the @command{gcc} program exits with the code of 1 if any
1613 phase of the compiler returns a non-success return code.  If you specify
1614 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1615 the numerically highest error produced by any phase returning an error
1616 indication.  The C, C++, and Fortran front ends return 4 if an internal
1617 compiler error is encountered.
1619 @item -pipe
1620 @opindex pipe
1621 Use pipes rather than temporary files for communication between the
1622 various stages of compilation.  This fails to work on some systems where
1623 the assembler is unable to read from a pipe; but the GNU assembler has
1624 no trouble.
1626 @item -specs=@var{file}
1627 @opindex specs
1628 Process @var{file} after the compiler reads in the standard @file{specs}
1629 file, in order to override the defaults which the @command{gcc} driver
1630 program uses when determining what switches to pass to @command{cc1},
1631 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
1632 @option{-specs=@var{file}} can be specified on the command line, and they
1633 are processed in order, from left to right.  @xref{Spec Files}, for
1634 information about the format of the @var{file}.
1636 @item -wrapper
1637 @opindex wrapper
1638 Invoke all subcommands under a wrapper program.  The name of the
1639 wrapper program and its parameters are passed as a comma separated
1640 list.
1642 @smallexample
1643 gcc -c t.c -wrapper gdb,--args
1644 @end smallexample
1646 @noindent
1647 This invokes all subprograms of @command{gcc} under
1648 @samp{gdb --args}, thus the invocation of @command{cc1} is
1649 @samp{gdb --args cc1 @dots{}}.
1651 @item -fplugin=@var{name}.so
1652 @opindex fplugin
1653 Load the plugin code in file @var{name}.so, assumed to be a
1654 shared object to be dlopen'd by the compiler.  The base name of
1655 the shared object file is used to identify the plugin for the
1656 purposes of argument parsing (See
1657 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1658 Each plugin should define the callback functions specified in the
1659 Plugins API.
1661 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1662 @opindex fplugin-arg
1663 Define an argument called @var{key} with a value of @var{value}
1664 for the plugin called @var{name}.
1666 @item -fdump-ada-spec@r{[}-slim@r{]}
1667 @opindex fdump-ada-spec
1668 For C and C++ source and include files, generate corresponding Ada specs.
1669 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1670 GNAT User's Guide}, which provides detailed documentation on this feature.
1672 @item -fada-spec-parent=@var{unit}
1673 @opindex fada-spec-parent
1674 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1675 Ada specs as child units of parent @var{unit}.
1677 @item -fdump-go-spec=@var{file}
1678 @opindex fdump-go-spec
1679 For input files in any language, generate corresponding Go
1680 declarations in @var{file}.  This generates Go @code{const},
1681 @code{type}, @code{var}, and @code{func} declarations which may be a
1682 useful way to start writing a Go interface to code written in some
1683 other language.
1685 @include @value{srcdir}/../libiberty/at-file.texi
1686 @end table
1688 @node Invoking G++
1689 @section Compiling C++ Programs
1691 @cindex suffixes for C++ source
1692 @cindex C++ source file suffixes
1693 C++ source files conventionally use one of the suffixes @samp{.C},
1694 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1695 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1696 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1697 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1698 files with these names and compiles them as C++ programs even if you
1699 call the compiler the same way as for compiling C programs (usually
1700 with the name @command{gcc}).
1702 @findex g++
1703 @findex c++
1704 However, the use of @command{gcc} does not add the C++ library.
1705 @command{g++} is a program that calls GCC and automatically specifies linking
1706 against the C++ library.  It treats @samp{.c},
1707 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1708 files unless @option{-x} is used.  This program is also useful when
1709 precompiling a C header file with a @samp{.h} extension for use in C++
1710 compilations.  On many systems, @command{g++} is also installed with
1711 the name @command{c++}.
1713 @cindex invoking @command{g++}
1714 When you compile C++ programs, you may specify many of the same
1715 command-line options that you use for compiling programs in any
1716 language; or command-line options meaningful for C and related
1717 languages; or options that are meaningful only for C++ programs.
1718 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1719 explanations of options for languages related to C@.
1720 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1721 explanations of options that are meaningful only for C++ programs.
1723 @node C Dialect Options
1724 @section Options Controlling C Dialect
1725 @cindex dialect options
1726 @cindex language dialect options
1727 @cindex options, dialect
1729 The following options control the dialect of C (or languages derived
1730 from C, such as C++, Objective-C and Objective-C++) that the compiler
1731 accepts:
1733 @table @gcctabopt
1734 @cindex ANSI support
1735 @cindex ISO support
1736 @item -ansi
1737 @opindex ansi
1738 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1739 equivalent to @option{-std=c++98}.
1741 This turns off certain features of GCC that are incompatible with ISO
1742 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1743 such as the @code{asm} and @code{typeof} keywords, and
1744 predefined macros such as @code{unix} and @code{vax} that identify the
1745 type of system you are using.  It also enables the undesirable and
1746 rarely used ISO trigraph feature.  For the C compiler,
1747 it disables recognition of C++ style @samp{//} comments as well as
1748 the @code{inline} keyword.
1750 The alternate keywords @code{__asm__}, @code{__extension__},
1751 @code{__inline__} and @code{__typeof__} continue to work despite
1752 @option{-ansi}.  You would not want to use them in an ISO C program, of
1753 course, but it is useful to put them in header files that might be included
1754 in compilations done with @option{-ansi}.  Alternate predefined macros
1755 such as @code{__unix__} and @code{__vax__} are also available, with or
1756 without @option{-ansi}.
1758 The @option{-ansi} option does not cause non-ISO programs to be
1759 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1760 addition to @option{-ansi}.  @xref{Warning Options}.
1762 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1763 option is used.  Some header files may notice this macro and refrain
1764 from declaring certain functions or defining certain macros that the
1765 ISO standard doesn't call for; this is to avoid interfering with any
1766 programs that might use these names for other things.
1768 Functions that are normally built in but do not have semantics
1769 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1770 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1771 built-in functions provided by GCC}, for details of the functions
1772 affected.
1774 @item -std=
1775 @opindex std
1776 Determine the language standard. @xref{Standards,,Language Standards
1777 Supported by GCC}, for details of these standard versions.  This option
1778 is currently only supported when compiling C or C++.
1780 The compiler can accept several base standards, such as @samp{c90} or
1781 @samp{c++98}, and GNU dialects of those standards, such as
1782 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1783 compiler accepts all programs following that standard plus those
1784 using GNU extensions that do not contradict it.  For example,
1785 @option{-std=c90} turns off certain features of GCC that are
1786 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1787 keywords, but not other GNU extensions that do not have a meaning in
1788 ISO C90, such as omitting the middle term of a @code{?:}
1789 expression. On the other hand, when a GNU dialect of a standard is
1790 specified, all features supported by the compiler are enabled, even when
1791 those features change the meaning of the base standard.  As a result, some
1792 strict-conforming programs may be rejected.  The particular standard
1793 is used by @option{-Wpedantic} to identify which features are GNU
1794 extensions given that version of the standard. For example
1795 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1796 comments, while @option{-std=gnu99 -Wpedantic} does not.
1798 A value for this option must be provided; possible values are
1800 @table @samp
1801 @item c90
1802 @itemx c89
1803 @itemx iso9899:1990
1804 Support all ISO C90 programs (certain GNU extensions that conflict
1805 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1807 @item iso9899:199409
1808 ISO C90 as modified in amendment 1.
1810 @item c99
1811 @itemx c9x
1812 @itemx iso9899:1999
1813 @itemx iso9899:199x
1814 ISO C99.  This standard is substantially completely supported, modulo
1815 bugs and floating-point issues
1816 (mainly but not entirely relating to optional C99 features from
1817 Annexes F and G).  See
1818 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1819 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1821 @item c11
1822 @itemx c1x
1823 @itemx iso9899:2011
1824 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1825 substantially completely supported, modulo bugs, floating-point issues
1826 (mainly but not entirely relating to optional C11 features from
1827 Annexes F and G) and the optional Annexes K (Bounds-checking
1828 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1830 @item gnu90
1831 @itemx gnu89
1832 GNU dialect of ISO C90 (including some C99 features).
1834 @item gnu99
1835 @itemx gnu9x
1836 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1838 @item gnu11
1839 @itemx gnu1x
1840 GNU dialect of ISO C11.  This is the default for C code.
1841 The name @samp{gnu1x} is deprecated.
1843 @item c++98
1844 @itemx c++03
1845 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1846 additional defect reports. Same as @option{-ansi} for C++ code.
1848 @item gnu++98
1849 @itemx gnu++03
1850 GNU dialect of @option{-std=c++98}.
1852 @item c++11
1853 @itemx c++0x
1854 The 2011 ISO C++ standard plus amendments.
1855 The name @samp{c++0x} is deprecated.
1857 @item gnu++11
1858 @itemx gnu++0x
1859 GNU dialect of @option{-std=c++11}.
1860 The name @samp{gnu++0x} is deprecated.
1862 @item c++14
1863 @itemx c++1y
1864 The 2014 ISO C++ standard plus amendments.
1865 The name @samp{c++1y} is deprecated.
1867 @item gnu++14
1868 @itemx gnu++1y
1869 GNU dialect of @option{-std=c++14}.
1870 This is the default for C++ code.
1871 The name @samp{gnu++1y} is deprecated.
1873 @item c++1z
1874 The next revision of the ISO C++ standard, tentatively planned for
1875 2017.  Support is highly experimental, and will almost certainly
1876 change in incompatible ways in future releases.
1878 @item gnu++1z
1879 GNU dialect of @option{-std=c++1z}.  Support is highly experimental,
1880 and will almost certainly change in incompatible ways in future
1881 releases.
1882 @end table
1884 @item -fgnu89-inline
1885 @opindex fgnu89-inline
1886 The option @option{-fgnu89-inline} tells GCC to use the traditional
1887 GNU semantics for @code{inline} functions when in C99 mode.
1888 @xref{Inline,,An Inline Function is As Fast As a Macro}.
1889 Using this option is roughly equivalent to adding the
1890 @code{gnu_inline} function attribute to all inline functions
1891 (@pxref{Function Attributes}).
1893 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1894 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1895 specifies the default behavior).
1896 This option is not supported in @option{-std=c90} or
1897 @option{-std=gnu90} mode.
1899 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1900 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1901 in effect for @code{inline} functions.  @xref{Common Predefined
1902 Macros,,,cpp,The C Preprocessor}.
1904 @item -fpermitted-flt-eval-methods=@var{style}
1905 @opindex fpermitted-flt-eval-methods
1906 @opindex fpermitted-flt-eval-methods=c11
1907 @opindex fpermitted-flt-eval-methods=ts-18661-3
1908 ISO/IEC TS 18661-3 defines new permissible values for
1909 @code{FLT_EVAL_METHOD} that indicate that operations and constants with
1910 a semantic type that is an interchange or extended format should be
1911 evaluated to the precision and range of that type.  These new values are
1912 a superset of those permitted under C99/C11, which does not specify the
1913 meaning of other positive values of @code{FLT_EVAL_METHOD}.  As such, code
1914 conforming to C11 may not have been written expecting the possibility of
1915 the new values.
1917 @option{-fpermitted-flt-eval-methods} specifies whether the compiler
1918 should allow only the values of @code{FLT_EVAL_METHOD} specified in C99/C11,
1919 or the extended set of values specified in ISO/IEC TS 18661-3.
1921 @var{style} is either @code{c11} or @code{ts-18661-3} as appropriate.
1923 The default when in a standards compliant mode (@option{-std=c11} or similar)
1924 is @option{-fpermitted-flt-eval-methods=c11}.  The default when in a GNU
1925 dialect (@option{-std=gnu11} or similar) is
1926 @option{-fpermitted-flt-eval-methods=ts-18661-3}.
1928 @item -aux-info @var{filename}
1929 @opindex aux-info
1930 Output to the given filename prototyped declarations for all functions
1931 declared and/or defined in a translation unit, including those in header
1932 files.  This option is silently ignored in any language other than C@.
1934 Besides declarations, the file indicates, in comments, the origin of
1935 each declaration (source file and line), whether the declaration was
1936 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1937 @samp{O} for old, respectively, in the first character after the line
1938 number and the colon), and whether it came from a declaration or a
1939 definition (@samp{C} or @samp{F}, respectively, in the following
1940 character).  In the case of function definitions, a K&R-style list of
1941 arguments followed by their declarations is also provided, inside
1942 comments, after the declaration.
1944 @item -fallow-parameterless-variadic-functions
1945 @opindex fallow-parameterless-variadic-functions
1946 Accept variadic functions without named parameters.
1948 Although it is possible to define such a function, this is not very
1949 useful as it is not possible to read the arguments.  This is only
1950 supported for C as this construct is allowed by C++.
1952 @item -fno-asm
1953 @opindex fno-asm
1954 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1955 keyword, so that code can use these words as identifiers.  You can use
1956 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1957 instead.  @option{-ansi} implies @option{-fno-asm}.
1959 In C++, this switch only affects the @code{typeof} keyword, since
1960 @code{asm} and @code{inline} are standard keywords.  You may want to
1961 use the @option{-fno-gnu-keywords} flag instead, which has the same
1962 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1963 switch only affects the @code{asm} and @code{typeof} keywords, since
1964 @code{inline} is a standard keyword in ISO C99.
1966 @item -fno-builtin
1967 @itemx -fno-builtin-@var{function}
1968 @opindex fno-builtin
1969 @cindex built-in functions
1970 Don't recognize built-in functions that do not begin with
1971 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1972 functions provided by GCC}, for details of the functions affected,
1973 including those which are not built-in functions when @option{-ansi} or
1974 @option{-std} options for strict ISO C conformance are used because they
1975 do not have an ISO standard meaning.
1977 GCC normally generates special code to handle certain built-in functions
1978 more efficiently; for instance, calls to @code{alloca} may become single
1979 instructions which adjust the stack directly, and calls to @code{memcpy}
1980 may become inline copy loops.  The resulting code is often both smaller
1981 and faster, but since the function calls no longer appear as such, you
1982 cannot set a breakpoint on those calls, nor can you change the behavior
1983 of the functions by linking with a different library.  In addition,
1984 when a function is recognized as a built-in function, GCC may use
1985 information about that function to warn about problems with calls to
1986 that function, or to generate more efficient code, even if the
1987 resulting code still contains calls to that function.  For example,
1988 warnings are given with @option{-Wformat} for bad calls to
1989 @code{printf} when @code{printf} is built in and @code{strlen} is
1990 known not to modify global memory.
1992 With the @option{-fno-builtin-@var{function}} option
1993 only the built-in function @var{function} is
1994 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1995 function is named that is not built-in in this version of GCC, this
1996 option is ignored.  There is no corresponding
1997 @option{-fbuiltin-@var{function}} option; if you wish to enable
1998 built-in functions selectively when using @option{-fno-builtin} or
1999 @option{-ffreestanding}, you may define macros such as:
2001 @smallexample
2002 #define abs(n)          __builtin_abs ((n))
2003 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
2004 @end smallexample
2006 @item -fgimple
2007 @opindex fgimple
2009 Enable parsing of function definitions marked with @code{__GIMPLE}.
2010 This is an experimental feature that allows unit testing of GIMPLE
2011 passes.
2013 @item -fhosted
2014 @opindex fhosted
2015 @cindex hosted environment
2017 Assert that compilation targets a hosted environment.  This implies
2018 @option{-fbuiltin}.  A hosted environment is one in which the
2019 entire standard library is available, and in which @code{main} has a return
2020 type of @code{int}.  Examples are nearly everything except a kernel.
2021 This is equivalent to @option{-fno-freestanding}.
2023 @item -ffreestanding
2024 @opindex ffreestanding
2025 @cindex hosted environment
2027 Assert that compilation targets a freestanding environment.  This
2028 implies @option{-fno-builtin}.  A freestanding environment
2029 is one in which the standard library may not exist, and program startup may
2030 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
2031 This is equivalent to @option{-fno-hosted}.
2033 @xref{Standards,,Language Standards Supported by GCC}, for details of
2034 freestanding and hosted environments.
2036 @item -fopenacc
2037 @opindex fopenacc
2038 @cindex OpenACC accelerator programming
2039 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
2040 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
2041 compiler generates accelerated code according to the OpenACC Application
2042 Programming Interface v2.0 @w{@uref{https://www.openacc.org}}.  This option
2043 implies @option{-pthread}, and thus is only supported on targets that
2044 have support for @option{-pthread}.
2046 @item -fopenacc-dim=@var{geom}
2047 @opindex fopenacc-dim
2048 @cindex OpenACC accelerator programming
2049 Specify default compute dimensions for parallel offload regions that do
2050 not explicitly specify.  The @var{geom} value is a triple of
2051 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'.  A size
2052 can be omitted, to use a target-specific default value.
2054 @item -fopenmp
2055 @opindex fopenmp
2056 @cindex OpenMP parallel
2057 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
2058 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
2059 compiler generates parallel code according to the OpenMP Application
2060 Program Interface v4.5 @w{@uref{http://www.openmp.org/}}.  This option
2061 implies @option{-pthread}, and thus is only supported on targets that
2062 have support for @option{-pthread}. @option{-fopenmp} implies
2063 @option{-fopenmp-simd}.
2065 @item -fopenmp-simd
2066 @opindex fopenmp-simd
2067 @cindex OpenMP SIMD
2068 @cindex SIMD
2069 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
2070 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
2071 are ignored.
2073 @item -fcilkplus
2074 @opindex fcilkplus
2075 @cindex Enable Cilk Plus
2076 Enable the usage of Cilk Plus language extension features for C/C++.
2077 When the option @option{-fcilkplus} is specified, enable the usage of
2078 the Cilk Plus Language extension features for C/C++.  The present
2079 implementation follows ABI version 1.2.  This is an experimental
2080 feature that is only partially complete, and whose interface may
2081 change in future versions of GCC as the official specification
2082 changes.  Currently, all features but @code{_Cilk_for} have been
2083 implemented.
2085 @item -fgnu-tm
2086 @opindex fgnu-tm
2087 When the option @option{-fgnu-tm} is specified, the compiler
2088 generates code for the Linux variant of Intel's current Transactional
2089 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
2090 an experimental feature whose interface may change in future versions
2091 of GCC, as the official specification changes.  Please note that not
2092 all architectures are supported for this feature.
2094 For more information on GCC's support for transactional memory,
2095 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
2096 Transactional Memory Library}.
2098 Note that the transactional memory feature is not supported with
2099 non-call exceptions (@option{-fnon-call-exceptions}).
2101 @item -fms-extensions
2102 @opindex fms-extensions
2103 Accept some non-standard constructs used in Microsoft header files.
2105 In C++ code, this allows member names in structures to be similar
2106 to previous types declarations.
2108 @smallexample
2109 typedef int UOW;
2110 struct ABC @{
2111   UOW UOW;
2113 @end smallexample
2115 Some cases of unnamed fields in structures and unions are only
2116 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
2117 fields within structs/unions}, for details.
2119 Note that this option is off for all targets but x86 
2120 targets using ms-abi.
2122 @item -fplan9-extensions
2123 @opindex fplan9-extensions
2124 Accept some non-standard constructs used in Plan 9 code.
2126 This enables @option{-fms-extensions}, permits passing pointers to
2127 structures with anonymous fields to functions that expect pointers to
2128 elements of the type of the field, and permits referring to anonymous
2129 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2130 struct/union fields within structs/unions}, for details.  This is only
2131 supported for C, not C++.
2133 @item -fcond-mismatch
2134 @opindex fcond-mismatch
2135 Allow conditional expressions with mismatched types in the second and
2136 third arguments.  The value of such an expression is void.  This option
2137 is not supported for C++.
2139 @item -flax-vector-conversions
2140 @opindex flax-vector-conversions
2141 Allow implicit conversions between vectors with differing numbers of
2142 elements and/or incompatible element types.  This option should not be
2143 used for new code.
2145 @item -funsigned-char
2146 @opindex funsigned-char
2147 Let the type @code{char} be unsigned, like @code{unsigned char}.
2149 Each kind of machine has a default for what @code{char} should
2150 be.  It is either like @code{unsigned char} by default or like
2151 @code{signed char} by default.
2153 Ideally, a portable program should always use @code{signed char} or
2154 @code{unsigned char} when it depends on the signedness of an object.
2155 But many programs have been written to use plain @code{char} and
2156 expect it to be signed, or expect it to be unsigned, depending on the
2157 machines they were written for.  This option, and its inverse, let you
2158 make such a program work with the opposite default.
2160 The type @code{char} is always a distinct type from each of
2161 @code{signed char} or @code{unsigned char}, even though its behavior
2162 is always just like one of those two.
2164 @item -fsigned-char
2165 @opindex fsigned-char
2166 Let the type @code{char} be signed, like @code{signed char}.
2168 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2169 the negative form of @option{-funsigned-char}.  Likewise, the option
2170 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2172 @item -fsigned-bitfields
2173 @itemx -funsigned-bitfields
2174 @itemx -fno-signed-bitfields
2175 @itemx -fno-unsigned-bitfields
2176 @opindex fsigned-bitfields
2177 @opindex funsigned-bitfields
2178 @opindex fno-signed-bitfields
2179 @opindex fno-unsigned-bitfields
2180 These options control whether a bit-field is signed or unsigned, when the
2181 declaration does not use either @code{signed} or @code{unsigned}.  By
2182 default, such a bit-field is signed, because this is consistent: the
2183 basic integer types such as @code{int} are signed types.
2185 @item -fsso-struct=@var{endianness}
2186 @opindex fsso-struct
2187 Set the default scalar storage order of structures and unions to the
2188 specified endianness.  The accepted values are @samp{big-endian},
2189 @samp{little-endian} and @samp{native} for the native endianness of
2190 the target (the default).  This option is not supported for C++.
2192 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2193 code that is not binary compatible with code generated without it if the
2194 specified endianness is not the native endianness of the target.
2195 @end table
2197 @node C++ Dialect Options
2198 @section Options Controlling C++ Dialect
2200 @cindex compiler options, C++
2201 @cindex C++ options, command-line
2202 @cindex options, C++
2203 This section describes the command-line options that are only meaningful
2204 for C++ programs.  You can also use most of the GNU compiler options
2205 regardless of what language your program is in.  For example, you
2206 might compile a file @file{firstClass.C} like this:
2208 @smallexample
2209 g++ -g -fstrict-enums -O -c firstClass.C
2210 @end smallexample
2212 @noindent
2213 In this example, only @option{-fstrict-enums} is an option meant
2214 only for C++ programs; you can use the other options with any
2215 language supported by GCC@.
2217 Some options for compiling C programs, such as @option{-std}, are also
2218 relevant for C++ programs.
2219 @xref{C Dialect Options,,Options Controlling C Dialect}.
2221 Here is a list of options that are @emph{only} for compiling C++ programs:
2223 @table @gcctabopt
2225 @item -fabi-version=@var{n}
2226 @opindex fabi-version
2227 Use version @var{n} of the C++ ABI@.  The default is version 0.
2229 Version 0 refers to the version conforming most closely to
2230 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2231 will change in different versions of G++ as ABI bugs are fixed.
2233 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2235 Version 2 is the version of the C++ ABI that first appeared in G++
2236 3.4, and was the default through G++ 4.9.
2238 Version 3 corrects an error in mangling a constant address as a
2239 template argument.
2241 Version 4, which first appeared in G++ 4.5, implements a standard
2242 mangling for vector types.
2244 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2245 attribute const/volatile on function pointer types, decltype of a
2246 plain decl, and use of a function parameter in the declaration of
2247 another parameter.
2249 Version 6, which first appeared in G++ 4.7, corrects the promotion
2250 behavior of C++11 scoped enums and the mangling of template argument
2251 packs, const/static_cast, prefix ++ and --, and a class scope function
2252 used as a template argument.
2254 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2255 builtin type and corrects the mangling of lambdas in default argument
2256 scope.
2258 Version 8, which first appeared in G++ 4.9, corrects the substitution
2259 behavior of function types with function-cv-qualifiers.
2261 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2262 @code{nullptr_t}.
2264 Version 10, which first appeared in G++ 6.1, adds mangling of
2265 attributes that affect type identity, such as ia32 calling convention
2266 attributes (e.g. @samp{stdcall}).
2268 Version 11, which first appeared in G++ 7, corrects the mangling of
2269 sizeof... expressions and operator names.  For multiple entities with
2270 the same name within a function, that are declared in different scopes,
2271 the mangling now changes starting with the twelfth occurrence.  It also
2272 implies @option{-fnew-inheriting-ctors}.
2274 See also @option{-Wabi}.
2276 @item -fabi-compat-version=@var{n}
2277 @opindex fabi-compat-version
2278 On targets that support strong aliases, G++
2279 works around mangling changes by creating an alias with the correct
2280 mangled name when defining a symbol with an incorrect mangled name.
2281 This switch specifies which ABI version to use for the alias.
2283 With @option{-fabi-version=0} (the default), this defaults to 8 (GCC 5
2284 compatibility).  If another ABI version is explicitly selected, this
2285 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2286 use @option{-fabi-compat-version=2}.
2288 If this option is not provided but @option{-Wabi=@var{n}} is, that
2289 version is used for compatibility aliases.  If this option is provided
2290 along with @option{-Wabi} (without the version), the version from this
2291 option is used for the warning.
2293 @item -fno-access-control
2294 @opindex fno-access-control
2295 Turn off all access checking.  This switch is mainly useful for working
2296 around bugs in the access control code.
2298 @item -faligned-new
2299 @opindex faligned-new
2300 Enable support for C++17 @code{new} of types that require more
2301 alignment than @code{void* ::operator new(std::size_t)} provides.  A
2302 numeric argument such as @code{-faligned-new=32} can be used to
2303 specify how much alignment (in bytes) is provided by that function,
2304 but few users will need to override the default of
2305 @code{alignof(std::max_align_t)}.
2307 This flag is enabled by default for @option{-std=c++1z}.
2309 @item -fcheck-new
2310 @opindex fcheck-new
2311 Check that the pointer returned by @code{operator new} is non-null
2312 before attempting to modify the storage allocated.  This check is
2313 normally unnecessary because the C++ standard specifies that
2314 @code{operator new} only returns @code{0} if it is declared
2315 @code{throw()}, in which case the compiler always checks the
2316 return value even without this option.  In all other cases, when
2317 @code{operator new} has a non-empty exception specification, memory
2318 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2319 @samp{new (nothrow)}.
2321 @item -fconcepts
2322 @opindex fconcepts
2323 Enable support for the C++ Extensions for Concepts Technical
2324 Specification, ISO 19217 (2015), which allows code like
2326 @smallexample
2327 template <class T> concept bool Addable = requires (T t) @{ t + t; @};
2328 template <Addable T> T add (T a, T b) @{ return a + b; @}
2329 @end smallexample
2331 @item -fconstexpr-depth=@var{n}
2332 @opindex fconstexpr-depth
2333 Set the maximum nested evaluation depth for C++11 constexpr functions
2334 to @var{n}.  A limit is needed to detect endless recursion during
2335 constant expression evaluation.  The minimum specified by the standard
2336 is 512.
2338 @item -fconstexpr-loop-limit=@var{n}
2339 @opindex fconstexpr-loop-limit
2340 Set the maximum number of iterations for a loop in C++14 constexpr functions
2341 to @var{n}.  A limit is needed to detect infinite loops during
2342 constant expression evaluation.  The default is 262144 (1<<18).
2344 @item -fdeduce-init-list
2345 @opindex fdeduce-init-list
2346 Enable deduction of a template type parameter as
2347 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2349 @smallexample
2350 template <class T> auto forward(T t) -> decltype (realfn (t))
2352   return realfn (t);
2355 void f()
2357   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2359 @end smallexample
2361 This deduction was implemented as a possible extension to the
2362 originally proposed semantics for the C++11 standard, but was not part
2363 of the final standard, so it is disabled by default.  This option is
2364 deprecated, and may be removed in a future version of G++.
2366 @item -ffriend-injection
2367 @opindex ffriend-injection
2368 Inject friend functions into the enclosing namespace, so that they are
2369 visible outside the scope of the class in which they are declared.
2370 Friend functions were documented to work this way in the old Annotated
2371 C++ Reference Manual.  
2372 However, in ISO C++ a friend function that is not declared
2373 in an enclosing scope can only be found using argument dependent
2374 lookup.  GCC defaults to the standard behavior.
2376 This option is for compatibility, and may be removed in a future
2377 release of G++.
2379 @item -fno-elide-constructors
2380 @opindex fno-elide-constructors
2381 The C++ standard allows an implementation to omit creating a temporary
2382 that is only used to initialize another object of the same type.
2383 Specifying this option disables that optimization, and forces G++ to
2384 call the copy constructor in all cases.  This option also causes G++
2385 to call trivial member functions which otherwise would be expanded inline.
2387 In C++17, the compiler is required to omit these temporaries, but this
2388 option still affects trivial member functions.
2390 @item -fno-enforce-eh-specs
2391 @opindex fno-enforce-eh-specs
2392 Don't generate code to check for violation of exception specifications
2393 at run time.  This option violates the C++ standard, but may be useful
2394 for reducing code size in production builds, much like defining
2395 @code{NDEBUG}.  This does not give user code permission to throw
2396 exceptions in violation of the exception specifications; the compiler
2397 still optimizes based on the specifications, so throwing an
2398 unexpected exception results in undefined behavior at run time.
2400 @item -fextern-tls-init
2401 @itemx -fno-extern-tls-init
2402 @opindex fextern-tls-init
2403 @opindex fno-extern-tls-init
2404 The C++11 and OpenMP standards allow @code{thread_local} and
2405 @code{threadprivate} variables to have dynamic (runtime)
2406 initialization.  To support this, any use of such a variable goes
2407 through a wrapper function that performs any necessary initialization.
2408 When the use and definition of the variable are in the same
2409 translation unit, this overhead can be optimized away, but when the
2410 use is in a different translation unit there is significant overhead
2411 even if the variable doesn't actually need dynamic initialization.  If
2412 the programmer can be sure that no use of the variable in a
2413 non-defining TU needs to trigger dynamic initialization (either
2414 because the variable is statically initialized, or a use of the
2415 variable in the defining TU will be executed before any uses in
2416 another TU), they can avoid this overhead with the
2417 @option{-fno-extern-tls-init} option.
2419 On targets that support symbol aliases, the default is
2420 @option{-fextern-tls-init}.  On targets that do not support symbol
2421 aliases, the default is @option{-fno-extern-tls-init}.
2423 @item -ffor-scope
2424 @itemx -fno-for-scope
2425 @opindex ffor-scope
2426 @opindex fno-for-scope
2427 If @option{-ffor-scope} is specified, the scope of variables declared in
2428 a @i{for-init-statement} is limited to the @code{for} loop itself,
2429 as specified by the C++ standard.
2430 If @option{-fno-for-scope} is specified, the scope of variables declared in
2431 a @i{for-init-statement} extends to the end of the enclosing scope,
2432 as was the case in old versions of G++, and other (traditional)
2433 implementations of C++.
2435 If neither flag is given, the default is to follow the standard,
2436 but to allow and give a warning for old-style code that would
2437 otherwise be invalid, or have different behavior.
2439 @item -fno-gnu-keywords
2440 @opindex fno-gnu-keywords
2441 Do not recognize @code{typeof} as a keyword, so that code can use this
2442 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2443 This option is implied by the strict ISO C++ dialects: @option{-ansi},
2444 @option{-std=c++98}, @option{-std=c++11}, etc.
2446 @item -fno-implicit-templates
2447 @opindex fno-implicit-templates
2448 Never emit code for non-inline templates that are instantiated
2449 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2450 @xref{Template Instantiation}, for more information.
2452 @item -fno-implicit-inline-templates
2453 @opindex fno-implicit-inline-templates
2454 Don't emit code for implicit instantiations of inline templates, either.
2455 The default is to handle inlines differently so that compiles with and
2456 without optimization need the same set of explicit instantiations.
2458 @item -fno-implement-inlines
2459 @opindex fno-implement-inlines
2460 To save space, do not emit out-of-line copies of inline functions
2461 controlled by @code{#pragma implementation}.  This causes linker
2462 errors if these functions are not inlined everywhere they are called.
2464 @item -fms-extensions
2465 @opindex fms-extensions
2466 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2467 int and getting a pointer to member function via non-standard syntax.
2469 @item -fnew-inheriting-ctors
2470 @opindex fnew-inheriting-ctors
2471 Enable the P0136 adjustment to the semantics of C++11 constructor
2472 inheritance.  This is part of C++17 but also considered to be a Defect
2473 Report against C++11 and C++14.  This flag is enabled by default
2474 unless @option{-fabi-version=10} or lower is specified.
2476 @item -fnew-ttp-matching
2477 @opindex fnew-ttp-matching
2478 Enable the P0522 resolution to Core issue 150, template template
2479 parameters and default arguments: this allows a template with default
2480 template arguments as an argument for a template template parameter
2481 with fewer template parameters.  This flag is enabled by default for
2482 @option{-std=c++1z}.
2484 @item -fno-nonansi-builtins
2485 @opindex fno-nonansi-builtins
2486 Disable built-in declarations of functions that are not mandated by
2487 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2488 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2490 @item -fnothrow-opt
2491 @opindex fnothrow-opt
2492 Treat a @code{throw()} exception specification as if it were a
2493 @code{noexcept} specification to reduce or eliminate the text size
2494 overhead relative to a function with no exception specification.  If
2495 the function has local variables of types with non-trivial
2496 destructors, the exception specification actually makes the
2497 function smaller because the EH cleanups for those variables can be
2498 optimized away.  The semantic effect is that an exception thrown out of
2499 a function with such an exception specification results in a call
2500 to @code{terminate} rather than @code{unexpected}.
2502 @item -fno-operator-names
2503 @opindex fno-operator-names
2504 Do not treat the operator name keywords @code{and}, @code{bitand},
2505 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2506 synonyms as keywords.
2508 @item -fno-optional-diags
2509 @opindex fno-optional-diags
2510 Disable diagnostics that the standard says a compiler does not need to
2511 issue.  Currently, the only such diagnostic issued by G++ is the one for
2512 a name having multiple meanings within a class.
2514 @item -fpermissive
2515 @opindex fpermissive
2516 Downgrade some diagnostics about nonconformant code from errors to
2517 warnings.  Thus, using @option{-fpermissive} allows some
2518 nonconforming code to compile.
2520 @item -fno-pretty-templates
2521 @opindex fno-pretty-templates
2522 When an error message refers to a specialization of a function
2523 template, the compiler normally prints the signature of the
2524 template followed by the template arguments and any typedefs or
2525 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2526 rather than @code{void f(int)}) so that it's clear which template is
2527 involved.  When an error message refers to a specialization of a class
2528 template, the compiler omits any template arguments that match
2529 the default template arguments for that template.  If either of these
2530 behaviors make it harder to understand the error message rather than
2531 easier, you can use @option{-fno-pretty-templates} to disable them.
2533 @item -frepo
2534 @opindex frepo
2535 Enable automatic template instantiation at link time.  This option also
2536 implies @option{-fno-implicit-templates}.  @xref{Template
2537 Instantiation}, for more information.
2539 @item -fno-rtti
2540 @opindex fno-rtti
2541 Disable generation of information about every class with virtual
2542 functions for use by the C++ run-time type identification features
2543 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2544 of the language, you can save some space by using this flag.  Note that
2545 exception handling uses the same information, but G++ generates it as
2546 needed. The @code{dynamic_cast} operator can still be used for casts that
2547 do not require run-time type information, i.e.@: casts to @code{void *} or to
2548 unambiguous base classes.
2550 @item -fsized-deallocation
2551 @opindex fsized-deallocation
2552 Enable the built-in global declarations
2553 @smallexample
2554 void operator delete (void *, std::size_t) noexcept;
2555 void operator delete[] (void *, std::size_t) noexcept;
2556 @end smallexample
2557 as introduced in C++14.  This is useful for user-defined replacement
2558 deallocation functions that, for example, use the size of the object
2559 to make deallocation faster.  Enabled by default under
2560 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2561 warns about places that might want to add a definition.
2563 @item -fstrict-enums
2564 @opindex fstrict-enums
2565 Allow the compiler to optimize using the assumption that a value of
2566 enumerated type can only be one of the values of the enumeration (as
2567 defined in the C++ standard; basically, a value that can be
2568 represented in the minimum number of bits needed to represent all the
2569 enumerators).  This assumption may not be valid if the program uses a
2570 cast to convert an arbitrary integer value to the enumerated type.
2572 @item -fstrong-eval-order
2573 @opindex fstrong-eval-order
2574 Evaluate member access, array subscripting, and shift expressions in
2575 left-to-right order, and evaluate assignment in right-to-left order,
2576 as adopted for C++17.  Enabled by default with @option{-std=c++1z}.
2577 @option{-fstrong-eval-order=some} enables just the ordering of member
2578 access and shift expressions, and is the default without
2579 @option{-std=c++1z}.
2581 @item -ftemplate-backtrace-limit=@var{n}
2582 @opindex ftemplate-backtrace-limit
2583 Set the maximum number of template instantiation notes for a single
2584 warning or error to @var{n}.  The default value is 10.
2586 @item -ftemplate-depth=@var{n}
2587 @opindex ftemplate-depth
2588 Set the maximum instantiation depth for template classes to @var{n}.
2589 A limit on the template instantiation depth is needed to detect
2590 endless recursions during template class instantiation.  ANSI/ISO C++
2591 conforming programs must not rely on a maximum depth greater than 17
2592 (changed to 1024 in C++11).  The default value is 900, as the compiler
2593 can run out of stack space before hitting 1024 in some situations.
2595 @item -fno-threadsafe-statics
2596 @opindex fno-threadsafe-statics
2597 Do not emit the extra code to use the routines specified in the C++
2598 ABI for thread-safe initialization of local statics.  You can use this
2599 option to reduce code size slightly in code that doesn't need to be
2600 thread-safe.
2602 @item -fuse-cxa-atexit
2603 @opindex fuse-cxa-atexit
2604 Register destructors for objects with static storage duration with the
2605 @code{__cxa_atexit} function rather than the @code{atexit} function.
2606 This option is required for fully standards-compliant handling of static
2607 destructors, but only works if your C library supports
2608 @code{__cxa_atexit}.
2610 @item -fno-use-cxa-get-exception-ptr
2611 @opindex fno-use-cxa-get-exception-ptr
2612 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2613 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2614 if the runtime routine is not available.
2616 @item -fvisibility-inlines-hidden
2617 @opindex fvisibility-inlines-hidden
2618 This switch declares that the user does not attempt to compare
2619 pointers to inline functions or methods where the addresses of the two functions
2620 are taken in different shared objects.
2622 The effect of this is that GCC may, effectively, mark inline methods with
2623 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2624 appear in the export table of a DSO and do not require a PLT indirection
2625 when used within the DSO@.  Enabling this option can have a dramatic effect
2626 on load and link times of a DSO as it massively reduces the size of the
2627 dynamic export table when the library makes heavy use of templates.
2629 The behavior of this switch is not quite the same as marking the
2630 methods as hidden directly, because it does not affect static variables
2631 local to the function or cause the compiler to deduce that
2632 the function is defined in only one shared object.
2634 You may mark a method as having a visibility explicitly to negate the
2635 effect of the switch for that method.  For example, if you do want to
2636 compare pointers to a particular inline method, you might mark it as
2637 having default visibility.  Marking the enclosing class with explicit
2638 visibility has no effect.
2640 Explicitly instantiated inline methods are unaffected by this option
2641 as their linkage might otherwise cross a shared library boundary.
2642 @xref{Template Instantiation}.
2644 @item -fvisibility-ms-compat
2645 @opindex fvisibility-ms-compat
2646 This flag attempts to use visibility settings to make GCC's C++
2647 linkage model compatible with that of Microsoft Visual Studio.
2649 The flag makes these changes to GCC's linkage model:
2651 @enumerate
2652 @item
2653 It sets the default visibility to @code{hidden}, like
2654 @option{-fvisibility=hidden}.
2656 @item
2657 Types, but not their members, are not hidden by default.
2659 @item
2660 The One Definition Rule is relaxed for types without explicit
2661 visibility specifications that are defined in more than one
2662 shared object: those declarations are permitted if they are
2663 permitted when this option is not used.
2664 @end enumerate
2666 In new code it is better to use @option{-fvisibility=hidden} and
2667 export those classes that are intended to be externally visible.
2668 Unfortunately it is possible for code to rely, perhaps accidentally,
2669 on the Visual Studio behavior.
2671 Among the consequences of these changes are that static data members
2672 of the same type with the same name but defined in different shared
2673 objects are different, so changing one does not change the other;
2674 and that pointers to function members defined in different shared
2675 objects may not compare equal.  When this flag is given, it is a
2676 violation of the ODR to define types with the same name differently.
2678 @item -fno-weak
2679 @opindex fno-weak
2680 Do not use weak symbol support, even if it is provided by the linker.
2681 By default, G++ uses weak symbols if they are available.  This
2682 option exists only for testing, and should not be used by end-users;
2683 it results in inferior code and has no benefits.  This option may
2684 be removed in a future release of G++.
2686 @item -nostdinc++
2687 @opindex nostdinc++
2688 Do not search for header files in the standard directories specific to
2689 C++, but do still search the other standard directories.  (This option
2690 is used when building the C++ library.)
2691 @end table
2693 In addition, these optimization, warning, and code generation options
2694 have meanings only for C++ programs:
2696 @table @gcctabopt
2697 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2698 @opindex Wabi
2699 @opindex Wno-abi
2700 Warn when G++ it generates code that is probably not compatible with
2701 the vendor-neutral C++ ABI@.  Since G++ now defaults to updating the
2702 ABI with each major release, normally @option{-Wabi} will warn only if
2703 there is a check added later in a release series for an ABI issue
2704 discovered since the initial release.  @option{-Wabi} will warn about
2705 more things if an older ABI version is selected (with
2706 @option{-fabi-version=@var{n}}).
2708 @option{-Wabi} can also be used with an explicit version number to
2709 warn about compatibility with a particular @option{-fabi-version}
2710 level, e.g. @option{-Wabi=2} to warn about changes relative to
2711 @option{-fabi-version=2}.
2713 If an explicit version number is provided and
2714 @option{-fabi-compat-version} is not specified, the version number
2715 from this option is used for compatibility aliases.  If no explicit
2716 version number is provided with this option, but
2717 @option{-fabi-compat-version} is specified, that version number is
2718 used for ABI warnings.
2720 Although an effort has been made to warn about
2721 all such cases, there are probably some cases that are not warned about,
2722 even though G++ is generating incompatible code.  There may also be
2723 cases where warnings are emitted even though the code that is generated
2724 is compatible.
2726 You should rewrite your code to avoid these warnings if you are
2727 concerned about the fact that code generated by G++ may not be binary
2728 compatible with code generated by other compilers.
2730 Known incompatibilities in @option{-fabi-version=2} (which was the
2731 default from GCC 3.4 to 4.9) include:
2733 @itemize @bullet
2735 @item
2736 A template with a non-type template parameter of reference type was
2737 mangled incorrectly:
2738 @smallexample
2739 extern int N;
2740 template <int &> struct S @{@};
2741 void n (S<N>) @{2@}
2742 @end smallexample
2744 This was fixed in @option{-fabi-version=3}.
2746 @item
2747 SIMD vector types declared using @code{__attribute ((vector_size))} were
2748 mangled in a non-standard way that does not allow for overloading of
2749 functions taking vectors of different sizes.
2751 The mangling was changed in @option{-fabi-version=4}.
2753 @item
2754 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2755 qualifiers, and @code{decltype} of a plain declaration was folded away.
2757 These mangling issues were fixed in @option{-fabi-version=5}.
2759 @item
2760 Scoped enumerators passed as arguments to a variadic function are
2761 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2762 On most targets this does not actually affect the parameter passing
2763 ABI, as there is no way to pass an argument smaller than @code{int}.
2765 Also, the ABI changed the mangling of template argument packs,
2766 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2767 a class scope function used as a template argument.
2769 These issues were corrected in @option{-fabi-version=6}.
2771 @item
2772 Lambdas in default argument scope were mangled incorrectly, and the
2773 ABI changed the mangling of @code{nullptr_t}.
2775 These issues were corrected in @option{-fabi-version=7}.
2777 @item
2778 When mangling a function type with function-cv-qualifiers, the
2779 un-qualified function type was incorrectly treated as a substitution
2780 candidate.
2782 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
2784 @item
2785 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
2786 unaligned accesses.  Note that this did not affect the ABI of a
2787 function with a @code{nullptr_t} parameter, as parameters have a
2788 minimum alignment.
2790 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
2792 @item
2793 Target-specific attributes that affect the identity of a type, such as
2794 ia32 calling conventions on a function type (stdcall, regparm, etc.),
2795 did not affect the mangled name, leading to name collisions when
2796 function pointers were used as template arguments.
2798 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
2800 @end itemize
2802 It also warns about psABI-related changes.  The known psABI changes at this
2803 point include:
2805 @itemize @bullet
2807 @item
2808 For SysV/x86-64, unions with @code{long double} members are 
2809 passed in memory as specified in psABI.  For example:
2811 @smallexample
2812 union U @{
2813   long double ld;
2814   int i;
2816 @end smallexample
2818 @noindent
2819 @code{union U} is always passed in memory.
2821 @end itemize
2823 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
2824 @opindex Wabi-tag
2825 @opindex -Wabi-tag
2826 Warn when a type with an ABI tag is used in a context that does not
2827 have that ABI tag.  See @ref{C++ Attributes} for more information
2828 about ABI tags.
2830 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2831 @opindex Wctor-dtor-privacy
2832 @opindex Wno-ctor-dtor-privacy
2833 Warn when a class seems unusable because all the constructors or
2834 destructors in that class are private, and it has neither friends nor
2835 public static member functions.  Also warn if there are no non-private
2836 methods, and there's at least one private member function that isn't
2837 a constructor or destructor.
2839 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2840 @opindex Wdelete-non-virtual-dtor
2841 @opindex Wno-delete-non-virtual-dtor
2842 Warn when @code{delete} is used to destroy an instance of a class that
2843 has virtual functions and non-virtual destructor. It is unsafe to delete
2844 an instance of a derived class through a pointer to a base class if the
2845 base class does not have a virtual destructor.  This warning is enabled
2846 by @option{-Wall}.
2848 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2849 @opindex Wliteral-suffix
2850 @opindex Wno-literal-suffix
2851 Warn when a string or character literal is followed by a ud-suffix which does
2852 not begin with an underscore.  As a conforming extension, GCC treats such
2853 suffixes as separate preprocessing tokens in order to maintain backwards
2854 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2855 For example:
2857 @smallexample
2858 #define __STDC_FORMAT_MACROS
2859 #include <inttypes.h>
2860 #include <stdio.h>
2862 int main() @{
2863   int64_t i64 = 123;
2864   printf("My int64: %" PRId64"\n", i64);
2866 @end smallexample
2868 In this case, @code{PRId64} is treated as a separate preprocessing token.
2870 Additionally, warn when a user-defined literal operator is declared with
2871 a literal suffix identifier that doesn't begin with an underscore. Literal
2872 suffix identifiers that don't begin with an underscore are reserved for
2873 future standardization.
2875 This warning is enabled by default.
2877 @item -Wlto-type-mismatch
2878 @opindex Wlto-type-mismatch
2879 @opindex Wno-lto-type-mismatch
2881 During the link-time optimization warn about type mismatches in
2882 global declarations from different compilation units.
2883 Requires @option{-flto} to be enabled.  Enabled by default.
2885 @item -Wno-narrowing @r{(C++ and Objective-C++ only)}
2886 @opindex Wnarrowing
2887 @opindex Wno-narrowing
2888 For C++11 and later standards, narrowing conversions are diagnosed by default,
2889 as required by the standard.  A narrowing conversion from a constant produces
2890 an error, and a narrowing conversion from a non-constant produces a warning,
2891 but @option{-Wno-narrowing} suppresses the diagnostic.
2892 Note that this does not affect the meaning of well-formed code;
2893 narrowing conversions are still considered ill-formed in SFINAE contexts.
2895 With @option{-Wnarrowing} in C++98, warn when a narrowing
2896 conversion prohibited by C++11 occurs within
2897 @samp{@{ @}}, e.g.
2899 @smallexample
2900 int i = @{ 2.2 @}; // error: narrowing from double to int
2901 @end smallexample
2903 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2905 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2906 @opindex Wnoexcept
2907 @opindex Wno-noexcept
2908 Warn when a noexcept-expression evaluates to false because of a call
2909 to a function that does not have a non-throwing exception
2910 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
2911 the compiler to never throw an exception.
2913 @item -Wnoexcept-type @r{(C++ and Objective-C++ only)}
2914 @opindex Wnoexcept-type
2915 @opindex Wno-noexcept-type
2916 Warn if the C++1z feature making @code{noexcept} part of a function
2917 type changes the mangled name of a symbol relative to C++14.  Enabled
2918 by @option{-Wabi} and @option{-Wc++1z-compat}.
2920 @smallexample
2921 template <class T> void f(T t) @{ t(); @};
2922 void g() noexcept;
2923 void h() @{ f(g); @} // in C++14 calls f<void(*)()>, in C++1z calls f<void(*)()noexcept>
2924 @end smallexample
2926 @item -Wclass-memaccess @r{(C++ and Objective-C++ only)}
2927 @opindex Wclass-memaccess
2928 Warn when the destination of a call to a raw memory function such as
2929 @code{memset} or @code{memcpy} is an object of class type writing into which
2930 might bypass the class non-trivial or deleted constructor or copy assignment,
2931 violate const-correctness or encapsulation, or corrupt the virtual table.
2932 Modifying the representation of such objects may violate invariants maintained
2933 by member functions of the class.  For example, the call to @code{memset}
2934 below is undefined becase it modifies a non-trivial class object and is,
2935 therefore, diagnosed.  The safe way to either initialize or clear the storage
2936 of objects of such types is by using the appropriate constructor or assignment
2937 operator, if one is available.
2938 @smallexample
2939 std::string str = "abc";
2940 memset (&str, 0, 3);
2941 @end smallexample
2942 The @option{-Wclass-memaccess} option is enabled by @option{-Wall}.
2944 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2945 @opindex Wnon-virtual-dtor
2946 @opindex Wno-non-virtual-dtor
2947 Warn when a class has virtual functions and an accessible non-virtual
2948 destructor itself or in an accessible polymorphic base class, in which
2949 case it is possible but unsafe to delete an instance of a derived
2950 class through a pointer to the class itself or base class.  This
2951 warning is automatically enabled if @option{-Weffc++} is specified.
2953 @item -Wregister @r{(C++ and Objective-C++ only)}
2954 @opindex Wregister
2955 @opindex Wno-register
2956 Warn on uses of the @code{register} storage class specifier, except
2957 when it is part of the GNU @ref{Explicit Register Variables} extension.
2958 The use of the @code{register} keyword as storage class specifier has
2959 been deprecated in C++11 and removed in C++17.
2960 Enabled by default with @option{-std=c++1z}.
2962 @item -Wreorder @r{(C++ and Objective-C++ only)}
2963 @opindex Wreorder
2964 @opindex Wno-reorder
2965 @cindex reordering, warning
2966 @cindex warning for reordering of member initializers
2967 Warn when the order of member initializers given in the code does not
2968 match the order in which they must be executed.  For instance:
2970 @smallexample
2971 struct A @{
2972   int i;
2973   int j;
2974   A(): j (0), i (1) @{ @}
2976 @end smallexample
2978 @noindent
2979 The compiler rearranges the member initializers for @code{i}
2980 and @code{j} to match the declaration order of the members, emitting
2981 a warning to that effect.  This warning is enabled by @option{-Wall}.
2983 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2984 @opindex fext-numeric-literals
2985 @opindex fno-ext-numeric-literals
2986 Accept imaginary, fixed-point, or machine-defined
2987 literal number suffixes as GNU extensions.
2988 When this option is turned off these suffixes are treated
2989 as C++11 user-defined literal numeric suffixes.
2990 This is on by default for all pre-C++11 dialects and all GNU dialects:
2991 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2992 @option{-std=gnu++14}.
2993 This option is off by default
2994 for ISO C++11 onwards (@option{-std=c++11}, ...).
2995 @end table
2997 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2999 @table @gcctabopt
3000 @item -Weffc++ @r{(C++ and Objective-C++ only)}
3001 @opindex Weffc++
3002 @opindex Wno-effc++
3003 Warn about violations of the following style guidelines from Scott Meyers'
3004 @cite{Effective C++} series of books:
3006 @itemize @bullet
3007 @item
3008 Define a copy constructor and an assignment operator for classes
3009 with dynamically-allocated memory.
3011 @item
3012 Prefer initialization to assignment in constructors.
3014 @item
3015 Have @code{operator=} return a reference to @code{*this}.
3017 @item
3018 Don't try to return a reference when you must return an object.
3020 @item
3021 Distinguish between prefix and postfix forms of increment and
3022 decrement operators.
3024 @item
3025 Never overload @code{&&}, @code{||}, or @code{,}.
3027 @end itemize
3029 This option also enables @option{-Wnon-virtual-dtor}, which is also
3030 one of the effective C++ recommendations.  However, the check is
3031 extended to warn about the lack of virtual destructor in accessible
3032 non-polymorphic bases classes too.
3034 When selecting this option, be aware that the standard library
3035 headers do not obey all of these guidelines; use @samp{grep -v}
3036 to filter out those warnings.
3038 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
3039 @opindex Wstrict-null-sentinel
3040 @opindex Wno-strict-null-sentinel
3041 Warn about the use of an uncasted @code{NULL} as sentinel.  When
3042 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
3043 to @code{__null}.  Although it is a null pointer constant rather than a
3044 null pointer, it is guaranteed to be of the same size as a pointer.
3045 But this use is not portable across different compilers.
3047 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
3048 @opindex Wno-non-template-friend
3049 @opindex Wnon-template-friend
3050 Disable warnings when non-template friend functions are declared
3051 within a template.  In very old versions of GCC that predate implementation
3052 of the ISO standard, declarations such as 
3053 @samp{friend int foo(int)}, where the name of the friend is an unqualified-id,
3054 could be interpreted as a particular specialization of a template
3055 function; the warning exists to diagnose compatibility problems, 
3056 and is enabled by default.
3058 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
3059 @opindex Wold-style-cast
3060 @opindex Wno-old-style-cast
3061 Warn if an old-style (C-style) cast to a non-void type is used within
3062 a C++ program.  The new-style casts (@code{dynamic_cast},
3063 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
3064 less vulnerable to unintended effects and much easier to search for.
3066 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
3067 @opindex Woverloaded-virtual
3068 @opindex Wno-overloaded-virtual
3069 @cindex overloaded virtual function, warning
3070 @cindex warning for overloaded virtual function
3071 Warn when a function declaration hides virtual functions from a
3072 base class.  For example, in:
3074 @smallexample
3075 struct A @{
3076   virtual void f();
3079 struct B: public A @{
3080   void f(int);
3082 @end smallexample
3084 the @code{A} class version of @code{f} is hidden in @code{B}, and code
3085 like:
3087 @smallexample
3088 B* b;
3089 b->f();
3090 @end smallexample
3092 @noindent
3093 fails to compile.
3095 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
3096 @opindex Wno-pmf-conversions
3097 @opindex Wpmf-conversions
3098 Disable the diagnostic for converting a bound pointer to member function
3099 to a plain pointer.
3101 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
3102 @opindex Wsign-promo
3103 @opindex Wno-sign-promo
3104 Warn when overload resolution chooses a promotion from unsigned or
3105 enumerated type to a signed type, over a conversion to an unsigned type of
3106 the same size.  Previous versions of G++ tried to preserve
3107 unsignedness, but the standard mandates the current behavior.
3109 @item -Wtemplates @r{(C++ and Objective-C++ only)}
3110 @opindex Wtemplates
3111 Warn when a primary template declaration is encountered.  Some coding
3112 rules disallow templates, and this may be used to enforce that rule.
3113 The warning is inactive inside a system header file, such as the STL, so
3114 one can still use the STL.  One may also instantiate or specialize
3115 templates.
3117 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
3118 @opindex Wmultiple-inheritance
3119 Warn when a class is defined with multiple direct base classes.  Some
3120 coding rules disallow multiple inheritance, and this may be used to
3121 enforce that rule.  The warning is inactive inside a system header file,
3122 such as the STL, so one can still use the STL.  One may also define
3123 classes that indirectly use multiple inheritance.
3125 @item -Wvirtual-inheritance
3126 @opindex Wvirtual-inheritance
3127 Warn when a class is defined with a virtual direct base class.  Some
3128 coding rules disallow multiple inheritance, and this may be used to
3129 enforce that rule.  The warning is inactive inside a system header file,
3130 such as the STL, so one can still use the STL.  One may also define
3131 classes that indirectly use virtual inheritance.
3133 @item -Wnamespaces
3134 @opindex Wnamespaces
3135 Warn when a namespace definition is opened.  Some coding rules disallow
3136 namespaces, and this may be used to enforce that rule.  The warning is
3137 inactive inside a system header file, such as the STL, so one can still
3138 use the STL.  One may also use using directives and qualified names.
3140 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
3141 @opindex Wterminate
3142 @opindex Wno-terminate
3143 Disable the warning about a throw-expression that will immediately
3144 result in a call to @code{terminate}.
3145 @end table
3147 @node Objective-C and Objective-C++ Dialect Options
3148 @section Options Controlling Objective-C and Objective-C++ Dialects
3150 @cindex compiler options, Objective-C and Objective-C++
3151 @cindex Objective-C and Objective-C++ options, command-line
3152 @cindex options, Objective-C and Objective-C++
3153 (NOTE: This manual does not describe the Objective-C and Objective-C++
3154 languages themselves.  @xref{Standards,,Language Standards
3155 Supported by GCC}, for references.)
3157 This section describes the command-line options that are only meaningful
3158 for Objective-C and Objective-C++ programs.  You can also use most of
3159 the language-independent GNU compiler options.
3160 For example, you might compile a file @file{some_class.m} like this:
3162 @smallexample
3163 gcc -g -fgnu-runtime -O -c some_class.m
3164 @end smallexample
3166 @noindent
3167 In this example, @option{-fgnu-runtime} is an option meant only for
3168 Objective-C and Objective-C++ programs; you can use the other options with
3169 any language supported by GCC@.
3171 Note that since Objective-C is an extension of the C language, Objective-C
3172 compilations may also use options specific to the C front-end (e.g.,
3173 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
3174 C++-specific options (e.g., @option{-Wabi}).
3176 Here is a list of options that are @emph{only} for compiling Objective-C
3177 and Objective-C++ programs:
3179 @table @gcctabopt
3180 @item -fconstant-string-class=@var{class-name}
3181 @opindex fconstant-string-class
3182 Use @var{class-name} as the name of the class to instantiate for each
3183 literal string specified with the syntax @code{@@"@dots{}"}.  The default
3184 class name is @code{NXConstantString} if the GNU runtime is being used, and
3185 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
3186 @option{-fconstant-cfstrings} option, if also present, overrides the
3187 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
3188 to be laid out as constant CoreFoundation strings.
3190 @item -fgnu-runtime
3191 @opindex fgnu-runtime
3192 Generate object code compatible with the standard GNU Objective-C
3193 runtime.  This is the default for most types of systems.
3195 @item -fnext-runtime
3196 @opindex fnext-runtime
3197 Generate output compatible with the NeXT runtime.  This is the default
3198 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
3199 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
3200 used.
3202 @item -fno-nil-receivers
3203 @opindex fno-nil-receivers
3204 Assume that all Objective-C message dispatches (@code{[receiver
3205 message:arg]}) in this translation unit ensure that the receiver is
3206 not @code{nil}.  This allows for more efficient entry points in the
3207 runtime to be used.  This option is only available in conjunction with
3208 the NeXT runtime and ABI version 0 or 1.
3210 @item -fobjc-abi-version=@var{n}
3211 @opindex fobjc-abi-version
3212 Use version @var{n} of the Objective-C ABI for the selected runtime.
3213 This option is currently supported only for the NeXT runtime.  In that
3214 case, Version 0 is the traditional (32-bit) ABI without support for
3215 properties and other Objective-C 2.0 additions.  Version 1 is the
3216 traditional (32-bit) ABI with support for properties and other
3217 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
3218 nothing is specified, the default is Version 0 on 32-bit target
3219 machines, and Version 2 on 64-bit target machines.
3221 @item -fobjc-call-cxx-cdtors
3222 @opindex fobjc-call-cxx-cdtors
3223 For each Objective-C class, check if any of its instance variables is a
3224 C++ object with a non-trivial default constructor.  If so, synthesize a
3225 special @code{- (id) .cxx_construct} instance method which runs
3226 non-trivial default constructors on any such instance variables, in order,
3227 and then return @code{self}.  Similarly, check if any instance variable
3228 is a C++ object with a non-trivial destructor, and if so, synthesize a
3229 special @code{- (void) .cxx_destruct} method which runs
3230 all such default destructors, in reverse order.
3232 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
3233 methods thusly generated only operate on instance variables
3234 declared in the current Objective-C class, and not those inherited
3235 from superclasses.  It is the responsibility of the Objective-C
3236 runtime to invoke all such methods in an object's inheritance
3237 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
3238 by the runtime immediately after a new object instance is allocated;
3239 the @code{- (void) .cxx_destruct} methods are invoked immediately
3240 before the runtime deallocates an object instance.
3242 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3243 support for invoking the @code{- (id) .cxx_construct} and
3244 @code{- (void) .cxx_destruct} methods.
3246 @item -fobjc-direct-dispatch
3247 @opindex fobjc-direct-dispatch
3248 Allow fast jumps to the message dispatcher.  On Darwin this is
3249 accomplished via the comm page.
3251 @item -fobjc-exceptions
3252 @opindex fobjc-exceptions
3253 Enable syntactic support for structured exception handling in
3254 Objective-C, similar to what is offered by C++.  This option
3255 is required to use the Objective-C keywords @code{@@try},
3256 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3257 @code{@@synchronized}.  This option is available with both the GNU
3258 runtime and the NeXT runtime (but not available in conjunction with
3259 the NeXT runtime on Mac OS X 10.2 and earlier).
3261 @item -fobjc-gc
3262 @opindex fobjc-gc
3263 Enable garbage collection (GC) in Objective-C and Objective-C++
3264 programs.  This option is only available with the NeXT runtime; the
3265 GNU runtime has a different garbage collection implementation that
3266 does not require special compiler flags.
3268 @item -fobjc-nilcheck
3269 @opindex fobjc-nilcheck
3270 For the NeXT runtime with version 2 of the ABI, check for a nil
3271 receiver in method invocations before doing the actual method call.
3272 This is the default and can be disabled using
3273 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3274 checked for nil in this way no matter what this flag is set to.
3275 Currently this flag does nothing when the GNU runtime, or an older
3276 version of the NeXT runtime ABI, is used.
3278 @item -fobjc-std=objc1
3279 @opindex fobjc-std
3280 Conform to the language syntax of Objective-C 1.0, the language
3281 recognized by GCC 4.0.  This only affects the Objective-C additions to
3282 the C/C++ language; it does not affect conformance to C/C++ standards,
3283 which is controlled by the separate C/C++ dialect option flags.  When
3284 this option is used with the Objective-C or Objective-C++ compiler,
3285 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3286 This is useful if you need to make sure that your Objective-C code can
3287 be compiled with older versions of GCC@.
3289 @item -freplace-objc-classes
3290 @opindex freplace-objc-classes
3291 Emit a special marker instructing @command{ld(1)} not to statically link in
3292 the resulting object file, and allow @command{dyld(1)} to load it in at
3293 run time instead.  This is used in conjunction with the Fix-and-Continue
3294 debugging mode, where the object file in question may be recompiled and
3295 dynamically reloaded in the course of program execution, without the need
3296 to restart the program itself.  Currently, Fix-and-Continue functionality
3297 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3298 and later.
3300 @item -fzero-link
3301 @opindex fzero-link
3302 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3303 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3304 compile time) with static class references that get initialized at load time,
3305 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3306 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3307 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3308 for individual class implementations to be modified during program execution.
3309 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3310 regardless of command-line options.
3312 @item -fno-local-ivars
3313 @opindex fno-local-ivars
3314 @opindex flocal-ivars
3315 By default instance variables in Objective-C can be accessed as if
3316 they were local variables from within the methods of the class they're
3317 declared in.  This can lead to shadowing between instance variables
3318 and other variables declared either locally inside a class method or
3319 globally with the same name.  Specifying the @option{-fno-local-ivars}
3320 flag disables this behavior thus avoiding variable shadowing issues.
3322 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3323 @opindex fivar-visibility
3324 Set the default instance variable visibility to the specified option
3325 so that instance variables declared outside the scope of any access
3326 modifier directives default to the specified visibility.
3328 @item -gen-decls
3329 @opindex gen-decls
3330 Dump interface declarations for all classes seen in the source file to a
3331 file named @file{@var{sourcename}.decl}.
3333 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3334 @opindex Wassign-intercept
3335 @opindex Wno-assign-intercept
3336 Warn whenever an Objective-C assignment is being intercepted by the
3337 garbage collector.
3339 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3340 @opindex Wno-protocol
3341 @opindex Wprotocol
3342 If a class is declared to implement a protocol, a warning is issued for
3343 every method in the protocol that is not implemented by the class.  The
3344 default behavior is to issue a warning for every method not explicitly
3345 implemented in the class, even if a method implementation is inherited
3346 from the superclass.  If you use the @option{-Wno-protocol} option, then
3347 methods inherited from the superclass are considered to be implemented,
3348 and no warning is issued for them.
3350 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3351 @opindex Wselector
3352 @opindex Wno-selector
3353 Warn if multiple methods of different types for the same selector are
3354 found during compilation.  The check is performed on the list of methods
3355 in the final stage of compilation.  Additionally, a check is performed
3356 for each selector appearing in a @code{@@selector(@dots{})}
3357 expression, and a corresponding method for that selector has been found
3358 during compilation.  Because these checks scan the method table only at
3359 the end of compilation, these warnings are not produced if the final
3360 stage of compilation is not reached, for example because an error is
3361 found during compilation, or because the @option{-fsyntax-only} option is
3362 being used.
3364 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3365 @opindex Wstrict-selector-match
3366 @opindex Wno-strict-selector-match
3367 Warn if multiple methods with differing argument and/or return types are
3368 found for a given selector when attempting to send a message using this
3369 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3370 is off (which is the default behavior), the compiler omits such warnings
3371 if any differences found are confined to types that share the same size
3372 and alignment.
3374 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3375 @opindex Wundeclared-selector
3376 @opindex Wno-undeclared-selector
3377 Warn if a @code{@@selector(@dots{})} expression referring to an
3378 undeclared selector is found.  A selector is considered undeclared if no
3379 method with that name has been declared before the
3380 @code{@@selector(@dots{})} expression, either explicitly in an
3381 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3382 an @code{@@implementation} section.  This option always performs its
3383 checks as soon as a @code{@@selector(@dots{})} expression is found,
3384 while @option{-Wselector} only performs its checks in the final stage of
3385 compilation.  This also enforces the coding style convention
3386 that methods and selectors must be declared before being used.
3388 @item -print-objc-runtime-info
3389 @opindex print-objc-runtime-info
3390 Generate C header describing the largest structure that is passed by
3391 value, if any.
3393 @end table
3395 @node Diagnostic Message Formatting Options
3396 @section Options to Control Diagnostic Messages Formatting
3397 @cindex options to control diagnostics formatting
3398 @cindex diagnostic messages
3399 @cindex message formatting
3401 Traditionally, diagnostic messages have been formatted irrespective of
3402 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3403 options described below
3404 to control the formatting algorithm for diagnostic messages, 
3405 e.g.@: how many characters per line, how often source location
3406 information should be reported.  Note that some language front ends may not
3407 honor these options.
3409 @table @gcctabopt
3410 @item -fmessage-length=@var{n}
3411 @opindex fmessage-length
3412 Try to format error messages so that they fit on lines of about
3413 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3414 done; each error message appears on a single line.  This is the
3415 default for all front ends.
3417 @item -fdiagnostics-show-location=once
3418 @opindex fdiagnostics-show-location
3419 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3420 reporter to emit source location information @emph{once}; that is, in
3421 case the message is too long to fit on a single physical line and has to
3422 be wrapped, the source location won't be emitted (as prefix) again,
3423 over and over, in subsequent continuation lines.  This is the default
3424 behavior.
3426 @item -fdiagnostics-show-location=every-line
3427 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3428 messages reporter to emit the same source location information (as
3429 prefix) for physical lines that result from the process of breaking
3430 a message which is too long to fit on a single line.
3432 @item -fdiagnostics-color[=@var{WHEN}]
3433 @itemx -fno-diagnostics-color
3434 @opindex fdiagnostics-color
3435 @cindex highlight, color
3436 @vindex GCC_COLORS @r{environment variable}
3437 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3438 or @samp{auto}.  The default depends on how the compiler has been configured,
3439 it can be any of the above @var{WHEN} options or also @samp{never}
3440 if @env{GCC_COLORS} environment variable isn't present in the environment,
3441 and @samp{auto} otherwise.
3442 @samp{auto} means to use color only when the standard error is a terminal.
3443 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3444 aliases for @option{-fdiagnostics-color=always} and
3445 @option{-fdiagnostics-color=never}, respectively.
3447 The colors are defined by the environment variable @env{GCC_COLORS}.
3448 Its value is a colon-separated list of capabilities and Select Graphic
3449 Rendition (SGR) substrings. SGR commands are interpreted by the
3450 terminal or terminal emulator.  (See the section in the documentation
3451 of your text terminal for permitted values and their meanings as
3452 character attributes.)  These substring values are integers in decimal
3453 representation and can be concatenated with semicolons.
3454 Common values to concatenate include
3455 @samp{1} for bold,
3456 @samp{4} for underline,
3457 @samp{5} for blink,
3458 @samp{7} for inverse,
3459 @samp{39} for default foreground color,
3460 @samp{30} to @samp{37} for foreground colors,
3461 @samp{90} to @samp{97} for 16-color mode foreground colors,
3462 @samp{38;5;0} to @samp{38;5;255}
3463 for 88-color and 256-color modes foreground colors,
3464 @samp{49} for default background color,
3465 @samp{40} to @samp{47} for background colors,
3466 @samp{100} to @samp{107} for 16-color mode background colors,
3467 and @samp{48;5;0} to @samp{48;5;255}
3468 for 88-color and 256-color modes background colors.
3470 The default @env{GCC_COLORS} is
3471 @smallexample
3472 error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\
3473 quote=01:fixit-insert=32:fixit-delete=31:\
3474 diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32:\
3475 type-diff=01;32
3476 @end smallexample
3477 @noindent
3478 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3479 @samp{01;36} is bold cyan, @samp{32} is green, @samp{34} is blue,
3480 @samp{01} is bold, and @samp{31} is red.
3481 Setting @env{GCC_COLORS} to the empty string disables colors.
3482 Supported capabilities are as follows.
3484 @table @code
3485 @item error=
3486 @vindex error GCC_COLORS @r{capability}
3487 SGR substring for error: markers.
3489 @item warning=
3490 @vindex warning GCC_COLORS @r{capability}
3491 SGR substring for warning: markers.
3493 @item note=
3494 @vindex note GCC_COLORS @r{capability}
3495 SGR substring for note: markers.
3497 @item range1=
3498 @vindex range1 GCC_COLORS @r{capability}
3499 SGR substring for first additional range.
3501 @item range2=
3502 @vindex range2 GCC_COLORS @r{capability}
3503 SGR substring for second additional range.
3505 @item locus=
3506 @vindex locus GCC_COLORS @r{capability}
3507 SGR substring for location information, @samp{file:line} or
3508 @samp{file:line:column} etc.
3510 @item quote=
3511 @vindex quote GCC_COLORS @r{capability}
3512 SGR substring for information printed within quotes.
3514 @item fixit-insert=
3515 @vindex fixit-insert GCC_COLORS @r{capability}
3516 SGR substring for fix-it hints suggesting text to
3517 be inserted or replaced.
3519 @item fixit-delete=
3520 @vindex fixit-delete GCC_COLORS @r{capability}
3521 SGR substring for fix-it hints suggesting text to
3522 be deleted.
3524 @item diff-filename=
3525 @vindex diff-filename GCC_COLORS @r{capability}
3526 SGR substring for filename headers within generated patches.
3528 @item diff-hunk=
3529 @vindex diff-hunk GCC_COLORS @r{capability}
3530 SGR substring for the starts of hunks within generated patches.
3532 @item diff-delete=
3533 @vindex diff-delete GCC_COLORS @r{capability}
3534 SGR substring for deleted lines within generated patches.
3536 @item diff-insert=
3537 @vindex diff-insert GCC_COLORS @r{capability}
3538 SGR substring for inserted lines within generated patches.
3540 @item type-diff=
3541 @vindex type-diff GCC_COLORS @r{capability}
3542 SGR substring for highlighting mismatching types within template
3543 arguments in the C++ frontend.
3544 @end table
3546 @item -fno-diagnostics-show-option
3547 @opindex fno-diagnostics-show-option
3548 @opindex fdiagnostics-show-option
3549 By default, each diagnostic emitted includes text indicating the
3550 command-line option that directly controls the diagnostic (if such an
3551 option is known to the diagnostic machinery).  Specifying the
3552 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3554 @item -fno-diagnostics-show-caret
3555 @opindex fno-diagnostics-show-caret
3556 @opindex fdiagnostics-show-caret
3557 By default, each diagnostic emitted includes the original source line
3558 and a caret @samp{^} indicating the column.  This option suppresses this
3559 information.  The source line is truncated to @var{n} characters, if
3560 the @option{-fmessage-length=n} option is given.  When the output is done
3561 to the terminal, the width is limited to the width given by the
3562 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3564 @item -fdiagnostics-parseable-fixits
3565 @opindex fdiagnostics-parseable-fixits
3566 Emit fix-it hints in a machine-parseable format, suitable for consumption
3567 by IDEs.  For each fix-it, a line will be printed after the relevant
3568 diagnostic, starting with the string ``fix-it:''.  For example:
3570 @smallexample
3571 fix-it:"test.c":@{45:3-45:21@}:"gtk_widget_show_all"
3572 @end smallexample
3574 The location is expressed as a half-open range, expressed as a count of
3575 bytes, starting at byte 1 for the initial column.  In the above example,
3576 bytes 3 through 20 of line 45 of ``test.c'' are to be replaced with the
3577 given string:
3579 @smallexample
3580 00000000011111111112222222222
3581 12345678901234567890123456789
3582   gtk_widget_showall (dlg);
3583   ^^^^^^^^^^^^^^^^^^
3584   gtk_widget_show_all
3585 @end smallexample
3587 The filename and replacement string escape backslash as ``\\", tab as ``\t'',
3588 newline as ``\n'', double quotes as ``\"'', non-printable characters as octal
3589 (e.g. vertical tab as ``\013'').
3591 An empty replacement string indicates that the given range is to be removed.
3592 An empty range (e.g. ``45:3-45:3'') indicates that the string is to
3593 be inserted at the given position.
3595 @item -fdiagnostics-generate-patch
3596 @opindex fdiagnostics-generate-patch
3597 Print fix-it hints to stderr in unified diff format, after any diagnostics
3598 are printed.  For example:
3600 @smallexample
3601 --- test.c
3602 +++ test.c
3603 @@ -42,5 +42,5 @@
3605  void show_cb(GtkDialog *dlg)
3606  @{
3607 -  gtk_widget_showall(dlg);
3608 +  gtk_widget_show_all(dlg);
3609  @}
3611 @end smallexample
3613 The diff may or may not be colorized, following the same rules
3614 as for diagnostics (see @option{-fdiagnostics-color}).
3616 @item -fdiagnostics-show-template-tree
3617 @opindex fdiagnostics-show-template-tree
3619 In the C++ frontend, when printing diagnostics showing mismatching
3620 template types, such as:
3622 @smallexample
3623   could not convert 'std::map<int, std::vector<double> >()'
3624     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
3625 @end smallexample
3627 the @option{-fdiagnostics-show-template-tree} flag enables printing a
3628 tree-like structure showing the common and differing parts of the types,
3629 such as:
3631 @smallexample
3632   map<
3633     [...],
3634     vector<
3635       [double != float]>>
3636 @end smallexample
3638 The parts that differ are highlighted with color (``double'' and
3639 ``float'' in this case).
3641 @item -fno-elide-type
3642 @opindex fno-elide-type
3643 @opindex felide-type
3644 By default when the C++ frontend prints diagnostics showing mismatching
3645 template types, common parts of the types are printed as ``[...]'' to
3646 simplify the error message.  For example:
3648 @smallexample
3649   could not convert 'std::map<int, std::vector<double> >()'
3650     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
3651 @end smallexample
3653 Specifying the @option{-fno-elide-type} flag suppresses that behavior.
3654 This flag also affects the output of the
3655 @option{-fdiagnostics-show-template-tree} flag.
3657 @item -fno-show-column
3658 @opindex fno-show-column
3659 Do not print column numbers in diagnostics.  This may be necessary if
3660 diagnostics are being scanned by a program that does not understand the
3661 column numbers, such as @command{dejagnu}.
3663 @end table
3665 @node Warning Options
3666 @section Options to Request or Suppress Warnings
3667 @cindex options to control warnings
3668 @cindex warning messages
3669 @cindex messages, warning
3670 @cindex suppressing warnings
3672 Warnings are diagnostic messages that report constructions that
3673 are not inherently erroneous but that are risky or suggest there
3674 may have been an error.
3676 The following language-independent options do not enable specific
3677 warnings but control the kinds of diagnostics produced by GCC@.
3679 @table @gcctabopt
3680 @cindex syntax checking
3681 @item -fsyntax-only
3682 @opindex fsyntax-only
3683 Check the code for syntax errors, but don't do anything beyond that.
3685 @item -fmax-errors=@var{n}
3686 @opindex fmax-errors
3687 Limits the maximum number of error messages to @var{n}, at which point
3688 GCC bails out rather than attempting to continue processing the source
3689 code.  If @var{n} is 0 (the default), there is no limit on the number
3690 of error messages produced.  If @option{-Wfatal-errors} is also
3691 specified, then @option{-Wfatal-errors} takes precedence over this
3692 option.
3694 @item -w
3695 @opindex w
3696 Inhibit all warning messages.
3698 @item -Werror
3699 @opindex Werror
3700 @opindex Wno-error
3701 Make all warnings into errors.
3703 @item -Werror=
3704 @opindex Werror=
3705 @opindex Wno-error=
3706 Make the specified warning into an error.  The specifier for a warning
3707 is appended; for example @option{-Werror=switch} turns the warnings
3708 controlled by @option{-Wswitch} into errors.  This switch takes a
3709 negative form, to be used to negate @option{-Werror} for specific
3710 warnings; for example @option{-Wno-error=switch} makes
3711 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3712 is in effect.
3714 The warning message for each controllable warning includes the
3715 option that controls the warning.  That option can then be used with
3716 @option{-Werror=} and @option{-Wno-error=} as described above.
3717 (Printing of the option in the warning message can be disabled using the
3718 @option{-fno-diagnostics-show-option} flag.)
3720 Note that specifying @option{-Werror=}@var{foo} automatically implies
3721 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3722 imply anything.
3724 @item -Wfatal-errors
3725 @opindex Wfatal-errors
3726 @opindex Wno-fatal-errors
3727 This option causes the compiler to abort compilation on the first error
3728 occurred rather than trying to keep going and printing further error
3729 messages.
3731 @end table
3733 You can request many specific warnings with options beginning with
3734 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3735 implicit declarations.  Each of these specific warning options also
3736 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3737 example, @option{-Wno-implicit}.  This manual lists only one of the
3738 two forms, whichever is not the default.  For further
3739 language-specific options also refer to @ref{C++ Dialect Options} and
3740 @ref{Objective-C and Objective-C++ Dialect Options}.
3742 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3743 options, such as @option{-Wunused}, which may turn on further options,
3744 such as @option{-Wunused-value}. The combined effect of positive and
3745 negative forms is that more specific options have priority over less
3746 specific ones, independently of their position in the command-line. For
3747 options of the same specificity, the last one takes effect. Options
3748 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
3749 as if they appeared at the end of the command-line.
3751 When an unrecognized warning option is requested (e.g.,
3752 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3753 that the option is not recognized.  However, if the @option{-Wno-} form
3754 is used, the behavior is slightly different: no diagnostic is
3755 produced for @option{-Wno-unknown-warning} unless other diagnostics
3756 are being produced.  This allows the use of new @option{-Wno-} options
3757 with old compilers, but if something goes wrong, the compiler
3758 warns that an unrecognized option is present.
3760 @table @gcctabopt
3761 @item -Wpedantic
3762 @itemx -pedantic
3763 @opindex pedantic
3764 @opindex Wpedantic
3765 Issue all the warnings demanded by strict ISO C and ISO C++;
3766 reject all programs that use forbidden extensions, and some other
3767 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3768 version of the ISO C standard specified by any @option{-std} option used.
3770 Valid ISO C and ISO C++ programs should compile properly with or without
3771 this option (though a rare few require @option{-ansi} or a
3772 @option{-std} option specifying the required version of ISO C)@.  However,
3773 without this option, certain GNU extensions and traditional C and C++
3774 features are supported as well.  With this option, they are rejected.
3776 @option{-Wpedantic} does not cause warning messages for use of the
3777 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3778 warnings are also disabled in the expression that follows
3779 @code{__extension__}.  However, only system header files should use
3780 these escape routes; application programs should avoid them.
3781 @xref{Alternate Keywords}.
3783 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3784 C conformance.  They soon find that it does not do quite what they want:
3785 it finds some non-ISO practices, but not all---only those for which
3786 ISO C @emph{requires} a diagnostic, and some others for which
3787 diagnostics have been added.
3789 A feature to report any failure to conform to ISO C might be useful in
3790 some instances, but would require considerable additional work and would
3791 be quite different from @option{-Wpedantic}.  We don't have plans to
3792 support such a feature in the near future.
3794 Where the standard specified with @option{-std} represents a GNU
3795 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3796 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3797 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3798 where they are required by the base standard.  (It does not make sense
3799 for such warnings to be given only for features not in the specified GNU
3800 C dialect, since by definition the GNU dialects of C include all
3801 features the compiler supports with the given option, and there would be
3802 nothing to warn about.)
3804 @item -pedantic-errors
3805 @opindex pedantic-errors
3806 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
3807 requires a diagnostic, in some cases where there is undefined behavior
3808 at compile-time and in some other cases that do not prevent compilation
3809 of programs that are valid according to the standard. This is not
3810 equivalent to @option{-Werror=pedantic}, since there are errors enabled
3811 by this option and not enabled by the latter and vice versa.
3813 @item -Wall
3814 @opindex Wall
3815 @opindex Wno-all
3816 This enables all the warnings about constructions that some users
3817 consider questionable, and that are easy to avoid (or modify to
3818 prevent the warning), even in conjunction with macros.  This also
3819 enables some language-specific warnings described in @ref{C++ Dialect
3820 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3822 @option{-Wall} turns on the following warning flags:
3824 @gccoptlist{-Waddress   @gol
3825 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
3826 -Wbool-compare  @gol
3827 -Wbool-operation  @gol
3828 -Wc++11-compat  -Wc++14-compat  @gol
3829 -Wcatch-value @r{(C++ and Objective-C++ only)}  @gol
3830 -Wchar-subscripts  @gol
3831 -Wcomment  @gol
3832 -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
3833 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3834 -Wformat   @gol
3835 -Wint-in-bool-context  @gol
3836 -Wimplicit @r{(C and Objective-C only)} @gol
3837 -Wimplicit-int @r{(C and Objective-C only)} @gol
3838 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3839 -Winit-self @r{(only for C++)} @gol
3840 -Wlogical-not-parentheses @gol
3841 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3842 -Wmaybe-uninitialized @gol
3843 -Wmemset-elt-size @gol
3844 -Wmemset-transposed-args @gol
3845 -Wmisleading-indentation @r{(only for C/C++)} @gol
3846 -Wmissing-braces @r{(only for C/ObjC)} @gol
3847 -Wmultistatement-macros  @gol
3848 -Wnarrowing @r{(only for C++)}  @gol
3849 -Wnonnull  @gol
3850 -Wnonnull-compare  @gol
3851 -Wopenmp-simd @gol
3852 -Wparentheses  @gol
3853 -Wpointer-sign  @gol
3854 -Wreorder   @gol
3855 -Wreturn-type  @gol
3856 -Wsequence-point  @gol
3857 -Wsign-compare @r{(only in C++)}  @gol
3858 -Wsizeof-pointer-div @gol
3859 -Wsizeof-pointer-memaccess @gol
3860 -Wstrict-aliasing  @gol
3861 -Wstrict-overflow=1  @gol
3862 -Wswitch  @gol
3863 -Wtautological-compare  @gol
3864 -Wtrigraphs  @gol
3865 -Wuninitialized  @gol
3866 -Wunknown-pragmas  @gol
3867 -Wunused-function  @gol
3868 -Wunused-label     @gol
3869 -Wunused-value     @gol
3870 -Wunused-variable  @gol
3871 -Wvolatile-register-var @gol
3874 Note that some warning flags are not implied by @option{-Wall}.  Some of
3875 them warn about constructions that users generally do not consider
3876 questionable, but which occasionally you might wish to check for;
3877 others warn about constructions that are necessary or hard to avoid in
3878 some cases, and there is no simple way to modify the code to suppress
3879 the warning. Some of them are enabled by @option{-Wextra} but many of
3880 them must be enabled individually.
3882 @item -Wextra
3883 @opindex W
3884 @opindex Wextra
3885 @opindex Wno-extra
3886 This enables some extra warning flags that are not enabled by
3887 @option{-Wall}. (This option used to be called @option{-W}.  The older
3888 name is still supported, but the newer name is more descriptive.)
3890 @gccoptlist{-Wclobbered  @gol
3891 -Wempty-body  @gol
3892 -Wignored-qualifiers @gol
3893 -Wimplicit-fallthrough=3 @gol
3894 -Wmissing-field-initializers  @gol
3895 -Wmissing-parameter-type @r{(C only)}  @gol
3896 -Wold-style-declaration @r{(C only)}  @gol
3897 -Woverride-init  @gol
3898 -Wsign-compare @r{(C only)} @gol
3899 -Wtype-limits  @gol
3900 -Wuninitialized  @gol
3901 -Wshift-negative-value @r{(in C++03 and in C99 and newer)}  @gol
3902 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3903 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3906 The option @option{-Wextra} also prints warning messages for the
3907 following cases:
3909 @itemize @bullet
3911 @item
3912 A pointer is compared against integer zero with @code{<}, @code{<=},
3913 @code{>}, or @code{>=}.
3915 @item
3916 (C++ only) An enumerator and a non-enumerator both appear in a
3917 conditional expression.
3919 @item
3920 (C++ only) Ambiguous virtual bases.
3922 @item
3923 (C++ only) Subscripting an array that has been declared @code{register}.
3925 @item
3926 (C++ only) Taking the address of a variable that has been declared
3927 @code{register}.
3929 @item
3930 (C++ only) A base class is not initialized in the copy constructor
3931 of a derived class.
3933 @end itemize
3935 @item -Wchar-subscripts
3936 @opindex Wchar-subscripts
3937 @opindex Wno-char-subscripts
3938 Warn if an array subscript has type @code{char}.  This is a common cause
3939 of error, as programmers often forget that this type is signed on some
3940 machines.
3941 This warning is enabled by @option{-Wall}.
3943 @item -Wchkp
3944 @opindex Wchkp
3945 Warn about an invalid memory access that is found by Pointer Bounds Checker
3946 (@option{-fcheck-pointer-bounds}).
3948 @item -Wno-coverage-mismatch
3949 @opindex Wno-coverage-mismatch
3950 Warn if feedback profiles do not match when using the
3951 @option{-fprofile-use} option.
3952 If a source file is changed between compiling with @option{-fprofile-gen} and
3953 with @option{-fprofile-use}, the files with the profile feedback can fail
3954 to match the source file and GCC cannot use the profile feedback
3955 information.  By default, this warning is enabled and is treated as an
3956 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3957 warning or @option{-Wno-error=coverage-mismatch} can be used to
3958 disable the error.  Disabling the error for this warning can result in
3959 poorly optimized code and is useful only in the
3960 case of very minor changes such as bug fixes to an existing code-base.
3961 Completely disabling the warning is not recommended.
3963 @item -Wno-cpp
3964 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3966 Suppress warning messages emitted by @code{#warning} directives.
3968 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3969 @opindex Wdouble-promotion
3970 @opindex Wno-double-promotion
3971 Give a warning when a value of type @code{float} is implicitly
3972 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3973 floating-point unit implement @code{float} in hardware, but emulate
3974 @code{double} in software.  On such a machine, doing computations
3975 using @code{double} values is much more expensive because of the
3976 overhead required for software emulation.
3978 It is easy to accidentally do computations with @code{double} because
3979 floating-point literals are implicitly of type @code{double}.  For
3980 example, in:
3981 @smallexample
3982 @group
3983 float area(float radius)
3985    return 3.14159 * radius * radius;
3987 @end group
3988 @end smallexample
3989 the compiler performs the entire computation with @code{double}
3990 because the floating-point literal is a @code{double}.
3992 @item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
3993 @opindex Wduplicate-decl-specifier
3994 @opindex Wno-duplicate-decl-specifier
3995 Warn if a declaration has duplicate @code{const}, @code{volatile},
3996 @code{restrict} or @code{_Atomic} specifier.  This warning is enabled by
3997 @option{-Wall}.
3999 @item -Wformat
4000 @itemx -Wformat=@var{n}
4001 @opindex Wformat
4002 @opindex Wno-format
4003 @opindex ffreestanding
4004 @opindex fno-builtin
4005 @opindex Wformat=
4006 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
4007 the arguments supplied have types appropriate to the format string
4008 specified, and that the conversions specified in the format string make
4009 sense.  This includes standard functions, and others specified by format
4010 attributes (@pxref{Function Attributes}), in the @code{printf},
4011 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
4012 not in the C standard) families (or other target-specific families).
4013 Which functions are checked without format attributes having been
4014 specified depends on the standard version selected, and such checks of
4015 functions without the attribute specified are disabled by
4016 @option{-ffreestanding} or @option{-fno-builtin}.
4018 The formats are checked against the format features supported by GNU
4019 libc version 2.2.  These include all ISO C90 and C99 features, as well
4020 as features from the Single Unix Specification and some BSD and GNU
4021 extensions.  Other library implementations may not support all these
4022 features; GCC does not support warning about features that go beyond a
4023 particular library's limitations.  However, if @option{-Wpedantic} is used
4024 with @option{-Wformat}, warnings are given about format features not
4025 in the selected standard version (but not for @code{strfmon} formats,
4026 since those are not in any version of the C standard).  @xref{C Dialect
4027 Options,,Options Controlling C Dialect}.
4029 @table @gcctabopt
4030 @item -Wformat=1
4031 @itemx -Wformat
4032 @opindex Wformat
4033 @opindex Wformat=1
4034 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
4035 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
4036 @option{-Wformat} also checks for null format arguments for several
4037 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
4038 aspects of this level of format checking can be disabled by the
4039 options: @option{-Wno-format-contains-nul},
4040 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
4041 @option{-Wformat} is enabled by @option{-Wall}.
4043 @item -Wno-format-contains-nul
4044 @opindex Wno-format-contains-nul
4045 @opindex Wformat-contains-nul
4046 If @option{-Wformat} is specified, do not warn about format strings that
4047 contain NUL bytes.
4049 @item -Wno-format-extra-args
4050 @opindex Wno-format-extra-args
4051 @opindex Wformat-extra-args
4052 If @option{-Wformat} is specified, do not warn about excess arguments to a
4053 @code{printf} or @code{scanf} format function.  The C standard specifies
4054 that such arguments are ignored.
4056 Where the unused arguments lie between used arguments that are
4057 specified with @samp{$} operand number specifications, normally
4058 warnings are still given, since the implementation could not know what
4059 type to pass to @code{va_arg} to skip the unused arguments.  However,
4060 in the case of @code{scanf} formats, this option suppresses the
4061 warning if the unused arguments are all pointers, since the Single
4062 Unix Specification says that such unused arguments are allowed.
4064 @item -Wformat-overflow
4065 @itemx -Wformat-overflow=@var{level}
4066 @opindex Wformat-overflow
4067 @opindex Wno-format-overflow
4068 Warn about calls to formatted input/output functions such as @code{sprintf}
4069 and @code{vsprintf} that might overflow the destination buffer.  When the
4070 exact number of bytes written by a format directive cannot be determined
4071 at compile-time it is estimated based on heuristics that depend on the
4072 @var{level} argument and on optimization.  While enabling optimization
4073 will in most cases improve the accuracy of the warning, it may also
4074 result in false positives.
4076 @table @gcctabopt
4077 @item -Wformat-overflow
4078 @item -Wformat-overflow=1
4079 @opindex Wformat-overflow
4080 @opindex Wno-format-overflow
4081 Level @var{1} of @option{-Wformat-overflow} enabled by @option{-Wformat}
4082 employs a conservative approach that warns only about calls that most
4083 likely overflow the buffer.  At this level, numeric arguments to format
4084 directives with unknown values are assumed to have the value of one, and
4085 strings of unknown length to be empty.  Numeric arguments that are known
4086 to be bounded to a subrange of their type, or string arguments whose output
4087 is bounded either by their directive's precision or by a finite set of
4088 string literals, are assumed to take on the value within the range that
4089 results in the most bytes on output.  For example, the call to @code{sprintf}
4090 below is diagnosed because even with both @var{a} and @var{b} equal to zero,
4091 the terminating NUL character (@code{'\0'}) appended by the function
4092 to the destination buffer will be written past its end.  Increasing
4093 the size of the buffer by a single byte is sufficient to avoid the
4094 warning, though it may not be sufficient to avoid the overflow.
4096 @smallexample
4097 void f (int a, int b)
4099   char buf [12];
4100   sprintf (buf, "a = %i, b = %i\n", a, b);
4102 @end smallexample
4104 @item -Wformat-overflow=2
4105 Level @var{2} warns also about calls that might overflow the destination
4106 buffer given an argument of sufficient length or magnitude.  At level
4107 @var{2}, unknown numeric arguments are assumed to have the minimum
4108 representable value for signed types with a precision greater than 1, and
4109 the maximum representable value otherwise.  Unknown string arguments whose
4110 length cannot be assumed to be bounded either by the directive's precision,
4111 or by a finite set of string literals they may evaluate to, or the character
4112 array they may point to, are assumed to be 1 character long.
4114 At level @var{2}, the call in the example above is again diagnosed, but
4115 this time because with @var{a} equal to a 32-bit @code{INT_MIN} the first
4116 @code{%i} directive will write some of its digits beyond the end of
4117 the destination buffer.  To make the call safe regardless of the values
4118 of the two variables, the size of the destination buffer must be increased
4119 to at least 34 bytes.  GCC includes the minimum size of the buffer in
4120 an informational note following the warning.
4122 An alternative to increasing the size of the destination buffer is to
4123 constrain the range of formatted values.  The maximum length of string
4124 arguments can be bounded by specifying the precision in the format
4125 directive.  When numeric arguments of format directives can be assumed
4126 to be bounded by less than the precision of their type, choosing
4127 an appropriate length modifier to the format specifier will reduce
4128 the required buffer size.  For example, if @var{a} and @var{b} in the
4129 example above can be assumed to be within the precision of
4130 the @code{short int} type then using either the @code{%hi} format
4131 directive or casting the argument to @code{short} reduces the maximum
4132 required size of the buffer to 24 bytes.
4134 @smallexample
4135 void f (int a, int b)
4137   char buf [23];
4138   sprintf (buf, "a = %hi, b = %i\n", a, (short)b);
4140 @end smallexample
4141 @end table
4143 @item -Wno-format-zero-length
4144 @opindex Wno-format-zero-length
4145 @opindex Wformat-zero-length
4146 If @option{-Wformat} is specified, do not warn about zero-length formats.
4147 The C standard specifies that zero-length formats are allowed.
4150 @item -Wformat=2
4151 @opindex Wformat=2
4152 Enable @option{-Wformat} plus additional format checks.  Currently
4153 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
4154 -Wformat-y2k}.
4156 @item -Wformat-nonliteral
4157 @opindex Wformat-nonliteral
4158 @opindex Wno-format-nonliteral
4159 If @option{-Wformat} is specified, also warn if the format string is not a
4160 string literal and so cannot be checked, unless the format function
4161 takes its format arguments as a @code{va_list}.
4163 @item -Wformat-security
4164 @opindex Wformat-security
4165 @opindex Wno-format-security
4166 If @option{-Wformat} is specified, also warn about uses of format
4167 functions that represent possible security problems.  At present, this
4168 warns about calls to @code{printf} and @code{scanf} functions where the
4169 format string is not a string literal and there are no format arguments,
4170 as in @code{printf (foo);}.  This may be a security hole if the format
4171 string came from untrusted input and contains @samp{%n}.  (This is
4172 currently a subset of what @option{-Wformat-nonliteral} warns about, but
4173 in future warnings may be added to @option{-Wformat-security} that are not
4174 included in @option{-Wformat-nonliteral}.)
4176 @item -Wformat-signedness
4177 @opindex Wformat-signedness
4178 @opindex Wno-format-signedness
4179 If @option{-Wformat} is specified, also warn if the format string
4180 requires an unsigned argument and the argument is signed and vice versa.
4182 @item -Wformat-truncation
4183 @itemx -Wformat-truncation=@var{level}
4184 @opindex Wformat-truncation
4185 @opindex Wno-format-truncation
4186 Warn about calls to formatted input/output functions such as @code{snprintf}
4187 and @code{vsnprintf} that might result in output truncation.  When the exact
4188 number of bytes written by a format directive cannot be determined at
4189 compile-time it is estimated based on heuristics that depend on
4190 the @var{level} argument and on optimization.  While enabling optimization
4191 will in most cases improve the accuracy of the warning, it may also result
4192 in false positives.  Except as noted otherwise, the option uses the same
4193 logic @option{-Wformat-overflow}.
4195 @table @gcctabopt
4196 @item -Wformat-truncation
4197 @item -Wformat-truncation=1
4198 @opindex Wformat-truncation
4199 @opindex Wno-format-overflow
4200 Level @var{1} of @option{-Wformat-truncation} enabled by @option{-Wformat}
4201 employs a conservative approach that warns only about calls to bounded
4202 functions whose return value is unused and that will most likely result
4203 in output truncation.
4205 @item -Wformat-truncation=2
4206 Level @var{2} warns also about calls to bounded functions whose return
4207 value is used and that might result in truncation given an argument of
4208 sufficient length or magnitude.
4209 @end table
4211 @item -Wformat-y2k
4212 @opindex Wformat-y2k
4213 @opindex Wno-format-y2k
4214 If @option{-Wformat} is specified, also warn about @code{strftime}
4215 formats that may yield only a two-digit year.
4216 @end table
4218 @item -Wnonnull
4219 @opindex Wnonnull
4220 @opindex Wno-nonnull
4221 Warn about passing a null pointer for arguments marked as
4222 requiring a non-null value by the @code{nonnull} function attribute.
4224 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
4225 can be disabled with the @option{-Wno-nonnull} option.
4227 @item -Wnonnull-compare
4228 @opindex Wnonnull-compare
4229 @opindex Wno-nonnull-compare
4230 Warn when comparing an argument marked with the @code{nonnull}
4231 function attribute against null inside the function.
4233 @option{-Wnonnull-compare} is included in @option{-Wall}.  It
4234 can be disabled with the @option{-Wno-nonnull-compare} option.
4236 @item -Wnull-dereference
4237 @opindex Wnull-dereference
4238 @opindex Wno-null-dereference
4239 Warn if the compiler detects paths that trigger erroneous or
4240 undefined behavior due to dereferencing a null pointer.  This option
4241 is only active when @option{-fdelete-null-pointer-checks} is active,
4242 which is enabled by optimizations in most targets.  The precision of
4243 the warnings depends on the optimization options used.
4245 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
4246 @opindex Winit-self
4247 @opindex Wno-init-self
4248 Warn about uninitialized variables that are initialized with themselves.
4249 Note this option can only be used with the @option{-Wuninitialized} option.
4251 For example, GCC warns about @code{i} being uninitialized in the
4252 following snippet only when @option{-Winit-self} has been specified:
4253 @smallexample
4254 @group
4255 int f()
4257   int i = i;
4258   return i;
4260 @end group
4261 @end smallexample
4263 This warning is enabled by @option{-Wall} in C++.
4265 @item -Wimplicit-int @r{(C and Objective-C only)}
4266 @opindex Wimplicit-int
4267 @opindex Wno-implicit-int
4268 Warn when a declaration does not specify a type.
4269 This warning is enabled by @option{-Wall}.
4271 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
4272 @opindex Wimplicit-function-declaration
4273 @opindex Wno-implicit-function-declaration
4274 Give a warning whenever a function is used before being declared. In
4275 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
4276 enabled by default and it is made into an error by
4277 @option{-pedantic-errors}. This warning is also enabled by
4278 @option{-Wall}.
4280 @item -Wimplicit @r{(C and Objective-C only)}
4281 @opindex Wimplicit
4282 @opindex Wno-implicit
4283 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
4284 This warning is enabled by @option{-Wall}.
4286 @item -Wimplicit-fallthrough
4287 @opindex Wimplicit-fallthrough
4288 @opindex Wno-implicit-fallthrough
4289 @option{-Wimplicit-fallthrough} is the same as @option{-Wimplicit-fallthrough=3}
4290 and @option{-Wno-implicit-fallthrough} is the same as
4291 @option{-Wimplicit-fallthrough=0}.
4293 @item -Wimplicit-fallthrough=@var{n}
4294 @opindex Wimplicit-fallthrough=
4295 Warn when a switch case falls through.  For example:
4297 @smallexample
4298 @group
4299 switch (cond)
4300   @{
4301   case 1:
4302     a = 1;
4303     break;
4304   case 2:
4305     a = 2;
4306   case 3:
4307     a = 3;
4308     break;
4309   @}
4310 @end group
4311 @end smallexample
4313 This warning does not warn when the last statement of a case cannot
4314 fall through, e.g. when there is a return statement or a call to function
4315 declared with the noreturn attribute.  @option{-Wimplicit-fallthrough=}
4316 also takes into account control flow statements, such as ifs, and only
4317 warns when appropriate.  E.g.@:
4319 @smallexample
4320 @group
4321 switch (cond)
4322   @{
4323   case 1:
4324     if (i > 3) @{
4325       bar (5);
4326       break;
4327     @} else if (i < 1) @{
4328       bar (0);
4329     @} else
4330       return;
4331   default:
4332     @dots{}
4333   @}
4334 @end group
4335 @end smallexample
4337 Since there are occasions where a switch case fall through is desirable,
4338 GCC provides an attribute, @code{__attribute__ ((fallthrough))}, that is
4339 to be used along with a null statement to suppress this warning that
4340 would normally occur:
4342 @smallexample
4343 @group
4344 switch (cond)
4345   @{
4346   case 1:
4347     bar (0);
4348     __attribute__ ((fallthrough));
4349   default:
4350     @dots{}
4351   @}
4352 @end group
4353 @end smallexample
4355 C++17 provides a standard way to suppress the @option{-Wimplicit-fallthrough}
4356 warning using @code{[[fallthrough]];} instead of the GNU attribute.  In C++11
4357 or C++14 users can use @code{[[gnu::fallthrough]];}, which is a GNU extension.
4358 Instead of these attributes, it is also possible to add a fallthrough comment
4359 to silence the warning.  The whole body of the C or C++ style comment should
4360 match the given regular expressions listed below.  The option argument @var{n}
4361 specifies what kind of comments are accepted:
4363 @itemize @bullet
4365 @item @option{-Wimplicit-fallthrough=0} disables the warning altogether.
4367 @item @option{-Wimplicit-fallthrough=1} matches @code{.*} regular
4368 expression, any comment is used as fallthrough comment.
4370 @item @option{-Wimplicit-fallthrough=2} case insensitively matches
4371 @code{.*falls?[ \t-]*thr(ough|u).*} regular expression.
4373 @item @option{-Wimplicit-fallthrough=3} case sensitively matches one of the
4374 following regular expressions:
4376 @itemize @bullet
4378 @item @code{-fallthrough}
4380 @item @code{@@fallthrough@@}
4382 @item @code{lint -fallthrough[ \t]*}
4384 @item @code{[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?@*FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?}
4386 @item @code{[ \t.!]*(Else,? |Intentional(ly)? )?@*Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4388 @item @code{[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?@*fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4390 @end itemize
4392 @item @option{-Wimplicit-fallthrough=4} case sensitively matches one of the
4393 following regular expressions:
4395 @itemize @bullet
4397 @item @code{-fallthrough}
4399 @item @code{@@fallthrough@@}
4401 @item @code{lint -fallthrough[ \t]*}
4403 @item @code{[ \t]*FALLTHR(OUGH|U)[ \t]*}
4405 @end itemize
4407 @item @option{-Wimplicit-fallthrough=5} doesn't recognize any comments as
4408 fallthrough comments, only attributes disable the warning.
4410 @end itemize
4412 The comment needs to be followed after optional whitespace and other comments
4413 by @code{case} or @code{default} keywords or by a user label that precedes some
4414 @code{case} or @code{default} label.
4416 @smallexample
4417 @group
4418 switch (cond)
4419   @{
4420   case 1:
4421     bar (0);
4422     /* FALLTHRU */
4423   default:
4424     @dots{}
4425   @}
4426 @end group
4427 @end smallexample
4429 The @option{-Wimplicit-fallthrough=3} warning is enabled by @option{-Wextra}.
4431 @item -Wif-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
4432 @opindex Wif-not-aligned
4433 @opindex Wno-if-not-aligned
4434 Control if warning triggered by the @code{warn_if_not_aligned} attribute
4435 should be issued.  This is is enabled by default.
4436 Use @option{-Wno-if-not-aligned} to disable it.
4438 @item -Wignored-qualifiers @r{(C and C++ only)}
4439 @opindex Wignored-qualifiers
4440 @opindex Wno-ignored-qualifiers
4441 Warn if the return type of a function has a type qualifier
4442 such as @code{const}.  For ISO C such a type qualifier has no effect,
4443 since the value returned by a function is not an lvalue.
4444 For C++, the warning is only emitted for scalar types or @code{void}.
4445 ISO C prohibits qualified @code{void} return types on function
4446 definitions, so such return types always receive a warning
4447 even without this option.
4449 This warning is also enabled by @option{-Wextra}.
4451 @item -Wignored-attributes @r{(C and C++ only)}
4452 @opindex Wignored-attributes
4453 @opindex Wno-ignored-attributes
4454 Warn when an attribute is ignored.  This is different from the
4455 @option{-Wattributes} option in that it warns whenever the compiler decides
4456 to drop an attribute, not that the attribute is either unknown, used in a
4457 wrong place, etc.  This warning is enabled by default.
4459 @item -Wmain
4460 @opindex Wmain
4461 @opindex Wno-main
4462 Warn if the type of @code{main} is suspicious.  @code{main} should be
4463 a function with external linkage, returning int, taking either zero
4464 arguments, two, or three arguments of appropriate types.  This warning
4465 is enabled by default in C++ and is enabled by either @option{-Wall}
4466 or @option{-Wpedantic}.
4468 @item -Wmisleading-indentation @r{(C and C++ only)}
4469 @opindex Wmisleading-indentation
4470 @opindex Wno-misleading-indentation
4471 Warn when the indentation of the code does not reflect the block structure.
4472 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
4473 @code{for} clauses with a guarded statement that does not use braces,
4474 followed by an unguarded statement with the same indentation.
4476 In the following example, the call to ``bar'' is misleadingly indented as
4477 if it were guarded by the ``if'' conditional.
4479 @smallexample
4480   if (some_condition ())
4481     foo ();
4482     bar ();  /* Gotcha: this is not guarded by the "if".  */
4483 @end smallexample
4485 In the case of mixed tabs and spaces, the warning uses the
4486 @option{-ftabstop=} option to determine if the statements line up
4487 (defaulting to 8).
4489 The warning is not issued for code involving multiline preprocessor logic
4490 such as the following example.
4492 @smallexample
4493   if (flagA)
4494     foo (0);
4495 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
4496   if (flagB)
4497 #endif
4498     foo (1);
4499 @end smallexample
4501 The warning is not issued after a @code{#line} directive, since this
4502 typically indicates autogenerated code, and no assumptions can be made
4503 about the layout of the file that the directive references.
4505 This warning is enabled by @option{-Wall} in C and C++.
4507 @item -Wmissing-braces
4508 @opindex Wmissing-braces
4509 @opindex Wno-missing-braces
4510 Warn if an aggregate or union initializer is not fully bracketed.  In
4511 the following example, the initializer for @code{a} is not fully
4512 bracketed, but that for @code{b} is fully bracketed.  This warning is
4513 enabled by @option{-Wall} in C.
4515 @smallexample
4516 int a[2][2] = @{ 0, 1, 2, 3 @};
4517 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
4518 @end smallexample
4520 This warning is enabled by @option{-Wall}.
4522 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
4523 @opindex Wmissing-include-dirs
4524 @opindex Wno-missing-include-dirs
4525 Warn if a user-supplied include directory does not exist.
4527 @item -Wmultistatement-macros
4528 @opindex Wmultistatement-macros
4529 @opindex Wno-multistatement-macros
4530 Warn about unsafe multiple statement macros that appear to be guarded
4531 by a clause such as @code{if}, @code{else}, @code{for}, @code{switch}, or
4532 @code{while}, in which only the first statement is actually guarded after
4533 the macro is expanded.
4535 For example:
4537 @smallexample
4538 #define DOIT x++; y++
4539 if (c)
4540   DOIT;
4541 @end smallexample
4543 will increment @code{y} unconditionally, not just when @code{c} holds.
4544 The can usually be fixed by wrapping the macro in a do-while loop:
4545 @smallexample
4546 #define DOIT do @{ x++; y++; @} while (0)
4547 if (c)
4548   DOIT;
4549 @end smallexample
4551 This warning is enabled by @option{-Wall} in C and C++.
4553 @item -Wparentheses
4554 @opindex Wparentheses
4555 @opindex Wno-parentheses
4556 Warn if parentheses are omitted in certain contexts, such
4557 as when there is an assignment in a context where a truth value
4558 is expected, or when operators are nested whose precedence people
4559 often get confused about.
4561 Also warn if a comparison like @code{x<=y<=z} appears; this is
4562 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
4563 interpretation from that of ordinary mathematical notation.
4565 Also warn for dangerous uses of the GNU extension to
4566 @code{?:} with omitted middle operand. When the condition
4567 in the @code{?}: operator is a boolean expression, the omitted value is
4568 always 1.  Often programmers expect it to be a value computed
4569 inside the conditional expression instead.
4571 This warning is enabled by @option{-Wall}.
4573 @item -Wsequence-point
4574 @opindex Wsequence-point
4575 @opindex Wno-sequence-point
4576 Warn about code that may have undefined semantics because of violations
4577 of sequence point rules in the C and C++ standards.
4579 The C and C++ standards define the order in which expressions in a C/C++
4580 program are evaluated in terms of @dfn{sequence points}, which represent
4581 a partial ordering between the execution of parts of the program: those
4582 executed before the sequence point, and those executed after it.  These
4583 occur after the evaluation of a full expression (one which is not part
4584 of a larger expression), after the evaluation of the first operand of a
4585 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
4586 function is called (but after the evaluation of its arguments and the
4587 expression denoting the called function), and in certain other places.
4588 Other than as expressed by the sequence point rules, the order of
4589 evaluation of subexpressions of an expression is not specified.  All
4590 these rules describe only a partial order rather than a total order,
4591 since, for example, if two functions are called within one expression
4592 with no sequence point between them, the order in which the functions
4593 are called is not specified.  However, the standards committee have
4594 ruled that function calls do not overlap.
4596 It is not specified when between sequence points modifications to the
4597 values of objects take effect.  Programs whose behavior depends on this
4598 have undefined behavior; the C and C++ standards specify that ``Between
4599 the previous and next sequence point an object shall have its stored
4600 value modified at most once by the evaluation of an expression.
4601 Furthermore, the prior value shall be read only to determine the value
4602 to be stored.''.  If a program breaks these rules, the results on any
4603 particular implementation are entirely unpredictable.
4605 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
4606 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
4607 diagnosed by this option, and it may give an occasional false positive
4608 result, but in general it has been found fairly effective at detecting
4609 this sort of problem in programs.
4611 The C++17 standard will define the order of evaluation of operands in
4612 more cases: in particular it requires that the right-hand side of an
4613 assignment be evaluated before the left-hand side, so the above
4614 examples are no longer undefined.  But this warning will still warn
4615 about them, to help people avoid writing code that is undefined in C
4616 and earlier revisions of C++.
4618 The standard is worded confusingly, therefore there is some debate
4619 over the precise meaning of the sequence point rules in subtle cases.
4620 Links to discussions of the problem, including proposed formal
4621 definitions, may be found on the GCC readings page, at
4622 @uref{http://gcc.gnu.org/@/readings.html}.
4624 This warning is enabled by @option{-Wall} for C and C++.
4626 @item -Wno-return-local-addr
4627 @opindex Wno-return-local-addr
4628 @opindex Wreturn-local-addr
4629 Do not warn about returning a pointer (or in C++, a reference) to a
4630 variable that goes out of scope after the function returns.
4632 @item -Wreturn-type
4633 @opindex Wreturn-type
4634 @opindex Wno-return-type
4635 Warn whenever a function is defined with a return type that defaults
4636 to @code{int}.  Also warn about any @code{return} statement with no
4637 return value in a function whose return type is not @code{void}
4638 (falling off the end of the function body is considered returning
4639 without a value).
4641 For C only, warn about a @code{return} statement with an expression in a
4642 function whose return type is @code{void}, unless the expression type is
4643 also @code{void}.  As a GNU extension, the latter case is accepted
4644 without a warning unless @option{-Wpedantic} is used.
4646 For C++, a function without return type always produces a diagnostic
4647 message, even when @option{-Wno-return-type} is specified.  The only
4648 exceptions are @code{main} and functions defined in system headers.
4650 This warning is enabled by @option{-Wall}.
4652 @item -Wshift-count-negative
4653 @opindex Wshift-count-negative
4654 @opindex Wno-shift-count-negative
4655 Warn if shift count is negative. This warning is enabled by default.
4657 @item -Wshift-count-overflow
4658 @opindex Wshift-count-overflow
4659 @opindex Wno-shift-count-overflow
4660 Warn if shift count >= width of type. This warning is enabled by default.
4662 @item -Wshift-negative-value
4663 @opindex Wshift-negative-value
4664 @opindex Wno-shift-negative-value
4665 Warn if left shifting a negative value.  This warning is enabled by
4666 @option{-Wextra} in C99 and C++11 modes (and newer).
4668 @item -Wshift-overflow
4669 @itemx -Wshift-overflow=@var{n}
4670 @opindex Wshift-overflow
4671 @opindex Wno-shift-overflow
4672 Warn about left shift overflows.  This warning is enabled by
4673 default in C99 and C++11 modes (and newer).
4675 @table @gcctabopt
4676 @item -Wshift-overflow=1
4677 This is the warning level of @option{-Wshift-overflow} and is enabled
4678 by default in C99 and C++11 modes (and newer).  This warning level does
4679 not warn about left-shifting 1 into the sign bit.  (However, in C, such
4680 an overflow is still rejected in contexts where an integer constant expression
4681 is required.)
4683 @item -Wshift-overflow=2
4684 This warning level also warns about left-shifting 1 into the sign bit,
4685 unless C++14 mode is active.
4686 @end table
4688 @item -Wswitch
4689 @opindex Wswitch
4690 @opindex Wno-switch
4691 Warn whenever a @code{switch} statement has an index of enumerated type
4692 and lacks a @code{case} for one or more of the named codes of that
4693 enumeration.  (The presence of a @code{default} label prevents this
4694 warning.)  @code{case} labels outside the enumeration range also
4695 provoke warnings when this option is used (even if there is a
4696 @code{default} label).
4697 This warning is enabled by @option{-Wall}.
4699 @item -Wswitch-default
4700 @opindex Wswitch-default
4701 @opindex Wno-switch-default
4702 Warn whenever a @code{switch} statement does not have a @code{default}
4703 case.
4705 @item -Wswitch-enum
4706 @opindex Wswitch-enum
4707 @opindex Wno-switch-enum
4708 Warn whenever a @code{switch} statement has an index of enumerated type
4709 and lacks a @code{case} for one or more of the named codes of that
4710 enumeration.  @code{case} labels outside the enumeration range also
4711 provoke warnings when this option is used.  The only difference
4712 between @option{-Wswitch} and this option is that this option gives a
4713 warning about an omitted enumeration code even if there is a
4714 @code{default} label.
4716 @item -Wswitch-bool
4717 @opindex Wswitch-bool
4718 @opindex Wno-switch-bool
4719 Warn whenever a @code{switch} statement has an index of boolean type
4720 and the case values are outside the range of a boolean type.
4721 It is possible to suppress this warning by casting the controlling
4722 expression to a type other than @code{bool}.  For example:
4723 @smallexample
4724 @group
4725 switch ((int) (a == 4))
4726   @{
4727   @dots{}
4728   @}
4729 @end group
4730 @end smallexample
4731 This warning is enabled by default for C and C++ programs.
4733 @item -Wswitch-unreachable
4734 @opindex Wswitch-unreachable
4735 @opindex Wno-switch-unreachable
4736 Warn whenever a @code{switch} statement contains statements between the
4737 controlling expression and the first case label, which will never be
4738 executed.  For example:
4739 @smallexample
4740 @group
4741 switch (cond)
4742   @{
4743    i = 15;
4744   @dots{}
4745    case 5:
4746   @dots{}
4747   @}
4748 @end group
4749 @end smallexample
4750 @option{-Wswitch-unreachable} does not warn if the statement between the
4751 controlling expression and the first case label is just a declaration:
4752 @smallexample
4753 @group
4754 switch (cond)
4755   @{
4756    int i;
4757   @dots{}
4758    case 5:
4759    i = 5;
4760   @dots{}
4761   @}
4762 @end group
4763 @end smallexample
4764 This warning is enabled by default for C and C++ programs.
4766 @item -Wsync-nand @r{(C and C++ only)}
4767 @opindex Wsync-nand
4768 @opindex Wno-sync-nand
4769 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
4770 built-in functions are used.  These functions changed semantics in GCC 4.4.
4772 @item -Wunused-but-set-parameter
4773 @opindex Wunused-but-set-parameter
4774 @opindex Wno-unused-but-set-parameter
4775 Warn whenever a function parameter is assigned to, but otherwise unused
4776 (aside from its declaration).
4778 To suppress this warning use the @code{unused} attribute
4779 (@pxref{Variable Attributes}).
4781 This warning is also enabled by @option{-Wunused} together with
4782 @option{-Wextra}.
4784 @item -Wunused-but-set-variable
4785 @opindex Wunused-but-set-variable
4786 @opindex Wno-unused-but-set-variable
4787 Warn whenever a local variable is assigned to, but otherwise unused
4788 (aside from its declaration).
4789 This warning is enabled by @option{-Wall}.
4791 To suppress this warning use the @code{unused} attribute
4792 (@pxref{Variable Attributes}).
4794 This warning is also enabled by @option{-Wunused}, which is enabled
4795 by @option{-Wall}.
4797 @item -Wunused-function
4798 @opindex Wunused-function
4799 @opindex Wno-unused-function
4800 Warn whenever a static function is declared but not defined or a
4801 non-inline static function is unused.
4802 This warning is enabled by @option{-Wall}.
4804 @item -Wunused-label
4805 @opindex Wunused-label
4806 @opindex Wno-unused-label
4807 Warn whenever a label is declared but not used.
4808 This warning is enabled by @option{-Wall}.
4810 To suppress this warning use the @code{unused} attribute
4811 (@pxref{Variable Attributes}).
4813 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
4814 @opindex Wunused-local-typedefs
4815 Warn when a typedef locally defined in a function is not used.
4816 This warning is enabled by @option{-Wall}.
4818 @item -Wunused-parameter
4819 @opindex Wunused-parameter
4820 @opindex Wno-unused-parameter
4821 Warn whenever a function parameter is unused aside from its declaration.
4823 To suppress this warning use the @code{unused} attribute
4824 (@pxref{Variable Attributes}).
4826 @item -Wno-unused-result
4827 @opindex Wunused-result
4828 @opindex Wno-unused-result
4829 Do not warn if a caller of a function marked with attribute
4830 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
4831 its return value. The default is @option{-Wunused-result}.
4833 @item -Wunused-variable
4834 @opindex Wunused-variable
4835 @opindex Wno-unused-variable
4836 Warn whenever a local or static variable is unused aside from its
4837 declaration. This option implies @option{-Wunused-const-variable=1} for C,
4838 but not for C++. This warning is enabled by @option{-Wall}.
4840 To suppress this warning use the @code{unused} attribute
4841 (@pxref{Variable Attributes}).
4843 @item -Wunused-const-variable
4844 @itemx -Wunused-const-variable=@var{n}
4845 @opindex Wunused-const-variable
4846 @opindex Wno-unused-const-variable
4847 Warn whenever a constant static variable is unused aside from its declaration.
4848 @option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
4849 for C, but not for C++. In C this declares variable storage, but in C++ this
4850 is not an error since const variables take the place of @code{#define}s.
4852 To suppress this warning use the @code{unused} attribute
4853 (@pxref{Variable Attributes}).
4855 @table @gcctabopt
4856 @item -Wunused-const-variable=1
4857 This is the warning level that is enabled by @option{-Wunused-variable} for
4858 C.  It warns only about unused static const variables defined in the main
4859 compilation unit, but not about static const variables declared in any
4860 header included.
4862 @item -Wunused-const-variable=2
4863 This warning level also warns for unused constant static variables in
4864 headers (excluding system headers).  This is the warning level of
4865 @option{-Wunused-const-variable} and must be explicitly requested since
4866 in C++ this isn't an error and in C it might be harder to clean up all
4867 headers included.
4868 @end table
4870 @item -Wunused-value
4871 @opindex Wunused-value
4872 @opindex Wno-unused-value
4873 Warn whenever a statement computes a result that is explicitly not
4874 used. To suppress this warning cast the unused expression to
4875 @code{void}. This includes an expression-statement or the left-hand
4876 side of a comma expression that contains no side effects. For example,
4877 an expression such as @code{x[i,j]} causes a warning, while
4878 @code{x[(void)i,j]} does not.
4880 This warning is enabled by @option{-Wall}.
4882 @item -Wunused
4883 @opindex Wunused
4884 @opindex Wno-unused
4885 All the above @option{-Wunused} options combined.
4887 In order to get a warning about an unused function parameter, you must
4888 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
4889 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
4891 @item -Wuninitialized
4892 @opindex Wuninitialized
4893 @opindex Wno-uninitialized
4894 Warn if an automatic variable is used without first being initialized
4895 or if a variable may be clobbered by a @code{setjmp} call. In C++,
4896 warn if a non-static reference or non-static @code{const} member
4897 appears in a class without constructors.
4899 If you want to warn about code that uses the uninitialized value of the
4900 variable in its own initializer, use the @option{-Winit-self} option.
4902 These warnings occur for individual uninitialized or clobbered
4903 elements of structure, union or array variables as well as for
4904 variables that are uninitialized or clobbered as a whole.  They do
4905 not occur for variables or elements declared @code{volatile}.  Because
4906 these warnings depend on optimization, the exact variables or elements
4907 for which there are warnings depends on the precise optimization
4908 options and version of GCC used.
4910 Note that there may be no warning about a variable that is used only
4911 to compute a value that itself is never used, because such
4912 computations may be deleted by data flow analysis before the warnings
4913 are printed.
4915 @item -Winvalid-memory-model
4916 @opindex Winvalid-memory-model
4917 @opindex Wno-invalid-memory-model
4918 Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
4919 and the C11 atomic generic functions with a memory consistency argument
4920 that is either invalid for the operation or outside the range of values
4921 of the @code{memory_order} enumeration.  For example, since the
4922 @code{__atomic_store} and @code{__atomic_store_n} built-ins are only
4923 defined for the relaxed, release, and sequentially consistent memory
4924 orders the following code is diagnosed:
4926 @smallexample
4927 void store (int *i)
4929   __atomic_store_n (i, 0, memory_order_consume);
4931 @end smallexample
4933 @option{-Winvalid-memory-model} is enabled by default.
4935 @item -Wmaybe-uninitialized
4936 @opindex Wmaybe-uninitialized
4937 @opindex Wno-maybe-uninitialized
4938 For an automatic variable, if there exists a path from the function
4939 entry to a use of the variable that is initialized, but there exist
4940 some other paths for which the variable is not initialized, the compiler
4941 emits a warning if it cannot prove the uninitialized paths are not
4942 executed at run time. These warnings are made optional because GCC is
4943 not smart enough to see all the reasons why the code might be correct
4944 in spite of appearing to have an error.  Here is one example of how
4945 this can happen:
4947 @smallexample
4948 @group
4950   int x;
4951   switch (y)
4952     @{
4953     case 1: x = 1;
4954       break;
4955     case 2: x = 4;
4956       break;
4957     case 3: x = 5;
4958     @}
4959   foo (x);
4961 @end group
4962 @end smallexample
4964 @noindent
4965 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4966 always initialized, but GCC doesn't know this. To suppress the
4967 warning, you need to provide a default case with assert(0) or
4968 similar code.
4970 @cindex @code{longjmp} warnings
4971 This option also warns when a non-volatile automatic variable might be
4972 changed by a call to @code{longjmp}.  These warnings as well are possible
4973 only in optimizing compilation.
4975 The compiler sees only the calls to @code{setjmp}.  It cannot know
4976 where @code{longjmp} will be called; in fact, a signal handler could
4977 call it at any point in the code.  As a result, you may get a warning
4978 even when there is in fact no problem because @code{longjmp} cannot
4979 in fact be called at the place that would cause a problem.
4981 Some spurious warnings can be avoided if you declare all the functions
4982 you use that never return as @code{noreturn}.  @xref{Function
4983 Attributes}.
4985 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4987 @item -Wunknown-pragmas
4988 @opindex Wunknown-pragmas
4989 @opindex Wno-unknown-pragmas
4990 @cindex warning for unknown pragmas
4991 @cindex unknown pragmas, warning
4992 @cindex pragmas, warning of unknown
4993 Warn when a @code{#pragma} directive is encountered that is not understood by 
4994 GCC@.  If this command-line option is used, warnings are even issued
4995 for unknown pragmas in system header files.  This is not the case if
4996 the warnings are only enabled by the @option{-Wall} command-line option.
4998 @item -Wno-pragmas
4999 @opindex Wno-pragmas
5000 @opindex Wpragmas
5001 Do not warn about misuses of pragmas, such as incorrect parameters,
5002 invalid syntax, or conflicts between pragmas.  See also
5003 @option{-Wunknown-pragmas}.
5005 @item -Wstrict-aliasing
5006 @opindex Wstrict-aliasing
5007 @opindex Wno-strict-aliasing
5008 This option is only active when @option{-fstrict-aliasing} is active.
5009 It warns about code that might break the strict aliasing rules that the
5010 compiler is using for optimization.  The warning does not catch all
5011 cases, but does attempt to catch the more common pitfalls.  It is
5012 included in @option{-Wall}.
5013 It is equivalent to @option{-Wstrict-aliasing=3}
5015 @item -Wstrict-aliasing=n
5016 @opindex Wstrict-aliasing=n
5017 This option is only active when @option{-fstrict-aliasing} is active.
5018 It warns about code that might break the strict aliasing rules that the
5019 compiler is using for optimization.
5020 Higher levels correspond to higher accuracy (fewer false positives).
5021 Higher levels also correspond to more effort, similar to the way @option{-O} 
5022 works.
5023 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
5025 Level 1: Most aggressive, quick, least accurate.
5026 Possibly useful when higher levels
5027 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
5028 false negatives.  However, it has many false positives.
5029 Warns for all pointer conversions between possibly incompatible types,
5030 even if never dereferenced.  Runs in the front end only.
5032 Level 2: Aggressive, quick, not too precise.
5033 May still have many false positives (not as many as level 1 though),
5034 and few false negatives (but possibly more than level 1).
5035 Unlike level 1, it only warns when an address is taken.  Warns about
5036 incomplete types.  Runs in the front end only.
5038 Level 3 (default for @option{-Wstrict-aliasing}):
5039 Should have very few false positives and few false
5040 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
5041 Takes care of the common pun+dereference pattern in the front end:
5042 @code{*(int*)&some_float}.
5043 If optimization is enabled, it also runs in the back end, where it deals
5044 with multiple statement cases using flow-sensitive points-to information.
5045 Only warns when the converted pointer is dereferenced.
5046 Does not warn about incomplete types.
5048 @item -Wstrict-overflow
5049 @itemx -Wstrict-overflow=@var{n}
5050 @opindex Wstrict-overflow
5051 @opindex Wno-strict-overflow
5052 This option is only active when signed overflow is undefined.
5053 It warns about cases where the compiler optimizes based on the
5054 assumption that signed overflow does not occur.  Note that it does not
5055 warn about all cases where the code might overflow: it only warns
5056 about cases where the compiler implements some optimization.  Thus
5057 this warning depends on the optimization level.
5059 An optimization that assumes that signed overflow does not occur is
5060 perfectly safe if the values of the variables involved are such that
5061 overflow never does, in fact, occur.  Therefore this warning can
5062 easily give a false positive: a warning about code that is not
5063 actually a problem.  To help focus on important issues, several
5064 warning levels are defined.  No warnings are issued for the use of
5065 undefined signed overflow when estimating how many iterations a loop
5066 requires, in particular when determining whether a loop will be
5067 executed at all.
5069 @table @gcctabopt
5070 @item -Wstrict-overflow=1
5071 Warn about cases that are both questionable and easy to avoid.  For
5072 example the compiler simplifies
5073 @code{x + 1 > x} to @code{1}.  This level of
5074 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
5075 are not, and must be explicitly requested.
5077 @item -Wstrict-overflow=2
5078 Also warn about other cases where a comparison is simplified to a
5079 constant.  For example: @code{abs (x) >= 0}.  This can only be
5080 simplified when signed integer overflow is undefined, because
5081 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
5082 zero.  @option{-Wstrict-overflow} (with no level) is the same as
5083 @option{-Wstrict-overflow=2}.
5085 @item -Wstrict-overflow=3
5086 Also warn about other cases where a comparison is simplified.  For
5087 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
5089 @item -Wstrict-overflow=4
5090 Also warn about other simplifications not covered by the above cases.
5091 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
5093 @item -Wstrict-overflow=5
5094 Also warn about cases where the compiler reduces the magnitude of a
5095 constant involved in a comparison.  For example: @code{x + 2 > y} is
5096 simplified to @code{x + 1 >= y}.  This is reported only at the
5097 highest warning level because this simplification applies to many
5098 comparisons, so this warning level gives a very large number of
5099 false positives.
5100 @end table
5102 @item -Wstringop-overflow
5103 @itemx -Wstringop-overflow=@var{type}
5104 @opindex Wstringop-overflow
5105 @opindex Wno-stringop-overflow
5106 Warn for calls to string manipulation functions such as @code{memcpy} and
5107 @code{strcpy} that are determined to overflow the destination buffer.  The
5108 optional argument is one greater than the type of Object Size Checking to
5109 perform to determine the size of the destination.  @xref{Object Size Checking}.
5110 The argument is meaningful only for functions that operate on character arrays
5111 but not for raw memory functions like @code{memcpy} which always make use
5112 of Object Size type-0.  The option also warns for calls that specify a size
5113 in excess of the largest possible object or at most @code{SIZE_MAX / 2} bytes.
5114 The option produces the best results with optimization enabled but can detect
5115 a small subset of simple buffer overflows even without optimization in
5116 calls to the GCC built-in functions like @code{__builtin_memcpy} that
5117 correspond to the standard functions.  In any case, the option warns about
5118 just a subset of buffer overflows detected by the corresponding overflow
5119 checking built-ins.  For example, the option will issue a warning for
5120 the @code{strcpy} call below because it copies at least 5 characters
5121 (the string @code{"blue"} including the terminating NUL) into the buffer
5122 of size 4.
5124 @smallexample
5125 enum Color @{ blue, purple, yellow @};
5126 const char* f (enum Color clr)
5128   static char buf [4];
5129   const char *str;
5130   switch (clr)
5131     @{
5132       case blue: str = "blue"; break;
5133       case purple: str = "purple"; break;
5134       case yellow: str = "yellow"; break;
5135     @}
5137   return strcpy (buf, str);   // warning here
5139 @end smallexample
5141 Option @option{-Wstringop-overflow=2} is enabled by default.
5143 @table @gcctabopt
5144 @item -Wstringop-overflow
5145 @item -Wstringop-overflow=1
5146 @opindex Wstringop-overflow
5147 @opindex Wno-stringop-overflow
5148 The @option{-Wstringop-overflow=1} option uses type-zero Object Size Checking
5149 to determine the sizes of destination objects.  This is the default setting
5150 of the option.  At this setting the option will not warn for writes past
5151 the end of subobjects of larger objects accessed by pointers unless the
5152 size of the largest surrounding object is known.  When the destination may
5153 be one of several objects it is assumed to be the largest one of them.  On
5154 Linux systems, when optimization is enabled at this setting the option warns
5155 for the same code as when the @code{_FORTIFY_SOURCE} macro is defined to
5156 a non-zero value.
5158 @item -Wstringop-overflow=2
5159 The @option{-Wstringop-overflow=2} option uses type-one Object Size Checking
5160 to determine the sizes of destination objects.  At this setting the option
5161 will warn about overflows when writing to members of the largest complete
5162 objects whose exact size is known.  It will, however, not warn for excessive
5163 writes to the same members of unknown objects referenced by pointers since
5164 they may point to arrays containing unknown numbers of elements.
5166 @item -Wstringop-overflow=3
5167 The @option{-Wstringop-overflow=3} option uses type-two Object Size Checking
5168 to determine the sizes of destination objects.  At this setting the option
5169 warns about overflowing the smallest object or data member.  This is the
5170 most restrictive setting of the option that may result in warnings for safe
5171 code.
5173 @item -Wstringop-overflow=4
5174 The @option{-Wstringop-overflow=4} option uses type-three Object Size Checking
5175 to determine the sizes of destination objects.  At this setting the option
5176 will warn about overflowing any data members, and when the destination is
5177 one of several objects it uses the size of the largest of them to decide
5178 whether to issue a warning.  Similarly to @option{-Wstringop-overflow=3} this
5179 setting of the option may result in warnings for benign code.
5180 @end table
5182 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
5183 @opindex Wsuggest-attribute=
5184 @opindex Wno-suggest-attribute=
5185 Warn for cases where adding an attribute may be beneficial. The
5186 attributes currently supported are listed below.
5188 @table @gcctabopt
5189 @item -Wsuggest-attribute=pure
5190 @itemx -Wsuggest-attribute=const
5191 @itemx -Wsuggest-attribute=noreturn
5192 @opindex Wsuggest-attribute=pure
5193 @opindex Wno-suggest-attribute=pure
5194 @opindex Wsuggest-attribute=const
5195 @opindex Wno-suggest-attribute=const
5196 @opindex Wsuggest-attribute=noreturn
5197 @opindex Wno-suggest-attribute=noreturn
5199 Warn about functions that might be candidates for attributes
5200 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
5201 functions visible in other compilation units or (in the case of @code{pure} and
5202 @code{const}) if it cannot prove that the function returns normally. A function
5203 returns normally if it doesn't contain an infinite loop or return abnormally
5204 by throwing, calling @code{abort} or trapping.  This analysis requires option
5205 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
5206 higher.  Higher optimization levels improve the accuracy of the analysis.
5208 @item -Wsuggest-attribute=format
5209 @itemx -Wmissing-format-attribute
5210 @opindex Wsuggest-attribute=format
5211 @opindex Wmissing-format-attribute
5212 @opindex Wno-suggest-attribute=format
5213 @opindex Wno-missing-format-attribute
5214 @opindex Wformat
5215 @opindex Wno-format
5217 Warn about function pointers that might be candidates for @code{format}
5218 attributes.  Note these are only possible candidates, not absolute ones.
5219 GCC guesses that function pointers with @code{format} attributes that
5220 are used in assignment, initialization, parameter passing or return
5221 statements should have a corresponding @code{format} attribute in the
5222 resulting type.  I.e.@: the left-hand side of the assignment or
5223 initialization, the type of the parameter variable, or the return type
5224 of the containing function respectively should also have a @code{format}
5225 attribute to avoid the warning.
5227 GCC also warns about function definitions that might be
5228 candidates for @code{format} attributes.  Again, these are only
5229 possible candidates.  GCC guesses that @code{format} attributes
5230 might be appropriate for any function that calls a function like
5231 @code{vprintf} or @code{vscanf}, but this might not always be the
5232 case, and some functions for which @code{format} attributes are
5233 appropriate may not be detected.
5234 @end table
5236 @item -Wsuggest-final-types
5237 @opindex Wno-suggest-final-types
5238 @opindex Wsuggest-final-types
5239 Warn about types with virtual methods where code quality would be improved
5240 if the type were declared with the C++11 @code{final} specifier, 
5241 or, if possible,
5242 declared in an anonymous namespace. This allows GCC to more aggressively
5243 devirtualize the polymorphic calls. This warning is more effective with link
5244 time optimization, where the information about the class hierarchy graph is
5245 more complete.
5247 @item -Wsuggest-final-methods
5248 @opindex Wno-suggest-final-methods
5249 @opindex Wsuggest-final-methods
5250 Warn about virtual methods where code quality would be improved if the method
5251 were declared with the C++11 @code{final} specifier, 
5252 or, if possible, its type were
5253 declared in an anonymous namespace or with the @code{final} specifier.
5254 This warning is
5255 more effective with link-time optimization, where the information about the
5256 class hierarchy graph is more complete. It is recommended to first consider
5257 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
5258 annotations.
5260 @item -Wsuggest-override
5261 Warn about overriding virtual functions that are not marked with the override
5262 keyword.
5264 @item -Walloc-zero
5265 @opindex Wno-alloc-zero
5266 @opindex Walloc-zero
5267 Warn about calls to allocation functions decorated with attribute
5268 @code{alloc_size} that specify zero bytes, including those to the built-in
5269 forms of the functions @code{aligned_alloc}, @code{alloca}, @code{calloc},
5270 @code{malloc}, and @code{realloc}.  Because the behavior of these functions
5271 when called with a zero size differs among implementations (and in the case
5272 of @code{realloc} has been deprecated) relying on it may result in subtle
5273 portability bugs and should be avoided.
5275 @item -Walloc-size-larger-than=@var{n}
5276 Warn about calls to functions decorated with attribute @code{alloc_size}
5277 that attempt to allocate objects larger than the specified number of bytes,
5278 or where the result of the size computation in an integer type with infinite
5279 precision would exceed @code{SIZE_MAX / 2}.  The option argument @var{n}
5280 may end in one of the standard suffixes designating a multiple of bytes
5281 such as @code{kB} and @code{KiB} for kilobyte and kibibyte, respectively,
5282 @code{MB} and @code{MiB} for megabyte and mebibyte, and so on.
5283 @xref{Function Attributes}.
5285 @item -Walloca
5286 @opindex Wno-alloca
5287 @opindex Walloca
5288 This option warns on all uses of @code{alloca} in the source.
5290 @item -Walloca-larger-than=@var{n}
5291 This option warns on calls to @code{alloca} that are not bounded by a
5292 controlling predicate limiting its argument of integer type to at most
5293 @var{n} bytes, or calls to @code{alloca} where the bound is unknown.
5294 Arguments of non-integer types are considered unbounded even if they
5295 appear to be constrained to the expected range.
5297 For example, a bounded case of @code{alloca} could be:
5299 @smallexample
5300 void func (size_t n)
5302   void *p;
5303   if (n <= 1000)
5304     p = alloca (n);
5305   else
5306     p = malloc (n);
5307   f (p);
5309 @end smallexample
5311 In the above example, passing @code{-Walloca-larger-than=1000} would not
5312 issue a warning because the call to @code{alloca} is known to be at most
5313 1000 bytes.  However, if @code{-Walloca-larger-than=500} were passed,
5314 the compiler would emit a warning.
5316 Unbounded uses, on the other hand, are uses of @code{alloca} with no
5317 controlling predicate constraining its integer argument.  For example:
5319 @smallexample
5320 void func ()
5322   void *p = alloca (n);
5323   f (p);
5325 @end smallexample
5327 If @code{-Walloca-larger-than=500} were passed, the above would trigger
5328 a warning, but this time because of the lack of bounds checking.
5330 Note, that even seemingly correct code involving signed integers could
5331 cause a warning:
5333 @smallexample
5334 void func (signed int n)
5336   if (n < 500)
5337     @{
5338       p = alloca (n);
5339       f (p);
5340     @}
5342 @end smallexample
5344 In the above example, @var{n} could be negative, causing a larger than
5345 expected argument to be implicitly cast into the @code{alloca} call.
5347 This option also warns when @code{alloca} is used in a loop.
5349 This warning is not enabled by @option{-Wall}, and is only active when
5350 @option{-ftree-vrp} is active (default for @option{-O2} and above).
5352 See also @option{-Wvla-larger-than=@var{n}}.
5354 @item -Warray-bounds
5355 @itemx -Warray-bounds=@var{n}
5356 @opindex Wno-array-bounds
5357 @opindex Warray-bounds
5358 This option is only active when @option{-ftree-vrp} is active
5359 (default for @option{-O2} and above). It warns about subscripts to arrays
5360 that are always out of bounds. This warning is enabled by @option{-Wall}.
5362 @table @gcctabopt
5363 @item -Warray-bounds=1
5364 This is the warning level of @option{-Warray-bounds} and is enabled
5365 by @option{-Wall}; higher levels are not, and must be explicitly requested.
5367 @item -Warray-bounds=2
5368 This warning level also warns about out of bounds access for
5369 arrays at the end of a struct and for arrays accessed through
5370 pointers. This warning level may give a larger number of
5371 false positives and is deactivated by default.
5372 @end table
5374 @item -Wbool-compare
5375 @opindex Wno-bool-compare
5376 @opindex Wbool-compare
5377 Warn about boolean expression compared with an integer value different from
5378 @code{true}/@code{false}.  For instance, the following comparison is
5379 always false:
5380 @smallexample
5381 int n = 5;
5382 @dots{}
5383 if ((n > 1) == 2) @{ @dots{} @}
5384 @end smallexample
5385 This warning is enabled by @option{-Wall}.
5387 @item -Wbool-operation
5388 @opindex Wno-bool-operation
5389 @opindex Wbool-operation
5390 Warn about suspicious operations on expressions of a boolean type.  For
5391 instance, bitwise negation of a boolean is very likely a bug in the program.
5392 For C, this warning also warns about incrementing or decrementing a boolean,
5393 which rarely makes sense.  (In C++, decrementing a boolean is always invalid.
5394 Incrementing a boolean is invalid in C++1z, and deprecated otherwise.)
5396 This warning is enabled by @option{-Wall}.
5398 @item -Wduplicated-branches
5399 @opindex Wno-duplicated-branches
5400 @opindex Wduplicated-branches
5401 Warn when an if-else has identical branches.  This warning detects cases like
5402 @smallexample
5403 if (p != NULL)
5404   return 0;
5405 else
5406   return 0;
5407 @end smallexample
5408 It doesn't warn when both branches contain just a null statement.  This warning
5409 also warn for conditional operators:
5410 @smallexample
5411   int i = x ? *p : *p;
5412 @end smallexample
5414 @item -Wduplicated-cond
5415 @opindex Wno-duplicated-cond
5416 @opindex Wduplicated-cond
5417 Warn about duplicated conditions in an if-else-if chain.  For instance,
5418 warn for the following code:
5419 @smallexample
5420 if (p->q != NULL) @{ @dots{} @}
5421 else if (p->q != NULL) @{ @dots{} @}
5422 @end smallexample
5424 @item -Wframe-address
5425 @opindex Wno-frame-address
5426 @opindex Wframe-address
5427 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
5428 is called with an argument greater than 0.  Such calls may return indeterminate
5429 values or crash the program.  The warning is included in @option{-Wall}.
5431 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
5432 @opindex Wno-discarded-qualifiers
5433 @opindex Wdiscarded-qualifiers
5434 Do not warn if type qualifiers on pointers are being discarded.
5435 Typically, the compiler warns if a @code{const char *} variable is
5436 passed to a function that takes a @code{char *} parameter.  This option
5437 can be used to suppress such a warning.
5439 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
5440 @opindex Wno-discarded-array-qualifiers
5441 @opindex Wdiscarded-array-qualifiers
5442 Do not warn if type qualifiers on arrays which are pointer targets
5443 are being discarded. Typically, the compiler warns if a
5444 @code{const int (*)[]} variable is passed to a function that
5445 takes a @code{int (*)[]} parameter.  This option can be used to
5446 suppress such a warning.
5448 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
5449 @opindex Wno-incompatible-pointer-types
5450 @opindex Wincompatible-pointer-types
5451 Do not warn when there is a conversion between pointers that have incompatible
5452 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
5453 which warns for pointer argument passing or assignment with different
5454 signedness.
5456 @item -Wno-int-conversion @r{(C and Objective-C only)}
5457 @opindex Wno-int-conversion
5458 @opindex Wint-conversion
5459 Do not warn about incompatible integer to pointer and pointer to integer
5460 conversions.  This warning is about implicit conversions; for explicit
5461 conversions the warnings @option{-Wno-int-to-pointer-cast} and
5462 @option{-Wno-pointer-to-int-cast} may be used.
5464 @item -Wno-div-by-zero
5465 @opindex Wno-div-by-zero
5466 @opindex Wdiv-by-zero
5467 Do not warn about compile-time integer division by zero.  Floating-point
5468 division by zero is not warned about, as it can be a legitimate way of
5469 obtaining infinities and NaNs.
5471 @item -Wsystem-headers
5472 @opindex Wsystem-headers
5473 @opindex Wno-system-headers
5474 @cindex warnings from system headers
5475 @cindex system headers, warnings from
5476 Print warning messages for constructs found in system header files.
5477 Warnings from system headers are normally suppressed, on the assumption
5478 that they usually do not indicate real problems and would only make the
5479 compiler output harder to read.  Using this command-line option tells
5480 GCC to emit warnings from system headers as if they occurred in user
5481 code.  However, note that using @option{-Wall} in conjunction with this
5482 option does @emph{not} warn about unknown pragmas in system
5483 headers---for that, @option{-Wunknown-pragmas} must also be used.
5485 @item -Wtautological-compare
5486 @opindex Wtautological-compare
5487 @opindex Wno-tautological-compare
5488 Warn if a self-comparison always evaluates to true or false.  This
5489 warning detects various mistakes such as:
5490 @smallexample
5491 int i = 1;
5492 @dots{}
5493 if (i > i) @{ @dots{} @}
5494 @end smallexample
5496 This warning also warns about bitwise comparisons that always evaluate
5497 to true or false, for instance:
5498 @smallexample
5499 if ((a & 16) == 10) @{ @dots{} @}
5500 @end smallexample
5501 will always be false.
5503 This warning is enabled by @option{-Wall}.
5505 @item -Wtrampolines
5506 @opindex Wtrampolines
5507 @opindex Wno-trampolines
5508 Warn about trampolines generated for pointers to nested functions.
5509 A trampoline is a small piece of data or code that is created at run
5510 time on the stack when the address of a nested function is taken, and is
5511 used to call the nested function indirectly.  For some targets, it is
5512 made up of data only and thus requires no special treatment.  But, for
5513 most targets, it is made up of code and thus requires the stack to be
5514 made executable in order for the program to work properly.
5516 @item -Wfloat-equal
5517 @opindex Wfloat-equal
5518 @opindex Wno-float-equal
5519 Warn if floating-point values are used in equality comparisons.
5521 The idea behind this is that sometimes it is convenient (for the
5522 programmer) to consider floating-point values as approximations to
5523 infinitely precise real numbers.  If you are doing this, then you need
5524 to compute (by analyzing the code, or in some other way) the maximum or
5525 likely maximum error that the computation introduces, and allow for it
5526 when performing comparisons (and when producing output, but that's a
5527 different problem).  In particular, instead of testing for equality, you
5528 should check to see whether the two values have ranges that overlap; and
5529 this is done with the relational operators, so equality comparisons are
5530 probably mistaken.
5532 @item -Wtraditional @r{(C and Objective-C only)}
5533 @opindex Wtraditional
5534 @opindex Wno-traditional
5535 Warn about certain constructs that behave differently in traditional and
5536 ISO C@.  Also warn about ISO C constructs that have no traditional C
5537 equivalent, and/or problematic constructs that should be avoided.
5539 @itemize @bullet
5540 @item
5541 Macro parameters that appear within string literals in the macro body.
5542 In traditional C macro replacement takes place within string literals,
5543 but in ISO C it does not.
5545 @item
5546 In traditional C, some preprocessor directives did not exist.
5547 Traditional preprocessors only considered a line to be a directive
5548 if the @samp{#} appeared in column 1 on the line.  Therefore
5549 @option{-Wtraditional} warns about directives that traditional C
5550 understands but ignores because the @samp{#} does not appear as the
5551 first character on the line.  It also suggests you hide directives like
5552 @code{#pragma} not understood by traditional C by indenting them.  Some
5553 traditional implementations do not recognize @code{#elif}, so this option
5554 suggests avoiding it altogether.
5556 @item
5557 A function-like macro that appears without arguments.
5559 @item
5560 The unary plus operator.
5562 @item
5563 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
5564 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
5565 constants.)  Note, these suffixes appear in macros defined in the system
5566 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
5567 Use of these macros in user code might normally lead to spurious
5568 warnings, however GCC's integrated preprocessor has enough context to
5569 avoid warning in these cases.
5571 @item
5572 A function declared external in one block and then used after the end of
5573 the block.
5575 @item
5576 A @code{switch} statement has an operand of type @code{long}.
5578 @item
5579 A non-@code{static} function declaration follows a @code{static} one.
5580 This construct is not accepted by some traditional C compilers.
5582 @item
5583 The ISO type of an integer constant has a different width or
5584 signedness from its traditional type.  This warning is only issued if
5585 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
5586 typically represent bit patterns, are not warned about.
5588 @item
5589 Usage of ISO string concatenation is detected.
5591 @item
5592 Initialization of automatic aggregates.
5594 @item
5595 Identifier conflicts with labels.  Traditional C lacks a separate
5596 namespace for labels.
5598 @item
5599 Initialization of unions.  If the initializer is zero, the warning is
5600 omitted.  This is done under the assumption that the zero initializer in
5601 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
5602 initializer warnings and relies on default initialization to zero in the
5603 traditional C case.
5605 @item
5606 Conversions by prototypes between fixed/floating-point values and vice
5607 versa.  The absence of these prototypes when compiling with traditional
5608 C causes serious problems.  This is a subset of the possible
5609 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
5611 @item
5612 Use of ISO C style function definitions.  This warning intentionally is
5613 @emph{not} issued for prototype declarations or variadic functions
5614 because these ISO C features appear in your code when using
5615 libiberty's traditional C compatibility macros, @code{PARAMS} and
5616 @code{VPARAMS}.  This warning is also bypassed for nested functions
5617 because that feature is already a GCC extension and thus not relevant to
5618 traditional C compatibility.
5619 @end itemize
5621 @item -Wtraditional-conversion @r{(C and Objective-C only)}
5622 @opindex Wtraditional-conversion
5623 @opindex Wno-traditional-conversion
5624 Warn if a prototype causes a type conversion that is different from what
5625 would happen to the same argument in the absence of a prototype.  This
5626 includes conversions of fixed point to floating and vice versa, and
5627 conversions changing the width or signedness of a fixed-point argument
5628 except when the same as the default promotion.
5630 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
5631 @opindex Wdeclaration-after-statement
5632 @opindex Wno-declaration-after-statement
5633 Warn when a declaration is found after a statement in a block.  This
5634 construct, known from C++, was introduced with ISO C99 and is by default
5635 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
5637 @item -Wshadow
5638 @opindex Wshadow
5639 @opindex Wno-shadow
5640 Warn whenever a local variable or type declaration shadows another
5641 variable, parameter, type, class member (in C++), or instance variable
5642 (in Objective-C) or whenever a built-in function is shadowed. Note
5643 that in C++, the compiler warns if a local variable shadows an
5644 explicit typedef, but not if it shadows a struct/class/enum.
5645 Same as @option{-Wshadow=global}.
5647 @item -Wno-shadow-ivar @r{(Objective-C only)}
5648 @opindex Wno-shadow-ivar
5649 @opindex Wshadow-ivar
5650 Do not warn whenever a local variable shadows an instance variable in an
5651 Objective-C method.
5653 @item -Wshadow=global
5654 @opindex Wshadow=local
5655 The default for @option{-Wshadow}. Warns for any (global) shadowing.
5657 @item -Wshadow=local
5658 @opindex Wshadow=local
5659 Warn when a local variable shadows another local variable or parameter.
5660 This warning is enabled by @option{-Wshadow=global}.
5662 @item -Wshadow=compatible-local
5663 @opindex Wshadow=compatible-local
5664 Warn when a local variable shadows another local variable or parameter
5665 whose type is compatible with that of the shadowing variable. In C++,
5666 type compatibility here means the type of the shadowing variable can be
5667 converted to that of the shadowed variable. The creation of this flag
5668 (in addition to @option{-Wshadow=local}) is based on the idea that when
5669 a local variable shadows another one of incompatible type, it is most
5670 likely intentional, not a bug or typo, as shown in the following example:
5672 @smallexample
5673 @group
5674 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
5676   for (int i = 0; i < N; ++i)
5677   @{
5678     ...
5679   @}
5680   ...
5682 @end group
5683 @end smallexample
5685 Since the two variable @code{i} in the example above have incompatible types,
5686 enabling only @option{-Wshadow=compatible-local} will not emit a warning.
5687 Because their types are incompatible, if a programmer accidentally uses one
5688 in place of the other, type checking will catch that and emit an error or
5689 warning. So not warning (about shadowing) in this case will not lead to
5690 undetected bugs. Use of this flag instead of @option{-Wshadow=local} can
5691 possibly reduce the number of warnings triggered by intentional shadowing.
5693 This warning is enabled by @option{-Wshadow=local}.
5695 @item -Wlarger-than=@var{len}
5696 @opindex Wlarger-than=@var{len}
5697 @opindex Wlarger-than-@var{len}
5698 Warn whenever an object of larger than @var{len} bytes is defined.
5700 @item -Wframe-larger-than=@var{len}
5701 @opindex Wframe-larger-than
5702 Warn if the size of a function frame is larger than @var{len} bytes.
5703 The computation done to determine the stack frame size is approximate
5704 and not conservative.
5705 The actual requirements may be somewhat greater than @var{len}
5706 even if you do not get a warning.  In addition, any space allocated
5707 via @code{alloca}, variable-length arrays, or related constructs
5708 is not included by the compiler when determining
5709 whether or not to issue a warning.
5711 @item -Wno-free-nonheap-object
5712 @opindex Wno-free-nonheap-object
5713 @opindex Wfree-nonheap-object
5714 Do not warn when attempting to free an object that was not allocated
5715 on the heap.
5717 @item -Wstack-usage=@var{len}
5718 @opindex Wstack-usage
5719 Warn if the stack usage of a function might be larger than @var{len} bytes.
5720 The computation done to determine the stack usage is conservative.
5721 Any space allocated via @code{alloca}, variable-length arrays, or related
5722 constructs is included by the compiler when determining whether or not to
5723 issue a warning.
5725 The message is in keeping with the output of @option{-fstack-usage}.
5727 @itemize
5728 @item
5729 If the stack usage is fully static but exceeds the specified amount, it's:
5731 @smallexample
5732   warning: stack usage is 1120 bytes
5733 @end smallexample
5734 @item
5735 If the stack usage is (partly) dynamic but bounded, it's:
5737 @smallexample
5738   warning: stack usage might be 1648 bytes
5739 @end smallexample
5740 @item
5741 If the stack usage is (partly) dynamic and not bounded, it's:
5743 @smallexample
5744   warning: stack usage might be unbounded
5745 @end smallexample
5746 @end itemize
5748 @item -Wunsafe-loop-optimizations
5749 @opindex Wunsafe-loop-optimizations
5750 @opindex Wno-unsafe-loop-optimizations
5751 Warn if the loop cannot be optimized because the compiler cannot
5752 assume anything on the bounds of the loop indices.  With
5753 @option{-funsafe-loop-optimizations} warn if the compiler makes
5754 such assumptions.
5756 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
5757 @opindex Wno-pedantic-ms-format
5758 @opindex Wpedantic-ms-format
5759 When used in combination with @option{-Wformat}
5760 and @option{-pedantic} without GNU extensions, this option
5761 disables the warnings about non-ISO @code{printf} / @code{scanf} format
5762 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
5763 which depend on the MS runtime.
5765 @item -Waligned-new
5766 @opindex Waligned-new
5767 @opindex Wno-aligned-new
5768 Warn about a new-expression of a type that requires greater alignment
5769 than the @code{alignof(std::max_align_t)} but uses an allocation
5770 function without an explicit alignment parameter. This option is
5771 enabled by @option{-Wall}.
5773 Normally this only warns about global allocation functions, but
5774 @option{-Waligned-new=all} also warns about class member allocation
5775 functions.
5777 @item -Wplacement-new
5778 @itemx -Wplacement-new=@var{n}
5779 @opindex Wplacement-new
5780 @opindex Wno-placement-new
5781 Warn about placement new expressions with undefined behavior, such as
5782 constructing an object in a buffer that is smaller than the type of
5783 the object.  For example, the placement new expression below is diagnosed
5784 because it attempts to construct an array of 64 integers in a buffer only
5785 64 bytes large.
5786 @smallexample
5787 char buf [64];
5788 new (buf) int[64];
5789 @end smallexample
5790 This warning is enabled by default.
5792 @table @gcctabopt
5793 @item -Wplacement-new=1
5794 This is the default warning level of @option{-Wplacement-new}.  At this
5795 level the warning is not issued for some strictly undefined constructs that
5796 GCC allows as extensions for compatibility with legacy code.  For example,
5797 the following @code{new} expression is not diagnosed at this level even
5798 though it has undefined behavior according to the C++ standard because
5799 it writes past the end of the one-element array.
5800 @smallexample
5801 struct S @{ int n, a[1]; @};
5802 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
5803 new (s->a)int [32]();
5804 @end smallexample
5806 @item -Wplacement-new=2
5807 At this level, in addition to diagnosing all the same constructs as at level
5808 1, a diagnostic is also issued for placement new expressions that construct
5809 an object in the last member of structure whose type is an array of a single
5810 element and whose size is less than the size of the object being constructed.
5811 While the previous example would be diagnosed, the following construct makes
5812 use of the flexible member array extension to avoid the warning at level 2.
5813 @smallexample
5814 struct S @{ int n, a[]; @};
5815 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
5816 new (s->a)int [32]();
5817 @end smallexample
5819 @end table
5821 @item -Wpointer-arith
5822 @opindex Wpointer-arith
5823 @opindex Wno-pointer-arith
5824 Warn about anything that depends on the ``size of'' a function type or
5825 of @code{void}.  GNU C assigns these types a size of 1, for
5826 convenience in calculations with @code{void *} pointers and pointers
5827 to functions.  In C++, warn also when an arithmetic operation involves
5828 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
5830 @item -Wpointer-compare
5831 @opindex Wpointer-compare
5832 @opindex Wno-pointer-compare
5833 Warn if a pointer is compared with a zero character constant.  This usually
5834 means that the pointer was meant to be dereferenced.  For example:
5836 @smallexample
5837 const char *p = foo ();
5838 if (p == '\0')
5839   return 42;
5840 @end smallexample
5842 Note that the code above is invalid in C++11.
5844 This warning is enabled by default.
5846 @item -Wtype-limits
5847 @opindex Wtype-limits
5848 @opindex Wno-type-limits
5849 Warn if a comparison is always true or always false due to the limited
5850 range of the data type, but do not warn for constant expressions.  For
5851 example, warn if an unsigned variable is compared against zero with
5852 @code{<} or @code{>=}.  This warning is also enabled by
5853 @option{-Wextra}.
5855 @include cppwarnopts.texi
5857 @item -Wbad-function-cast @r{(C and Objective-C only)}
5858 @opindex Wbad-function-cast
5859 @opindex Wno-bad-function-cast
5860 Warn when a function call is cast to a non-matching type.
5861 For example, warn if a call to a function returning an integer type 
5862 is cast to a pointer type.
5864 @item -Wc90-c99-compat @r{(C and Objective-C only)}
5865 @opindex Wc90-c99-compat
5866 @opindex Wno-c90-c99-compat
5867 Warn about features not present in ISO C90, but present in ISO C99.
5868 For instance, warn about use of variable length arrays, @code{long long}
5869 type, @code{bool} type, compound literals, designated initializers, and so
5870 on.  This option is independent of the standards mode.  Warnings are disabled
5871 in the expression that follows @code{__extension__}.
5873 @item -Wc99-c11-compat @r{(C and Objective-C only)}
5874 @opindex Wc99-c11-compat
5875 @opindex Wno-c99-c11-compat
5876 Warn about features not present in ISO C99, but present in ISO C11.
5877 For instance, warn about use of anonymous structures and unions,
5878 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
5879 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
5880 and so on.  This option is independent of the standards mode.  Warnings are
5881 disabled in the expression that follows @code{__extension__}.
5883 @item -Wc++-compat @r{(C and Objective-C only)}
5884 @opindex Wc++-compat
5885 Warn about ISO C constructs that are outside of the common subset of
5886 ISO C and ISO C++, e.g.@: request for implicit conversion from
5887 @code{void *} to a pointer to non-@code{void} type.
5889 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
5890 @opindex Wc++11-compat
5891 Warn about C++ constructs whose meaning differs between ISO C++ 1998
5892 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
5893 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
5894 enabled by @option{-Wall}.
5896 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
5897 @opindex Wc++14-compat
5898 Warn about C++ constructs whose meaning differs between ISO C++ 2011
5899 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
5901 @item -Wc++1z-compat @r{(C++ and Objective-C++ only)}
5902 @opindex Wc++1z-compat
5903 Warn about C++ constructs whose meaning differs between ISO C++ 2014
5904 and the forthoming ISO C++ 2017(?).  This warning is enabled by @option{-Wall}.
5906 @item -Wcast-qual
5907 @opindex Wcast-qual
5908 @opindex Wno-cast-qual
5909 Warn whenever a pointer is cast so as to remove a type qualifier from
5910 the target type.  For example, warn if a @code{const char *} is cast
5911 to an ordinary @code{char *}.
5913 Also warn when making a cast that introduces a type qualifier in an
5914 unsafe way.  For example, casting @code{char **} to @code{const char **}
5915 is unsafe, as in this example:
5917 @smallexample
5918   /* p is char ** value.  */
5919   const char **q = (const char **) p;
5920   /* Assignment of readonly string to const char * is OK.  */
5921   *q = "string";
5922   /* Now char** pointer points to read-only memory.  */
5923   **p = 'b';
5924 @end smallexample
5926 @item -Wcast-align
5927 @opindex Wcast-align
5928 @opindex Wno-cast-align
5929 Warn whenever a pointer is cast such that the required alignment of the
5930 target is increased.  For example, warn if a @code{char *} is cast to
5931 an @code{int *} on machines where integers can only be accessed at
5932 two- or four-byte boundaries.
5934 @item -Wwrite-strings
5935 @opindex Wwrite-strings
5936 @opindex Wno-write-strings
5937 When compiling C, give string constants the type @code{const
5938 char[@var{length}]} so that copying the address of one into a
5939 non-@code{const} @code{char *} pointer produces a warning.  These
5940 warnings help you find at compile time code that can try to write
5941 into a string constant, but only if you have been very careful about
5942 using @code{const} in declarations and prototypes.  Otherwise, it is
5943 just a nuisance. This is why we did not make @option{-Wall} request
5944 these warnings.
5946 When compiling C++, warn about the deprecated conversion from string
5947 literals to @code{char *}.  This warning is enabled by default for C++
5948 programs.
5950 @item -Wcatch-value
5951 @itemx -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)}
5952 @opindex Wcatch-value
5953 @opindex Wno-catch-value
5954 Warn about catch handlers that do not catch via reference.
5955 With @option{-Wcatch-value=1} (or @option{-Wcatch-value} for short)
5956 warn about polymorphic class types that are caught by value.
5957 With @option{-Wcatch-value=2} warn about all class types that are caught
5958 by value. With @option{-Wcatch-value=3} warn about all types that are
5959 not caught by reference. @option{-Wcatch-value} is enabled by @option{-Wall}.
5961 @item -Wclobbered
5962 @opindex Wclobbered
5963 @opindex Wno-clobbered
5964 Warn for variables that might be changed by @code{longjmp} or
5965 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
5967 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
5968 @opindex Wconditionally-supported
5969 @opindex Wno-conditionally-supported
5970 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
5972 @item -Wconversion
5973 @opindex Wconversion
5974 @opindex Wno-conversion
5975 Warn for implicit conversions that may alter a value. This includes
5976 conversions between real and integer, like @code{abs (x)} when
5977 @code{x} is @code{double}; conversions between signed and unsigned,
5978 like @code{unsigned ui = -1}; and conversions to smaller types, like
5979 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
5980 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
5981 changed by the conversion like in @code{abs (2.0)}.  Warnings about
5982 conversions between signed and unsigned integers can be disabled by
5983 using @option{-Wno-sign-conversion}.
5985 For C++, also warn for confusing overload resolution for user-defined
5986 conversions; and conversions that never use a type conversion
5987 operator: conversions to @code{void}, the same type, a base class or a
5988 reference to them. Warnings about conversions between signed and
5989 unsigned integers are disabled by default in C++ unless
5990 @option{-Wsign-conversion} is explicitly enabled.
5992 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
5993 @opindex Wconversion-null
5994 @opindex Wno-conversion-null
5995 Do not warn for conversions between @code{NULL} and non-pointer
5996 types. @option{-Wconversion-null} is enabled by default.
5998 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
5999 @opindex Wzero-as-null-pointer-constant
6000 @opindex Wno-zero-as-null-pointer-constant
6001 Warn when a literal @samp{0} is used as null pointer constant.  This can
6002 be useful to facilitate the conversion to @code{nullptr} in C++11.
6004 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
6005 @opindex Wsubobject-linkage
6006 @opindex Wno-subobject-linkage
6007 Warn if a class type has a base or a field whose type uses the anonymous
6008 namespace or depends on a type with no linkage.  If a type A depends on
6009 a type B with no or internal linkage, defining it in multiple
6010 translation units would be an ODR violation because the meaning of B
6011 is different in each translation unit.  If A only appears in a single
6012 translation unit, the best way to silence the warning is to give it
6013 internal linkage by putting it in an anonymous namespace as well.  The
6014 compiler doesn't give this warning for types defined in the main .C
6015 file, as those are unlikely to have multiple definitions.
6016 @option{-Wsubobject-linkage} is enabled by default.
6018 @item -Wdangling-else
6019 @opindex Wdangling-else
6020 @opindex Wno-dangling-else
6021 Warn about constructions where there may be confusion to which
6022 @code{if} statement an @code{else} branch belongs.  Here is an example of
6023 such a case:
6025 @smallexample
6026 @group
6028   if (a)
6029     if (b)
6030       foo ();
6031   else
6032     bar ();
6034 @end group
6035 @end smallexample
6037 In C/C++, every @code{else} branch belongs to the innermost possible
6038 @code{if} statement, which in this example is @code{if (b)}.  This is
6039 often not what the programmer expected, as illustrated in the above
6040 example by indentation the programmer chose.  When there is the
6041 potential for this confusion, GCC issues a warning when this flag
6042 is specified.  To eliminate the warning, add explicit braces around
6043 the innermost @code{if} statement so there is no way the @code{else}
6044 can belong to the enclosing @code{if}.  The resulting code
6045 looks like this:
6047 @smallexample
6048 @group
6050   if (a)
6051     @{
6052       if (b)
6053         foo ();
6054       else
6055         bar ();
6056     @}
6058 @end group
6059 @end smallexample
6061 This warning is enabled by @option{-Wparentheses}.
6063 @item -Wdate-time
6064 @opindex Wdate-time
6065 @opindex Wno-date-time
6066 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
6067 are encountered as they might prevent bit-wise-identical reproducible
6068 compilations.
6070 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
6071 @opindex Wdelete-incomplete
6072 @opindex Wno-delete-incomplete
6073 Warn when deleting a pointer to incomplete type, which may cause
6074 undefined behavior at runtime.  This warning is enabled by default.
6076 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
6077 @opindex Wuseless-cast
6078 @opindex Wno-useless-cast
6079 Warn when an expression is casted to its own type.
6081 @item -Wempty-body
6082 @opindex Wempty-body
6083 @opindex Wno-empty-body
6084 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
6085 while} statement.  This warning is also enabled by @option{-Wextra}.
6087 @item -Wenum-compare
6088 @opindex Wenum-compare
6089 @opindex Wno-enum-compare
6090 Warn about a comparison between values of different enumerated types.
6091 In C++ enumerated type mismatches in conditional expressions are also
6092 diagnosed and the warning is enabled by default.  In C this warning is 
6093 enabled by @option{-Wall}.
6095 @item -Wextra-semi @r{(C++, Objective-C++ only)}
6096 @opindex Wextra-semi
6097 @opindex Wno-extra-semi
6098 Warn about redundant semicolon after in-class function definition.
6100 @item -Wjump-misses-init @r{(C, Objective-C only)}
6101 @opindex Wjump-misses-init
6102 @opindex Wno-jump-misses-init
6103 Warn if a @code{goto} statement or a @code{switch} statement jumps
6104 forward across the initialization of a variable, or jumps backward to a
6105 label after the variable has been initialized.  This only warns about
6106 variables that are initialized when they are declared.  This warning is
6107 only supported for C and Objective-C; in C++ this sort of branch is an
6108 error in any case.
6110 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
6111 can be disabled with the @option{-Wno-jump-misses-init} option.
6113 @item -Wsign-compare
6114 @opindex Wsign-compare
6115 @opindex Wno-sign-compare
6116 @cindex warning for comparison of signed and unsigned values
6117 @cindex comparison of signed and unsigned values, warning
6118 @cindex signed and unsigned values, comparison warning
6119 Warn when a comparison between signed and unsigned values could produce
6120 an incorrect result when the signed value is converted to unsigned.
6121 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
6122 also enabled by @option{-Wextra}.
6124 @item -Wsign-conversion
6125 @opindex Wsign-conversion
6126 @opindex Wno-sign-conversion
6127 Warn for implicit conversions that may change the sign of an integer
6128 value, like assigning a signed integer expression to an unsigned
6129 integer variable. An explicit cast silences the warning. In C, this
6130 option is enabled also by @option{-Wconversion}.
6132 @item -Wfloat-conversion
6133 @opindex Wfloat-conversion
6134 @opindex Wno-float-conversion
6135 Warn for implicit conversions that reduce the precision of a real value.
6136 This includes conversions from real to integer, and from higher precision
6137 real to lower precision real values.  This option is also enabled by
6138 @option{-Wconversion}.
6140 @item -Wno-scalar-storage-order
6141 @opindex -Wno-scalar-storage-order
6142 @opindex -Wscalar-storage-order
6143 Do not warn on suspicious constructs involving reverse scalar storage order.
6145 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
6146 @opindex Wsized-deallocation
6147 @opindex Wno-sized-deallocation
6148 Warn about a definition of an unsized deallocation function
6149 @smallexample
6150 void operator delete (void *) noexcept;
6151 void operator delete[] (void *) noexcept;
6152 @end smallexample
6153 without a definition of the corresponding sized deallocation function
6154 @smallexample
6155 void operator delete (void *, std::size_t) noexcept;
6156 void operator delete[] (void *, std::size_t) noexcept;
6157 @end smallexample
6158 or vice versa.  Enabled by @option{-Wextra} along with
6159 @option{-fsized-deallocation}.
6161 @item -Wsizeof-pointer-div
6162 @opindex Wsizeof-pointer-div
6163 @opindex Wno-sizeof-pointer-div
6164 Warn for suspicious divisions of two sizeof expressions that divide
6165 the pointer size by the element size, which is the usual way to compute
6166 the array size but won't work out correctly with pointers.  This warning
6167 warns e.g.@: about @code{sizeof (ptr) / sizeof (ptr[0])} if @code{ptr} is
6168 not an array, but a pointer.  This warning is enabled by @option{-Wall}.
6170 @item -Wsizeof-pointer-memaccess
6171 @opindex Wsizeof-pointer-memaccess
6172 @opindex Wno-sizeof-pointer-memaccess
6173 Warn for suspicious length parameters to certain string and memory built-in
6174 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
6175 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
6176 but a pointer, and suggests a possible fix, or about
6177 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
6178 @option{-Wall}.
6180 @item -Wsizeof-array-argument
6181 @opindex Wsizeof-array-argument
6182 @opindex Wno-sizeof-array-argument
6183 Warn when the @code{sizeof} operator is applied to a parameter that is
6184 declared as an array in a function definition.  This warning is enabled by
6185 default for C and C++ programs.
6187 @item -Wmemset-elt-size
6188 @opindex Wmemset-elt-size
6189 @opindex Wno-memset-elt-size
6190 Warn for suspicious calls to the @code{memset} built-in function, if the
6191 first argument references an array, and the third argument is a number
6192 equal to the number of elements, but not equal to the size of the array
6193 in memory.  This indicates that the user has omitted a multiplication by
6194 the element size.  This warning is enabled by @option{-Wall}.
6196 @item -Wmemset-transposed-args
6197 @opindex Wmemset-transposed-args
6198 @opindex Wno-memset-transposed-args
6199 Warn for suspicious calls to the @code{memset} built-in function, if the
6200 second argument is not zero and the third argument is zero.  This warns e.g.@
6201 about @code{memset (buf, sizeof buf, 0)} where most probably
6202 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
6203 is only emitted if the third argument is literal zero.  If it is some
6204 expression that is folded to zero, a cast of zero to some type, etc., 
6205 it is far less likely that the user has mistakenly exchanged the arguments 
6206 and no warning is emitted.  This warning is enabled by @option{-Wall}.
6208 @item -Waddress
6209 @opindex Waddress
6210 @opindex Wno-address
6211 Warn about suspicious uses of memory addresses. These include using
6212 the address of a function in a conditional expression, such as
6213 @code{void func(void); if (func)}, and comparisons against the memory
6214 address of a string literal, such as @code{if (x == "abc")}.  Such
6215 uses typically indicate a programmer error: the address of a function
6216 always evaluates to true, so their use in a conditional usually
6217 indicate that the programmer forgot the parentheses in a function
6218 call; and comparisons against string literals result in unspecified
6219 behavior and are not portable in C, so they usually indicate that the
6220 programmer intended to use @code{strcmp}.  This warning is enabled by
6221 @option{-Wall}.
6223 @item -Wlogical-op
6224 @opindex Wlogical-op
6225 @opindex Wno-logical-op
6226 Warn about suspicious uses of logical operators in expressions.
6227 This includes using logical operators in contexts where a
6228 bit-wise operator is likely to be expected.  Also warns when
6229 the operands of a logical operator are the same:
6230 @smallexample
6231 extern int a;
6232 if (a < 0 && a < 0) @{ @dots{} @}
6233 @end smallexample
6235 @item -Wlogical-not-parentheses
6236 @opindex Wlogical-not-parentheses
6237 @opindex Wno-logical-not-parentheses
6238 Warn about logical not used on the left hand side operand of a comparison.
6239 This option does not warn if the right operand is considered to be a boolean
6240 expression.  Its purpose is to detect suspicious code like the following:
6241 @smallexample
6242 int a;
6243 @dots{}
6244 if (!a > 1) @{ @dots{} @}
6245 @end smallexample
6247 It is possible to suppress the warning by wrapping the LHS into
6248 parentheses:
6249 @smallexample
6250 if ((!a) > 1) @{ @dots{} @}
6251 @end smallexample
6253 This warning is enabled by @option{-Wall}.
6255 @item -Waggregate-return
6256 @opindex Waggregate-return
6257 @opindex Wno-aggregate-return
6258 Warn if any functions that return structures or unions are defined or
6259 called.  (In languages where you can return an array, this also elicits
6260 a warning.)
6262 @item -Wno-aggressive-loop-optimizations
6263 @opindex Wno-aggressive-loop-optimizations
6264 @opindex Waggressive-loop-optimizations
6265 Warn if in a loop with constant number of iterations the compiler detects
6266 undefined behavior in some statement during one or more of the iterations.
6268 @item -Wno-attributes
6269 @opindex Wno-attributes
6270 @opindex Wattributes
6271 Do not warn if an unexpected @code{__attribute__} is used, such as
6272 unrecognized attributes, function attributes applied to variables,
6273 etc.  This does not stop errors for incorrect use of supported
6274 attributes.
6276 @item -Wno-builtin-declaration-mismatch
6277 @opindex Wno-builtin-declaration-mismatch
6278 @opindex Wbuiltin-declaration-mismatch
6279 Warn if a built-in function is declared with the wrong signature.
6280 This warning is enabled by default.
6282 @item -Wno-builtin-macro-redefined
6283 @opindex Wno-builtin-macro-redefined
6284 @opindex Wbuiltin-macro-redefined
6285 Do not warn if certain built-in macros are redefined.  This suppresses
6286 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
6287 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
6289 @item -Wstrict-prototypes @r{(C and Objective-C only)}
6290 @opindex Wstrict-prototypes
6291 @opindex Wno-strict-prototypes
6292 Warn if a function is declared or defined without specifying the
6293 argument types.  (An old-style function definition is permitted without
6294 a warning if preceded by a declaration that specifies the argument
6295 types.)
6297 @item -Wold-style-declaration @r{(C and Objective-C only)}
6298 @opindex Wold-style-declaration
6299 @opindex Wno-old-style-declaration
6300 Warn for obsolescent usages, according to the C Standard, in a
6301 declaration. For example, warn if storage-class specifiers like
6302 @code{static} are not the first things in a declaration.  This warning
6303 is also enabled by @option{-Wextra}.
6305 @item -Wold-style-definition @r{(C and Objective-C only)}
6306 @opindex Wold-style-definition
6307 @opindex Wno-old-style-definition
6308 Warn if an old-style function definition is used.  A warning is given
6309 even if there is a previous prototype.
6311 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
6312 @opindex Wmissing-parameter-type
6313 @opindex Wno-missing-parameter-type
6314 A function parameter is declared without a type specifier in K&R-style
6315 functions:
6317 @smallexample
6318 void foo(bar) @{ @}
6319 @end smallexample
6321 This warning is also enabled by @option{-Wextra}.
6323 @item -Wmissing-prototypes @r{(C and Objective-C only)}
6324 @opindex Wmissing-prototypes
6325 @opindex Wno-missing-prototypes
6326 Warn if a global function is defined without a previous prototype
6327 declaration.  This warning is issued even if the definition itself
6328 provides a prototype.  Use this option to detect global functions
6329 that do not have a matching prototype declaration in a header file.
6330 This option is not valid for C++ because all function declarations
6331 provide prototypes and a non-matching declaration declares an
6332 overload rather than conflict with an earlier declaration.
6333 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
6335 @item -Wmissing-declarations
6336 @opindex Wmissing-declarations
6337 @opindex Wno-missing-declarations
6338 Warn if a global function is defined without a previous declaration.
6339 Do so even if the definition itself provides a prototype.
6340 Use this option to detect global functions that are not declared in
6341 header files.  In C, no warnings are issued for functions with previous
6342 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
6343 missing prototypes.  In C++, no warnings are issued for function templates,
6344 or for inline functions, or for functions in anonymous namespaces.
6346 @item -Wmissing-field-initializers
6347 @opindex Wmissing-field-initializers
6348 @opindex Wno-missing-field-initializers
6349 @opindex W
6350 @opindex Wextra
6351 @opindex Wno-extra
6352 Warn if a structure's initializer has some fields missing.  For
6353 example, the following code causes such a warning, because
6354 @code{x.h} is implicitly zero:
6356 @smallexample
6357 struct s @{ int f, g, h; @};
6358 struct s x = @{ 3, 4 @};
6359 @end smallexample
6361 This option does not warn about designated initializers, so the following
6362 modification does not trigger a warning:
6364 @smallexample
6365 struct s @{ int f, g, h; @};
6366 struct s x = @{ .f = 3, .g = 4 @};
6367 @end smallexample
6369 In C this option does not warn about the universal zero initializer
6370 @samp{@{ 0 @}}:
6372 @smallexample
6373 struct s @{ int f, g, h; @};
6374 struct s x = @{ 0 @};
6375 @end smallexample
6377 Likewise, in C++ this option does not warn about the empty @{ @}
6378 initializer, for example:
6380 @smallexample
6381 struct s @{ int f, g, h; @};
6382 s x = @{ @};
6383 @end smallexample
6385 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
6386 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
6388 @item -Wno-multichar
6389 @opindex Wno-multichar
6390 @opindex Wmultichar
6391 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
6392 Usually they indicate a typo in the user's code, as they have
6393 implementation-defined values, and should not be used in portable code.
6395 @item -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]}
6396 @opindex Wnormalized=
6397 @opindex Wnormalized
6398 @opindex Wno-normalized
6399 @cindex NFC
6400 @cindex NFKC
6401 @cindex character set, input normalization
6402 In ISO C and ISO C++, two identifiers are different if they are
6403 different sequences of characters.  However, sometimes when characters
6404 outside the basic ASCII character set are used, you can have two
6405 different character sequences that look the same.  To avoid confusion,
6406 the ISO 10646 standard sets out some @dfn{normalization rules} which
6407 when applied ensure that two sequences that look the same are turned into
6408 the same sequence.  GCC can warn you if you are using identifiers that
6409 have not been normalized; this option controls that warning.
6411 There are four levels of warning supported by GCC@.  The default is
6412 @option{-Wnormalized=nfc}, which warns about any identifier that is
6413 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
6414 recommended form for most uses.  It is equivalent to
6415 @option{-Wnormalized}.
6417 Unfortunately, there are some characters allowed in identifiers by
6418 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
6419 identifiers.  That is, there's no way to use these symbols in portable
6420 ISO C or C++ and have all your identifiers in NFC@.
6421 @option{-Wnormalized=id} suppresses the warning for these characters.
6422 It is hoped that future versions of the standards involved will correct
6423 this, which is why this option is not the default.
6425 You can switch the warning off for all characters by writing
6426 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
6427 only do this if you are using some other normalization scheme (like
6428 ``D''), because otherwise you can easily create bugs that are
6429 literally impossible to see.
6431 Some characters in ISO 10646 have distinct meanings but look identical
6432 in some fonts or display methodologies, especially once formatting has
6433 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
6434 LETTER N'', displays just like a regular @code{n} that has been
6435 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
6436 normalization scheme to convert all these into a standard form as
6437 well, and GCC warns if your code is not in NFKC if you use
6438 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
6439 about every identifier that contains the letter O because it might be
6440 confused with the digit 0, and so is not the default, but may be
6441 useful as a local coding convention if the programming environment 
6442 cannot be fixed to display these characters distinctly.
6444 @item -Wno-deprecated
6445 @opindex Wno-deprecated
6446 @opindex Wdeprecated
6447 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
6449 @item -Wno-deprecated-declarations
6450 @opindex Wno-deprecated-declarations
6451 @opindex Wdeprecated-declarations
6452 Do not warn about uses of functions (@pxref{Function Attributes}),
6453 variables (@pxref{Variable Attributes}), and types (@pxref{Type
6454 Attributes}) marked as deprecated by using the @code{deprecated}
6455 attribute.
6457 @item -Wno-overflow
6458 @opindex Wno-overflow
6459 @opindex Woverflow
6460 Do not warn about compile-time overflow in constant expressions.
6462 @item -Wno-odr
6463 @opindex Wno-odr
6464 @opindex Wodr
6465 Warn about One Definition Rule violations during link-time optimization.
6466 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
6468 @item -Wopenmp-simd
6469 @opindex Wopenm-simd
6470 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
6471 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
6472 option can be used to relax the cost model.
6474 @item -Woverride-init @r{(C and Objective-C only)}
6475 @opindex Woverride-init
6476 @opindex Wno-override-init
6477 @opindex W
6478 @opindex Wextra
6479 @opindex Wno-extra
6480 Warn if an initialized field without side effects is overridden when
6481 using designated initializers (@pxref{Designated Inits, , Designated
6482 Initializers}).
6484 This warning is included in @option{-Wextra}.  To get other
6485 @option{-Wextra} warnings without this one, use @option{-Wextra
6486 -Wno-override-init}.
6488 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
6489 @opindex Woverride-init-side-effects
6490 @opindex Wno-override-init-side-effects
6491 Warn if an initialized field with side effects is overridden when
6492 using designated initializers (@pxref{Designated Inits, , Designated
6493 Initializers}).  This warning is enabled by default.
6495 @item -Wpacked
6496 @opindex Wpacked
6497 @opindex Wno-packed
6498 Warn if a structure is given the packed attribute, but the packed
6499 attribute has no effect on the layout or size of the structure.
6500 Such structures may be mis-aligned for little benefit.  For
6501 instance, in this code, the variable @code{f.x} in @code{struct bar}
6502 is misaligned even though @code{struct bar} does not itself
6503 have the packed attribute:
6505 @smallexample
6506 @group
6507 struct foo @{
6508   int x;
6509   char a, b, c, d;
6510 @} __attribute__((packed));
6511 struct bar @{
6512   char z;
6513   struct foo f;
6515 @end group
6516 @end smallexample
6518 @item -Wpacked-bitfield-compat
6519 @opindex Wpacked-bitfield-compat
6520 @opindex Wno-packed-bitfield-compat
6521 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
6522 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
6523 the change can lead to differences in the structure layout.  GCC
6524 informs you when the offset of such a field has changed in GCC 4.4.
6525 For example there is no longer a 4-bit padding between field @code{a}
6526 and @code{b} in this structure:
6528 @smallexample
6529 struct foo
6531   char a:4;
6532   char b:8;
6533 @} __attribute__ ((packed));
6534 @end smallexample
6536 This warning is enabled by default.  Use
6537 @option{-Wno-packed-bitfield-compat} to disable this warning.
6539 @item -Wpacked-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
6540 @opindex Wpacked-not-aligned
6541 @opindex Wno-packed-not-aligned
6542 Warn if a structure field with explicitly specified alignment in a
6543 packed struct or union is misaligned.  For example, a warning will
6544 be issued on @code{struct S}, like, @code{warning: alignment 1 of
6545 'struct S' is less than 8}, in this code:
6547 @smallexample
6548 @group
6549 struct __attribute__ ((aligned (8))) S8 @{ char a[8]; @};
6550 struct __attribute__ ((packed)) S @{
6551   struct S8 s8;
6553 @end group
6554 @end smallexample
6556 This warning is enabled by @option{-Wall}.
6558 @item -Wpadded
6559 @opindex Wpadded
6560 @opindex Wno-padded
6561 Warn if padding is included in a structure, either to align an element
6562 of the structure or to align the whole structure.  Sometimes when this
6563 happens it is possible to rearrange the fields of the structure to
6564 reduce the padding and so make the structure smaller.
6566 @item -Wredundant-decls
6567 @opindex Wredundant-decls
6568 @opindex Wno-redundant-decls
6569 Warn if anything is declared more than once in the same scope, even in
6570 cases where multiple declaration is valid and changes nothing.
6572 @item -Wrestrict
6573 @opindex Wrestrict
6574 @opindex Wno-restrict
6575 Warn when an argument passed to a restrict-qualified parameter
6576 aliases with another argument.
6578 @item -Wnested-externs @r{(C and Objective-C only)}
6579 @opindex Wnested-externs
6580 @opindex Wno-nested-externs
6581 Warn if an @code{extern} declaration is encountered within a function.
6583 @item -Wno-inherited-variadic-ctor
6584 @opindex Winherited-variadic-ctor
6585 @opindex Wno-inherited-variadic-ctor
6586 Suppress warnings about use of C++11 inheriting constructors when the
6587 base class inherited from has a C variadic constructor; the warning is
6588 on by default because the ellipsis is not inherited.
6590 @item -Winline
6591 @opindex Winline
6592 @opindex Wno-inline
6593 Warn if a function that is declared as inline cannot be inlined.
6594 Even with this option, the compiler does not warn about failures to
6595 inline functions declared in system headers.
6597 The compiler uses a variety of heuristics to determine whether or not
6598 to inline a function.  For example, the compiler takes into account
6599 the size of the function being inlined and the amount of inlining
6600 that has already been done in the current function.  Therefore,
6601 seemingly insignificant changes in the source program can cause the
6602 warnings produced by @option{-Winline} to appear or disappear.
6604 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
6605 @opindex Wno-invalid-offsetof
6606 @opindex Winvalid-offsetof
6607 Suppress warnings from applying the @code{offsetof} macro to a non-POD
6608 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
6609 to a non-standard-layout type is undefined.  In existing C++ implementations,
6610 however, @code{offsetof} typically gives meaningful results.
6611 This flag is for users who are aware that they are
6612 writing nonportable code and who have deliberately chosen to ignore the
6613 warning about it.
6615 The restrictions on @code{offsetof} may be relaxed in a future version
6616 of the C++ standard.
6618 @item -Wint-in-bool-context
6619 @opindex Wint-in-bool-context
6620 @opindex Wno-int-in-bool-context
6621 Warn for suspicious use of integer values where boolean values are expected,
6622 such as conditional expressions (?:) using non-boolean integer constants in
6623 boolean context, like @code{if (a <= b ? 2 : 3)}.  Or left shifting of signed
6624 integers in boolean context, like @code{for (a = 0; 1 << a; a++);}.  Likewise
6625 for all kinds of multiplications regardless of the data type.
6626 This warning is enabled by @option{-Wall}.
6628 @item -Wno-int-to-pointer-cast
6629 @opindex Wno-int-to-pointer-cast
6630 @opindex Wint-to-pointer-cast
6631 Suppress warnings from casts to pointer type of an integer of a
6632 different size. In C++, casting to a pointer type of smaller size is
6633 an error. @option{Wint-to-pointer-cast} is enabled by default.
6636 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
6637 @opindex Wno-pointer-to-int-cast
6638 @opindex Wpointer-to-int-cast
6639 Suppress warnings from casts from a pointer to an integer type of a
6640 different size.
6642 @item -Winvalid-pch
6643 @opindex Winvalid-pch
6644 @opindex Wno-invalid-pch
6645 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
6646 the search path but cannot be used.
6648 @item -Wlong-long
6649 @opindex Wlong-long
6650 @opindex Wno-long-long
6651 Warn if @code{long long} type is used.  This is enabled by either
6652 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
6653 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
6655 @item -Wvariadic-macros
6656 @opindex Wvariadic-macros
6657 @opindex Wno-variadic-macros
6658 Warn if variadic macros are used in ISO C90 mode, or if the GNU
6659 alternate syntax is used in ISO C99 mode.  This is enabled by either
6660 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
6661 messages, use @option{-Wno-variadic-macros}.
6663 @item -Wvarargs
6664 @opindex Wvarargs
6665 @opindex Wno-varargs
6666 Warn upon questionable usage of the macros used to handle variable
6667 arguments like @code{va_start}.  This is default.  To inhibit the
6668 warning messages, use @option{-Wno-varargs}.
6670 @item -Wvector-operation-performance
6671 @opindex Wvector-operation-performance
6672 @opindex Wno-vector-operation-performance
6673 Warn if vector operation is not implemented via SIMD capabilities of the
6674 architecture.  Mainly useful for the performance tuning.
6675 Vector operation can be implemented @code{piecewise}, which means that the
6676 scalar operation is performed on every vector element; 
6677 @code{in parallel}, which means that the vector operation is implemented
6678 using scalars of wider type, which normally is more performance efficient;
6679 and @code{as a single scalar}, which means that vector fits into a
6680 scalar type.
6682 @item -Wno-virtual-move-assign
6683 @opindex Wvirtual-move-assign
6684 @opindex Wno-virtual-move-assign
6685 Suppress warnings about inheriting from a virtual base with a
6686 non-trivial C++11 move assignment operator.  This is dangerous because
6687 if the virtual base is reachable along more than one path, it is
6688 moved multiple times, which can mean both objects end up in the
6689 moved-from state.  If the move assignment operator is written to avoid
6690 moving from a moved-from object, this warning can be disabled.
6692 @item -Wvla
6693 @opindex Wvla
6694 @opindex Wno-vla
6695 Warn if a variable-length array is used in the code.
6696 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
6697 the variable-length array.
6699 @item -Wvla-larger-than=@var{n}
6700 If this option is used, the compiler will warn on uses of
6701 variable-length arrays where the size is either unbounded, or bounded
6702 by an argument that can be larger than @var{n} bytes.  This is similar
6703 to how @option{-Walloca-larger-than=@var{n}} works, but with
6704 variable-length arrays.
6706 Note that GCC may optimize small variable-length arrays of a known
6707 value into plain arrays, so this warning may not get triggered for
6708 such arrays.
6710 This warning is not enabled by @option{-Wall}, and is only active when
6711 @option{-ftree-vrp} is active (default for @option{-O2} and above).
6713 See also @option{-Walloca-larger-than=@var{n}}.
6715 @item -Wvolatile-register-var
6716 @opindex Wvolatile-register-var
6717 @opindex Wno-volatile-register-var
6718 Warn if a register variable is declared volatile.  The volatile
6719 modifier does not inhibit all optimizations that may eliminate reads
6720 and/or writes to register variables.  This warning is enabled by
6721 @option{-Wall}.
6723 @item -Wdisabled-optimization
6724 @opindex Wdisabled-optimization
6725 @opindex Wno-disabled-optimization
6726 Warn if a requested optimization pass is disabled.  This warning does
6727 not generally indicate that there is anything wrong with your code; it
6728 merely indicates that GCC's optimizers are unable to handle the code
6729 effectively.  Often, the problem is that your code is too big or too
6730 complex; GCC refuses to optimize programs when the optimization
6731 itself is likely to take inordinate amounts of time.
6733 @item -Wpointer-sign @r{(C and Objective-C only)}
6734 @opindex Wpointer-sign
6735 @opindex Wno-pointer-sign
6736 Warn for pointer argument passing or assignment with different signedness.
6737 This option is only supported for C and Objective-C@.  It is implied by
6738 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
6739 @option{-Wno-pointer-sign}.
6741 @item -Wstack-protector
6742 @opindex Wstack-protector
6743 @opindex Wno-stack-protector
6744 This option is only active when @option{-fstack-protector} is active.  It
6745 warns about functions that are not protected against stack smashing.
6747 @item -Woverlength-strings
6748 @opindex Woverlength-strings
6749 @opindex Wno-overlength-strings
6750 Warn about string constants that are longer than the ``minimum
6751 maximum'' length specified in the C standard.  Modern compilers
6752 generally allow string constants that are much longer than the
6753 standard's minimum limit, but very portable programs should avoid
6754 using longer strings.
6756 The limit applies @emph{after} string constant concatenation, and does
6757 not count the trailing NUL@.  In C90, the limit was 509 characters; in
6758 C99, it was raised to 4095.  C++98 does not specify a normative
6759 minimum maximum, so we do not diagnose overlength strings in C++@.
6761 This option is implied by @option{-Wpedantic}, and can be disabled with
6762 @option{-Wno-overlength-strings}.
6764 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
6765 @opindex Wunsuffixed-float-constants
6767 Issue a warning for any floating constant that does not have
6768 a suffix.  When used together with @option{-Wsystem-headers} it
6769 warns about such constants in system header files.  This can be useful
6770 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
6771 from the decimal floating-point extension to C99.
6773 @item -Wno-designated-init @r{(C and Objective-C only)}
6774 Suppress warnings when a positional initializer is used to initialize
6775 a structure that has been marked with the @code{designated_init}
6776 attribute.
6778 @item -Whsa
6779 Issue a warning when HSAIL cannot be emitted for the compiled function or
6780 OpenMP construct.
6782 @end table
6784 @node Debugging Options
6785 @section Options for Debugging Your Program
6786 @cindex options, debugging
6787 @cindex debugging information options
6789 To tell GCC to emit extra information for use by a debugger, in almost 
6790 all cases you need only to add @option{-g} to your other options.
6792 GCC allows you to use @option{-g} with
6793 @option{-O}.  The shortcuts taken by optimized code may occasionally
6794 be surprising: some variables you declared may not exist
6795 at all; flow of control may briefly move where you did not expect it;
6796 some statements may not be executed because they compute constant
6797 results or their values are already at hand; some statements may
6798 execute in different places because they have been moved out of loops.
6799 Nevertheless it is possible to debug optimized output.  This makes
6800 it reasonable to use the optimizer for programs that might have bugs.
6802 If you are not using some other optimization option, consider
6803 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
6804 With no @option{-O} option at all, some compiler passes that collect
6805 information useful for debugging do not run at all, so that
6806 @option{-Og} may result in a better debugging experience.
6808 @table @gcctabopt
6809 @item -g
6810 @opindex g
6811 Produce debugging information in the operating system's native format
6812 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
6813 information.
6815 On most systems that use stabs format, @option{-g} enables use of extra
6816 debugging information that only GDB can use; this extra information
6817 makes debugging work better in GDB but probably makes other debuggers
6818 crash or
6819 refuse to read the program.  If you want to control for certain whether
6820 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
6821 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
6823 @item -ggdb
6824 @opindex ggdb
6825 Produce debugging information for use by GDB@.  This means to use the
6826 most expressive format available (DWARF, stabs, or the native format
6827 if neither of those are supported), including GDB extensions if at all
6828 possible.
6830 @item -gdwarf
6831 @itemx -gdwarf-@var{version}
6832 @opindex gdwarf
6833 Produce debugging information in DWARF format (if that is supported).
6834 The value of @var{version} may be either 2, 3, 4 or 5; the default version
6835 for most targets is 4.  DWARF Version 5 is only experimental.
6837 Note that with DWARF Version 2, some ports require and always
6838 use some non-conflicting DWARF 3 extensions in the unwind tables.
6840 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
6841 for maximum benefit.
6843 GCC no longer supports DWARF Version 1, which is substantially
6844 different than Version 2 and later.  For historical reasons, some
6845 other DWARF-related options such as
6846 @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
6847 in their names, but apply to all currently-supported versions of DWARF.
6849 @item -gstabs
6850 @opindex gstabs
6851 Produce debugging information in stabs format (if that is supported),
6852 without GDB extensions.  This is the format used by DBX on most BSD
6853 systems.  On MIPS, Alpha and System V Release 4 systems this option
6854 produces stabs debugging output that is not understood by DBX or SDB@.
6855 On System V Release 4 systems this option requires the GNU assembler.
6857 @item -gstabs+
6858 @opindex gstabs+
6859 Produce debugging information in stabs format (if that is supported),
6860 using GNU extensions understood only by the GNU debugger (GDB)@.  The
6861 use of these extensions is likely to make other debuggers crash or
6862 refuse to read the program.
6864 @item -gcoff
6865 @opindex gcoff
6866 Produce debugging information in COFF format (if that is supported).
6867 This is the format used by SDB on most System V systems prior to
6868 System V Release 4.
6870 @item -gxcoff
6871 @opindex gxcoff
6872 Produce debugging information in XCOFF format (if that is supported).
6873 This is the format used by the DBX debugger on IBM RS/6000 systems.
6875 @item -gxcoff+
6876 @opindex gxcoff+
6877 Produce debugging information in XCOFF format (if that is supported),
6878 using GNU extensions understood only by the GNU debugger (GDB)@.  The
6879 use of these extensions is likely to make other debuggers crash or
6880 refuse to read the program, and may cause assemblers other than the GNU
6881 assembler (GAS) to fail with an error.
6883 @item -gvms
6884 @opindex gvms
6885 Produce debugging information in Alpha/VMS debug format (if that is
6886 supported).  This is the format used by DEBUG on Alpha/VMS systems.
6888 @item -g@var{level}
6889 @itemx -ggdb@var{level}
6890 @itemx -gstabs@var{level}
6891 @itemx -gcoff@var{level}
6892 @itemx -gxcoff@var{level}
6893 @itemx -gvms@var{level}
6894 Request debugging information and also use @var{level} to specify how
6895 much information.  The default level is 2.
6897 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
6898 @option{-g}.
6900 Level 1 produces minimal information, enough for making backtraces in
6901 parts of the program that you don't plan to debug.  This includes
6902 descriptions of functions and external variables, and line number
6903 tables, but no information about local variables.
6905 Level 3 includes extra information, such as all the macro definitions
6906 present in the program.  Some debuggers support macro expansion when
6907 you use @option{-g3}.
6909 @option{-gdwarf} does not accept a concatenated debug level, to avoid
6910 confusion with @option{-gdwarf-@var{level}}.
6911 Instead use an additional @option{-g@var{level}} option to change the
6912 debug level for DWARF.
6914 @item -feliminate-unused-debug-symbols
6915 @opindex feliminate-unused-debug-symbols
6916 Produce debugging information in stabs format (if that is supported),
6917 for only symbols that are actually used.
6919 @item -femit-class-debug-always
6920 @opindex femit-class-debug-always
6921 Instead of emitting debugging information for a C++ class in only one
6922 object file, emit it in all object files using the class.  This option
6923 should be used only with debuggers that are unable to handle the way GCC
6924 normally emits debugging information for classes because using this
6925 option increases the size of debugging information by as much as a
6926 factor of two.
6928 @item -fno-merge-debug-strings
6929 @opindex fmerge-debug-strings
6930 @opindex fno-merge-debug-strings
6931 Direct the linker to not merge together strings in the debugging
6932 information that are identical in different object files.  Merging is
6933 not supported by all assemblers or linkers.  Merging decreases the size
6934 of the debug information in the output file at the cost of increasing
6935 link processing time.  Merging is enabled by default.
6937 @item -fdebug-prefix-map=@var{old}=@var{new}
6938 @opindex fdebug-prefix-map
6939 When compiling files in directory @file{@var{old}}, record debugging
6940 information describing them as in @file{@var{new}} instead.
6942 @item -fvar-tracking
6943 @opindex fvar-tracking
6944 Run variable tracking pass.  It computes where variables are stored at each
6945 position in code.  Better debugging information is then generated
6946 (if the debugging information format supports this information).
6948 It is enabled by default when compiling with optimization (@option{-Os},
6949 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6950 the debug info format supports it.
6952 @item -fvar-tracking-assignments
6953 @opindex fvar-tracking-assignments
6954 @opindex fno-var-tracking-assignments
6955 Annotate assignments to user variables early in the compilation and
6956 attempt to carry the annotations over throughout the compilation all the
6957 way to the end, in an attempt to improve debug information while
6958 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6960 It can be enabled even if var-tracking is disabled, in which case
6961 annotations are created and maintained, but discarded at the end.
6962 By default, this flag is enabled together with @option{-fvar-tracking},
6963 except when selective scheduling is enabled.
6965 @item -gsplit-dwarf
6966 @opindex gsplit-dwarf
6967 Separate as much DWARF debugging information as possible into a
6968 separate output file with the extension @file{.dwo}.  This option allows
6969 the build system to avoid linking files with debug information.  To
6970 be useful, this option requires a debugger capable of reading @file{.dwo}
6971 files.
6973 @item -gpubnames
6974 @opindex gpubnames
6975 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
6977 @item -ggnu-pubnames
6978 @opindex ggnu-pubnames
6979 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
6980 suitable for conversion into a GDB@ index.  This option is only useful
6981 with a linker that can produce GDB@ index version 7.
6983 @item -fdebug-types-section
6984 @opindex fdebug-types-section
6985 @opindex fno-debug-types-section
6986 When using DWARF Version 4 or higher, type DIEs can be put into
6987 their own @code{.debug_types} section instead of making them part of the
6988 @code{.debug_info} section.  It is more efficient to put them in a separate
6989 comdat sections since the linker can then remove duplicates.
6990 But not all DWARF consumers support @code{.debug_types} sections yet
6991 and on some objects @code{.debug_types} produces larger instead of smaller
6992 debugging information.
6994 @item -grecord-gcc-switches
6995 @item -gno-record-gcc-switches
6996 @opindex grecord-gcc-switches
6997 @opindex gno-record-gcc-switches
6998 This switch causes the command-line options used to invoke the
6999 compiler that may affect code generation to be appended to the
7000 DW_AT_producer attribute in DWARF debugging information.  The options
7001 are concatenated with spaces separating them from each other and from
7002 the compiler version.  
7003 It is enabled by default.
7004 See also @option{-frecord-gcc-switches} for another
7005 way of storing compiler options into the object file.  
7007 @item -gstrict-dwarf
7008 @opindex gstrict-dwarf
7009 Disallow using extensions of later DWARF standard version than selected
7010 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
7011 DWARF extensions from later standard versions is allowed.
7013 @item -gno-strict-dwarf
7014 @opindex gno-strict-dwarf
7015 Allow using extensions of later DWARF standard version than selected with
7016 @option{-gdwarf-@var{version}}.
7018 @item -gcolumn-info
7019 @item -gno-column-info
7020 @opindex gcolumn-info
7021 @opindex gno-column-info
7022 Emit location column information into DWARF debugging information, rather
7023 than just file and line.
7024 This option is disabled by default.
7026 @item -gz@r{[}=@var{type}@r{]}
7027 @opindex gz
7028 Produce compressed debug sections in DWARF format, if that is supported.
7029 If @var{type} is not given, the default type depends on the capabilities
7030 of the assembler and linker used.  @var{type} may be one of
7031 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
7032 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
7033 compression in traditional GNU format).  If the linker doesn't support
7034 writing compressed debug sections, the option is rejected.  Otherwise,
7035 if the assembler does not support them, @option{-gz} is silently ignored
7036 when producing object files.
7038 @item -femit-struct-debug-baseonly
7039 @opindex femit-struct-debug-baseonly
7040 Emit debug information for struct-like types
7041 only when the base name of the compilation source file
7042 matches the base name of file in which the struct is defined.
7044 This option substantially reduces the size of debugging information,
7045 but at significant potential loss in type information to the debugger.
7046 See @option{-femit-struct-debug-reduced} for a less aggressive option.
7047 See @option{-femit-struct-debug-detailed} for more detailed control.
7049 This option works only with DWARF debug output.
7051 @item -femit-struct-debug-reduced
7052 @opindex femit-struct-debug-reduced
7053 Emit debug information for struct-like types
7054 only when the base name of the compilation source file
7055 matches the base name of file in which the type is defined,
7056 unless the struct is a template or defined in a system header.
7058 This option significantly reduces the size of debugging information,
7059 with some potential loss in type information to the debugger.
7060 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
7061 See @option{-femit-struct-debug-detailed} for more detailed control.
7063 This option works only with DWARF debug output.
7065 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
7066 @opindex femit-struct-debug-detailed
7067 Specify the struct-like types
7068 for which the compiler generates debug information.
7069 The intent is to reduce duplicate struct debug information
7070 between different object files within the same program.
7072 This option is a detailed version of
7073 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
7074 which serves for most needs.
7076 A specification has the syntax@*
7077 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
7079 The optional first word limits the specification to
7080 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
7081 A struct type is used directly when it is the type of a variable, member.
7082 Indirect uses arise through pointers to structs.
7083 That is, when use of an incomplete struct is valid, the use is indirect.
7084 An example is
7085 @samp{struct one direct; struct two * indirect;}.
7087 The optional second word limits the specification to
7088 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
7089 Generic structs are a bit complicated to explain.
7090 For C++, these are non-explicit specializations of template classes,
7091 or non-template classes within the above.
7092 Other programming languages have generics,
7093 but @option{-femit-struct-debug-detailed} does not yet implement them.
7095 The third word specifies the source files for those
7096 structs for which the compiler should emit debug information.
7097 The values @samp{none} and @samp{any} have the normal meaning.
7098 The value @samp{base} means that
7099 the base of name of the file in which the type declaration appears
7100 must match the base of the name of the main compilation file.
7101 In practice, this means that when compiling @file{foo.c}, debug information
7102 is generated for types declared in that file and @file{foo.h},
7103 but not other header files.
7104 The value @samp{sys} means those types satisfying @samp{base}
7105 or declared in system or compiler headers.
7107 You may need to experiment to determine the best settings for your application.
7109 The default is @option{-femit-struct-debug-detailed=all}.
7111 This option works only with DWARF debug output.
7113 @item -fno-dwarf2-cfi-asm
7114 @opindex fdwarf2-cfi-asm
7115 @opindex fno-dwarf2-cfi-asm
7116 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
7117 instead of using GAS @code{.cfi_*} directives.
7119 @item -fno-eliminate-unused-debug-types
7120 @opindex feliminate-unused-debug-types
7121 @opindex fno-eliminate-unused-debug-types
7122 Normally, when producing DWARF output, GCC avoids producing debug symbol 
7123 output for types that are nowhere used in the source file being compiled.
7124 Sometimes it is useful to have GCC emit debugging
7125 information for all types declared in a compilation
7126 unit, regardless of whether or not they are actually used
7127 in that compilation unit, for example 
7128 if, in the debugger, you want to cast a value to a type that is
7129 not actually used in your program (but is declared).  More often,
7130 however, this results in a significant amount of wasted space.
7131 @end table
7133 @node Optimize Options
7134 @section Options That Control Optimization
7135 @cindex optimize options
7136 @cindex options, optimization
7138 These options control various sorts of optimizations.
7140 Without any optimization option, the compiler's goal is to reduce the
7141 cost of compilation and to make debugging produce the expected
7142 results.  Statements are independent: if you stop the program with a
7143 breakpoint between statements, you can then assign a new value to any
7144 variable or change the program counter to any other statement in the
7145 function and get exactly the results you expect from the source
7146 code.
7148 Turning on optimization flags makes the compiler attempt to improve
7149 the performance and/or code size at the expense of compilation time
7150 and possibly the ability to debug the program.
7152 The compiler performs optimization based on the knowledge it has of the
7153 program.  Compiling multiple files at once to a single output file mode allows
7154 the compiler to use information gained from all of the files when compiling
7155 each of them.
7157 Not all optimizations are controlled directly by a flag.  Only
7158 optimizations that have a flag are listed in this section.
7160 Most optimizations are only enabled if an @option{-O} level is set on
7161 the command line.  Otherwise they are disabled, even if individual
7162 optimization flags are specified.
7164 Depending on the target and how GCC was configured, a slightly different
7165 set of optimizations may be enabled at each @option{-O} level than
7166 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7167 to find out the exact set of optimizations that are enabled at each level.
7168 @xref{Overall Options}, for examples.
7170 @table @gcctabopt
7171 @item -O
7172 @itemx -O1
7173 @opindex O
7174 @opindex O1
7175 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7176 more memory for a large function.
7178 With @option{-O}, the compiler tries to reduce code size and execution
7179 time, without performing any optimizations that take a great deal of
7180 compilation time.
7182 @option{-O} turns on the following optimization flags:
7183 @gccoptlist{
7184 -fauto-inc-dec @gol
7185 -fbranch-count-reg @gol
7186 -fcombine-stack-adjustments @gol
7187 -fcompare-elim @gol
7188 -fcprop-registers @gol
7189 -fdce @gol
7190 -fdefer-pop @gol
7191 -fdelayed-branch @gol
7192 -fdse @gol
7193 -fforward-propagate @gol
7194 -fguess-branch-probability @gol
7195 -fif-conversion2 @gol
7196 -fif-conversion @gol
7197 -finline-functions-called-once @gol
7198 -fipa-pure-const @gol
7199 -fipa-profile @gol
7200 -fipa-reference @gol
7201 -fmerge-constants @gol
7202 -fmove-loop-invariants @gol
7203 -freorder-blocks @gol
7204 -fshrink-wrap @gol
7205 -fshrink-wrap-separate @gol
7206 -fsplit-wide-types @gol
7207 -fssa-backprop @gol
7208 -fssa-phiopt @gol
7209 -ftree-bit-ccp @gol
7210 -ftree-ccp @gol
7211 -ftree-ch @gol
7212 -ftree-coalesce-vars @gol
7213 -ftree-copy-prop @gol
7214 -ftree-dce @gol
7215 -ftree-dominator-opts @gol
7216 -ftree-dse @gol
7217 -ftree-forwprop @gol
7218 -ftree-fre @gol
7219 -ftree-phiprop @gol
7220 -ftree-sink @gol
7221 -ftree-slsr @gol
7222 -ftree-sra @gol
7223 -ftree-pta @gol
7224 -ftree-ter @gol
7225 -funit-at-a-time}
7227 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
7228 where doing so does not interfere with debugging.
7230 @item -O2
7231 @opindex O2
7232 Optimize even more.  GCC performs nearly all supported optimizations
7233 that do not involve a space-speed tradeoff.
7234 As compared to @option{-O}, this option increases both compilation time
7235 and the performance of the generated code.
7237 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7238 also turns on the following optimization flags:
7239 @gccoptlist{-fthread-jumps @gol
7240 -falign-functions  -falign-jumps @gol
7241 -falign-loops  -falign-labels @gol
7242 -fcaller-saves @gol
7243 -fcrossjumping @gol
7244 -fcse-follow-jumps  -fcse-skip-blocks @gol
7245 -fdelete-null-pointer-checks @gol
7246 -fdevirtualize -fdevirtualize-speculatively @gol
7247 -fexpensive-optimizations @gol
7248 -fgcse  -fgcse-lm  @gol
7249 -fhoist-adjacent-loads @gol
7250 -finline-small-functions @gol
7251 -findirect-inlining @gol
7252 -fipa-cp @gol
7253 -fipa-bit-cp @gol
7254 -fipa-vrp @gol
7255 -fipa-sra @gol
7256 -fipa-icf @gol
7257 -fisolate-erroneous-paths-dereference @gol
7258 -flra-remat @gol
7259 -foptimize-sibling-calls @gol
7260 -foptimize-strlen @gol
7261 -fpartial-inlining @gol
7262 -fpeephole2 @gol
7263 -freorder-blocks-algorithm=stc @gol
7264 -freorder-blocks-and-partition -freorder-functions @gol
7265 -frerun-cse-after-loop  @gol
7266 -fsched-interblock  -fsched-spec @gol
7267 -fschedule-insns  -fschedule-insns2 @gol
7268 -fstore-merging @gol
7269 -fstrict-aliasing @gol
7270 -ftree-builtin-call-dce @gol
7271 -ftree-switch-conversion -ftree-tail-merge @gol
7272 -fcode-hoisting @gol
7273 -ftree-pre @gol
7274 -ftree-vrp @gol
7275 -fipa-ra}
7277 Please note the warning under @option{-fgcse} about
7278 invoking @option{-O2} on programs that use computed gotos.
7280 @item -O3
7281 @opindex O3
7282 Optimize yet more.  @option{-O3} turns on all optimizations specified
7283 by @option{-O2} and also turns on the following optimization flags:
7284 @gccoptlist{-finline-functions @gol
7285 -funswitch-loops @gol
7286 -fpredictive-commoning @gol
7287 -fgcse-after-reload @gol
7288 -ftree-loop-vectorize @gol
7289 -ftree-loop-distribution @gol
7290 -ftree-loop-distribute-patterns @gol
7291 -fsplit-paths @gol
7292 -ftree-slp-vectorize @gol
7293 -fvect-cost-model @gol
7294 -ftree-partial-pre @gol
7295 -fpeel-loops @gol
7296 -fipa-cp-clone}
7298 @item -O0
7299 @opindex O0
7300 Reduce compilation time and make debugging produce the expected
7301 results.  This is the default.
7303 @item -Os
7304 @opindex Os
7305 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7306 do not typically increase code size.  It also performs further
7307 optimizations designed to reduce code size.
7309 @option{-Os} disables the following optimization flags:
7310 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7311 -falign-labels  -freorder-blocks  -freorder-blocks-algorithm=stc @gol
7312 -freorder-blocks-and-partition  -fprefetch-loop-arrays}
7314 @item -Ofast
7315 @opindex Ofast
7316 Disregard strict standards compliance.  @option{-Ofast} enables all
7317 @option{-O3} optimizations.  It also enables optimizations that are not
7318 valid for all standard-compliant programs.
7319 It turns on @option{-ffast-math} and the Fortran-specific
7320 @option{-fstack-arrays}, unless @option{-fmax-stack-var-size} is
7321 specified, and @option{-fno-protect-parens}.
7323 @item -Og
7324 @opindex Og
7325 Optimize debugging experience.  @option{-Og} enables optimizations
7326 that do not interfere with debugging. It should be the optimization
7327 level of choice for the standard edit-compile-debug cycle, offering
7328 a reasonable level of optimization while maintaining fast compilation
7329 and a good debugging experience.
7330 @end table
7332 If you use multiple @option{-O} options, with or without level numbers,
7333 the last such option is the one that is effective.
7335 Options of the form @option{-f@var{flag}} specify machine-independent
7336 flags.  Most flags have both positive and negative forms; the negative
7337 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7338 below, only one of the forms is listed---the one you typically 
7339 use.  You can figure out the other form by either removing @samp{no-}
7340 or adding it.
7342 The following options control specific optimizations.  They are either
7343 activated by @option{-O} options or are related to ones that are.  You
7344 can use the following flags in the rare cases when ``fine-tuning'' of
7345 optimizations to be performed is desired.
7347 @table @gcctabopt
7348 @item -fno-defer-pop
7349 @opindex fno-defer-pop
7350 Always pop the arguments to each function call as soon as that function
7351 returns.  For machines that must pop arguments after a function call,
7352 the compiler normally lets arguments accumulate on the stack for several
7353 function calls and pops them all at once.
7355 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7357 @item -fforward-propagate
7358 @opindex fforward-propagate
7359 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7360 instructions and checks if the result can be simplified.  If loop unrolling
7361 is active, two passes are performed and the second is scheduled after
7362 loop unrolling.
7364 This option is enabled by default at optimization levels @option{-O},
7365 @option{-O2}, @option{-O3}, @option{-Os}.
7367 @item -ffp-contract=@var{style}
7368 @opindex ffp-contract
7369 @option{-ffp-contract=off} disables floating-point expression contraction.
7370 @option{-ffp-contract=fast} enables floating-point expression contraction
7371 such as forming of fused multiply-add operations if the target has
7372 native support for them.
7373 @option{-ffp-contract=on} enables floating-point expression contraction
7374 if allowed by the language standard.  This is currently not implemented
7375 and treated equal to @option{-ffp-contract=off}.
7377 The default is @option{-ffp-contract=fast}.
7379 @item -fomit-frame-pointer
7380 @opindex fomit-frame-pointer
7381 Don't keep the frame pointer in a register for functions that
7382 don't need one.  This avoids the instructions to save, set up and
7383 restore frame pointers; it also makes an extra register available
7384 in many functions.  @strong{It also makes debugging impossible on
7385 some machines.}
7387 On some machines, such as the VAX, this flag has no effect, because
7388 the standard calling sequence automatically handles the frame pointer
7389 and nothing is saved by pretending it doesn't exist.  The
7390 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7391 whether a target machine supports this flag.  @xref{Registers,,Register
7392 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7394 The default setting (when not optimizing for
7395 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets is
7396 @option{-fomit-frame-pointer}.  You can configure GCC with the
7397 @option{--enable-frame-pointer} configure option to change the default.
7399 Note that @option{-fno-omit-frame-pointer} doesn't force a new stack
7400 frame for all functions if it isn't otherwise needed, and hence doesn't
7401 guarantee a new frame pointer for all functions.
7403 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7405 @item -foptimize-sibling-calls
7406 @opindex foptimize-sibling-calls
7407 Optimize sibling and tail recursive calls.
7409 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7411 @item -foptimize-strlen
7412 @opindex foptimize-strlen
7413 Optimize various standard C string functions (e.g. @code{strlen},
7414 @code{strchr} or @code{strcpy}) and
7415 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
7417 Enabled at levels @option{-O2}, @option{-O3}.
7419 @item -fno-inline
7420 @opindex fno-inline
7421 Do not expand any functions inline apart from those marked with
7422 the @code{always_inline} attribute.  This is the default when not
7423 optimizing.
7425 Single functions can be exempted from inlining by marking them
7426 with the @code{noinline} attribute.
7428 @item -finline-small-functions
7429 @opindex finline-small-functions
7430 Integrate functions into their callers when their body is smaller than expected
7431 function call code (so overall size of program gets smaller).  The compiler
7432 heuristically decides which functions are simple enough to be worth integrating
7433 in this way.  This inlining applies to all functions, even those not declared
7434 inline.
7436 Enabled at level @option{-O2}.
7438 @item -findirect-inlining
7439 @opindex findirect-inlining
7440 Inline also indirect calls that are discovered to be known at compile
7441 time thanks to previous inlining.  This option has any effect only
7442 when inlining itself is turned on by the @option{-finline-functions}
7443 or @option{-finline-small-functions} options.
7445 Enabled at level @option{-O2}.
7447 @item -finline-functions
7448 @opindex finline-functions
7449 Consider all functions for inlining, even if they are not declared inline.
7450 The compiler heuristically decides which functions are worth integrating
7451 in this way.
7453 If all calls to a given function are integrated, and the function is
7454 declared @code{static}, then the function is normally not output as
7455 assembler code in its own right.
7457 Enabled at level @option{-O3}.
7459 @item -finline-functions-called-once
7460 @opindex finline-functions-called-once
7461 Consider all @code{static} functions called once for inlining into their
7462 caller even if they are not marked @code{inline}.  If a call to a given
7463 function is integrated, then the function is not output as assembler code
7464 in its own right.
7466 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7468 @item -fearly-inlining
7469 @opindex fearly-inlining
7470 Inline functions marked by @code{always_inline} and functions whose body seems
7471 smaller than the function call overhead early before doing
7472 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7473 makes profiling significantly cheaper and usually inlining faster on programs
7474 having large chains of nested wrapper functions.
7476 Enabled by default.
7478 @item -fipa-sra
7479 @opindex fipa-sra
7480 Perform interprocedural scalar replacement of aggregates, removal of
7481 unused parameters and replacement of parameters passed by reference
7482 by parameters passed by value.
7484 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7486 @item -finline-limit=@var{n}
7487 @opindex finline-limit
7488 By default, GCC limits the size of functions that can be inlined.  This flag
7489 allows coarse control of this limit.  @var{n} is the size of functions that
7490 can be inlined in number of pseudo instructions.
7492 Inlining is actually controlled by a number of parameters, which may be
7493 specified individually by using @option{--param @var{name}=@var{value}}.
7494 The @option{-finline-limit=@var{n}} option sets some of these parameters
7495 as follows:
7497 @table @gcctabopt
7498 @item max-inline-insns-single
7499 is set to @var{n}/2.
7500 @item max-inline-insns-auto
7501 is set to @var{n}/2.
7502 @end table
7504 See below for a documentation of the individual
7505 parameters controlling inlining and for the defaults of these parameters.
7507 @emph{Note:} there may be no value to @option{-finline-limit} that results
7508 in default behavior.
7510 @emph{Note:} pseudo instruction represents, in this particular context, an
7511 abstract measurement of function's size.  In no way does it represent a count
7512 of assembly instructions and as such its exact meaning might change from one
7513 release to an another.
7515 @item -fno-keep-inline-dllexport
7516 @opindex fno-keep-inline-dllexport
7517 This is a more fine-grained version of @option{-fkeep-inline-functions},
7518 which applies only to functions that are declared using the @code{dllexport}
7519 attribute or declspec.  @xref{Function Attributes,,Declaring Attributes of
7520 Functions}.
7522 @item -fkeep-inline-functions
7523 @opindex fkeep-inline-functions
7524 In C, emit @code{static} functions that are declared @code{inline}
7525 into the object file, even if the function has been inlined into all
7526 of its callers.  This switch does not affect functions using the
7527 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7528 inline functions into the object file.
7530 @item -fkeep-static-functions
7531 @opindex fkeep-static-functions
7532 Emit @code{static} functions into the object file, even if the function
7533 is never used.
7535 @item -fkeep-static-consts
7536 @opindex fkeep-static-consts
7537 Emit variables declared @code{static const} when optimization isn't turned
7538 on, even if the variables aren't referenced.
7540 GCC enables this option by default.  If you want to force the compiler to
7541 check if a variable is referenced, regardless of whether or not
7542 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7544 @item -fmerge-constants
7545 @opindex fmerge-constants
7546 Attempt to merge identical constants (string constants and floating-point
7547 constants) across compilation units.
7549 This option is the default for optimized compilation if the assembler and
7550 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7551 behavior.
7553 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7555 @item -fmerge-all-constants
7556 @opindex fmerge-all-constants
7557 Attempt to merge identical constants and identical variables.
7559 This option implies @option{-fmerge-constants}.  In addition to
7560 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7561 arrays or initialized constant variables with integral or floating-point
7562 types.  Languages like C or C++ require each variable, including multiple
7563 instances of the same variable in recursive calls, to have distinct locations,
7564 so using this option results in non-conforming
7565 behavior.
7567 @item -fmodulo-sched
7568 @opindex fmodulo-sched
7569 Perform swing modulo scheduling immediately before the first scheduling
7570 pass.  This pass looks at innermost loops and reorders their
7571 instructions by overlapping different iterations.
7573 @item -fmodulo-sched-allow-regmoves
7574 @opindex fmodulo-sched-allow-regmoves
7575 Perform more aggressive SMS-based modulo scheduling with register moves
7576 allowed.  By setting this flag certain anti-dependences edges are
7577 deleted, which triggers the generation of reg-moves based on the
7578 life-range analysis.  This option is effective only with
7579 @option{-fmodulo-sched} enabled.
7581 @item -fno-branch-count-reg
7582 @opindex fno-branch-count-reg
7583 Avoid running a pass scanning for opportunities to use ``decrement and
7584 branch'' instructions on a count register instead of generating sequences
7585 of instructions that decrement a register, compare it against zero, and
7586 then branch based upon the result.  This option is only meaningful on
7587 architectures that support such instructions, which include x86, PowerPC,
7588 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
7589 doesn't remove the decrement and branch instructions from the generated
7590 instruction stream introduced by other optimization passes.
7592 Enabled by default at @option{-O1} and higher.
7594 The default is @option{-fbranch-count-reg}.
7596 @item -fno-function-cse
7597 @opindex fno-function-cse
7598 Do not put function addresses in registers; make each instruction that
7599 calls a constant function contain the function's address explicitly.
7601 This option results in less efficient code, but some strange hacks
7602 that alter the assembler output may be confused by the optimizations
7603 performed when this option is not used.
7605 The default is @option{-ffunction-cse}
7607 @item -fno-zero-initialized-in-bss
7608 @opindex fno-zero-initialized-in-bss
7609 If the target supports a BSS section, GCC by default puts variables that
7610 are initialized to zero into BSS@.  This can save space in the resulting
7611 code.
7613 This option turns off this behavior because some programs explicitly
7614 rely on variables going to the data section---e.g., so that the
7615 resulting executable can find the beginning of that section and/or make
7616 assumptions based on that.
7618 The default is @option{-fzero-initialized-in-bss}.
7620 @item -fthread-jumps
7621 @opindex fthread-jumps
7622 Perform optimizations that check to see if a jump branches to a
7623 location where another comparison subsumed by the first is found.  If
7624 so, the first branch is redirected to either the destination of the
7625 second branch or a point immediately following it, depending on whether
7626 the condition is known to be true or false.
7628 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7630 @item -fsplit-wide-types
7631 @opindex fsplit-wide-types
7632 When using a type that occupies multiple registers, such as @code{long
7633 long} on a 32-bit system, split the registers apart and allocate them
7634 independently.  This normally generates better code for those types,
7635 but may make debugging more difficult.
7637 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7638 @option{-Os}.
7640 @item -fcse-follow-jumps
7641 @opindex fcse-follow-jumps
7642 In common subexpression elimination (CSE), scan through jump instructions
7643 when the target of the jump is not reached by any other path.  For
7644 example, when CSE encounters an @code{if} statement with an
7645 @code{else} clause, CSE follows the jump when the condition
7646 tested is false.
7648 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7650 @item -fcse-skip-blocks
7651 @opindex fcse-skip-blocks
7652 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7653 follow jumps that conditionally skip over blocks.  When CSE
7654 encounters a simple @code{if} statement with no else clause,
7655 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7656 body of the @code{if}.
7658 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7660 @item -frerun-cse-after-loop
7661 @opindex frerun-cse-after-loop
7662 Re-run common subexpression elimination after loop optimizations are
7663 performed.
7665 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7667 @item -fgcse
7668 @opindex fgcse
7669 Perform a global common subexpression elimination pass.
7670 This pass also performs global constant and copy propagation.
7672 @emph{Note:} When compiling a program using computed gotos, a GCC
7673 extension, you may get better run-time performance if you disable
7674 the global common subexpression elimination pass by adding
7675 @option{-fno-gcse} to the command line.
7677 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7679 @item -fgcse-lm
7680 @opindex fgcse-lm
7681 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7682 attempts to move loads that are only killed by stores into themselves.  This
7683 allows a loop containing a load/store sequence to be changed to a load outside
7684 the loop, and a copy/store within the loop.
7686 Enabled by default when @option{-fgcse} is enabled.
7688 @item -fgcse-sm
7689 @opindex fgcse-sm
7690 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7691 global common subexpression elimination.  This pass attempts to move
7692 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7693 loops containing a load/store sequence can be changed to a load before
7694 the loop and a store after the loop.
7696 Not enabled at any optimization level.
7698 @item -fgcse-las
7699 @opindex fgcse-las
7700 When @option{-fgcse-las} is enabled, the global common subexpression
7701 elimination pass eliminates redundant loads that come after stores to the
7702 same memory location (both partial and full redundancies).
7704 Not enabled at any optimization level.
7706 @item -fgcse-after-reload
7707 @opindex fgcse-after-reload
7708 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7709 pass is performed after reload.  The purpose of this pass is to clean up
7710 redundant spilling.
7712 @item -faggressive-loop-optimizations
7713 @opindex faggressive-loop-optimizations
7714 This option tells the loop optimizer to use language constraints to
7715 derive bounds for the number of iterations of a loop.  This assumes that
7716 loop code does not invoke undefined behavior by for example causing signed
7717 integer overflows or out-of-bound array accesses.  The bounds for the
7718 number of iterations of a loop are used to guide loop unrolling and peeling
7719 and loop exit test optimizations.
7720 This option is enabled by default.
7722 @item -funconstrained-commons
7723 @opindex funconstrained-commons
7724 This option tells the compiler that variables declared in common blocks
7725 (e.g. Fortran) may later be overridden with longer trailing arrays. This
7726 prevents certain optimizations that depend on knowing the array bounds.
7728 @item -fcrossjumping
7729 @opindex fcrossjumping
7730 Perform cross-jumping transformation.
7731 This transformation unifies equivalent code and saves code size.  The
7732 resulting code may or may not perform better than without cross-jumping.
7734 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7736 @item -fauto-inc-dec
7737 @opindex fauto-inc-dec
7738 Combine increments or decrements of addresses with memory accesses.
7739 This pass is always skipped on architectures that do not have
7740 instructions to support this.  Enabled by default at @option{-O} and
7741 higher on architectures that support this.
7743 @item -fdce
7744 @opindex fdce
7745 Perform dead code elimination (DCE) on RTL@.
7746 Enabled by default at @option{-O} and higher.
7748 @item -fdse
7749 @opindex fdse
7750 Perform dead store elimination (DSE) on RTL@.
7751 Enabled by default at @option{-O} and higher.
7753 @item -fif-conversion
7754 @opindex fif-conversion
7755 Attempt to transform conditional jumps into branch-less equivalents.  This
7756 includes use of conditional moves, min, max, set flags and abs instructions, and
7757 some tricks doable by standard arithmetics.  The use of conditional execution
7758 on chips where it is available is controlled by @option{-fif-conversion2}.
7760 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7762 @item -fif-conversion2
7763 @opindex fif-conversion2
7764 Use conditional execution (where available) to transform conditional jumps into
7765 branch-less equivalents.
7767 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7769 @item -fdeclone-ctor-dtor
7770 @opindex fdeclone-ctor-dtor
7771 The C++ ABI requires multiple entry points for constructors and
7772 destructors: one for a base subobject, one for a complete object, and
7773 one for a virtual destructor that calls operator delete afterwards.
7774 For a hierarchy with virtual bases, the base and complete variants are
7775 clones, which means two copies of the function.  With this option, the
7776 base and complete variants are changed to be thunks that call a common
7777 implementation.
7779 Enabled by @option{-Os}.
7781 @item -fdelete-null-pointer-checks
7782 @opindex fdelete-null-pointer-checks
7783 Assume that programs cannot safely dereference null pointers, and that
7784 no code or data element resides at address zero.
7785 This option enables simple constant
7786 folding optimizations at all optimization levels.  In addition, other
7787 optimization passes in GCC use this flag to control global dataflow
7788 analyses that eliminate useless checks for null pointers; these assume
7789 that a memory access to address zero always results in a trap, so
7790 that if a pointer is checked after it has already been dereferenced,
7791 it cannot be null.
7793 Note however that in some environments this assumption is not true.
7794 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7795 for programs that depend on that behavior.
7797 This option is enabled by default on most targets.  On Nios II ELF, it
7798 defaults to off.  On AVR and CR16, this option is completely disabled.  
7800 Passes that use the dataflow information
7801 are enabled independently at different optimization levels.
7803 @item -fdevirtualize
7804 @opindex fdevirtualize
7805 Attempt to convert calls to virtual functions to direct calls.  This
7806 is done both within a procedure and interprocedurally as part of
7807 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
7808 propagation (@option{-fipa-cp}).
7809 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7811 @item -fdevirtualize-speculatively
7812 @opindex fdevirtualize-speculatively
7813 Attempt to convert calls to virtual functions to speculative direct calls.
7814 Based on the analysis of the type inheritance graph, determine for a given call
7815 the set of likely targets. If the set is small, preferably of size 1, change
7816 the call into a conditional deciding between direct and indirect calls.  The
7817 speculative calls enable more optimizations, such as inlining.  When they seem
7818 useless after further optimization, they are converted back into original form.
7820 @item -fdevirtualize-at-ltrans
7821 @opindex fdevirtualize-at-ltrans
7822 Stream extra information needed for aggressive devirtualization when running
7823 the link-time optimizer in local transformation mode.  
7824 This option enables more devirtualization but
7825 significantly increases the size of streamed data. For this reason it is
7826 disabled by default.
7828 @item -fexpensive-optimizations
7829 @opindex fexpensive-optimizations
7830 Perform a number of minor optimizations that are relatively expensive.
7832 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7834 @item -free
7835 @opindex free
7836 Attempt to remove redundant extension instructions.  This is especially
7837 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7838 registers after writing to their lower 32-bit half.
7840 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
7841 @option{-O3}, @option{-Os}.
7843 @item -fno-lifetime-dse
7844 @opindex fno-lifetime-dse
7845 In C++ the value of an object is only affected by changes within its
7846 lifetime: when the constructor begins, the object has an indeterminate
7847 value, and any changes during the lifetime of the object are dead when
7848 the object is destroyed.  Normally dead store elimination will take
7849 advantage of this; if your code relies on the value of the object
7850 storage persisting beyond the lifetime of the object, you can use this
7851 flag to disable this optimization.  To preserve stores before the
7852 constructor starts (e.g. because your operator new clears the object
7853 storage) but still treat the object as dead after the destructor you,
7854 can use @option{-flifetime-dse=1}.  The default behavior can be
7855 explicitly selected with @option{-flifetime-dse=2}.
7856 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
7858 @item -flive-range-shrinkage
7859 @opindex flive-range-shrinkage
7860 Attempt to decrease register pressure through register live range
7861 shrinkage.  This is helpful for fast processors with small or moderate
7862 size register sets.
7864 @item -fira-algorithm=@var{algorithm}
7865 @opindex fira-algorithm
7866 Use the specified coloring algorithm for the integrated register
7867 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7868 specifies Chow's priority coloring, or @samp{CB}, which specifies
7869 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7870 for all architectures, but for those targets that do support it, it is
7871 the default because it generates better code.
7873 @item -fira-region=@var{region}
7874 @opindex fira-region
7875 Use specified regions for the integrated register allocator.  The
7876 @var{region} argument should be one of the following:
7878 @table @samp
7880 @item all
7881 Use all loops as register allocation regions.
7882 This can give the best results for machines with a small and/or
7883 irregular register set.
7885 @item mixed
7886 Use all loops except for loops with small register pressure 
7887 as the regions.  This value usually gives
7888 the best results in most cases and for most architectures,
7889 and is enabled by default when compiling with optimization for speed
7890 (@option{-O}, @option{-O2}, @dots{}).
7892 @item one
7893 Use all functions as a single region.  
7894 This typically results in the smallest code size, and is enabled by default for
7895 @option{-Os} or @option{-O0}.
7897 @end table
7899 @item -fira-hoist-pressure
7900 @opindex fira-hoist-pressure
7901 Use IRA to evaluate register pressure in the code hoisting pass for
7902 decisions to hoist expressions.  This option usually results in smaller
7903 code, but it can slow the compiler down.
7905 This option is enabled at level @option{-Os} for all targets.
7907 @item -fira-loop-pressure
7908 @opindex fira-loop-pressure
7909 Use IRA to evaluate register pressure in loops for decisions to move
7910 loop invariants.  This option usually results in generation
7911 of faster and smaller code on machines with large register files (>= 32
7912 registers), but it can slow the compiler down.
7914 This option is enabled at level @option{-O3} for some targets.
7916 @item -fno-ira-share-save-slots
7917 @opindex fno-ira-share-save-slots
7918 Disable sharing of stack slots used for saving call-used hard
7919 registers living through a call.  Each hard register gets a
7920 separate stack slot, and as a result function stack frames are
7921 larger.
7923 @item -fno-ira-share-spill-slots
7924 @opindex fno-ira-share-spill-slots
7925 Disable sharing of stack slots allocated for pseudo-registers.  Each
7926 pseudo-register that does not get a hard register gets a separate
7927 stack slot, and as a result function stack frames are larger.
7929 @item -flra-remat
7930 @opindex flra-remat
7931 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
7932 values of spilled pseudos, LRA tries to rematerialize (recalculate)
7933 values if it is profitable.
7935 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7937 @item -fdelayed-branch
7938 @opindex fdelayed-branch
7939 If supported for the target machine, attempt to reorder instructions
7940 to exploit instruction slots available after delayed branch
7941 instructions.
7943 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7945 @item -fschedule-insns
7946 @opindex fschedule-insns
7947 If supported for the target machine, attempt to reorder instructions to
7948 eliminate execution stalls due to required data being unavailable.  This
7949 helps machines that have slow floating point or memory load instructions
7950 by allowing other instructions to be issued until the result of the load
7951 or floating-point instruction is required.
7953 Enabled at levels @option{-O2}, @option{-O3}.
7955 @item -fschedule-insns2
7956 @opindex fschedule-insns2
7957 Similar to @option{-fschedule-insns}, but requests an additional pass of
7958 instruction scheduling after register allocation has been done.  This is
7959 especially useful on machines with a relatively small number of
7960 registers and where memory load instructions take more than one cycle.
7962 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7964 @item -fno-sched-interblock
7965 @opindex fno-sched-interblock
7966 Don't schedule instructions across basic blocks.  This is normally
7967 enabled by default when scheduling before register allocation, i.e.@:
7968 with @option{-fschedule-insns} or at @option{-O2} or higher.
7970 @item -fno-sched-spec
7971 @opindex fno-sched-spec
7972 Don't allow speculative motion of non-load instructions.  This is normally
7973 enabled by default when scheduling before register allocation, i.e.@:
7974 with @option{-fschedule-insns} or at @option{-O2} or higher.
7976 @item -fsched-pressure
7977 @opindex fsched-pressure
7978 Enable register pressure sensitive insn scheduling before register
7979 allocation.  This only makes sense when scheduling before register
7980 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7981 @option{-O2} or higher.  Usage of this option can improve the
7982 generated code and decrease its size by preventing register pressure
7983 increase above the number of available hard registers and subsequent
7984 spills in register allocation.
7986 @item -fsched-spec-load
7987 @opindex fsched-spec-load
7988 Allow speculative motion of some load instructions.  This only makes
7989 sense when scheduling before register allocation, i.e.@: with
7990 @option{-fschedule-insns} or at @option{-O2} or higher.
7992 @item -fsched-spec-load-dangerous
7993 @opindex fsched-spec-load-dangerous
7994 Allow speculative motion of more load instructions.  This only makes
7995 sense when scheduling before register allocation, i.e.@: with
7996 @option{-fschedule-insns} or at @option{-O2} or higher.
7998 @item -fsched-stalled-insns
7999 @itemx -fsched-stalled-insns=@var{n}
8000 @opindex fsched-stalled-insns
8001 Define how many insns (if any) can be moved prematurely from the queue
8002 of stalled insns into the ready list during the second scheduling pass.
8003 @option{-fno-sched-stalled-insns} means that no insns are moved
8004 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
8005 on how many queued insns can be moved prematurely.
8006 @option{-fsched-stalled-insns} without a value is equivalent to
8007 @option{-fsched-stalled-insns=1}.
8009 @item -fsched-stalled-insns-dep
8010 @itemx -fsched-stalled-insns-dep=@var{n}
8011 @opindex fsched-stalled-insns-dep
8012 Define how many insn groups (cycles) are examined for a dependency
8013 on a stalled insn that is a candidate for premature removal from the queue
8014 of stalled insns.  This has an effect only during the second scheduling pass,
8015 and only if @option{-fsched-stalled-insns} is used.
8016 @option{-fno-sched-stalled-insns-dep} is equivalent to
8017 @option{-fsched-stalled-insns-dep=0}.
8018 @option{-fsched-stalled-insns-dep} without a value is equivalent to
8019 @option{-fsched-stalled-insns-dep=1}.
8021 @item -fsched2-use-superblocks
8022 @opindex fsched2-use-superblocks
8023 When scheduling after register allocation, use superblock scheduling.
8024 This allows motion across basic block boundaries,
8025 resulting in faster schedules.  This option is experimental, as not all machine
8026 descriptions used by GCC model the CPU closely enough to avoid unreliable
8027 results from the algorithm.
8029 This only makes sense when scheduling after register allocation, i.e.@: with
8030 @option{-fschedule-insns2} or at @option{-O2} or higher.
8032 @item -fsched-group-heuristic
8033 @opindex fsched-group-heuristic
8034 Enable the group heuristic in the scheduler.  This heuristic favors
8035 the instruction that belongs to a schedule group.  This is enabled
8036 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8037 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8039 @item -fsched-critical-path-heuristic
8040 @opindex fsched-critical-path-heuristic
8041 Enable the critical-path heuristic in the scheduler.  This heuristic favors
8042 instructions on the critical path.  This is enabled by default when
8043 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8044 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8046 @item -fsched-spec-insn-heuristic
8047 @opindex fsched-spec-insn-heuristic
8048 Enable the speculative instruction heuristic in the scheduler.  This
8049 heuristic favors speculative instructions with greater dependency weakness.
8050 This is enabled by default when scheduling is enabled, i.e.@:
8051 with @option{-fschedule-insns} or @option{-fschedule-insns2}
8052 or at @option{-O2} or higher.
8054 @item -fsched-rank-heuristic
8055 @opindex fsched-rank-heuristic
8056 Enable the rank heuristic in the scheduler.  This heuristic favors
8057 the instruction belonging to a basic block with greater size or frequency.
8058 This is enabled by default when scheduling is enabled, i.e.@:
8059 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8060 at @option{-O2} or higher.
8062 @item -fsched-last-insn-heuristic
8063 @opindex fsched-last-insn-heuristic
8064 Enable the last-instruction heuristic in the scheduler.  This heuristic
8065 favors the instruction that is less dependent on the last instruction
8066 scheduled.  This is enabled by default when scheduling is enabled,
8067 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8068 at @option{-O2} or higher.
8070 @item -fsched-dep-count-heuristic
8071 @opindex fsched-dep-count-heuristic
8072 Enable the dependent-count heuristic in the scheduler.  This heuristic
8073 favors the instruction that has more instructions depending on it.
8074 This is enabled by default when scheduling is enabled, i.e.@:
8075 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8076 at @option{-O2} or higher.
8078 @item -freschedule-modulo-scheduled-loops
8079 @opindex freschedule-modulo-scheduled-loops
8080 Modulo scheduling is performed before traditional scheduling.  If a loop
8081 is modulo scheduled, later scheduling passes may change its schedule.  
8082 Use this option to control that behavior.
8084 @item -fselective-scheduling
8085 @opindex fselective-scheduling
8086 Schedule instructions using selective scheduling algorithm.  Selective
8087 scheduling runs instead of the first scheduler pass.
8089 @item -fselective-scheduling2
8090 @opindex fselective-scheduling2
8091 Schedule instructions using selective scheduling algorithm.  Selective
8092 scheduling runs instead of the second scheduler pass.
8094 @item -fsel-sched-pipelining
8095 @opindex fsel-sched-pipelining
8096 Enable software pipelining of innermost loops during selective scheduling.
8097 This option has no effect unless one of @option{-fselective-scheduling} or
8098 @option{-fselective-scheduling2} is turned on.
8100 @item -fsel-sched-pipelining-outer-loops
8101 @opindex fsel-sched-pipelining-outer-loops
8102 When pipelining loops during selective scheduling, also pipeline outer loops.
8103 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
8105 @item -fsemantic-interposition
8106 @opindex fsemantic-interposition
8107 Some object formats, like ELF, allow interposing of symbols by the 
8108 dynamic linker.
8109 This means that for symbols exported from the DSO, the compiler cannot perform
8110 interprocedural propagation, inlining and other optimizations in anticipation
8111 that the function or variable in question may change. While this feature is
8112 useful, for example, to rewrite memory allocation functions by a debugging
8113 implementation, it is expensive in the terms of code quality.
8114 With @option{-fno-semantic-interposition} the compiler assumes that 
8115 if interposition happens for functions the overwriting function will have 
8116 precisely the same semantics (and side effects). 
8117 Similarly if interposition happens
8118 for variables, the constructor of the variable will be the same. The flag
8119 has no effect for functions explicitly declared inline 
8120 (where it is never allowed for interposition to change semantics) 
8121 and for symbols explicitly declared weak.
8123 @item -fshrink-wrap
8124 @opindex fshrink-wrap
8125 Emit function prologues only before parts of the function that need it,
8126 rather than at the top of the function.  This flag is enabled by default at
8127 @option{-O} and higher.
8129 @item -fshrink-wrap-separate
8130 @opindex fshrink-wrap-separate
8131 Shrink-wrap separate parts of the prologue and epilogue separately, so that
8132 those parts are only executed when needed.
8133 This option is on by default, but has no effect unless @option{-fshrink-wrap}
8134 is also turned on and the target supports this.
8136 @item -fcaller-saves
8137 @opindex fcaller-saves
8138 Enable allocation of values to registers that are clobbered by
8139 function calls, by emitting extra instructions to save and restore the
8140 registers around such calls.  Such allocation is done only when it
8141 seems to result in better code.
8143 This option is always enabled by default on certain machines, usually
8144 those which have no call-preserved registers to use instead.
8146 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8148 @item -fcombine-stack-adjustments
8149 @opindex fcombine-stack-adjustments
8150 Tracks stack adjustments (pushes and pops) and stack memory references
8151 and then tries to find ways to combine them.
8153 Enabled by default at @option{-O1} and higher.
8155 @item -fipa-ra
8156 @opindex fipa-ra
8157 Use caller save registers for allocation if those registers are not used by
8158 any called function.  In that case it is not necessary to save and restore
8159 them around calls.  This is only possible if called functions are part of
8160 same compilation unit as current function and they are compiled before it.
8162 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}, however the option
8163 is disabled if generated code will be instrumented for profiling
8164 (@option{-p}, or @option{-pg}) or if callee's register usage cannot be known
8165 exactly (this happens on targets that do not expose prologues
8166 and epilogues in RTL).
8168 @item -fconserve-stack
8169 @opindex fconserve-stack
8170 Attempt to minimize stack usage.  The compiler attempts to use less
8171 stack space, even if that makes the program slower.  This option
8172 implies setting the @option{large-stack-frame} parameter to 100
8173 and the @option{large-stack-frame-growth} parameter to 400.
8175 @item -ftree-reassoc
8176 @opindex ftree-reassoc
8177 Perform reassociation on trees.  This flag is enabled by default
8178 at @option{-O} and higher.
8180 @item -fcode-hoisting
8181 @opindex fcode-hoisting
8182 Perform code hoisting.  Code hoisting tries to move the
8183 evaluation of expressions executed on all paths to the function exit
8184 as early as possible.  This is especially useful as a code size
8185 optimization, but it often helps for code speed as well.
8186 This flag is enabled by default at @option{-O2} and higher.
8188 @item -ftree-pre
8189 @opindex ftree-pre
8190 Perform partial redundancy elimination (PRE) on trees.  This flag is
8191 enabled by default at @option{-O2} and @option{-O3}.
8193 @item -ftree-partial-pre
8194 @opindex ftree-partial-pre
8195 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8196 enabled by default at @option{-O3}.
8198 @item -ftree-forwprop
8199 @opindex ftree-forwprop
8200 Perform forward propagation on trees.  This flag is enabled by default
8201 at @option{-O} and higher.
8203 @item -ftree-fre
8204 @opindex ftree-fre
8205 Perform full redundancy elimination (FRE) on trees.  The difference
8206 between FRE and PRE is that FRE only considers expressions
8207 that are computed on all paths leading to the redundant computation.
8208 This analysis is faster than PRE, though it exposes fewer redundancies.
8209 This flag is enabled by default at @option{-O} and higher.
8211 @item -ftree-phiprop
8212 @opindex ftree-phiprop
8213 Perform hoisting of loads from conditional pointers on trees.  This
8214 pass is enabled by default at @option{-O} and higher.
8216 @item -fhoist-adjacent-loads
8217 @opindex fhoist-adjacent-loads
8218 Speculatively hoist loads from both branches of an if-then-else if the
8219 loads are from adjacent locations in the same structure and the target
8220 architecture has a conditional move instruction.  This flag is enabled
8221 by default at @option{-O2} and higher.
8223 @item -ftree-copy-prop
8224 @opindex ftree-copy-prop
8225 Perform copy propagation on trees.  This pass eliminates unnecessary
8226 copy operations.  This flag is enabled by default at @option{-O} and
8227 higher.
8229 @item -fipa-pure-const
8230 @opindex fipa-pure-const
8231 Discover which functions are pure or constant.
8232 Enabled by default at @option{-O} and higher.
8234 @item -fipa-reference
8235 @opindex fipa-reference
8236 Discover which static variables do not escape the
8237 compilation unit.
8238 Enabled by default at @option{-O} and higher.
8240 @item -fipa-pta
8241 @opindex fipa-pta
8242 Perform interprocedural pointer analysis and interprocedural modification
8243 and reference analysis.  This option can cause excessive memory and
8244 compile-time usage on large compilation units.  It is not enabled by
8245 default at any optimization level.
8247 @item -fipa-profile
8248 @opindex fipa-profile
8249 Perform interprocedural profile propagation.  The functions called only from
8250 cold functions are marked as cold. Also functions executed once (such as
8251 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
8252 functions and loop less parts of functions executed once are then optimized for
8253 size.
8254 Enabled by default at @option{-O} and higher.
8256 @item -fipa-cp
8257 @opindex fipa-cp
8258 Perform interprocedural constant propagation.
8259 This optimization analyzes the program to determine when values passed
8260 to functions are constants and then optimizes accordingly.
8261 This optimization can substantially increase performance
8262 if the application has constants passed to functions.
8263 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
8265 @item -fipa-cp-clone
8266 @opindex fipa-cp-clone
8267 Perform function cloning to make interprocedural constant propagation stronger.
8268 When enabled, interprocedural constant propagation performs function cloning
8269 when externally visible function can be called with constant arguments.
8270 Because this optimization can create multiple copies of functions,
8271 it may significantly increase code size
8272 (see @option{--param ipcp-unit-growth=@var{value}}).
8273 This flag is enabled by default at @option{-O3}.
8275 @item -fipa-bit-cp
8276 @opindex -fipa-bit-cp
8277 When enabled, perform interprocedural bitwise constant
8278 propagation. This flag is enabled by default at @option{-O2}. It
8279 requires that @option{-fipa-cp} is enabled.
8281 @item -fipa-vrp
8282 @opindex -fipa-vrp
8283 When enabled, perform interprocedural propagation of value
8284 ranges. This flag is enabled by default at @option{-O2}. It requires
8285 that @option{-fipa-cp} is enabled.
8287 @item -fipa-icf
8288 @opindex fipa-icf
8289 Perform Identical Code Folding for functions and read-only variables.
8290 The optimization reduces code size and may disturb unwind stacks by replacing
8291 a function by equivalent one with a different name. The optimization works
8292 more effectively with link-time optimization enabled.
8294 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
8295 works on different levels and thus the optimizations are not same - there are
8296 equivalences that are found only by GCC and equivalences found only by Gold.
8298 This flag is enabled by default at @option{-O2} and @option{-Os}.
8300 @item -fisolate-erroneous-paths-dereference
8301 @opindex fisolate-erroneous-paths-dereference
8302 Detect paths that trigger erroneous or undefined behavior due to
8303 dereferencing a null pointer.  Isolate those paths from the main control
8304 flow and turn the statement with erroneous or undefined behavior into a trap.
8305 This flag is enabled by default at @option{-O2} and higher and depends on
8306 @option{-fdelete-null-pointer-checks} also being enabled.
8308 @item -fisolate-erroneous-paths-attribute
8309 @opindex fisolate-erroneous-paths-attribute
8310 Detect paths that trigger erroneous or undefined behavior due a null value
8311 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
8312 attribute.  Isolate those paths from the main control flow and turn the
8313 statement with erroneous or undefined behavior into a trap.  This is not
8314 currently enabled, but may be enabled by @option{-O2} in the future.
8316 @item -ftree-sink
8317 @opindex ftree-sink
8318 Perform forward store motion on trees.  This flag is
8319 enabled by default at @option{-O} and higher.
8321 @item -ftree-bit-ccp
8322 @opindex ftree-bit-ccp
8323 Perform sparse conditional bit constant propagation on trees and propagate
8324 pointer alignment information.
8325 This pass only operates on local scalar variables and is enabled by default
8326 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
8328 @item -ftree-ccp
8329 @opindex ftree-ccp
8330 Perform sparse conditional constant propagation (CCP) on trees.  This
8331 pass only operates on local scalar variables and is enabled by default
8332 at @option{-O} and higher.
8334 @item -fssa-backprop
8335 @opindex fssa-backprop
8336 Propagate information about uses of a value up the definition chain
8337 in order to simplify the definitions.  For example, this pass strips
8338 sign operations if the sign of a value never matters.  The flag is
8339 enabled by default at @option{-O} and higher.
8341 @item -fssa-phiopt
8342 @opindex fssa-phiopt
8343 Perform pattern matching on SSA PHI nodes to optimize conditional
8344 code.  This pass is enabled by default at @option{-O} and higher.
8346 @item -ftree-switch-conversion
8347 @opindex ftree-switch-conversion
8348 Perform conversion of simple initializations in a switch to
8349 initializations from a scalar array.  This flag is enabled by default
8350 at @option{-O2} and higher.
8352 @item -ftree-tail-merge
8353 @opindex ftree-tail-merge
8354 Look for identical code sequences.  When found, replace one with a jump to the
8355 other.  This optimization is known as tail merging or cross jumping.  This flag
8356 is enabled by default at @option{-O2} and higher.  The compilation time
8357 in this pass can
8358 be limited using @option{max-tail-merge-comparisons} parameter and
8359 @option{max-tail-merge-iterations} parameter.
8361 @item -ftree-dce
8362 @opindex ftree-dce
8363 Perform dead code elimination (DCE) on trees.  This flag is enabled by
8364 default at @option{-O} and higher.
8366 @item -ftree-builtin-call-dce
8367 @opindex ftree-builtin-call-dce
8368 Perform conditional dead code elimination (DCE) for calls to built-in functions
8369 that may set @code{errno} but are otherwise side-effect free.  This flag is
8370 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8371 specified.
8373 @item -ftree-dominator-opts
8374 @opindex ftree-dominator-opts
8375 Perform a variety of simple scalar cleanups (constant/copy
8376 propagation, redundancy elimination, range propagation and expression
8377 simplification) based on a dominator tree traversal.  This also
8378 performs jump threading (to reduce jumps to jumps). This flag is
8379 enabled by default at @option{-O} and higher.
8381 @item -ftree-dse
8382 @opindex ftree-dse
8383 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8384 a memory location that is later overwritten by another store without
8385 any intervening loads.  In this case the earlier store can be deleted.  This
8386 flag is enabled by default at @option{-O} and higher.
8388 @item -ftree-ch
8389 @opindex ftree-ch
8390 Perform loop header copying on trees.  This is beneficial since it increases
8391 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8392 is enabled by default at @option{-O} and higher.  It is not enabled
8393 for @option{-Os}, since it usually increases code size.
8395 @item -ftree-loop-optimize
8396 @opindex ftree-loop-optimize
8397 Perform loop optimizations on trees.  This flag is enabled by default
8398 at @option{-O} and higher.
8400 @item -ftree-loop-linear
8401 @itemx -floop-interchange
8402 @itemx -floop-strip-mine
8403 @itemx -floop-block
8404 @itemx -floop-unroll-and-jam
8405 @opindex ftree-loop-linear
8406 @opindex floop-interchange
8407 @opindex floop-strip-mine
8408 @opindex floop-block
8409 @opindex floop-unroll-and-jam
8410 Perform loop nest optimizations.  Same as
8411 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
8412 to be configured with @option{--with-isl} to enable the Graphite loop
8413 transformation infrastructure.
8415 @item -fgraphite-identity
8416 @opindex fgraphite-identity
8417 Enable the identity transformation for graphite.  For every SCoP we generate
8418 the polyhedral representation and transform it back to gimple.  Using
8419 @option{-fgraphite-identity} we can check the costs or benefits of the
8420 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8421 are also performed by the code generator isl, like index splitting and
8422 dead code elimination in loops.
8424 @item -floop-nest-optimize
8425 @opindex floop-nest-optimize
8426 Enable the isl based loop nest optimizer.  This is a generic loop nest
8427 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8428 structure optimized for data-locality and parallelism.  This option
8429 is experimental.
8431 @item -floop-parallelize-all
8432 @opindex floop-parallelize-all
8433 Use the Graphite data dependence analysis to identify loops that can
8434 be parallelized.  Parallelize all the loops that can be analyzed to
8435 not contain loop carried dependences without checking that it is
8436 profitable to parallelize the loops.
8438 @item -ftree-coalesce-vars
8439 @opindex ftree-coalesce-vars
8440 While transforming the program out of the SSA representation, attempt to
8441 reduce copying by coalescing versions of different user-defined
8442 variables, instead of just compiler temporaries.  This may severely
8443 limit the ability to debug an optimized program compiled with
8444 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
8445 prevents SSA coalescing of user variables.  This option is enabled by
8446 default if optimization is enabled, and it does very little otherwise.
8448 @item -ftree-loop-if-convert
8449 @opindex ftree-loop-if-convert
8450 Attempt to transform conditional jumps in the innermost loops to
8451 branch-less equivalents.  The intent is to remove control-flow from
8452 the innermost loops in order to improve the ability of the
8453 vectorization pass to handle these loops.  This is enabled by default
8454 if vectorization is enabled.
8456 @item -ftree-loop-distribution
8457 @opindex ftree-loop-distribution
8458 Perform loop distribution.  This flag can improve cache performance on
8459 big loop bodies and allow further loop optimizations, like
8460 parallelization or vectorization, to take place.  For example, the loop
8461 @smallexample
8462 DO I = 1, N
8463   A(I) = B(I) + C
8464   D(I) = E(I) * F
8465 ENDDO
8466 @end smallexample
8467 is transformed to
8468 @smallexample
8469 DO I = 1, N
8470    A(I) = B(I) + C
8471 ENDDO
8472 DO I = 1, N
8473    D(I) = E(I) * F
8474 ENDDO
8475 @end smallexample
8477 @item -ftree-loop-distribute-patterns
8478 @opindex ftree-loop-distribute-patterns
8479 Perform loop distribution of patterns that can be code generated with
8480 calls to a library.  This flag is enabled by default at @option{-O3}.
8482 This pass distributes the initialization loops and generates a call to
8483 memset zero.  For example, the loop
8484 @smallexample
8485 DO I = 1, N
8486   A(I) = 0
8487   B(I) = A(I) + I
8488 ENDDO
8489 @end smallexample
8490 is transformed to
8491 @smallexample
8492 DO I = 1, N
8493    A(I) = 0
8494 ENDDO
8495 DO I = 1, N
8496    B(I) = A(I) + I
8497 ENDDO
8498 @end smallexample
8499 and the initialization loop is transformed into a call to memset zero.
8501 @item -ftree-loop-im
8502 @opindex ftree-loop-im
8503 Perform loop invariant motion on trees.  This pass moves only invariants that
8504 are hard to handle at RTL level (function calls, operations that expand to
8505 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8506 operands of conditions that are invariant out of the loop, so that we can use
8507 just trivial invariantness analysis in loop unswitching.  The pass also includes
8508 store motion.
8510 @item -ftree-loop-ivcanon
8511 @opindex ftree-loop-ivcanon
8512 Create a canonical counter for number of iterations in loops for which
8513 determining number of iterations requires complicated analysis.  Later
8514 optimizations then may determine the number easily.  Useful especially
8515 in connection with unrolling.
8517 @item -fivopts
8518 @opindex fivopts
8519 Perform induction variable optimizations (strength reduction, induction
8520 variable merging and induction variable elimination) on trees.
8522 @item -ftree-parallelize-loops=n
8523 @opindex ftree-parallelize-loops
8524 Parallelize loops, i.e., split their iteration space to run in n threads.
8525 This is only possible for loops whose iterations are independent
8526 and can be arbitrarily reordered.  The optimization is only
8527 profitable on multiprocessor machines, for loops that are CPU-intensive,
8528 rather than constrained e.g.@: by memory bandwidth.  This option
8529 implies @option{-pthread}, and thus is only supported on targets
8530 that have support for @option{-pthread}.
8532 @item -ftree-pta
8533 @opindex ftree-pta
8534 Perform function-local points-to analysis on trees.  This flag is
8535 enabled by default at @option{-O} and higher.
8537 @item -ftree-sra
8538 @opindex ftree-sra
8539 Perform scalar replacement of aggregates.  This pass replaces structure
8540 references with scalars to prevent committing structures to memory too
8541 early.  This flag is enabled by default at @option{-O} and higher.
8543 @item -fstore-merging
8544 @opindex fstore-merging
8545 Perform merging of narrow stores to consecutive memory addresses.  This pass
8546 merges contiguous stores of immediate values narrower than a word into fewer
8547 wider stores to reduce the number of instructions.  This is enabled by default
8548 at @option{-O2} and higher as well as @option{-Os}.
8550 @item -ftree-ter
8551 @opindex ftree-ter
8552 Perform temporary expression replacement during the SSA->normal phase.  Single
8553 use/single def temporaries are replaced at their use location with their
8554 defining expression.  This results in non-GIMPLE code, but gives the expanders
8555 much more complex trees to work on resulting in better RTL generation.  This is
8556 enabled by default at @option{-O} and higher.
8558 @item -ftree-slsr
8559 @opindex ftree-slsr
8560 Perform straight-line strength reduction on trees.  This recognizes related
8561 expressions involving multiplications and replaces them by less expensive
8562 calculations when possible.  This is enabled by default at @option{-O} and
8563 higher.
8565 @item -ftree-vectorize
8566 @opindex ftree-vectorize
8567 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8568 and @option{-ftree-slp-vectorize} if not explicitly specified.
8570 @item -ftree-loop-vectorize
8571 @opindex ftree-loop-vectorize
8572 Perform loop vectorization on trees. This flag is enabled by default at
8573 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8575 @item -ftree-slp-vectorize
8576 @opindex ftree-slp-vectorize
8577 Perform basic block vectorization on trees. This flag is enabled by default at
8578 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8580 @item -fvect-cost-model=@var{model}
8581 @opindex fvect-cost-model
8582 Alter the cost model used for vectorization.  The @var{model} argument
8583 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
8584 With the @samp{unlimited} model the vectorized code-path is assumed
8585 to be profitable while with the @samp{dynamic} model a runtime check
8586 guards the vectorized code-path to enable it only for iteration
8587 counts that will likely execute faster than when executing the original
8588 scalar loop.  The @samp{cheap} model disables vectorization of
8589 loops where doing so would be cost prohibitive for example due to
8590 required runtime checks for data dependence or alignment but otherwise
8591 is equal to the @samp{dynamic} model.
8592 The default cost model depends on other optimization flags and is
8593 either @samp{dynamic} or @samp{cheap}.
8595 @item -fsimd-cost-model=@var{model}
8596 @opindex fsimd-cost-model
8597 Alter the cost model used for vectorization of loops marked with the OpenMP
8598 or Cilk Plus simd directive.  The @var{model} argument should be one of
8599 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
8600 have the same meaning as described in @option{-fvect-cost-model} and by
8601 default a cost model defined with @option{-fvect-cost-model} is used.
8603 @item -ftree-vrp
8604 @opindex ftree-vrp
8605 Perform Value Range Propagation on trees.  This is similar to the
8606 constant propagation pass, but instead of values, ranges of values are
8607 propagated.  This allows the optimizers to remove unnecessary range
8608 checks like array bound checks and null pointer checks.  This is
8609 enabled by default at @option{-O2} and higher.  Null pointer check
8610 elimination is only done if @option{-fdelete-null-pointer-checks} is
8611 enabled.
8613 @item -fsplit-paths
8614 @opindex fsplit-paths
8615 Split paths leading to loop backedges.  This can improve dead code
8616 elimination and common subexpression elimination.  This is enabled by
8617 default at @option{-O2} and above.
8619 @item -fsplit-ivs-in-unroller
8620 @opindex fsplit-ivs-in-unroller
8621 Enables expression of values of induction variables in later iterations
8622 of the unrolled loop using the value in the first iteration.  This breaks
8623 long dependency chains, thus improving efficiency of the scheduling passes.
8625 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8626 same effect.  However, that is not reliable in cases where the loop body
8627 is more complicated than a single basic block.  It also does not work at all
8628 on some architectures due to restrictions in the CSE pass.
8630 This optimization is enabled by default.
8632 @item -fvariable-expansion-in-unroller
8633 @opindex fvariable-expansion-in-unroller
8634 With this option, the compiler creates multiple copies of some
8635 local variables when unrolling a loop, which can result in superior code.
8637 @item -fpartial-inlining
8638 @opindex fpartial-inlining
8639 Inline parts of functions.  This option has any effect only
8640 when inlining itself is turned on by the @option{-finline-functions}
8641 or @option{-finline-small-functions} options.
8643 Enabled at level @option{-O2}.
8645 @item -fpredictive-commoning
8646 @opindex fpredictive-commoning
8647 Perform predictive commoning optimization, i.e., reusing computations
8648 (especially memory loads and stores) performed in previous
8649 iterations of loops.
8651 This option is enabled at level @option{-O3}.
8653 @item -fprefetch-loop-arrays
8654 @opindex fprefetch-loop-arrays
8655 If supported by the target machine, generate instructions to prefetch
8656 memory to improve the performance of loops that access large arrays.
8658 This option may generate better or worse code; results are highly
8659 dependent on the structure of loops within the source code.
8661 Disabled at level @option{-Os}.
8663 @item -fno-printf-return-value
8664 @opindex fno-printf-return-value
8665 Do not substitute constants for known return value of formatted output
8666 functions such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and
8667 @code{vsnprintf} (but not @code{printf} of @code{fprintf}).  This
8668 transformation allows GCC to optimize or even eliminate branches based
8669 on the known return value of these functions called with arguments that
8670 are either constant, or whose values are known to be in a range that
8671 makes determining the exact return value possible.  For example, when
8672 @option{-fprintf-return-value} is in effect, both the branch and the
8673 body of the @code{if} statement (but not the call to @code{snprint})
8674 can be optimized away when @code{i} is a 32-bit or smaller integer
8675 because the return value is guaranteed to be at most 8.
8677 @smallexample
8678 char buf[9];
8679 if (snprintf (buf, "%08x", i) >= sizeof buf)
8680   @dots{}
8681 @end smallexample
8683 The @option{-fprintf-return-value} option relies on other optimizations
8684 and yields best results with @option{-O2}.  It works in tandem with the
8685 @option{-Wformat-overflow} and @option{-Wformat-truncation} options.
8686 The @option{-fprintf-return-value} option is enabled by default.
8688 @item -fno-peephole
8689 @itemx -fno-peephole2
8690 @opindex fno-peephole
8691 @opindex fno-peephole2
8692 Disable any machine-specific peephole optimizations.  The difference
8693 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8694 are implemented in the compiler; some targets use one, some use the
8695 other, a few use both.
8697 @option{-fpeephole} is enabled by default.
8698 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8700 @item -fno-guess-branch-probability
8701 @opindex fno-guess-branch-probability
8702 Do not guess branch probabilities using heuristics.
8704 GCC uses heuristics to guess branch probabilities if they are
8705 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8706 heuristics are based on the control flow graph.  If some branch probabilities
8707 are specified by @code{__builtin_expect}, then the heuristics are
8708 used to guess branch probabilities for the rest of the control flow graph,
8709 taking the @code{__builtin_expect} info into account.  The interactions
8710 between the heuristics and @code{__builtin_expect} can be complex, and in
8711 some cases, it may be useful to disable the heuristics so that the effects
8712 of @code{__builtin_expect} are easier to understand.
8714 The default is @option{-fguess-branch-probability} at levels
8715 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8717 @item -freorder-blocks
8718 @opindex freorder-blocks
8719 Reorder basic blocks in the compiled function in order to reduce number of
8720 taken branches and improve code locality.
8722 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8724 @item -freorder-blocks-algorithm=@var{algorithm}
8725 @opindex freorder-blocks-algorithm
8726 Use the specified algorithm for basic block reordering.  The
8727 @var{algorithm} argument can be @samp{simple}, which does not increase
8728 code size (except sometimes due to secondary effects like alignment),
8729 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
8730 put all often executed code together, minimizing the number of branches
8731 executed by making extra copies of code.
8733 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
8734 @samp{stc} at levels @option{-O2}, @option{-O3}.
8736 @item -freorder-blocks-and-partition
8737 @opindex freorder-blocks-and-partition
8738 In addition to reordering basic blocks in the compiled function, in order
8739 to reduce number of taken branches, partitions hot and cold basic blocks
8740 into separate sections of the assembly and @file{.o} files, to improve
8741 paging and cache locality performance.
8743 This optimization is automatically turned off in the presence of
8744 exception handling or unwind tables (on targets using setjump/longjump or target specific scheme), for linkonce sections, for functions with a user-defined
8745 section attribute and on any architecture that does not support named
8746 sections.  When @option{-fsplit-stack} is used this option is not
8747 enabled by default (to avoid linker errors), but may be enabled
8748 explicitly (if using a working linker).
8750 Enabled for x86 at levels @option{-O2}, @option{-O3}.
8752 @item -freorder-functions
8753 @opindex freorder-functions
8754 Reorder functions in the object file in order to
8755 improve code locality.  This is implemented by using special
8756 subsections @code{.text.hot} for most frequently executed functions and
8757 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8758 the linker so object file format must support named sections and linker must
8759 place them in a reasonable way.
8761 Also profile feedback must be available to make this option effective.  See
8762 @option{-fprofile-arcs} for details.
8764 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8766 @item -fstrict-aliasing
8767 @opindex fstrict-aliasing
8768 Allow the compiler to assume the strictest aliasing rules applicable to
8769 the language being compiled.  For C (and C++), this activates
8770 optimizations based on the type of expressions.  In particular, an
8771 object of one type is assumed never to reside at the same address as an
8772 object of a different type, unless the types are almost the same.  For
8773 example, an @code{unsigned int} can alias an @code{int}, but not a
8774 @code{void*} or a @code{double}.  A character type may alias any other
8775 type.
8777 @anchor{Type-punning}Pay special attention to code like this:
8778 @smallexample
8779 union a_union @{
8780   int i;
8781   double d;
8784 int f() @{
8785   union a_union t;
8786   t.d = 3.0;
8787   return t.i;
8789 @end smallexample
8790 The practice of reading from a different union member than the one most
8791 recently written to (called ``type-punning'') is common.  Even with
8792 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8793 is accessed through the union type.  So, the code above works as
8794 expected.  @xref{Structures unions enumerations and bit-fields
8795 implementation}.  However, this code might not:
8796 @smallexample
8797 int f() @{
8798   union a_union t;
8799   int* ip;
8800   t.d = 3.0;
8801   ip = &t.i;
8802   return *ip;
8804 @end smallexample
8806 Similarly, access by taking the address, casting the resulting pointer
8807 and dereferencing the result has undefined behavior, even if the cast
8808 uses a union type, e.g.:
8809 @smallexample
8810 int f() @{
8811   double d = 3.0;
8812   return ((union a_union *) &d)->i;
8814 @end smallexample
8816 The @option{-fstrict-aliasing} option is enabled at levels
8817 @option{-O2}, @option{-O3}, @option{-Os}.
8819 @item -falign-functions
8820 @itemx -falign-functions=@var{n}
8821 @opindex falign-functions
8822 Align the start of functions to the next power-of-two greater than
8823 @var{n}, skipping up to @var{n} bytes.  For instance,
8824 @option{-falign-functions=32} aligns functions to the next 32-byte
8825 boundary, but @option{-falign-functions=24} aligns to the next
8826 32-byte boundary only if this can be done by skipping 23 bytes or less.
8828 @option{-fno-align-functions} and @option{-falign-functions=1} are
8829 equivalent and mean that functions are not aligned.
8831 Some assemblers only support this flag when @var{n} is a power of two;
8832 in that case, it is rounded up.
8834 If @var{n} is not specified or is zero, use a machine-dependent default.
8836 Enabled at levels @option{-O2}, @option{-O3}.
8838 @item -flimit-function-alignment
8839 If this option is enabled, the compiler tries to avoid unnecessarily
8840 overaligning functions. It attempts to instruct the assembler to align
8841 by the amount specified by @option{-falign-functions}, but not to
8842 skip more bytes than the size of the function.
8844 @item -falign-labels
8845 @itemx -falign-labels=@var{n}
8846 @opindex falign-labels
8847 Align all branch targets to a power-of-two boundary, skipping up to
8848 @var{n} bytes like @option{-falign-functions}.  This option can easily
8849 make code slower, because it must insert dummy operations for when the
8850 branch target is reached in the usual flow of the code.
8852 @option{-fno-align-labels} and @option{-falign-labels=1} are
8853 equivalent and mean that labels are not aligned.
8855 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8856 are greater than this value, then their values are used instead.
8858 If @var{n} is not specified or is zero, use a machine-dependent default
8859 which is very likely to be @samp{1}, meaning no alignment.
8861 Enabled at levels @option{-O2}, @option{-O3}.
8863 @item -falign-loops
8864 @itemx -falign-loops=@var{n}
8865 @opindex falign-loops
8866 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8867 like @option{-falign-functions}.  If the loops are
8868 executed many times, this makes up for any execution of the dummy
8869 operations.
8871 @option{-fno-align-loops} and @option{-falign-loops=1} are
8872 equivalent and mean that loops are not aligned.
8874 If @var{n} is not specified or is zero, use a machine-dependent default.
8876 Enabled at levels @option{-O2}, @option{-O3}.
8878 @item -falign-jumps
8879 @itemx -falign-jumps=@var{n}
8880 @opindex falign-jumps
8881 Align branch targets to a power-of-two boundary, for branch targets
8882 where the targets can only be reached by jumping, skipping up to @var{n}
8883 bytes like @option{-falign-functions}.  In this case, no dummy operations
8884 need be executed.
8886 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8887 equivalent and mean that loops are not aligned.
8889 If @var{n} is not specified or is zero, use a machine-dependent default.
8891 Enabled at levels @option{-O2}, @option{-O3}.
8893 @item -funit-at-a-time
8894 @opindex funit-at-a-time
8895 This option is left for compatibility reasons. @option{-funit-at-a-time}
8896 has no effect, while @option{-fno-unit-at-a-time} implies
8897 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8899 Enabled by default.
8901 @item -fno-toplevel-reorder
8902 @opindex fno-toplevel-reorder
8903 Do not reorder top-level functions, variables, and @code{asm}
8904 statements.  Output them in the same order that they appear in the
8905 input file.  When this option is used, unreferenced static variables
8906 are not removed.  This option is intended to support existing code
8907 that relies on a particular ordering.  For new code, it is better to
8908 use attributes when possible.
8910 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8911 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8912 targets.
8914 @item -fweb
8915 @opindex fweb
8916 Constructs webs as commonly used for register allocation purposes and assign
8917 each web individual pseudo register.  This allows the register allocation pass
8918 to operate on pseudos directly, but also strengthens several other optimization
8919 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8920 however, make debugging impossible, since variables no longer stay in a
8921 ``home register''.
8923 Enabled by default with @option{-funroll-loops}.
8925 @item -fwhole-program
8926 @opindex fwhole-program
8927 Assume that the current compilation unit represents the whole program being
8928 compiled.  All public functions and variables with the exception of @code{main}
8929 and those merged by attribute @code{externally_visible} become static functions
8930 and in effect are optimized more aggressively by interprocedural optimizers.
8932 This option should not be used in combination with @option{-flto}.
8933 Instead relying on a linker plugin should provide safer and more precise
8934 information.
8936 @item -flto[=@var{n}]
8937 @opindex flto
8938 This option runs the standard link-time optimizer.  When invoked
8939 with source code, it generates GIMPLE (one of GCC's internal
8940 representations) and writes it to special ELF sections in the object
8941 file.  When the object files are linked together, all the function
8942 bodies are read from these ELF sections and instantiated as if they
8943 had been part of the same translation unit.
8945 To use the link-time optimizer, @option{-flto} and optimization
8946 options should be specified at compile time and during the final link.
8947 It is recommended that you compile all the files participating in the
8948 same link with the same options and also specify those options at
8949 link time.  
8950 For example:
8952 @smallexample
8953 gcc -c -O2 -flto foo.c
8954 gcc -c -O2 -flto bar.c
8955 gcc -o myprog -flto -O2 foo.o bar.o
8956 @end smallexample
8958 The first two invocations to GCC save a bytecode representation
8959 of GIMPLE into special ELF sections inside @file{foo.o} and
8960 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8961 @file{foo.o} and @file{bar.o}, merges the two files into a single
8962 internal image, and compiles the result as usual.  Since both
8963 @file{foo.o} and @file{bar.o} are merged into a single image, this
8964 causes all the interprocedural analyses and optimizations in GCC to
8965 work across the two files as if they were a single one.  This means,
8966 for example, that the inliner is able to inline functions in
8967 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8969 Another (simpler) way to enable link-time optimization is:
8971 @smallexample
8972 gcc -o myprog -flto -O2 foo.c bar.c
8973 @end smallexample
8975 The above generates bytecode for @file{foo.c} and @file{bar.c},
8976 merges them together into a single GIMPLE representation and optimizes
8977 them as usual to produce @file{myprog}.
8979 The only important thing to keep in mind is that to enable link-time
8980 optimizations you need to use the GCC driver to perform the link step.
8981 GCC then automatically performs link-time optimization if any of the
8982 objects involved were compiled with the @option{-flto} command-line option.  
8983 You generally
8984 should specify the optimization options to be used for link-time
8985 optimization though GCC tries to be clever at guessing an
8986 optimization level to use from the options used at compile time
8987 if you fail to specify one at link time.  You can always override
8988 the automatic decision to do link-time optimization
8989 by passing @option{-fno-lto} to the link command.
8991 To make whole program optimization effective, it is necessary to make
8992 certain whole program assumptions.  The compiler needs to know
8993 what functions and variables can be accessed by libraries and runtime
8994 outside of the link-time optimized unit.  When supported by the linker,
8995 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8996 to the compiler about used and externally visible symbols.  When
8997 the linker plugin is not available, @option{-fwhole-program} should be
8998 used to allow the compiler to make these assumptions, which leads
8999 to more aggressive optimization decisions.
9001 When @option{-fuse-linker-plugin} is not enabled, when a file is
9002 compiled with @option{-flto}, the generated object file is larger than
9003 a regular object file because it contains GIMPLE bytecodes and the usual
9004 final code (see @option{-ffat-lto-objects}.  This means that
9005 object files with LTO information can be linked as normal object
9006 files; if @option{-fno-lto} is passed to the linker, no
9007 interprocedural optimizations are applied.  Note that when
9008 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
9009 but you cannot perform a regular, non-LTO link on them.
9011 Additionally, the optimization flags used to compile individual files
9012 are not necessarily related to those used at link time.  For instance,
9014 @smallexample
9015 gcc -c -O0 -ffat-lto-objects -flto foo.c
9016 gcc -c -O0 -ffat-lto-objects -flto bar.c
9017 gcc -o myprog -O3 foo.o bar.o
9018 @end smallexample
9020 This produces individual object files with unoptimized assembler
9021 code, but the resulting binary @file{myprog} is optimized at
9022 @option{-O3}.  If, instead, the final binary is generated with
9023 @option{-fno-lto}, then @file{myprog} is not optimized.
9025 When producing the final binary, GCC only
9026 applies link-time optimizations to those files that contain bytecode.
9027 Therefore, you can mix and match object files and libraries with
9028 GIMPLE bytecodes and final object code.  GCC automatically selects
9029 which files to optimize in LTO mode and which files to link without
9030 further processing.
9032 There are some code generation flags preserved by GCC when
9033 generating bytecodes, as they need to be used during the final link
9034 stage.  Generally options specified at link time override those
9035 specified at compile time.
9037 If you do not specify an optimization level option @option{-O} at
9038 link time, then GCC uses the highest optimization level 
9039 used when compiling the object files.
9041 Currently, the following options and their settings are taken from
9042 the first object file that explicitly specifies them: 
9043 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
9044 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
9045 and all the @option{-m} target flags.
9047 Certain ABI-changing flags are required to match in all compilation units,
9048 and trying to override this at link time with a conflicting value
9049 is ignored.  This includes options such as @option{-freg-struct-return}
9050 and @option{-fpcc-struct-return}. 
9052 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
9053 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
9054 are passed through to the link stage and merged conservatively for
9055 conflicting translation units.  Specifically
9056 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
9057 precedence; and for example @option{-ffp-contract=off} takes precedence
9058 over @option{-ffp-contract=fast}.  You can override them at link time.
9060 If LTO encounters objects with C linkage declared with incompatible
9061 types in separate translation units to be linked together (undefined
9062 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
9063 issued.  The behavior is still undefined at run time.  Similar
9064 diagnostics may be raised for other languages.
9066 Another feature of LTO is that it is possible to apply interprocedural
9067 optimizations on files written in different languages:
9069 @smallexample
9070 gcc -c -flto foo.c
9071 g++ -c -flto bar.cc
9072 gfortran -c -flto baz.f90
9073 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
9074 @end smallexample
9076 Notice that the final link is done with @command{g++} to get the C++
9077 runtime libraries and @option{-lgfortran} is added to get the Fortran
9078 runtime libraries.  In general, when mixing languages in LTO mode, you
9079 should use the same link command options as when mixing languages in a
9080 regular (non-LTO) compilation.
9082 If object files containing GIMPLE bytecode are stored in a library archive, say
9083 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
9084 are using a linker with plugin support.  To create static libraries suitable
9085 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
9086 and @command{ranlib}; 
9087 to show the symbols of object files with GIMPLE bytecode, use
9088 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
9089 and @command{nm} have been compiled with plugin support.  At link time, use the the
9090 flag @option{-fuse-linker-plugin} to ensure that the library participates in
9091 the LTO optimization process:
9093 @smallexample
9094 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
9095 @end smallexample
9097 With the linker plugin enabled, the linker extracts the needed
9098 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
9099 to make them part of the aggregated GIMPLE image to be optimized.
9101 If you are not using a linker with plugin support and/or do not
9102 enable the linker plugin, then the objects inside @file{libfoo.a}
9103 are extracted and linked as usual, but they do not participate
9104 in the LTO optimization process.  In order to make a static library suitable
9105 for both LTO optimization and usual linkage, compile its object files with
9106 @option{-flto} @option{-ffat-lto-objects}.
9108 Link-time optimizations do not require the presence of the whole program to
9109 operate.  If the program does not require any symbols to be exported, it is
9110 possible to combine @option{-flto} and @option{-fwhole-program} to allow
9111 the interprocedural optimizers to use more aggressive assumptions which may
9112 lead to improved optimization opportunities.
9113 Use of @option{-fwhole-program} is not needed when linker plugin is
9114 active (see @option{-fuse-linker-plugin}).
9116 The current implementation of LTO makes no
9117 attempt to generate bytecode that is portable between different
9118 types of hosts.  The bytecode files are versioned and there is a
9119 strict version check, so bytecode files generated in one version of
9120 GCC do not work with an older or newer version of GCC.
9122 Link-time optimization does not work well with generation of debugging
9123 information.  Combining @option{-flto} with
9124 @option{-g} is currently experimental and expected to produce unexpected
9125 results.
9127 If you specify the optional @var{n}, the optimization and code
9128 generation done at link time is executed in parallel using @var{n}
9129 parallel jobs by utilizing an installed @command{make} program.  The
9130 environment variable @env{MAKE} may be used to override the program
9131 used.  The default value for @var{n} is 1.
9133 You can also specify @option{-flto=jobserver} to use GNU make's
9134 job server mode to determine the number of parallel jobs. This
9135 is useful when the Makefile calling GCC is already executing in parallel.
9136 You must prepend a @samp{+} to the command recipe in the parent Makefile
9137 for this to work.  This option likely only works if @env{MAKE} is
9138 GNU make.
9140 @item -flto-partition=@var{alg}
9141 @opindex flto-partition
9142 Specify the partitioning algorithm used by the link-time optimizer.
9143 The value is either @samp{1to1} to specify a partitioning mirroring
9144 the original source files or @samp{balanced} to specify partitioning
9145 into equally sized chunks (whenever possible) or @samp{max} to create
9146 new partition for every symbol where possible.  Specifying @samp{none}
9147 as an algorithm disables partitioning and streaming completely. 
9148 The default value is @samp{balanced}. While @samp{1to1} can be used
9149 as an workaround for various code ordering issues, the @samp{max}
9150 partitioning is intended for internal testing only.
9151 The value @samp{one} specifies that exactly one partition should be
9152 used while the value @samp{none} bypasses partitioning and executes
9153 the link-time optimization step directly from the WPA phase.
9155 @item -flto-odr-type-merging
9156 @opindex flto-odr-type-merging
9157 Enable streaming of mangled types names of C++ types and their unification
9158 at link time.  This increases size of LTO object files, but enables
9159 diagnostics about One Definition Rule violations.
9161 @item -flto-compression-level=@var{n}
9162 @opindex flto-compression-level
9163 This option specifies the level of compression used for intermediate
9164 language written to LTO object files, and is only meaningful in
9165 conjunction with LTO mode (@option{-flto}).  Valid
9166 values are 0 (no compression) to 9 (maximum compression).  Values
9167 outside this range are clamped to either 0 or 9.  If the option is not
9168 given, a default balanced compression setting is used.
9170 @item -fuse-linker-plugin
9171 @opindex fuse-linker-plugin
9172 Enables the use of a linker plugin during link-time optimization.  This
9173 option relies on plugin support in the linker, which is available in gold
9174 or in GNU ld 2.21 or newer.
9176 This option enables the extraction of object files with GIMPLE bytecode out
9177 of library archives. This improves the quality of optimization by exposing
9178 more code to the link-time optimizer.  This information specifies what
9179 symbols can be accessed externally (by non-LTO object or during dynamic
9180 linking).  Resulting code quality improvements on binaries (and shared
9181 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
9182 See @option{-flto} for a description of the effect of this flag and how to
9183 use it.
9185 This option is enabled by default when LTO support in GCC is enabled
9186 and GCC was configured for use with
9187 a linker supporting plugins (GNU ld 2.21 or newer or gold).
9189 @item -ffat-lto-objects
9190 @opindex ffat-lto-objects
9191 Fat LTO objects are object files that contain both the intermediate language
9192 and the object code. This makes them usable for both LTO linking and normal
9193 linking. This option is effective only when compiling with @option{-flto}
9194 and is ignored at link time.
9196 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
9197 requires the complete toolchain to be aware of LTO. It requires a linker with
9198 linker plugin support for basic functionality.  Additionally,
9199 @command{nm}, @command{ar} and @command{ranlib}
9200 need to support linker plugins to allow a full-featured build environment
9201 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
9202 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
9203 to these tools. With non fat LTO makefiles need to be modified to use them.
9205 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
9206 support.
9208 @item -fcompare-elim
9209 @opindex fcompare-elim
9210 After register allocation and post-register allocation instruction splitting,
9211 identify arithmetic instructions that compute processor flags similar to a
9212 comparison operation based on that arithmetic.  If possible, eliminate the
9213 explicit comparison operation.
9215 This pass only applies to certain targets that cannot explicitly represent
9216 the comparison operation before register allocation is complete.
9218 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9220 @item -fcprop-registers
9221 @opindex fcprop-registers
9222 After register allocation and post-register allocation instruction splitting,
9223 perform a copy-propagation pass to try to reduce scheduling dependencies
9224 and occasionally eliminate the copy.
9226 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9228 @item -fprofile-correction
9229 @opindex fprofile-correction
9230 Profiles collected using an instrumented binary for multi-threaded programs may
9231 be inconsistent due to missed counter updates. When this option is specified,
9232 GCC uses heuristics to correct or smooth out such inconsistencies. By
9233 default, GCC emits an error message when an inconsistent profile is detected.
9235 @item -fprofile-use
9236 @itemx -fprofile-use=@var{path}
9237 @opindex fprofile-use
9238 Enable profile feedback-directed optimizations, 
9239 and the following optimizations
9240 which are generally profitable only with profile feedback available:
9241 @option{-fbranch-probabilities}, @option{-fvpt},
9242 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9243 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
9245 Before you can use this option, you must first generate profiling information.
9246 @xref{Instrumentation Options}, for information about the
9247 @option{-fprofile-generate} option.
9249 By default, GCC emits an error message if the feedback profiles do not
9250 match the source code.  This error can be turned into a warning by using
9251 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9252 code.
9254 If @var{path} is specified, GCC looks at the @var{path} to find
9255 the profile feedback data files. See @option{-fprofile-dir}.
9257 @item -fauto-profile
9258 @itemx -fauto-profile=@var{path}
9259 @opindex fauto-profile
9260 Enable sampling-based feedback-directed optimizations, 
9261 and the following optimizations
9262 which are generally profitable only with profile feedback available:
9263 @option{-fbranch-probabilities}, @option{-fvpt},
9264 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9265 @option{-ftree-vectorize},
9266 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
9267 @option{-fpredictive-commoning}, @option{-funswitch-loops},
9268 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
9270 @var{path} is the name of a file containing AutoFDO profile information.
9271 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
9273 Producing an AutoFDO profile data file requires running your program
9274 with the @command{perf} utility on a supported GNU/Linux target system.
9275 For more information, see @uref{https://perf.wiki.kernel.org/}.
9277 E.g.
9278 @smallexample
9279 perf record -e br_inst_retired:near_taken -b -o perf.data \
9280     -- your_program
9281 @end smallexample
9283 Then use the @command{create_gcov} tool to convert the raw profile data
9284 to a format that can be used by GCC.@  You must also supply the 
9285 unstripped binary for your program to this tool.  
9286 See @uref{https://github.com/google/autofdo}.
9288 E.g.
9289 @smallexample
9290 create_gcov --binary=your_program.unstripped --profile=perf.data \
9291     --gcov=profile.afdo
9292 @end smallexample
9293 @end table
9295 The following options control compiler behavior regarding floating-point 
9296 arithmetic.  These options trade off between speed and
9297 correctness.  All must be specifically enabled.
9299 @table @gcctabopt
9300 @item -ffloat-store
9301 @opindex ffloat-store
9302 Do not store floating-point variables in registers, and inhibit other
9303 options that might change whether a floating-point value is taken from a
9304 register or memory.
9306 @cindex floating-point precision
9307 This option prevents undesirable excess precision on machines such as
9308 the 68000 where the floating registers (of the 68881) keep more
9309 precision than a @code{double} is supposed to have.  Similarly for the
9310 x86 architecture.  For most programs, the excess precision does only
9311 good, but a few programs rely on the precise definition of IEEE floating
9312 point.  Use @option{-ffloat-store} for such programs, after modifying
9313 them to store all pertinent intermediate computations into variables.
9315 @item -fexcess-precision=@var{style}
9316 @opindex fexcess-precision
9317 This option allows further control over excess precision on machines
9318 where floating-point operations occur in a format with more precision or
9319 range than the IEEE standard and interchange floating-point types.  By
9320 default, @option{-fexcess-precision=fast} is in effect; this means that
9321 operations may be carried out in a wider precision than the types specified
9322 in the source if that would result in faster code, and it is unpredictable
9323 when rounding to the types specified in the source code takes place.
9324 When compiling C, if @option{-fexcess-precision=standard} is specified then
9325 excess precision follows the rules specified in ISO C99; in particular,
9326 both casts and assignments cause values to be rounded to their
9327 semantic types (whereas @option{-ffloat-store} only affects
9328 assignments).  This option is enabled by default for C if a strict
9329 conformance option such as @option{-std=c99} is used.
9330 @option{-ffast-math} enables @option{-fexcess-precision=fast} by default
9331 regardless of whether a strict conformance option is used.
9333 @opindex mfpmath
9334 @option{-fexcess-precision=standard} is not implemented for languages
9335 other than C.  On the x86, it has no effect if @option{-mfpmath=sse}
9336 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9337 semantics apply without excess precision, and in the latter, rounding
9338 is unpredictable.
9340 @item -ffast-math
9341 @opindex ffast-math
9342 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9343 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9344 @option{-fno-signaling-nans}, @option{-fcx-limited-range} and
9345 @option{-fexcess-precision=fast}.
9347 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9349 This option is not turned on by any @option{-O} option besides
9350 @option{-Ofast} since it can result in incorrect output for programs
9351 that depend on an exact implementation of IEEE or ISO rules/specifications
9352 for math functions. It may, however, yield faster code for programs
9353 that do not require the guarantees of these specifications.
9355 @item -fno-math-errno
9356 @opindex fno-math-errno
9357 Do not set @code{errno} after calling math functions that are executed
9358 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9359 IEEE exceptions for math error handling may want to use this flag
9360 for speed while maintaining IEEE arithmetic compatibility.
9362 This option is not turned on by any @option{-O} option since
9363 it can result in incorrect output for programs that depend on
9364 an exact implementation of IEEE or ISO rules/specifications for
9365 math functions. It may, however, yield faster code for programs
9366 that do not require the guarantees of these specifications.
9368 The default is @option{-fmath-errno}.
9370 On Darwin systems, the math library never sets @code{errno}.  There is
9371 therefore no reason for the compiler to consider the possibility that
9372 it might, and @option{-fno-math-errno} is the default.
9374 @item -funsafe-math-optimizations
9375 @opindex funsafe-math-optimizations
9377 Allow optimizations for floating-point arithmetic that (a) assume
9378 that arguments and results are valid and (b) may violate IEEE or
9379 ANSI standards.  When used at link time, it may include libraries
9380 or startup files that change the default FPU control word or other
9381 similar optimizations.
9383 This option is not turned on by any @option{-O} option since
9384 it can result in incorrect output for programs that depend on
9385 an exact implementation of IEEE or ISO rules/specifications for
9386 math functions. It may, however, yield faster code for programs
9387 that do not require the guarantees of these specifications.
9388 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9389 @option{-fassociative-math} and @option{-freciprocal-math}.
9391 The default is @option{-fno-unsafe-math-optimizations}.
9393 @item -fassociative-math
9394 @opindex fassociative-math
9396 Allow re-association of operands in series of floating-point operations.
9397 This violates the ISO C and C++ language standard by possibly changing
9398 computation result.  NOTE: re-ordering may change the sign of zero as
9399 well as ignore NaNs and inhibit or create underflow or overflow (and
9400 thus cannot be used on code that relies on rounding behavior like
9401 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9402 and thus may not be used when ordered comparisons are required.
9403 This option requires that both @option{-fno-signed-zeros} and
9404 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9405 much sense with @option{-frounding-math}. For Fortran the option
9406 is automatically enabled when both @option{-fno-signed-zeros} and
9407 @option{-fno-trapping-math} are in effect.
9409 The default is @option{-fno-associative-math}.
9411 @item -freciprocal-math
9412 @opindex freciprocal-math
9414 Allow the reciprocal of a value to be used instead of dividing by
9415 the value if this enables optimizations.  For example @code{x / y}
9416 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9417 is subject to common subexpression elimination.  Note that this loses
9418 precision and increases the number of flops operating on the value.
9420 The default is @option{-fno-reciprocal-math}.
9422 @item -ffinite-math-only
9423 @opindex ffinite-math-only
9424 Allow optimizations for floating-point arithmetic that assume
9425 that arguments and results are not NaNs or +-Infs.
9427 This option is not turned on by any @option{-O} option since
9428 it can result in incorrect output for programs that depend on
9429 an exact implementation of IEEE or ISO rules/specifications for
9430 math functions. It may, however, yield faster code for programs
9431 that do not require the guarantees of these specifications.
9433 The default is @option{-fno-finite-math-only}.
9435 @item -fno-signed-zeros
9436 @opindex fno-signed-zeros
9437 Allow optimizations for floating-point arithmetic that ignore the
9438 signedness of zero.  IEEE arithmetic specifies the behavior of
9439 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9440 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9441 This option implies that the sign of a zero result isn't significant.
9443 The default is @option{-fsigned-zeros}.
9445 @item -fno-trapping-math
9446 @opindex fno-trapping-math
9447 Compile code assuming that floating-point operations cannot generate
9448 user-visible traps.  These traps include division by zero, overflow,
9449 underflow, inexact result and invalid operation.  This option requires
9450 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9451 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9453 This option should never be turned on by any @option{-O} option since
9454 it can result in incorrect output for programs that depend on
9455 an exact implementation of IEEE or ISO rules/specifications for
9456 math functions.
9458 The default is @option{-ftrapping-math}.
9460 @item -frounding-math
9461 @opindex frounding-math
9462 Disable transformations and optimizations that assume default floating-point
9463 rounding behavior.  This is round-to-zero for all floating point
9464 to integer conversions, and round-to-nearest for all other arithmetic
9465 truncations.  This option should be specified for programs that change
9466 the FP rounding mode dynamically, or that may be executed with a
9467 non-default rounding mode.  This option disables constant folding of
9468 floating-point expressions at compile time (which may be affected by
9469 rounding mode) and arithmetic transformations that are unsafe in the
9470 presence of sign-dependent rounding modes.
9472 The default is @option{-fno-rounding-math}.
9474 This option is experimental and does not currently guarantee to
9475 disable all GCC optimizations that are affected by rounding mode.
9476 Future versions of GCC may provide finer control of this setting
9477 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9478 will be used to specify the default state for @code{FENV_ACCESS}.
9480 @item -fsignaling-nans
9481 @opindex fsignaling-nans
9482 Compile code assuming that IEEE signaling NaNs may generate user-visible
9483 traps during floating-point operations.  Setting this option disables
9484 optimizations that may change the number of exceptions visible with
9485 signaling NaNs.  This option implies @option{-ftrapping-math}.
9487 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9488 be defined.
9490 The default is @option{-fno-signaling-nans}.
9492 This option is experimental and does not currently guarantee to
9493 disable all GCC optimizations that affect signaling NaN behavior.
9495 @item -fno-fp-int-builtin-inexact
9496 @opindex fno-fp-int-builtin-inexact
9497 Do not allow the built-in functions @code{ceil}, @code{floor},
9498 @code{round} and @code{trunc}, and their @code{float} and @code{long
9499 double} variants, to generate code that raises the ``inexact''
9500 floating-point exception for noninteger arguments.  ISO C99 and C11
9501 allow these functions to raise the ``inexact'' exception, but ISO/IEC
9502 TS 18661-1:2014, the C bindings to IEEE 754-2008, does not allow these
9503 functions to do so.
9505 The default is @option{-ffp-int-builtin-inexact}, allowing the
9506 exception to be raised.  This option does nothing unless
9507 @option{-ftrapping-math} is in effect.
9509 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
9510 generate a call to a library function then the ``inexact'' exception
9511 may be raised if the library implementation does not follow TS 18661.
9513 @item -fsingle-precision-constant
9514 @opindex fsingle-precision-constant
9515 Treat floating-point constants as single precision instead of
9516 implicitly converting them to double-precision constants.
9518 @item -fcx-limited-range
9519 @opindex fcx-limited-range
9520 When enabled, this option states that a range reduction step is not
9521 needed when performing complex division.  Also, there is no checking
9522 whether the result of a complex multiplication or division is @code{NaN
9523 + I*NaN}, with an attempt to rescue the situation in that case.  The
9524 default is @option{-fno-cx-limited-range}, but is enabled by
9525 @option{-ffast-math}.
9527 This option controls the default setting of the ISO C99
9528 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9529 all languages.
9531 @item -fcx-fortran-rules
9532 @opindex fcx-fortran-rules
9533 Complex multiplication and division follow Fortran rules.  Range
9534 reduction is done as part of complex division, but there is no checking
9535 whether the result of a complex multiplication or division is @code{NaN
9536 + I*NaN}, with an attempt to rescue the situation in that case.
9538 The default is @option{-fno-cx-fortran-rules}.
9540 @end table
9542 The following options control optimizations that may improve
9543 performance, but are not enabled by any @option{-O} options.  This
9544 section includes experimental options that may produce broken code.
9546 @table @gcctabopt
9547 @item -fbranch-probabilities
9548 @opindex fbranch-probabilities
9549 After running a program compiled with @option{-fprofile-arcs}
9550 (@pxref{Instrumentation Options}),
9551 you can compile it a second time using
9552 @option{-fbranch-probabilities}, to improve optimizations based on
9553 the number of times each branch was taken.  When a program
9554 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9555 counts to a file called @file{@var{sourcename}.gcda} for each source
9556 file.  The information in this data file is very dependent on the
9557 structure of the generated code, so you must use the same source code
9558 and the same optimization options for both compilations.
9560 With @option{-fbranch-probabilities}, GCC puts a
9561 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9562 These can be used to improve optimization.  Currently, they are only
9563 used in one place: in @file{reorg.c}, instead of guessing which path a
9564 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9565 exactly determine which path is taken more often.
9567 @item -fprofile-values
9568 @opindex fprofile-values
9569 If combined with @option{-fprofile-arcs}, it adds code so that some
9570 data about values of expressions in the program is gathered.
9572 With @option{-fbranch-probabilities}, it reads back the data gathered
9573 from profiling values of expressions for usage in optimizations.
9575 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9577 @item -fprofile-reorder-functions
9578 @opindex fprofile-reorder-functions
9579 Function reordering based on profile instrumentation collects
9580 first time of execution of a function and orders these functions
9581 in ascending order.
9583 Enabled with @option{-fprofile-use}.
9585 @item -fvpt
9586 @opindex fvpt
9587 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9588 to add code to gather information about values of expressions.
9590 With @option{-fbranch-probabilities}, it reads back the data gathered
9591 and actually performs the optimizations based on them.
9592 Currently the optimizations include specialization of division operations
9593 using the knowledge about the value of the denominator.
9595 @item -frename-registers
9596 @opindex frename-registers
9597 Attempt to avoid false dependencies in scheduled code by making use
9598 of registers left over after register allocation.  This optimization
9599 most benefits processors with lots of registers.  Depending on the
9600 debug information format adopted by the target, however, it can
9601 make debugging impossible, since variables no longer stay in
9602 a ``home register''.
9604 Enabled by default with @option{-funroll-loops}.
9606 @item -fschedule-fusion
9607 @opindex fschedule-fusion
9608 Performs a target dependent pass over the instruction stream to schedule
9609 instructions of same type together because target machine can execute them
9610 more efficiently if they are adjacent to each other in the instruction flow.
9612 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9614 @item -ftracer
9615 @opindex ftracer
9616 Perform tail duplication to enlarge superblock size.  This transformation
9617 simplifies the control flow of the function allowing other optimizations to do
9618 a better job.
9620 Enabled with @option{-fprofile-use}.
9622 @item -funroll-loops
9623 @opindex funroll-loops
9624 Unroll loops whose number of iterations can be determined at compile time or
9625 upon entry to the loop.  @option{-funroll-loops} implies
9626 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9627 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9628 a small constant number of iterations).  This option makes code larger, and may
9629 or may not make it run faster.
9631 Enabled with @option{-fprofile-use}.
9633 @item -funroll-all-loops
9634 @opindex funroll-all-loops
9635 Unroll all loops, even if their number of iterations is uncertain when
9636 the loop is entered.  This usually makes programs run more slowly.
9637 @option{-funroll-all-loops} implies the same options as
9638 @option{-funroll-loops}.
9640 @item -fpeel-loops
9641 @opindex fpeel-loops
9642 Peels loops for which there is enough information that they do not
9643 roll much (from profile feedback or static analysis).  It also turns on
9644 complete loop peeling (i.e.@: complete removal of loops with small constant
9645 number of iterations).
9647 Enabled with @option{-O3} and/or @option{-fprofile-use}.
9649 @item -fmove-loop-invariants
9650 @opindex fmove-loop-invariants
9651 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9652 at level @option{-O1}
9654 @item -fsplit-loops
9655 @opindex fsplit-loops
9656 Split a loop into two if it contains a condition that's always true
9657 for one side of the iteration space and false for the other.
9659 @item -funswitch-loops
9660 @opindex funswitch-loops
9661 Move branches with loop invariant conditions out of the loop, with duplicates
9662 of the loop on both branches (modified according to result of the condition).
9664 @item -ffunction-sections
9665 @itemx -fdata-sections
9666 @opindex ffunction-sections
9667 @opindex fdata-sections
9668 Place each function or data item into its own section in the output
9669 file if the target supports arbitrary sections.  The name of the
9670 function or the name of the data item determines the section's name
9671 in the output file.
9673 Use these options on systems where the linker can perform optimizations
9674 to improve locality of reference in the instruction space.  Most systems
9675 using the ELF object format and SPARC processors running Solaris 2 have
9676 linkers with such optimizations.  AIX may have these optimizations in
9677 the future.
9679 Only use these options when there are significant benefits from doing
9680 so.  When you specify these options, the assembler and linker
9681 create larger object and executable files and are also slower.
9682 You cannot use @command{gprof} on all systems if you
9683 specify this option, and you may have problems with debugging if
9684 you specify both this option and @option{-g}.
9686 @item -fbranch-target-load-optimize
9687 @opindex fbranch-target-load-optimize
9688 Perform branch target register load optimization before prologue / epilogue
9689 threading.
9690 The use of target registers can typically be exposed only during reload,
9691 thus hoisting loads out of loops and doing inter-block scheduling needs
9692 a separate optimization pass.
9694 @item -fbranch-target-load-optimize2
9695 @opindex fbranch-target-load-optimize2
9696 Perform branch target register load optimization after prologue / epilogue
9697 threading.
9699 @item -fbtr-bb-exclusive
9700 @opindex fbtr-bb-exclusive
9701 When performing branch target register load optimization, don't reuse
9702 branch target registers within any basic block.
9704 @item -fstdarg-opt
9705 @opindex fstdarg-opt
9706 Optimize the prologue of variadic argument functions with respect to usage of
9707 those arguments.
9709 @item -fsection-anchors
9710 @opindex fsection-anchors
9711 Try to reduce the number of symbolic address calculations by using
9712 shared ``anchor'' symbols to address nearby objects.  This transformation
9713 can help to reduce the number of GOT entries and GOT accesses on some
9714 targets.
9716 For example, the implementation of the following function @code{foo}:
9718 @smallexample
9719 static int a, b, c;
9720 int foo (void) @{ return a + b + c; @}
9721 @end smallexample
9723 @noindent
9724 usually calculates the addresses of all three variables, but if you
9725 compile it with @option{-fsection-anchors}, it accesses the variables
9726 from a common anchor point instead.  The effect is similar to the
9727 following pseudocode (which isn't valid C):
9729 @smallexample
9730 int foo (void)
9732   register int *xr = &x;
9733   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9735 @end smallexample
9737 Not all targets support this option.
9739 @item --param @var{name}=@var{value}
9740 @opindex param
9741 In some places, GCC uses various constants to control the amount of
9742 optimization that is done.  For example, GCC does not inline functions
9743 that contain more than a certain number of instructions.  You can
9744 control some of these constants on the command line using the
9745 @option{--param} option.
9747 The names of specific parameters, and the meaning of the values, are
9748 tied to the internals of the compiler, and are subject to change
9749 without notice in future releases.
9751 In each case, the @var{value} is an integer.  The allowable choices for
9752 @var{name} are:
9754 @table @gcctabopt
9755 @item predictable-branch-outcome
9756 When branch is predicted to be taken with probability lower than this threshold
9757 (in percent), then it is considered well predictable. The default is 10.
9759 @item max-rtl-if-conversion-insns
9760 RTL if-conversion tries to remove conditional branches around a block and
9761 replace them with conditionally executed instructions.  This parameter
9762 gives the maximum number of instructions in a block which should be
9763 considered for if-conversion.  The default is 10, though the compiler will
9764 also use other heuristics to decide whether if-conversion is likely to be
9765 profitable.
9767 @item max-rtl-if-conversion-predictable-cost
9768 @item max-rtl-if-conversion-unpredictable-cost
9769 RTL if-conversion will try to remove conditional branches around a block
9770 and replace them with conditionally executed instructions.  These parameters
9771 give the maximum permissible cost for the sequence that would be generated
9772 by if-conversion depending on whether the branch is statically determined
9773 to be predictable or not.  The units for this parameter are the same as
9774 those for the GCC internal seq_cost metric.  The compiler will try to
9775 provide a reasonable default for this parameter using the BRANCH_COST
9776 target macro.
9778 @item max-crossjump-edges
9779 The maximum number of incoming edges to consider for cross-jumping.
9780 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9781 the number of edges incoming to each block.  Increasing values mean
9782 more aggressive optimization, making the compilation time increase with
9783 probably small improvement in executable size.
9785 @item min-crossjump-insns
9786 The minimum number of instructions that must be matched at the end
9787 of two blocks before cross-jumping is performed on them.  This
9788 value is ignored in the case where all instructions in the block being
9789 cross-jumped from are matched.  The default value is 5.
9791 @item max-grow-copy-bb-insns
9792 The maximum code size expansion factor when copying basic blocks
9793 instead of jumping.  The expansion is relative to a jump instruction.
9794 The default value is 8.
9796 @item max-goto-duplication-insns
9797 The maximum number of instructions to duplicate to a block that jumps
9798 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9799 passes, GCC factors computed gotos early in the compilation process,
9800 and unfactors them as late as possible.  Only computed jumps at the
9801 end of a basic blocks with no more than max-goto-duplication-insns are
9802 unfactored.  The default value is 8.
9804 @item max-delay-slot-insn-search
9805 The maximum number of instructions to consider when looking for an
9806 instruction to fill a delay slot.  If more than this arbitrary number of
9807 instructions are searched, the time savings from filling the delay slot
9808 are minimal, so stop searching.  Increasing values mean more
9809 aggressive optimization, making the compilation time increase with probably
9810 small improvement in execution time.
9812 @item max-delay-slot-live-search
9813 When trying to fill delay slots, the maximum number of instructions to
9814 consider when searching for a block with valid live register
9815 information.  Increasing this arbitrarily chosen value means more
9816 aggressive optimization, increasing the compilation time.  This parameter
9817 should be removed when the delay slot code is rewritten to maintain the
9818 control-flow graph.
9820 @item max-gcse-memory
9821 The approximate maximum amount of memory that can be allocated in
9822 order to perform the global common subexpression elimination
9823 optimization.  If more memory than specified is required, the
9824 optimization is not done.
9826 @item max-gcse-insertion-ratio
9827 If the ratio of expression insertions to deletions is larger than this value
9828 for any expression, then RTL PRE inserts or removes the expression and thus
9829 leaves partially redundant computations in the instruction stream.  The default value is 20.
9831 @item max-pending-list-length
9832 The maximum number of pending dependencies scheduling allows
9833 before flushing the current state and starting over.  Large functions
9834 with few branches or calls can create excessively large lists which
9835 needlessly consume memory and resources.
9837 @item max-modulo-backtrack-attempts
9838 The maximum number of backtrack attempts the scheduler should make
9839 when modulo scheduling a loop.  Larger values can exponentially increase
9840 compilation time.
9842 @item max-inline-insns-single
9843 Several parameters control the tree inliner used in GCC@.
9844 This number sets the maximum number of instructions (counted in GCC's
9845 internal representation) in a single function that the tree inliner
9846 considers for inlining.  This only affects functions declared
9847 inline and methods implemented in a class declaration (C++).
9848 The default value is 400.
9850 @item max-inline-insns-auto
9851 When you use @option{-finline-functions} (included in @option{-O3}),
9852 a lot of functions that would otherwise not be considered for inlining
9853 by the compiler are investigated.  To those functions, a different
9854 (more restrictive) limit compared to functions declared inline can
9855 be applied.
9856 The default value is 40.
9858 @item inline-min-speedup
9859 When estimated performance improvement of caller + callee runtime exceeds this
9860 threshold (in percent), the function can be inlined regardless of the limit on
9861 @option{--param max-inline-insns-single} and @option{--param
9862 max-inline-insns-auto}.
9864 @item large-function-insns
9865 The limit specifying really large functions.  For functions larger than this
9866 limit after inlining, inlining is constrained by
9867 @option{--param large-function-growth}.  This parameter is useful primarily
9868 to avoid extreme compilation time caused by non-linear algorithms used by the
9869 back end.
9870 The default value is 2700.
9872 @item large-function-growth
9873 Specifies maximal growth of large function caused by inlining in percents.
9874 The default value is 100 which limits large function growth to 2.0 times
9875 the original size.
9877 @item large-unit-insns
9878 The limit specifying large translation unit.  Growth caused by inlining of
9879 units larger than this limit is limited by @option{--param inline-unit-growth}.
9880 For small units this might be too tight.
9881 For example, consider a unit consisting of function A
9882 that is inline and B that just calls A three times.  If B is small relative to
9883 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9884 large units consisting of small inlineable functions, however, the overall unit
9885 growth limit is needed to avoid exponential explosion of code size.  Thus for
9886 smaller units, the size is increased to @option{--param large-unit-insns}
9887 before applying @option{--param inline-unit-growth}.  The default is 10000.
9889 @item inline-unit-growth
9890 Specifies maximal overall growth of the compilation unit caused by inlining.
9891 The default value is 20 which limits unit growth to 1.2 times the original
9892 size. Cold functions (either marked cold via an attribute or by profile
9893 feedback) are not accounted into the unit size.
9895 @item ipcp-unit-growth
9896 Specifies maximal overall growth of the compilation unit caused by
9897 interprocedural constant propagation.  The default value is 10 which limits
9898 unit growth to 1.1 times the original size.
9900 @item large-stack-frame
9901 The limit specifying large stack frames.  While inlining the algorithm is trying
9902 to not grow past this limit too much.  The default value is 256 bytes.
9904 @item large-stack-frame-growth
9905 Specifies maximal growth of large stack frames caused by inlining in percents.
9906 The default value is 1000 which limits large stack frame growth to 11 times
9907 the original size.
9909 @item max-inline-insns-recursive
9910 @itemx max-inline-insns-recursive-auto
9911 Specifies the maximum number of instructions an out-of-line copy of a
9912 self-recursive inline
9913 function can grow into by performing recursive inlining.
9915 @option{--param max-inline-insns-recursive} applies to functions
9916 declared inline.
9917 For functions not declared inline, recursive inlining
9918 happens only when @option{-finline-functions} (included in @option{-O3}) is
9919 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
9920 default value is 450.
9922 @item max-inline-recursive-depth
9923 @itemx max-inline-recursive-depth-auto
9924 Specifies the maximum recursion depth used for recursive inlining.
9926 @option{--param max-inline-recursive-depth} applies to functions
9927 declared inline.  For functions not declared inline, recursive inlining
9928 happens only when @option{-finline-functions} (included in @option{-O3}) is
9929 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
9930 default value is 8.
9932 @item min-inline-recursive-probability
9933 Recursive inlining is profitable only for function having deep recursion
9934 in average and can hurt for function having little recursion depth by
9935 increasing the prologue size or complexity of function body to other
9936 optimizers.
9938 When profile feedback is available (see @option{-fprofile-generate}) the actual
9939 recursion depth can be guessed from the probability that function recurses
9940 via a given call expression.  This parameter limits inlining only to call
9941 expressions whose probability exceeds the given threshold (in percents).
9942 The default value is 10.
9944 @item early-inlining-insns
9945 Specify growth that the early inliner can make.  In effect it increases
9946 the amount of inlining for code having a large abstraction penalty.
9947 The default value is 14.
9949 @item max-early-inliner-iterations
9950 Limit of iterations of the early inliner.  This basically bounds
9951 the number of nested indirect calls the early inliner can resolve.
9952 Deeper chains are still handled by late inlining.
9954 @item comdat-sharing-probability
9955 Probability (in percent) that C++ inline function with comdat visibility
9956 are shared across multiple compilation units.  The default value is 20.
9958 @item profile-func-internal-id
9959 A parameter to control whether to use function internal id in profile
9960 database lookup. If the value is 0, the compiler uses an id that
9961 is based on function assembler name and filename, which makes old profile
9962 data more tolerant to source changes such as function reordering etc.
9963 The default value is 0.
9965 @item min-vect-loop-bound
9966 The minimum number of iterations under which loops are not vectorized
9967 when @option{-ftree-vectorize} is used.  The number of iterations after
9968 vectorization needs to be greater than the value specified by this option
9969 to allow vectorization.  The default value is 0.
9971 @item gcse-cost-distance-ratio
9972 Scaling factor in calculation of maximum distance an expression
9973 can be moved by GCSE optimizations.  This is currently supported only in the
9974 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9975 is with simple expressions, i.e., the expressions that have cost
9976 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9977 hoisting of simple expressions.  The default value is 10.
9979 @item gcse-unrestricted-cost
9980 Cost, roughly measured as the cost of a single typical machine
9981 instruction, at which GCSE optimizations do not constrain
9982 the distance an expression can travel.  This is currently
9983 supported only in the code hoisting pass.  The lesser the cost,
9984 the more aggressive code hoisting is.  Specifying 0 
9985 allows all expressions to travel unrestricted distances.
9986 The default value is 3.
9988 @item max-hoist-depth
9989 The depth of search in the dominator tree for expressions to hoist.
9990 This is used to avoid quadratic behavior in hoisting algorithm.
9991 The value of 0 does not limit on the search, but may slow down compilation
9992 of huge functions.  The default value is 30.
9994 @item max-tail-merge-comparisons
9995 The maximum amount of similar bbs to compare a bb with.  This is used to
9996 avoid quadratic behavior in tree tail merging.  The default value is 10.
9998 @item max-tail-merge-iterations
9999 The maximum amount of iterations of the pass over the function.  This is used to
10000 limit compilation time in tree tail merging.  The default value is 2.
10002 @item store-merging-allow-unaligned
10003 Allow the store merging pass to introduce unaligned stores if it is legal to
10004 do so.  The default value is 1.
10006 @item max-stores-to-merge
10007 The maximum number of stores to attempt to merge into wider stores in the store
10008 merging pass.  The minimum value is 2 and the default is 64.
10010 @item max-unrolled-insns
10011 The maximum number of instructions that a loop may have to be unrolled.
10012 If a loop is unrolled, this parameter also determines how many times
10013 the loop code is unrolled.
10015 @item max-average-unrolled-insns
10016 The maximum number of instructions biased by probabilities of their execution
10017 that a loop may have to be unrolled.  If a loop is unrolled,
10018 this parameter also determines how many times the loop code is unrolled.
10020 @item max-unroll-times
10021 The maximum number of unrollings of a single loop.
10023 @item max-peeled-insns
10024 The maximum number of instructions that a loop may have to be peeled.
10025 If a loop is peeled, this parameter also determines how many times
10026 the loop code is peeled.
10028 @item max-peel-times
10029 The maximum number of peelings of a single loop.
10031 @item max-peel-branches
10032 The maximum number of branches on the hot path through the peeled sequence.
10034 @item max-completely-peeled-insns
10035 The maximum number of insns of a completely peeled loop.
10037 @item max-completely-peel-times
10038 The maximum number of iterations of a loop to be suitable for complete peeling.
10040 @item max-completely-peel-loop-nest-depth
10041 The maximum depth of a loop nest suitable for complete peeling.
10043 @item max-unswitch-insns
10044 The maximum number of insns of an unswitched loop.
10046 @item max-unswitch-level
10047 The maximum number of branches unswitched in a single loop.
10049 @item max-loop-headers-insns
10050 The maximum number of insns in loop header duplicated by the copy loop headers
10051 pass.
10053 @item lim-expensive
10054 The minimum cost of an expensive expression in the loop invariant motion.
10056 @item iv-consider-all-candidates-bound
10057 Bound on number of candidates for induction variables, below which
10058 all candidates are considered for each use in induction variable
10059 optimizations.  If there are more candidates than this,
10060 only the most relevant ones are considered to avoid quadratic time complexity.
10062 @item iv-max-considered-uses
10063 The induction variable optimizations give up on loops that contain more
10064 induction variable uses.
10066 @item iv-always-prune-cand-set-bound
10067 If the number of candidates in the set is smaller than this value,
10068 always try to remove unnecessary ivs from the set
10069 when adding a new one.
10071 @item avg-loop-niter
10072 Average number of iterations of a loop.
10074 @item dse-max-object-size
10075 Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
10076 Larger values may result in larger compilation times.
10078 @item scev-max-expr-size
10079 Bound on size of expressions used in the scalar evolutions analyzer.
10080 Large expressions slow the analyzer.
10082 @item scev-max-expr-complexity
10083 Bound on the complexity of the expressions in the scalar evolutions analyzer.
10084 Complex expressions slow the analyzer.
10086 @item max-tree-if-conversion-phi-args
10087 Maximum number of arguments in a PHI supported by TREE if conversion
10088 unless the loop is marked with simd pragma.
10090 @item vect-max-version-for-alignment-checks
10091 The maximum number of run-time checks that can be performed when
10092 doing loop versioning for alignment in the vectorizer.
10094 @item vect-max-version-for-alias-checks
10095 The maximum number of run-time checks that can be performed when
10096 doing loop versioning for alias in the vectorizer.
10098 @item vect-max-peeling-for-alignment
10099 The maximum number of loop peels to enhance access alignment
10100 for vectorizer. Value -1 means no limit.
10102 @item max-iterations-to-track
10103 The maximum number of iterations of a loop the brute-force algorithm
10104 for analysis of the number of iterations of the loop tries to evaluate.
10106 @item hot-bb-count-ws-permille
10107 A basic block profile count is considered hot if it contributes to 
10108 the given permillage (i.e. 0...1000) of the entire profiled execution.
10110 @item hot-bb-frequency-fraction
10111 Select fraction of the entry block frequency of executions of basic block in
10112 function given basic block needs to have to be considered hot.
10114 @item max-predicted-iterations
10115 The maximum number of loop iterations we predict statically.  This is useful
10116 in cases where a function contains a single loop with known bound and
10117 another loop with unknown bound.
10118 The known number of iterations is predicted correctly, while
10119 the unknown number of iterations average to roughly 10.  This means that the
10120 loop without bounds appears artificially cold relative to the other one.
10122 @item builtin-expect-probability
10123 Control the probability of the expression having the specified value. This
10124 parameter takes a percentage (i.e. 0 ... 100) as input.
10125 The default probability of 90 is obtained empirically.
10127 @item align-threshold
10129 Select fraction of the maximal frequency of executions of a basic block in
10130 a function to align the basic block.
10132 @item align-loop-iterations
10134 A loop expected to iterate at least the selected number of iterations is
10135 aligned.
10137 @item tracer-dynamic-coverage
10138 @itemx tracer-dynamic-coverage-feedback
10140 This value is used to limit superblock formation once the given percentage of
10141 executed instructions is covered.  This limits unnecessary code size
10142 expansion.
10144 The @option{tracer-dynamic-coverage-feedback} parameter
10145 is used only when profile
10146 feedback is available.  The real profiles (as opposed to statically estimated
10147 ones) are much less balanced allowing the threshold to be larger value.
10149 @item tracer-max-code-growth
10150 Stop tail duplication once code growth has reached given percentage.  This is
10151 a rather artificial limit, as most of the duplicates are eliminated later in
10152 cross jumping, so it may be set to much higher values than is the desired code
10153 growth.
10155 @item tracer-min-branch-ratio
10157 Stop reverse growth when the reverse probability of best edge is less than this
10158 threshold (in percent).
10160 @item tracer-min-branch-probability
10161 @itemx tracer-min-branch-probability-feedback
10163 Stop forward growth if the best edge has probability lower than this
10164 threshold.
10166 Similarly to @option{tracer-dynamic-coverage} two parameters are
10167 provided.  @option{tracer-min-branch-probability-feedback} is used for
10168 compilation with profile feedback and @option{tracer-min-branch-probability}
10169 compilation without.  The value for compilation with profile feedback
10170 needs to be more conservative (higher) in order to make tracer
10171 effective.
10173 @item max-cse-path-length
10175 The maximum number of basic blocks on path that CSE considers.
10176 The default is 10.
10178 @item max-cse-insns
10179 The maximum number of instructions CSE processes before flushing.
10180 The default is 1000.
10182 @item ggc-min-expand
10184 GCC uses a garbage collector to manage its own memory allocation.  This
10185 parameter specifies the minimum percentage by which the garbage
10186 collector's heap should be allowed to expand between collections.
10187 Tuning this may improve compilation speed; it has no effect on code
10188 generation.
10190 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
10191 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
10192 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10193 GCC is not able to calculate RAM on a particular platform, the lower
10194 bound of 30% is used.  Setting this parameter and
10195 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10196 every opportunity.  This is extremely slow, but can be useful for
10197 debugging.
10199 @item ggc-min-heapsize
10201 Minimum size of the garbage collector's heap before it begins bothering
10202 to collect garbage.  The first collection occurs after the heap expands
10203 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10204 tuning this may improve compilation speed, and has no effect on code
10205 generation.
10207 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10208 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10209 with a lower bound of 4096 (four megabytes) and an upper bound of
10210 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10211 particular platform, the lower bound is used.  Setting this parameter
10212 very large effectively disables garbage collection.  Setting this
10213 parameter and @option{ggc-min-expand} to zero causes a full collection
10214 to occur at every opportunity.
10216 @item max-reload-search-insns
10217 The maximum number of instruction reload should look backward for equivalent
10218 register.  Increasing values mean more aggressive optimization, making the
10219 compilation time increase with probably slightly better performance.
10220 The default value is 100.
10222 @item max-cselib-memory-locations
10223 The maximum number of memory locations cselib should take into account.
10224 Increasing values mean more aggressive optimization, making the compilation time
10225 increase with probably slightly better performance.  The default value is 500.
10227 @item max-sched-ready-insns
10228 The maximum number of instructions ready to be issued the scheduler should
10229 consider at any given time during the first scheduling pass.  Increasing
10230 values mean more thorough searches, making the compilation time increase
10231 with probably little benefit.  The default value is 100.
10233 @item max-sched-region-blocks
10234 The maximum number of blocks in a region to be considered for
10235 interblock scheduling.  The default value is 10.
10237 @item max-pipeline-region-blocks
10238 The maximum number of blocks in a region to be considered for
10239 pipelining in the selective scheduler.  The default value is 15.
10241 @item max-sched-region-insns
10242 The maximum number of insns in a region to be considered for
10243 interblock scheduling.  The default value is 100.
10245 @item max-pipeline-region-insns
10246 The maximum number of insns in a region to be considered for
10247 pipelining in the selective scheduler.  The default value is 200.
10249 @item min-spec-prob
10250 The minimum probability (in percents) of reaching a source block
10251 for interblock speculative scheduling.  The default value is 40.
10253 @item max-sched-extend-regions-iters
10254 The maximum number of iterations through CFG to extend regions.
10255 A value of 0 (the default) disables region extensions.
10257 @item max-sched-insn-conflict-delay
10258 The maximum conflict delay for an insn to be considered for speculative motion.
10259 The default value is 3.
10261 @item sched-spec-prob-cutoff
10262 The minimal probability of speculation success (in percents), so that
10263 speculative insns are scheduled.
10264 The default value is 40.
10266 @item sched-state-edge-prob-cutoff
10267 The minimum probability an edge must have for the scheduler to save its
10268 state across it.
10269 The default value is 10.
10271 @item sched-mem-true-dep-cost
10272 Minimal distance (in CPU cycles) between store and load targeting same
10273 memory locations.  The default value is 1.
10275 @item selsched-max-lookahead
10276 The maximum size of the lookahead window of selective scheduling.  It is a
10277 depth of search for available instructions.
10278 The default value is 50.
10280 @item selsched-max-sched-times
10281 The maximum number of times that an instruction is scheduled during
10282 selective scheduling.  This is the limit on the number of iterations
10283 through which the instruction may be pipelined.  The default value is 2.
10285 @item selsched-insns-to-rename
10286 The maximum number of best instructions in the ready list that are considered
10287 for renaming in the selective scheduler.  The default value is 2.
10289 @item sms-min-sc
10290 The minimum value of stage count that swing modulo scheduler
10291 generates.  The default value is 2.
10293 @item max-last-value-rtl
10294 The maximum size measured as number of RTLs that can be recorded in an expression
10295 in combiner for a pseudo register as last known value of that register.  The default
10296 is 10000.
10298 @item max-combine-insns
10299 The maximum number of instructions the RTL combiner tries to combine.
10300 The default value is 2 at @option{-Og} and 4 otherwise.
10302 @item integer-share-limit
10303 Small integer constants can use a shared data structure, reducing the
10304 compiler's memory usage and increasing its speed.  This sets the maximum
10305 value of a shared integer constant.  The default value is 256.
10307 @item ssp-buffer-size
10308 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10309 protection when @option{-fstack-protection} is used.
10311 @item min-size-for-stack-sharing
10312 The minimum size of variables taking part in stack slot sharing when not
10313 optimizing. The default value is 32.
10315 @item max-jump-thread-duplication-stmts
10316 Maximum number of statements allowed in a block that needs to be
10317 duplicated when threading jumps.
10319 @item max-fields-for-field-sensitive
10320 Maximum number of fields in a structure treated in
10321 a field sensitive manner during pointer analysis.  The default is zero
10322 for @option{-O0} and @option{-O1},
10323 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
10325 @item prefetch-latency
10326 Estimate on average number of instructions that are executed before
10327 prefetch finishes.  The distance prefetched ahead is proportional
10328 to this constant.  Increasing this number may also lead to less
10329 streams being prefetched (see @option{simultaneous-prefetches}).
10331 @item simultaneous-prefetches
10332 Maximum number of prefetches that can run at the same time.
10334 @item l1-cache-line-size
10335 The size of cache line in L1 cache, in bytes.
10337 @item l1-cache-size
10338 The size of L1 cache, in kilobytes.
10340 @item l2-cache-size
10341 The size of L2 cache, in kilobytes.
10343 @item min-insn-to-prefetch-ratio
10344 The minimum ratio between the number of instructions and the
10345 number of prefetches to enable prefetching in a loop.
10347 @item prefetch-min-insn-to-mem-ratio
10348 The minimum ratio between the number of instructions and the
10349 number of memory references to enable prefetching in a loop.
10351 @item use-canonical-types
10352 Whether the compiler should use the ``canonical'' type system.  By
10353 default, this should always be 1, which uses a more efficient internal
10354 mechanism for comparing types in C++ and Objective-C++.  However, if
10355 bugs in the canonical type system are causing compilation failures,
10356 set this value to 0 to disable canonical types.
10358 @item switch-conversion-max-branch-ratio
10359 Switch initialization conversion refuses to create arrays that are
10360 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10361 branches in the switch.
10363 @item max-partial-antic-length
10364 Maximum length of the partial antic set computed during the tree
10365 partial redundancy elimination optimization (@option{-ftree-pre}) when
10366 optimizing at @option{-O3} and above.  For some sorts of source code
10367 the enhanced partial redundancy elimination optimization can run away,
10368 consuming all of the memory available on the host machine.  This
10369 parameter sets a limit on the length of the sets that are computed,
10370 which prevents the runaway behavior.  Setting a value of 0 for
10371 this parameter allows an unlimited set length.
10373 @item sccvn-max-scc-size
10374 Maximum size of a strongly connected component (SCC) during SCCVN
10375 processing.  If this limit is hit, SCCVN processing for the whole
10376 function is not done and optimizations depending on it are
10377 disabled.  The default maximum SCC size is 10000.
10379 @item sccvn-max-alias-queries-per-access
10380 Maximum number of alias-oracle queries we perform when looking for
10381 redundancies for loads and stores.  If this limit is hit the search
10382 is aborted and the load or store is not considered redundant.  The
10383 number of queries is algorithmically limited to the number of
10384 stores on all paths from the load to the function entry.
10385 The default maximum number of queries is 1000.
10387 @item ira-max-loops-num
10388 IRA uses regional register allocation by default.  If a function
10389 contains more loops than the number given by this parameter, only at most
10390 the given number of the most frequently-executed loops form regions
10391 for regional register allocation.  The default value of the
10392 parameter is 100.
10394 @item ira-max-conflict-table-size 
10395 Although IRA uses a sophisticated algorithm to compress the conflict
10396 table, the table can still require excessive amounts of memory for
10397 huge functions.  If the conflict table for a function could be more
10398 than the size in MB given by this parameter, the register allocator
10399 instead uses a faster, simpler, and lower-quality
10400 algorithm that does not require building a pseudo-register conflict table.  
10401 The default value of the parameter is 2000.
10403 @item ira-loop-reserved-regs
10404 IRA can be used to evaluate more accurate register pressure in loops
10405 for decisions to move loop invariants (see @option{-O3}).  The number
10406 of available registers reserved for some other purposes is given
10407 by this parameter.  The default value of the parameter is 2, which is
10408 the minimal number of registers needed by typical instructions.
10409 This value is the best found from numerous experiments.
10411 @item lra-inheritance-ebb-probability-cutoff
10412 LRA tries to reuse values reloaded in registers in subsequent insns.
10413 This optimization is called inheritance.  EBB is used as a region to
10414 do this optimization.  The parameter defines a minimal fall-through
10415 edge probability in percentage used to add BB to inheritance EBB in
10416 LRA.  The default value of the parameter is 40.  The value was chosen
10417 from numerous runs of SPEC2000 on x86-64.
10419 @item loop-invariant-max-bbs-in-loop
10420 Loop invariant motion can be very expensive, both in compilation time and
10421 in amount of needed compile-time memory, with very large loops.  Loops
10422 with more basic blocks than this parameter won't have loop invariant
10423 motion optimization performed on them.  The default value of the
10424 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10426 @item loop-max-datarefs-for-datadeps
10427 Building data dependencies is expensive for very large loops.  This
10428 parameter limits the number of data references in loops that are
10429 considered for data dependence analysis.  These large loops are no
10430 handled by the optimizations using loop data dependencies.
10431 The default value is 1000.
10433 @item max-vartrack-size
10434 Sets a maximum number of hash table slots to use during variable
10435 tracking dataflow analysis of any function.  If this limit is exceeded
10436 with variable tracking at assignments enabled, analysis for that
10437 function is retried without it, after removing all debug insns from
10438 the function.  If the limit is exceeded even without debug insns, var
10439 tracking analysis is completely disabled for the function.  Setting
10440 the parameter to zero makes it unlimited.
10442 @item max-vartrack-expr-depth
10443 Sets a maximum number of recursion levels when attempting to map
10444 variable names or debug temporaries to value expressions.  This trades
10445 compilation time for more complete debug information.  If this is set too
10446 low, value expressions that are available and could be represented in
10447 debug information may end up not being used; setting this higher may
10448 enable the compiler to find more complex debug expressions, but compile
10449 time and memory use may grow.  The default is 12.
10451 @item min-nondebug-insn-uid
10452 Use uids starting at this parameter for nondebug insns.  The range below
10453 the parameter is reserved exclusively for debug insns created by
10454 @option{-fvar-tracking-assignments}, but debug insns may get
10455 (non-overlapping) uids above it if the reserved range is exhausted.
10457 @item ipa-sra-ptr-growth-factor
10458 IPA-SRA replaces a pointer to an aggregate with one or more new
10459 parameters only when their cumulative size is less or equal to
10460 @option{ipa-sra-ptr-growth-factor} times the size of the original
10461 pointer parameter.
10463 @item sra-max-scalarization-size-Ospeed
10464 @item sra-max-scalarization-size-Osize
10465 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
10466 replace scalar parts of aggregates with uses of independent scalar
10467 variables.  These parameters control the maximum size, in storage units,
10468 of aggregate which is considered for replacement when compiling for
10469 speed
10470 (@option{sra-max-scalarization-size-Ospeed}) or size
10471 (@option{sra-max-scalarization-size-Osize}) respectively.
10473 @item tm-max-aggregate-size
10474 When making copies of thread-local variables in a transaction, this
10475 parameter specifies the size in bytes after which variables are
10476 saved with the logging functions as opposed to save/restore code
10477 sequence pairs.  This option only applies when using
10478 @option{-fgnu-tm}.
10480 @item graphite-max-nb-scop-params
10481 To avoid exponential effects in the Graphite loop transforms, the
10482 number of parameters in a Static Control Part (SCoP) is bounded.  The
10483 default value is 10 parameters.  A variable whose value is unknown at
10484 compilation time and defined outside a SCoP is a parameter of the SCoP.
10486 @item graphite-max-bbs-per-function
10487 To avoid exponential effects in the detection of SCoPs, the size of
10488 the functions analyzed by Graphite is bounded.  The default value is
10489 100 basic blocks.
10491 @item loop-block-tile-size
10492 Loop blocking or strip mining transforms, enabled with
10493 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10494 loop in the loop nest by a given number of iterations.  The strip
10495 length can be changed using the @option{loop-block-tile-size}
10496 parameter.  The default value is 51 iterations.
10498 @item loop-unroll-jam-size
10499 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
10500 default value is 4.
10502 @item loop-unroll-jam-depth
10503 Specify the dimension to be unrolled (counting from the most inner loop)
10504 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
10506 @item ipa-cp-value-list-size
10507 IPA-CP attempts to track all possible values and types passed to a function's
10508 parameter in order to propagate them and perform devirtualization.
10509 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10510 stores per one formal parameter of a function.
10512 @item ipa-cp-eval-threshold
10513 IPA-CP calculates its own score of cloning profitability heuristics
10514 and performs those cloning opportunities with scores that exceed
10515 @option{ipa-cp-eval-threshold}.
10517 @item ipa-cp-recursion-penalty
10518 Percentage penalty the recursive functions will receive when they
10519 are evaluated for cloning.
10521 @item ipa-cp-single-call-penalty
10522 Percentage penalty functions containing a single call to another
10523 function will receive when they are evaluated for cloning.
10526 @item ipa-max-agg-items
10527 IPA-CP is also capable to propagate a number of scalar values passed
10528 in an aggregate. @option{ipa-max-agg-items} controls the maximum
10529 number of such values per one parameter.
10531 @item ipa-cp-loop-hint-bonus
10532 When IPA-CP determines that a cloning candidate would make the number
10533 of iterations of a loop known, it adds a bonus of
10534 @option{ipa-cp-loop-hint-bonus} to the profitability score of
10535 the candidate.
10537 @item ipa-cp-array-index-hint-bonus
10538 When IPA-CP determines that a cloning candidate would make the index of
10539 an array access known, it adds a bonus of
10540 @option{ipa-cp-array-index-hint-bonus} to the profitability
10541 score of the candidate.
10543 @item ipa-max-aa-steps
10544 During its analysis of function bodies, IPA-CP employs alias analysis
10545 in order to track values pointed to by function parameters.  In order
10546 not spend too much time analyzing huge functions, it gives up and
10547 consider all memory clobbered after examining
10548 @option{ipa-max-aa-steps} statements modifying memory.
10550 @item lto-partitions
10551 Specify desired number of partitions produced during WHOPR compilation.
10552 The number of partitions should exceed the number of CPUs used for compilation.
10553 The default value is 32.
10555 @item lto-min-partition
10556 Size of minimal partition for WHOPR (in estimated instructions).
10557 This prevents expenses of splitting very small programs into too many
10558 partitions.
10560 @item lto-max-partition
10561 Size of max partition for WHOPR (in estimated instructions).
10562 to provide an upper bound for individual size of partition.
10563 Meant to be used only with balanced partitioning.
10565 @item cxx-max-namespaces-for-diagnostic-help
10566 The maximum number of namespaces to consult for suggestions when C++
10567 name lookup fails for an identifier.  The default is 1000.
10569 @item sink-frequency-threshold
10570 The maximum relative execution frequency (in percents) of the target block
10571 relative to a statement's original block to allow statement sinking of a
10572 statement.  Larger numbers result in more aggressive statement sinking.
10573 The default value is 75.  A small positive adjustment is applied for
10574 statements with memory operands as those are even more profitable so sink.
10576 @item max-stores-to-sink
10577 The maximum number of conditional store pairs that can be sunk.  Set to 0
10578 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10579 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10581 @item allow-store-data-races
10582 Allow optimizers to introduce new data races on stores.
10583 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10584 at optimization level @option{-Ofast}.
10586 @item case-values-threshold
10587 The smallest number of different values for which it is best to use a
10588 jump-table instead of a tree of conditional branches.  If the value is
10589 0, use the default for the machine.  The default is 0.
10591 @item tree-reassoc-width
10592 Set the maximum number of instructions executed in parallel in
10593 reassociated tree. This parameter overrides target dependent
10594 heuristics used by default if has non zero value.
10596 @item sched-pressure-algorithm
10597 Choose between the two available implementations of
10598 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10599 and is the more likely to prevent instructions from being reordered.
10600 Algorithm 2 was designed to be a compromise between the relatively
10601 conservative approach taken by algorithm 1 and the rather aggressive
10602 approach taken by the default scheduler.  It relies more heavily on
10603 having a regular register file and accurate register pressure classes.
10604 See @file{haifa-sched.c} in the GCC sources for more details.
10606 The default choice depends on the target.
10608 @item max-slsr-cand-scan
10609 Set the maximum number of existing candidates that are considered when
10610 seeking a basis for a new straight-line strength reduction candidate.
10612 @item asan-globals
10613 Enable buffer overflow detection for global objects.  This kind
10614 of protection is enabled by default if you are using
10615 @option{-fsanitize=address} option.
10616 To disable global objects protection use @option{--param asan-globals=0}.
10618 @item asan-stack
10619 Enable buffer overflow detection for stack objects.  This kind of
10620 protection is enabled by default when using @option{-fsanitize=address}.
10621 To disable stack protection use @option{--param asan-stack=0} option.
10623 @item asan-instrument-reads
10624 Enable buffer overflow detection for memory reads.  This kind of
10625 protection is enabled by default when using @option{-fsanitize=address}.
10626 To disable memory reads protection use
10627 @option{--param asan-instrument-reads=0}.
10629 @item asan-instrument-writes
10630 Enable buffer overflow detection for memory writes.  This kind of
10631 protection is enabled by default when using @option{-fsanitize=address}.
10632 To disable memory writes protection use
10633 @option{--param asan-instrument-writes=0} option.
10635 @item asan-memintrin
10636 Enable detection for built-in functions.  This kind of protection
10637 is enabled by default when using @option{-fsanitize=address}.
10638 To disable built-in functions protection use
10639 @option{--param asan-memintrin=0}.
10641 @item asan-use-after-return
10642 Enable detection of use-after-return.  This kind of protection
10643 is enabled by default when using the @option{-fsanitize=address} option.
10644 To disable it use @option{--param asan-use-after-return=0}.
10646 Note: By default the check is disabled at run time.  To enable it,
10647 add @code{detect_stack_use_after_return=1} to the environment variable
10648 @env{ASAN_OPTIONS}.
10650 @item asan-instrumentation-with-call-threshold
10651 If number of memory accesses in function being instrumented
10652 is greater or equal to this number, use callbacks instead of inline checks.
10653 E.g. to disable inline code use
10654 @option{--param asan-instrumentation-with-call-threshold=0}.
10656 @item use-after-scope-direct-emission-threshold
10657 If the size of a local variable in bytes is smaller or equal to this
10658 number, directly poison (or unpoison) shadow memory instead of using
10659 run-time callbacks.  The default value is 256.
10661 @item chkp-max-ctor-size
10662 Static constructors generated by Pointer Bounds Checker may become very
10663 large and significantly increase compile time at optimization level
10664 @option{-O1} and higher.  This parameter is a maximum number of statements
10665 in a single generated constructor.  Default value is 5000.
10667 @item max-fsm-thread-path-insns
10668 Maximum number of instructions to copy when duplicating blocks on a
10669 finite state automaton jump thread path.  The default is 100.
10671 @item max-fsm-thread-length
10672 Maximum number of basic blocks on a finite state automaton jump thread
10673 path.  The default is 10.
10675 @item max-fsm-thread-paths
10676 Maximum number of new jump thread paths to create for a finite state
10677 automaton.  The default is 50.
10679 @item parloops-chunk-size
10680 Chunk size of omp schedule for loops parallelized by parloops.  The default
10681 is 0.
10683 @item parloops-schedule
10684 Schedule type of omp schedule for loops parallelized by parloops (static,
10685 dynamic, guided, auto, runtime).  The default is static.
10687 @item max-ssa-name-query-depth
10688 Maximum depth of recursion when querying properties of SSA names in things
10689 like fold routines.  One level of recursion corresponds to following a
10690 use-def chain.
10692 @item hsa-gen-debug-stores
10693 Enable emission of special debug stores within HSA kernels which are
10694 then read and reported by libgomp plugin.  Generation of these stores
10695 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
10696 enable it.
10698 @item max-speculative-devirt-maydefs
10699 The maximum number of may-defs we analyze when looking for a must-def
10700 specifying the dynamic type of an object that invokes a virtual call
10701 we may be able to devirtualize speculatively.
10703 @item max-vrp-switch-assertions
10704 The maximum number of assertions to add along the default edge of a switch
10705 statement during VRP.  The default is 10.
10706 @end table
10707 @end table
10709 @node Instrumentation Options
10710 @section Program Instrumentation Options
10711 @cindex instrumentation options
10712 @cindex program instrumentation options
10713 @cindex run-time error checking options
10714 @cindex profiling options
10715 @cindex options, program instrumentation
10716 @cindex options, run-time error checking
10717 @cindex options, profiling
10719 GCC supports a number of command-line options that control adding
10720 run-time instrumentation to the code it normally generates.  
10721 For example, one purpose of instrumentation is collect profiling
10722 statistics for use in finding program hot spots, code coverage
10723 analysis, or profile-guided optimizations.
10724 Another class of program instrumentation is adding run-time checking 
10725 to detect programming errors like invalid pointer
10726 dereferences or out-of-bounds array accesses, as well as deliberately
10727 hostile attacks such as stack smashing or C++ vtable hijacking.
10728 There is also a general hook which can be used to implement other
10729 forms of tracing or function-level instrumentation for debug or
10730 program analysis purposes.
10732 @table @gcctabopt
10733 @cindex @command{prof}
10734 @item -p
10735 @opindex p
10736 Generate extra code to write profile information suitable for the
10737 analysis program @command{prof}.  You must use this option when compiling
10738 the source files you want data about, and you must also use it when
10739 linking.
10741 @cindex @command{gprof}
10742 @item -pg
10743 @opindex pg
10744 Generate extra code to write profile information suitable for the
10745 analysis program @command{gprof}.  You must use this option when compiling
10746 the source files you want data about, and you must also use it when
10747 linking.
10749 @item -fprofile-arcs
10750 @opindex fprofile-arcs
10751 Add code so that program flow @dfn{arcs} are instrumented.  During
10752 execution the program records how many times each branch and call is
10753 executed and how many times it is taken or returns.  On targets that support
10754 constructors with priority support, profiling properly handles constructors,
10755 destructors and C++ constructors (and destructors) of classes which are used
10756 as a type of a global variable.
10758 When the compiled
10759 program exits it saves this data to a file called
10760 @file{@var{auxname}.gcda} for each source file.  The data may be used for
10761 profile-directed optimizations (@option{-fbranch-probabilities}), or for
10762 test coverage analysis (@option{-ftest-coverage}).  Each object file's
10763 @var{auxname} is generated from the name of the output file, if
10764 explicitly specified and it is not the final executable, otherwise it is
10765 the basename of the source file.  In both cases any suffix is removed
10766 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
10767 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
10768 @xref{Cross-profiling}.
10770 @cindex @command{gcov}
10771 @item --coverage
10772 @opindex coverage
10774 This option is used to compile and link code instrumented for coverage
10775 analysis.  The option is a synonym for @option{-fprofile-arcs}
10776 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
10777 linking).  See the documentation for those options for more details.
10779 @itemize
10781 @item
10782 Compile the source files with @option{-fprofile-arcs} plus optimization
10783 and code generation options.  For test coverage analysis, use the
10784 additional @option{-ftest-coverage} option.  You do not need to profile
10785 every source file in a program.
10787 @item
10788 Compile the source files additionally with @option{-fprofile-abs-path}
10789 to create absolute path names in the @file{.gcno} files.  This allows
10790 @command{gcov} to find the correct sources in projects where compilations
10791 occur with different working directories.
10793 @item
10794 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
10795 (the latter implies the former).
10797 @item
10798 Run the program on a representative workload to generate the arc profile
10799 information.  This may be repeated any number of times.  You can run
10800 concurrent instances of your program, and provided that the file system
10801 supports locking, the data files will be correctly updated.  Also
10802 @code{fork} calls are detected and correctly handled (double counting
10803 will not happen).
10805 @item
10806 For profile-directed optimizations, compile the source files again with
10807 the same optimization and code generation options plus
10808 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
10809 Control Optimization}).
10811 @item
10812 For test coverage analysis, use @command{gcov} to produce human readable
10813 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
10814 @command{gcov} documentation for further information.
10816 @end itemize
10818 With @option{-fprofile-arcs}, for each function of your program GCC
10819 creates a program flow graph, then finds a spanning tree for the graph.
10820 Only arcs that are not on the spanning tree have to be instrumented: the
10821 compiler adds code to count the number of times that these arcs are
10822 executed.  When an arc is the only exit or only entrance to a block, the
10823 instrumentation code can be added to the block; otherwise, a new basic
10824 block must be created to hold the instrumentation code.
10826 @need 2000
10827 @item -ftest-coverage
10828 @opindex ftest-coverage
10829 Produce a notes file that the @command{gcov} code-coverage utility
10830 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
10831 show program coverage.  Each source file's note file is called
10832 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
10833 above for a description of @var{auxname} and instructions on how to
10834 generate test coverage data.  Coverage data matches the source files
10835 more closely if you do not optimize.
10837 @item -fprofile-abs-path
10838 @opindex fprofile-abs-path
10839 Automatically convert relative source file names to absolute path names
10840 in the @file{.gcno} files.  This allows @command{gcov} to find the correct
10841 sources in projects where compilations occur with different working
10842 directories.
10844 @item -fprofile-dir=@var{path}
10845 @opindex fprofile-dir
10847 Set the directory to search for the profile data files in to @var{path}.
10848 This option affects only the profile data generated by
10849 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
10850 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
10851 and its related options.  Both absolute and relative paths can be used.
10852 By default, GCC uses the current directory as @var{path}, thus the
10853 profile data file appears in the same directory as the object file.
10855 @item -fprofile-generate
10856 @itemx -fprofile-generate=@var{path}
10857 @opindex fprofile-generate
10859 Enable options usually used for instrumenting application to produce
10860 profile useful for later recompilation with profile feedback based
10861 optimization.  You must use @option{-fprofile-generate} both when
10862 compiling and when linking your program.
10864 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
10866 If @var{path} is specified, GCC looks at the @var{path} to find
10867 the profile feedback data files. See @option{-fprofile-dir}.
10869 To optimize the program based on the collected profile information, use
10870 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
10872 @item -fprofile-update=@var{method}
10873 @opindex fprofile-update
10875 Alter the update method for an application instrumented for profile
10876 feedback based optimization.  The @var{method} argument should be one of
10877 @samp{single}, @samp{atomic} or @samp{prefer-atomic}.
10878 The first one is useful for single-threaded applications,
10879 while the second one prevents profile corruption by emitting thread-safe code.
10881 @strong{Warning:} When an application does not properly join all threads
10882 (or creates an detached thread), a profile file can be still corrupted.
10884 Using @samp{prefer-atomic} would be transformed either to @samp{atomic},
10885 when supported by a target, or to @samp{single} otherwise.  The GCC driver
10886 automatically selects @samp{prefer-atomic} when @option{-pthread}
10887 is present in the command line.
10889 @item -fsanitize=address
10890 @opindex fsanitize=address
10891 Enable AddressSanitizer, a fast memory error detector.
10892 Memory access instructions are instrumented to detect
10893 out-of-bounds and use-after-free bugs.
10894 The option enables @option{-fsanitize-address-use-after-scope}.
10895 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
10896 more details.  The run-time behavior can be influenced using the
10897 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
10898 the available options are shown at startup of the instrumented program.  See
10899 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
10900 for a list of supported options.
10901 The option cannot be combined with @option{-fsanitize=thread}
10902 and/or @option{-fcheck-pointer-bounds}.
10904 @item -fsanitize=kernel-address
10905 @opindex fsanitize=kernel-address
10906 Enable AddressSanitizer for Linux kernel.
10907 See @uref{https://github.com/google/kasan/wiki} for more details.
10908 The option cannot be combined with @option{-fcheck-pointer-bounds}.
10910 @item -fsanitize=thread
10911 @opindex fsanitize=thread
10912 Enable ThreadSanitizer, a fast data race detector.
10913 Memory access instructions are instrumented to detect
10914 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
10915 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
10916 environment variable; see
10917 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
10918 supported options.
10919 The option cannot be combined with @option{-fsanitize=address},
10920 @option{-fsanitize=leak} and/or @option{-fcheck-pointer-bounds}.
10922 Note that sanitized atomic builtins cannot throw exceptions when
10923 operating on invalid memory addresses with non-call exceptions
10924 (@option{-fnon-call-exceptions}).
10926 @item -fsanitize=leak
10927 @opindex fsanitize=leak
10928 Enable LeakSanitizer, a memory leak detector.
10929 This option only matters for linking of executables and
10930 the executable is linked against a library that overrides @code{malloc}
10931 and other allocator functions.  See
10932 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
10933 details.  The run-time behavior can be influenced using the
10934 @env{LSAN_OPTIONS} environment variable.
10935 The option cannot be combined with @option{-fsanitize=thread}.
10937 @item -fsanitize=undefined
10938 @opindex fsanitize=undefined
10939 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
10940 Various computations are instrumented to detect undefined behavior
10941 at runtime.  Current suboptions are:
10943 @table @gcctabopt
10945 @item -fsanitize=shift
10946 @opindex fsanitize=shift
10947 This option enables checking that the result of a shift operation is
10948 not undefined.  Note that what exactly is considered undefined differs
10949 slightly between C and C++, as well as between ISO C90 and C99, etc.
10950 This option has two suboptions, @option{-fsanitize=shift-base} and
10951 @option{-fsanitize=shift-exponent}.
10953 @item -fsanitize=shift-exponent
10954 @opindex fsanitize=shift-exponent
10955 This option enables checking that the second argument of a shift operation
10956 is not negative and is smaller than the precision of the promoted first
10957 argument.
10959 @item -fsanitize=shift-base
10960 @opindex fsanitize=shift-base
10961 If the second argument of a shift operation is within range, check that the
10962 result of a shift operation is not undefined.  Note that what exactly is
10963 considered undefined differs slightly between C and C++, as well as between
10964 ISO C90 and C99, etc.
10966 @item -fsanitize=integer-divide-by-zero
10967 @opindex fsanitize=integer-divide-by-zero
10968 Detect integer division by zero as well as @code{INT_MIN / -1} division.
10970 @item -fsanitize=unreachable
10971 @opindex fsanitize=unreachable
10972 With this option, the compiler turns the @code{__builtin_unreachable}
10973 call into a diagnostics message call instead.  When reaching the
10974 @code{__builtin_unreachable} call, the behavior is undefined.
10976 @item -fsanitize=vla-bound
10977 @opindex fsanitize=vla-bound
10978 This option instructs the compiler to check that the size of a variable
10979 length array is positive.
10981 @item -fsanitize=null
10982 @opindex fsanitize=null
10983 This option enables pointer checking.  Particularly, the application
10984 built with this option turned on will issue an error message when it
10985 tries to dereference a NULL pointer, or if a reference (possibly an
10986 rvalue reference) is bound to a NULL pointer, or if a method is invoked
10987 on an object pointed by a NULL pointer.
10989 @item -fsanitize=return
10990 @opindex fsanitize=return
10991 This option enables return statement checking.  Programs
10992 built with this option turned on will issue an error message
10993 when the end of a non-void function is reached without actually
10994 returning a value.  This option works in C++ only.
10996 @item -fsanitize=signed-integer-overflow
10997 @opindex fsanitize=signed-integer-overflow
10998 This option enables signed integer overflow checking.  We check that
10999 the result of @code{+}, @code{*}, and both unary and binary @code{-}
11000 does not overflow in the signed arithmetics.  Note, integer promotion
11001 rules must be taken into account.  That is, the following is not an
11002 overflow:
11003 @smallexample
11004 signed char a = SCHAR_MAX;
11005 a++;
11006 @end smallexample
11008 @item -fsanitize=bounds
11009 @opindex fsanitize=bounds
11010 This option enables instrumentation of array bounds.  Various out of bounds
11011 accesses are detected.  Flexible array members, flexible array member-like
11012 arrays, and initializers of variables with static storage are not instrumented.
11013 The option cannot be combined with @option{-fcheck-pointer-bounds}.
11015 @item -fsanitize=bounds-strict
11016 @opindex fsanitize=bounds-strict
11017 This option enables strict instrumentation of array bounds.  Most out of bounds
11018 accesses are detected, including flexible array members and flexible array
11019 member-like arrays.  Initializers of variables with static storage are not
11020 instrumented.  The option cannot be combined
11021 with @option{-fcheck-pointer-bounds}.
11023 @item -fsanitize=alignment
11024 @opindex fsanitize=alignment
11026 This option enables checking of alignment of pointers when they are
11027 dereferenced, or when a reference is bound to insufficiently aligned target,
11028 or when a method or constructor is invoked on insufficiently aligned object.
11030 @item -fsanitize=object-size
11031 @opindex fsanitize=object-size
11032 This option enables instrumentation of memory references using the
11033 @code{__builtin_object_size} function.  Various out of bounds pointer
11034 accesses are detected.
11036 @item -fsanitize=float-divide-by-zero
11037 @opindex fsanitize=float-divide-by-zero
11038 Detect floating-point division by zero.  Unlike other similar options,
11039 @option{-fsanitize=float-divide-by-zero} is not enabled by
11040 @option{-fsanitize=undefined}, since floating-point division by zero can
11041 be a legitimate way of obtaining infinities and NaNs.
11043 @item -fsanitize=float-cast-overflow
11044 @opindex fsanitize=float-cast-overflow
11045 This option enables floating-point type to integer conversion checking.
11046 We check that the result of the conversion does not overflow.
11047 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
11048 not enabled by @option{-fsanitize=undefined}.
11049 This option does not work well with @code{FE_INVALID} exceptions enabled.
11051 @item -fsanitize=nonnull-attribute
11052 @opindex fsanitize=nonnull-attribute
11054 This option enables instrumentation of calls, checking whether null values
11055 are not passed to arguments marked as requiring a non-null value by the
11056 @code{nonnull} function attribute.
11058 @item -fsanitize=returns-nonnull-attribute
11059 @opindex fsanitize=returns-nonnull-attribute
11061 This option enables instrumentation of return statements in functions
11062 marked with @code{returns_nonnull} function attribute, to detect returning
11063 of null values from such functions.
11065 @item -fsanitize=bool
11066 @opindex fsanitize=bool
11068 This option enables instrumentation of loads from bool.  If a value other
11069 than 0/1 is loaded, a run-time error is issued.
11071 @item -fsanitize=enum
11072 @opindex fsanitize=enum
11074 This option enables instrumentation of loads from an enum type.  If
11075 a value outside the range of values for the enum type is loaded,
11076 a run-time error is issued.
11078 @item -fsanitize=vptr
11079 @opindex fsanitize=vptr
11081 This option enables instrumentation of C++ member function calls, member
11082 accesses and some conversions between pointers to base and derived classes,
11083 to verify the referenced object has the correct dynamic type.
11085 @item -fsanitize=pointer-overflow
11086 @opindex fsanitize=pointer-overflow
11088 This option enables instrumentation of pointer arithmetics.  If the pointer
11089 arithmetics overflows, a run-time error is issued.
11091 @end table
11093 While @option{-ftrapv} causes traps for signed overflows to be emitted,
11094 @option{-fsanitize=undefined} gives a diagnostic message.
11095 This currently works only for the C family of languages.
11097 @item -fno-sanitize=all
11098 @opindex fno-sanitize=all
11100 This option disables all previously enabled sanitizers.
11101 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
11102 together.
11104 @item -fasan-shadow-offset=@var{number}
11105 @opindex fasan-shadow-offset
11106 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
11107 It is useful for experimenting with different shadow memory layouts in
11108 Kernel AddressSanitizer.
11110 @item -fsanitize-sections=@var{s1},@var{s2},...
11111 @opindex fsanitize-sections
11112 Sanitize global variables in selected user-defined sections.  @var{si} may
11113 contain wildcards.
11115 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
11116 @opindex fsanitize-recover
11117 @opindex fno-sanitize-recover
11118 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
11119 mentioned in comma-separated list of @var{opts}.  Enabling this option
11120 for a sanitizer component causes it to attempt to continue
11121 running the program as if no error happened.  This means multiple
11122 runtime errors can be reported in a single program run, and the exit
11123 code of the program may indicate success even when errors
11124 have been reported.  The @option{-fno-sanitize-recover=} option
11125 can be used to alter
11126 this behavior: only the first detected error is reported
11127 and program then exits with a non-zero exit code.
11129 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
11130 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
11131 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
11132 @option{-fsanitize=bounds-strict},
11133 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
11134 For these sanitizers error recovery is turned on by default,
11135 except @option{-fsanitize=address}, for which this feature is experimental.
11136 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
11137 accepted, the former enables recovery for all sanitizers that support it,
11138 the latter disables recovery for all sanitizers that support it.
11140 Even if a recovery mode is turned on the compiler side, it needs to be also
11141 enabled on the runtime library side, otherwise the failures are still fatal.
11142 The runtime library defaults to @code{halt_on_error=0} for
11143 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
11144 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
11145 setting the @code{halt_on_error} flag in the corresponding environment variable.
11147 Syntax without an explicit @var{opts} parameter is deprecated.  It is
11148 equivalent to specifying an @var{opts} list of:
11150 @smallexample
11151 undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
11152 @end smallexample
11154 @item -fsanitize-address-use-after-scope
11155 @opindex fsanitize-address-use-after-scope
11156 Enable sanitization of local variables to detect use-after-scope bugs.
11157 The option sets @option{-fstack-reuse} to @samp{none}.
11159 @item -fsanitize-undefined-trap-on-error
11160 @opindex fsanitize-undefined-trap-on-error
11161 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
11162 report undefined behavior using @code{__builtin_trap} rather than
11163 a @code{libubsan} library routine.  The advantage of this is that the
11164 @code{libubsan} library is not needed and is not linked in, so this
11165 is usable even in freestanding environments.
11167 @item -fsanitize-coverage=trace-pc
11168 @opindex fsanitize-coverage=trace-pc
11169 Enable coverage-guided fuzzing code instrumentation.
11170 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
11172 @item -fsanitize-coverage=trace-cmp
11173 @opindex fsanitize-coverage=trace-cmp
11174 Enable dataflow guided fuzzing code instrumentation.
11175 Inserts a call to @code{__sanitizer_cov_trace_cmp1},
11176 @code{__sanitizer_cov_trace_cmp2}, @code{__sanitizer_cov_trace_cmp4} or
11177 @code{__sanitizer_cov_trace_cmp8} for integral comparison with both operands
11178 variable or @code{__sanitizer_cov_trace_const_cmp1},
11179 @code{__sanitizer_cov_trace_const_cmp2},
11180 @code{__sanitizer_cov_trace_const_cmp4} or
11181 @code{__sanitizer_cov_trace_const_cmp8} for integral comparison with one
11182 operand constant, @code{__sanitizer_cov_trace_cmpf} or
11183 @code{__sanitizer_cov_trace_cmpd} for float or double comparisons and
11184 @code{__sanitizer_cov_trace_switch} for switch statements.
11186 @item -fbounds-check
11187 @opindex fbounds-check
11188 For front ends that support it, generate additional code to check that
11189 indices used to access arrays are within the declared range.  This is
11190 currently only supported by the Fortran front end, where this option
11191 defaults to false.
11193 @item -fcheck-pointer-bounds
11194 @opindex fcheck-pointer-bounds
11195 @opindex fno-check-pointer-bounds
11196 @cindex Pointer Bounds Checker options
11197 Enable Pointer Bounds Checker instrumentation.  Each memory reference
11198 is instrumented with checks of the pointer used for memory access against
11199 bounds associated with that pointer.  
11201 Currently there
11202 is only an implementation for Intel MPX available, thus x86 GNU/Linux target
11203 and @option{-mmpx} are required to enable this feature.  
11204 MPX-based instrumentation requires
11205 a runtime library to enable MPX in hardware and handle bounds
11206 violation signals.  By default when @option{-fcheck-pointer-bounds}
11207 and @option{-mmpx} options are used to link a program, the GCC driver
11208 links against the @file{libmpx} and @file{libmpxwrappers} libraries.
11209 Bounds checking on calls to dynamic libraries requires a linker
11210 with @option{-z bndplt} support; if GCC was configured with a linker
11211 without support for this option (including the Gold linker and older
11212 versions of ld), a warning is given if you link with @option{-mmpx}
11213 without also specifying @option{-static}, since the overall effectiveness
11214 of the bounds checking protection is reduced.
11215 See also @option{-static-libmpxwrappers}.
11217 MPX-based instrumentation
11218 may be used for debugging and also may be included in production code
11219 to increase program security.  Depending on usage, you may
11220 have different requirements for the runtime library.  The current version
11221 of the MPX runtime library is more oriented for use as a debugging
11222 tool.  MPX runtime library usage implies @option{-lpthread}.  See
11223 also @option{-static-libmpx}.  The runtime library  behavior can be
11224 influenced using various @env{CHKP_RT_*} environment variables.  See
11225 @uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
11226 for more details.
11228 Generated instrumentation may be controlled by various
11229 @option{-fchkp-*} options and by the @code{bnd_variable_size}
11230 structure field attribute (@pxref{Type Attributes}) and
11231 @code{bnd_legacy}, and @code{bnd_instrument} function attributes
11232 (@pxref{Function Attributes}).  GCC also provides a number of built-in
11233 functions for controlling the Pointer Bounds Checker.  @xref{Pointer
11234 Bounds Checker builtins}, for more information.
11236 @item -fchkp-check-incomplete-type
11237 @opindex fchkp-check-incomplete-type
11238 @opindex fno-chkp-check-incomplete-type
11239 Generate pointer bounds checks for variables with incomplete type.
11240 Enabled by default.
11242 @item -fchkp-narrow-bounds
11243 @opindex fchkp-narrow-bounds
11244 @opindex fno-chkp-narrow-bounds
11245 Controls bounds used by Pointer Bounds Checker for pointers to object
11246 fields.  If narrowing is enabled then field bounds are used.  Otherwise
11247 object bounds are used.  See also @option{-fchkp-narrow-to-innermost-array}
11248 and @option{-fchkp-first-field-has-own-bounds}.  Enabled by default.
11250 @item -fchkp-first-field-has-own-bounds
11251 @opindex fchkp-first-field-has-own-bounds
11252 @opindex fno-chkp-first-field-has-own-bounds
11253 Forces Pointer Bounds Checker to use narrowed bounds for the address of the
11254 first field in the structure.  By default a pointer to the first field has
11255 the same bounds as a pointer to the whole structure.
11257 @item -fchkp-flexible-struct-trailing-arrays
11258 @opindex fchkp-flexible-struct-trailing-arrays
11259 @opindex fno-chkp-flexible-struct-trailing-arrays
11260 Forces Pointer Bounds Checker to treat all trailing arrays in structures as
11261 possibly flexible.  By default only array fields with zero length or that are
11262 marked with attribute bnd_variable_size are treated as flexible.
11264 @item -fchkp-narrow-to-innermost-array
11265 @opindex fchkp-narrow-to-innermost-array
11266 @opindex fno-chkp-narrow-to-innermost-array
11267 Forces Pointer Bounds Checker to use bounds of the innermost arrays in
11268 case of nested static array access.  By default this option is disabled and
11269 bounds of the outermost array are used.
11271 @item -fchkp-optimize
11272 @opindex fchkp-optimize
11273 @opindex fno-chkp-optimize
11274 Enables Pointer Bounds Checker optimizations.  Enabled by default at
11275 optimization levels @option{-O}, @option{-O2}, @option{-O3}.
11277 @item -fchkp-use-fast-string-functions
11278 @opindex fchkp-use-fast-string-functions
11279 @opindex fno-chkp-use-fast-string-functions
11280 Enables use of @code{*_nobnd} versions of string functions (not copying bounds)
11281 by Pointer Bounds Checker.  Disabled by default.
11283 @item -fchkp-use-nochk-string-functions
11284 @opindex fchkp-use-nochk-string-functions
11285 @opindex fno-chkp-use-nochk-string-functions
11286 Enables use of @code{*_nochk} versions of string functions (not checking bounds)
11287 by Pointer Bounds Checker.  Disabled by default.
11289 @item -fchkp-use-static-bounds
11290 @opindex fchkp-use-static-bounds
11291 @opindex fno-chkp-use-static-bounds
11292 Allow Pointer Bounds Checker to generate static bounds holding
11293 bounds of static variables.  Enabled by default.
11295 @item -fchkp-use-static-const-bounds
11296 @opindex fchkp-use-static-const-bounds
11297 @opindex fno-chkp-use-static-const-bounds
11298 Use statically-initialized bounds for constant bounds instead of
11299 generating them each time they are required.  By default enabled when
11300 @option{-fchkp-use-static-bounds} is enabled.
11302 @item -fchkp-treat-zero-dynamic-size-as-infinite
11303 @opindex fchkp-treat-zero-dynamic-size-as-infinite
11304 @opindex fno-chkp-treat-zero-dynamic-size-as-infinite
11305 With this option, objects with incomplete type whose
11306 dynamically-obtained size is zero are treated as having infinite size
11307 instead by Pointer Bounds
11308 Checker.  This option may be helpful if a program is linked with a library
11309 missing size information for some symbols.  Disabled by default.
11311 @item -fchkp-check-read
11312 @opindex fchkp-check-read
11313 @opindex fno-chkp-check-read
11314 Instructs Pointer Bounds Checker to generate checks for all read
11315 accesses to memory.  Enabled by default.
11317 @item -fchkp-check-write
11318 @opindex fchkp-check-write
11319 @opindex fno-chkp-check-write
11320 Instructs Pointer Bounds Checker to generate checks for all write
11321 accesses to memory.  Enabled by default.
11323 @item -fchkp-store-bounds
11324 @opindex fchkp-store-bounds
11325 @opindex fno-chkp-store-bounds
11326 Instructs Pointer Bounds Checker to generate bounds stores for
11327 pointer writes.  Enabled by default.
11329 @item -fchkp-instrument-calls
11330 @opindex fchkp-instrument-calls
11331 @opindex fno-chkp-instrument-calls
11332 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
11333 Enabled by default.
11335 @item -fchkp-instrument-marked-only
11336 @opindex fchkp-instrument-marked-only
11337 @opindex fno-chkp-instrument-marked-only
11338 Instructs Pointer Bounds Checker to instrument only functions
11339 marked with the @code{bnd_instrument} attribute
11340 (@pxref{Function Attributes}).  Disabled by default.
11342 @item -fchkp-use-wrappers
11343 @opindex fchkp-use-wrappers
11344 @opindex fno-chkp-use-wrappers
11345 Allows Pointer Bounds Checker to replace calls to built-in functions
11346 with calls to wrapper functions.  When @option{-fchkp-use-wrappers}
11347 is used to link a program, the GCC driver automatically links
11348 against @file{libmpxwrappers}.  See also @option{-static-libmpxwrappers}.
11349 Enabled by default.
11351 @item -fstack-protector
11352 @opindex fstack-protector
11353 Emit extra code to check for buffer overflows, such as stack smashing
11354 attacks.  This is done by adding a guard variable to functions with
11355 vulnerable objects.  This includes functions that call @code{alloca}, and
11356 functions with buffers larger than 8 bytes.  The guards are initialized
11357 when a function is entered and then checked when the function exits.
11358 If a guard check fails, an error message is printed and the program exits.
11360 @item -fstack-protector-all
11361 @opindex fstack-protector-all
11362 Like @option{-fstack-protector} except that all functions are protected.
11364 @item -fstack-protector-strong
11365 @opindex fstack-protector-strong
11366 Like @option{-fstack-protector} but includes additional functions to
11367 be protected --- those that have local array definitions, or have
11368 references to local frame addresses.
11370 @item -fstack-protector-explicit
11371 @opindex fstack-protector-explicit
11372 Like @option{-fstack-protector} but only protects those functions which
11373 have the @code{stack_protect} attribute.
11375 @item -fstack-check
11376 @opindex fstack-check
11377 Generate code to verify that you do not go beyond the boundary of the
11378 stack.  You should specify this flag if you are running in an
11379 environment with multiple threads, but you only rarely need to specify it in
11380 a single-threaded environment since stack overflow is automatically
11381 detected on nearly all systems if there is only one stack.
11383 Note that this switch does not actually cause checking to be done; the
11384 operating system or the language runtime must do that.  The switch causes
11385 generation of code to ensure that they see the stack being extended.
11387 You can additionally specify a string parameter: @samp{no} means no
11388 checking, @samp{generic} means force the use of old-style checking,
11389 @samp{specific} means use the best checking method and is equivalent
11390 to bare @option{-fstack-check}.
11392 Old-style checking is a generic mechanism that requires no specific
11393 target support in the compiler but comes with the following drawbacks:
11395 @enumerate
11396 @item
11397 Modified allocation strategy for large objects: they are always
11398 allocated dynamically if their size exceeds a fixed threshold.
11400 @item
11401 Fixed limit on the size of the static frame of functions: when it is
11402 topped by a particular function, stack checking is not reliable and
11403 a warning is issued by the compiler.
11405 @item
11406 Inefficiency: because of both the modified allocation strategy and the
11407 generic implementation, code performance is hampered.
11408 @end enumerate
11410 Note that old-style stack checking is also the fallback method for
11411 @samp{specific} if no target support has been added in the compiler.
11413 @item -fstack-limit-register=@var{reg}
11414 @itemx -fstack-limit-symbol=@var{sym}
11415 @itemx -fno-stack-limit
11416 @opindex fstack-limit-register
11417 @opindex fstack-limit-symbol
11418 @opindex fno-stack-limit
11419 Generate code to ensure that the stack does not grow beyond a certain value,
11420 either the value of a register or the address of a symbol.  If a larger
11421 stack is required, a signal is raised at run time.  For most targets,
11422 the signal is raised before the stack overruns the boundary, so
11423 it is possible to catch the signal without taking special precautions.
11425 For instance, if the stack starts at absolute address @samp{0x80000000}
11426 and grows downwards, you can use the flags
11427 @option{-fstack-limit-symbol=__stack_limit} and
11428 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
11429 of 128KB@.  Note that this may only work with the GNU linker.
11431 You can locally override stack limit checking by using the
11432 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
11434 @item -fsplit-stack
11435 @opindex fsplit-stack
11436 Generate code to automatically split the stack before it overflows.
11437 The resulting program has a discontiguous stack which can only
11438 overflow if the program is unable to allocate any more memory.  This
11439 is most useful when running threaded programs, as it is no longer
11440 necessary to calculate a good stack size to use for each thread.  This
11441 is currently only implemented for the x86 targets running
11442 GNU/Linux.
11444 When code compiled with @option{-fsplit-stack} calls code compiled
11445 without @option{-fsplit-stack}, there may not be much stack space
11446 available for the latter code to run.  If compiling all code,
11447 including library code, with @option{-fsplit-stack} is not an option,
11448 then the linker can fix up these calls so that the code compiled
11449 without @option{-fsplit-stack} always has a large stack.  Support for
11450 this is implemented in the gold linker in GNU binutils release 2.21
11451 and later.
11453 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
11454 @opindex fvtable-verify
11455 This option is only available when compiling C++ code.
11456 It turns on (or off, if using @option{-fvtable-verify=none}) the security
11457 feature that verifies at run time, for every virtual call, that
11458 the vtable pointer through which the call is made is valid for the type of
11459 the object, and has not been corrupted or overwritten.  If an invalid vtable
11460 pointer is detected at run time, an error is reported and execution of the
11461 program is immediately halted.
11463 This option causes run-time data structures to be built at program startup,
11464 which are used for verifying the vtable pointers.  
11465 The options @samp{std} and @samp{preinit}
11466 control the timing of when these data structures are built.  In both cases the
11467 data structures are built before execution reaches @code{main}.  Using
11468 @option{-fvtable-verify=std} causes the data structures to be built after
11469 shared libraries have been loaded and initialized.
11470 @option{-fvtable-verify=preinit} causes them to be built before shared
11471 libraries have been loaded and initialized.
11473 If this option appears multiple times in the command line with different
11474 values specified, @samp{none} takes highest priority over both @samp{std} and
11475 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
11477 @item -fvtv-debug
11478 @opindex fvtv-debug
11479 When used in conjunction with @option{-fvtable-verify=std} or 
11480 @option{-fvtable-verify=preinit}, causes debug versions of the 
11481 runtime functions for the vtable verification feature to be called.  
11482 This flag also causes the compiler to log information about which 
11483 vtable pointers it finds for each class.
11484 This information is written to a file named @file{vtv_set_ptr_data.log} 
11485 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
11486 if that is defined or the current working directory otherwise.
11488 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
11489 file, be sure to delete any existing one.
11491 @item -fvtv-counts
11492 @opindex fvtv-counts
11493 This is a debugging flag.  When used in conjunction with
11494 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
11495 causes the compiler to keep track of the total number of virtual calls
11496 it encounters and the number of verifications it inserts.  It also
11497 counts the number of calls to certain run-time library functions
11498 that it inserts and logs this information for each compilation unit.
11499 The compiler writes this information to a file named
11500 @file{vtv_count_data.log} in the directory named by the environment
11501 variable @env{VTV_LOGS_DIR} if that is defined or the current working
11502 directory otherwise.  It also counts the size of the vtable pointer sets
11503 for each class, and writes this information to @file{vtv_class_set_sizes.log}
11504 in the same directory.
11506 Note:  This feature @emph{appends} data to the log files.  To get fresh log
11507 files, be sure to delete any existing ones.
11509 @item -finstrument-functions
11510 @opindex finstrument-functions
11511 Generate instrumentation calls for entry and exit to functions.  Just
11512 after function entry and just before function exit, the following
11513 profiling functions are called with the address of the current
11514 function and its call site.  (On some platforms,
11515 @code{__builtin_return_address} does not work beyond the current
11516 function, so the call site information may not be available to the
11517 profiling functions otherwise.)
11519 @smallexample
11520 void __cyg_profile_func_enter (void *this_fn,
11521                                void *call_site);
11522 void __cyg_profile_func_exit  (void *this_fn,
11523                                void *call_site);
11524 @end smallexample
11526 The first argument is the address of the start of the current function,
11527 which may be looked up exactly in the symbol table.
11529 This instrumentation is also done for functions expanded inline in other
11530 functions.  The profiling calls indicate where, conceptually, the
11531 inline function is entered and exited.  This means that addressable
11532 versions of such functions must be available.  If all your uses of a
11533 function are expanded inline, this may mean an additional expansion of
11534 code size.  If you use @code{extern inline} in your C code, an
11535 addressable version of such functions must be provided.  (This is
11536 normally the case anyway, but if you get lucky and the optimizer always
11537 expands the functions inline, you might have gotten away without
11538 providing static copies.)
11540 A function may be given the attribute @code{no_instrument_function}, in
11541 which case this instrumentation is not done.  This can be used, for
11542 example, for the profiling functions listed above, high-priority
11543 interrupt routines, and any functions from which the profiling functions
11544 cannot safely be called (perhaps signal handlers, if the profiling
11545 routines generate output or allocate memory).
11547 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
11548 @opindex finstrument-functions-exclude-file-list
11550 Set the list of functions that are excluded from instrumentation (see
11551 the description of @option{-finstrument-functions}).  If the file that
11552 contains a function definition matches with one of @var{file}, then
11553 that function is not instrumented.  The match is done on substrings:
11554 if the @var{file} parameter is a substring of the file name, it is
11555 considered to be a match.
11557 For example:
11559 @smallexample
11560 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
11561 @end smallexample
11563 @noindent
11564 excludes any inline function defined in files whose pathnames
11565 contain @file{/bits/stl} or @file{include/sys}.
11567 If, for some reason, you want to include letter @samp{,} in one of
11568 @var{sym}, write @samp{\,}. For example,
11569 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
11570 (note the single quote surrounding the option).
11572 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
11573 @opindex finstrument-functions-exclude-function-list
11575 This is similar to @option{-finstrument-functions-exclude-file-list},
11576 but this option sets the list of function names to be excluded from
11577 instrumentation.  The function name to be matched is its user-visible
11578 name, such as @code{vector<int> blah(const vector<int> &)}, not the
11579 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
11580 match is done on substrings: if the @var{sym} parameter is a substring
11581 of the function name, it is considered to be a match.  For C99 and C++
11582 extended identifiers, the function name must be given in UTF-8, not
11583 using universal character names.
11585 @item -fpatchable-function-entry=@var{N}[,@var{M}]
11586 @opindex fpatchable-function-entry
11587 Generate @var{N} NOPs right at the beginning
11588 of each function, with the function entry point before the @var{M}th NOP.
11589 If @var{M} is omitted, it defaults to @code{0} so the
11590 function entry points to the address just at the first NOP.
11591 The NOP instructions reserve extra space which can be used to patch in
11592 any desired instrumentation at run time, provided that the code segment
11593 is writable.  The amount of space is controllable indirectly via
11594 the number of NOPs; the NOP instruction used corresponds to the instruction
11595 emitted by the internal GCC back-end interface @code{gen_nop}.  This behavior
11596 is target-specific and may also depend on the architecture variant and/or
11597 other compilation options.
11599 For run-time identification, the starting addresses of these areas,
11600 which correspond to their respective function entries minus @var{M},
11601 are additionally collected in the @code{__patchable_function_entries}
11602 section of the resulting binary.
11604 Note that the value of @code{__attribute__ ((patchable_function_entry
11605 (N,M)))} takes precedence over command-line option
11606 @option{-fpatchable-function-entry=N,M}.  This can be used to increase
11607 the area size or to remove it completely on a single function.
11608 If @code{N=0}, no pad location is recorded.
11610 The NOP instructions are inserted at---and maybe before, depending on
11611 @var{M}---the function entry address, even before the prologue.
11613 @end table
11616 @node Preprocessor Options
11617 @section Options Controlling the Preprocessor
11618 @cindex preprocessor options
11619 @cindex options, preprocessor
11621 These options control the C preprocessor, which is run on each C source
11622 file before actual compilation.
11624 If you use the @option{-E} option, nothing is done except preprocessing.
11625 Some of these options make sense only together with @option{-E} because
11626 they cause the preprocessor output to be unsuitable for actual
11627 compilation.
11629 In addition to the options listed here, there are a number of options 
11630 to control search paths for include files documented in 
11631 @ref{Directory Options}.  
11632 Options to control preprocessor diagnostics are listed in 
11633 @ref{Warning Options}.
11635 @table @gcctabopt
11636 @include cppopts.texi
11638 @item -Wp,@var{option}
11639 @opindex Wp
11640 You can use @option{-Wp,@var{option}} to bypass the compiler driver
11641 and pass @var{option} directly through to the preprocessor.  If
11642 @var{option} contains commas, it is split into multiple options at the
11643 commas.  However, many options are modified, translated or interpreted
11644 by the compiler driver before being passed to the preprocessor, and
11645 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
11646 interface is undocumented and subject to change, so whenever possible
11647 you should avoid using @option{-Wp} and let the driver handle the
11648 options instead.
11650 @item -Xpreprocessor @var{option}
11651 @opindex Xpreprocessor
11652 Pass @var{option} as an option to the preprocessor.  You can use this to
11653 supply system-specific preprocessor options that GCC does not 
11654 recognize.
11656 If you want to pass an option that takes an argument, you must use
11657 @option{-Xpreprocessor} twice, once for the option and once for the argument.
11659 @item -no-integrated-cpp
11660 @opindex no-integrated-cpp
11661 Perform preprocessing as a separate pass before compilation.
11662 By default, GCC performs preprocessing as an integrated part of
11663 input tokenization and parsing.
11664 If this option is provided, the appropriate language front end
11665 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
11666 and Objective-C, respectively) is instead invoked twice,
11667 once for preprocessing only and once for actual compilation
11668 of the preprocessed input.
11669 This option may be useful in conjunction with the @option{-B} or
11670 @option{-wrapper} options to specify an alternate preprocessor or
11671 perform additional processing of the program source between
11672 normal preprocessing and compilation.
11674 @end table
11676 @node Assembler Options
11677 @section Passing Options to the Assembler
11679 @c prevent bad page break with this line
11680 You can pass options to the assembler.
11682 @table @gcctabopt
11683 @item -Wa,@var{option}
11684 @opindex Wa
11685 Pass @var{option} as an option to the assembler.  If @var{option}
11686 contains commas, it is split into multiple options at the commas.
11688 @item -Xassembler @var{option}
11689 @opindex Xassembler
11690 Pass @var{option} as an option to the assembler.  You can use this to
11691 supply system-specific assembler options that GCC does not
11692 recognize.
11694 If you want to pass an option that takes an argument, you must use
11695 @option{-Xassembler} twice, once for the option and once for the argument.
11697 @end table
11699 @node Link Options
11700 @section Options for Linking
11701 @cindex link options
11702 @cindex options, linking
11704 These options come into play when the compiler links object files into
11705 an executable output file.  They are meaningless if the compiler is
11706 not doing a link step.
11708 @table @gcctabopt
11709 @cindex file names
11710 @item @var{object-file-name}
11711 A file name that does not end in a special recognized suffix is
11712 considered to name an object file or library.  (Object files are
11713 distinguished from libraries by the linker according to the file
11714 contents.)  If linking is done, these object files are used as input
11715 to the linker.
11717 @item -c
11718 @itemx -S
11719 @itemx -E
11720 @opindex c
11721 @opindex S
11722 @opindex E
11723 If any of these options is used, then the linker is not run, and
11724 object file names should not be used as arguments.  @xref{Overall
11725 Options}.
11727 @item -fuse-ld=bfd
11728 @opindex fuse-ld=bfd
11729 Use the @command{bfd} linker instead of the default linker.
11731 @item -fuse-ld=gold
11732 @opindex fuse-ld=gold
11733 Use the @command{gold} linker instead of the default linker.
11735 @cindex Libraries
11736 @item -l@var{library}
11737 @itemx -l @var{library}
11738 @opindex l
11739 Search the library named @var{library} when linking.  (The second
11740 alternative with the library as a separate argument is only for
11741 POSIX compliance and is not recommended.)
11743 It makes a difference where in the command you write this option; the
11744 linker searches and processes libraries and object files in the order they
11745 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
11746 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
11747 to functions in @samp{z}, those functions may not be loaded.
11749 The linker searches a standard list of directories for the library,
11750 which is actually a file named @file{lib@var{library}.a}.  The linker
11751 then uses this file as if it had been specified precisely by name.
11753 The directories searched include several standard system directories
11754 plus any that you specify with @option{-L}.
11756 Normally the files found this way are library files---archive files
11757 whose members are object files.  The linker handles an archive file by
11758 scanning through it for members which define symbols that have so far
11759 been referenced but not defined.  But if the file that is found is an
11760 ordinary object file, it is linked in the usual fashion.  The only
11761 difference between using an @option{-l} option and specifying a file name
11762 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
11763 and searches several directories.
11765 @item -lobjc
11766 @opindex lobjc
11767 You need this special case of the @option{-l} option in order to
11768 link an Objective-C or Objective-C++ program.
11770 @item -nostartfiles
11771 @opindex nostartfiles
11772 Do not use the standard system startup files when linking.
11773 The standard system libraries are used normally, unless @option{-nostdlib}
11774 or @option{-nodefaultlibs} is used.
11776 @item -nodefaultlibs
11777 @opindex nodefaultlibs
11778 Do not use the standard system libraries when linking.
11779 Only the libraries you specify are passed to the linker, and options
11780 specifying linkage of the system libraries, such as @option{-static-libgcc}
11781 or @option{-shared-libgcc}, are ignored.  
11782 The standard startup files are used normally, unless @option{-nostartfiles}
11783 is used.  
11785 The compiler may generate calls to @code{memcmp},
11786 @code{memset}, @code{memcpy} and @code{memmove}.
11787 These entries are usually resolved by entries in
11788 libc.  These entry points should be supplied through some other
11789 mechanism when this option is specified.
11791 @item -nostdlib
11792 @opindex nostdlib
11793 Do not use the standard system startup files or libraries when linking.
11794 No startup files and only the libraries you specify are passed to
11795 the linker, and options specifying linkage of the system libraries, such as
11796 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
11798 The compiler may generate calls to @code{memcmp}, @code{memset},
11799 @code{memcpy} and @code{memmove}.
11800 These entries are usually resolved by entries in
11801 libc.  These entry points should be supplied through some other
11802 mechanism when this option is specified.
11804 @cindex @option{-lgcc}, use with @option{-nostdlib}
11805 @cindex @option{-nostdlib} and unresolved references
11806 @cindex unresolved references and @option{-nostdlib}
11807 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
11808 @cindex @option{-nodefaultlibs} and unresolved references
11809 @cindex unresolved references and @option{-nodefaultlibs}
11810 One of the standard libraries bypassed by @option{-nostdlib} and
11811 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
11812 which GCC uses to overcome shortcomings of particular machines, or special
11813 needs for some languages.
11814 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
11815 Collection (GCC) Internals},
11816 for more discussion of @file{libgcc.a}.)
11817 In most cases, you need @file{libgcc.a} even when you want to avoid
11818 other standard libraries.  In other words, when you specify @option{-nostdlib}
11819 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
11820 This ensures that you have no unresolved references to internal GCC
11821 library subroutines.
11822 (An example of such an internal subroutine is @code{__main}, used to ensure C++
11823 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
11824 GNU Compiler Collection (GCC) Internals}.)
11826 @item -pie
11827 @opindex pie
11828 Produce a position independent executable on targets that support it.
11829 For predictable results, you must also specify the same set of options
11830 used for compilation (@option{-fpie}, @option{-fPIE},
11831 or model suboptions) when you specify this linker option.
11833 @item -no-pie
11834 @opindex no-pie
11835 Don't produce a position independent executable.
11837 @item -pthread
11838 @opindex pthread
11839 Link with the POSIX threads library.  This option is supported on 
11840 GNU/Linux targets, most other Unix derivatives, and also on 
11841 x86 Cygwin and MinGW targets.  On some targets this option also sets 
11842 flags for the preprocessor, so it should be used consistently for both
11843 compilation and linking.
11845 @item -rdynamic
11846 @opindex rdynamic
11847 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
11848 that support it. This instructs the linker to add all symbols, not
11849 only used ones, to the dynamic symbol table. This option is needed
11850 for some uses of @code{dlopen} or to allow obtaining backtraces
11851 from within a program.
11853 @item -s
11854 @opindex s
11855 Remove all symbol table and relocation information from the executable.
11857 @item -static
11858 @opindex static
11859 On systems that support dynamic linking, this prevents linking with the shared
11860 libraries.  On other systems, this option has no effect.
11862 @item -shared
11863 @opindex shared
11864 Produce a shared object which can then be linked with other objects to
11865 form an executable.  Not all systems support this option.  For predictable
11866 results, you must also specify the same set of options used for compilation
11867 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
11868 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
11869 needs to build supplementary stub code for constructors to work.  On
11870 multi-libbed systems, @samp{gcc -shared} must select the correct support
11871 libraries to link against.  Failing to supply the correct flags may lead
11872 to subtle defects.  Supplying them in cases where they are not necessary
11873 is innocuous.}
11875 @item -shared-libgcc
11876 @itemx -static-libgcc
11877 @opindex shared-libgcc
11878 @opindex static-libgcc
11879 On systems that provide @file{libgcc} as a shared library, these options
11880 force the use of either the shared or static version, respectively.
11881 If no shared version of @file{libgcc} was built when the compiler was
11882 configured, these options have no effect.
11884 There are several situations in which an application should use the
11885 shared @file{libgcc} instead of the static version.  The most common
11886 of these is when the application wishes to throw and catch exceptions
11887 across different shared libraries.  In that case, each of the libraries
11888 as well as the application itself should use the shared @file{libgcc}.
11890 Therefore, the G++ and driver automatically adds @option{-shared-libgcc}
11891  whenever you build a shared library or a main executable, because C++
11892  programs typically use exceptions, so this is the right thing to do.
11894 If, instead, you use the GCC driver to create shared libraries, you may
11895 find that they are not always linked with the shared @file{libgcc}.
11896 If GCC finds, at its configuration time, that you have a non-GNU linker
11897 or a GNU linker that does not support option @option{--eh-frame-hdr},
11898 it links the shared version of @file{libgcc} into shared libraries
11899 by default.  Otherwise, it takes advantage of the linker and optimizes
11900 away the linking with the shared version of @file{libgcc}, linking with
11901 the static version of libgcc by default.  This allows exceptions to
11902 propagate through such shared libraries, without incurring relocation
11903 costs at library load time.
11905 However, if a library or main executable is supposed to throw or catch
11906 exceptions, you must link it using the G++ driver, as appropriate
11907 for the languages used in the program, or using the option
11908 @option{-shared-libgcc}, such that it is linked with the shared
11909 @file{libgcc}.
11911 @item -static-libasan
11912 @opindex static-libasan
11913 When the @option{-fsanitize=address} option is used to link a program,
11914 the GCC driver automatically links against @option{libasan}.  If
11915 @file{libasan} is available as a shared library, and the @option{-static}
11916 option is not used, then this links against the shared version of
11917 @file{libasan}.  The @option{-static-libasan} option directs the GCC
11918 driver to link @file{libasan} statically, without necessarily linking
11919 other libraries statically.
11921 @item -static-libtsan
11922 @opindex static-libtsan
11923 When the @option{-fsanitize=thread} option is used to link a program,
11924 the GCC driver automatically links against @option{libtsan}.  If
11925 @file{libtsan} is available as a shared library, and the @option{-static}
11926 option is not used, then this links against the shared version of
11927 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
11928 driver to link @file{libtsan} statically, without necessarily linking
11929 other libraries statically.
11931 @item -static-liblsan
11932 @opindex static-liblsan
11933 When the @option{-fsanitize=leak} option is used to link a program,
11934 the GCC driver automatically links against @option{liblsan}.  If
11935 @file{liblsan} is available as a shared library, and the @option{-static}
11936 option is not used, then this links against the shared version of
11937 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
11938 driver to link @file{liblsan} statically, without necessarily linking
11939 other libraries statically.
11941 @item -static-libubsan
11942 @opindex static-libubsan
11943 When the @option{-fsanitize=undefined} option is used to link a program,
11944 the GCC driver automatically links against @option{libubsan}.  If
11945 @file{libubsan} is available as a shared library, and the @option{-static}
11946 option is not used, then this links against the shared version of
11947 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
11948 driver to link @file{libubsan} statically, without necessarily linking
11949 other libraries statically.
11951 @item -static-libmpx
11952 @opindex static-libmpx
11953 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are
11954 used to link a program, the GCC driver automatically links against
11955 @file{libmpx}.  If @file{libmpx} is available as a shared library,
11956 and the @option{-static} option is not used, then this links against
11957 the shared version of @file{libmpx}.  The @option{-static-libmpx}
11958 option directs the GCC driver to link @file{libmpx} statically,
11959 without necessarily linking other libraries statically.
11961 @item -static-libmpxwrappers
11962 @opindex static-libmpxwrappers
11963 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are used
11964 to link a program without also using @option{-fno-chkp-use-wrappers}, the
11965 GCC driver automatically links against @file{libmpxwrappers}.  If
11966 @file{libmpxwrappers} is available as a shared library, and the
11967 @option{-static} option is not used, then this links against the shared
11968 version of @file{libmpxwrappers}.  The @option{-static-libmpxwrappers}
11969 option directs the GCC driver to link @file{libmpxwrappers} statically,
11970 without necessarily linking other libraries statically.
11972 @item -static-libstdc++
11973 @opindex static-libstdc++
11974 When the @command{g++} program is used to link a C++ program, it
11975 normally automatically links against @option{libstdc++}.  If
11976 @file{libstdc++} is available as a shared library, and the
11977 @option{-static} option is not used, then this links against the
11978 shared version of @file{libstdc++}.  That is normally fine.  However, it
11979 is sometimes useful to freeze the version of @file{libstdc++} used by
11980 the program without going all the way to a fully static link.  The
11981 @option{-static-libstdc++} option directs the @command{g++} driver to
11982 link @file{libstdc++} statically, without necessarily linking other
11983 libraries statically.
11985 @item -symbolic
11986 @opindex symbolic
11987 Bind references to global symbols when building a shared object.  Warn
11988 about any unresolved references (unless overridden by the link editor
11989 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
11990 this option.
11992 @item -T @var{script}
11993 @opindex T
11994 @cindex linker script
11995 Use @var{script} as the linker script.  This option is supported by most
11996 systems using the GNU linker.  On some targets, such as bare-board
11997 targets without an operating system, the @option{-T} option may be required
11998 when linking to avoid references to undefined symbols.
12000 @item -Xlinker @var{option}
12001 @opindex Xlinker
12002 Pass @var{option} as an option to the linker.  You can use this to
12003 supply system-specific linker options that GCC does not recognize.
12005 If you want to pass an option that takes a separate argument, you must use
12006 @option{-Xlinker} twice, once for the option and once for the argument.
12007 For example, to pass @option{-assert definitions}, you must write
12008 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
12009 @option{-Xlinker "-assert definitions"}, because this passes the entire
12010 string as a single argument, which is not what the linker expects.
12012 When using the GNU linker, it is usually more convenient to pass
12013 arguments to linker options using the @option{@var{option}=@var{value}}
12014 syntax than as separate arguments.  For example, you can specify
12015 @option{-Xlinker -Map=output.map} rather than
12016 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
12017 this syntax for command-line options.
12019 @item -Wl,@var{option}
12020 @opindex Wl
12021 Pass @var{option} as an option to the linker.  If @var{option} contains
12022 commas, it is split into multiple options at the commas.  You can use this
12023 syntax to pass an argument to the option.
12024 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
12025 linker.  When using the GNU linker, you can also get the same effect with
12026 @option{-Wl,-Map=output.map}.
12028 @item -u @var{symbol}
12029 @opindex u
12030 Pretend the symbol @var{symbol} is undefined, to force linking of
12031 library modules to define it.  You can use @option{-u} multiple times with
12032 different symbols to force loading of additional library modules.
12034 @item -z @var{keyword}
12035 @opindex z
12036 @option{-z} is passed directly on to the linker along with the keyword
12037 @var{keyword}. See the section in the documentation of your linker for
12038 permitted values and their meanings.
12039 @end table
12041 @node Directory Options
12042 @section Options for Directory Search
12043 @cindex directory options
12044 @cindex options, directory search
12045 @cindex search path
12047 These options specify directories to search for header files, for
12048 libraries and for parts of the compiler:
12050 @table @gcctabopt
12051 @include cppdiropts.texi
12053 @item -iplugindir=@var{dir}
12054 @opindex iplugindir=
12055 Set the directory to search for plugins that are passed
12056 by @option{-fplugin=@var{name}} instead of
12057 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
12058 to be used by the user, but only passed by the driver.
12060 @item -L@var{dir}
12061 @opindex L
12062 Add directory @var{dir} to the list of directories to be searched
12063 for @option{-l}.
12065 @item -B@var{prefix}
12066 @opindex B
12067 This option specifies where to find the executables, libraries,
12068 include files, and data files of the compiler itself.
12070 The compiler driver program runs one or more of the subprograms
12071 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
12072 @var{prefix} as a prefix for each program it tries to run, both with and
12073 without @samp{@var{machine}/@var{version}/} for the corresponding target
12074 machine and compiler version.
12076 For each subprogram to be run, the compiler driver first tries the
12077 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
12078 is not specified, the driver tries two standard prefixes, 
12079 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
12080 those results in a file name that is found, the unmodified program
12081 name is searched for using the directories specified in your
12082 @env{PATH} environment variable.
12084 The compiler checks to see if the path provided by @option{-B}
12085 refers to a directory, and if necessary it adds a directory
12086 separator character at the end of the path.
12088 @option{-B} prefixes that effectively specify directory names also apply
12089 to libraries in the linker, because the compiler translates these
12090 options into @option{-L} options for the linker.  They also apply to
12091 include files in the preprocessor, because the compiler translates these
12092 options into @option{-isystem} options for the preprocessor.  In this case,
12093 the compiler appends @samp{include} to the prefix.
12095 The runtime support file @file{libgcc.a} can also be searched for using
12096 the @option{-B} prefix, if needed.  If it is not found there, the two
12097 standard prefixes above are tried, and that is all.  The file is left
12098 out of the link if it is not found by those means.
12100 Another way to specify a prefix much like the @option{-B} prefix is to use
12101 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
12102 Variables}.
12104 As a special kludge, if the path provided by @option{-B} is
12105 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
12106 9, then it is replaced by @file{[dir/]include}.  This is to help
12107 with boot-strapping the compiler.
12109 @item -no-canonical-prefixes
12110 @opindex no-canonical-prefixes
12111 Do not expand any symbolic links, resolve references to @samp{/../}
12112 or @samp{/./}, or make the path absolute when generating a relative
12113 prefix.
12115 @item --sysroot=@var{dir}
12116 @opindex sysroot
12117 Use @var{dir} as the logical root directory for headers and libraries.
12118 For example, if the compiler normally searches for headers in
12119 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
12120 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
12122 If you use both this option and the @option{-isysroot} option, then
12123 the @option{--sysroot} option applies to libraries, but the
12124 @option{-isysroot} option applies to header files.
12126 The GNU linker (beginning with version 2.16) has the necessary support
12127 for this option.  If your linker does not support this option, the
12128 header file aspect of @option{--sysroot} still works, but the
12129 library aspect does not.
12131 @item --no-sysroot-suffix
12132 @opindex no-sysroot-suffix
12133 For some targets, a suffix is added to the root directory specified
12134 with @option{--sysroot}, depending on the other options used, so that
12135 headers may for example be found in
12136 @file{@var{dir}/@var{suffix}/usr/include} instead of
12137 @file{@var{dir}/usr/include}.  This option disables the addition of
12138 such a suffix.
12140 @end table
12142 @node Code Gen Options
12143 @section Options for Code Generation Conventions
12144 @cindex code generation conventions
12145 @cindex options, code generation
12146 @cindex run-time options
12148 These machine-independent options control the interface conventions
12149 used in code generation.
12151 Most of them have both positive and negative forms; the negative form
12152 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
12153 one of the forms is listed---the one that is not the default.  You
12154 can figure out the other form by either removing @samp{no-} or adding
12157 @table @gcctabopt
12158 @item -fstack-reuse=@var{reuse-level}
12159 @opindex fstack_reuse
12160 This option controls stack space reuse for user declared local/auto variables
12161 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
12162 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
12163 local variables and temporaries, @samp{named_vars} enables the reuse only for
12164 user defined local variables with names, and @samp{none} disables stack reuse
12165 completely. The default value is @samp{all}. The option is needed when the
12166 program extends the lifetime of a scoped local variable or a compiler generated
12167 temporary beyond the end point defined by the language.  When a lifetime of
12168 a variable ends, and if the variable lives in memory, the optimizing compiler
12169 has the freedom to reuse its stack space with other temporaries or scoped
12170 local variables whose live range does not overlap with it. Legacy code extending
12171 local lifetime is likely to break with the stack reuse optimization.
12173 For example,
12175 @smallexample
12176    int *p;
12177    @{
12178      int local1;
12180      p = &local1;
12181      local1 = 10;
12182      ....
12183    @}
12184    @{
12185       int local2;
12186       local2 = 20;
12187       ...
12188    @}
12190    if (*p == 10)  // out of scope use of local1
12191      @{
12193      @}
12194 @end smallexample
12196 Another example:
12197 @smallexample
12199    struct A
12200    @{
12201        A(int k) : i(k), j(k) @{ @}
12202        int i;
12203        int j;
12204    @};
12206    A *ap;
12208    void foo(const A& ar)
12209    @{
12210       ap = &ar;
12211    @}
12213    void bar()
12214    @{
12215       foo(A(10)); // temp object's lifetime ends when foo returns
12217       @{
12218         A a(20);
12219         ....
12220       @}
12221       ap->i+= 10;  // ap references out of scope temp whose space
12222                    // is reused with a. What is the value of ap->i?
12223    @}
12225 @end smallexample
12227 The lifetime of a compiler generated temporary is well defined by the C++
12228 standard. When a lifetime of a temporary ends, and if the temporary lives
12229 in memory, the optimizing compiler has the freedom to reuse its stack
12230 space with other temporaries or scoped local variables whose live range
12231 does not overlap with it. However some of the legacy code relies on
12232 the behavior of older compilers in which temporaries' stack space is
12233 not reused, the aggressive stack reuse can lead to runtime errors. This
12234 option is used to control the temporary stack reuse optimization.
12236 @item -ftrapv
12237 @opindex ftrapv
12238 This option generates traps for signed overflow on addition, subtraction,
12239 multiplication operations.
12240 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
12241 @option{-ftrapv} @option{-fwrapv} on the command-line results in
12242 @option{-fwrapv} being effective.  Note that only active options override, so
12243 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
12244 results in @option{-ftrapv} being effective.
12246 @item -fwrapv
12247 @opindex fwrapv
12248 This option instructs the compiler to assume that signed arithmetic
12249 overflow of addition, subtraction and multiplication wraps around
12250 using twos-complement representation.  This flag enables some optimizations
12251 and disables others.
12252 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
12253 @option{-ftrapv} @option{-fwrapv} on the command-line results in
12254 @option{-fwrapv} being effective.  Note that only active options override, so
12255 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
12256 results in @option{-ftrapv} being effective.
12258 @item -fexceptions
12259 @opindex fexceptions
12260 Enable exception handling.  Generates extra code needed to propagate
12261 exceptions.  For some targets, this implies GCC generates frame
12262 unwind information for all functions, which can produce significant data
12263 size overhead, although it does not affect execution.  If you do not
12264 specify this option, GCC enables it by default for languages like
12265 C++ that normally require exception handling, and disables it for
12266 languages like C that do not normally require it.  However, you may need
12267 to enable this option when compiling C code that needs to interoperate
12268 properly with exception handlers written in C++.  You may also wish to
12269 disable this option if you are compiling older C++ programs that don't
12270 use exception handling.
12272 @item -fnon-call-exceptions
12273 @opindex fnon-call-exceptions
12274 Generate code that allows trapping instructions to throw exceptions.
12275 Note that this requires platform-specific runtime support that does
12276 not exist everywhere.  Moreover, it only allows @emph{trapping}
12277 instructions to throw exceptions, i.e.@: memory references or floating-point
12278 instructions.  It does not allow exceptions to be thrown from
12279 arbitrary signal handlers such as @code{SIGALRM}.
12281 @item -fdelete-dead-exceptions
12282 @opindex fdelete-dead-exceptions
12283 Consider that instructions that may throw exceptions but don't otherwise
12284 contribute to the execution of the program can be optimized away.
12285 This option is enabled by default for the Ada front end, as permitted by
12286 the Ada language specification.
12287 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
12289 @item -funwind-tables
12290 @opindex funwind-tables
12291 Similar to @option{-fexceptions}, except that it just generates any needed
12292 static data, but does not affect the generated code in any other way.
12293 You normally do not need to enable this option; instead, a language processor
12294 that needs this handling enables it on your behalf.
12296 @item -fasynchronous-unwind-tables
12297 @opindex fasynchronous-unwind-tables
12298 Generate unwind table in DWARF format, if supported by target machine.  The
12299 table is exact at each instruction boundary, so it can be used for stack
12300 unwinding from asynchronous events (such as debugger or garbage collector).
12302 @item -fno-gnu-unique
12303 @opindex fno-gnu-unique
12304 On systems with recent GNU assembler and C library, the C++ compiler
12305 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
12306 of template static data members and static local variables in inline
12307 functions are unique even in the presence of @code{RTLD_LOCAL}; this
12308 is necessary to avoid problems with a library used by two different
12309 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
12310 therefore disagreeing with the other one about the binding of the
12311 symbol.  But this causes @code{dlclose} to be ignored for affected
12312 DSOs; if your program relies on reinitialization of a DSO via
12313 @code{dlclose} and @code{dlopen}, you can use
12314 @option{-fno-gnu-unique}.
12316 @item -fpcc-struct-return
12317 @opindex fpcc-struct-return
12318 Return ``short'' @code{struct} and @code{union} values in memory like
12319 longer ones, rather than in registers.  This convention is less
12320 efficient, but it has the advantage of allowing intercallability between
12321 GCC-compiled files and files compiled with other compilers, particularly
12322 the Portable C Compiler (pcc).
12324 The precise convention for returning structures in memory depends
12325 on the target configuration macros.
12327 Short structures and unions are those whose size and alignment match
12328 that of some integer type.
12330 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
12331 switch is not binary compatible with code compiled with the
12332 @option{-freg-struct-return} switch.
12333 Use it to conform to a non-default application binary interface.
12335 @item -freg-struct-return
12336 @opindex freg-struct-return
12337 Return @code{struct} and @code{union} values in registers when possible.
12338 This is more efficient for small structures than
12339 @option{-fpcc-struct-return}.
12341 If you specify neither @option{-fpcc-struct-return} nor
12342 @option{-freg-struct-return}, GCC defaults to whichever convention is
12343 standard for the target.  If there is no standard convention, GCC
12344 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
12345 the principal compiler.  In those cases, we can choose the standard, and
12346 we chose the more efficient register return alternative.
12348 @strong{Warning:} code compiled with the @option{-freg-struct-return}
12349 switch is not binary compatible with code compiled with the
12350 @option{-fpcc-struct-return} switch.
12351 Use it to conform to a non-default application binary interface.
12353 @item -fshort-enums
12354 @opindex fshort-enums
12355 Allocate to an @code{enum} type only as many bytes as it needs for the
12356 declared range of possible values.  Specifically, the @code{enum} type
12357 is equivalent to the smallest integer type that has enough room.
12359 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
12360 code that is not binary compatible with code generated without that switch.
12361 Use it to conform to a non-default application binary interface.
12363 @item -fshort-wchar
12364 @opindex fshort-wchar
12365 Override the underlying type for @code{wchar_t} to be @code{short
12366 unsigned int} instead of the default for the target.  This option is
12367 useful for building programs to run under WINE@.
12369 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
12370 code that is not binary compatible with code generated without that switch.
12371 Use it to conform to a non-default application binary interface.
12373 @item -fno-common
12374 @opindex fno-common
12375 @cindex tentative definitions
12376 In C code, this option controls the placement of global variables 
12377 defined without an initializer, known as @dfn{tentative definitions} 
12378 in the C standard.  Tentative definitions are distinct from declarations 
12379 of a variable with the @code{extern} keyword, which do not allocate storage.
12381 Unix C compilers have traditionally allocated storage for
12382 uninitialized global variables in a common block.  This allows the
12383 linker to resolve all tentative definitions of the same variable
12384 in different compilation units to the same object, or to a non-tentative
12385 definition.  
12386 This is the behavior specified by @option{-fcommon}, and is the default for 
12387 GCC on most targets.  
12388 On the other hand, this behavior is not required by ISO
12389 C, and on some targets may carry a speed or code size penalty on
12390 variable references.
12392 The @option{-fno-common} option specifies that the compiler should instead
12393 place uninitialized global variables in the data section of the object file.
12394 This inhibits the merging of tentative definitions by the linker so
12395 you get a multiple-definition error if the same 
12396 variable is defined in more than one compilation unit.
12397 Compiling with @option{-fno-common} is useful on targets for which
12398 it provides better performance, or if you wish to verify that the
12399 program will work on other systems that always treat uninitialized
12400 variable definitions this way.
12402 @item -fno-ident
12403 @opindex fno-ident
12404 Ignore the @code{#ident} directive.
12406 @item -finhibit-size-directive
12407 @opindex finhibit-size-directive
12408 Don't output a @code{.size} assembler directive, or anything else that
12409 would cause trouble if the function is split in the middle, and the
12410 two halves are placed at locations far apart in memory.  This option is
12411 used when compiling @file{crtstuff.c}; you should not need to use it
12412 for anything else.
12414 @item -fverbose-asm
12415 @opindex fverbose-asm
12416 Put extra commentary information in the generated assembly code to
12417 make it more readable.  This option is generally only of use to those
12418 who actually need to read the generated assembly code (perhaps while
12419 debugging the compiler itself).
12421 @option{-fno-verbose-asm}, the default, causes the
12422 extra information to be omitted and is useful when comparing two assembler
12423 files.
12425 The added comments include:
12427 @itemize @bullet
12429 @item
12430 information on the compiler version and command-line options,
12432 @item
12433 the source code lines associated with the assembly instructions,
12434 in the form FILENAME:LINENUMBER:CONTENT OF LINE,
12436 @item
12437 hints on which high-level expressions correspond to
12438 the various assembly instruction operands.
12440 @end itemize
12442 For example, given this C source file:
12444 @smallexample
12445 int test (int n)
12447   int i;
12448   int total = 0;
12450   for (i = 0; i < n; i++)
12451     total += i * i;
12453   return total;
12455 @end smallexample
12457 compiling to (x86_64) assembly via @option{-S} and emitting the result
12458 direct to stdout via @option{-o} @option{-}
12460 @smallexample
12461 gcc -S test.c -fverbose-asm -Os -o -
12462 @end smallexample
12464 gives output similar to this:
12466 @smallexample
12467         .file   "test.c"
12468 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
12469   [...snip...]
12470 # options passed:
12471   [...snip...]
12473         .text
12474         .globl  test
12475         .type   test, @@function
12476 test:
12477 .LFB0:
12478         .cfi_startproc
12479 # test.c:4:   int total = 0;
12480         xorl    %eax, %eax      # <retval>
12481 # test.c:6:   for (i = 0; i < n; i++)
12482         xorl    %edx, %edx      # i
12483 .L2:
12484 # test.c:6:   for (i = 0; i < n; i++)
12485         cmpl    %edi, %edx      # n, i
12486         jge     .L5     #,
12487 # test.c:7:     total += i * i;
12488         movl    %edx, %ecx      # i, tmp92
12489         imull   %edx, %ecx      # i, tmp92
12490 # test.c:6:   for (i = 0; i < n; i++)
12491         incl    %edx    # i
12492 # test.c:7:     total += i * i;
12493         addl    %ecx, %eax      # tmp92, <retval>
12494         jmp     .L2     #
12495 .L5:
12496 # test.c:10: @}
12497         ret
12498         .cfi_endproc
12499 .LFE0:
12500         .size   test, .-test
12501         .ident  "GCC: (GNU) 7.0.0 20160809 (experimental)"
12502         .section        .note.GNU-stack,"",@@progbits
12503 @end smallexample
12505 The comments are intended for humans rather than machines and hence the
12506 precise format of the comments is subject to change.
12508 @item -frecord-gcc-switches
12509 @opindex frecord-gcc-switches
12510 This switch causes the command line used to invoke the
12511 compiler to be recorded into the object file that is being created.
12512 This switch is only implemented on some targets and the exact format
12513 of the recording is target and binary file format dependent, but it
12514 usually takes the form of a section containing ASCII text.  This
12515 switch is related to the @option{-fverbose-asm} switch, but that
12516 switch only records information in the assembler output file as
12517 comments, so it never reaches the object file.
12518 See also @option{-grecord-gcc-switches} for another
12519 way of storing compiler options into the object file.
12521 @item -fpic
12522 @opindex fpic
12523 @cindex global offset table
12524 @cindex PIC
12525 Generate position-independent code (PIC) suitable for use in a shared
12526 library, if supported for the target machine.  Such code accesses all
12527 constant addresses through a global offset table (GOT)@.  The dynamic
12528 loader resolves the GOT entries when the program starts (the dynamic
12529 loader is not part of GCC; it is part of the operating system).  If
12530 the GOT size for the linked executable exceeds a machine-specific
12531 maximum size, you get an error message from the linker indicating that
12532 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
12533 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
12534 on the m68k and RS/6000.  The x86 has no such limit.)
12536 Position-independent code requires special support, and therefore works
12537 only on certain machines.  For the x86, GCC supports PIC for System V
12538 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
12539 position-independent.
12541 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
12542 are defined to 1.
12544 @item -fPIC
12545 @opindex fPIC
12546 If supported for the target machine, emit position-independent code,
12547 suitable for dynamic linking and avoiding any limit on the size of the
12548 global offset table.  This option makes a difference on AArch64, m68k,
12549 PowerPC and SPARC@.
12551 Position-independent code requires special support, and therefore works
12552 only on certain machines.
12554 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
12555 are defined to 2.
12557 @item -fpie
12558 @itemx -fPIE
12559 @opindex fpie
12560 @opindex fPIE
12561 These options are similar to @option{-fpic} and @option{-fPIC}, but
12562 generated position independent code can be only linked into executables.
12563 Usually these options are used when @option{-pie} GCC option is
12564 used during linking.
12566 @option{-fpie} and @option{-fPIE} both define the macros
12567 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
12568 for @option{-fpie} and 2 for @option{-fPIE}.
12570 @item -fno-plt
12571 @opindex fno-plt
12572 Do not use the PLT for external function calls in position-independent code.
12573 Instead, load the callee address at call sites from the GOT and branch to it.
12574 This leads to more efficient code by eliminating PLT stubs and exposing
12575 GOT loads to optimizations.  On architectures such as 32-bit x86 where
12576 PLT stubs expect the GOT pointer in a specific register, this gives more
12577 register allocation freedom to the compiler.
12578 Lazy binding requires use of the PLT; 
12579 with @option{-fno-plt} all external symbols are resolved at load time.
12581 Alternatively, the function attribute @code{noplt} can be used to avoid calls
12582 through the PLT for specific external functions.
12584 In position-dependent code, a few targets also convert calls to
12585 functions that are marked to not use the PLT to use the GOT instead.
12587 @item -fno-jump-tables
12588 @opindex fno-jump-tables
12589 Do not use jump tables for switch statements even where it would be
12590 more efficient than other code generation strategies.  This option is
12591 of use in conjunction with @option{-fpic} or @option{-fPIC} for
12592 building code that forms part of a dynamic linker and cannot
12593 reference the address of a jump table.  On some targets, jump tables
12594 do not require a GOT and this option is not needed.
12596 @item -ffixed-@var{reg}
12597 @opindex ffixed
12598 Treat the register named @var{reg} as a fixed register; generated code
12599 should never refer to it (except perhaps as a stack pointer, frame
12600 pointer or in some other fixed role).
12602 @var{reg} must be the name of a register.  The register names accepted
12603 are machine-specific and are defined in the @code{REGISTER_NAMES}
12604 macro in the machine description macro file.
12606 This flag does not have a negative form, because it specifies a
12607 three-way choice.
12609 @item -fcall-used-@var{reg}
12610 @opindex fcall-used
12611 Treat the register named @var{reg} as an allocable register that is
12612 clobbered by function calls.  It may be allocated for temporaries or
12613 variables that do not live across a call.  Functions compiled this way
12614 do not save and restore the register @var{reg}.
12616 It is an error to use this flag with the frame pointer or stack pointer.
12617 Use of this flag for other registers that have fixed pervasive roles in
12618 the machine's execution model produces disastrous results.
12620 This flag does not have a negative form, because it specifies a
12621 three-way choice.
12623 @item -fcall-saved-@var{reg}
12624 @opindex fcall-saved
12625 Treat the register named @var{reg} as an allocable register saved by
12626 functions.  It may be allocated even for temporaries or variables that
12627 live across a call.  Functions compiled this way save and restore
12628 the register @var{reg} if they use it.
12630 It is an error to use this flag with the frame pointer or stack pointer.
12631 Use of this flag for other registers that have fixed pervasive roles in
12632 the machine's execution model produces disastrous results.
12634 A different sort of disaster results from the use of this flag for
12635 a register in which function values may be returned.
12637 This flag does not have a negative form, because it specifies a
12638 three-way choice.
12640 @item -fpack-struct[=@var{n}]
12641 @opindex fpack-struct
12642 Without a value specified, pack all structure members together without
12643 holes.  When a value is specified (which must be a small power of two), pack
12644 structure members according to this value, representing the maximum
12645 alignment (that is, objects with default alignment requirements larger than
12646 this are output potentially unaligned at the next fitting location.
12648 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
12649 code that is not binary compatible with code generated without that switch.
12650 Additionally, it makes the code suboptimal.
12651 Use it to conform to a non-default application binary interface.
12653 @item -fleading-underscore
12654 @opindex fleading-underscore
12655 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
12656 change the way C symbols are represented in the object file.  One use
12657 is to help link with legacy assembly code.
12659 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
12660 generate code that is not binary compatible with code generated without that
12661 switch.  Use it to conform to a non-default application binary interface.
12662 Not all targets provide complete support for this switch.
12664 @item -ftls-model=@var{model}
12665 @opindex ftls-model
12666 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
12667 The @var{model} argument should be one of @samp{global-dynamic},
12668 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
12669 Note that the choice is subject to optimization: the compiler may use
12670 a more efficient model for symbols not visible outside of the translation
12671 unit, or if @option{-fpic} is not given on the command line.
12673 The default without @option{-fpic} is @samp{initial-exec}; with
12674 @option{-fpic} the default is @samp{global-dynamic}.
12676 @item -ftrampolines
12677 @opindex ftrampolines
12678 For targets that normally need trampolines for nested functions, always
12679 generate them instead of using descriptors.  Otherwise, for targets that
12680 do not need them, like for example HP-PA or IA-64, do nothing.
12682 A trampoline is a small piece of code that is created at run time on the
12683 stack when the address of a nested function is taken, and is used to call
12684 the nested function indirectly.  Therefore, it requires the stack to be
12685 made executable in order for the program to work properly.
12687 @option{-fno-trampolines} is enabled by default on a language by language
12688 basis to let the compiler avoid generating them, if it computes that this
12689 is safe, and replace them with descriptors.  Descriptors are made up of data
12690 only, but the generated code must be prepared to deal with them.  As of this
12691 writing, @option{-fno-trampolines} is enabled by default only for Ada.
12693 Moreover, code compiled with @option{-ftrampolines} and code compiled with
12694 @option{-fno-trampolines} are not binary compatible if nested functions are
12695 present.  This option must therefore be used on a program-wide basis and be
12696 manipulated with extreme care.
12698 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
12699 @opindex fvisibility
12700 Set the default ELF image symbol visibility to the specified option---all
12701 symbols are marked with this unless overridden within the code.
12702 Using this feature can very substantially improve linking and
12703 load times of shared object libraries, produce more optimized
12704 code, provide near-perfect API export and prevent symbol clashes.
12705 It is @strong{strongly} recommended that you use this in any shared objects
12706 you distribute.
12708 Despite the nomenclature, @samp{default} always means public; i.e.,
12709 available to be linked against from outside the shared object.
12710 @samp{protected} and @samp{internal} are pretty useless in real-world
12711 usage so the only other commonly used option is @samp{hidden}.
12712 The default if @option{-fvisibility} isn't specified is
12713 @samp{default}, i.e., make every symbol public.
12715 A good explanation of the benefits offered by ensuring ELF
12716 symbols have the correct visibility is given by ``How To Write
12717 Shared Libraries'' by Ulrich Drepper (which can be found at
12718 @w{@uref{https://www.akkadia.org/drepper/}})---however a superior
12719 solution made possible by this option to marking things hidden when
12720 the default is public is to make the default hidden and mark things
12721 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
12722 and @code{__attribute__ ((visibility("default")))} instead of
12723 @code{__declspec(dllexport)} you get almost identical semantics with
12724 identical syntax.  This is a great boon to those working with
12725 cross-platform projects.
12727 For those adding visibility support to existing code, you may find
12728 @code{#pragma GCC visibility} of use.  This works by you enclosing
12729 the declarations you wish to set visibility for with (for example)
12730 @code{#pragma GCC visibility push(hidden)} and
12731 @code{#pragma GCC visibility pop}.
12732 Bear in mind that symbol visibility should be viewed @strong{as
12733 part of the API interface contract} and thus all new code should
12734 always specify visibility when it is not the default; i.e., declarations
12735 only for use within the local DSO should @strong{always} be marked explicitly
12736 as hidden as so to avoid PLT indirection overheads---making this
12737 abundantly clear also aids readability and self-documentation of the code.
12738 Note that due to ISO C++ specification requirements, @code{operator new} and
12739 @code{operator delete} must always be of default visibility.
12741 Be aware that headers from outside your project, in particular system
12742 headers and headers from any other library you use, may not be
12743 expecting to be compiled with visibility other than the default.  You
12744 may need to explicitly say @code{#pragma GCC visibility push(default)}
12745 before including any such headers.
12747 @code{extern} declarations are not affected by @option{-fvisibility}, so
12748 a lot of code can be recompiled with @option{-fvisibility=hidden} with
12749 no modifications.  However, this means that calls to @code{extern}
12750 functions with no explicit visibility use the PLT, so it is more
12751 effective to use @code{__attribute ((visibility))} and/or
12752 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
12753 declarations should be treated as hidden.
12755 Note that @option{-fvisibility} does affect C++ vague linkage
12756 entities. This means that, for instance, an exception class that is
12757 be thrown between DSOs must be explicitly marked with default
12758 visibility so that the @samp{type_info} nodes are unified between
12759 the DSOs.
12761 An overview of these techniques, their benefits and how to use them
12762 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
12764 @item -fstrict-volatile-bitfields
12765 @opindex fstrict-volatile-bitfields
12766 This option should be used if accesses to volatile bit-fields (or other
12767 structure fields, although the compiler usually honors those types
12768 anyway) should use a single access of the width of the
12769 field's type, aligned to a natural alignment if possible.  For
12770 example, targets with memory-mapped peripheral registers might require
12771 all such accesses to be 16 bits wide; with this flag you can
12772 declare all peripheral bit-fields as @code{unsigned short} (assuming short
12773 is 16 bits on these targets) to force GCC to use 16-bit accesses
12774 instead of, perhaps, a more efficient 32-bit access.
12776 If this option is disabled, the compiler uses the most efficient
12777 instruction.  In the previous example, that might be a 32-bit load
12778 instruction, even though that accesses bytes that do not contain
12779 any portion of the bit-field, or memory-mapped registers unrelated to
12780 the one being updated.
12782 In some cases, such as when the @code{packed} attribute is applied to a 
12783 structure field, it may not be possible to access the field with a single
12784 read or write that is correctly aligned for the target machine.  In this
12785 case GCC falls back to generating multiple accesses rather than code that 
12786 will fault or truncate the result at run time.
12788 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
12789 not allowed to touch non bit-field members.  It is therefore recommended
12790 to define all bits of the field's type as bit-field members.
12792 The default value of this option is determined by the application binary
12793 interface for the target processor.
12795 @item -fsync-libcalls
12796 @opindex fsync-libcalls
12797 This option controls whether any out-of-line instance of the @code{__sync}
12798 family of functions may be used to implement the C++11 @code{__atomic}
12799 family of functions.
12801 The default value of this option is enabled, thus the only useful form
12802 of the option is @option{-fno-sync-libcalls}.  This option is used in
12803 the implementation of the @file{libatomic} runtime library.
12805 @end table
12807 @node Developer Options
12808 @section GCC Developer Options
12809 @cindex developer options
12810 @cindex debugging GCC
12811 @cindex debug dump options
12812 @cindex dump options
12813 @cindex compilation statistics
12815 This section describes command-line options that are primarily of
12816 interest to GCC developers, including options to support compiler
12817 testing and investigation of compiler bugs and compile-time
12818 performance problems.  This includes options that produce debug dumps
12819 at various points in the compilation; that print statistics such as
12820 memory use and execution time; and that print information about GCC's
12821 configuration, such as where it searches for libraries.  You should
12822 rarely need to use any of these options for ordinary compilation and
12823 linking tasks.
12825 @table @gcctabopt
12827 @item -d@var{letters}
12828 @itemx -fdump-rtl-@var{pass}
12829 @itemx -fdump-rtl-@var{pass}=@var{filename}
12830 @opindex d
12831 @opindex fdump-rtl-@var{pass}
12832 Says to make debugging dumps during compilation at times specified by
12833 @var{letters}.  This is used for debugging the RTL-based passes of the
12834 compiler.  The file names for most of the dumps are made by appending
12835 a pass number and a word to the @var{dumpname}, and the files are
12836 created in the directory of the output file.  In case of
12837 @option{=@var{filename}} option, the dump is output on the given file
12838 instead of the pass numbered dump files.  Note that the pass number is
12839 assigned as passes are registered into the pass manager.  Most passes
12840 are registered in the order that they will execute and for these passes
12841 the number corresponds to the pass execution order.  However, passes
12842 registered by plugins, passes specific to compilation targets, or
12843 passes that are otherwise registered after all the other passes are
12844 numbered higher than a pass named "final", even if they are executed
12845 earlier.  @var{dumpname} is generated from the name of the output
12846 file if explicitly specified and not an executable, otherwise it is
12847 the basename of the source file.  
12849 Some @option{-d@var{letters}} switches have different meaning when
12850 @option{-E} is used for preprocessing.  @xref{Preprocessor Options},
12851 for information about preprocessor-specific dump options.
12853 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
12854 @option{-d} option @var{letters}.  Here are the possible
12855 letters for use in @var{pass} and @var{letters}, and their meanings:
12857 @table @gcctabopt
12859 @item -fdump-rtl-alignments
12860 @opindex fdump-rtl-alignments
12861 Dump after branch alignments have been computed.
12863 @item -fdump-rtl-asmcons
12864 @opindex fdump-rtl-asmcons
12865 Dump after fixing rtl statements that have unsatisfied in/out constraints.
12867 @item -fdump-rtl-auto_inc_dec
12868 @opindex fdump-rtl-auto_inc_dec
12869 Dump after auto-inc-dec discovery.  This pass is only run on
12870 architectures that have auto inc or auto dec instructions.
12872 @item -fdump-rtl-barriers
12873 @opindex fdump-rtl-barriers
12874 Dump after cleaning up the barrier instructions.
12876 @item -fdump-rtl-bbpart
12877 @opindex fdump-rtl-bbpart
12878 Dump after partitioning hot and cold basic blocks.
12880 @item -fdump-rtl-bbro
12881 @opindex fdump-rtl-bbro
12882 Dump after block reordering.
12884 @item -fdump-rtl-btl1
12885 @itemx -fdump-rtl-btl2
12886 @opindex fdump-rtl-btl2
12887 @opindex fdump-rtl-btl2
12888 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
12889 after the two branch
12890 target load optimization passes.
12892 @item -fdump-rtl-bypass
12893 @opindex fdump-rtl-bypass
12894 Dump after jump bypassing and control flow optimizations.
12896 @item -fdump-rtl-combine
12897 @opindex fdump-rtl-combine
12898 Dump after the RTL instruction combination pass.
12900 @item -fdump-rtl-compgotos
12901 @opindex fdump-rtl-compgotos
12902 Dump after duplicating the computed gotos.
12904 @item -fdump-rtl-ce1
12905 @itemx -fdump-rtl-ce2
12906 @itemx -fdump-rtl-ce3
12907 @opindex fdump-rtl-ce1
12908 @opindex fdump-rtl-ce2
12909 @opindex fdump-rtl-ce3
12910 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
12911 @option{-fdump-rtl-ce3} enable dumping after the three
12912 if conversion passes.
12914 @item -fdump-rtl-cprop_hardreg
12915 @opindex fdump-rtl-cprop_hardreg
12916 Dump after hard register copy propagation.
12918 @item -fdump-rtl-csa
12919 @opindex fdump-rtl-csa
12920 Dump after combining stack adjustments.
12922 @item -fdump-rtl-cse1
12923 @itemx -fdump-rtl-cse2
12924 @opindex fdump-rtl-cse1
12925 @opindex fdump-rtl-cse2
12926 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
12927 the two common subexpression elimination passes.
12929 @item -fdump-rtl-dce
12930 @opindex fdump-rtl-dce
12931 Dump after the standalone dead code elimination passes.
12933 @item -fdump-rtl-dbr
12934 @opindex fdump-rtl-dbr
12935 Dump after delayed branch scheduling.
12937 @item -fdump-rtl-dce1
12938 @itemx -fdump-rtl-dce2
12939 @opindex fdump-rtl-dce1
12940 @opindex fdump-rtl-dce2
12941 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
12942 the two dead store elimination passes.
12944 @item -fdump-rtl-eh
12945 @opindex fdump-rtl-eh
12946 Dump after finalization of EH handling code.
12948 @item -fdump-rtl-eh_ranges
12949 @opindex fdump-rtl-eh_ranges
12950 Dump after conversion of EH handling range regions.
12952 @item -fdump-rtl-expand
12953 @opindex fdump-rtl-expand
12954 Dump after RTL generation.
12956 @item -fdump-rtl-fwprop1
12957 @itemx -fdump-rtl-fwprop2
12958 @opindex fdump-rtl-fwprop1
12959 @opindex fdump-rtl-fwprop2
12960 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
12961 dumping after the two forward propagation passes.
12963 @item -fdump-rtl-gcse1
12964 @itemx -fdump-rtl-gcse2
12965 @opindex fdump-rtl-gcse1
12966 @opindex fdump-rtl-gcse2
12967 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
12968 after global common subexpression elimination.
12970 @item -fdump-rtl-init-regs
12971 @opindex fdump-rtl-init-regs
12972 Dump after the initialization of the registers.
12974 @item -fdump-rtl-initvals
12975 @opindex fdump-rtl-initvals
12976 Dump after the computation of the initial value sets.
12978 @item -fdump-rtl-into_cfglayout
12979 @opindex fdump-rtl-into_cfglayout
12980 Dump after converting to cfglayout mode.
12982 @item -fdump-rtl-ira
12983 @opindex fdump-rtl-ira
12984 Dump after iterated register allocation.
12986 @item -fdump-rtl-jump
12987 @opindex fdump-rtl-jump
12988 Dump after the second jump optimization.
12990 @item -fdump-rtl-loop2
12991 @opindex fdump-rtl-loop2
12992 @option{-fdump-rtl-loop2} enables dumping after the rtl
12993 loop optimization passes.
12995 @item -fdump-rtl-mach
12996 @opindex fdump-rtl-mach
12997 Dump after performing the machine dependent reorganization pass, if that
12998 pass exists.
13000 @item -fdump-rtl-mode_sw
13001 @opindex fdump-rtl-mode_sw
13002 Dump after removing redundant mode switches.
13004 @item -fdump-rtl-rnreg
13005 @opindex fdump-rtl-rnreg
13006 Dump after register renumbering.
13008 @item -fdump-rtl-outof_cfglayout
13009 @opindex fdump-rtl-outof_cfglayout
13010 Dump after converting from cfglayout mode.
13012 @item -fdump-rtl-peephole2
13013 @opindex fdump-rtl-peephole2
13014 Dump after the peephole pass.
13016 @item -fdump-rtl-postreload
13017 @opindex fdump-rtl-postreload
13018 Dump after post-reload optimizations.
13020 @item -fdump-rtl-pro_and_epilogue
13021 @opindex fdump-rtl-pro_and_epilogue
13022 Dump after generating the function prologues and epilogues.
13024 @item -fdump-rtl-sched1
13025 @itemx -fdump-rtl-sched2
13026 @opindex fdump-rtl-sched1
13027 @opindex fdump-rtl-sched2
13028 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
13029 after the basic block scheduling passes.
13031 @item -fdump-rtl-ree
13032 @opindex fdump-rtl-ree
13033 Dump after sign/zero extension elimination.
13035 @item -fdump-rtl-seqabstr
13036 @opindex fdump-rtl-seqabstr
13037 Dump after common sequence discovery.
13039 @item -fdump-rtl-shorten
13040 @opindex fdump-rtl-shorten
13041 Dump after shortening branches.
13043 @item -fdump-rtl-sibling
13044 @opindex fdump-rtl-sibling
13045 Dump after sibling call optimizations.
13047 @item -fdump-rtl-split1
13048 @itemx -fdump-rtl-split2
13049 @itemx -fdump-rtl-split3
13050 @itemx -fdump-rtl-split4
13051 @itemx -fdump-rtl-split5
13052 @opindex fdump-rtl-split1
13053 @opindex fdump-rtl-split2
13054 @opindex fdump-rtl-split3
13055 @opindex fdump-rtl-split4
13056 @opindex fdump-rtl-split5
13057 These options enable dumping after five rounds of
13058 instruction splitting.
13060 @item -fdump-rtl-sms
13061 @opindex fdump-rtl-sms
13062 Dump after modulo scheduling.  This pass is only run on some
13063 architectures.
13065 @item -fdump-rtl-stack
13066 @opindex fdump-rtl-stack
13067 Dump after conversion from GCC's ``flat register file'' registers to the
13068 x87's stack-like registers.  This pass is only run on x86 variants.
13070 @item -fdump-rtl-subreg1
13071 @itemx -fdump-rtl-subreg2
13072 @opindex fdump-rtl-subreg1
13073 @opindex fdump-rtl-subreg2
13074 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
13075 the two subreg expansion passes.
13077 @item -fdump-rtl-unshare
13078 @opindex fdump-rtl-unshare
13079 Dump after all rtl has been unshared.
13081 @item -fdump-rtl-vartrack
13082 @opindex fdump-rtl-vartrack
13083 Dump after variable tracking.
13085 @item -fdump-rtl-vregs
13086 @opindex fdump-rtl-vregs
13087 Dump after converting virtual registers to hard registers.
13089 @item -fdump-rtl-web
13090 @opindex fdump-rtl-web
13091 Dump after live range splitting.
13093 @item -fdump-rtl-regclass
13094 @itemx -fdump-rtl-subregs_of_mode_init
13095 @itemx -fdump-rtl-subregs_of_mode_finish
13096 @itemx -fdump-rtl-dfinit
13097 @itemx -fdump-rtl-dfinish
13098 @opindex fdump-rtl-regclass
13099 @opindex fdump-rtl-subregs_of_mode_init
13100 @opindex fdump-rtl-subregs_of_mode_finish
13101 @opindex fdump-rtl-dfinit
13102 @opindex fdump-rtl-dfinish
13103 These dumps are defined but always produce empty files.
13105 @item -da
13106 @itemx -fdump-rtl-all
13107 @opindex da
13108 @opindex fdump-rtl-all
13109 Produce all the dumps listed above.
13111 @item -dA
13112 @opindex dA
13113 Annotate the assembler output with miscellaneous debugging information.
13115 @item -dD
13116 @opindex dD
13117 Dump all macro definitions, at the end of preprocessing, in addition to
13118 normal output.
13120 @item -dH
13121 @opindex dH
13122 Produce a core dump whenever an error occurs.
13124 @item -dp
13125 @opindex dp
13126 Annotate the assembler output with a comment indicating which
13127 pattern and alternative is used.  The length of each instruction is
13128 also printed.
13130 @item -dP
13131 @opindex dP
13132 Dump the RTL in the assembler output as a comment before each instruction.
13133 Also turns on @option{-dp} annotation.
13135 @item -dx
13136 @opindex dx
13137 Just generate RTL for a function instead of compiling it.  Usually used
13138 with @option{-fdump-rtl-expand}.
13139 @end table
13141 @item -fdump-noaddr
13142 @opindex fdump-noaddr
13143 When doing debugging dumps, suppress address output.  This makes it more
13144 feasible to use diff on debugging dumps for compiler invocations with
13145 different compiler binaries and/or different
13146 text / bss / data / heap / stack / dso start locations.
13148 @item -freport-bug
13149 @opindex freport-bug
13150 Collect and dump debug information into a temporary file if an
13151 internal compiler error (ICE) occurs.
13153 @item -fdump-unnumbered
13154 @opindex fdump-unnumbered
13155 When doing debugging dumps, suppress instruction numbers and address output.
13156 This makes it more feasible to use diff on debugging dumps for compiler
13157 invocations with different options, in particular with and without
13158 @option{-g}.
13160 @item -fdump-unnumbered-links
13161 @opindex fdump-unnumbered-links
13162 When doing debugging dumps (see @option{-d} option above), suppress
13163 instruction numbers for the links to the previous and next instructions
13164 in a sequence.
13166 @item -fdump-ipa-@var{switch}
13167 @opindex fdump-ipa
13168 Control the dumping at various stages of inter-procedural analysis
13169 language tree to a file.  The file name is generated by appending a
13170 switch specific suffix to the source file name, and the file is created
13171 in the same directory as the output file.  The following dumps are
13172 possible:
13174 @table @samp
13175 @item all
13176 Enables all inter-procedural analysis dumps.
13178 @item cgraph
13179 Dumps information about call-graph optimization, unused function removal,
13180 and inlining decisions.
13182 @item inline
13183 Dump after function inlining.
13185 @end table
13187 @item -fdump-lang-all
13188 @itemx -fdump-lang-@var{switch}
13189 @itemx -fdump-lang-@var{switch}-@var{options}
13190 @itemx -fdump-lang-@var{switch}-@var{options}=@var{filename}
13191 @opindex fdump-lang-all
13192 @opindex fdump-lang
13193 Control the dumping of language-specific information.  The @var{options}
13194 and @var{filename} portions behave as described in the
13195 @option{-fdump-tree} option.  The following @var{switch} values are
13196 accepted:
13198 @table @samp
13199 @item all
13201 Enable all language-specific dumps.
13203 @item class
13204 Dump class hierarchy information.  Virtual table information is emitted
13205 unless '@option{slim}' is specified.  This option is applicable to C++ only.
13207 @item raw
13208 Dump the raw internal tree data.  This option is applicable to C++ only.
13210 @end table
13212 @item -fdump-passes
13213 @opindex fdump-passes
13214 Print on @file{stderr} the list of optimization passes that are turned
13215 on and off by the current command-line options.
13217 @item -fdump-statistics-@var{option}
13218 @opindex fdump-statistics
13219 Enable and control dumping of pass statistics in a separate file.  The
13220 file name is generated by appending a suffix ending in
13221 @samp{.statistics} to the source file name, and the file is created in
13222 the same directory as the output file.  If the @samp{-@var{option}}
13223 form is used, @samp{-stats} causes counters to be summed over the
13224 whole compilation unit while @samp{-details} dumps every event as
13225 the passes generate them.  The default with no option is to sum
13226 counters for each function compiled.
13228 @item -fdump-tree-all
13229 @itemx -fdump-tree-@var{switch}
13230 @itemx -fdump-tree-@var{switch}-@var{options}
13231 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
13232 @opindex fdump-tree-all
13233 @opindex fdump-tree
13234 Control the dumping at various stages of processing the intermediate
13235 language tree to a file.  The file name is generated by appending a
13236 switch-specific suffix to the source file name, and the file is
13237 created in the same directory as the output file. In case of
13238 @option{=@var{filename}} option, the dump is output on the given file
13239 instead of the auto named dump files.  If the @samp{-@var{options}}
13240 form is used, @var{options} is a list of @samp{-} separated options
13241 which control the details of the dump.  Not all options are applicable
13242 to all dumps; those that are not meaningful are ignored.  The
13243 following options are available
13245 @table @samp
13246 @item address
13247 Print the address of each node.  Usually this is not meaningful as it
13248 changes according to the environment and source file.  Its primary use
13249 is for tying up a dump file with a debug environment.
13250 @item asmname
13251 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
13252 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
13253 use working backward from mangled names in the assembly file.
13254 @item slim
13255 When dumping front-end intermediate representations, inhibit dumping
13256 of members of a scope or body of a function merely because that scope
13257 has been reached.  Only dump such items when they are directly reachable
13258 by some other path.
13260 When dumping pretty-printed trees, this option inhibits dumping the
13261 bodies of control structures.
13263 When dumping RTL, print the RTL in slim (condensed) form instead of
13264 the default LISP-like representation.
13265 @item raw
13266 Print a raw representation of the tree.  By default, trees are
13267 pretty-printed into a C-like representation.
13268 @item details
13269 Enable more detailed dumps (not honored by every dump option). Also
13270 include information from the optimization passes.
13271 @item stats
13272 Enable dumping various statistics about the pass (not honored by every dump
13273 option).
13274 @item blocks
13275 Enable showing basic block boundaries (disabled in raw dumps).
13276 @item graph
13277 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
13278 dump a representation of the control flow graph suitable for viewing with
13279 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
13280 the file is pretty-printed as a subgraph, so that GraphViz can render them
13281 all in a single plot.
13283 This option currently only works for RTL dumps, and the RTL is always
13284 dumped in slim form.
13285 @item vops
13286 Enable showing virtual operands for every statement.
13287 @item lineno
13288 Enable showing line numbers for statements.
13289 @item uid
13290 Enable showing the unique ID (@code{DECL_UID}) for each variable.
13291 @item verbose
13292 Enable showing the tree dump for each statement.
13293 @item eh
13294 Enable showing the EH region number holding each statement.
13295 @item scev
13296 Enable showing scalar evolution analysis details.
13297 @item optimized
13298 Enable showing optimization information (only available in certain
13299 passes).
13300 @item missed
13301 Enable showing missed optimization information (only available in certain
13302 passes).
13303 @item note
13304 Enable other detailed optimization information (only available in
13305 certain passes).
13306 @item =@var{filename}
13307 Instead of an auto named dump file, output into the given file
13308 name. The file names @file{stdout} and @file{stderr} are treated
13309 specially and are considered already open standard streams. For
13310 example,
13312 @smallexample
13313 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
13314      -fdump-tree-pre=/dev/stderr file.c
13315 @end smallexample
13317 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
13318 output on to @file{stderr}. If two conflicting dump filenames are
13319 given for the same pass, then the latter option overrides the earlier
13320 one.
13322 @item all
13323 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
13324 and @option{lineno}.
13326 @item optall
13327 Turn on all optimization options, i.e., @option{optimized},
13328 @option{missed}, and @option{note}.
13329 @end table
13331 To determine what tree dumps are available or find the dump for a pass
13332 of interest follow the steps below.
13334 @enumerate
13335 @item
13336 Invoke GCC with @option{-fdump-passes} and in the @file{stderr} output
13337 look for a code that corresponds to the pass you are interested in.
13338 For example, the codes @code{tree-evrp}, @code{tree-vrp1}, and
13339 @code{tree-vrp2} correspond to the three Value Range Propagation passes.
13340 The number at the end distinguishes distinct invocations of the same pass.
13341 @item
13342 To enable the creation of the dump file, append the pass code to
13343 the @option{-fdump-} option prefix and invoke GCC with it.  For example,
13344 to enable the dump from the Early Value Range Propagation pass, invoke
13345 GCC with the @option{-fdump-tree-evrp} option.  Optionally, you may
13346 specify the name of the dump file.  If you don't specify one, GCC
13347 creates as described below.
13348 @item
13349 Find the pass dump in a file whose name is composed of three components
13350 separated by a period: the name of the source file GCC was invoked to
13351 compile, a numeric suffix indicating the pass number followed by the
13352 letter @samp{t} for tree passes (and the letter @samp{r} for RTL passes),
13353 and finally the pass code.  For example, the Early VRP pass dump might
13354 be in a file named @file{myfile.c.038t.evrp} in the current working
13355 directory.  Note that the numeric codes are not stable and may change
13356 from one version of GCC to another.
13357 @end enumerate
13359 @item -fopt-info
13360 @itemx -fopt-info-@var{options}
13361 @itemx -fopt-info-@var{options}=@var{filename}
13362 @opindex fopt-info
13363 Controls optimization dumps from various optimization passes. If the
13364 @samp{-@var{options}} form is used, @var{options} is a list of
13365 @samp{-} separated option keywords to select the dump details and
13366 optimizations.  
13368 The @var{options} can be divided into two groups: options describing the
13369 verbosity of the dump, and options describing which optimizations
13370 should be included. The options from both the groups can be freely
13371 mixed as they are non-overlapping. However, in case of any conflicts,
13372 the later options override the earlier options on the command
13373 line. 
13375 The following options control the dump verbosity:
13377 @table @samp
13378 @item optimized
13379 Print information when an optimization is successfully applied. It is
13380 up to a pass to decide which information is relevant. For example, the
13381 vectorizer passes print the source location of loops which are
13382 successfully vectorized.
13383 @item missed
13384 Print information about missed optimizations. Individual passes
13385 control which information to include in the output. 
13386 @item note
13387 Print verbose information about optimizations, such as certain
13388 transformations, more detailed messages about decisions etc.
13389 @item all
13390 Print detailed optimization information. This includes
13391 @samp{optimized}, @samp{missed}, and @samp{note}.
13392 @end table
13394 One or more of the following option keywords can be used to describe a
13395 group of optimizations:
13397 @table @samp
13398 @item ipa
13399 Enable dumps from all interprocedural optimizations.
13400 @item loop
13401 Enable dumps from all loop optimizations.
13402 @item inline
13403 Enable dumps from all inlining optimizations.
13404 @item omp
13405 Enable dumps from all OMP (Offloading and Multi Processing) optimizations.
13406 @item vec
13407 Enable dumps from all vectorization optimizations.
13408 @item optall
13409 Enable dumps from all optimizations. This is a superset of
13410 the optimization groups listed above.
13411 @end table
13413 If @var{options} is
13414 omitted, it defaults to @samp{optimized-optall}, which means to dump all
13415 info about successful optimizations from all the passes.  
13417 If the @var{filename} is provided, then the dumps from all the
13418 applicable optimizations are concatenated into the @var{filename}.
13419 Otherwise the dump is output onto @file{stderr}. Though multiple
13420 @option{-fopt-info} options are accepted, only one of them can include
13421 a @var{filename}. If other filenames are provided then all but the
13422 first such option are ignored.
13424 Note that the output @var{filename} is overwritten
13425 in case of multiple translation units. If a combined output from
13426 multiple translation units is desired, @file{stderr} should be used
13427 instead.
13429 In the following example, the optimization info is output to
13430 @file{stderr}:
13432 @smallexample
13433 gcc -O3 -fopt-info
13434 @end smallexample
13436 This example:
13437 @smallexample
13438 gcc -O3 -fopt-info-missed=missed.all
13439 @end smallexample
13441 @noindent
13442 outputs missed optimization report from all the passes into
13443 @file{missed.all}, and this one:
13445 @smallexample
13446 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
13447 @end smallexample
13449 @noindent
13450 prints information about missed optimization opportunities from
13451 vectorization passes on @file{stderr}.  
13452 Note that @option{-fopt-info-vec-missed} is equivalent to 
13453 @option{-fopt-info-missed-vec}.  The order of the optimization group
13454 names and message types listed after @option{-fopt-info} does not matter.
13456 As another example,
13457 @smallexample
13458 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
13459 @end smallexample
13461 @noindent
13462 outputs information about missed optimizations as well as
13463 optimized locations from all the inlining passes into
13464 @file{inline.txt}.
13466 Finally, consider:
13468 @smallexample
13469 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
13470 @end smallexample
13472 @noindent
13473 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
13474 in conflict since only one output file is allowed. In this case, only
13475 the first option takes effect and the subsequent options are
13476 ignored. Thus only @file{vec.miss} is produced which contains
13477 dumps from the vectorizer about missed opportunities.
13479 @item -fsched-verbose=@var{n}
13480 @opindex fsched-verbose
13481 On targets that use instruction scheduling, this option controls the
13482 amount of debugging output the scheduler prints to the dump files.
13484 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
13485 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
13486 For @var{n} greater than one, it also output basic block probabilities,
13487 detailed ready list information and unit/insn info.  For @var{n} greater
13488 than two, it includes RTL at abort point, control-flow and regions info.
13489 And for @var{n} over four, @option{-fsched-verbose} also includes
13490 dependence info.
13494 @item -fenable-@var{kind}-@var{pass}
13495 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
13496 @opindex fdisable-
13497 @opindex fenable-
13499 This is a set of options that are used to explicitly disable/enable
13500 optimization passes.  These options are intended for use for debugging GCC.
13501 Compiler users should use regular options for enabling/disabling
13502 passes instead.
13504 @table @gcctabopt
13506 @item -fdisable-ipa-@var{pass}
13507 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
13508 statically invoked in the compiler multiple times, the pass name should be
13509 appended with a sequential number starting from 1.
13511 @item -fdisable-rtl-@var{pass}
13512 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
13513 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
13514 statically invoked in the compiler multiple times, the pass name should be
13515 appended with a sequential number starting from 1.  @var{range-list} is a 
13516 comma-separated list of function ranges or assembler names.  Each range is a number
13517 pair separated by a colon.  The range is inclusive in both ends.  If the range
13518 is trivial, the number pair can be simplified as a single number.  If the
13519 function's call graph node's @var{uid} falls within one of the specified ranges,
13520 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
13521 function header of a dump file, and the pass names can be dumped by using
13522 option @option{-fdump-passes}.
13524 @item -fdisable-tree-@var{pass}
13525 @itemx -fdisable-tree-@var{pass}=@var{range-list}
13526 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
13527 option arguments.
13529 @item -fenable-ipa-@var{pass}
13530 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
13531 statically invoked in the compiler multiple times, the pass name should be
13532 appended with a sequential number starting from 1.
13534 @item -fenable-rtl-@var{pass}
13535 @itemx -fenable-rtl-@var{pass}=@var{range-list}
13536 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
13537 description and examples.
13539 @item -fenable-tree-@var{pass}
13540 @itemx -fenable-tree-@var{pass}=@var{range-list}
13541 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
13542 of option arguments.
13544 @end table
13546 Here are some examples showing uses of these options.
13548 @smallexample
13550 # disable ccp1 for all functions
13551    -fdisable-tree-ccp1
13552 # disable complete unroll for function whose cgraph node uid is 1
13553    -fenable-tree-cunroll=1
13554 # disable gcse2 for functions at the following ranges [1,1],
13555 # [300,400], and [400,1000]
13556 # disable gcse2 for functions foo and foo2
13557    -fdisable-rtl-gcse2=foo,foo2
13558 # disable early inlining
13559    -fdisable-tree-einline
13560 # disable ipa inlining
13561    -fdisable-ipa-inline
13562 # enable tree full unroll
13563    -fenable-tree-unroll
13565 @end smallexample
13567 @item -fchecking
13568 @itemx -fchecking=@var{n}
13569 @opindex fchecking
13570 @opindex fno-checking
13571 Enable internal consistency checking.  The default depends on
13572 the compiler configuration.  @option{-fchecking=2} enables further
13573 internal consistency checking that might affect code generation.
13575 @item -frandom-seed=@var{string}
13576 @opindex frandom-seed
13577 This option provides a seed that GCC uses in place of
13578 random numbers in generating certain symbol names
13579 that have to be different in every compiled file.  It is also used to
13580 place unique stamps in coverage data files and the object files that
13581 produce them.  You can use the @option{-frandom-seed} option to produce
13582 reproducibly identical object files.
13584 The @var{string} can either be a number (decimal, octal or hex) or an
13585 arbitrary string (in which case it's converted to a number by
13586 computing CRC32).
13588 The @var{string} should be different for every file you compile.
13590 @item -save-temps
13591 @itemx -save-temps=cwd
13592 @opindex save-temps
13593 Store the usual ``temporary'' intermediate files permanently; place them
13594 in the current directory and name them based on the source file.  Thus,
13595 compiling @file{foo.c} with @option{-c -save-temps} produces files
13596 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
13597 preprocessed @file{foo.i} output file even though the compiler now
13598 normally uses an integrated preprocessor.
13600 When used in combination with the @option{-x} command-line option,
13601 @option{-save-temps} is sensible enough to avoid over writing an
13602 input source file with the same extension as an intermediate file.
13603 The corresponding intermediate file may be obtained by renaming the
13604 source file before using @option{-save-temps}.
13606 If you invoke GCC in parallel, compiling several different source
13607 files that share a common base name in different subdirectories or the
13608 same source file compiled for multiple output destinations, it is
13609 likely that the different parallel compilers will interfere with each
13610 other, and overwrite the temporary files.  For instance:
13612 @smallexample
13613 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
13614 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
13615 @end smallexample
13617 may result in @file{foo.i} and @file{foo.o} being written to
13618 simultaneously by both compilers.
13620 @item -save-temps=obj
13621 @opindex save-temps=obj
13622 Store the usual ``temporary'' intermediate files permanently.  If the
13623 @option{-o} option is used, the temporary files are based on the
13624 object file.  If the @option{-o} option is not used, the
13625 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
13627 For example:
13629 @smallexample
13630 gcc -save-temps=obj -c foo.c
13631 gcc -save-temps=obj -c bar.c -o dir/xbar.o
13632 gcc -save-temps=obj foobar.c -o dir2/yfoobar
13633 @end smallexample
13635 @noindent
13636 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
13637 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
13638 @file{dir2/yfoobar.o}.
13640 @item -time@r{[}=@var{file}@r{]}
13641 @opindex time
13642 Report the CPU time taken by each subprocess in the compilation
13643 sequence.  For C source files, this is the compiler proper and assembler
13644 (plus the linker if linking is done).
13646 Without the specification of an output file, the output looks like this:
13648 @smallexample
13649 # cc1 0.12 0.01
13650 # as 0.00 0.01
13651 @end smallexample
13653 The first number on each line is the ``user time'', that is time spent
13654 executing the program itself.  The second number is ``system time'',
13655 time spent executing operating system routines on behalf of the program.
13656 Both numbers are in seconds.
13658 With the specification of an output file, the output is appended to the
13659 named file, and it looks like this:
13661 @smallexample
13662 0.12 0.01 cc1 @var{options}
13663 0.00 0.01 as @var{options}
13664 @end smallexample
13666 The ``user time'' and the ``system time'' are moved before the program
13667 name, and the options passed to the program are displayed, so that one
13668 can later tell what file was being compiled, and with which options.
13670 @item -fdump-final-insns@r{[}=@var{file}@r{]}
13671 @opindex fdump-final-insns
13672 Dump the final internal representation (RTL) to @var{file}.  If the
13673 optional argument is omitted (or if @var{file} is @code{.}), the name
13674 of the dump file is determined by appending @code{.gkd} to the
13675 compilation output file name.
13677 @item -fcompare-debug@r{[}=@var{opts}@r{]}
13678 @opindex fcompare-debug
13679 @opindex fno-compare-debug
13680 If no error occurs during compilation, run the compiler a second time,
13681 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
13682 passed to the second compilation.  Dump the final internal
13683 representation in both compilations, and print an error if they differ.
13685 If the equal sign is omitted, the default @option{-gtoggle} is used.
13687 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
13688 and nonzero, implicitly enables @option{-fcompare-debug}.  If
13689 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
13690 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
13691 is used.
13693 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
13694 is equivalent to @option{-fno-compare-debug}, which disables the dumping
13695 of the final representation and the second compilation, preventing even
13696 @env{GCC_COMPARE_DEBUG} from taking effect.
13698 To verify full coverage during @option{-fcompare-debug} testing, set
13699 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
13700 which GCC rejects as an invalid option in any actual compilation
13701 (rather than preprocessing, assembly or linking).  To get just a
13702 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
13703 not overridden} will do.
13705 @item -fcompare-debug-second
13706 @opindex fcompare-debug-second
13707 This option is implicitly passed to the compiler for the second
13708 compilation requested by @option{-fcompare-debug}, along with options to
13709 silence warnings, and omitting other options that would cause
13710 side-effect compiler outputs to files or to the standard output.  Dump
13711 files and preserved temporary files are renamed so as to contain the
13712 @code{.gk} additional extension during the second compilation, to avoid
13713 overwriting those generated by the first.
13715 When this option is passed to the compiler driver, it causes the
13716 @emph{first} compilation to be skipped, which makes it useful for little
13717 other than debugging the compiler proper.
13719 @item -gtoggle
13720 @opindex gtoggle
13721 Turn off generation of debug info, if leaving out this option
13722 generates it, or turn it on at level 2 otherwise.  The position of this
13723 argument in the command line does not matter; it takes effect after all
13724 other options are processed, and it does so only once, no matter how
13725 many times it is given.  This is mainly intended to be used with
13726 @option{-fcompare-debug}.
13728 @item -fvar-tracking-assignments-toggle
13729 @opindex fvar-tracking-assignments-toggle
13730 @opindex fno-var-tracking-assignments-toggle
13731 Toggle @option{-fvar-tracking-assignments}, in the same way that
13732 @option{-gtoggle} toggles @option{-g}.
13734 @item -Q
13735 @opindex Q
13736 Makes the compiler print out each function name as it is compiled, and
13737 print some statistics about each pass when it finishes.
13739 @item -ftime-report
13740 @opindex ftime-report
13741 Makes the compiler print some statistics about the time consumed by each
13742 pass when it finishes.
13744 @item -ftime-report-details
13745 @opindex ftime-report-details
13746 Record the time consumed by infrastructure parts separately for each pass.
13748 @item -fira-verbose=@var{n}
13749 @opindex fira-verbose
13750 Control the verbosity of the dump file for the integrated register allocator.
13751 The default value is 5.  If the value @var{n} is greater or equal to 10,
13752 the dump output is sent to stderr using the same format as @var{n} minus 10.
13754 @item -flto-report
13755 @opindex flto-report
13756 Prints a report with internal details on the workings of the link-time
13757 optimizer.  The contents of this report vary from version to version.
13758 It is meant to be useful to GCC developers when processing object
13759 files in LTO mode (via @option{-flto}).
13761 Disabled by default.
13763 @item -flto-report-wpa
13764 @opindex flto-report-wpa
13765 Like @option{-flto-report}, but only print for the WPA phase of Link
13766 Time Optimization.
13768 @item -fmem-report
13769 @opindex fmem-report
13770 Makes the compiler print some statistics about permanent memory
13771 allocation when it finishes.
13773 @item -fmem-report-wpa
13774 @opindex fmem-report-wpa
13775 Makes the compiler print some statistics about permanent memory
13776 allocation for the WPA phase only.
13778 @item -fpre-ipa-mem-report
13779 @opindex fpre-ipa-mem-report
13780 @item -fpost-ipa-mem-report
13781 @opindex fpost-ipa-mem-report
13782 Makes the compiler print some statistics about permanent memory
13783 allocation before or after interprocedural optimization.
13785 @item -fprofile-report
13786 @opindex fprofile-report
13787 Makes the compiler print some statistics about consistency of the
13788 (estimated) profile and effect of individual passes.
13790 @item -fstack-usage
13791 @opindex fstack-usage
13792 Makes the compiler output stack usage information for the program, on a
13793 per-function basis.  The filename for the dump is made by appending
13794 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
13795 the output file, if explicitly specified and it is not an executable,
13796 otherwise it is the basename of the source file.  An entry is made up
13797 of three fields:
13799 @itemize
13800 @item
13801 The name of the function.
13802 @item
13803 A number of bytes.
13804 @item
13805 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
13806 @end itemize
13808 The qualifier @code{static} means that the function manipulates the stack
13809 statically: a fixed number of bytes are allocated for the frame on function
13810 entry and released on function exit; no stack adjustments are otherwise made
13811 in the function.  The second field is this fixed number of bytes.
13813 The qualifier @code{dynamic} means that the function manipulates the stack
13814 dynamically: in addition to the static allocation described above, stack
13815 adjustments are made in the body of the function, for example to push/pop
13816 arguments around function calls.  If the qualifier @code{bounded} is also
13817 present, the amount of these adjustments is bounded at compile time and
13818 the second field is an upper bound of the total amount of stack used by
13819 the function.  If it is not present, the amount of these adjustments is
13820 not bounded at compile time and the second field only represents the
13821 bounded part.
13823 @item -fstats
13824 @opindex fstats
13825 Emit statistics about front-end processing at the end of the compilation.
13826 This option is supported only by the C++ front end, and
13827 the information is generally only useful to the G++ development team.
13829 @item -fdbg-cnt-list
13830 @opindex fdbg-cnt-list
13831 Print the name and the counter upper bound for all debug counters.
13834 @item -fdbg-cnt=@var{counter-value-list}
13835 @opindex fdbg-cnt
13836 Set the internal debug counter upper bound.  @var{counter-value-list}
13837 is a comma-separated list of @var{name}:@var{value} pairs
13838 which sets the upper bound of each debug counter @var{name} to @var{value}.
13839 All debug counters have the initial upper bound of @code{UINT_MAX};
13840 thus @code{dbg_cnt} returns true always unless the upper bound
13841 is set by this option.
13842 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
13843 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
13845 @item -print-file-name=@var{library}
13846 @opindex print-file-name
13847 Print the full absolute name of the library file @var{library} that
13848 would be used when linking---and don't do anything else.  With this
13849 option, GCC does not compile or link anything; it just prints the
13850 file name.
13852 @item -print-multi-directory
13853 @opindex print-multi-directory
13854 Print the directory name corresponding to the multilib selected by any
13855 other switches present in the command line.  This directory is supposed
13856 to exist in @env{GCC_EXEC_PREFIX}.
13858 @item -print-multi-lib
13859 @opindex print-multi-lib
13860 Print the mapping from multilib directory names to compiler switches
13861 that enable them.  The directory name is separated from the switches by
13862 @samp{;}, and each switch starts with an @samp{@@} instead of the
13863 @samp{-}, without spaces between multiple switches.  This is supposed to
13864 ease shell processing.
13866 @item -print-multi-os-directory
13867 @opindex print-multi-os-directory
13868 Print the path to OS libraries for the selected
13869 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
13870 present in the @file{lib} subdirectory and no multilibs are used, this is
13871 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
13872 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
13873 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
13874 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
13876 @item -print-multiarch
13877 @opindex print-multiarch
13878 Print the path to OS libraries for the selected multiarch,
13879 relative to some @file{lib} subdirectory.
13881 @item -print-prog-name=@var{program}
13882 @opindex print-prog-name
13883 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
13885 @item -print-libgcc-file-name
13886 @opindex print-libgcc-file-name
13887 Same as @option{-print-file-name=libgcc.a}.
13889 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
13890 but you do want to link with @file{libgcc.a}.  You can do:
13892 @smallexample
13893 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
13894 @end smallexample
13896 @item -print-search-dirs
13897 @opindex print-search-dirs
13898 Print the name of the configured installation directory and a list of
13899 program and library directories @command{gcc} searches---and don't do anything else.
13901 This is useful when @command{gcc} prints the error message
13902 @samp{installation problem, cannot exec cpp0: No such file or directory}.
13903 To resolve this you either need to put @file{cpp0} and the other compiler
13904 components where @command{gcc} expects to find them, or you can set the environment
13905 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
13906 Don't forget the trailing @samp{/}.
13907 @xref{Environment Variables}.
13909 @item -print-sysroot
13910 @opindex print-sysroot
13911 Print the target sysroot directory that is used during
13912 compilation.  This is the target sysroot specified either at configure
13913 time or using the @option{--sysroot} option, possibly with an extra
13914 suffix that depends on compilation options.  If no target sysroot is
13915 specified, the option prints nothing.
13917 @item -print-sysroot-headers-suffix
13918 @opindex print-sysroot-headers-suffix
13919 Print the suffix added to the target sysroot when searching for
13920 headers, or give an error if the compiler is not configured with such
13921 a suffix---and don't do anything else.
13923 @item -dumpmachine
13924 @opindex dumpmachine
13925 Print the compiler's target machine (for example,
13926 @samp{i686-pc-linux-gnu})---and don't do anything else.
13928 @item -dumpversion
13929 @opindex dumpversion
13930 Print the compiler version (for example, @code{3.0}, @code{6.3.0} or @code{7})---and don't do
13931 anything else.  This is the compiler version used in filesystem paths,
13932 specs, can be depending on how the compiler has been configured just
13933 a single number (major version), two numbers separated by dot (major and
13934 minor version) or three numbers separated by dots (major, minor and patchlevel
13935 version).
13937 @item -dumpfullversion
13938 @opindex dumpfullversion
13939 Print the full compiler version, always 3 numbers separated by dots,
13940 major, minor and patchlevel version.
13942 @item -dumpspecs
13943 @opindex dumpspecs
13944 Print the compiler's built-in specs---and don't do anything else.  (This
13945 is used when GCC itself is being built.)  @xref{Spec Files}.
13946 @end table
13948 @node Submodel Options
13949 @section Machine-Dependent Options
13950 @cindex submodel options
13951 @cindex specifying hardware config
13952 @cindex hardware models and configurations, specifying
13953 @cindex target-dependent options
13954 @cindex machine-dependent options
13956 Each target machine supported by GCC can have its own options---for
13957 example, to allow you to compile for a particular processor variant or
13958 ABI, or to control optimizations specific to that machine.  By
13959 convention, the names of machine-specific options start with
13960 @samp{-m}.
13962 Some configurations of the compiler also support additional target-specific
13963 options, usually for compatibility with other compilers on the same
13964 platform.
13966 @c This list is ordered alphanumerically by subsection name.
13967 @c It should be the same order and spelling as these options are listed
13968 @c in Machine Dependent Options
13970 @menu
13971 * AArch64 Options::
13972 * Adapteva Epiphany Options::
13973 * ARC Options::
13974 * ARM Options::
13975 * AVR Options::
13976 * Blackfin Options::
13977 * C6X Options::
13978 * CRIS Options::
13979 * CR16 Options::
13980 * Darwin Options::
13981 * DEC Alpha Options::
13982 * FR30 Options::
13983 * FT32 Options::
13984 * FRV Options::
13985 * GNU/Linux Options::
13986 * H8/300 Options::
13987 * HPPA Options::
13988 * IA-64 Options::
13989 * LM32 Options::
13990 * M32C Options::
13991 * M32R/D Options::
13992 * M680x0 Options::
13993 * MCore Options::
13994 * MeP Options::
13995 * MicroBlaze Options::
13996 * MIPS Options::
13997 * MMIX Options::
13998 * MN10300 Options::
13999 * Moxie Options::
14000 * MSP430 Options::
14001 * NDS32 Options::
14002 * Nios II Options::
14003 * Nvidia PTX Options::
14004 * PDP-11 Options::
14005 * picoChip Options::
14006 * PowerPC Options::
14007 * RISC-V Options::
14008 * RL78 Options::
14009 * RS/6000 and PowerPC Options::
14010 * RX Options::
14011 * S/390 and zSeries Options::
14012 * Score Options::
14013 * SH Options::
14014 * Solaris 2 Options::
14015 * SPARC Options::
14016 * SPU Options::
14017 * System V Options::
14018 * TILE-Gx Options::
14019 * TILEPro Options::
14020 * V850 Options::
14021 * VAX Options::
14022 * Visium Options::
14023 * VMS Options::
14024 * VxWorks Options::
14025 * x86 Options::
14026 * x86 Windows Options::
14027 * Xstormy16 Options::
14028 * Xtensa Options::
14029 * zSeries Options::
14030 @end menu
14032 @node AArch64 Options
14033 @subsection AArch64 Options
14034 @cindex AArch64 Options
14036 These options are defined for AArch64 implementations:
14038 @table @gcctabopt
14040 @item -mabi=@var{name}
14041 @opindex mabi
14042 Generate code for the specified data model.  Permissible values
14043 are @samp{ilp32} for SysV-like data model where int, long int and pointers
14044 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
14045 but long int and pointers are 64 bits.
14047 The default depends on the specific target configuration.  Note that
14048 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
14049 entire program with the same ABI, and link with a compatible set of libraries.
14051 @item -mbig-endian
14052 @opindex mbig-endian
14053 Generate big-endian code.  This is the default when GCC is configured for an
14054 @samp{aarch64_be-*-*} target.
14056 @item -mgeneral-regs-only
14057 @opindex mgeneral-regs-only
14058 Generate code which uses only the general-purpose registers.  This will prevent
14059 the compiler from using floating-point and Advanced SIMD registers but will not
14060 impose any restrictions on the assembler.
14062 @item -mlittle-endian
14063 @opindex mlittle-endian
14064 Generate little-endian code.  This is the default when GCC is configured for an
14065 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
14067 @item -mcmodel=tiny
14068 @opindex mcmodel=tiny
14069 Generate code for the tiny code model.  The program and its statically defined
14070 symbols must be within 1MB of each other.  Programs can be statically or
14071 dynamically linked.
14073 @item -mcmodel=small
14074 @opindex mcmodel=small
14075 Generate code for the small code model.  The program and its statically defined
14076 symbols must be within 4GB of each other.  Programs can be statically or
14077 dynamically linked.  This is the default code model.
14079 @item -mcmodel=large
14080 @opindex mcmodel=large
14081 Generate code for the large code model.  This makes no assumptions about
14082 addresses and sizes of sections.  Programs can be statically linked only.
14084 @item -mstrict-align
14085 @opindex mstrict-align
14086 Avoid generating memory accesses that may not be aligned on a natural object
14087 boundary as described in the architecture specification.
14089 @item -momit-leaf-frame-pointer
14090 @itemx -mno-omit-leaf-frame-pointer
14091 @opindex momit-leaf-frame-pointer
14092 @opindex mno-omit-leaf-frame-pointer
14093 Omit or keep the frame pointer in leaf functions.  The former behavior is the
14094 default.
14096 @item -mtls-dialect=desc
14097 @opindex mtls-dialect=desc
14098 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
14099 of TLS variables.  This is the default.
14101 @item -mtls-dialect=traditional
14102 @opindex mtls-dialect=traditional
14103 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
14104 of TLS variables.
14106 @item -mtls-size=@var{size}
14107 @opindex mtls-size
14108 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
14109 This option requires binutils 2.26 or newer.
14111 @item -mfix-cortex-a53-835769
14112 @itemx -mno-fix-cortex-a53-835769
14113 @opindex mfix-cortex-a53-835769
14114 @opindex mno-fix-cortex-a53-835769
14115 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
14116 This involves inserting a NOP instruction between memory instructions and
14117 64-bit integer multiply-accumulate instructions.
14119 @item -mfix-cortex-a53-843419
14120 @itemx -mno-fix-cortex-a53-843419
14121 @opindex mfix-cortex-a53-843419
14122 @opindex mno-fix-cortex-a53-843419
14123 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
14124 This erratum workaround is made at link time and this will only pass the
14125 corresponding flag to the linker.
14127 @item -mlow-precision-recip-sqrt
14128 @item -mno-low-precision-recip-sqrt
14129 @opindex mlow-precision-recip-sqrt
14130 @opindex mno-low-precision-recip-sqrt
14131 Enable or disable the reciprocal square root approximation.
14132 This option only has an effect if @option{-ffast-math} or
14133 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14134 precision of reciprocal square root results to about 16 bits for
14135 single precision and to 32 bits for double precision.
14137 @item -mlow-precision-sqrt
14138 @item -mno-low-precision-sqrt
14139 @opindex -mlow-precision-sqrt
14140 @opindex -mno-low-precision-sqrt
14141 Enable or disable the square root approximation.
14142 This option only has an effect if @option{-ffast-math} or
14143 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14144 precision of square root results to about 16 bits for
14145 single precision and to 32 bits for double precision.
14146 If enabled, it implies @option{-mlow-precision-recip-sqrt}.
14148 @item -mlow-precision-div
14149 @item -mno-low-precision-div
14150 @opindex -mlow-precision-div
14151 @opindex -mno-low-precision-div
14152 Enable or disable the division approximation.
14153 This option only has an effect if @option{-ffast-math} or
14154 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14155 precision of division results to about 16 bits for
14156 single precision and to 32 bits for double precision.
14158 @item -march=@var{name}
14159 @opindex march
14160 Specify the name of the target architecture and, optionally, one or
14161 more feature modifiers.  This option has the form
14162 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
14164 The permissible values for @var{arch} are @samp{armv8-a},
14165 @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a} or @var{native}.
14167 The value @samp{armv8.3-a} implies @samp{armv8.2-a} and enables compiler
14168 support for the ARMv8.3-A architecture extensions.
14170 The value @samp{armv8.2-a} implies @samp{armv8.1-a} and enables compiler
14171 support for the ARMv8.2-A architecture extensions.
14173 The value @samp{armv8.1-a} implies @samp{armv8-a} and enables compiler
14174 support for the ARMv8.1-A architecture extension.  In particular, it
14175 enables the @samp{+crc}, @samp{+lse}, and @samp{+rdma} features.
14177 The value @samp{native} is available on native AArch64 GNU/Linux and
14178 causes the compiler to pick the architecture of the host system.  This
14179 option has no effect if the compiler is unable to recognize the
14180 architecture of the host system,
14182 The permissible values for @var{feature} are listed in the sub-section
14183 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
14184 Feature Modifiers}.  Where conflicting feature modifiers are
14185 specified, the right-most feature is used.
14187 GCC uses @var{name} to determine what kind of instructions it can emit
14188 when generating assembly code.  If @option{-march} is specified
14189 without either of @option{-mtune} or @option{-mcpu} also being
14190 specified, the code is tuned to perform well across a range of target
14191 processors implementing the target architecture.
14193 @item -mtune=@var{name}
14194 @opindex mtune
14195 Specify the name of the target processor for which GCC should tune the
14196 performance of the code.  Permissible values for this option are:
14197 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
14198 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
14199 @samp{exynos-m1}, @samp{falkor}, @samp{qdf24xx},
14200 @samp{xgene1}, @samp{vulcan}, @samp{thunderx},
14201 @samp{thunderxt88}, @samp{thunderxt88p1}, @samp{thunderxt81},
14202 @samp{thunderxt83}, @samp{thunderx2t99}, @samp{cortex-a57.cortex-a53},
14203 @samp{cortex-a72.cortex-a53}, @samp{cortex-a73.cortex-a35},
14204 @samp{cortex-a73.cortex-a53}, @samp{cortex-a75.cortex-a55},
14205 @samp{native}.
14207 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
14208 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
14209 @samp{cortex-a75.cortex-a55} specify that GCC should tune for a
14210 big.LITTLE system.
14212 Additionally on native AArch64 GNU/Linux systems the value
14213 @samp{native} tunes performance to the host system.  This option has no effect
14214 if the compiler is unable to recognize the processor of the host system.
14216 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
14217 are specified, the code is tuned to perform well across a range
14218 of target processors.
14220 This option cannot be suffixed by feature modifiers.
14222 @item -mcpu=@var{name}
14223 @opindex mcpu
14224 Specify the name of the target processor, optionally suffixed by one
14225 or more feature modifiers.  This option has the form
14226 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
14227 the permissible values for @var{cpu} are the same as those available
14228 for @option{-mtune}.  The permissible values for @var{feature} are
14229 documented in the sub-section on
14230 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
14231 Feature Modifiers}.  Where conflicting feature modifiers are
14232 specified, the right-most feature is used.
14234 GCC uses @var{name} to determine what kind of instructions it can emit when
14235 generating assembly code (as if by @option{-march}) and to determine
14236 the target processor for which to tune for performance (as if
14237 by @option{-mtune}).  Where this option is used in conjunction
14238 with @option{-march} or @option{-mtune}, those options take precedence
14239 over the appropriate part of this option.
14241 @item -moverride=@var{string}
14242 @opindex moverride
14243 Override tuning decisions made by the back-end in response to a
14244 @option{-mtune=} switch.  The syntax, semantics, and accepted values
14245 for @var{string} in this option are not guaranteed to be consistent
14246 across releases.
14248 This option is only intended to be useful when developing GCC.
14250 @item -mpc-relative-literal-loads
14251 @itemx -mno-pc-relative-literal-loads
14252 @opindex mpc-relative-literal-loads
14253 @opindex mno-pc-relative-literal-loads
14254 Enable or disable PC-relative literal loads.  With this option literal pools are
14255 accessed using a single instruction and emitted after each function.  This
14256 limits the maximum size of functions to 1MB.  This is enabled by default for
14257 @option{-mcmodel=tiny}.
14259 @item -msign-return-address=@var{scope}
14260 @opindex msign-return-address
14261 Select the function scope on which return address signing will be applied.
14262 Permissible values are @samp{none}, which disables return address signing,
14263 @samp{non-leaf}, which enables pointer signing for functions which are not leaf
14264 functions, and @samp{all}, which enables pointer signing for all functions.  The
14265 default value is @samp{none}.
14267 @end table
14269 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
14270 @anchor{aarch64-feature-modifiers}
14271 @cindex @option{-march} feature modifiers
14272 @cindex @option{-mcpu} feature modifiers
14273 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
14274 the following and their inverses @option{no@var{feature}}:
14276 @table @samp
14277 @item crc
14278 Enable CRC extension.  This is on by default for
14279 @option{-march=armv8.1-a}.
14280 @item crypto
14281 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
14282 instructions.
14283 @item fp
14284 Enable floating-point instructions.  This is on by default for all possible
14285 values for options @option{-march} and @option{-mcpu}.
14286 @item simd
14287 Enable Advanced SIMD instructions.  This also enables floating-point
14288 instructions.  This is on by default for all possible values for options
14289 @option{-march} and @option{-mcpu}.
14290 @item lse
14291 Enable Large System Extension instructions.  This is on by default for
14292 @option{-march=armv8.1-a}.
14293 @item rdma
14294 Enable Round Double Multiply Accumulate instructions.  This is on by default
14295 for @option{-march=armv8.1-a}.
14296 @item fp16
14297 Enable FP16 extension.  This also enables floating-point instructions.
14298 @item rcpc
14299 Enable the RcPc extension.  This does not change code generation from GCC,
14300 but is passed on to the assembler, enabling inline asm statements to use
14301 instructions from the RcPc extension.
14303 @end table
14305 Feature @option{crypto} implies @option{simd}, which implies @option{fp}.
14306 Conversely, @option{nofp} implies @option{nosimd}, which implies
14307 @option{nocrypto}.
14309 @node Adapteva Epiphany Options
14310 @subsection Adapteva Epiphany Options
14312 These @samp{-m} options are defined for Adapteva Epiphany:
14314 @table @gcctabopt
14315 @item -mhalf-reg-file
14316 @opindex mhalf-reg-file
14317 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
14318 That allows code to run on hardware variants that lack these registers.
14320 @item -mprefer-short-insn-regs
14321 @opindex mprefer-short-insn-regs
14322 Preferentially allocate registers that allow short instruction generation.
14323 This can result in increased instruction count, so this may either reduce or
14324 increase overall code size.
14326 @item -mbranch-cost=@var{num}
14327 @opindex mbranch-cost
14328 Set the cost of branches to roughly @var{num} ``simple'' instructions.
14329 This cost is only a heuristic and is not guaranteed to produce
14330 consistent results across releases.
14332 @item -mcmove
14333 @opindex mcmove
14334 Enable the generation of conditional moves.
14336 @item -mnops=@var{num}
14337 @opindex mnops
14338 Emit @var{num} NOPs before every other generated instruction.
14340 @item -mno-soft-cmpsf
14341 @opindex mno-soft-cmpsf
14342 For single-precision floating-point comparisons, emit an @code{fsub} instruction
14343 and test the flags.  This is faster than a software comparison, but can
14344 get incorrect results in the presence of NaNs, or when two different small
14345 numbers are compared such that their difference is calculated as zero.
14346 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
14347 software comparisons.
14349 @item -mstack-offset=@var{num}
14350 @opindex mstack-offset
14351 Set the offset between the top of the stack and the stack pointer.
14352 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
14353 can be used by leaf functions without stack allocation.
14354 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
14355 Note also that this option changes the ABI; compiling a program with a
14356 different stack offset than the libraries have been compiled with
14357 generally does not work.
14358 This option can be useful if you want to evaluate if a different stack
14359 offset would give you better code, but to actually use a different stack
14360 offset to build working programs, it is recommended to configure the
14361 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
14363 @item -mno-round-nearest
14364 @opindex mno-round-nearest
14365 Make the scheduler assume that the rounding mode has been set to
14366 truncating.  The default is @option{-mround-nearest}.
14368 @item -mlong-calls
14369 @opindex mlong-calls
14370 If not otherwise specified by an attribute, assume all calls might be beyond
14371 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
14372 function address into a register before performing a (otherwise direct) call.
14373 This is the default.
14375 @item -mshort-calls
14376 @opindex short-calls
14377 If not otherwise specified by an attribute, assume all direct calls are
14378 in the range of the @code{b} / @code{bl} instructions, so use these instructions
14379 for direct calls.  The default is @option{-mlong-calls}.
14381 @item -msmall16
14382 @opindex msmall16
14383 Assume addresses can be loaded as 16-bit unsigned values.  This does not
14384 apply to function addresses for which @option{-mlong-calls} semantics
14385 are in effect.
14387 @item -mfp-mode=@var{mode}
14388 @opindex mfp-mode
14389 Set the prevailing mode of the floating-point unit.
14390 This determines the floating-point mode that is provided and expected
14391 at function call and return time.  Making this mode match the mode you
14392 predominantly need at function start can make your programs smaller and
14393 faster by avoiding unnecessary mode switches.
14395 @var{mode} can be set to one the following values:
14397 @table @samp
14398 @item caller
14399 Any mode at function entry is valid, and retained or restored when
14400 the function returns, and when it calls other functions.
14401 This mode is useful for compiling libraries or other compilation units
14402 you might want to incorporate into different programs with different
14403 prevailing FPU modes, and the convenience of being able to use a single
14404 object file outweighs the size and speed overhead for any extra
14405 mode switching that might be needed, compared with what would be needed
14406 with a more specific choice of prevailing FPU mode.
14408 @item truncate
14409 This is the mode used for floating-point calculations with
14410 truncating (i.e.@: round towards zero) rounding mode.  That includes
14411 conversion from floating point to integer.
14413 @item round-nearest
14414 This is the mode used for floating-point calculations with
14415 round-to-nearest-or-even rounding mode.
14417 @item int
14418 This is the mode used to perform integer calculations in the FPU, e.g.@:
14419 integer multiply, or integer multiply-and-accumulate.
14420 @end table
14422 The default is @option{-mfp-mode=caller}
14424 @item -mnosplit-lohi
14425 @itemx -mno-postinc
14426 @itemx -mno-postmodify
14427 @opindex mnosplit-lohi
14428 @opindex mno-postinc
14429 @opindex mno-postmodify
14430 Code generation tweaks that disable, respectively, splitting of 32-bit
14431 loads, generation of post-increment addresses, and generation of
14432 post-modify addresses.  The defaults are @option{msplit-lohi},
14433 @option{-mpost-inc}, and @option{-mpost-modify}.
14435 @item -mnovect-double
14436 @opindex mno-vect-double
14437 Change the preferred SIMD mode to SImode.  The default is
14438 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
14440 @item -max-vect-align=@var{num}
14441 @opindex max-vect-align
14442 The maximum alignment for SIMD vector mode types.
14443 @var{num} may be 4 or 8.  The default is 8.
14444 Note that this is an ABI change, even though many library function
14445 interfaces are unaffected if they don't use SIMD vector modes
14446 in places that affect size and/or alignment of relevant types.
14448 @item -msplit-vecmove-early
14449 @opindex msplit-vecmove-early
14450 Split vector moves into single word moves before reload.  In theory this
14451 can give better register allocation, but so far the reverse seems to be
14452 generally the case.
14454 @item -m1reg-@var{reg}
14455 @opindex m1reg-
14456 Specify a register to hold the constant @minus{}1, which makes loading small negative
14457 constants and certain bitmasks faster.
14458 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
14459 which specify use of that register as a fixed register,
14460 and @samp{none}, which means that no register is used for this
14461 purpose.  The default is @option{-m1reg-none}.
14463 @end table
14465 @node ARC Options
14466 @subsection ARC Options
14467 @cindex ARC options
14469 The following options control the architecture variant for which code
14470 is being compiled:
14472 @c architecture variants
14473 @table @gcctabopt
14475 @item -mbarrel-shifter
14476 @opindex mbarrel-shifter
14477 Generate instructions supported by barrel shifter.  This is the default
14478 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
14480 @item -mcpu=@var{cpu}
14481 @opindex mcpu
14482 Set architecture type, register usage, and instruction scheduling
14483 parameters for @var{cpu}.  There are also shortcut alias options
14484 available for backward compatibility and convenience.  Supported
14485 values for @var{cpu} are
14487 @table @samp
14488 @opindex mA6
14489 @opindex mARC600
14490 @item arc600
14491 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
14493 @item arc601
14494 @opindex mARC601
14495 Compile for ARC601.  Alias: @option{-mARC601}.
14497 @item arc700
14498 @opindex mA7
14499 @opindex mARC700
14500 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
14501 This is the default when configured with @option{--with-cpu=arc700}@.
14503 @item arcem
14504 Compile for ARC EM.
14506 @item archs
14507 Compile for ARC HS.
14509 @item em
14510 Compile for ARC EM CPU with no hardware extensions.
14512 @item em4
14513 Compile for ARC EM4 CPU.
14515 @item em4_dmips
14516 Compile for ARC EM4 DMIPS CPU.
14518 @item em4_fpus
14519 Compile for ARC EM4 DMIPS CPU with the single-precision floating-point
14520 extension.
14522 @item em4_fpuda
14523 Compile for ARC EM4 DMIPS CPU with single-precision floating-point and
14524 double assist instructions.
14526 @item hs
14527 Compile for ARC HS CPU with no hardware extensions except the atomic
14528 instructions.
14530 @item hs34
14531 Compile for ARC HS34 CPU.
14533 @item hs38
14534 Compile for ARC HS38 CPU.
14536 @item hs38_linux
14537 Compile for ARC HS38 CPU with all hardware extensions on.
14539 @item arc600_norm
14540 Compile for ARC 600 CPU with @code{norm} instructions enabled.
14542 @item arc600_mul32x16
14543 Compile for ARC 600 CPU with @code{norm} and 32x16-bit multiply 
14544 instructions enabled.
14546 @item arc600_mul64
14547 Compile for ARC 600 CPU with @code{norm} and @code{mul64}-family 
14548 instructions enabled.
14550 @item arc601_norm
14551 Compile for ARC 601 CPU with @code{norm} instructions enabled.
14553 @item arc601_mul32x16
14554 Compile for ARC 601 CPU with @code{norm} and 32x16-bit multiply
14555 instructions enabled.
14557 @item arc601_mul64
14558 Compile for ARC 601 CPU with @code{norm} and @code{mul64}-family
14559 instructions enabled.
14561 @item nps400
14562 Compile for ARC 700 on NPS400 chip.
14564 @end table
14566 @item -mdpfp
14567 @opindex mdpfp
14568 @itemx -mdpfp-compact
14569 @opindex mdpfp-compact
14570 Generate double-precision FPX instructions, tuned for the compact
14571 implementation.
14573 @item -mdpfp-fast
14574 @opindex mdpfp-fast
14575 Generate double-precision FPX instructions, tuned for the fast
14576 implementation.
14578 @item -mno-dpfp-lrsr
14579 @opindex mno-dpfp-lrsr
14580 Disable @code{lr} and @code{sr} instructions from using FPX extension
14581 aux registers.
14583 @item -mea
14584 @opindex mea
14585 Generate extended arithmetic instructions.  Currently only
14586 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
14587 supported.  This is always enabled for @option{-mcpu=ARC700}.
14589 @item -mno-mpy
14590 @opindex mno-mpy
14591 Do not generate @code{mpy}-family instructions for ARC700.  This option is
14592 deprecated.
14594 @item -mmul32x16
14595 @opindex mmul32x16
14596 Generate 32x16-bit multiply and multiply-accumulate instructions.
14598 @item -mmul64
14599 @opindex mmul64
14600 Generate @code{mul64} and @code{mulu64} instructions.  
14601 Only valid for @option{-mcpu=ARC600}.
14603 @item -mnorm
14604 @opindex mnorm
14605 Generate @code{norm} instructions.  This is the default if @option{-mcpu=ARC700}
14606 is in effect.
14608 @item -mspfp
14609 @opindex mspfp
14610 @itemx -mspfp-compact
14611 @opindex mspfp-compact
14612 Generate single-precision FPX instructions, tuned for the compact
14613 implementation.
14615 @item -mspfp-fast
14616 @opindex mspfp-fast
14617 Generate single-precision FPX instructions, tuned for the fast
14618 implementation.
14620 @item -msimd
14621 @opindex msimd
14622 Enable generation of ARC SIMD instructions via target-specific
14623 builtins.  Only valid for @option{-mcpu=ARC700}.
14625 @item -msoft-float
14626 @opindex msoft-float
14627 This option ignored; it is provided for compatibility purposes only.
14628 Software floating-point code is emitted by default, and this default
14629 can overridden by FPX options; @option{-mspfp}, @option{-mspfp-compact}, or
14630 @option{-mspfp-fast} for single precision, and @option{-mdpfp},
14631 @option{-mdpfp-compact}, or @option{-mdpfp-fast} for double precision.
14633 @item -mswap
14634 @opindex mswap
14635 Generate @code{swap} instructions.
14637 @item -matomic
14638 @opindex matomic
14639 This enables use of the locked load/store conditional extension to implement
14640 atomic memory built-in functions.  Not available for ARC 6xx or ARC
14641 EM cores.
14643 @item -mdiv-rem
14644 @opindex mdiv-rem
14645 Enable @code{div} and @code{rem} instructions for ARCv2 cores.
14647 @item -mcode-density
14648 @opindex mcode-density
14649 Enable code density instructions for ARC EM.  
14650 This option is on by default for ARC HS.
14652 @item -mll64
14653 @opindex mll64
14654 Enable double load/store operations for ARC HS cores.
14656 @item -mtp-regno=@var{regno}
14657 @opindex mtp-regno
14658 Specify thread pointer register number.
14660 @item -mmpy-option=@var{multo}
14661 @opindex mmpy-option
14662 Compile ARCv2 code with a multiplier design option.  You can specify 
14663 the option using either a string or numeric value for @var{multo}.  
14664 @samp{wlh1} is the default value.  The recognized values are:
14666 @table @samp
14667 @item 0
14668 @itemx none
14669 No multiplier available.
14671 @item 1
14672 @itemx w
14673 16x16 multiplier, fully pipelined.
14674 The following instructions are enabled: @code{mpyw} and @code{mpyuw}.
14676 @item 2
14677 @itemx wlh1
14678 32x32 multiplier, fully
14679 pipelined (1 stage).  The following instructions are additionally
14680 enabled: @code{mpy}, @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14682 @item 3
14683 @itemx wlh2
14684 32x32 multiplier, fully pipelined
14685 (2 stages).  The following instructions are additionally enabled: @code{mpy},
14686 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14688 @item 4
14689 @itemx wlh3
14690 Two 16x16 multipliers, blocking,
14691 sequential.  The following instructions are additionally enabled: @code{mpy},
14692 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14694 @item 5
14695 @itemx wlh4
14696 One 16x16 multiplier, blocking,
14697 sequential.  The following instructions are additionally enabled: @code{mpy},
14698 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14700 @item 6
14701 @itemx wlh5
14702 One 32x4 multiplier, blocking,
14703 sequential.  The following instructions are additionally enabled: @code{mpy},
14704 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14706 @item 7
14707 @itemx plus_dmpy
14708 ARC HS SIMD support.
14710 @item 8
14711 @itemx plus_macd
14712 ARC HS SIMD support.
14714 @item 9
14715 @itemx plus_qmacw
14716 ARC HS SIMD support.
14718 @end table
14720 This option is only available for ARCv2 cores@.
14722 @item -mfpu=@var{fpu}
14723 @opindex mfpu
14724 Enables support for specific floating-point hardware extensions for ARCv2
14725 cores.  Supported values for @var{fpu} are:
14727 @table @samp
14729 @item fpus
14730 Enables support for single-precision floating-point hardware
14731 extensions@.
14733 @item fpud
14734 Enables support for double-precision floating-point hardware
14735 extensions.  The single-precision floating-point extension is also
14736 enabled.  Not available for ARC EM@.
14738 @item fpuda
14739 Enables support for double-precision floating-point hardware
14740 extensions using double-precision assist instructions.  The single-precision
14741 floating-point extension is also enabled.  This option is
14742 only available for ARC EM@.
14744 @item fpuda_div
14745 Enables support for double-precision floating-point hardware
14746 extensions using double-precision assist instructions.
14747 The single-precision floating-point, square-root, and divide 
14748 extensions are also enabled.  This option is
14749 only available for ARC EM@.
14751 @item fpuda_fma
14752 Enables support for double-precision floating-point hardware
14753 extensions using double-precision assist instructions.
14754 The single-precision floating-point and fused multiply and add 
14755 hardware extensions are also enabled.  This option is
14756 only available for ARC EM@.
14758 @item fpuda_all
14759 Enables support for double-precision floating-point hardware
14760 extensions using double-precision assist instructions.
14761 All single-precision floating-point hardware extensions are also
14762 enabled.  This option is only available for ARC EM@.
14764 @item fpus_div
14765 Enables support for single-precision floating-point, square-root and divide 
14766 hardware extensions@.
14768 @item fpud_div
14769 Enables support for double-precision floating-point, square-root and divide 
14770 hardware extensions.  This option
14771 includes option @samp{fpus_div}. Not available for ARC EM@.
14773 @item fpus_fma
14774 Enables support for single-precision floating-point and 
14775 fused multiply and add hardware extensions@.
14777 @item fpud_fma
14778 Enables support for double-precision floating-point and 
14779 fused multiply and add hardware extensions.  This option
14780 includes option @samp{fpus_fma}.  Not available for ARC EM@.
14782 @item fpus_all
14783 Enables support for all single-precision floating-point hardware
14784 extensions@.
14786 @item fpud_all
14787 Enables support for all single- and double-precision floating-point
14788 hardware extensions.  Not available for ARC EM@.
14790 @end table
14792 @item -mirq-ctrl-saved=@var{register-range}, @var{blink}, @var{lp_count}
14793 @opindex mirq-ctrl-saved
14794 Specifies general-purposes registers that the processor automatically
14795 saves/restores on interrupt entry and exit.  @var{register-range} is
14796 specified as two registers separated by a dash.  The register range
14797 always starts with @code{r0}, the upper limit is @code{fp} register.
14798 @var{blink} and @var{lp_count} are optional.  This option is only
14799 valid for ARC EM and ARC HS cores.
14801 @item -mrgf-banked-regs=@var{number}
14802 @opindex mrgf-banked-regs
14803 Specifies the number of registers replicated in second register bank
14804 on entry to fast interrupt.  Fast interrupts are interrupts with the
14805 highest priority level P0.  These interrupts save only PC and STATUS32
14806 registers to avoid memory transactions during interrupt entry and exit
14807 sequences.  Use this option when you are using fast interrupts in an
14808 ARC V2 family processor.  Permitted values are 4, 8, 16, and 32.
14810 @item -mlpc-width=@var{width}
14811 @opindex mlpc-width
14812 Specify the width of the @code{lp_count} register.  Valid values for
14813 @var{width} are 8, 16, 20, 24, 28 and 32 bits.  The default width is
14814 fixed to 32 bits.  If the width is less than 32, the compiler does not
14815 attempt to transform loops in your program to use the zero-delay loop
14816 mechanism unless it is known that the @code{lp_count} register can
14817 hold the required loop-counter value.  Depending on the width
14818 specified, the compiler and run-time library might continue to use the
14819 loop mechanism for various needs.  This option defines macro
14820 @code{__ARC_LPC_WIDTH__} with the value of @var{width}.
14822 @end table
14824 The following options are passed through to the assembler, and also
14825 define preprocessor macro symbols.
14827 @c Flags used by the assembler, but for which we define preprocessor
14828 @c macro symbols as well.
14829 @table @gcctabopt
14830 @item -mdsp-packa
14831 @opindex mdsp-packa
14832 Passed down to the assembler to enable the DSP Pack A extensions.
14833 Also sets the preprocessor symbol @code{__Xdsp_packa}.  This option is
14834 deprecated.
14836 @item -mdvbf
14837 @opindex mdvbf
14838 Passed down to the assembler to enable the dual Viterbi butterfly
14839 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.  This
14840 option is deprecated.
14842 @c ARC700 4.10 extension instruction
14843 @item -mlock
14844 @opindex mlock
14845 Passed down to the assembler to enable the locked load/store
14846 conditional extension.  Also sets the preprocessor symbol
14847 @code{__Xlock}.
14849 @item -mmac-d16
14850 @opindex mmac-d16
14851 Passed down to the assembler.  Also sets the preprocessor symbol
14852 @code{__Xxmac_d16}.  This option is deprecated.
14854 @item -mmac-24
14855 @opindex mmac-24
14856 Passed down to the assembler.  Also sets the preprocessor symbol
14857 @code{__Xxmac_24}.  This option is deprecated.
14859 @c ARC700 4.10 extension instruction
14860 @item -mrtsc
14861 @opindex mrtsc
14862 Passed down to the assembler to enable the 64-bit time-stamp counter
14863 extension instruction.  Also sets the preprocessor symbol
14864 @code{__Xrtsc}.  This option is deprecated.
14866 @c ARC700 4.10 extension instruction
14867 @item -mswape
14868 @opindex mswape
14869 Passed down to the assembler to enable the swap byte ordering
14870 extension instruction.  Also sets the preprocessor symbol
14871 @code{__Xswape}.
14873 @item -mtelephony
14874 @opindex mtelephony
14875 Passed down to the assembler to enable dual- and single-operand
14876 instructions for telephony.  Also sets the preprocessor symbol
14877 @code{__Xtelephony}.  This option is deprecated.
14879 @item -mxy
14880 @opindex mxy
14881 Passed down to the assembler to enable the XY memory extension.  Also
14882 sets the preprocessor symbol @code{__Xxy}.
14884 @end table
14886 The following options control how the assembly code is annotated:
14888 @c Assembly annotation options
14889 @table @gcctabopt
14890 @item -misize
14891 @opindex misize
14892 Annotate assembler instructions with estimated addresses.
14894 @item -mannotate-align
14895 @opindex mannotate-align
14896 Explain what alignment considerations lead to the decision to make an
14897 instruction short or long.
14899 @end table
14901 The following options are passed through to the linker:
14903 @c options passed through to the linker
14904 @table @gcctabopt
14905 @item -marclinux
14906 @opindex marclinux
14907 Passed through to the linker, to specify use of the @code{arclinux} emulation.
14908 This option is enabled by default in tool chains built for
14909 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
14910 when profiling is not requested.
14912 @item -marclinux_prof
14913 @opindex marclinux_prof
14914 Passed through to the linker, to specify use of the
14915 @code{arclinux_prof} emulation.  This option is enabled by default in
14916 tool chains built for @w{@code{arc-linux-uclibc}} and
14917 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
14919 @end table
14921 The following options control the semantics of generated code:
14923 @c semantically relevant code generation options
14924 @table @gcctabopt
14925 @item -mlong-calls
14926 @opindex mlong-calls
14927 Generate calls as register indirect calls, thus providing access
14928 to the full 32-bit address range.
14930 @item -mmedium-calls
14931 @opindex mmedium-calls
14932 Don't use less than 25-bit addressing range for calls, which is the
14933 offset available for an unconditional branch-and-link
14934 instruction.  Conditional execution of function calls is suppressed, to
14935 allow use of the 25-bit range, rather than the 21-bit range with
14936 conditional branch-and-link.  This is the default for tool chains built
14937 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
14939 @item -G @var{num}
14940 @opindex G
14941 Put definitions of externally-visible data in a small data section if
14942 that data is no bigger than @var{num} bytes.  The default value of
14943 @var{num} is 4 for any ARC configuration, or 8 when we have double
14944 load/store operations.
14946 @item -mno-sdata
14947 @opindex mno-sdata
14948 Do not generate sdata references.  This is the default for tool chains
14949 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
14950 targets.
14952 @item -mvolatile-cache
14953 @opindex mvolatile-cache
14954 Use ordinarily cached memory accesses for volatile references.  This is the
14955 default.
14957 @item -mno-volatile-cache
14958 @opindex mno-volatile-cache
14959 Enable cache bypass for volatile references.
14961 @end table
14963 The following options fine tune code generation:
14964 @c code generation tuning options
14965 @table @gcctabopt
14966 @item -malign-call
14967 @opindex malign-call
14968 Do alignment optimizations for call instructions.
14970 @item -mauto-modify-reg
14971 @opindex mauto-modify-reg
14972 Enable the use of pre/post modify with register displacement.
14974 @item -mbbit-peephole
14975 @opindex mbbit-peephole
14976 Enable bbit peephole2.
14978 @item -mno-brcc
14979 @opindex mno-brcc
14980 This option disables a target-specific pass in @file{arc_reorg} to
14981 generate compare-and-branch (@code{br@var{cc}}) instructions.  
14982 It has no effect on
14983 generation of these instructions driven by the combiner pass.
14985 @item -mcase-vector-pcrel
14986 @opindex mcase-vector-pcrel
14987 Use PC-relative switch case tables to enable case table shortening.
14988 This is the default for @option{-Os}.
14990 @item -mcompact-casesi
14991 @opindex mcompact-casesi
14992 Enable compact @code{casesi} pattern.  This is the default for @option{-Os},
14993 and only available for ARCv1 cores.
14995 @item -mno-cond-exec
14996 @opindex mno-cond-exec
14997 Disable the ARCompact-specific pass to generate conditional 
14998 execution instructions.
15000 Due to delay slot scheduling and interactions between operand numbers,
15001 literal sizes, instruction lengths, and the support for conditional execution,
15002 the target-independent pass to generate conditional execution is often lacking,
15003 so the ARC port has kept a special pass around that tries to find more
15004 conditional execution generation opportunities after register allocation,
15005 branch shortening, and delay slot scheduling have been done.  This pass
15006 generally, but not always, improves performance and code size, at the cost of
15007 extra compilation time, which is why there is an option to switch it off.
15008 If you have a problem with call instructions exceeding their allowable
15009 offset range because they are conditionalized, you should consider using
15010 @option{-mmedium-calls} instead.
15012 @item -mearly-cbranchsi
15013 @opindex mearly-cbranchsi
15014 Enable pre-reload use of the @code{cbranchsi} pattern.
15016 @item -mexpand-adddi
15017 @opindex mexpand-adddi
15018 Expand @code{adddi3} and @code{subdi3} at RTL generation time into
15019 @code{add.f}, @code{adc} etc.  This option is deprecated.
15021 @item -mindexed-loads
15022 @opindex mindexed-loads
15023 Enable the use of indexed loads.  This can be problematic because some
15024 optimizers then assume that indexed stores exist, which is not
15025 the case.
15027 @opindex mlra
15028 Enable Local Register Allocation.  This is still experimental for ARC,
15029 so by default the compiler uses standard reload
15030 (i.e. @option{-mno-lra}).
15032 @item -mlra-priority-none
15033 @opindex mlra-priority-none
15034 Don't indicate any priority for target registers.
15036 @item -mlra-priority-compact
15037 @opindex mlra-priority-compact
15038 Indicate target register priority for r0..r3 / r12..r15.
15040 @item -mlra-priority-noncompact
15041 @opindex mlra-priority-noncompact
15042 Reduce target register priority for r0..r3 / r12..r15.
15044 @item -mno-millicode
15045 @opindex mno-millicode
15046 When optimizing for size (using @option{-Os}), prologues and epilogues
15047 that have to save or restore a large number of registers are often
15048 shortened by using call to a special function in libgcc; this is
15049 referred to as a @emph{millicode} call.  As these calls can pose
15050 performance issues, and/or cause linking issues when linking in a
15051 nonstandard way, this option is provided to turn off millicode call
15052 generation.
15054 @item -mmixed-code
15055 @opindex mmixed-code
15056 Tweak register allocation to help 16-bit instruction generation.
15057 This generally has the effect of decreasing the average instruction size
15058 while increasing the instruction count.
15060 @item -mq-class
15061 @opindex mq-class
15062 Enable @samp{q} instruction alternatives.
15063 This is the default for @option{-Os}.
15065 @item -mRcq
15066 @opindex mRcq
15067 Enable @samp{Rcq} constraint handling.  
15068 Most short code generation depends on this.
15069 This is the default.
15071 @item -mRcw
15072 @opindex mRcw
15073 Enable @samp{Rcw} constraint handling.  
15074 Most ccfsm condexec mostly depends on this.
15075 This is the default.
15077 @item -msize-level=@var{level}
15078 @opindex msize-level
15079 Fine-tune size optimization with regards to instruction lengths and alignment.
15080 The recognized values for @var{level} are:
15081 @table @samp
15082 @item 0
15083 No size optimization.  This level is deprecated and treated like @samp{1}.
15085 @item 1
15086 Short instructions are used opportunistically.
15088 @item 2
15089 In addition, alignment of loops and of code after barriers are dropped.
15091 @item 3
15092 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
15094 @end table
15096 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
15097 the behavior when this is not set is equivalent to level @samp{1}.
15099 @item -mtune=@var{cpu}
15100 @opindex mtune
15101 Set instruction scheduling parameters for @var{cpu}, overriding any implied
15102 by @option{-mcpu=}.
15104 Supported values for @var{cpu} are
15106 @table @samp
15107 @item ARC600
15108 Tune for ARC600 CPU.
15110 @item ARC601
15111 Tune for ARC601 CPU.
15113 @item ARC700
15114 Tune for ARC700 CPU with standard multiplier block.
15116 @item ARC700-xmac
15117 Tune for ARC700 CPU with XMAC block.
15119 @item ARC725D
15120 Tune for ARC725D CPU.
15122 @item ARC750D
15123 Tune for ARC750D CPU.
15125 @end table
15127 @item -mmultcost=@var{num}
15128 @opindex mmultcost
15129 Cost to assume for a multiply instruction, with @samp{4} being equal to a
15130 normal instruction.
15132 @item -munalign-prob-threshold=@var{probability}
15133 @opindex munalign-prob-threshold
15134 Set probability threshold for unaligning branches.
15135 When tuning for @samp{ARC700} and optimizing for speed, branches without
15136 filled delay slot are preferably emitted unaligned and long, unless
15137 profiling indicates that the probability for the branch to be taken
15138 is below @var{probability}.  @xref{Cross-profiling}.
15139 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
15141 @end table
15143 The following options are maintained for backward compatibility, but
15144 are now deprecated and will be removed in a future release:
15146 @c Deprecated options
15147 @table @gcctabopt
15149 @item -margonaut
15150 @opindex margonaut
15151 Obsolete FPX.
15153 @item -mbig-endian
15154 @opindex mbig-endian
15155 @itemx -EB
15156 @opindex EB
15157 Compile code for big-endian targets.  Use of these options is now
15158 deprecated.  Big-endian code is supported by configuring GCC to build
15159 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets,
15160 for which big endian is the default.
15162 @item -mlittle-endian
15163 @opindex mlittle-endian
15164 @itemx -EL
15165 @opindex EL
15166 Compile code for little-endian targets.  Use of these options is now
15167 deprecated.  Little-endian code is supported by configuring GCC to build 
15168 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets,
15169 for which little endian is the default.
15171 @item -mbarrel_shifter
15172 @opindex mbarrel_shifter
15173 Replaced by @option{-mbarrel-shifter}.
15175 @item -mdpfp_compact
15176 @opindex mdpfp_compact
15177 Replaced by @option{-mdpfp-compact}.
15179 @item -mdpfp_fast
15180 @opindex mdpfp_fast
15181 Replaced by @option{-mdpfp-fast}.
15183 @item -mdsp_packa
15184 @opindex mdsp_packa
15185 Replaced by @option{-mdsp-packa}.
15187 @item -mEA
15188 @opindex mEA
15189 Replaced by @option{-mea}.
15191 @item -mmac_24
15192 @opindex mmac_24
15193 Replaced by @option{-mmac-24}.
15195 @item -mmac_d16
15196 @opindex mmac_d16
15197 Replaced by @option{-mmac-d16}.
15199 @item -mspfp_compact
15200 @opindex mspfp_compact
15201 Replaced by @option{-mspfp-compact}.
15203 @item -mspfp_fast
15204 @opindex mspfp_fast
15205 Replaced by @option{-mspfp-fast}.
15207 @item -mtune=@var{cpu}
15208 @opindex mtune
15209 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
15210 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
15211 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively.
15213 @item -multcost=@var{num}
15214 @opindex multcost
15215 Replaced by @option{-mmultcost}.
15217 @end table
15219 @node ARM Options
15220 @subsection ARM Options
15221 @cindex ARM options
15223 These @samp{-m} options are defined for the ARM port:
15225 @table @gcctabopt
15226 @item -mabi=@var{name}
15227 @opindex mabi
15228 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
15229 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
15231 @item -mapcs-frame
15232 @opindex mapcs-frame
15233 Generate a stack frame that is compliant with the ARM Procedure Call
15234 Standard for all functions, even if this is not strictly necessary for
15235 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
15236 with this option causes the stack frames not to be generated for
15237 leaf functions.  The default is @option{-mno-apcs-frame}.
15238 This option is deprecated.
15240 @item -mapcs
15241 @opindex mapcs
15242 This is a synonym for @option{-mapcs-frame} and is deprecated.
15244 @ignore
15245 @c not currently implemented
15246 @item -mapcs-stack-check
15247 @opindex mapcs-stack-check
15248 Generate code to check the amount of stack space available upon entry to
15249 every function (that actually uses some stack space).  If there is
15250 insufficient space available then either the function
15251 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
15252 called, depending upon the amount of stack space required.  The runtime
15253 system is required to provide these functions.  The default is
15254 @option{-mno-apcs-stack-check}, since this produces smaller code.
15256 @c not currently implemented
15257 @item -mapcs-reentrant
15258 @opindex mapcs-reentrant
15259 Generate reentrant, position-independent code.  The default is
15260 @option{-mno-apcs-reentrant}.
15261 @end ignore
15263 @item -mthumb-interwork
15264 @opindex mthumb-interwork
15265 Generate code that supports calling between the ARM and Thumb
15266 instruction sets.  Without this option, on pre-v5 architectures, the
15267 two instruction sets cannot be reliably used inside one program.  The
15268 default is @option{-mno-thumb-interwork}, since slightly larger code
15269 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
15270 configurations this option is meaningless.
15272 @item -mno-sched-prolog
15273 @opindex mno-sched-prolog
15274 Prevent the reordering of instructions in the function prologue, or the
15275 merging of those instruction with the instructions in the function's
15276 body.  This means that all functions start with a recognizable set
15277 of instructions (or in fact one of a choice from a small set of
15278 different function prologues), and this information can be used to
15279 locate the start of functions inside an executable piece of code.  The
15280 default is @option{-msched-prolog}.
15282 @item -mfloat-abi=@var{name}
15283 @opindex mfloat-abi
15284 Specifies which floating-point ABI to use.  Permissible values
15285 are: @samp{soft}, @samp{softfp} and @samp{hard}.
15287 Specifying @samp{soft} causes GCC to generate output containing
15288 library calls for floating-point operations.
15289 @samp{softfp} allows the generation of code using hardware floating-point
15290 instructions, but still uses the soft-float calling conventions.
15291 @samp{hard} allows generation of floating-point instructions
15292 and uses FPU-specific calling conventions.
15294 The default depends on the specific target configuration.  Note that
15295 the hard-float and soft-float ABIs are not link-compatible; you must
15296 compile your entire program with the same ABI, and link with a
15297 compatible set of libraries.
15299 @item -mlittle-endian
15300 @opindex mlittle-endian
15301 Generate code for a processor running in little-endian mode.  This is
15302 the default for all standard configurations.
15304 @item -mbig-endian
15305 @opindex mbig-endian
15306 Generate code for a processor running in big-endian mode; the default is
15307 to compile code for a little-endian processor.
15309 @item -mbe8
15310 @itemx -mbe32
15311 @opindex mbe8
15312 When linking a big-endian image select between BE8 and BE32 formats.
15313 The option has no effect for little-endian images and is ignored.  The
15314 default is dependent on the selected target architecture.  For ARMv6
15315 and later architectures the default is BE8, for older architectures
15316 the default is BE32.  BE32 format has been deprecated by ARM.
15318 @item -march=@var{name}@r{[}+extension@dots{}@r{]}
15319 @opindex march
15320 This specifies the name of the target ARM architecture.  GCC uses this
15321 name to determine what kind of instructions it can emit when generating
15322 assembly code.  This option can be used in conjunction with or instead
15323 of the @option{-mcpu=} option.
15325 Permissible names are:
15326 @samp{armv4t},
15327 @samp{armv5t}, @samp{armv5te},
15328 @samp{armv6}, @samp{armv6j}, @samp{armv6k}, @samp{armv6kz}, @samp{armv6t2},
15329 @samp{armv6z}, @samp{armv6zk},
15330 @samp{armv7}, @samp{armv7-a}, @samp{armv7ve}, 
15331 @samp{armv8-a}, @samp{armv8.1-a}, @samp{armv8.2-a},
15332 @samp{armv7-r},
15333 @samp{armv8-r},
15334 @samp{armv6-m}, @samp{armv6s-m},
15335 @samp{armv7-m}, @samp{armv7e-m},
15336 @samp{armv8-m.base}, @samp{armv8-m.main},
15337 @samp{iwmmxt} and @samp{iwmmxt2}.
15339 Additionally, the following architectures, which lack support for the
15340 Thumb exection state, are recognized but support is deprecated:
15341 @samp{armv2}, @samp{armv2a}, @samp{armv3}, @samp{armv3m},
15342 @samp{armv4}, @samp{armv5} and @samp{armv5e}.
15344 Many of the architectures support extensions.  These can be added by
15345 appending @samp{+@var{extension}} to the architecture name.  Extension
15346 options are processed in order and capabilities accumulate.  An extension
15347 will also enable any necessary base extensions
15348 upon which it depends.  For example, the @samp{+crypto} extension
15349 will always enable the @samp{+simd} extension.  The exception to the
15350 additive construction is for extensions that are prefixed with
15351 @samp{+no@dots{}}: these extensions disable the specified option and
15352 any other extensions that may depend on the presence of that
15353 extension.
15355 For example, @samp{-march=armv7-a+simd+nofp+vfpv4} is equivalent to
15356 writing @samp{-march=armv7-a+vfpv4} since the @samp{+simd} option is
15357 entirely disabled by the @samp{+nofp} option that follows it.
15359 Most extension names are generically named, but have an effect that is
15360 dependent upon the architecture to which it is applied.  For example,
15361 the @samp{+simd} option can be applied to both @samp{armv7-a} and
15362 @samp{armv8-a} architectures, but will enable the original ARMv7
15363 Advanced SIMD (Neon) extensions for @samp{armv7-a} and the ARMv8-a
15364 variant for @samp{armv8-a}.
15366 The table below lists the supported extensions for each architecture.
15367 Architectures not mentioned do not support any extensions.
15369 @table @samp
15370 @item  armv5e
15371 @itemx armv5te
15372 @itemx armv6
15373 @itemx armv6j
15374 @itemx armv6k
15375 @itemx armv6kz
15376 @itemx armv6t2
15377 @itemx armv6z
15378 @itemx armv6zk
15379 @table @samp
15380 @item +fp
15381 The VFPv2 floating-point instructions.  The extension @samp{+vfpv2} can be
15382 used as an alias for this extension.
15384 @item +nofp
15385 Disable the floating-point instructions.
15386 @end table
15388 @item armv7
15389 The common subset of the ARMv7-A, ARMv7-R and ARMv7-M architectures.
15390 @table @samp
15391 @item +fp
15392 The VFPv3 floating-point instructions, with 16 double-precision
15393 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
15394 for this extension.  Note that floating-point is not supported by the
15395 base ARMv7-M architecture, but is compatible with both the ARMv7-A and
15396 ARMv7-R architectures.
15398 @item +nofp
15399 Disable the floating-point instructions.
15400 @end table
15402 @item armv7-a
15403 @table @samp
15404 @item +fp
15405 The VFPv3 floating-point instructions, with 16 double-precision
15406 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
15407 for this extension.
15409 @item +simd
15410 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
15411 The extensions @samp{+neon} and @samp{+neon-vfpv3} can be used as aliases
15412 for this extension.
15414 @item +vfpv3
15415 The VFPv3 floating-point instructions, with 32 double-precision
15416 registers.
15418 @item +vfpv3-d16-fp16
15419 The VFPv3 floating-point instructions, with 16 double-precision
15420 registers and the half-precision floating-point conversion operations.
15422 @item +vfpv3-fp16
15423 The VFPv3 floating-point instructions, with 32 double-precision
15424 registers and the half-precision floating-point conversion operations.
15426 @item +vfpv4-d16
15427 The VFPv4 floating-point instructions, with 16 double-precision
15428 registers.
15430 @item +vfpv4
15431 The VFPv4 floating-point instructions, with 32 double-precision
15432 registers.
15434 @item +neon-fp16
15435 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
15436 the half-precision floating-point conversion operations.
15438 @item +neon-vfpv4
15439 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.
15441 @item +nosimd
15442 Disable the Advanced SIMD instructions (does not disable floating point).
15444 @item +nofp
15445 Disable the floating-point and Advanced SIMD instructions.
15446 @end table
15448 @item armv7ve
15449 The extended version of the ARMv7-A architecture with support for
15450 virtualization.
15451 @table @samp
15452 @item +fp
15453 The VFPv4 floating-point instructions, with 16 double-precision registers.
15454 The extension @samp{+vfpv4-d16} can be used as an alias for this extension.
15456 @item +simd
15457 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.  The
15458 extension @samp{+neon-vfpv4} can be used as an alias for this extension.
15460 @item +vfpv3-d16
15461 The VFPv3 floating-point instructions, with 16 double-precision
15462 registers.
15464 @item +vfpv3
15465 The VFPv3 floating-point instructions, with 32 double-precision
15466 registers.
15468 @item +vfpv3-d16-fp16
15469 The VFPv3 floating-point instructions, with 16 double-precision
15470 registers and the half-precision floating-point conversion operations.
15472 @item +vfpv3-fp16
15473 The VFPv3 floating-point instructions, with 32 double-precision
15474 registers and the half-precision floating-point conversion operations.
15476 @item +vfpv4-d16
15477 The VFPv4 floating-point instructions, with 16 double-precision
15478 registers.
15480 @item +vfpv4
15481 The VFPv4 floating-point instructions, with 32 double-precision
15482 registers.
15484 @item +neon
15485 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
15486 The extension @samp{+neon-vfpv3} can be used as an alias for this extension.
15488 @item +neon-fp16
15489 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
15490 the half-precision floating-point conversion operations.
15492 @item +nosimd
15493 Disable the Advanced SIMD instructions (does not disable floating point).
15495 @item +nofp
15496 Disable the floating-point and Advanced SIMD instructions.
15497 @end table
15499 @item armv8-a
15500 @table @samp
15501 @item +crc
15502 The Cyclic Redundancy Check (CRC) instructions.
15503 @item +simd
15504 The ARMv8 Advanced SIMD and floating-point instructions.
15505 @item +crypto
15506 The cryptographic instructions.
15507 @item +nocrypto
15508 Disable the cryptographic isntructions.
15509 @item +nofp
15510 Disable the floating-point, Advanced SIMD and cryptographic instructions.
15511 @end table
15513 @item armv8.1-a
15514 @table @samp
15515 @item +simd
15516 The ARMv8.1 Advanced SIMD and floating-point instructions.
15518 @item +crypto
15519 The cryptographic instructions.  This also enables the Advanced SIMD and
15520 floating-point instructions.
15522 @item +nocrypto
15523 Disable the cryptographic isntructions.
15525 @item +nofp
15526 Disable the floating-point, Advanced SIMD and cryptographic instructions.
15527 @end table
15529 @item armv8.2-a
15530 @table @samp
15531 @item +fp16
15532 The half-precision floating-point data processing instructions.
15533 This also enables the Advanced SIMD and floating-point instructions.
15535 @item +simd
15536 The ARMv8.1 Advanced SIMD and floating-point instructions.
15538 @item +crypto
15539 The cryptographic instructions.  This also enables the Advanced SIMD and
15540 floating-point instructions.
15542 @item +nocrypto
15543 Disable the cryptographic extension.
15545 @item +nofp
15546 Disable the floating-point, Advanced SIMD and cryptographic instructions.
15547 @end table
15549 @item armv7-r
15550 @table @samp
15551 @item +fp.sp
15552 The single-precision VFPv3 floating-point instructions.  The extension
15553 @samp{+vfpv3xd} can be used as an alias for this extension.
15555 @item +fp
15556 The VFPv3 floating-point instructions with 16 double-precision registers.
15557 The extension +vfpv3-d16 can be used as an alias for this extension.
15559 @item +nofp
15560 Disable the floating-point extension.
15562 @item +idiv
15563 The ARM-state integer division instructions.
15565 @item +noidiv
15566 Disable the ARM-state integer division extension.
15567 @end table
15569 @item armv7e-m
15570 @table @samp
15571 @item +fp
15572 The single-precision VFPv4 floating-point instructions.
15574 @item +fpv5
15575 The single-precision FPv5 floating-point instructions.
15577 @item +fp.dp
15578 The single- and double-precision FPv5 floating-point instructions.
15580 @item +nofp
15581 Disable the floating-point extensions.
15582 @end table
15584 @item  armv8-m.main
15585 @table @samp
15586 @item +dsp
15587 The DSP instructions.
15589 @item +nodsp
15590 Disable the DSP extension.
15592 @item +fp
15593 The single-precision floating-point instructions.
15595 @item +fp.dp
15596 The single- and double-precision floating-point instructions.
15598 @item +nofp
15599 Disable the floating-point extension.
15600 @end table
15602 @item armv8-r
15603 @table @samp
15604 @item +crc
15605 The Cyclic Redundancy Check (CRC) instructions.
15606 @item +fp.sp
15607 The single-precision FPv5 floating-point instructions.
15608 @item +simd
15609 The ARMv8 Advanced SIMD and floating-point instructions.
15610 @item +crypto
15611 The cryptographic instructions.
15612 @item +nocrypto
15613 Disable the cryptographic isntructions.
15614 @item +nofp
15615 Disable the floating-point, Advanced SIMD and cryptographic instructions.
15616 @end table
15618 @end table
15620 @option{-march=native} causes the compiler to auto-detect the architecture
15621 of the build computer.  At present, this feature is only supported on
15622 GNU/Linux, and not all architectures are recognized.  If the auto-detect
15623 is unsuccessful the option has no effect.
15625 @item -mtune=@var{name}
15626 @opindex mtune
15627 This option specifies the name of the target ARM processor for
15628 which GCC should tune the performance of the code.
15629 For some ARM implementations better performance can be obtained by using
15630 this option.
15631 Permissible names are: @samp{arm2}, @samp{arm250},
15632 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
15633 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
15634 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
15635 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
15636 @samp{arm720},
15637 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
15638 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
15639 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
15640 @samp{strongarm1110},
15641 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
15642 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
15643 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
15644 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
15645 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
15646 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
15647 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
15648 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
15649 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
15650 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
15651 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
15652 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7},
15653 @samp{cortex-r8}, @samp{cortex-r52},
15654 @samp{cortex-m33},
15655 @samp{cortex-m23},
15656 @samp{cortex-m7},
15657 @samp{cortex-m4},
15658 @samp{cortex-m3},
15659 @samp{cortex-m1},
15660 @samp{cortex-m0},
15661 @samp{cortex-m0plus},
15662 @samp{cortex-m1.small-multiply},
15663 @samp{cortex-m0.small-multiply},
15664 @samp{cortex-m0plus.small-multiply},
15665 @samp{exynos-m1},
15666 @samp{marvell-pj4},
15667 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
15668 @samp{fa526}, @samp{fa626},
15669 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
15670 @samp{xgene1}.
15672 Additionally, this option can specify that GCC should tune the performance
15673 of the code for a big.LITTLE system.  Permissible names are:
15674 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
15675 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
15676 @samp{cortex-a72.cortex-a35}, @samp{cortex-a73.cortex-a53},
15677 @samp{cortex-a75.cortex-a55}.
15679 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
15680 performance for a blend of processors within architecture @var{arch}.
15681 The aim is to generate code that run well on the current most popular
15682 processors, balancing between optimizations that benefit some CPUs in the
15683 range, and avoiding performance pitfalls of other CPUs.  The effects of
15684 this option may change in future GCC versions as CPU models come and go.
15686 @option{-mtune} permits the same extension options as @option{-mcpu}, but
15687 the extension options do not affect the tuning of the generated code.
15689 @option{-mtune=native} causes the compiler to auto-detect the CPU
15690 of the build computer.  At present, this feature is only supported on
15691 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
15692 unsuccessful the option has no effect.
15694 @item -mcpu=@var{name}@r{[}+extension@dots{}@r{]}
15695 @opindex mcpu
15696 This specifies the name of the target ARM processor.  GCC uses this name
15697 to derive the name of the target ARM architecture (as if specified
15698 by @option{-march}) and the ARM processor type for which to tune for
15699 performance (as if specified by @option{-mtune}).  Where this option
15700 is used in conjunction with @option{-march} or @option{-mtune},
15701 those options take precedence over the appropriate part of this option.
15703 Many of the supported CPUs implement optional architectural
15704 extensions.  Where this is so the architectural extensions are
15705 normally enabled by default.  If implementations that lack the
15706 extension exist, then the extension syntax can be used to disable
15707 those extensions that have been omitted.  For floating-point and
15708 Advanced SIMD (Neon) instructions, the settings of the options
15709 @option{-mfloat-abi} and @option{-mfpu} must also be considered:
15710 floating-point and Advanced SIMD instructions will only be used if
15711 @option{-mfloat-abi} is not set to @samp{soft}; and any setting of
15712 @option{-mfpu} other than @samp{auto} will override the available
15713 floating-point and SIMD extension instructions.
15715 For example, @samp{cortex-a9} can be found in three major
15716 configurations: integer only, with just a floating-point unit or with
15717 floating-point and Advanced SIMD.  The default is to enable all the
15718 instructions, but the extensions @samp{+nosimd} and @samp{+nofp} can
15719 be used to disable just the SIMD or both the SIMD and floating-point
15720 instructions respectively.
15722 Permissible names for this option are the same as those for
15723 @option{-mtune}.
15725 The following extension options are common to the listed CPUs:
15727 @table @samp
15728 @item  +nofp
15729 Disables the floating-point instructions on @samp{arm9e},
15730 @samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm10e},
15731 @samp{arm1020e}, @samp{arm1022e}, @samp{arm926ej-s},
15732 @samp{arm1026ej-s}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
15733 @samp{cortex-m4}, @samp{cortex-m7} and @samp{cortex-m33}.
15734 Disables the floating-point and SIMD instructions on
15735 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7},
15736 @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a12},
15737 @samp{cortex-a15}, @samp{cortex-a17}, @samp{cortex-a15.cortex-a7},
15738 @samp{cortex-a17.cortex-a7}, @samp{cortex-a32}, @samp{cortex-a35},
15739 @samp{cortex-a53} and @samp{cortex-a55}.
15741 @item +nofp.dp
15742 Disables the double-precision component of the floating-point instructions
15743 on @samp{cortex-r5}, @samp{cortex-r52} and @samp{cortex-m7}.
15745 @item +nosimd
15746 Disables the SIMD (but not floating-point) instructions on
15747 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}
15748 and @samp{cortex-a9}.
15750 @item +crypto
15751 Enables the cryptographic instructions on @samp{cortex-a32},
15752 @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55}, @samp{cortex-a57},
15753 @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75}, @samp{exynos-m1},
15754 @samp{xgene1}, @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
15755 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53} and
15756 @samp{cortex-a75.cortex-a55}.
15757 @end table
15759 Additionally the @samp{generic-armv7-a} pseudo target defaults to
15760 VFPv3 with 16 double-precision registers.  It supports the following
15761 extension options: @samp{vfpv3-d16}, @samp{vfpv3},
15762 @samp{vfpv3-d16-fp16}, @samp{vfpv3-fp16}, @samp{vfpv4-d16},
15763 @samp{vfpv4}, @samp{neon}, @samp{neon-vfpv3}, @samp{neon-fp16},
15764 @samp{neon-vfpv4}.  The meanings are the same as for the extensions to
15765 @option{-march=armv7-a}.
15767 @option{-mcpu=generic-@var{arch}} is also permissible, and is
15768 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
15769 See @option{-mtune} for more information.
15771 @option{-mcpu=native} causes the compiler to auto-detect the CPU
15772 of the build computer.  At present, this feature is only supported on
15773 GNU/Linux, and not all architectures are recognized.  If the auto-detect
15774 is unsuccessful the option has no effect.
15776 @item -mfpu=@var{name}
15777 @opindex mfpu
15778 This specifies what floating-point hardware (or hardware emulation) is
15779 available on the target.  Permissible names are: @samp{auto}, @samp{vfpv2},
15780 @samp{vfpv3},
15781 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
15782 @samp{vfpv3xd-fp16}, @samp{neon-vfpv3}, @samp{neon-fp16}, @samp{vfpv4},
15783 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
15784 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
15785 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
15786 Note that @samp{neon} is an alias for @samp{neon-vfpv3} and @samp{vfp}
15787 is an alias for @samp{vfpv2}.
15789 The setting @samp{auto} is the default and is special.  It causes the
15790 compiler to select the floating-point and Advanced SIMD instructions
15791 based on the settings of @option{-mcpu} and @option{-march}.
15793 If the selected floating-point hardware includes the NEON extension
15794 (e.g. @option{-mfpu=neon}), note that floating-point
15795 operations are not generated by GCC's auto-vectorization pass unless
15796 @option{-funsafe-math-optimizations} is also specified.  This is
15797 because NEON hardware does not fully implement the IEEE 754 standard for
15798 floating-point arithmetic (in particular denormal values are treated as
15799 zero), so the use of NEON instructions may lead to a loss of precision.
15801 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}).
15803 @item -mfp16-format=@var{name}
15804 @opindex mfp16-format
15805 Specify the format of the @code{__fp16} half-precision floating-point type.
15806 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
15807 the default is @samp{none}, in which case the @code{__fp16} type is not
15808 defined.  @xref{Half-Precision}, for more information.
15810 @item -mstructure-size-boundary=@var{n}
15811 @opindex mstructure-size-boundary
15812 The sizes of all structures and unions are rounded up to a multiple
15813 of the number of bits set by this option.  Permissible values are 8, 32
15814 and 64.  The default value varies for different toolchains.  For the COFF
15815 targeted toolchain the default value is 8.  A value of 64 is only allowed
15816 if the underlying ABI supports it.
15818 Specifying a larger number can produce faster, more efficient code, but
15819 can also increase the size of the program.  Different values are potentially
15820 incompatible.  Code compiled with one value cannot necessarily expect to
15821 work with code or libraries compiled with another value, if they exchange
15822 information using structures or unions.
15824 This option is deprecated.
15826 @item -mabort-on-noreturn
15827 @opindex mabort-on-noreturn
15828 Generate a call to the function @code{abort} at the end of a
15829 @code{noreturn} function.  It is executed if the function tries to
15830 return.
15832 @item -mlong-calls
15833 @itemx -mno-long-calls
15834 @opindex mlong-calls
15835 @opindex mno-long-calls
15836 Tells the compiler to perform function calls by first loading the
15837 address of the function into a register and then performing a subroutine
15838 call on this register.  This switch is needed if the target function
15839 lies outside of the 64-megabyte addressing range of the offset-based
15840 version of subroutine call instruction.
15842 Even if this switch is enabled, not all function calls are turned
15843 into long calls.  The heuristic is that static functions, functions
15844 that have the @code{short_call} attribute, functions that are inside
15845 the scope of a @code{#pragma no_long_calls} directive, and functions whose
15846 definitions have already been compiled within the current compilation
15847 unit are not turned into long calls.  The exceptions to this rule are
15848 that weak function definitions, functions with the @code{long_call}
15849 attribute or the @code{section} attribute, and functions that are within
15850 the scope of a @code{#pragma long_calls} directive are always
15851 turned into long calls.
15853 This feature is not enabled by default.  Specifying
15854 @option{-mno-long-calls} restores the default behavior, as does
15855 placing the function calls within the scope of a @code{#pragma
15856 long_calls_off} directive.  Note these switches have no effect on how
15857 the compiler generates code to handle function calls via function
15858 pointers.
15860 @item -msingle-pic-base
15861 @opindex msingle-pic-base
15862 Treat the register used for PIC addressing as read-only, rather than
15863 loading it in the prologue for each function.  The runtime system is
15864 responsible for initializing this register with an appropriate value
15865 before execution begins.
15867 @item -mpic-register=@var{reg}
15868 @opindex mpic-register
15869 Specify the register to be used for PIC addressing.
15870 For standard PIC base case, the default is any suitable register
15871 determined by compiler.  For single PIC base case, the default is
15872 @samp{R9} if target is EABI based or stack-checking is enabled,
15873 otherwise the default is @samp{R10}.
15875 @item -mpic-data-is-text-relative
15876 @opindex mpic-data-is-text-relative
15877 Assume that the displacement between the text and data segments is fixed
15878 at static link time.  This permits using PC-relative addressing
15879 operations to access data known to be in the data segment.  For
15880 non-VxWorks RTP targets, this option is enabled by default.  When
15881 disabled on such targets, it will enable @option{-msingle-pic-base} by
15882 default.
15884 @item -mpoke-function-name
15885 @opindex mpoke-function-name
15886 Write the name of each function into the text section, directly
15887 preceding the function prologue.  The generated code is similar to this:
15889 @smallexample
15890      t0
15891          .ascii "arm_poke_function_name", 0
15892          .align
15893      t1
15894          .word 0xff000000 + (t1 - t0)
15895      arm_poke_function_name
15896          mov     ip, sp
15897          stmfd   sp!, @{fp, ip, lr, pc@}
15898          sub     fp, ip, #4
15899 @end smallexample
15901 When performing a stack backtrace, code can inspect the value of
15902 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
15903 location @code{pc - 12} and the top 8 bits are set, then we know that
15904 there is a function name embedded immediately preceding this location
15905 and has length @code{((pc[-3]) & 0xff000000)}.
15907 @item -mthumb
15908 @itemx -marm
15909 @opindex marm
15910 @opindex mthumb
15912 Select between generating code that executes in ARM and Thumb
15913 states.  The default for most configurations is to generate code
15914 that executes in ARM state, but the default can be changed by
15915 configuring GCC with the @option{--with-mode=}@var{state}
15916 configure option.
15918 You can also override the ARM and Thumb mode for each function
15919 by using the @code{target("thumb")} and @code{target("arm")} function attributes
15920 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
15922 @item -mtpcs-frame
15923 @opindex mtpcs-frame
15924 Generate a stack frame that is compliant with the Thumb Procedure Call
15925 Standard for all non-leaf functions.  (A leaf function is one that does
15926 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
15928 @item -mtpcs-leaf-frame
15929 @opindex mtpcs-leaf-frame
15930 Generate a stack frame that is compliant with the Thumb Procedure Call
15931 Standard for all leaf functions.  (A leaf function is one that does
15932 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
15934 @item -mcallee-super-interworking
15935 @opindex mcallee-super-interworking
15936 Gives all externally visible functions in the file being compiled an ARM
15937 instruction set header which switches to Thumb mode before executing the
15938 rest of the function.  This allows these functions to be called from
15939 non-interworking code.  This option is not valid in AAPCS configurations
15940 because interworking is enabled by default.
15942 @item -mcaller-super-interworking
15943 @opindex mcaller-super-interworking
15944 Allows calls via function pointers (including virtual functions) to
15945 execute correctly regardless of whether the target code has been
15946 compiled for interworking or not.  There is a small overhead in the cost
15947 of executing a function pointer if this option is enabled.  This option
15948 is not valid in AAPCS configurations because interworking is enabled
15949 by default.
15951 @item -mtp=@var{name}
15952 @opindex mtp
15953 Specify the access model for the thread local storage pointer.  The valid
15954 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
15955 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
15956 (supported in the arm6k architecture), and @samp{auto}, which uses the
15957 best available method for the selected processor.  The default setting is
15958 @samp{auto}.
15960 @item -mtls-dialect=@var{dialect}
15961 @opindex mtls-dialect
15962 Specify the dialect to use for accessing thread local storage.  Two
15963 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
15964 @samp{gnu} dialect selects the original GNU scheme for supporting
15965 local and global dynamic TLS models.  The @samp{gnu2} dialect
15966 selects the GNU descriptor scheme, which provides better performance
15967 for shared libraries.  The GNU descriptor scheme is compatible with
15968 the original scheme, but does require new assembler, linker and
15969 library support.  Initial and local exec TLS models are unaffected by
15970 this option and always use the original scheme.
15972 @item -mword-relocations
15973 @opindex mword-relocations
15974 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
15975 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
15976 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
15977 is specified.
15979 @item -mfix-cortex-m3-ldrd
15980 @opindex mfix-cortex-m3-ldrd
15981 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
15982 with overlapping destination and base registers are used.  This option avoids
15983 generating these instructions.  This option is enabled by default when
15984 @option{-mcpu=cortex-m3} is specified.
15986 @item -munaligned-access
15987 @itemx -mno-unaligned-access
15988 @opindex munaligned-access
15989 @opindex mno-unaligned-access
15990 Enables (or disables) reading and writing of 16- and 32- bit values
15991 from addresses that are not 16- or 32- bit aligned.  By default
15992 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
15993 ARMv8-M Baseline architectures, and enabled for all other
15994 architectures.  If unaligned access is not enabled then words in packed
15995 data structures are accessed a byte at a time.
15997 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
15998 generated object file to either true or false, depending upon the
15999 setting of this option.  If unaligned access is enabled then the
16000 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
16001 defined.
16003 @item -mneon-for-64bits
16004 @opindex mneon-for-64bits
16005 Enables using Neon to handle scalar 64-bits operations. This is
16006 disabled by default since the cost of moving data from core registers
16007 to Neon is high.
16009 @item -mslow-flash-data
16010 @opindex mslow-flash-data
16011 Assume loading data from flash is slower than fetching instruction.
16012 Therefore literal load is minimized for better performance.
16013 This option is only supported when compiling for ARMv7 M-profile and
16014 off by default.
16016 @item -masm-syntax-unified
16017 @opindex masm-syntax-unified
16018 Assume inline assembler is using unified asm syntax.  The default is
16019 currently off which implies divided syntax.  This option has no impact
16020 on Thumb2. However, this may change in future releases of GCC.
16021 Divided syntax should be considered deprecated.
16023 @item -mrestrict-it
16024 @opindex mrestrict-it
16025 Restricts generation of IT blocks to conform to the rules of ARMv8.
16026 IT blocks can only contain a single 16-bit instruction from a select
16027 set of instructions. This option is on by default for ARMv8 Thumb mode.
16029 @item -mprint-tune-info
16030 @opindex mprint-tune-info
16031 Print CPU tuning information as comment in assembler file.  This is
16032 an option used only for regression testing of the compiler and not
16033 intended for ordinary use in compiling code.  This option is disabled
16034 by default.
16036 @item -mpure-code
16037 @opindex mpure-code
16038 Do not allow constant data to be placed in code sections.
16039 Additionally, when compiling for ELF object format give all text sections the
16040 ELF processor-specific section attribute @code{SHF_ARM_PURECODE}.  This option
16041 is only available when generating non-pic code for M-profile targets with the
16042 MOVT instruction.
16044 @item -mcmse
16045 @opindex mcmse
16046 Generate secure code as per the "ARMv8-M Security Extensions: Requirements on
16047 Development Tools Engineering Specification", which can be found on
16048 @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}.
16049 @end table
16051 @node AVR Options
16052 @subsection AVR Options
16053 @cindex AVR Options
16055 These options are defined for AVR implementations:
16057 @table @gcctabopt
16058 @item -mmcu=@var{mcu}
16059 @opindex mmcu
16060 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
16062 The default for this option is@tie{}@samp{avr2}.
16064 GCC supports the following AVR devices and ISAs:
16066 @include avr-mmcu.texi
16068 @item -mabsdata
16069 @opindex mabsdata
16071 Assume that all data in static storage can be accessed by LDS / STS
16072 instructions.  This option has only an effect on reduced Tiny devices like
16073 ATtiny40.  See also the @code{absdata}
16074 @ref{AVR Variable Attributes,variable attribute}.
16076 @item -maccumulate-args
16077 @opindex maccumulate-args
16078 Accumulate outgoing function arguments and acquire/release the needed
16079 stack space for outgoing function arguments once in function
16080 prologue/epilogue.  Without this option, outgoing arguments are pushed
16081 before calling a function and popped afterwards.
16083 Popping the arguments after the function call can be expensive on
16084 AVR so that accumulating the stack space might lead to smaller
16085 executables because arguments need not be removed from the
16086 stack after such a function call.
16088 This option can lead to reduced code size for functions that perform
16089 several calls to functions that get their arguments on the stack like
16090 calls to printf-like functions.
16092 @item -mbranch-cost=@var{cost}
16093 @opindex mbranch-cost
16094 Set the branch costs for conditional branch instructions to
16095 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
16096 integers. The default branch cost is 0.
16098 @item -mcall-prologues
16099 @opindex mcall-prologues
16100 Functions prologues/epilogues are expanded as calls to appropriate
16101 subroutines.  Code size is smaller.
16103 @item -mgas-isr-prologues
16104 @opindex mgas-isr-prologues
16105 Interrupt service routines (ISRs) may use the @code{__gcc_isr} pseudo
16106 instruction supported by GNU Binutils.
16107 If this option is on, the feature can still be disabled for individual
16108 ISRs by means of the @ref{AVR Function Attributes,,@code{no_gccisr}}
16109 function attribute.  This feature is activated per default
16110 if optimization is on (but not with @option{-Og}, @pxref{Optimize Options}),
16111 and if GNU Binutils support @w{@uref{https://sourceware.org/PR21683,PR21683}}.
16113 @item -mint8
16114 @opindex mint8
16115 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
16116 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
16117 and @code{long long} is 4 bytes.  Please note that this option does not
16118 conform to the C standards, but it results in smaller code
16119 size.
16121 @item -mn-flash=@var{num}
16122 @opindex mn-flash
16123 Assume that the flash memory has a size of 
16124 @var{num} times 64@tie{}KiB.
16126 @item -mno-interrupts
16127 @opindex mno-interrupts
16128 Generated code is not compatible with hardware interrupts.
16129 Code size is smaller.
16131 @item -mrelax
16132 @opindex mrelax
16133 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
16134 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
16135 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
16136 the assembler's command line and the @option{--relax} option to the
16137 linker's command line.
16139 Jump relaxing is performed by the linker because jump offsets are not
16140 known before code is located. Therefore, the assembler code generated by the
16141 compiler is the same, but the instructions in the executable may
16142 differ from instructions in the assembler code.
16144 Relaxing must be turned on if linker stubs are needed, see the
16145 section on @code{EIND} and linker stubs below.
16147 @item -mrmw
16148 @opindex mrmw
16149 Assume that the device supports the Read-Modify-Write
16150 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
16152 @item -mshort-calls
16153 @opindex mshort-calls
16155 Assume that @code{RJMP} and @code{RCALL} can target the whole
16156 program memory.
16158 This option is used internally for multilib selection.  It is
16159 not an optimization option, and you don't need to set it by hand.
16161 @item -msp8
16162 @opindex msp8
16163 Treat the stack pointer register as an 8-bit register,
16164 i.e.@: assume the high byte of the stack pointer is zero.
16165 In general, you don't need to set this option by hand.
16167 This option is used internally by the compiler to select and
16168 build multilibs for architectures @code{avr2} and @code{avr25}.
16169 These architectures mix devices with and without @code{SPH}.
16170 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
16171 the compiler driver adds or removes this option from the compiler
16172 proper's command line, because the compiler then knows if the device
16173 or architecture has an 8-bit stack pointer and thus no @code{SPH}
16174 register or not.
16176 @item -mstrict-X
16177 @opindex mstrict-X
16178 Use address register @code{X} in a way proposed by the hardware.  This means
16179 that @code{X} is only used in indirect, post-increment or
16180 pre-decrement addressing.
16182 Without this option, the @code{X} register may be used in the same way
16183 as @code{Y} or @code{Z} which then is emulated by additional
16184 instructions.  
16185 For example, loading a value with @code{X+const} addressing with a
16186 small non-negative @code{const < 64} to a register @var{Rn} is
16187 performed as
16189 @example
16190 adiw r26, const   ; X += const
16191 ld   @var{Rn}, X        ; @var{Rn} = *X
16192 sbiw r26, const   ; X -= const
16193 @end example
16195 @item -mtiny-stack
16196 @opindex mtiny-stack
16197 Only change the lower 8@tie{}bits of the stack pointer.
16199 @item -mfract-convert-truncate
16200 @opindex mfract-convert-truncate
16201 Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
16203 @item -nodevicelib
16204 @opindex nodevicelib
16205 Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
16207 @item -Waddr-space-convert
16208 @opindex Waddr-space-convert
16209 Warn about conversions between address spaces in the case where the
16210 resulting address space is not contained in the incoming address space.
16212 @item -Wmisspelled-isr
16213 @opindex Wmisspelled-isr
16214 Warn if the ISR is misspelled, i.e. without __vector prefix.
16215 Enabled by default.
16216 @end table
16218 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
16219 @cindex @code{EIND}
16220 Pointers in the implementation are 16@tie{}bits wide.
16221 The address of a function or label is represented as word address so
16222 that indirect jumps and calls can target any code address in the
16223 range of 64@tie{}Ki words.
16225 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
16226 bytes of program memory space, there is a special function register called
16227 @code{EIND} that serves as most significant part of the target address
16228 when @code{EICALL} or @code{EIJMP} instructions are used.
16230 Indirect jumps and calls on these devices are handled as follows by
16231 the compiler and are subject to some limitations:
16233 @itemize @bullet
16235 @item
16236 The compiler never sets @code{EIND}.
16238 @item
16239 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
16240 instructions or might read @code{EIND} directly in order to emulate an
16241 indirect call/jump by means of a @code{RET} instruction.
16243 @item
16244 The compiler assumes that @code{EIND} never changes during the startup
16245 code or during the application. In particular, @code{EIND} is not
16246 saved/restored in function or interrupt service routine
16247 prologue/epilogue.
16249 @item
16250 For indirect calls to functions and computed goto, the linker
16251 generates @emph{stubs}. Stubs are jump pads sometimes also called
16252 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
16253 The stub contains a direct jump to the desired address.
16255 @item
16256 Linker relaxation must be turned on so that the linker generates
16257 the stubs correctly in all situations. See the compiler option
16258 @option{-mrelax} and the linker option @option{--relax}.
16259 There are corner cases where the linker is supposed to generate stubs
16260 but aborts without relaxation and without a helpful error message.
16262 @item
16263 The default linker script is arranged for code with @code{EIND = 0}.
16264 If code is supposed to work for a setup with @code{EIND != 0}, a custom
16265 linker script has to be used in order to place the sections whose
16266 name start with @code{.trampolines} into the segment where @code{EIND}
16267 points to.
16269 @item
16270 The startup code from libgcc never sets @code{EIND}.
16271 Notice that startup code is a blend of code from libgcc and AVR-LibC.
16272 For the impact of AVR-LibC on @code{EIND}, see the
16273 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
16275 @item
16276 It is legitimate for user-specific startup code to set up @code{EIND}
16277 early, for example by means of initialization code located in
16278 section @code{.init3}. Such code runs prior to general startup code
16279 that initializes RAM and calls constructors, but after the bit
16280 of startup code from AVR-LibC that sets @code{EIND} to the segment
16281 where the vector table is located.
16282 @example
16283 #include <avr/io.h>
16285 static void
16286 __attribute__((section(".init3"),naked,used,no_instrument_function))
16287 init3_set_eind (void)
16289   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
16290                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
16292 @end example
16294 @noindent
16295 The @code{__trampolines_start} symbol is defined in the linker script.
16297 @item
16298 Stubs are generated automatically by the linker if
16299 the following two conditions are met:
16300 @itemize @minus
16302 @item The address of a label is taken by means of the @code{gs} modifier
16303 (short for @emph{generate stubs}) like so:
16304 @example
16305 LDI r24, lo8(gs(@var{func}))
16306 LDI r25, hi8(gs(@var{func}))
16307 @end example
16308 @item The final location of that label is in a code segment
16309 @emph{outside} the segment where the stubs are located.
16310 @end itemize
16312 @item
16313 The compiler emits such @code{gs} modifiers for code labels in the
16314 following situations:
16315 @itemize @minus
16316 @item Taking address of a function or code label.
16317 @item Computed goto.
16318 @item If prologue-save function is used, see @option{-mcall-prologues}
16319 command-line option.
16320 @item Switch/case dispatch tables. If you do not want such dispatch
16321 tables you can specify the @option{-fno-jump-tables} command-line option.
16322 @item C and C++ constructors/destructors called during startup/shutdown.
16323 @item If the tools hit a @code{gs()} modifier explained above.
16324 @end itemize
16326 @item
16327 Jumping to non-symbolic addresses like so is @emph{not} supported:
16329 @example
16330 int main (void)
16332     /* Call function at word address 0x2 */
16333     return ((int(*)(void)) 0x2)();
16335 @end example
16337 Instead, a stub has to be set up, i.e.@: the function has to be called
16338 through a symbol (@code{func_4} in the example):
16340 @example
16341 int main (void)
16343     extern int func_4 (void);
16345     /* Call function at byte address 0x4 */
16346     return func_4();
16348 @end example
16350 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
16351 Alternatively, @code{func_4} can be defined in the linker script.
16352 @end itemize
16354 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
16355 @cindex @code{RAMPD}
16356 @cindex @code{RAMPX}
16357 @cindex @code{RAMPY}
16358 @cindex @code{RAMPZ}
16359 Some AVR devices support memories larger than the 64@tie{}KiB range
16360 that can be accessed with 16-bit pointers.  To access memory locations
16361 outside this 64@tie{}KiB range, the content of a @code{RAMP}
16362 register is used as high part of the address:
16363 The @code{X}, @code{Y}, @code{Z} address register is concatenated
16364 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
16365 register, respectively, to get a wide address. Similarly,
16366 @code{RAMPD} is used together with direct addressing.
16368 @itemize
16369 @item
16370 The startup code initializes the @code{RAMP} special function
16371 registers with zero.
16373 @item
16374 If a @ref{AVR Named Address Spaces,named address space} other than
16375 generic or @code{__flash} is used, then @code{RAMPZ} is set
16376 as needed before the operation.
16378 @item
16379 If the device supports RAM larger than 64@tie{}KiB and the compiler
16380 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
16381 is reset to zero after the operation.
16383 @item
16384 If the device comes with a specific @code{RAMP} register, the ISR
16385 prologue/epilogue saves/restores that SFR and initializes it with
16386 zero in case the ISR code might (implicitly) use it.
16388 @item
16389 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
16390 If you use inline assembler to read from locations outside the
16391 16-bit address range and change one of the @code{RAMP} registers,
16392 you must reset it to zero after the access.
16394 @end itemize
16396 @subsubsection AVR Built-in Macros
16398 GCC defines several built-in macros so that the user code can test
16399 for the presence or absence of features.  Almost any of the following
16400 built-in macros are deduced from device capabilities and thus
16401 triggered by the @option{-mmcu=} command-line option.
16403 For even more AVR-specific built-in macros see
16404 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
16406 @table @code
16408 @item __AVR_ARCH__
16409 Build-in macro that resolves to a decimal number that identifies the
16410 architecture and depends on the @option{-mmcu=@var{mcu}} option.
16411 Possible values are:
16413 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
16414 @code{4}, @code{5}, @code{51}, @code{6}
16416 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
16417 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
16419 respectively and
16421 @code{100},
16422 @code{102}, @code{103}, @code{104},
16423 @code{105}, @code{106}, @code{107}
16425 for @var{mcu}=@code{avrtiny},
16426 @code{avrxmega2}, @code{avrxmega3}, @code{avrxmega4},
16427 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
16428 If @var{mcu} specifies a device, this built-in macro is set
16429 accordingly. For example, with @option{-mmcu=atmega8} the macro is
16430 defined to @code{4}.
16432 @item __AVR_@var{Device}__
16433 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
16434 the device's name. For example, @option{-mmcu=atmega8} defines the
16435 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
16436 @code{__AVR_ATtiny261A__}, etc.
16438 The built-in macros' names follow
16439 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
16440 the device name as from the AVR user manual. The difference between
16441 @var{Device} in the built-in macro and @var{device} in
16442 @option{-mmcu=@var{device}} is that the latter is always lowercase.
16444 If @var{device} is not a device but only a core architecture like
16445 @samp{avr51}, this macro is not defined.
16447 @item __AVR_DEVICE_NAME__
16448 Setting @option{-mmcu=@var{device}} defines this built-in macro to
16449 the device's name. For example, with @option{-mmcu=atmega8} the macro
16450 is defined to @code{atmega8}.
16452 If @var{device} is not a device but only a core architecture like
16453 @samp{avr51}, this macro is not defined.
16455 @item __AVR_XMEGA__
16456 The device / architecture belongs to the XMEGA family of devices.
16458 @item __AVR_HAVE_ELPM__
16459 The device has the @code{ELPM} instruction.
16461 @item __AVR_HAVE_ELPMX__
16462 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
16463 R@var{n},Z+} instructions.
16465 @item __AVR_HAVE_MOVW__
16466 The device has the @code{MOVW} instruction to perform 16-bit
16467 register-register moves.
16469 @item __AVR_HAVE_LPMX__
16470 The device has the @code{LPM R@var{n},Z} and
16471 @code{LPM R@var{n},Z+} instructions.
16473 @item __AVR_HAVE_MUL__
16474 The device has a hardware multiplier. 
16476 @item __AVR_HAVE_JMP_CALL__
16477 The device has the @code{JMP} and @code{CALL} instructions.
16478 This is the case for devices with more than 8@tie{}KiB of program
16479 memory.
16481 @item __AVR_HAVE_EIJMP_EICALL__
16482 @itemx __AVR_3_BYTE_PC__
16483 The device has the @code{EIJMP} and @code{EICALL} instructions.
16484 This is the case for devices with more than 128@tie{}KiB of program memory.
16485 This also means that the program counter
16486 (PC) is 3@tie{}bytes wide.
16488 @item __AVR_2_BYTE_PC__
16489 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
16490 with up to 128@tie{}KiB of program memory.
16492 @item __AVR_HAVE_8BIT_SP__
16493 @itemx __AVR_HAVE_16BIT_SP__
16494 The stack pointer (SP) register is treated as 8-bit respectively
16495 16-bit register by the compiler.
16496 The definition of these macros is affected by @option{-mtiny-stack}.
16498 @item __AVR_HAVE_SPH__
16499 @itemx __AVR_SP8__
16500 The device has the SPH (high part of stack pointer) special function
16501 register or has an 8-bit stack pointer, respectively.
16502 The definition of these macros is affected by @option{-mmcu=} and
16503 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
16504 by @option{-msp8}.
16506 @item __AVR_HAVE_RAMPD__
16507 @itemx __AVR_HAVE_RAMPX__
16508 @itemx __AVR_HAVE_RAMPY__
16509 @itemx __AVR_HAVE_RAMPZ__
16510 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
16511 @code{RAMPZ} special function register, respectively.
16513 @item __NO_INTERRUPTS__
16514 This macro reflects the @option{-mno-interrupts} command-line option.
16516 @item __AVR_ERRATA_SKIP__
16517 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
16518 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
16519 instructions because of a hardware erratum.  Skip instructions are
16520 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
16521 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
16522 set.
16524 @item __AVR_ISA_RMW__
16525 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
16527 @item __AVR_SFR_OFFSET__=@var{offset}
16528 Instructions that can address I/O special function registers directly
16529 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
16530 address as if addressed by an instruction to access RAM like @code{LD}
16531 or @code{STS}. This offset depends on the device architecture and has
16532 to be subtracted from the RAM address in order to get the
16533 respective I/O@tie{}address.
16535 @item __AVR_SHORT_CALLS__
16536 The @option{-mshort-calls} command line option is set.
16538 @item __AVR_PM_BASE_ADDRESS__=@var{addr}
16539 Some devices support reading from flash memory by means of @code{LD*}
16540 instructions.  The flash memory is seen in the data address space
16541 at an offset of @code{__AVR_PM_BASE_ADDRESS__}.  If this macro
16542 is not defined, this feature is not available.  If defined,
16543 the address space is linear and there is no need to put
16544 @code{.rodata} into RAM.  This is handled by the default linker
16545 description file, and is currently available for
16546 @code{avrtiny} and @code{avrxmega3}.  Even more convenient,
16547 there is no need to use address spaces like @code{__flash} or
16548 features like attribute @code{progmem} and @code{pgm_read_*}.
16550 @item __WITH_AVRLIBC__
16551 The compiler is configured to be used together with AVR-Libc.
16552 See the @option{--with-avrlibc} configure option.
16554 @end table
16556 @node Blackfin Options
16557 @subsection Blackfin Options
16558 @cindex Blackfin Options
16560 @table @gcctabopt
16561 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
16562 @opindex mcpu=
16563 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
16564 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
16565 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
16566 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
16567 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
16568 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
16569 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
16570 @samp{bf561}, @samp{bf592}.
16572 The optional @var{sirevision} specifies the silicon revision of the target
16573 Blackfin processor.  Any workarounds available for the targeted silicon revision
16574 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
16575 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
16576 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
16577 hexadecimal digits representing the major and minor numbers in the silicon
16578 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
16579 is not defined.  If @var{sirevision} is @samp{any}, the
16580 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
16581 If this optional @var{sirevision} is not used, GCC assumes the latest known
16582 silicon revision of the targeted Blackfin processor.
16584 GCC defines a preprocessor macro for the specified @var{cpu}.
16585 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
16586 provided by libgloss to be linked in if @option{-msim} is not given.
16588 Without this option, @samp{bf532} is used as the processor by default.
16590 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
16591 only the preprocessor macro is defined.
16593 @item -msim
16594 @opindex msim
16595 Specifies that the program will be run on the simulator.  This causes
16596 the simulator BSP provided by libgloss to be linked in.  This option
16597 has effect only for @samp{bfin-elf} toolchain.
16598 Certain other options, such as @option{-mid-shared-library} and
16599 @option{-mfdpic}, imply @option{-msim}.
16601 @item -momit-leaf-frame-pointer
16602 @opindex momit-leaf-frame-pointer
16603 Don't keep the frame pointer in a register for leaf functions.  This
16604 avoids the instructions to save, set up and restore frame pointers and
16605 makes an extra register available in leaf functions.  The option
16606 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
16607 which might make debugging harder.
16609 @item -mspecld-anomaly
16610 @opindex mspecld-anomaly
16611 When enabled, the compiler ensures that the generated code does not
16612 contain speculative loads after jump instructions. If this option is used,
16613 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
16615 @item -mno-specld-anomaly
16616 @opindex mno-specld-anomaly
16617 Don't generate extra code to prevent speculative loads from occurring.
16619 @item -mcsync-anomaly
16620 @opindex mcsync-anomaly
16621 When enabled, the compiler ensures that the generated code does not
16622 contain CSYNC or SSYNC instructions too soon after conditional branches.
16623 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
16625 @item -mno-csync-anomaly
16626 @opindex mno-csync-anomaly
16627 Don't generate extra code to prevent CSYNC or SSYNC instructions from
16628 occurring too soon after a conditional branch.
16630 @item -mlow-64k
16631 @opindex mlow-64k
16632 When enabled, the compiler is free to take advantage of the knowledge that
16633 the entire program fits into the low 64k of memory.
16635 @item -mno-low-64k
16636 @opindex mno-low-64k
16637 Assume that the program is arbitrarily large.  This is the default.
16639 @item -mstack-check-l1
16640 @opindex mstack-check-l1
16641 Do stack checking using information placed into L1 scratchpad memory by the
16642 uClinux kernel.
16644 @item -mid-shared-library
16645 @opindex mid-shared-library
16646 Generate code that supports shared libraries via the library ID method.
16647 This allows for execute in place and shared libraries in an environment
16648 without virtual memory management.  This option implies @option{-fPIC}.
16649 With a @samp{bfin-elf} target, this option implies @option{-msim}.
16651 @item -mno-id-shared-library
16652 @opindex mno-id-shared-library
16653 Generate code that doesn't assume ID-based shared libraries are being used.
16654 This is the default.
16656 @item -mleaf-id-shared-library
16657 @opindex mleaf-id-shared-library
16658 Generate code that supports shared libraries via the library ID method,
16659 but assumes that this library or executable won't link against any other
16660 ID shared libraries.  That allows the compiler to use faster code for jumps
16661 and calls.
16663 @item -mno-leaf-id-shared-library
16664 @opindex mno-leaf-id-shared-library
16665 Do not assume that the code being compiled won't link against any ID shared
16666 libraries.  Slower code is generated for jump and call insns.
16668 @item -mshared-library-id=n
16669 @opindex mshared-library-id
16670 Specifies the identification number of the ID-based shared library being
16671 compiled.  Specifying a value of 0 generates more compact code; specifying
16672 other values forces the allocation of that number to the current
16673 library but is no more space- or time-efficient than omitting this option.
16675 @item -msep-data
16676 @opindex msep-data
16677 Generate code that allows the data segment to be located in a different
16678 area of memory from the text segment.  This allows for execute in place in
16679 an environment without virtual memory management by eliminating relocations
16680 against the text section.
16682 @item -mno-sep-data
16683 @opindex mno-sep-data
16684 Generate code that assumes that the data segment follows the text segment.
16685 This is the default.
16687 @item -mlong-calls
16688 @itemx -mno-long-calls
16689 @opindex mlong-calls
16690 @opindex mno-long-calls
16691 Tells the compiler to perform function calls by first loading the
16692 address of the function into a register and then performing a subroutine
16693 call on this register.  This switch is needed if the target function
16694 lies outside of the 24-bit addressing range of the offset-based
16695 version of subroutine call instruction.
16697 This feature is not enabled by default.  Specifying
16698 @option{-mno-long-calls} restores the default behavior.  Note these
16699 switches have no effect on how the compiler generates code to handle
16700 function calls via function pointers.
16702 @item -mfast-fp
16703 @opindex mfast-fp
16704 Link with the fast floating-point library. This library relaxes some of
16705 the IEEE floating-point standard's rules for checking inputs against
16706 Not-a-Number (NAN), in the interest of performance.
16708 @item -minline-plt
16709 @opindex minline-plt
16710 Enable inlining of PLT entries in function calls to functions that are
16711 not known to bind locally.  It has no effect without @option{-mfdpic}.
16713 @item -mmulticore
16714 @opindex mmulticore
16715 Build a standalone application for multicore Blackfin processors. 
16716 This option causes proper start files and link scripts supporting 
16717 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
16718 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
16720 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
16721 selects the one-application-per-core programming model.  Without
16722 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
16723 programming model is used. In this model, the main function of Core B
16724 should be named as @code{coreb_main}.
16726 If this option is not used, the single-core application programming
16727 model is used.
16729 @item -mcorea
16730 @opindex mcorea
16731 Build a standalone application for Core A of BF561 when using
16732 the one-application-per-core programming model. Proper start files
16733 and link scripts are used to support Core A, and the macro
16734 @code{__BFIN_COREA} is defined.
16735 This option can only be used in conjunction with @option{-mmulticore}.
16737 @item -mcoreb
16738 @opindex mcoreb
16739 Build a standalone application for Core B of BF561 when using
16740 the one-application-per-core programming model. Proper start files
16741 and link scripts are used to support Core B, and the macro
16742 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
16743 should be used instead of @code{main}. 
16744 This option can only be used in conjunction with @option{-mmulticore}.
16746 @item -msdram
16747 @opindex msdram
16748 Build a standalone application for SDRAM. Proper start files and
16749 link scripts are used to put the application into SDRAM, and the macro
16750 @code{__BFIN_SDRAM} is defined.
16751 The loader should initialize SDRAM before loading the application.
16753 @item -micplb
16754 @opindex micplb
16755 Assume that ICPLBs are enabled at run time.  This has an effect on certain
16756 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
16757 are enabled; for standalone applications the default is off.
16758 @end table
16760 @node C6X Options
16761 @subsection C6X Options
16762 @cindex C6X Options
16764 @table @gcctabopt
16765 @item -march=@var{name}
16766 @opindex march
16767 This specifies the name of the target architecture.  GCC uses this
16768 name to determine what kind of instructions it can emit when generating
16769 assembly code.  Permissible names are: @samp{c62x},
16770 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
16772 @item -mbig-endian
16773 @opindex mbig-endian
16774 Generate code for a big-endian target.
16776 @item -mlittle-endian
16777 @opindex mlittle-endian
16778 Generate code for a little-endian target.  This is the default.
16780 @item -msim
16781 @opindex msim
16782 Choose startup files and linker script suitable for the simulator.
16784 @item -msdata=default
16785 @opindex msdata=default
16786 Put small global and static data in the @code{.neardata} section,
16787 which is pointed to by register @code{B14}.  Put small uninitialized
16788 global and static data in the @code{.bss} section, which is adjacent
16789 to the @code{.neardata} section.  Put small read-only data into the
16790 @code{.rodata} section.  The corresponding sections used for large
16791 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
16793 @item -msdata=all
16794 @opindex msdata=all
16795 Put all data, not just small objects, into the sections reserved for
16796 small data, and use addressing relative to the @code{B14} register to
16797 access them.
16799 @item -msdata=none
16800 @opindex msdata=none
16801 Make no use of the sections reserved for small data, and use absolute
16802 addresses to access all data.  Put all initialized global and static
16803 data in the @code{.fardata} section, and all uninitialized data in the
16804 @code{.far} section.  Put all constant data into the @code{.const}
16805 section.
16806 @end table
16808 @node CRIS Options
16809 @subsection CRIS Options
16810 @cindex CRIS Options
16812 These options are defined specifically for the CRIS ports.
16814 @table @gcctabopt
16815 @item -march=@var{architecture-type}
16816 @itemx -mcpu=@var{architecture-type}
16817 @opindex march
16818 @opindex mcpu
16819 Generate code for the specified architecture.  The choices for
16820 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
16821 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
16822 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
16823 @samp{v10}.
16825 @item -mtune=@var{architecture-type}
16826 @opindex mtune
16827 Tune to @var{architecture-type} everything applicable about the generated
16828 code, except for the ABI and the set of available instructions.  The
16829 choices for @var{architecture-type} are the same as for
16830 @option{-march=@var{architecture-type}}.
16832 @item -mmax-stack-frame=@var{n}
16833 @opindex mmax-stack-frame
16834 Warn when the stack frame of a function exceeds @var{n} bytes.
16836 @item -metrax4
16837 @itemx -metrax100
16838 @opindex metrax4
16839 @opindex metrax100
16840 The options @option{-metrax4} and @option{-metrax100} are synonyms for
16841 @option{-march=v3} and @option{-march=v8} respectively.
16843 @item -mmul-bug-workaround
16844 @itemx -mno-mul-bug-workaround
16845 @opindex mmul-bug-workaround
16846 @opindex mno-mul-bug-workaround
16847 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
16848 models where it applies.  This option is active by default.
16850 @item -mpdebug
16851 @opindex mpdebug
16852 Enable CRIS-specific verbose debug-related information in the assembly
16853 code.  This option also has the effect of turning off the @samp{#NO_APP}
16854 formatted-code indicator to the assembler at the beginning of the
16855 assembly file.
16857 @item -mcc-init
16858 @opindex mcc-init
16859 Do not use condition-code results from previous instruction; always emit
16860 compare and test instructions before use of condition codes.
16862 @item -mno-side-effects
16863 @opindex mno-side-effects
16864 Do not emit instructions with side effects in addressing modes other than
16865 post-increment.
16867 @item -mstack-align
16868 @itemx -mno-stack-align
16869 @itemx -mdata-align
16870 @itemx -mno-data-align
16871 @itemx -mconst-align
16872 @itemx -mno-const-align
16873 @opindex mstack-align
16874 @opindex mno-stack-align
16875 @opindex mdata-align
16876 @opindex mno-data-align
16877 @opindex mconst-align
16878 @opindex mno-const-align
16879 These options (@samp{no-} options) arrange (eliminate arrangements) for the
16880 stack frame, individual data and constants to be aligned for the maximum
16881 single data access size for the chosen CPU model.  The default is to
16882 arrange for 32-bit alignment.  ABI details such as structure layout are
16883 not affected by these options.
16885 @item -m32-bit
16886 @itemx -m16-bit
16887 @itemx -m8-bit
16888 @opindex m32-bit
16889 @opindex m16-bit
16890 @opindex m8-bit
16891 Similar to the stack- data- and const-align options above, these options
16892 arrange for stack frame, writable data and constants to all be 32-bit,
16893 16-bit or 8-bit aligned.  The default is 32-bit alignment.
16895 @item -mno-prologue-epilogue
16896 @itemx -mprologue-epilogue
16897 @opindex mno-prologue-epilogue
16898 @opindex mprologue-epilogue
16899 With @option{-mno-prologue-epilogue}, the normal function prologue and
16900 epilogue which set up the stack frame are omitted and no return
16901 instructions or return sequences are generated in the code.  Use this
16902 option only together with visual inspection of the compiled code: no
16903 warnings or errors are generated when call-saved registers must be saved,
16904 or storage for local variables needs to be allocated.
16906 @item -mno-gotplt
16907 @itemx -mgotplt
16908 @opindex mno-gotplt
16909 @opindex mgotplt
16910 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
16911 instruction sequences that load addresses for functions from the PLT part
16912 of the GOT rather than (traditional on other architectures) calls to the
16913 PLT@.  The default is @option{-mgotplt}.
16915 @item -melf
16916 @opindex melf
16917 Legacy no-op option only recognized with the cris-axis-elf and
16918 cris-axis-linux-gnu targets.
16920 @item -mlinux
16921 @opindex mlinux
16922 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
16924 @item -sim
16925 @opindex sim
16926 This option, recognized for the cris-axis-elf, arranges
16927 to link with input-output functions from a simulator library.  Code,
16928 initialized data and zero-initialized data are allocated consecutively.
16930 @item -sim2
16931 @opindex sim2
16932 Like @option{-sim}, but pass linker options to locate initialized data at
16933 0x40000000 and zero-initialized data at 0x80000000.
16934 @end table
16936 @node CR16 Options
16937 @subsection CR16 Options
16938 @cindex CR16 Options
16940 These options are defined specifically for the CR16 ports.
16942 @table @gcctabopt
16944 @item -mmac
16945 @opindex mmac
16946 Enable the use of multiply-accumulate instructions. Disabled by default.
16948 @item -mcr16cplus
16949 @itemx -mcr16c
16950 @opindex mcr16cplus
16951 @opindex mcr16c
16952 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
16953 is default.
16955 @item -msim
16956 @opindex msim
16957 Links the library libsim.a which is in compatible with simulator. Applicable
16958 to ELF compiler only.
16960 @item -mint32
16961 @opindex mint32
16962 Choose integer type as 32-bit wide.
16964 @item -mbit-ops
16965 @opindex mbit-ops
16966 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
16968 @item -mdata-model=@var{model}
16969 @opindex mdata-model
16970 Choose a data model. The choices for @var{model} are @samp{near},
16971 @samp{far} or @samp{medium}. @samp{medium} is default.
16972 However, @samp{far} is not valid with @option{-mcr16c}, as the
16973 CR16C architecture does not support the far data model.
16974 @end table
16976 @node Darwin Options
16977 @subsection Darwin Options
16978 @cindex Darwin options
16980 These options are defined for all architectures running the Darwin operating
16981 system.
16983 FSF GCC on Darwin does not create ``fat'' object files; it creates
16984 an object file for the single architecture that GCC was built to
16985 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
16986 @option{-arch} options are used; it does so by running the compiler or
16987 linker multiple times and joining the results together with
16988 @file{lipo}.
16990 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
16991 @samp{i686}) is determined by the flags that specify the ISA
16992 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
16993 @option{-force_cpusubtype_ALL} option can be used to override this.
16995 The Darwin tools vary in their behavior when presented with an ISA
16996 mismatch.  The assembler, @file{as}, only permits instructions to
16997 be used that are valid for the subtype of the file it is generating,
16998 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
16999 The linker for shared libraries, @file{/usr/bin/libtool}, fails
17000 and prints an error if asked to create a shared library with a less
17001 restrictive subtype than its input files (for instance, trying to put
17002 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
17003 for executables, @command{ld}, quietly gives the executable the most
17004 restrictive subtype of any of its input files.
17006 @table @gcctabopt
17007 @item -F@var{dir}
17008 @opindex F
17009 Add the framework directory @var{dir} to the head of the list of
17010 directories to be searched for header files.  These directories are
17011 interleaved with those specified by @option{-I} options and are
17012 scanned in a left-to-right order.
17014 A framework directory is a directory with frameworks in it.  A
17015 framework is a directory with a @file{Headers} and/or
17016 @file{PrivateHeaders} directory contained directly in it that ends
17017 in @file{.framework}.  The name of a framework is the name of this
17018 directory excluding the @file{.framework}.  Headers associated with
17019 the framework are found in one of those two directories, with
17020 @file{Headers} being searched first.  A subframework is a framework
17021 directory that is in a framework's @file{Frameworks} directory.
17022 Includes of subframework headers can only appear in a header of a
17023 framework that contains the subframework, or in a sibling subframework
17024 header.  Two subframeworks are siblings if they occur in the same
17025 framework.  A subframework should not have the same name as a
17026 framework; a warning is issued if this is violated.  Currently a
17027 subframework cannot have subframeworks; in the future, the mechanism
17028 may be extended to support this.  The standard frameworks can be found
17029 in @file{/System/Library/Frameworks} and
17030 @file{/Library/Frameworks}.  An example include looks like
17031 @code{#include <Framework/header.h>}, where @file{Framework} denotes
17032 the name of the framework and @file{header.h} is found in the
17033 @file{PrivateHeaders} or @file{Headers} directory.
17035 @item -iframework@var{dir}
17036 @opindex iframework
17037 Like @option{-F} except the directory is a treated as a system
17038 directory.  The main difference between this @option{-iframework} and
17039 @option{-F} is that with @option{-iframework} the compiler does not
17040 warn about constructs contained within header files found via
17041 @var{dir}.  This option is valid only for the C family of languages.
17043 @item -gused
17044 @opindex gused
17045 Emit debugging information for symbols that are used.  For stabs
17046 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
17047 This is by default ON@.
17049 @item -gfull
17050 @opindex gfull
17051 Emit debugging information for all symbols and types.
17053 @item -mmacosx-version-min=@var{version}
17054 The earliest version of MacOS X that this executable will run on
17055 is @var{version}.  Typical values of @var{version} include @code{10.1},
17056 @code{10.2}, and @code{10.3.9}.
17058 If the compiler was built to use the system's headers by default,
17059 then the default for this option is the system version on which the
17060 compiler is running, otherwise the default is to make choices that
17061 are compatible with as many systems and code bases as possible.
17063 @item -mkernel
17064 @opindex mkernel
17065 Enable kernel development mode.  The @option{-mkernel} option sets
17066 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
17067 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
17068 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
17069 applicable.  This mode also sets @option{-mno-altivec},
17070 @option{-msoft-float}, @option{-fno-builtin} and
17071 @option{-mlong-branch} for PowerPC targets.
17073 @item -mone-byte-bool
17074 @opindex mone-byte-bool
17075 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
17076 By default @code{sizeof(bool)} is @code{4} when compiling for
17077 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
17078 option has no effect on x86.
17080 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
17081 to generate code that is not binary compatible with code generated
17082 without that switch.  Using this switch may require recompiling all
17083 other modules in a program, including system libraries.  Use this
17084 switch to conform to a non-default data model.
17086 @item -mfix-and-continue
17087 @itemx -ffix-and-continue
17088 @itemx -findirect-data
17089 @opindex mfix-and-continue
17090 @opindex ffix-and-continue
17091 @opindex findirect-data
17092 Generate code suitable for fast turnaround development, such as to
17093 allow GDB to dynamically load @file{.o} files into already-running
17094 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
17095 are provided for backwards compatibility.
17097 @item -all_load
17098 @opindex all_load
17099 Loads all members of static archive libraries.
17100 See man ld(1) for more information.
17102 @item -arch_errors_fatal
17103 @opindex arch_errors_fatal
17104 Cause the errors having to do with files that have the wrong architecture
17105 to be fatal.
17107 @item -bind_at_load
17108 @opindex bind_at_load
17109 Causes the output file to be marked such that the dynamic linker will
17110 bind all undefined references when the file is loaded or launched.
17112 @item -bundle
17113 @opindex bundle
17114 Produce a Mach-o bundle format file.
17115 See man ld(1) for more information.
17117 @item -bundle_loader @var{executable}
17118 @opindex bundle_loader
17119 This option specifies the @var{executable} that will load the build
17120 output file being linked.  See man ld(1) for more information.
17122 @item -dynamiclib
17123 @opindex dynamiclib
17124 When passed this option, GCC produces a dynamic library instead of
17125 an executable when linking, using the Darwin @file{libtool} command.
17127 @item -force_cpusubtype_ALL
17128 @opindex force_cpusubtype_ALL
17129 This causes GCC's output file to have the @samp{ALL} subtype, instead of
17130 one controlled by the @option{-mcpu} or @option{-march} option.
17132 @item -allowable_client  @var{client_name}
17133 @itemx -client_name
17134 @itemx -compatibility_version
17135 @itemx -current_version
17136 @itemx -dead_strip
17137 @itemx -dependency-file
17138 @itemx -dylib_file
17139 @itemx -dylinker_install_name
17140 @itemx -dynamic
17141 @itemx -exported_symbols_list
17142 @itemx -filelist
17143 @need 800
17144 @itemx -flat_namespace
17145 @itemx -force_flat_namespace
17146 @itemx -headerpad_max_install_names
17147 @itemx -image_base
17148 @itemx -init
17149 @itemx -install_name
17150 @itemx -keep_private_externs
17151 @itemx -multi_module
17152 @itemx -multiply_defined
17153 @itemx -multiply_defined_unused
17154 @need 800
17155 @itemx -noall_load
17156 @itemx -no_dead_strip_inits_and_terms
17157 @itemx -nofixprebinding
17158 @itemx -nomultidefs
17159 @itemx -noprebind
17160 @itemx -noseglinkedit
17161 @itemx -pagezero_size
17162 @itemx -prebind
17163 @itemx -prebind_all_twolevel_modules
17164 @itemx -private_bundle
17165 @need 800
17166 @itemx -read_only_relocs
17167 @itemx -sectalign
17168 @itemx -sectobjectsymbols
17169 @itemx -whyload
17170 @itemx -seg1addr
17171 @itemx -sectcreate
17172 @itemx -sectobjectsymbols
17173 @itemx -sectorder
17174 @itemx -segaddr
17175 @itemx -segs_read_only_addr
17176 @need 800
17177 @itemx -segs_read_write_addr
17178 @itemx -seg_addr_table
17179 @itemx -seg_addr_table_filename
17180 @itemx -seglinkedit
17181 @itemx -segprot
17182 @itemx -segs_read_only_addr
17183 @itemx -segs_read_write_addr
17184 @itemx -single_module
17185 @itemx -static
17186 @itemx -sub_library
17187 @need 800
17188 @itemx -sub_umbrella
17189 @itemx -twolevel_namespace
17190 @itemx -umbrella
17191 @itemx -undefined
17192 @itemx -unexported_symbols_list
17193 @itemx -weak_reference_mismatches
17194 @itemx -whatsloaded
17195 @opindex allowable_client
17196 @opindex client_name
17197 @opindex compatibility_version
17198 @opindex current_version
17199 @opindex dead_strip
17200 @opindex dependency-file
17201 @opindex dylib_file
17202 @opindex dylinker_install_name
17203 @opindex dynamic
17204 @opindex exported_symbols_list
17205 @opindex filelist
17206 @opindex flat_namespace
17207 @opindex force_flat_namespace
17208 @opindex headerpad_max_install_names
17209 @opindex image_base
17210 @opindex init
17211 @opindex install_name
17212 @opindex keep_private_externs
17213 @opindex multi_module
17214 @opindex multiply_defined
17215 @opindex multiply_defined_unused
17216 @opindex noall_load
17217 @opindex no_dead_strip_inits_and_terms
17218 @opindex nofixprebinding
17219 @opindex nomultidefs
17220 @opindex noprebind
17221 @opindex noseglinkedit
17222 @opindex pagezero_size
17223 @opindex prebind
17224 @opindex prebind_all_twolevel_modules
17225 @opindex private_bundle
17226 @opindex read_only_relocs
17227 @opindex sectalign
17228 @opindex sectobjectsymbols
17229 @opindex whyload
17230 @opindex seg1addr
17231 @opindex sectcreate
17232 @opindex sectobjectsymbols
17233 @opindex sectorder
17234 @opindex segaddr
17235 @opindex segs_read_only_addr
17236 @opindex segs_read_write_addr
17237 @opindex seg_addr_table
17238 @opindex seg_addr_table_filename
17239 @opindex seglinkedit
17240 @opindex segprot
17241 @opindex segs_read_only_addr
17242 @opindex segs_read_write_addr
17243 @opindex single_module
17244 @opindex static
17245 @opindex sub_library
17246 @opindex sub_umbrella
17247 @opindex twolevel_namespace
17248 @opindex umbrella
17249 @opindex undefined
17250 @opindex unexported_symbols_list
17251 @opindex weak_reference_mismatches
17252 @opindex whatsloaded
17253 These options are passed to the Darwin linker.  The Darwin linker man page
17254 describes them in detail.
17255 @end table
17257 @node DEC Alpha Options
17258 @subsection DEC Alpha Options
17260 These @samp{-m} options are defined for the DEC Alpha implementations:
17262 @table @gcctabopt
17263 @item -mno-soft-float
17264 @itemx -msoft-float
17265 @opindex mno-soft-float
17266 @opindex msoft-float
17267 Use (do not use) the hardware floating-point instructions for
17268 floating-point operations.  When @option{-msoft-float} is specified,
17269 functions in @file{libgcc.a} are used to perform floating-point
17270 operations.  Unless they are replaced by routines that emulate the
17271 floating-point operations, or compiled in such a way as to call such
17272 emulations routines, these routines issue floating-point
17273 operations.   If you are compiling for an Alpha without floating-point
17274 operations, you must ensure that the library is built so as not to call
17275 them.
17277 Note that Alpha implementations without floating-point operations are
17278 required to have floating-point registers.
17280 @item -mfp-reg
17281 @itemx -mno-fp-regs
17282 @opindex mfp-reg
17283 @opindex mno-fp-regs
17284 Generate code that uses (does not use) the floating-point register set.
17285 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
17286 register set is not used, floating-point operands are passed in integer
17287 registers as if they were integers and floating-point results are passed
17288 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
17289 so any function with a floating-point argument or return value called by code
17290 compiled with @option{-mno-fp-regs} must also be compiled with that
17291 option.
17293 A typical use of this option is building a kernel that does not use,
17294 and hence need not save and restore, any floating-point registers.
17296 @item -mieee
17297 @opindex mieee
17298 The Alpha architecture implements floating-point hardware optimized for
17299 maximum performance.  It is mostly compliant with the IEEE floating-point
17300 standard.  However, for full compliance, software assistance is
17301 required.  This option generates code fully IEEE-compliant code
17302 @emph{except} that the @var{inexact-flag} is not maintained (see below).
17303 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
17304 defined during compilation.  The resulting code is less efficient but is
17305 able to correctly support denormalized numbers and exceptional IEEE
17306 values such as not-a-number and plus/minus infinity.  Other Alpha
17307 compilers call this option @option{-ieee_with_no_inexact}.
17309 @item -mieee-with-inexact
17310 @opindex mieee-with-inexact
17311 This is like @option{-mieee} except the generated code also maintains
17312 the IEEE @var{inexact-flag}.  Turning on this option causes the
17313 generated code to implement fully-compliant IEEE math.  In addition to
17314 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
17315 macro.  On some Alpha implementations the resulting code may execute
17316 significantly slower than the code generated by default.  Since there is
17317 very little code that depends on the @var{inexact-flag}, you should
17318 normally not specify this option.  Other Alpha compilers call this
17319 option @option{-ieee_with_inexact}.
17321 @item -mfp-trap-mode=@var{trap-mode}
17322 @opindex mfp-trap-mode
17323 This option controls what floating-point related traps are enabled.
17324 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
17325 The trap mode can be set to one of four values:
17327 @table @samp
17328 @item n
17329 This is the default (normal) setting.  The only traps that are enabled
17330 are the ones that cannot be disabled in software (e.g., division by zero
17331 trap).
17333 @item u
17334 In addition to the traps enabled by @samp{n}, underflow traps are enabled
17335 as well.
17337 @item su
17338 Like @samp{u}, but the instructions are marked to be safe for software
17339 completion (see Alpha architecture manual for details).
17341 @item sui
17342 Like @samp{su}, but inexact traps are enabled as well.
17343 @end table
17345 @item -mfp-rounding-mode=@var{rounding-mode}
17346 @opindex mfp-rounding-mode
17347 Selects the IEEE rounding mode.  Other Alpha compilers call this option
17348 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
17351 @table @samp
17352 @item n
17353 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
17354 the nearest machine number or towards the even machine number in case
17355 of a tie.
17357 @item m
17358 Round towards minus infinity.
17360 @item c
17361 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
17363 @item d
17364 Dynamic rounding mode.  A field in the floating-point control register
17365 (@var{fpcr}, see Alpha architecture reference manual) controls the
17366 rounding mode in effect.  The C library initializes this register for
17367 rounding towards plus infinity.  Thus, unless your program modifies the
17368 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
17369 @end table
17371 @item -mtrap-precision=@var{trap-precision}
17372 @opindex mtrap-precision
17373 In the Alpha architecture, floating-point traps are imprecise.  This
17374 means without software assistance it is impossible to recover from a
17375 floating trap and program execution normally needs to be terminated.
17376 GCC can generate code that can assist operating system trap handlers
17377 in determining the exact location that caused a floating-point trap.
17378 Depending on the requirements of an application, different levels of
17379 precisions can be selected:
17381 @table @samp
17382 @item p
17383 Program precision.  This option is the default and means a trap handler
17384 can only identify which program caused a floating-point exception.
17386 @item f
17387 Function precision.  The trap handler can determine the function that
17388 caused a floating-point exception.
17390 @item i
17391 Instruction precision.  The trap handler can determine the exact
17392 instruction that caused a floating-point exception.
17393 @end table
17395 Other Alpha compilers provide the equivalent options called
17396 @option{-scope_safe} and @option{-resumption_safe}.
17398 @item -mieee-conformant
17399 @opindex mieee-conformant
17400 This option marks the generated code as IEEE conformant.  You must not
17401 use this option unless you also specify @option{-mtrap-precision=i} and either
17402 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
17403 is to emit the line @samp{.eflag 48} in the function prologue of the
17404 generated assembly file.
17406 @item -mbuild-constants
17407 @opindex mbuild-constants
17408 Normally GCC examines a 32- or 64-bit integer constant to
17409 see if it can construct it from smaller constants in two or three
17410 instructions.  If it cannot, it outputs the constant as a literal and
17411 generates code to load it from the data segment at run time.
17413 Use this option to require GCC to construct @emph{all} integer constants
17414 using code, even if it takes more instructions (the maximum is six).
17416 You typically use this option to build a shared library dynamic
17417 loader.  Itself a shared library, it must relocate itself in memory
17418 before it can find the variables and constants in its own data segment.
17420 @item -mbwx
17421 @itemx -mno-bwx
17422 @itemx -mcix
17423 @itemx -mno-cix
17424 @itemx -mfix
17425 @itemx -mno-fix
17426 @itemx -mmax
17427 @itemx -mno-max
17428 @opindex mbwx
17429 @opindex mno-bwx
17430 @opindex mcix
17431 @opindex mno-cix
17432 @opindex mfix
17433 @opindex mno-fix
17434 @opindex mmax
17435 @opindex mno-max
17436 Indicate whether GCC should generate code to use the optional BWX,
17437 CIX, FIX and MAX instruction sets.  The default is to use the instruction
17438 sets supported by the CPU type specified via @option{-mcpu=} option or that
17439 of the CPU on which GCC was built if none is specified.
17441 @item -mfloat-vax
17442 @itemx -mfloat-ieee
17443 @opindex mfloat-vax
17444 @opindex mfloat-ieee
17445 Generate code that uses (does not use) VAX F and G floating-point
17446 arithmetic instead of IEEE single and double precision.
17448 @item -mexplicit-relocs
17449 @itemx -mno-explicit-relocs
17450 @opindex mexplicit-relocs
17451 @opindex mno-explicit-relocs
17452 Older Alpha assemblers provided no way to generate symbol relocations
17453 except via assembler macros.  Use of these macros does not allow
17454 optimal instruction scheduling.  GNU binutils as of version 2.12
17455 supports a new syntax that allows the compiler to explicitly mark
17456 which relocations should apply to which instructions.  This option
17457 is mostly useful for debugging, as GCC detects the capabilities of
17458 the assembler when it is built and sets the default accordingly.
17460 @item -msmall-data
17461 @itemx -mlarge-data
17462 @opindex msmall-data
17463 @opindex mlarge-data
17464 When @option{-mexplicit-relocs} is in effect, static data is
17465 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
17466 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
17467 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
17468 16-bit relocations off of the @code{$gp} register.  This limits the
17469 size of the small data area to 64KB, but allows the variables to be
17470 directly accessed via a single instruction.
17472 The default is @option{-mlarge-data}.  With this option the data area
17473 is limited to just below 2GB@.  Programs that require more than 2GB of
17474 data must use @code{malloc} or @code{mmap} to allocate the data in the
17475 heap instead of in the program's data segment.
17477 When generating code for shared libraries, @option{-fpic} implies
17478 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
17480 @item -msmall-text
17481 @itemx -mlarge-text
17482 @opindex msmall-text
17483 @opindex mlarge-text
17484 When @option{-msmall-text} is used, the compiler assumes that the
17485 code of the entire program (or shared library) fits in 4MB, and is
17486 thus reachable with a branch instruction.  When @option{-msmall-data}
17487 is used, the compiler can assume that all local symbols share the
17488 same @code{$gp} value, and thus reduce the number of instructions
17489 required for a function call from 4 to 1.
17491 The default is @option{-mlarge-text}.
17493 @item -mcpu=@var{cpu_type}
17494 @opindex mcpu
17495 Set the instruction set and instruction scheduling parameters for
17496 machine type @var{cpu_type}.  You can specify either the @samp{EV}
17497 style name or the corresponding chip number.  GCC supports scheduling
17498 parameters for the EV4, EV5 and EV6 family of processors and
17499 chooses the default values for the instruction set from the processor
17500 you specify.  If you do not specify a processor type, GCC defaults
17501 to the processor on which the compiler was built.
17503 Supported values for @var{cpu_type} are
17505 @table @samp
17506 @item ev4
17507 @itemx ev45
17508 @itemx 21064
17509 Schedules as an EV4 and has no instruction set extensions.
17511 @item ev5
17512 @itemx 21164
17513 Schedules as an EV5 and has no instruction set extensions.
17515 @item ev56
17516 @itemx 21164a
17517 Schedules as an EV5 and supports the BWX extension.
17519 @item pca56
17520 @itemx 21164pc
17521 @itemx 21164PC
17522 Schedules as an EV5 and supports the BWX and MAX extensions.
17524 @item ev6
17525 @itemx 21264
17526 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
17528 @item ev67
17529 @itemx 21264a
17530 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
17531 @end table
17533 Native toolchains also support the value @samp{native},
17534 which selects the best architecture option for the host processor.
17535 @option{-mcpu=native} has no effect if GCC does not recognize
17536 the processor.
17538 @item -mtune=@var{cpu_type}
17539 @opindex mtune
17540 Set only the instruction scheduling parameters for machine type
17541 @var{cpu_type}.  The instruction set is not changed.
17543 Native toolchains also support the value @samp{native},
17544 which selects the best architecture option for the host processor.
17545 @option{-mtune=native} has no effect if GCC does not recognize
17546 the processor.
17548 @item -mmemory-latency=@var{time}
17549 @opindex mmemory-latency
17550 Sets the latency the scheduler should assume for typical memory
17551 references as seen by the application.  This number is highly
17552 dependent on the memory access patterns used by the application
17553 and the size of the external cache on the machine.
17555 Valid options for @var{time} are
17557 @table @samp
17558 @item @var{number}
17559 A decimal number representing clock cycles.
17561 @item L1
17562 @itemx L2
17563 @itemx L3
17564 @itemx main
17565 The compiler contains estimates of the number of clock cycles for
17566 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
17567 (also called Dcache, Scache, and Bcache), as well as to main memory.
17568 Note that L3 is only valid for EV5.
17570 @end table
17571 @end table
17573 @node FR30 Options
17574 @subsection FR30 Options
17575 @cindex FR30 Options
17577 These options are defined specifically for the FR30 port.
17579 @table @gcctabopt
17581 @item -msmall-model
17582 @opindex msmall-model
17583 Use the small address space model.  This can produce smaller code, but
17584 it does assume that all symbolic values and addresses fit into a
17585 20-bit range.
17587 @item -mno-lsim
17588 @opindex mno-lsim
17589 Assume that runtime support has been provided and so there is no need
17590 to include the simulator library (@file{libsim.a}) on the linker
17591 command line.
17593 @end table
17595 @node FT32 Options
17596 @subsection FT32 Options
17597 @cindex FT32 Options
17599 These options are defined specifically for the FT32 port.
17601 @table @gcctabopt
17603 @item -msim
17604 @opindex msim
17605 Specifies that the program will be run on the simulator.  This causes
17606 an alternate runtime startup and library to be linked.
17607 You must not use this option when generating programs that will run on
17608 real hardware; you must provide your own runtime library for whatever
17609 I/O functions are needed.
17611 @item -mlra
17612 @opindex mlra
17613 Enable Local Register Allocation.  This is still experimental for FT32,
17614 so by default the compiler uses standard reload.
17616 @item -mnodiv
17617 @opindex mnodiv
17618 Do not use div and mod instructions.
17620 @end table
17622 @node FRV Options
17623 @subsection FRV Options
17624 @cindex FRV Options
17626 @table @gcctabopt
17627 @item -mgpr-32
17628 @opindex mgpr-32
17630 Only use the first 32 general-purpose registers.
17632 @item -mgpr-64
17633 @opindex mgpr-64
17635 Use all 64 general-purpose registers.
17637 @item -mfpr-32
17638 @opindex mfpr-32
17640 Use only the first 32 floating-point registers.
17642 @item -mfpr-64
17643 @opindex mfpr-64
17645 Use all 64 floating-point registers.
17647 @item -mhard-float
17648 @opindex mhard-float
17650 Use hardware instructions for floating-point operations.
17652 @item -msoft-float
17653 @opindex msoft-float
17655 Use library routines for floating-point operations.
17657 @item -malloc-cc
17658 @opindex malloc-cc
17660 Dynamically allocate condition code registers.
17662 @item -mfixed-cc
17663 @opindex mfixed-cc
17665 Do not try to dynamically allocate condition code registers, only
17666 use @code{icc0} and @code{fcc0}.
17668 @item -mdword
17669 @opindex mdword
17671 Change ABI to use double word insns.
17673 @item -mno-dword
17674 @opindex mno-dword
17676 Do not use double word instructions.
17678 @item -mdouble
17679 @opindex mdouble
17681 Use floating-point double instructions.
17683 @item -mno-double
17684 @opindex mno-double
17686 Do not use floating-point double instructions.
17688 @item -mmedia
17689 @opindex mmedia
17691 Use media instructions.
17693 @item -mno-media
17694 @opindex mno-media
17696 Do not use media instructions.
17698 @item -mmuladd
17699 @opindex mmuladd
17701 Use multiply and add/subtract instructions.
17703 @item -mno-muladd
17704 @opindex mno-muladd
17706 Do not use multiply and add/subtract instructions.
17708 @item -mfdpic
17709 @opindex mfdpic
17711 Select the FDPIC ABI, which uses function descriptors to represent
17712 pointers to functions.  Without any PIC/PIE-related options, it
17713 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
17714 assumes GOT entries and small data are within a 12-bit range from the
17715 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
17716 are computed with 32 bits.
17717 With a @samp{bfin-elf} target, this option implies @option{-msim}.
17719 @item -minline-plt
17720 @opindex minline-plt
17722 Enable inlining of PLT entries in function calls to functions that are
17723 not known to bind locally.  It has no effect without @option{-mfdpic}.
17724 It's enabled by default if optimizing for speed and compiling for
17725 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
17726 optimization option such as @option{-O3} or above is present in the
17727 command line.
17729 @item -mTLS
17730 @opindex mTLS
17732 Assume a large TLS segment when generating thread-local code.
17734 @item -mtls
17735 @opindex mtls
17737 Do not assume a large TLS segment when generating thread-local code.
17739 @item -mgprel-ro
17740 @opindex mgprel-ro
17742 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
17743 that is known to be in read-only sections.  It's enabled by default,
17744 except for @option{-fpic} or @option{-fpie}: even though it may help
17745 make the global offset table smaller, it trades 1 instruction for 4.
17746 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
17747 one of which may be shared by multiple symbols, and it avoids the need
17748 for a GOT entry for the referenced symbol, so it's more likely to be a
17749 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
17751 @item -multilib-library-pic
17752 @opindex multilib-library-pic
17754 Link with the (library, not FD) pic libraries.  It's implied by
17755 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
17756 @option{-fpic} without @option{-mfdpic}.  You should never have to use
17757 it explicitly.
17759 @item -mlinked-fp
17760 @opindex mlinked-fp
17762 Follow the EABI requirement of always creating a frame pointer whenever
17763 a stack frame is allocated.  This option is enabled by default and can
17764 be disabled with @option{-mno-linked-fp}.
17766 @item -mlong-calls
17767 @opindex mlong-calls
17769 Use indirect addressing to call functions outside the current
17770 compilation unit.  This allows the functions to be placed anywhere
17771 within the 32-bit address space.
17773 @item -malign-labels
17774 @opindex malign-labels
17776 Try to align labels to an 8-byte boundary by inserting NOPs into the
17777 previous packet.  This option only has an effect when VLIW packing
17778 is enabled.  It doesn't create new packets; it merely adds NOPs to
17779 existing ones.
17781 @item -mlibrary-pic
17782 @opindex mlibrary-pic
17784 Generate position-independent EABI code.
17786 @item -macc-4
17787 @opindex macc-4
17789 Use only the first four media accumulator registers.
17791 @item -macc-8
17792 @opindex macc-8
17794 Use all eight media accumulator registers.
17796 @item -mpack
17797 @opindex mpack
17799 Pack VLIW instructions.
17801 @item -mno-pack
17802 @opindex mno-pack
17804 Do not pack VLIW instructions.
17806 @item -mno-eflags
17807 @opindex mno-eflags
17809 Do not mark ABI switches in e_flags.
17811 @item -mcond-move
17812 @opindex mcond-move
17814 Enable the use of conditional-move instructions (default).
17816 This switch is mainly for debugging the compiler and will likely be removed
17817 in a future version.
17819 @item -mno-cond-move
17820 @opindex mno-cond-move
17822 Disable the use of conditional-move instructions.
17824 This switch is mainly for debugging the compiler and will likely be removed
17825 in a future version.
17827 @item -mscc
17828 @opindex mscc
17830 Enable the use of conditional set instructions (default).
17832 This switch is mainly for debugging the compiler and will likely be removed
17833 in a future version.
17835 @item -mno-scc
17836 @opindex mno-scc
17838 Disable the use of conditional set instructions.
17840 This switch is mainly for debugging the compiler and will likely be removed
17841 in a future version.
17843 @item -mcond-exec
17844 @opindex mcond-exec
17846 Enable the use of conditional execution (default).
17848 This switch is mainly for debugging the compiler and will likely be removed
17849 in a future version.
17851 @item -mno-cond-exec
17852 @opindex mno-cond-exec
17854 Disable the use of conditional execution.
17856 This switch is mainly for debugging the compiler and will likely be removed
17857 in a future version.
17859 @item -mvliw-branch
17860 @opindex mvliw-branch
17862 Run a pass to pack branches into VLIW instructions (default).
17864 This switch is mainly for debugging the compiler and will likely be removed
17865 in a future version.
17867 @item -mno-vliw-branch
17868 @opindex mno-vliw-branch
17870 Do not run a pass to pack branches into VLIW instructions.
17872 This switch is mainly for debugging the compiler and will likely be removed
17873 in a future version.
17875 @item -mmulti-cond-exec
17876 @opindex mmulti-cond-exec
17878 Enable optimization of @code{&&} and @code{||} in conditional execution
17879 (default).
17881 This switch is mainly for debugging the compiler and will likely be removed
17882 in a future version.
17884 @item -mno-multi-cond-exec
17885 @opindex mno-multi-cond-exec
17887 Disable optimization of @code{&&} and @code{||} in conditional execution.
17889 This switch is mainly for debugging the compiler and will likely be removed
17890 in a future version.
17892 @item -mnested-cond-exec
17893 @opindex mnested-cond-exec
17895 Enable nested conditional execution optimizations (default).
17897 This switch is mainly for debugging the compiler and will likely be removed
17898 in a future version.
17900 @item -mno-nested-cond-exec
17901 @opindex mno-nested-cond-exec
17903 Disable nested conditional execution optimizations.
17905 This switch is mainly for debugging the compiler and will likely be removed
17906 in a future version.
17908 @item -moptimize-membar
17909 @opindex moptimize-membar
17911 This switch removes redundant @code{membar} instructions from the
17912 compiler-generated code.  It is enabled by default.
17914 @item -mno-optimize-membar
17915 @opindex mno-optimize-membar
17917 This switch disables the automatic removal of redundant @code{membar}
17918 instructions from the generated code.
17920 @item -mtomcat-stats
17921 @opindex mtomcat-stats
17923 Cause gas to print out tomcat statistics.
17925 @item -mcpu=@var{cpu}
17926 @opindex mcpu
17928 Select the processor type for which to generate code.  Possible values are
17929 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
17930 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
17932 @end table
17934 @node GNU/Linux Options
17935 @subsection GNU/Linux Options
17937 These @samp{-m} options are defined for GNU/Linux targets:
17939 @table @gcctabopt
17940 @item -mglibc
17941 @opindex mglibc
17942 Use the GNU C library.  This is the default except
17943 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
17944 @samp{*-*-linux-*android*} targets.
17946 @item -muclibc
17947 @opindex muclibc
17948 Use uClibc C library.  This is the default on
17949 @samp{*-*-linux-*uclibc*} targets.
17951 @item -mmusl
17952 @opindex mmusl
17953 Use the musl C library.  This is the default on
17954 @samp{*-*-linux-*musl*} targets.
17956 @item -mbionic
17957 @opindex mbionic
17958 Use Bionic C library.  This is the default on
17959 @samp{*-*-linux-*android*} targets.
17961 @item -mandroid
17962 @opindex mandroid
17963 Compile code compatible with Android platform.  This is the default on
17964 @samp{*-*-linux-*android*} targets.
17966 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
17967 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
17968 this option makes the GCC driver pass Android-specific options to the linker.
17969 Finally, this option causes the preprocessor macro @code{__ANDROID__}
17970 to be defined.
17972 @item -tno-android-cc
17973 @opindex tno-android-cc
17974 Disable compilation effects of @option{-mandroid}, i.e., do not enable
17975 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
17976 @option{-fno-rtti} by default.
17978 @item -tno-android-ld
17979 @opindex tno-android-ld
17980 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
17981 linking options to the linker.
17983 @end table
17985 @node H8/300 Options
17986 @subsection H8/300 Options
17988 These @samp{-m} options are defined for the H8/300 implementations:
17990 @table @gcctabopt
17991 @item -mrelax
17992 @opindex mrelax
17993 Shorten some address references at link time, when possible; uses the
17994 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
17995 ld, Using ld}, for a fuller description.
17997 @item -mh
17998 @opindex mh
17999 Generate code for the H8/300H@.
18001 @item -ms
18002 @opindex ms
18003 Generate code for the H8S@.
18005 @item -mn
18006 @opindex mn
18007 Generate code for the H8S and H8/300H in the normal mode.  This switch
18008 must be used either with @option{-mh} or @option{-ms}.
18010 @item -ms2600
18011 @opindex ms2600
18012 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
18014 @item -mexr
18015 @opindex mexr
18016 Extended registers are stored on stack before execution of function
18017 with monitor attribute. Default option is @option{-mexr}.
18018 This option is valid only for H8S targets.
18020 @item -mno-exr
18021 @opindex mno-exr
18022 Extended registers are not stored on stack before execution of function 
18023 with monitor attribute. Default option is @option{-mno-exr}. 
18024 This option is valid only for H8S targets.
18026 @item -mint32
18027 @opindex mint32
18028 Make @code{int} data 32 bits by default.
18030 @item -malign-300
18031 @opindex malign-300
18032 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
18033 The default for the H8/300H and H8S is to align longs and floats on
18034 4-byte boundaries.
18035 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
18036 This option has no effect on the H8/300.
18037 @end table
18039 @node HPPA Options
18040 @subsection HPPA Options
18041 @cindex HPPA Options
18043 These @samp{-m} options are defined for the HPPA family of computers:
18045 @table @gcctabopt
18046 @item -march=@var{architecture-type}
18047 @opindex march
18048 Generate code for the specified architecture.  The choices for
18049 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
18050 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
18051 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
18052 architecture option for your machine.  Code compiled for lower numbered
18053 architectures runs on higher numbered architectures, but not the
18054 other way around.
18056 @item -mpa-risc-1-0
18057 @itemx -mpa-risc-1-1
18058 @itemx -mpa-risc-2-0
18059 @opindex mpa-risc-1-0
18060 @opindex mpa-risc-1-1
18061 @opindex mpa-risc-2-0
18062 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
18064 @item -mcaller-copies
18065 @opindex mcaller-copies
18066 The caller copies function arguments passed by hidden reference.  This
18067 option should be used with care as it is not compatible with the default
18068 32-bit runtime.  However, only aggregates larger than eight bytes are
18069 passed by hidden reference and the option provides better compatibility
18070 with OpenMP.
18072 @item -mjump-in-delay
18073 @opindex mjump-in-delay
18074 This option is ignored and provided for compatibility purposes only.
18076 @item -mdisable-fpregs
18077 @opindex mdisable-fpregs
18078 Prevent floating-point registers from being used in any manner.  This is
18079 necessary for compiling kernels that perform lazy context switching of
18080 floating-point registers.  If you use this option and attempt to perform
18081 floating-point operations, the compiler aborts.
18083 @item -mdisable-indexing
18084 @opindex mdisable-indexing
18085 Prevent the compiler from using indexing address modes.  This avoids some
18086 rather obscure problems when compiling MIG generated code under MACH@.
18088 @item -mno-space-regs
18089 @opindex mno-space-regs
18090 Generate code that assumes the target has no space registers.  This allows
18091 GCC to generate faster indirect calls and use unscaled index address modes.
18093 Such code is suitable for level 0 PA systems and kernels.
18095 @item -mfast-indirect-calls
18096 @opindex mfast-indirect-calls
18097 Generate code that assumes calls never cross space boundaries.  This
18098 allows GCC to emit code that performs faster indirect calls.
18100 This option does not work in the presence of shared libraries or nested
18101 functions.
18103 @item -mfixed-range=@var{register-range}
18104 @opindex mfixed-range
18105 Generate code treating the given register range as fixed registers.
18106 A fixed register is one that the register allocator cannot use.  This is
18107 useful when compiling kernel code.  A register range is specified as
18108 two registers separated by a dash.  Multiple register ranges can be
18109 specified separated by a comma.
18111 @item -mlong-load-store
18112 @opindex mlong-load-store
18113 Generate 3-instruction load and store sequences as sometimes required by
18114 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
18115 the HP compilers.
18117 @item -mportable-runtime
18118 @opindex mportable-runtime
18119 Use the portable calling conventions proposed by HP for ELF systems.
18121 @item -mgas
18122 @opindex mgas
18123 Enable the use of assembler directives only GAS understands.
18125 @item -mschedule=@var{cpu-type}
18126 @opindex mschedule
18127 Schedule code according to the constraints for the machine type
18128 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
18129 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
18130 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
18131 proper scheduling option for your machine.  The default scheduling is
18132 @samp{8000}.
18134 @item -mlinker-opt
18135 @opindex mlinker-opt
18136 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
18137 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
18138 linkers in which they give bogus error messages when linking some programs.
18140 @item -msoft-float
18141 @opindex msoft-float
18142 Generate output containing library calls for floating point.
18143 @strong{Warning:} the requisite libraries are not available for all HPPA
18144 targets.  Normally the facilities of the machine's usual C compiler are
18145 used, but this cannot be done directly in cross-compilation.  You must make
18146 your own arrangements to provide suitable library functions for
18147 cross-compilation.
18149 @option{-msoft-float} changes the calling convention in the output file;
18150 therefore, it is only useful if you compile @emph{all} of a program with
18151 this option.  In particular, you need to compile @file{libgcc.a}, the
18152 library that comes with GCC, with @option{-msoft-float} in order for
18153 this to work.
18155 @item -msio
18156 @opindex msio
18157 Generate the predefine, @code{_SIO}, for server IO@.  The default is
18158 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
18159 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
18160 options are available under HP-UX and HI-UX@.
18162 @item -mgnu-ld
18163 @opindex mgnu-ld
18164 Use options specific to GNU @command{ld}.
18165 This passes @option{-shared} to @command{ld} when
18166 building a shared library.  It is the default when GCC is configured,
18167 explicitly or implicitly, with the GNU linker.  This option does not
18168 affect which @command{ld} is called; it only changes what parameters
18169 are passed to that @command{ld}.
18170 The @command{ld} that is called is determined by the
18171 @option{--with-ld} configure option, GCC's program search path, and
18172 finally by the user's @env{PATH}.  The linker used by GCC can be printed
18173 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
18174 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
18176 @item -mhp-ld
18177 @opindex mhp-ld
18178 Use options specific to HP @command{ld}.
18179 This passes @option{-b} to @command{ld} when building
18180 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
18181 links.  It is the default when GCC is configured, explicitly or
18182 implicitly, with the HP linker.  This option does not affect
18183 which @command{ld} is called; it only changes what parameters are passed to that
18184 @command{ld}.
18185 The @command{ld} that is called is determined by the @option{--with-ld}
18186 configure option, GCC's program search path, and finally by the user's
18187 @env{PATH}.  The linker used by GCC can be printed using @samp{which
18188 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
18189 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
18191 @item -mlong-calls
18192 @opindex mno-long-calls
18193 Generate code that uses long call sequences.  This ensures that a call
18194 is always able to reach linker generated stubs.  The default is to generate
18195 long calls only when the distance from the call site to the beginning
18196 of the function or translation unit, as the case may be, exceeds a
18197 predefined limit set by the branch type being used.  The limits for
18198 normal calls are 7,600,000 and 240,000 bytes, respectively for the
18199 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
18200 240,000 bytes.
18202 Distances are measured from the beginning of functions when using the
18203 @option{-ffunction-sections} option, or when using the @option{-mgas}
18204 and @option{-mno-portable-runtime} options together under HP-UX with
18205 the SOM linker.
18207 It is normally not desirable to use this option as it degrades
18208 performance.  However, it may be useful in large applications,
18209 particularly when partial linking is used to build the application.
18211 The types of long calls used depends on the capabilities of the
18212 assembler and linker, and the type of code being generated.  The
18213 impact on systems that support long absolute calls, and long pic
18214 symbol-difference or pc-relative calls should be relatively small.
18215 However, an indirect call is used on 32-bit ELF systems in pic code
18216 and it is quite long.
18218 @item -munix=@var{unix-std}
18219 @opindex march
18220 Generate compiler predefines and select a startfile for the specified
18221 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
18222 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
18223 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
18224 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
18225 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
18226 and later.
18228 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
18229 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
18230 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
18231 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
18232 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
18233 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
18235 It is @emph{important} to note that this option changes the interfaces
18236 for various library routines.  It also affects the operational behavior
18237 of the C library.  Thus, @emph{extreme} care is needed in using this
18238 option.
18240 Library code that is intended to operate with more than one UNIX
18241 standard must test, set and restore the variable @code{__xpg4_extended_mask}
18242 as appropriate.  Most GNU software doesn't provide this capability.
18244 @item -nolibdld
18245 @opindex nolibdld
18246 Suppress the generation of link options to search libdld.sl when the
18247 @option{-static} option is specified on HP-UX 10 and later.
18249 @item -static
18250 @opindex static
18251 The HP-UX implementation of setlocale in libc has a dependency on
18252 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
18253 when the @option{-static} option is specified, special link options
18254 are needed to resolve this dependency.
18256 On HP-UX 10 and later, the GCC driver adds the necessary options to
18257 link with libdld.sl when the @option{-static} option is specified.
18258 This causes the resulting binary to be dynamic.  On the 64-bit port,
18259 the linkers generate dynamic binaries by default in any case.  The
18260 @option{-nolibdld} option can be used to prevent the GCC driver from
18261 adding these link options.
18263 @item -threads
18264 @opindex threads
18265 Add support for multithreading with the @dfn{dce thread} library
18266 under HP-UX@.  This option sets flags for both the preprocessor and
18267 linker.
18268 @end table
18270 @node IA-64 Options
18271 @subsection IA-64 Options
18272 @cindex IA-64 Options
18274 These are the @samp{-m} options defined for the Intel IA-64 architecture.
18276 @table @gcctabopt
18277 @item -mbig-endian
18278 @opindex mbig-endian
18279 Generate code for a big-endian target.  This is the default for HP-UX@.
18281 @item -mlittle-endian
18282 @opindex mlittle-endian
18283 Generate code for a little-endian target.  This is the default for AIX5
18284 and GNU/Linux.
18286 @item -mgnu-as
18287 @itemx -mno-gnu-as
18288 @opindex mgnu-as
18289 @opindex mno-gnu-as
18290 Generate (or don't) code for the GNU assembler.  This is the default.
18291 @c Also, this is the default if the configure option @option{--with-gnu-as}
18292 @c is used.
18294 @item -mgnu-ld
18295 @itemx -mno-gnu-ld
18296 @opindex mgnu-ld
18297 @opindex mno-gnu-ld
18298 Generate (or don't) code for the GNU linker.  This is the default.
18299 @c Also, this is the default if the configure option @option{--with-gnu-ld}
18300 @c is used.
18302 @item -mno-pic
18303 @opindex mno-pic
18304 Generate code that does not use a global pointer register.  The result
18305 is not position independent code, and violates the IA-64 ABI@.
18307 @item -mvolatile-asm-stop
18308 @itemx -mno-volatile-asm-stop
18309 @opindex mvolatile-asm-stop
18310 @opindex mno-volatile-asm-stop
18311 Generate (or don't) a stop bit immediately before and after volatile asm
18312 statements.
18314 @item -mregister-names
18315 @itemx -mno-register-names
18316 @opindex mregister-names
18317 @opindex mno-register-names
18318 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
18319 the stacked registers.  This may make assembler output more readable.
18321 @item -mno-sdata
18322 @itemx -msdata
18323 @opindex mno-sdata
18324 @opindex msdata
18325 Disable (or enable) optimizations that use the small data section.  This may
18326 be useful for working around optimizer bugs.
18328 @item -mconstant-gp
18329 @opindex mconstant-gp
18330 Generate code that uses a single constant global pointer value.  This is
18331 useful when compiling kernel code.
18333 @item -mauto-pic
18334 @opindex mauto-pic
18335 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
18336 This is useful when compiling firmware code.
18338 @item -minline-float-divide-min-latency
18339 @opindex minline-float-divide-min-latency
18340 Generate code for inline divides of floating-point values
18341 using the minimum latency algorithm.
18343 @item -minline-float-divide-max-throughput
18344 @opindex minline-float-divide-max-throughput
18345 Generate code for inline divides of floating-point values
18346 using the maximum throughput algorithm.
18348 @item -mno-inline-float-divide
18349 @opindex mno-inline-float-divide
18350 Do not generate inline code for divides of floating-point values.
18352 @item -minline-int-divide-min-latency
18353 @opindex minline-int-divide-min-latency
18354 Generate code for inline divides of integer values
18355 using the minimum latency algorithm.
18357 @item -minline-int-divide-max-throughput
18358 @opindex minline-int-divide-max-throughput
18359 Generate code for inline divides of integer values
18360 using the maximum throughput algorithm.
18362 @item -mno-inline-int-divide
18363 @opindex mno-inline-int-divide
18364 Do not generate inline code for divides of integer values.
18366 @item -minline-sqrt-min-latency
18367 @opindex minline-sqrt-min-latency
18368 Generate code for inline square roots
18369 using the minimum latency algorithm.
18371 @item -minline-sqrt-max-throughput
18372 @opindex minline-sqrt-max-throughput
18373 Generate code for inline square roots
18374 using the maximum throughput algorithm.
18376 @item -mno-inline-sqrt
18377 @opindex mno-inline-sqrt
18378 Do not generate inline code for @code{sqrt}.
18380 @item -mfused-madd
18381 @itemx -mno-fused-madd
18382 @opindex mfused-madd
18383 @opindex mno-fused-madd
18384 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
18385 instructions.  The default is to use these instructions.
18387 @item -mno-dwarf2-asm
18388 @itemx -mdwarf2-asm
18389 @opindex mno-dwarf2-asm
18390 @opindex mdwarf2-asm
18391 Don't (or do) generate assembler code for the DWARF line number debugging
18392 info.  This may be useful when not using the GNU assembler.
18394 @item -mearly-stop-bits
18395 @itemx -mno-early-stop-bits
18396 @opindex mearly-stop-bits
18397 @opindex mno-early-stop-bits
18398 Allow stop bits to be placed earlier than immediately preceding the
18399 instruction that triggered the stop bit.  This can improve instruction
18400 scheduling, but does not always do so.
18402 @item -mfixed-range=@var{register-range}
18403 @opindex mfixed-range
18404 Generate code treating the given register range as fixed registers.
18405 A fixed register is one that the register allocator cannot use.  This is
18406 useful when compiling kernel code.  A register range is specified as
18407 two registers separated by a dash.  Multiple register ranges can be
18408 specified separated by a comma.
18410 @item -mtls-size=@var{tls-size}
18411 @opindex mtls-size
18412 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
18415 @item -mtune=@var{cpu-type}
18416 @opindex mtune
18417 Tune the instruction scheduling for a particular CPU, Valid values are
18418 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
18419 and @samp{mckinley}.
18421 @item -milp32
18422 @itemx -mlp64
18423 @opindex milp32
18424 @opindex mlp64
18425 Generate code for a 32-bit or 64-bit environment.
18426 The 32-bit environment sets int, long and pointer to 32 bits.
18427 The 64-bit environment sets int to 32 bits and long and pointer
18428 to 64 bits.  These are HP-UX specific flags.
18430 @item -mno-sched-br-data-spec
18431 @itemx -msched-br-data-spec
18432 @opindex mno-sched-br-data-spec
18433 @opindex msched-br-data-spec
18434 (Dis/En)able data speculative scheduling before reload.
18435 This results in generation of @code{ld.a} instructions and
18436 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
18437 The default setting is disabled.
18439 @item -msched-ar-data-spec
18440 @itemx -mno-sched-ar-data-spec
18441 @opindex msched-ar-data-spec
18442 @opindex mno-sched-ar-data-spec
18443 (En/Dis)able data speculative scheduling after reload.
18444 This results in generation of @code{ld.a} instructions and
18445 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
18446 The default setting is enabled.
18448 @item -mno-sched-control-spec
18449 @itemx -msched-control-spec
18450 @opindex mno-sched-control-spec
18451 @opindex msched-control-spec
18452 (Dis/En)able control speculative scheduling.  This feature is
18453 available only during region scheduling (i.e.@: before reload).
18454 This results in generation of the @code{ld.s} instructions and
18455 the corresponding check instructions @code{chk.s}.
18456 The default setting is disabled.
18458 @item -msched-br-in-data-spec
18459 @itemx -mno-sched-br-in-data-spec
18460 @opindex msched-br-in-data-spec
18461 @opindex mno-sched-br-in-data-spec
18462 (En/Dis)able speculative scheduling of the instructions that
18463 are dependent on the data speculative loads before reload.
18464 This is effective only with @option{-msched-br-data-spec} enabled.
18465 The default setting is enabled.
18467 @item -msched-ar-in-data-spec
18468 @itemx -mno-sched-ar-in-data-spec
18469 @opindex msched-ar-in-data-spec
18470 @opindex mno-sched-ar-in-data-spec
18471 (En/Dis)able speculative scheduling of the instructions that
18472 are dependent on the data speculative loads after reload.
18473 This is effective only with @option{-msched-ar-data-spec} enabled.
18474 The default setting is enabled.
18476 @item -msched-in-control-spec
18477 @itemx -mno-sched-in-control-spec
18478 @opindex msched-in-control-spec
18479 @opindex mno-sched-in-control-spec
18480 (En/Dis)able speculative scheduling of the instructions that
18481 are dependent on the control speculative loads.
18482 This is effective only with @option{-msched-control-spec} enabled.
18483 The default setting is enabled.
18485 @item -mno-sched-prefer-non-data-spec-insns
18486 @itemx -msched-prefer-non-data-spec-insns
18487 @opindex mno-sched-prefer-non-data-spec-insns
18488 @opindex msched-prefer-non-data-spec-insns
18489 If enabled, data-speculative instructions are chosen for schedule
18490 only if there are no other choices at the moment.  This makes
18491 the use of the data speculation much more conservative.
18492 The default setting is disabled.
18494 @item -mno-sched-prefer-non-control-spec-insns
18495 @itemx -msched-prefer-non-control-spec-insns
18496 @opindex mno-sched-prefer-non-control-spec-insns
18497 @opindex msched-prefer-non-control-spec-insns
18498 If enabled, control-speculative instructions are chosen for schedule
18499 only if there are no other choices at the moment.  This makes
18500 the use of the control speculation much more conservative.
18501 The default setting is disabled.
18503 @item -mno-sched-count-spec-in-critical-path
18504 @itemx -msched-count-spec-in-critical-path
18505 @opindex mno-sched-count-spec-in-critical-path
18506 @opindex msched-count-spec-in-critical-path
18507 If enabled, speculative dependencies are considered during
18508 computation of the instructions priorities.  This makes the use of the
18509 speculation a bit more conservative.
18510 The default setting is disabled.
18512 @item -msched-spec-ldc
18513 @opindex msched-spec-ldc
18514 Use a simple data speculation check.  This option is on by default.
18516 @item -msched-control-spec-ldc
18517 @opindex msched-spec-ldc
18518 Use a simple check for control speculation.  This option is on by default.
18520 @item -msched-stop-bits-after-every-cycle
18521 @opindex msched-stop-bits-after-every-cycle
18522 Place a stop bit after every cycle when scheduling.  This option is on
18523 by default.
18525 @item -msched-fp-mem-deps-zero-cost
18526 @opindex msched-fp-mem-deps-zero-cost
18527 Assume that floating-point stores and loads are not likely to cause a conflict
18528 when placed into the same instruction group.  This option is disabled by
18529 default.
18531 @item -msel-sched-dont-check-control-spec
18532 @opindex msel-sched-dont-check-control-spec
18533 Generate checks for control speculation in selective scheduling.
18534 This flag is disabled by default.
18536 @item -msched-max-memory-insns=@var{max-insns}
18537 @opindex msched-max-memory-insns
18538 Limit on the number of memory insns per instruction group, giving lower
18539 priority to subsequent memory insns attempting to schedule in the same
18540 instruction group. Frequently useful to prevent cache bank conflicts.
18541 The default value is 1.
18543 @item -msched-max-memory-insns-hard-limit
18544 @opindex msched-max-memory-insns-hard-limit
18545 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
18546 disallowing more than that number in an instruction group.
18547 Otherwise, the limit is ``soft'', meaning that non-memory operations
18548 are preferred when the limit is reached, but memory operations may still
18549 be scheduled.
18551 @end table
18553 @node LM32 Options
18554 @subsection LM32 Options
18555 @cindex LM32 options
18557 These @option{-m} options are defined for the LatticeMico32 architecture:
18559 @table @gcctabopt
18560 @item -mbarrel-shift-enabled
18561 @opindex mbarrel-shift-enabled
18562 Enable barrel-shift instructions.
18564 @item -mdivide-enabled
18565 @opindex mdivide-enabled
18566 Enable divide and modulus instructions.
18568 @item -mmultiply-enabled
18569 @opindex multiply-enabled
18570 Enable multiply instructions.
18572 @item -msign-extend-enabled
18573 @opindex msign-extend-enabled
18574 Enable sign extend instructions.
18576 @item -muser-enabled
18577 @opindex muser-enabled
18578 Enable user-defined instructions.
18580 @end table
18582 @node M32C Options
18583 @subsection M32C Options
18584 @cindex M32C options
18586 @table @gcctabopt
18587 @item -mcpu=@var{name}
18588 @opindex mcpu=
18589 Select the CPU for which code is generated.  @var{name} may be one of
18590 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
18591 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
18592 the M32C/80 series.
18594 @item -msim
18595 @opindex msim
18596 Specifies that the program will be run on the simulator.  This causes
18597 an alternate runtime library to be linked in which supports, for
18598 example, file I/O@.  You must not use this option when generating
18599 programs that will run on real hardware; you must provide your own
18600 runtime library for whatever I/O functions are needed.
18602 @item -memregs=@var{number}
18603 @opindex memregs=
18604 Specifies the number of memory-based pseudo-registers GCC uses
18605 during code generation.  These pseudo-registers are used like real
18606 registers, so there is a tradeoff between GCC's ability to fit the
18607 code into available registers, and the performance penalty of using
18608 memory instead of registers.  Note that all modules in a program must
18609 be compiled with the same value for this option.  Because of that, you
18610 must not use this option with GCC's default runtime libraries.
18612 @end table
18614 @node M32R/D Options
18615 @subsection M32R/D Options
18616 @cindex M32R/D options
18618 These @option{-m} options are defined for Renesas M32R/D architectures:
18620 @table @gcctabopt
18621 @item -m32r2
18622 @opindex m32r2
18623 Generate code for the M32R/2@.
18625 @item -m32rx
18626 @opindex m32rx
18627 Generate code for the M32R/X@.
18629 @item -m32r
18630 @opindex m32r
18631 Generate code for the M32R@.  This is the default.
18633 @item -mmodel=small
18634 @opindex mmodel=small
18635 Assume all objects live in the lower 16MB of memory (so that their addresses
18636 can be loaded with the @code{ld24} instruction), and assume all subroutines
18637 are reachable with the @code{bl} instruction.
18638 This is the default.
18640 The addressability of a particular object can be set with the
18641 @code{model} attribute.
18643 @item -mmodel=medium
18644 @opindex mmodel=medium
18645 Assume objects may be anywhere in the 32-bit address space (the compiler
18646 generates @code{seth/add3} instructions to load their addresses), and
18647 assume all subroutines are reachable with the @code{bl} instruction.
18649 @item -mmodel=large
18650 @opindex mmodel=large
18651 Assume objects may be anywhere in the 32-bit address space (the compiler
18652 generates @code{seth/add3} instructions to load their addresses), and
18653 assume subroutines may not be reachable with the @code{bl} instruction
18654 (the compiler generates the much slower @code{seth/add3/jl}
18655 instruction sequence).
18657 @item -msdata=none
18658 @opindex msdata=none
18659 Disable use of the small data area.  Variables are put into
18660 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
18661 @code{section} attribute has been specified).
18662 This is the default.
18664 The small data area consists of sections @code{.sdata} and @code{.sbss}.
18665 Objects may be explicitly put in the small data area with the
18666 @code{section} attribute using one of these sections.
18668 @item -msdata=sdata
18669 @opindex msdata=sdata
18670 Put small global and static data in the small data area, but do not
18671 generate special code to reference them.
18673 @item -msdata=use
18674 @opindex msdata=use
18675 Put small global and static data in the small data area, and generate
18676 special instructions to reference them.
18678 @item -G @var{num}
18679 @opindex G
18680 @cindex smaller data references
18681 Put global and static objects less than or equal to @var{num} bytes
18682 into the small data or BSS sections instead of the normal data or BSS
18683 sections.  The default value of @var{num} is 8.
18684 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
18685 for this option to have any effect.
18687 All modules should be compiled with the same @option{-G @var{num}} value.
18688 Compiling with different values of @var{num} may or may not work; if it
18689 doesn't the linker gives an error message---incorrect code is not
18690 generated.
18692 @item -mdebug
18693 @opindex mdebug
18694 Makes the M32R-specific code in the compiler display some statistics
18695 that might help in debugging programs.
18697 @item -malign-loops
18698 @opindex malign-loops
18699 Align all loops to a 32-byte boundary.
18701 @item -mno-align-loops
18702 @opindex mno-align-loops
18703 Do not enforce a 32-byte alignment for loops.  This is the default.
18705 @item -missue-rate=@var{number}
18706 @opindex missue-rate=@var{number}
18707 Issue @var{number} instructions per cycle.  @var{number} can only be 1
18708 or 2.
18710 @item -mbranch-cost=@var{number}
18711 @opindex mbranch-cost=@var{number}
18712 @var{number} can only be 1 or 2.  If it is 1 then branches are
18713 preferred over conditional code, if it is 2, then the opposite applies.
18715 @item -mflush-trap=@var{number}
18716 @opindex mflush-trap=@var{number}
18717 Specifies the trap number to use to flush the cache.  The default is
18718 12.  Valid numbers are between 0 and 15 inclusive.
18720 @item -mno-flush-trap
18721 @opindex mno-flush-trap
18722 Specifies that the cache cannot be flushed by using a trap.
18724 @item -mflush-func=@var{name}
18725 @opindex mflush-func=@var{name}
18726 Specifies the name of the operating system function to call to flush
18727 the cache.  The default is @samp{_flush_cache}, but a function call
18728 is only used if a trap is not available.
18730 @item -mno-flush-func
18731 @opindex mno-flush-func
18732 Indicates that there is no OS function for flushing the cache.
18734 @end table
18736 @node M680x0 Options
18737 @subsection M680x0 Options
18738 @cindex M680x0 options
18740 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
18741 The default settings depend on which architecture was selected when
18742 the compiler was configured; the defaults for the most common choices
18743 are given below.
18745 @table @gcctabopt
18746 @item -march=@var{arch}
18747 @opindex march
18748 Generate code for a specific M680x0 or ColdFire instruction set
18749 architecture.  Permissible values of @var{arch} for M680x0
18750 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
18751 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
18752 architectures are selected according to Freescale's ISA classification
18753 and the permissible values are: @samp{isaa}, @samp{isaaplus},
18754 @samp{isab} and @samp{isac}.
18756 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
18757 code for a ColdFire target.  The @var{arch} in this macro is one of the
18758 @option{-march} arguments given above.
18760 When used together, @option{-march} and @option{-mtune} select code
18761 that runs on a family of similar processors but that is optimized
18762 for a particular microarchitecture.
18764 @item -mcpu=@var{cpu}
18765 @opindex mcpu
18766 Generate code for a specific M680x0 or ColdFire processor.
18767 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
18768 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
18769 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
18770 below, which also classifies the CPUs into families:
18772 @multitable @columnfractions 0.20 0.80
18773 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
18774 @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}
18775 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
18776 @item @samp{5206e} @tab @samp{5206e}
18777 @item @samp{5208} @tab @samp{5207} @samp{5208}
18778 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
18779 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
18780 @item @samp{5216} @tab @samp{5214} @samp{5216}
18781 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
18782 @item @samp{5225} @tab @samp{5224} @samp{5225}
18783 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
18784 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
18785 @item @samp{5249} @tab @samp{5249}
18786 @item @samp{5250} @tab @samp{5250}
18787 @item @samp{5271} @tab @samp{5270} @samp{5271}
18788 @item @samp{5272} @tab @samp{5272}
18789 @item @samp{5275} @tab @samp{5274} @samp{5275}
18790 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
18791 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
18792 @item @samp{5307} @tab @samp{5307}
18793 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
18794 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
18795 @item @samp{5407} @tab @samp{5407}
18796 @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}
18797 @end multitable
18799 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
18800 @var{arch} is compatible with @var{cpu}.  Other combinations of
18801 @option{-mcpu} and @option{-march} are rejected.
18803 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
18804 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
18805 where the value of @var{family} is given by the table above.
18807 @item -mtune=@var{tune}
18808 @opindex mtune
18809 Tune the code for a particular microarchitecture within the
18810 constraints set by @option{-march} and @option{-mcpu}.
18811 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
18812 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
18813 and @samp{cpu32}.  The ColdFire microarchitectures
18814 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
18816 You can also use @option{-mtune=68020-40} for code that needs
18817 to run relatively well on 68020, 68030 and 68040 targets.
18818 @option{-mtune=68020-60} is similar but includes 68060 targets
18819 as well.  These two options select the same tuning decisions as
18820 @option{-m68020-40} and @option{-m68020-60} respectively.
18822 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
18823 when tuning for 680x0 architecture @var{arch}.  It also defines
18824 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
18825 option is used.  If GCC is tuning for a range of architectures,
18826 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
18827 it defines the macros for every architecture in the range.
18829 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
18830 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
18831 of the arguments given above.
18833 @item -m68000
18834 @itemx -mc68000
18835 @opindex m68000
18836 @opindex mc68000
18837 Generate output for a 68000.  This is the default
18838 when the compiler is configured for 68000-based systems.
18839 It is equivalent to @option{-march=68000}.
18841 Use this option for microcontrollers with a 68000 or EC000 core,
18842 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
18844 @item -m68010
18845 @opindex m68010
18846 Generate output for a 68010.  This is the default
18847 when the compiler is configured for 68010-based systems.
18848 It is equivalent to @option{-march=68010}.
18850 @item -m68020
18851 @itemx -mc68020
18852 @opindex m68020
18853 @opindex mc68020
18854 Generate output for a 68020.  This is the default
18855 when the compiler is configured for 68020-based systems.
18856 It is equivalent to @option{-march=68020}.
18858 @item -m68030
18859 @opindex m68030
18860 Generate output for a 68030.  This is the default when the compiler is
18861 configured for 68030-based systems.  It is equivalent to
18862 @option{-march=68030}.
18864 @item -m68040
18865 @opindex m68040
18866 Generate output for a 68040.  This is the default when the compiler is
18867 configured for 68040-based systems.  It is equivalent to
18868 @option{-march=68040}.
18870 This option inhibits the use of 68881/68882 instructions that have to be
18871 emulated by software on the 68040.  Use this option if your 68040 does not
18872 have code to emulate those instructions.
18874 @item -m68060
18875 @opindex m68060
18876 Generate output for a 68060.  This is the default when the compiler is
18877 configured for 68060-based systems.  It is equivalent to
18878 @option{-march=68060}.
18880 This option inhibits the use of 68020 and 68881/68882 instructions that
18881 have to be emulated by software on the 68060.  Use this option if your 68060
18882 does not have code to emulate those instructions.
18884 @item -mcpu32
18885 @opindex mcpu32
18886 Generate output for a CPU32.  This is the default
18887 when the compiler is configured for CPU32-based systems.
18888 It is equivalent to @option{-march=cpu32}.
18890 Use this option for microcontrollers with a
18891 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
18892 68336, 68340, 68341, 68349 and 68360.
18894 @item -m5200
18895 @opindex m5200
18896 Generate output for a 520X ColdFire CPU@.  This is the default
18897 when the compiler is configured for 520X-based systems.
18898 It is equivalent to @option{-mcpu=5206}, and is now deprecated
18899 in favor of that option.
18901 Use this option for microcontroller with a 5200 core, including
18902 the MCF5202, MCF5203, MCF5204 and MCF5206.
18904 @item -m5206e
18905 @opindex m5206e
18906 Generate output for a 5206e ColdFire CPU@.  The option is now
18907 deprecated in favor of the equivalent @option{-mcpu=5206e}.
18909 @item -m528x
18910 @opindex m528x
18911 Generate output for a member of the ColdFire 528X family.
18912 The option is now deprecated in favor of the equivalent
18913 @option{-mcpu=528x}.
18915 @item -m5307
18916 @opindex m5307
18917 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
18918 in favor of the equivalent @option{-mcpu=5307}.
18920 @item -m5407
18921 @opindex m5407
18922 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
18923 in favor of the equivalent @option{-mcpu=5407}.
18925 @item -mcfv4e
18926 @opindex mcfv4e
18927 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
18928 This includes use of hardware floating-point instructions.
18929 The option is equivalent to @option{-mcpu=547x}, and is now
18930 deprecated in favor of that option.
18932 @item -m68020-40
18933 @opindex m68020-40
18934 Generate output for a 68040, without using any of the new instructions.
18935 This results in code that can run relatively efficiently on either a
18936 68020/68881 or a 68030 or a 68040.  The generated code does use the
18937 68881 instructions that are emulated on the 68040.
18939 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
18941 @item -m68020-60
18942 @opindex m68020-60
18943 Generate output for a 68060, without using any of the new instructions.
18944 This results in code that can run relatively efficiently on either a
18945 68020/68881 or a 68030 or a 68040.  The generated code does use the
18946 68881 instructions that are emulated on the 68060.
18948 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
18950 @item -mhard-float
18951 @itemx -m68881
18952 @opindex mhard-float
18953 @opindex m68881
18954 Generate floating-point instructions.  This is the default for 68020
18955 and above, and for ColdFire devices that have an FPU@.  It defines the
18956 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
18957 on ColdFire targets.
18959 @item -msoft-float
18960 @opindex msoft-float
18961 Do not generate floating-point instructions; use library calls instead.
18962 This is the default for 68000, 68010, and 68832 targets.  It is also
18963 the default for ColdFire devices that have no FPU.
18965 @item -mdiv
18966 @itemx -mno-div
18967 @opindex mdiv
18968 @opindex mno-div
18969 Generate (do not generate) ColdFire hardware divide and remainder
18970 instructions.  If @option{-march} is used without @option{-mcpu},
18971 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
18972 architectures.  Otherwise, the default is taken from the target CPU
18973 (either the default CPU, or the one specified by @option{-mcpu}).  For
18974 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
18975 @option{-mcpu=5206e}.
18977 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
18979 @item -mshort
18980 @opindex mshort
18981 Consider type @code{int} to be 16 bits wide, like @code{short int}.
18982 Additionally, parameters passed on the stack are also aligned to a
18983 16-bit boundary even on targets whose API mandates promotion to 32-bit.
18985 @item -mno-short
18986 @opindex mno-short
18987 Do not consider type @code{int} to be 16 bits wide.  This is the default.
18989 @item -mnobitfield
18990 @itemx -mno-bitfield
18991 @opindex mnobitfield
18992 @opindex mno-bitfield
18993 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
18994 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
18996 @item -mbitfield
18997 @opindex mbitfield
18998 Do use the bit-field instructions.  The @option{-m68020} option implies
18999 @option{-mbitfield}.  This is the default if you use a configuration
19000 designed for a 68020.
19002 @item -mrtd
19003 @opindex mrtd
19004 Use a different function-calling convention, in which functions
19005 that take a fixed number of arguments return with the @code{rtd}
19006 instruction, which pops their arguments while returning.  This
19007 saves one instruction in the caller since there is no need to pop
19008 the arguments there.
19010 This calling convention is incompatible with the one normally
19011 used on Unix, so you cannot use it if you need to call libraries
19012 compiled with the Unix compiler.
19014 Also, you must provide function prototypes for all functions that
19015 take variable numbers of arguments (including @code{printf});
19016 otherwise incorrect code is generated for calls to those
19017 functions.
19019 In addition, seriously incorrect code results if you call a
19020 function with too many arguments.  (Normally, extra arguments are
19021 harmlessly ignored.)
19023 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
19024 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
19026 @item -mno-rtd
19027 @opindex mno-rtd
19028 Do not use the calling conventions selected by @option{-mrtd}.
19029 This is the default.
19031 @item -malign-int
19032 @itemx -mno-align-int
19033 @opindex malign-int
19034 @opindex mno-align-int
19035 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
19036 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
19037 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
19038 Aligning variables on 32-bit boundaries produces code that runs somewhat
19039 faster on processors with 32-bit busses at the expense of more memory.
19041 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
19042 aligns structures containing the above types differently than
19043 most published application binary interface specifications for the m68k.
19045 @item -mpcrel
19046 @opindex mpcrel
19047 Use the pc-relative addressing mode of the 68000 directly, instead of
19048 using a global offset table.  At present, this option implies @option{-fpic},
19049 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
19050 not presently supported with @option{-mpcrel}, though this could be supported for
19051 68020 and higher processors.
19053 @item -mno-strict-align
19054 @itemx -mstrict-align
19055 @opindex mno-strict-align
19056 @opindex mstrict-align
19057 Do not (do) assume that unaligned memory references are handled by
19058 the system.
19060 @item -msep-data
19061 Generate code that allows the data segment to be located in a different
19062 area of memory from the text segment.  This allows for execute-in-place in
19063 an environment without virtual memory management.  This option implies
19064 @option{-fPIC}.
19066 @item -mno-sep-data
19067 Generate code that assumes that the data segment follows the text segment.
19068 This is the default.
19070 @item -mid-shared-library
19071 Generate code that supports shared libraries via the library ID method.
19072 This allows for execute-in-place and shared libraries in an environment
19073 without virtual memory management.  This option implies @option{-fPIC}.
19075 @item -mno-id-shared-library
19076 Generate code that doesn't assume ID-based shared libraries are being used.
19077 This is the default.
19079 @item -mshared-library-id=n
19080 Specifies the identification number of the ID-based shared library being
19081 compiled.  Specifying a value of 0 generates more compact code; specifying
19082 other values forces the allocation of that number to the current
19083 library, but is no more space- or time-efficient than omitting this option.
19085 @item -mxgot
19086 @itemx -mno-xgot
19087 @opindex mxgot
19088 @opindex mno-xgot
19089 When generating position-independent code for ColdFire, generate code
19090 that works if the GOT has more than 8192 entries.  This code is
19091 larger and slower than code generated without this option.  On M680x0
19092 processors, this option is not needed; @option{-fPIC} suffices.
19094 GCC normally uses a single instruction to load values from the GOT@.
19095 While this is relatively efficient, it only works if the GOT
19096 is smaller than about 64k.  Anything larger causes the linker
19097 to report an error such as:
19099 @cindex relocation truncated to fit (ColdFire)
19100 @smallexample
19101 relocation truncated to fit: R_68K_GOT16O foobar
19102 @end smallexample
19104 If this happens, you should recompile your code with @option{-mxgot}.
19105 It should then work with very large GOTs.  However, code generated with
19106 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
19107 the value of a global symbol.
19109 Note that some linkers, including newer versions of the GNU linker,
19110 can create multiple GOTs and sort GOT entries.  If you have such a linker,
19111 you should only need to use @option{-mxgot} when compiling a single
19112 object file that accesses more than 8192 GOT entries.  Very few do.
19114 These options have no effect unless GCC is generating
19115 position-independent code.
19117 @item -mlong-jump-table-offsets
19118 @opindex mlong-jump-table-offsets
19119 Use 32-bit offsets in @code{switch} tables.  The default is to use
19120 16-bit offsets.
19122 @end table
19124 @node MCore Options
19125 @subsection MCore Options
19126 @cindex MCore options
19128 These are the @samp{-m} options defined for the Motorola M*Core
19129 processors.
19131 @table @gcctabopt
19133 @item -mhardlit
19134 @itemx -mno-hardlit
19135 @opindex mhardlit
19136 @opindex mno-hardlit
19137 Inline constants into the code stream if it can be done in two
19138 instructions or less.
19140 @item -mdiv
19141 @itemx -mno-div
19142 @opindex mdiv
19143 @opindex mno-div
19144 Use the divide instruction.  (Enabled by default).
19146 @item -mrelax-immediate
19147 @itemx -mno-relax-immediate
19148 @opindex mrelax-immediate
19149 @opindex mno-relax-immediate
19150 Allow arbitrary-sized immediates in bit operations.
19152 @item -mwide-bitfields
19153 @itemx -mno-wide-bitfields
19154 @opindex mwide-bitfields
19155 @opindex mno-wide-bitfields
19156 Always treat bit-fields as @code{int}-sized.
19158 @item -m4byte-functions
19159 @itemx -mno-4byte-functions
19160 @opindex m4byte-functions
19161 @opindex mno-4byte-functions
19162 Force all functions to be aligned to a 4-byte boundary.
19164 @item -mcallgraph-data
19165 @itemx -mno-callgraph-data
19166 @opindex mcallgraph-data
19167 @opindex mno-callgraph-data
19168 Emit callgraph information.
19170 @item -mslow-bytes
19171 @itemx -mno-slow-bytes
19172 @opindex mslow-bytes
19173 @opindex mno-slow-bytes
19174 Prefer word access when reading byte quantities.
19176 @item -mlittle-endian
19177 @itemx -mbig-endian
19178 @opindex mlittle-endian
19179 @opindex mbig-endian
19180 Generate code for a little-endian target.
19182 @item -m210
19183 @itemx -m340
19184 @opindex m210
19185 @opindex m340
19186 Generate code for the 210 processor.
19188 @item -mno-lsim
19189 @opindex mno-lsim
19190 Assume that runtime support has been provided and so omit the
19191 simulator library (@file{libsim.a)} from the linker command line.
19193 @item -mstack-increment=@var{size}
19194 @opindex mstack-increment
19195 Set the maximum amount for a single stack increment operation.  Large
19196 values can increase the speed of programs that contain functions
19197 that need a large amount of stack space, but they can also trigger a
19198 segmentation fault if the stack is extended too much.  The default
19199 value is 0x1000.
19201 @end table
19203 @node MeP Options
19204 @subsection MeP Options
19205 @cindex MeP options
19207 @table @gcctabopt
19209 @item -mabsdiff
19210 @opindex mabsdiff
19211 Enables the @code{abs} instruction, which is the absolute difference
19212 between two registers.
19214 @item -mall-opts
19215 @opindex mall-opts
19216 Enables all the optional instructions---average, multiply, divide, bit
19217 operations, leading zero, absolute difference, min/max, clip, and
19218 saturation.
19221 @item -maverage
19222 @opindex maverage
19223 Enables the @code{ave} instruction, which computes the average of two
19224 registers.
19226 @item -mbased=@var{n}
19227 @opindex mbased=
19228 Variables of size @var{n} bytes or smaller are placed in the
19229 @code{.based} section by default.  Based variables use the @code{$tp}
19230 register as a base register, and there is a 128-byte limit to the
19231 @code{.based} section.
19233 @item -mbitops
19234 @opindex mbitops
19235 Enables the bit operation instructions---bit test (@code{btstm}), set
19236 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
19237 test-and-set (@code{tas}).
19239 @item -mc=@var{name}
19240 @opindex mc=
19241 Selects which section constant data is placed in.  @var{name} may
19242 be @samp{tiny}, @samp{near}, or @samp{far}.
19244 @item -mclip
19245 @opindex mclip
19246 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
19247 useful unless you also provide @option{-mminmax}.
19249 @item -mconfig=@var{name}
19250 @opindex mconfig=
19251 Selects one of the built-in core configurations.  Each MeP chip has
19252 one or more modules in it; each module has a core CPU and a variety of
19253 coprocessors, optional instructions, and peripherals.  The
19254 @code{MeP-Integrator} tool, not part of GCC, provides these
19255 configurations through this option; using this option is the same as
19256 using all the corresponding command-line options.  The default
19257 configuration is @samp{default}.
19259 @item -mcop
19260 @opindex mcop
19261 Enables the coprocessor instructions.  By default, this is a 32-bit
19262 coprocessor.  Note that the coprocessor is normally enabled via the
19263 @option{-mconfig=} option.
19265 @item -mcop32
19266 @opindex mcop32
19267 Enables the 32-bit coprocessor's instructions.
19269 @item -mcop64
19270 @opindex mcop64
19271 Enables the 64-bit coprocessor's instructions.
19273 @item -mivc2
19274 @opindex mivc2
19275 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
19277 @item -mdc
19278 @opindex mdc
19279 Causes constant variables to be placed in the @code{.near} section.
19281 @item -mdiv
19282 @opindex mdiv
19283 Enables the @code{div} and @code{divu} instructions.
19285 @item -meb
19286 @opindex meb
19287 Generate big-endian code.
19289 @item -mel
19290 @opindex mel
19291 Generate little-endian code.
19293 @item -mio-volatile
19294 @opindex mio-volatile
19295 Tells the compiler that any variable marked with the @code{io}
19296 attribute is to be considered volatile.
19298 @item -ml
19299 @opindex ml
19300 Causes variables to be assigned to the @code{.far} section by default.
19302 @item -mleadz
19303 @opindex mleadz
19304 Enables the @code{leadz} (leading zero) instruction.
19306 @item -mm
19307 @opindex mm
19308 Causes variables to be assigned to the @code{.near} section by default.
19310 @item -mminmax
19311 @opindex mminmax
19312 Enables the @code{min} and @code{max} instructions.
19314 @item -mmult
19315 @opindex mmult
19316 Enables the multiplication and multiply-accumulate instructions.
19318 @item -mno-opts
19319 @opindex mno-opts
19320 Disables all the optional instructions enabled by @option{-mall-opts}.
19322 @item -mrepeat
19323 @opindex mrepeat
19324 Enables the @code{repeat} and @code{erepeat} instructions, used for
19325 low-overhead looping.
19327 @item -ms
19328 @opindex ms
19329 Causes all variables to default to the @code{.tiny} section.  Note
19330 that there is a 65536-byte limit to this section.  Accesses to these
19331 variables use the @code{%gp} base register.
19333 @item -msatur
19334 @opindex msatur
19335 Enables the saturation instructions.  Note that the compiler does not
19336 currently generate these itself, but this option is included for
19337 compatibility with other tools, like @code{as}.
19339 @item -msdram
19340 @opindex msdram
19341 Link the SDRAM-based runtime instead of the default ROM-based runtime.
19343 @item -msim
19344 @opindex msim
19345 Link the simulator run-time libraries.
19347 @item -msimnovec
19348 @opindex msimnovec
19349 Link the simulator runtime libraries, excluding built-in support
19350 for reset and exception vectors and tables.
19352 @item -mtf
19353 @opindex mtf
19354 Causes all functions to default to the @code{.far} section.  Without
19355 this option, functions default to the @code{.near} section.
19357 @item -mtiny=@var{n}
19358 @opindex mtiny=
19359 Variables that are @var{n} bytes or smaller are allocated to the
19360 @code{.tiny} section.  These variables use the @code{$gp} base
19361 register.  The default for this option is 4, but note that there's a
19362 65536-byte limit to the @code{.tiny} section.
19364 @end table
19366 @node MicroBlaze Options
19367 @subsection MicroBlaze Options
19368 @cindex MicroBlaze Options
19370 @table @gcctabopt
19372 @item -msoft-float
19373 @opindex msoft-float
19374 Use software emulation for floating point (default).
19376 @item -mhard-float
19377 @opindex mhard-float
19378 Use hardware floating-point instructions.
19380 @item -mmemcpy
19381 @opindex mmemcpy
19382 Do not optimize block moves, use @code{memcpy}.
19384 @item -mno-clearbss
19385 @opindex mno-clearbss
19386 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
19388 @item -mcpu=@var{cpu-type}
19389 @opindex mcpu=
19390 Use features of, and schedule code for, the given CPU.
19391 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
19392 where @var{X} is a major version, @var{YY} is the minor version, and
19393 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
19394 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
19396 @item -mxl-soft-mul
19397 @opindex mxl-soft-mul
19398 Use software multiply emulation (default).
19400 @item -mxl-soft-div
19401 @opindex mxl-soft-div
19402 Use software emulation for divides (default).
19404 @item -mxl-barrel-shift
19405 @opindex mxl-barrel-shift
19406 Use the hardware barrel shifter.
19408 @item -mxl-pattern-compare
19409 @opindex mxl-pattern-compare
19410 Use pattern compare instructions.
19412 @item -msmall-divides
19413 @opindex msmall-divides
19414 Use table lookup optimization for small signed integer divisions.
19416 @item -mxl-stack-check
19417 @opindex mxl-stack-check
19418 This option is deprecated.  Use @option{-fstack-check} instead.
19420 @item -mxl-gp-opt
19421 @opindex mxl-gp-opt
19422 Use GP-relative @code{.sdata}/@code{.sbss} sections.
19424 @item -mxl-multiply-high
19425 @opindex mxl-multiply-high
19426 Use multiply high instructions for high part of 32x32 multiply.
19428 @item -mxl-float-convert
19429 @opindex mxl-float-convert
19430 Use hardware floating-point conversion instructions.
19432 @item -mxl-float-sqrt
19433 @opindex mxl-float-sqrt
19434 Use hardware floating-point square root instruction.
19436 @item -mbig-endian
19437 @opindex mbig-endian
19438 Generate code for a big-endian target.
19440 @item -mlittle-endian
19441 @opindex mlittle-endian
19442 Generate code for a little-endian target.
19444 @item -mxl-reorder
19445 @opindex mxl-reorder
19446 Use reorder instructions (swap and byte reversed load/store).
19448 @item -mxl-mode-@var{app-model}
19449 Select application model @var{app-model}.  Valid models are
19450 @table @samp
19451 @item executable
19452 normal executable (default), uses startup code @file{crt0.o}.
19454 @item xmdstub
19455 for use with Xilinx Microprocessor Debugger (XMD) based
19456 software intrusive debug agent called xmdstub. This uses startup file
19457 @file{crt1.o} and sets the start address of the program to 0x800.
19459 @item bootstrap
19460 for applications that are loaded using a bootloader.
19461 This model uses startup file @file{crt2.o} which does not contain a processor
19462 reset vector handler. This is suitable for transferring control on a
19463 processor reset to the bootloader rather than the application.
19465 @item novectors
19466 for applications that do not require any of the
19467 MicroBlaze vectors. This option may be useful for applications running
19468 within a monitoring application. This model uses @file{crt3.o} as a startup file.
19469 @end table
19471 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
19472 @option{-mxl-mode-@var{app-model}}.
19474 @end table
19476 @node MIPS Options
19477 @subsection MIPS Options
19478 @cindex MIPS options
19480 @table @gcctabopt
19482 @item -EB
19483 @opindex EB
19484 Generate big-endian code.
19486 @item -EL
19487 @opindex EL
19488 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
19489 configurations.
19491 @item -march=@var{arch}
19492 @opindex march
19493 Generate code that runs on @var{arch}, which can be the name of a
19494 generic MIPS ISA, or the name of a particular processor.
19495 The ISA names are:
19496 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
19497 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
19498 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
19499 @samp{mips64r5} and @samp{mips64r6}.
19500 The processor names are:
19501 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
19502 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
19503 @samp{5kc}, @samp{5kf},
19504 @samp{20kc},
19505 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
19506 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
19507 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
19508 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
19509 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
19510 @samp{i6400},
19511 @samp{interaptiv},
19512 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
19513 @samp{m4k},
19514 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
19515 @samp{m5100}, @samp{m5101},
19516 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
19517 @samp{orion},
19518 @samp{p5600},
19519 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
19520 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
19521 @samp{rm7000}, @samp{rm9000},
19522 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
19523 @samp{sb1},
19524 @samp{sr71000},
19525 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
19526 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
19527 @samp{xlr} and @samp{xlp}.
19528 The special value @samp{from-abi} selects the
19529 most compatible architecture for the selected ABI (that is,
19530 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
19532 The native Linux/GNU toolchain also supports the value @samp{native},
19533 which selects the best architecture option for the host processor.
19534 @option{-march=native} has no effect if GCC does not recognize
19535 the processor.
19537 In processor names, a final @samp{000} can be abbreviated as @samp{k}
19538 (for example, @option{-march=r2k}).  Prefixes are optional, and
19539 @samp{vr} may be written @samp{r}.
19541 Names of the form @samp{@var{n}f2_1} refer to processors with
19542 FPUs clocked at half the rate of the core, names of the form
19543 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
19544 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
19545 processors with FPUs clocked a ratio of 3:2 with respect to the core.
19546 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
19547 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
19548 accepted as synonyms for @samp{@var{n}f1_1}.
19550 GCC defines two macros based on the value of this option.  The first
19551 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
19552 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
19553 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
19554 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
19555 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
19557 Note that the @code{_MIPS_ARCH} macro uses the processor names given
19558 above.  In other words, it has the full prefix and does not
19559 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
19560 the macro names the resolved architecture (either @code{"mips1"} or
19561 @code{"mips3"}).  It names the default architecture when no
19562 @option{-march} option is given.
19564 @item -mtune=@var{arch}
19565 @opindex mtune
19566 Optimize for @var{arch}.  Among other things, this option controls
19567 the way instructions are scheduled, and the perceived cost of arithmetic
19568 operations.  The list of @var{arch} values is the same as for
19569 @option{-march}.
19571 When this option is not used, GCC optimizes for the processor
19572 specified by @option{-march}.  By using @option{-march} and
19573 @option{-mtune} together, it is possible to generate code that
19574 runs on a family of processors, but optimize the code for one
19575 particular member of that family.
19577 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
19578 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
19579 @option{-march} ones described above.
19581 @item -mips1
19582 @opindex mips1
19583 Equivalent to @option{-march=mips1}.
19585 @item -mips2
19586 @opindex mips2
19587 Equivalent to @option{-march=mips2}.
19589 @item -mips3
19590 @opindex mips3
19591 Equivalent to @option{-march=mips3}.
19593 @item -mips4
19594 @opindex mips4
19595 Equivalent to @option{-march=mips4}.
19597 @item -mips32
19598 @opindex mips32
19599 Equivalent to @option{-march=mips32}.
19601 @item -mips32r3
19602 @opindex mips32r3
19603 Equivalent to @option{-march=mips32r3}.
19605 @item -mips32r5
19606 @opindex mips32r5
19607 Equivalent to @option{-march=mips32r5}.
19609 @item -mips32r6
19610 @opindex mips32r6
19611 Equivalent to @option{-march=mips32r6}.
19613 @item -mips64
19614 @opindex mips64
19615 Equivalent to @option{-march=mips64}.
19617 @item -mips64r2
19618 @opindex mips64r2
19619 Equivalent to @option{-march=mips64r2}.
19621 @item -mips64r3
19622 @opindex mips64r3
19623 Equivalent to @option{-march=mips64r3}.
19625 @item -mips64r5
19626 @opindex mips64r5
19627 Equivalent to @option{-march=mips64r5}.
19629 @item -mips64r6
19630 @opindex mips64r6
19631 Equivalent to @option{-march=mips64r6}.
19633 @item -mips16
19634 @itemx -mno-mips16
19635 @opindex mips16
19636 @opindex mno-mips16
19637 Generate (do not generate) MIPS16 code.  If GCC is targeting a
19638 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
19640 MIPS16 code generation can also be controlled on a per-function basis
19641 by means of @code{mips16} and @code{nomips16} attributes.
19642 @xref{Function Attributes}, for more information.
19644 @item -mflip-mips16
19645 @opindex mflip-mips16
19646 Generate MIPS16 code on alternating functions.  This option is provided
19647 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
19648 not intended for ordinary use in compiling user code.
19650 @item -minterlink-compressed
19651 @item -mno-interlink-compressed
19652 @opindex minterlink-compressed
19653 @opindex mno-interlink-compressed
19654 Require (do not require) that code using the standard (uncompressed) MIPS ISA
19655 be link-compatible with MIPS16 and microMIPS code, and vice versa.
19657 For example, code using the standard ISA encoding cannot jump directly
19658 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
19659 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
19660 knows that the target of the jump is not compressed.
19662 @item -minterlink-mips16
19663 @itemx -mno-interlink-mips16
19664 @opindex minterlink-mips16
19665 @opindex mno-interlink-mips16
19666 Aliases of @option{-minterlink-compressed} and
19667 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
19668 and are retained for backwards compatibility.
19670 @item -mabi=32
19671 @itemx -mabi=o64
19672 @itemx -mabi=n32
19673 @itemx -mabi=64
19674 @itemx -mabi=eabi
19675 @opindex mabi=32
19676 @opindex mabi=o64
19677 @opindex mabi=n32
19678 @opindex mabi=64
19679 @opindex mabi=eabi
19680 Generate code for the given ABI@.
19682 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
19683 generates 64-bit code when you select a 64-bit architecture, but you
19684 can use @option{-mgp32} to get 32-bit code instead.
19686 For information about the O64 ABI, see
19687 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
19689 GCC supports a variant of the o32 ABI in which floating-point registers
19690 are 64 rather than 32 bits wide.  You can select this combination with
19691 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
19692 and @code{mfhc1} instructions and is therefore only supported for
19693 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
19695 The register assignments for arguments and return values remain the
19696 same, but each scalar value is passed in a single 64-bit register
19697 rather than a pair of 32-bit registers.  For example, scalar
19698 floating-point values are returned in @samp{$f0} only, not a
19699 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
19700 remains the same in that the even-numbered double-precision registers
19701 are saved.
19703 Two additional variants of the o32 ABI are supported to enable
19704 a transition from 32-bit to 64-bit registers.  These are FPXX
19705 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
19706 The FPXX extension mandates that all code must execute correctly
19707 when run using 32-bit or 64-bit registers.  The code can be interlinked
19708 with either FP32 or FP64, but not both.
19709 The FP64A extension is similar to the FP64 extension but forbids the
19710 use of odd-numbered single-precision registers.  This can be used
19711 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
19712 processors and allows both FP32 and FP64A code to interlink and
19713 run in the same process without changing FPU modes.
19715 @item -mabicalls
19716 @itemx -mno-abicalls
19717 @opindex mabicalls
19718 @opindex mno-abicalls
19719 Generate (do not generate) code that is suitable for SVR4-style
19720 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
19721 systems.
19723 @item -mshared
19724 @itemx -mno-shared
19725 Generate (do not generate) code that is fully position-independent,
19726 and that can therefore be linked into shared libraries.  This option
19727 only affects @option{-mabicalls}.
19729 All @option{-mabicalls} code has traditionally been position-independent,
19730 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
19731 as an extension, the GNU toolchain allows executables to use absolute
19732 accesses for locally-binding symbols.  It can also use shorter GP
19733 initialization sequences and generate direct calls to locally-defined
19734 functions.  This mode is selected by @option{-mno-shared}.
19736 @option{-mno-shared} depends on binutils 2.16 or higher and generates
19737 objects that can only be linked by the GNU linker.  However, the option
19738 does not affect the ABI of the final executable; it only affects the ABI
19739 of relocatable objects.  Using @option{-mno-shared} generally makes
19740 executables both smaller and quicker.
19742 @option{-mshared} is the default.
19744 @item -mplt
19745 @itemx -mno-plt
19746 @opindex mplt
19747 @opindex mno-plt
19748 Assume (do not assume) that the static and dynamic linkers
19749 support PLTs and copy relocations.  This option only affects
19750 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
19751 has no effect without @option{-msym32}.
19753 You can make @option{-mplt} the default by configuring
19754 GCC with @option{--with-mips-plt}.  The default is
19755 @option{-mno-plt} otherwise.
19757 @item -mxgot
19758 @itemx -mno-xgot
19759 @opindex mxgot
19760 @opindex mno-xgot
19761 Lift (do not lift) the usual restrictions on the size of the global
19762 offset table.
19764 GCC normally uses a single instruction to load values from the GOT@.
19765 While this is relatively efficient, it only works if the GOT
19766 is smaller than about 64k.  Anything larger causes the linker
19767 to report an error such as:
19769 @cindex relocation truncated to fit (MIPS)
19770 @smallexample
19771 relocation truncated to fit: R_MIPS_GOT16 foobar
19772 @end smallexample
19774 If this happens, you should recompile your code with @option{-mxgot}.
19775 This works with very large GOTs, although the code is also
19776 less efficient, since it takes three instructions to fetch the
19777 value of a global symbol.
19779 Note that some linkers can create multiple GOTs.  If you have such a
19780 linker, you should only need to use @option{-mxgot} when a single object
19781 file accesses more than 64k's worth of GOT entries.  Very few do.
19783 These options have no effect unless GCC is generating position
19784 independent code.
19786 @item -mgp32
19787 @opindex mgp32
19788 Assume that general-purpose registers are 32 bits wide.
19790 @item -mgp64
19791 @opindex mgp64
19792 Assume that general-purpose registers are 64 bits wide.
19794 @item -mfp32
19795 @opindex mfp32
19796 Assume that floating-point registers are 32 bits wide.
19798 @item -mfp64
19799 @opindex mfp64
19800 Assume that floating-point registers are 64 bits wide.
19802 @item -mfpxx
19803 @opindex mfpxx
19804 Do not assume the width of floating-point registers.
19806 @item -mhard-float
19807 @opindex mhard-float
19808 Use floating-point coprocessor instructions.
19810 @item -msoft-float
19811 @opindex msoft-float
19812 Do not use floating-point coprocessor instructions.  Implement
19813 floating-point calculations using library calls instead.
19815 @item -mno-float
19816 @opindex mno-float
19817 Equivalent to @option{-msoft-float}, but additionally asserts that the
19818 program being compiled does not perform any floating-point operations.
19819 This option is presently supported only by some bare-metal MIPS
19820 configurations, where it may select a special set of libraries
19821 that lack all floating-point support (including, for example, the
19822 floating-point @code{printf} formats).  
19823 If code compiled with @option{-mno-float} accidentally contains
19824 floating-point operations, it is likely to suffer a link-time
19825 or run-time failure.
19827 @item -msingle-float
19828 @opindex msingle-float
19829 Assume that the floating-point coprocessor only supports single-precision
19830 operations.
19832 @item -mdouble-float
19833 @opindex mdouble-float
19834 Assume that the floating-point coprocessor supports double-precision
19835 operations.  This is the default.
19837 @item -modd-spreg
19838 @itemx -mno-odd-spreg
19839 @opindex modd-spreg
19840 @opindex mno-odd-spreg
19841 Enable the use of odd-numbered single-precision floating-point registers
19842 for the o32 ABI.  This is the default for processors that are known to
19843 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
19844 is set by default.
19846 @item -mabs=2008
19847 @itemx -mabs=legacy
19848 @opindex mabs=2008
19849 @opindex mabs=legacy
19850 These options control the treatment of the special not-a-number (NaN)
19851 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
19852 @code{neg.@i{fmt}} machine instructions.
19854 By default or when @option{-mabs=legacy} is used the legacy
19855 treatment is selected.  In this case these instructions are considered
19856 arithmetic and avoided where correct operation is required and the
19857 input operand might be a NaN.  A longer sequence of instructions that
19858 manipulate the sign bit of floating-point datum manually is used
19859 instead unless the @option{-ffinite-math-only} option has also been
19860 specified.
19862 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
19863 this case these instructions are considered non-arithmetic and therefore
19864 operating correctly in all cases, including in particular where the
19865 input operand is a NaN.  These instructions are therefore always used
19866 for the respective operations.
19868 @item -mnan=2008
19869 @itemx -mnan=legacy
19870 @opindex mnan=2008
19871 @opindex mnan=legacy
19872 These options control the encoding of the special not-a-number (NaN)
19873 IEEE 754 floating-point data.
19875 The @option{-mnan=legacy} option selects the legacy encoding.  In this
19876 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
19877 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
19878 by the first bit of their trailing significand field being 1.
19880 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
19881 this case qNaNs are denoted by the first bit of their trailing
19882 significand field being 1, whereas sNaNs are denoted by the first bit of
19883 their trailing significand field being 0.
19885 The default is @option{-mnan=legacy} unless GCC has been configured with
19886 @option{--with-nan=2008}.
19888 @item -mllsc
19889 @itemx -mno-llsc
19890 @opindex mllsc
19891 @opindex mno-llsc
19892 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
19893 implement atomic memory built-in functions.  When neither option is
19894 specified, GCC uses the instructions if the target architecture
19895 supports them.
19897 @option{-mllsc} is useful if the runtime environment can emulate the
19898 instructions and @option{-mno-llsc} can be useful when compiling for
19899 nonstandard ISAs.  You can make either option the default by
19900 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
19901 respectively.  @option{--with-llsc} is the default for some
19902 configurations; see the installation documentation for details.
19904 @item -mdsp
19905 @itemx -mno-dsp
19906 @opindex mdsp
19907 @opindex mno-dsp
19908 Use (do not use) revision 1 of the MIPS DSP ASE@.
19909 @xref{MIPS DSP Built-in Functions}.  This option defines the
19910 preprocessor macro @code{__mips_dsp}.  It also defines
19911 @code{__mips_dsp_rev} to 1.
19913 @item -mdspr2
19914 @itemx -mno-dspr2
19915 @opindex mdspr2
19916 @opindex mno-dspr2
19917 Use (do not use) revision 2 of the MIPS DSP ASE@.
19918 @xref{MIPS DSP Built-in Functions}.  This option defines the
19919 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
19920 It also defines @code{__mips_dsp_rev} to 2.
19922 @item -msmartmips
19923 @itemx -mno-smartmips
19924 @opindex msmartmips
19925 @opindex mno-smartmips
19926 Use (do not use) the MIPS SmartMIPS ASE.
19928 @item -mpaired-single
19929 @itemx -mno-paired-single
19930 @opindex mpaired-single
19931 @opindex mno-paired-single
19932 Use (do not use) paired-single floating-point instructions.
19933 @xref{MIPS Paired-Single Support}.  This option requires
19934 hardware floating-point support to be enabled.
19936 @item -mdmx
19937 @itemx -mno-mdmx
19938 @opindex mdmx
19939 @opindex mno-mdmx
19940 Use (do not use) MIPS Digital Media Extension instructions.
19941 This option can only be used when generating 64-bit code and requires
19942 hardware floating-point support to be enabled.
19944 @item -mips3d
19945 @itemx -mno-mips3d
19946 @opindex mips3d
19947 @opindex mno-mips3d
19948 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
19949 The option @option{-mips3d} implies @option{-mpaired-single}.
19951 @item -mmicromips
19952 @itemx -mno-micromips
19953 @opindex mmicromips
19954 @opindex mno-mmicromips
19955 Generate (do not generate) microMIPS code.
19957 MicroMIPS code generation can also be controlled on a per-function basis
19958 by means of @code{micromips} and @code{nomicromips} attributes.
19959 @xref{Function Attributes}, for more information.
19961 @item -mmt
19962 @itemx -mno-mt
19963 @opindex mmt
19964 @opindex mno-mt
19965 Use (do not use) MT Multithreading instructions.
19967 @item -mmcu
19968 @itemx -mno-mcu
19969 @opindex mmcu
19970 @opindex mno-mcu
19971 Use (do not use) the MIPS MCU ASE instructions.
19973 @item -meva
19974 @itemx -mno-eva
19975 @opindex meva
19976 @opindex mno-eva
19977 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
19979 @item -mvirt
19980 @itemx -mno-virt
19981 @opindex mvirt
19982 @opindex mno-virt
19983 Use (do not use) the MIPS Virtualization (VZ) instructions.
19985 @item -mxpa
19986 @itemx -mno-xpa
19987 @opindex mxpa
19988 @opindex mno-xpa
19989 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
19991 @item -mlong64
19992 @opindex mlong64
19993 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
19994 an explanation of the default and the way that the pointer size is
19995 determined.
19997 @item -mlong32
19998 @opindex mlong32
19999 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
20001 The default size of @code{int}s, @code{long}s and pointers depends on
20002 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
20003 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
20004 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
20005 or the same size as integer registers, whichever is smaller.
20007 @item -msym32
20008 @itemx -mno-sym32
20009 @opindex msym32
20010 @opindex mno-sym32
20011 Assume (do not assume) that all symbols have 32-bit values, regardless
20012 of the selected ABI@.  This option is useful in combination with
20013 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
20014 to generate shorter and faster references to symbolic addresses.
20016 @item -G @var{num}
20017 @opindex G
20018 Put definitions of externally-visible data in a small data section
20019 if that data is no bigger than @var{num} bytes.  GCC can then generate
20020 more efficient accesses to the data; see @option{-mgpopt} for details.
20022 The default @option{-G} option depends on the configuration.
20024 @item -mlocal-sdata
20025 @itemx -mno-local-sdata
20026 @opindex mlocal-sdata
20027 @opindex mno-local-sdata
20028 Extend (do not extend) the @option{-G} behavior to local data too,
20029 such as to static variables in C@.  @option{-mlocal-sdata} is the
20030 default for all configurations.
20032 If the linker complains that an application is using too much small data,
20033 you might want to try rebuilding the less performance-critical parts with
20034 @option{-mno-local-sdata}.  You might also want to build large
20035 libraries with @option{-mno-local-sdata}, so that the libraries leave
20036 more room for the main program.
20038 @item -mextern-sdata
20039 @itemx -mno-extern-sdata
20040 @opindex mextern-sdata
20041 @opindex mno-extern-sdata
20042 Assume (do not assume) that externally-defined data is in
20043 a small data section if the size of that data is within the @option{-G} limit.
20044 @option{-mextern-sdata} is the default for all configurations.
20046 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
20047 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
20048 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
20049 is placed in a small data section.  If @var{Var} is defined by another
20050 module, you must either compile that module with a high-enough
20051 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
20052 definition.  If @var{Var} is common, you must link the application
20053 with a high-enough @option{-G} setting.
20055 The easiest way of satisfying these restrictions is to compile
20056 and link every module with the same @option{-G} option.  However,
20057 you may wish to build a library that supports several different
20058 small data limits.  You can do this by compiling the library with
20059 the highest supported @option{-G} setting and additionally using
20060 @option{-mno-extern-sdata} to stop the library from making assumptions
20061 about externally-defined data.
20063 @item -mgpopt
20064 @itemx -mno-gpopt
20065 @opindex mgpopt
20066 @opindex mno-gpopt
20067 Use (do not use) GP-relative accesses for symbols that are known to be
20068 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
20069 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
20070 configurations.
20072 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
20073 might not hold the value of @code{_gp}.  For example, if the code is
20074 part of a library that might be used in a boot monitor, programs that
20075 call boot monitor routines pass an unknown value in @code{$gp}.
20076 (In such situations, the boot monitor itself is usually compiled
20077 with @option{-G0}.)
20079 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
20080 @option{-mno-extern-sdata}.
20082 @item -membedded-data
20083 @itemx -mno-embedded-data
20084 @opindex membedded-data
20085 @opindex mno-embedded-data
20086 Allocate variables to the read-only data section first if possible, then
20087 next in the small data section if possible, otherwise in data.  This gives
20088 slightly slower code than the default, but reduces the amount of RAM required
20089 when executing, and thus may be preferred for some embedded systems.
20091 @item -muninit-const-in-rodata
20092 @itemx -mno-uninit-const-in-rodata
20093 @opindex muninit-const-in-rodata
20094 @opindex mno-uninit-const-in-rodata
20095 Put uninitialized @code{const} variables in the read-only data section.
20096 This option is only meaningful in conjunction with @option{-membedded-data}.
20098 @item -mcode-readable=@var{setting}
20099 @opindex mcode-readable
20100 Specify whether GCC may generate code that reads from executable sections.
20101 There are three possible settings:
20103 @table @gcctabopt
20104 @item -mcode-readable=yes
20105 Instructions may freely access executable sections.  This is the
20106 default setting.
20108 @item -mcode-readable=pcrel
20109 MIPS16 PC-relative load instructions can access executable sections,
20110 but other instructions must not do so.  This option is useful on 4KSc
20111 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
20112 It is also useful on processors that can be configured to have a dual
20113 instruction/data SRAM interface and that, like the M4K, automatically
20114 redirect PC-relative loads to the instruction RAM.
20116 @item -mcode-readable=no
20117 Instructions must not access executable sections.  This option can be
20118 useful on targets that are configured to have a dual instruction/data
20119 SRAM interface but that (unlike the M4K) do not automatically redirect
20120 PC-relative loads to the instruction RAM.
20121 @end table
20123 @item -msplit-addresses
20124 @itemx -mno-split-addresses
20125 @opindex msplit-addresses
20126 @opindex mno-split-addresses
20127 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
20128 relocation operators.  This option has been superseded by
20129 @option{-mexplicit-relocs} but is retained for backwards compatibility.
20131 @item -mexplicit-relocs
20132 @itemx -mno-explicit-relocs
20133 @opindex mexplicit-relocs
20134 @opindex mno-explicit-relocs
20135 Use (do not use) assembler relocation operators when dealing with symbolic
20136 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
20137 is to use assembler macros instead.
20139 @option{-mexplicit-relocs} is the default if GCC was configured
20140 to use an assembler that supports relocation operators.
20142 @item -mcheck-zero-division
20143 @itemx -mno-check-zero-division
20144 @opindex mcheck-zero-division
20145 @opindex mno-check-zero-division
20146 Trap (do not trap) on integer division by zero.
20148 The default is @option{-mcheck-zero-division}.
20150 @item -mdivide-traps
20151 @itemx -mdivide-breaks
20152 @opindex mdivide-traps
20153 @opindex mdivide-breaks
20154 MIPS systems check for division by zero by generating either a
20155 conditional trap or a break instruction.  Using traps results in
20156 smaller code, but is only supported on MIPS II and later.  Also, some
20157 versions of the Linux kernel have a bug that prevents trap from
20158 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
20159 allow conditional traps on architectures that support them and
20160 @option{-mdivide-breaks} to force the use of breaks.
20162 The default is usually @option{-mdivide-traps}, but this can be
20163 overridden at configure time using @option{--with-divide=breaks}.
20164 Divide-by-zero checks can be completely disabled using
20165 @option{-mno-check-zero-division}.
20167 @item -mload-store-pairs
20168 @itemx -mno-load-store-pairs
20169 @opindex mload-store-pairs
20170 @opindex mno-load-store-pairs
20171 Enable (disable) an optimization that pairs consecutive load or store
20172 instructions to enable load/store bonding.  This option is enabled by
20173 default but only takes effect when the selected architecture is known
20174 to support bonding.
20176 @item -mmemcpy
20177 @itemx -mno-memcpy
20178 @opindex mmemcpy
20179 @opindex mno-memcpy
20180 Force (do not force) the use of @code{memcpy} for non-trivial block
20181 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
20182 most constant-sized copies.
20184 @item -mlong-calls
20185 @itemx -mno-long-calls
20186 @opindex mlong-calls
20187 @opindex mno-long-calls
20188 Disable (do not disable) use of the @code{jal} instruction.  Calling
20189 functions using @code{jal} is more efficient but requires the caller
20190 and callee to be in the same 256 megabyte segment.
20192 This option has no effect on abicalls code.  The default is
20193 @option{-mno-long-calls}.
20195 @item -mmad
20196 @itemx -mno-mad
20197 @opindex mmad
20198 @opindex mno-mad
20199 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
20200 instructions, as provided by the R4650 ISA@.
20202 @item -mimadd
20203 @itemx -mno-imadd
20204 @opindex mimadd
20205 @opindex mno-imadd
20206 Enable (disable) use of the @code{madd} and @code{msub} integer
20207 instructions.  The default is @option{-mimadd} on architectures
20208 that support @code{madd} and @code{msub} except for the 74k 
20209 architecture where it was found to generate slower code.
20211 @item -mfused-madd
20212 @itemx -mno-fused-madd
20213 @opindex mfused-madd
20214 @opindex mno-fused-madd
20215 Enable (disable) use of the floating-point multiply-accumulate
20216 instructions, when they are available.  The default is
20217 @option{-mfused-madd}.
20219 On the R8000 CPU when multiply-accumulate instructions are used,
20220 the intermediate product is calculated to infinite precision
20221 and is not subject to the FCSR Flush to Zero bit.  This may be
20222 undesirable in some circumstances.  On other processors the result
20223 is numerically identical to the equivalent computation using
20224 separate multiply, add, subtract and negate instructions.
20226 @item -nocpp
20227 @opindex nocpp
20228 Tell the MIPS assembler to not run its preprocessor over user
20229 assembler files (with a @samp{.s} suffix) when assembling them.
20231 @item -mfix-24k
20232 @item -mno-fix-24k
20233 @opindex mfix-24k
20234 @opindex mno-fix-24k
20235 Work around the 24K E48 (lost data on stores during refill) errata.
20236 The workarounds are implemented by the assembler rather than by GCC@.
20238 @item -mfix-r4000
20239 @itemx -mno-fix-r4000
20240 @opindex mfix-r4000
20241 @opindex mno-fix-r4000
20242 Work around certain R4000 CPU errata:
20243 @itemize @minus
20244 @item
20245 A double-word or a variable shift may give an incorrect result if executed
20246 immediately after starting an integer division.
20247 @item
20248 A double-word or a variable shift may give an incorrect result if executed
20249 while an integer multiplication is in progress.
20250 @item
20251 An integer division may give an incorrect result if started in a delay slot
20252 of a taken branch or a jump.
20253 @end itemize
20255 @item -mfix-r4400
20256 @itemx -mno-fix-r4400
20257 @opindex mfix-r4400
20258 @opindex mno-fix-r4400
20259 Work around certain R4400 CPU errata:
20260 @itemize @minus
20261 @item
20262 A double-word or a variable shift may give an incorrect result if executed
20263 immediately after starting an integer division.
20264 @end itemize
20266 @item -mfix-r10000
20267 @itemx -mno-fix-r10000
20268 @opindex mfix-r10000
20269 @opindex mno-fix-r10000
20270 Work around certain R10000 errata:
20271 @itemize @minus
20272 @item
20273 @code{ll}/@code{sc} sequences may not behave atomically on revisions
20274 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
20275 @end itemize
20277 This option can only be used if the target architecture supports
20278 branch-likely instructions.  @option{-mfix-r10000} is the default when
20279 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
20280 otherwise.
20282 @item -mfix-rm7000
20283 @itemx -mno-fix-rm7000
20284 @opindex mfix-rm7000
20285 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
20286 workarounds are implemented by the assembler rather than by GCC@.
20288 @item -mfix-vr4120
20289 @itemx -mno-fix-vr4120
20290 @opindex mfix-vr4120
20291 Work around certain VR4120 errata:
20292 @itemize @minus
20293 @item
20294 @code{dmultu} does not always produce the correct result.
20295 @item
20296 @code{div} and @code{ddiv} do not always produce the correct result if one
20297 of the operands is negative.
20298 @end itemize
20299 The workarounds for the division errata rely on special functions in
20300 @file{libgcc.a}.  At present, these functions are only provided by
20301 the @code{mips64vr*-elf} configurations.
20303 Other VR4120 errata require a NOP to be inserted between certain pairs of
20304 instructions.  These errata are handled by the assembler, not by GCC itself.
20306 @item -mfix-vr4130
20307 @opindex mfix-vr4130
20308 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
20309 workarounds are implemented by the assembler rather than by GCC,
20310 although GCC avoids using @code{mflo} and @code{mfhi} if the
20311 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
20312 instructions are available instead.
20314 @item -mfix-sb1
20315 @itemx -mno-fix-sb1
20316 @opindex mfix-sb1
20317 Work around certain SB-1 CPU core errata.
20318 (This flag currently works around the SB-1 revision 2
20319 ``F1'' and ``F2'' floating-point errata.)
20321 @item -mr10k-cache-barrier=@var{setting}
20322 @opindex mr10k-cache-barrier
20323 Specify whether GCC should insert cache barriers to avoid the
20324 side-effects of speculation on R10K processors.
20326 In common with many processors, the R10K tries to predict the outcome
20327 of a conditional branch and speculatively executes instructions from
20328 the ``taken'' branch.  It later aborts these instructions if the
20329 predicted outcome is wrong.  However, on the R10K, even aborted
20330 instructions can have side effects.
20332 This problem only affects kernel stores and, depending on the system,
20333 kernel loads.  As an example, a speculatively-executed store may load
20334 the target memory into cache and mark the cache line as dirty, even if
20335 the store itself is later aborted.  If a DMA operation writes to the
20336 same area of memory before the ``dirty'' line is flushed, the cached
20337 data overwrites the DMA-ed data.  See the R10K processor manual
20338 for a full description, including other potential problems.
20340 One workaround is to insert cache barrier instructions before every memory
20341 access that might be speculatively executed and that might have side
20342 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
20343 controls GCC's implementation of this workaround.  It assumes that
20344 aborted accesses to any byte in the following regions does not have
20345 side effects:
20347 @enumerate
20348 @item
20349 the memory occupied by the current function's stack frame;
20351 @item
20352 the memory occupied by an incoming stack argument;
20354 @item
20355 the memory occupied by an object with a link-time-constant address.
20356 @end enumerate
20358 It is the kernel's responsibility to ensure that speculative
20359 accesses to these regions are indeed safe.
20361 If the input program contains a function declaration such as:
20363 @smallexample
20364 void foo (void);
20365 @end smallexample
20367 then the implementation of @code{foo} must allow @code{j foo} and
20368 @code{jal foo} to be executed speculatively.  GCC honors this
20369 restriction for functions it compiles itself.  It expects non-GCC
20370 functions (such as hand-written assembly code) to do the same.
20372 The option has three forms:
20374 @table @gcctabopt
20375 @item -mr10k-cache-barrier=load-store
20376 Insert a cache barrier before a load or store that might be
20377 speculatively executed and that might have side effects even
20378 if aborted.
20380 @item -mr10k-cache-barrier=store
20381 Insert a cache barrier before a store that might be speculatively
20382 executed and that might have side effects even if aborted.
20384 @item -mr10k-cache-barrier=none
20385 Disable the insertion of cache barriers.  This is the default setting.
20386 @end table
20388 @item -mflush-func=@var{func}
20389 @itemx -mno-flush-func
20390 @opindex mflush-func
20391 Specifies the function to call to flush the I and D caches, or to not
20392 call any such function.  If called, the function must take the same
20393 arguments as the common @code{_flush_func}, that is, the address of the
20394 memory range for which the cache is being flushed, the size of the
20395 memory range, and the number 3 (to flush both caches).  The default
20396 depends on the target GCC was configured for, but commonly is either
20397 @code{_flush_func} or @code{__cpu_flush}.
20399 @item mbranch-cost=@var{num}
20400 @opindex mbranch-cost
20401 Set the cost of branches to roughly @var{num} ``simple'' instructions.
20402 This cost is only a heuristic and is not guaranteed to produce
20403 consistent results across releases.  A zero cost redundantly selects
20404 the default, which is based on the @option{-mtune} setting.
20406 @item -mbranch-likely
20407 @itemx -mno-branch-likely
20408 @opindex mbranch-likely
20409 @opindex mno-branch-likely
20410 Enable or disable use of Branch Likely instructions, regardless of the
20411 default for the selected architecture.  By default, Branch Likely
20412 instructions may be generated if they are supported by the selected
20413 architecture.  An exception is for the MIPS32 and MIPS64 architectures
20414 and processors that implement those architectures; for those, Branch
20415 Likely instructions are not be generated by default because the MIPS32
20416 and MIPS64 architectures specifically deprecate their use.
20418 @item -mcompact-branches=never
20419 @itemx -mcompact-branches=optimal
20420 @itemx -mcompact-branches=always
20421 @opindex mcompact-branches=never
20422 @opindex mcompact-branches=optimal
20423 @opindex mcompact-branches=always
20424 These options control which form of branches will be generated.  The
20425 default is @option{-mcompact-branches=optimal}.
20427 The @option{-mcompact-branches=never} option ensures that compact branch
20428 instructions will never be generated.
20430 The @option{-mcompact-branches=always} option ensures that a compact
20431 branch instruction will be generated if available.  If a compact branch
20432 instruction is not available, a delay slot form of the branch will be
20433 used instead.
20435 This option is supported from MIPS Release 6 onwards.
20437 The @option{-mcompact-branches=optimal} option will cause a delay slot
20438 branch to be used if one is available in the current ISA and the delay
20439 slot is successfully filled.  If the delay slot is not filled, a compact
20440 branch will be chosen if one is available.
20442 @item -mfp-exceptions
20443 @itemx -mno-fp-exceptions
20444 @opindex mfp-exceptions
20445 Specifies whether FP exceptions are enabled.  This affects how
20446 FP instructions are scheduled for some processors.
20447 The default is that FP exceptions are
20448 enabled.
20450 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
20451 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
20452 FP pipe.
20454 @item -mvr4130-align
20455 @itemx -mno-vr4130-align
20456 @opindex mvr4130-align
20457 The VR4130 pipeline is two-way superscalar, but can only issue two
20458 instructions together if the first one is 8-byte aligned.  When this
20459 option is enabled, GCC aligns pairs of instructions that it
20460 thinks should execute in parallel.
20462 This option only has an effect when optimizing for the VR4130.
20463 It normally makes code faster, but at the expense of making it bigger.
20464 It is enabled by default at optimization level @option{-O3}.
20466 @item -msynci
20467 @itemx -mno-synci
20468 @opindex msynci
20469 Enable (disable) generation of @code{synci} instructions on
20470 architectures that support it.  The @code{synci} instructions (if
20471 enabled) are generated when @code{__builtin___clear_cache} is
20472 compiled.
20474 This option defaults to @option{-mno-synci}, but the default can be
20475 overridden by configuring GCC with @option{--with-synci}.
20477 When compiling code for single processor systems, it is generally safe
20478 to use @code{synci}.  However, on many multi-core (SMP) systems, it
20479 does not invalidate the instruction caches on all cores and may lead
20480 to undefined behavior.
20482 @item -mrelax-pic-calls
20483 @itemx -mno-relax-pic-calls
20484 @opindex mrelax-pic-calls
20485 Try to turn PIC calls that are normally dispatched via register
20486 @code{$25} into direct calls.  This is only possible if the linker can
20487 resolve the destination at link time and if the destination is within
20488 range for a direct call.
20490 @option{-mrelax-pic-calls} is the default if GCC was configured to use
20491 an assembler and a linker that support the @code{.reloc} assembly
20492 directive and @option{-mexplicit-relocs} is in effect.  With
20493 @option{-mno-explicit-relocs}, this optimization can be performed by the
20494 assembler and the linker alone without help from the compiler.
20496 @item -mmcount-ra-address
20497 @itemx -mno-mcount-ra-address
20498 @opindex mmcount-ra-address
20499 @opindex mno-mcount-ra-address
20500 Emit (do not emit) code that allows @code{_mcount} to modify the
20501 calling function's return address.  When enabled, this option extends
20502 the usual @code{_mcount} interface with a new @var{ra-address}
20503 parameter, which has type @code{intptr_t *} and is passed in register
20504 @code{$12}.  @code{_mcount} can then modify the return address by
20505 doing both of the following:
20506 @itemize
20507 @item
20508 Returning the new address in register @code{$31}.
20509 @item
20510 Storing the new address in @code{*@var{ra-address}},
20511 if @var{ra-address} is nonnull.
20512 @end itemize
20514 The default is @option{-mno-mcount-ra-address}.
20516 @item -mframe-header-opt
20517 @itemx -mno-frame-header-opt
20518 @opindex mframe-header-opt
20519 Enable (disable) frame header optimization in the o32 ABI.  When using the
20520 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
20521 function to write out register arguments.  When enabled, this optimization
20522 will suppress the allocation of the frame header if it can be determined that
20523 it is unused.
20525 This optimization is off by default at all optimization levels.
20527 @item -mlxc1-sxc1
20528 @itemx -mno-lxc1-sxc1
20529 @opindex mlxc1-sxc1
20530 When applicable, enable (disable) the generation of @code{lwxc1},
20531 @code{swxc1}, @code{ldxc1}, @code{sdxc1} instructions.  Enabled by default.
20533 @item -mmadd4
20534 @itemx -mno-madd4
20535 @opindex mmadd4
20536 When applicable, enable (disable) the generation of 4-operand @code{madd.s},
20537 @code{madd.d} and related instructions.  Enabled by default.
20539 @end table
20541 @node MMIX Options
20542 @subsection MMIX Options
20543 @cindex MMIX Options
20545 These options are defined for the MMIX:
20547 @table @gcctabopt
20548 @item -mlibfuncs
20549 @itemx -mno-libfuncs
20550 @opindex mlibfuncs
20551 @opindex mno-libfuncs
20552 Specify that intrinsic library functions are being compiled, passing all
20553 values in registers, no matter the size.
20555 @item -mepsilon
20556 @itemx -mno-epsilon
20557 @opindex mepsilon
20558 @opindex mno-epsilon
20559 Generate floating-point comparison instructions that compare with respect
20560 to the @code{rE} epsilon register.
20562 @item -mabi=mmixware
20563 @itemx -mabi=gnu
20564 @opindex mabi=mmixware
20565 @opindex mabi=gnu
20566 Generate code that passes function parameters and return values that (in
20567 the called function) are seen as registers @code{$0} and up, as opposed to
20568 the GNU ABI which uses global registers @code{$231} and up.
20570 @item -mzero-extend
20571 @itemx -mno-zero-extend
20572 @opindex mzero-extend
20573 @opindex mno-zero-extend
20574 When reading data from memory in sizes shorter than 64 bits, use (do not
20575 use) zero-extending load instructions by default, rather than
20576 sign-extending ones.
20578 @item -mknuthdiv
20579 @itemx -mno-knuthdiv
20580 @opindex mknuthdiv
20581 @opindex mno-knuthdiv
20582 Make the result of a division yielding a remainder have the same sign as
20583 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
20584 remainder follows the sign of the dividend.  Both methods are
20585 arithmetically valid, the latter being almost exclusively used.
20587 @item -mtoplevel-symbols
20588 @itemx -mno-toplevel-symbols
20589 @opindex mtoplevel-symbols
20590 @opindex mno-toplevel-symbols
20591 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
20592 code can be used with the @code{PREFIX} assembly directive.
20594 @item -melf
20595 @opindex melf
20596 Generate an executable in the ELF format, rather than the default
20597 @samp{mmo} format used by the @command{mmix} simulator.
20599 @item -mbranch-predict
20600 @itemx -mno-branch-predict
20601 @opindex mbranch-predict
20602 @opindex mno-branch-predict
20603 Use (do not use) the probable-branch instructions, when static branch
20604 prediction indicates a probable branch.
20606 @item -mbase-addresses
20607 @itemx -mno-base-addresses
20608 @opindex mbase-addresses
20609 @opindex mno-base-addresses
20610 Generate (do not generate) code that uses @emph{base addresses}.  Using a
20611 base address automatically generates a request (handled by the assembler
20612 and the linker) for a constant to be set up in a global register.  The
20613 register is used for one or more base address requests within the range 0
20614 to 255 from the value held in the register.  The generally leads to short
20615 and fast code, but the number of different data items that can be
20616 addressed is limited.  This means that a program that uses lots of static
20617 data may require @option{-mno-base-addresses}.
20619 @item -msingle-exit
20620 @itemx -mno-single-exit
20621 @opindex msingle-exit
20622 @opindex mno-single-exit
20623 Force (do not force) generated code to have a single exit point in each
20624 function.
20625 @end table
20627 @node MN10300 Options
20628 @subsection MN10300 Options
20629 @cindex MN10300 options
20631 These @option{-m} options are defined for Matsushita MN10300 architectures:
20633 @table @gcctabopt
20634 @item -mmult-bug
20635 @opindex mmult-bug
20636 Generate code to avoid bugs in the multiply instructions for the MN10300
20637 processors.  This is the default.
20639 @item -mno-mult-bug
20640 @opindex mno-mult-bug
20641 Do not generate code to avoid bugs in the multiply instructions for the
20642 MN10300 processors.
20644 @item -mam33
20645 @opindex mam33
20646 Generate code using features specific to the AM33 processor.
20648 @item -mno-am33
20649 @opindex mno-am33
20650 Do not generate code using features specific to the AM33 processor.  This
20651 is the default.
20653 @item -mam33-2
20654 @opindex mam33-2
20655 Generate code using features specific to the AM33/2.0 processor.
20657 @item -mam34
20658 @opindex mam34
20659 Generate code using features specific to the AM34 processor.
20661 @item -mtune=@var{cpu-type}
20662 @opindex mtune
20663 Use the timing characteristics of the indicated CPU type when
20664 scheduling instructions.  This does not change the targeted processor
20665 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
20666 @samp{am33-2} or @samp{am34}.
20668 @item -mreturn-pointer-on-d0
20669 @opindex mreturn-pointer-on-d0
20670 When generating a function that returns a pointer, return the pointer
20671 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
20672 only in @code{a0}, and attempts to call such functions without a prototype
20673 result in errors.  Note that this option is on by default; use
20674 @option{-mno-return-pointer-on-d0} to disable it.
20676 @item -mno-crt0
20677 @opindex mno-crt0
20678 Do not link in the C run-time initialization object file.
20680 @item -mrelax
20681 @opindex mrelax
20682 Indicate to the linker that it should perform a relaxation optimization pass
20683 to shorten branches, calls and absolute memory addresses.  This option only
20684 has an effect when used on the command line for the final link step.
20686 This option makes symbolic debugging impossible.
20688 @item -mliw
20689 @opindex mliw
20690 Allow the compiler to generate @emph{Long Instruction Word}
20691 instructions if the target is the @samp{AM33} or later.  This is the
20692 default.  This option defines the preprocessor macro @code{__LIW__}.
20694 @item -mnoliw
20695 @opindex mnoliw
20696 Do not allow the compiler to generate @emph{Long Instruction Word}
20697 instructions.  This option defines the preprocessor macro
20698 @code{__NO_LIW__}.
20700 @item -msetlb
20701 @opindex msetlb
20702 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
20703 instructions if the target is the @samp{AM33} or later.  This is the
20704 default.  This option defines the preprocessor macro @code{__SETLB__}.
20706 @item -mnosetlb
20707 @opindex mnosetlb
20708 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
20709 instructions.  This option defines the preprocessor macro
20710 @code{__NO_SETLB__}.
20712 @end table
20714 @node Moxie Options
20715 @subsection Moxie Options
20716 @cindex Moxie Options
20718 @table @gcctabopt
20720 @item -meb
20721 @opindex meb
20722 Generate big-endian code.  This is the default for @samp{moxie-*-*}
20723 configurations.
20725 @item -mel
20726 @opindex mel
20727 Generate little-endian code.
20729 @item -mmul.x
20730 @opindex mmul.x
20731 Generate mul.x and umul.x instructions.  This is the default for
20732 @samp{moxiebox-*-*} configurations.
20734 @item -mno-crt0
20735 @opindex mno-crt0
20736 Do not link in the C run-time initialization object file.
20738 @end table
20740 @node MSP430 Options
20741 @subsection MSP430 Options
20742 @cindex MSP430 Options
20744 These options are defined for the MSP430:
20746 @table @gcctabopt
20748 @item -masm-hex
20749 @opindex masm-hex
20750 Force assembly output to always use hex constants.  Normally such
20751 constants are signed decimals, but this option is available for
20752 testsuite and/or aesthetic purposes.
20754 @item -mmcu=
20755 @opindex mmcu=
20756 Select the MCU to target.  This is used to create a C preprocessor
20757 symbol based upon the MCU name, converted to upper case and pre- and
20758 post-fixed with @samp{__}.  This in turn is used by the
20759 @file{msp430.h} header file to select an MCU-specific supplementary
20760 header file.
20762 The option also sets the ISA to use.  If the MCU name is one that is
20763 known to only support the 430 ISA then that is selected, otherwise the
20764 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
20765 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
20766 name selects the 430X ISA.
20768 In addition an MCU-specific linker script is added to the linker
20769 command line.  The script's name is the name of the MCU with
20770 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
20771 command line defines the C preprocessor symbol @code{__XXX__} and
20772 cause the linker to search for a script called @file{xxx.ld}.
20774 This option is also passed on to the assembler.
20776 @item -mwarn-mcu
20777 @itemx -mno-warn-mcu
20778 @opindex mwarn-mcu
20779 @opindex mno-warn-mcu
20780 This option enables or disables warnings about conflicts between the
20781 MCU name specified by the @option{-mmcu} option and the ISA set by the
20782 @option{-mcpu} option and/or the hardware multiply support set by the
20783 @option{-mhwmult} option.  It also toggles warnings about unrecognized
20784 MCU names.  This option is on by default.
20786 @item -mcpu=
20787 @opindex mcpu=
20788 Specifies the ISA to use.  Accepted values are @samp{msp430},
20789 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
20790 @option{-mmcu=} option should be used to select the ISA.
20792 @item -msim
20793 @opindex msim
20794 Link to the simulator runtime libraries and linker script.  Overrides
20795 any scripts that would be selected by the @option{-mmcu=} option.
20797 @item -mlarge
20798 @opindex mlarge
20799 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
20801 @item -msmall
20802 @opindex msmall
20803 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
20805 @item -mrelax
20806 @opindex mrelax
20807 This option is passed to the assembler and linker, and allows the
20808 linker to perform certain optimizations that cannot be done until
20809 the final link.
20811 @item mhwmult=
20812 @opindex mhwmult=
20813 Describes the type of hardware multiply supported by the target.
20814 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
20815 for the original 16-bit-only multiply supported by early MCUs.
20816 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
20817 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
20818 A value of @samp{auto} can also be given.  This tells GCC to deduce
20819 the hardware multiply support based upon the MCU name provided by the
20820 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
20821 the MCU name is not recognized then no hardware multiply support is
20822 assumed.  @code{auto} is the default setting.
20824 Hardware multiplies are normally performed by calling a library
20825 routine.  This saves space in the generated code.  When compiling at
20826 @option{-O3} or higher however the hardware multiplier is invoked
20827 inline.  This makes for bigger, but faster code.
20829 The hardware multiply routines disable interrupts whilst running and
20830 restore the previous interrupt state when they finish.  This makes
20831 them safe to use inside interrupt handlers as well as in normal code.
20833 @item -minrt
20834 @opindex minrt
20835 Enable the use of a minimum runtime environment - no static
20836 initializers or constructors.  This is intended for memory-constrained
20837 devices.  The compiler includes special symbols in some objects
20838 that tell the linker and runtime which code fragments are required.
20840 @item -mcode-region=
20841 @itemx -mdata-region=
20842 @opindex mcode-region
20843 @opindex mdata-region
20844 These options tell the compiler where to place functions and data that
20845 do not have one of the @code{lower}, @code{upper}, @code{either} or
20846 @code{section} attributes.  Possible values are @code{lower},
20847 @code{upper}, @code{either} or @code{any}.  The first three behave
20848 like the corresponding attribute.  The fourth possible value -
20849 @code{any} - is the default.  It leaves placement entirely up to the
20850 linker script and how it assigns the standard sections
20851 (@code{.text}, @code{.data}, etc) to the memory regions.
20853 @item -msilicon-errata=
20854 @opindex msilicon-errata
20855 This option passes on a request to assembler to enable the fixes for
20856 the named silicon errata.
20858 @item -msilicon-errata-warn=
20859 @opindex msilicon-errata-warn
20860 This option passes on a request to the assembler to enable warning
20861 messages when a silicon errata might need to be applied.
20863 @end table
20865 @node NDS32 Options
20866 @subsection NDS32 Options
20867 @cindex NDS32 Options
20869 These options are defined for NDS32 implementations:
20871 @table @gcctabopt
20873 @item -mbig-endian
20874 @opindex mbig-endian
20875 Generate code in big-endian mode.
20877 @item -mlittle-endian
20878 @opindex mlittle-endian
20879 Generate code in little-endian mode.
20881 @item -mreduced-regs
20882 @opindex mreduced-regs
20883 Use reduced-set registers for register allocation.
20885 @item -mfull-regs
20886 @opindex mfull-regs
20887 Use full-set registers for register allocation.
20889 @item -mcmov
20890 @opindex mcmov
20891 Generate conditional move instructions.
20893 @item -mno-cmov
20894 @opindex mno-cmov
20895 Do not generate conditional move instructions.
20897 @item -mperf-ext
20898 @opindex mperf-ext
20899 Generate performance extension instructions.
20901 @item -mno-perf-ext
20902 @opindex mno-perf-ext
20903 Do not generate performance extension instructions.
20905 @item -mv3push
20906 @opindex mv3push
20907 Generate v3 push25/pop25 instructions.
20909 @item -mno-v3push
20910 @opindex mno-v3push
20911 Do not generate v3 push25/pop25 instructions.
20913 @item -m16-bit
20914 @opindex m16-bit
20915 Generate 16-bit instructions.
20917 @item -mno-16-bit
20918 @opindex mno-16-bit
20919 Do not generate 16-bit instructions.
20921 @item -misr-vector-size=@var{num}
20922 @opindex misr-vector-size
20923 Specify the size of each interrupt vector, which must be 4 or 16.
20925 @item -mcache-block-size=@var{num}
20926 @opindex mcache-block-size
20927 Specify the size of each cache block,
20928 which must be a power of 2 between 4 and 512.
20930 @item -march=@var{arch}
20931 @opindex march
20932 Specify the name of the target architecture.
20934 @item -mcmodel=@var{code-model}
20935 @opindex mcmodel
20936 Set the code model to one of
20937 @table @asis
20938 @item @samp{small}
20939 All the data and read-only data segments must be within 512KB addressing space.
20940 The text segment must be within 16MB addressing space.
20941 @item @samp{medium}
20942 The data segment must be within 512KB while the read-only data segment can be
20943 within 4GB addressing space.  The text segment should be still within 16MB
20944 addressing space.
20945 @item @samp{large}
20946 All the text and data segments can be within 4GB addressing space.
20947 @end table
20949 @item -mctor-dtor
20950 @opindex mctor-dtor
20951 Enable constructor/destructor feature.
20953 @item -mrelax
20954 @opindex mrelax
20955 Guide linker to relax instructions.
20957 @end table
20959 @node Nios II Options
20960 @subsection Nios II Options
20961 @cindex Nios II options
20962 @cindex Altera Nios II options
20964 These are the options defined for the Altera Nios II processor.
20966 @table @gcctabopt
20968 @item -G @var{num}
20969 @opindex G
20970 @cindex smaller data references
20971 Put global and static objects less than or equal to @var{num} bytes
20972 into the small data or BSS sections instead of the normal data or BSS
20973 sections.  The default value of @var{num} is 8.
20975 @item -mgpopt=@var{option}
20976 @item -mgpopt
20977 @itemx -mno-gpopt
20978 @opindex mgpopt
20979 @opindex mno-gpopt
20980 Generate (do not generate) GP-relative accesses.  The following 
20981 @var{option} names are recognized:
20983 @table @samp
20985 @item none
20986 Do not generate GP-relative accesses.
20988 @item local
20989 Generate GP-relative accesses for small data objects that are not 
20990 external, weak, or uninitialized common symbols.  
20991 Also use GP-relative addressing for objects that
20992 have been explicitly placed in a small data section via a @code{section}
20993 attribute.
20995 @item global
20996 As for @samp{local}, but also generate GP-relative accesses for
20997 small data objects that are external, weak, or common.  If you use this option,
20998 you must ensure that all parts of your program (including libraries) are
20999 compiled with the same @option{-G} setting.
21001 @item data
21002 Generate GP-relative accesses for all data objects in the program.  If you
21003 use this option, the entire data and BSS segments
21004 of your program must fit in 64K of memory and you must use an appropriate
21005 linker script to allocate them within the addressable range of the
21006 global pointer.
21008 @item all
21009 Generate GP-relative addresses for function pointers as well as data
21010 pointers.  If you use this option, the entire text, data, and BSS segments
21011 of your program must fit in 64K of memory and you must use an appropriate
21012 linker script to allocate them within the addressable range of the
21013 global pointer.
21015 @end table
21017 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
21018 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
21020 The default is @option{-mgpopt} except when @option{-fpic} or
21021 @option{-fPIC} is specified to generate position-independent code.
21022 Note that the Nios II ABI does not permit GP-relative accesses from
21023 shared libraries.
21025 You may need to specify @option{-mno-gpopt} explicitly when building
21026 programs that include large amounts of small data, including large
21027 GOT data sections.  In this case, the 16-bit offset for GP-relative
21028 addressing may not be large enough to allow access to the entire 
21029 small data section.
21031 @item -mel
21032 @itemx -meb
21033 @opindex mel
21034 @opindex meb
21035 Generate little-endian (default) or big-endian (experimental) code,
21036 respectively.
21038 @item -march=@var{arch}
21039 @opindex march
21040 This specifies the name of the target Nios II architecture.  GCC uses this
21041 name to determine what kind of instructions it can emit when generating
21042 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
21044 The preprocessor macro @code{__nios2_arch__} is available to programs,
21045 with value 1 or 2, indicating the targeted ISA level.
21047 @item -mbypass-cache
21048 @itemx -mno-bypass-cache
21049 @opindex mno-bypass-cache
21050 @opindex mbypass-cache
21051 Force all load and store instructions to always bypass cache by 
21052 using I/O variants of the instructions. The default is not to
21053 bypass the cache.
21055 @item -mno-cache-volatile 
21056 @itemx -mcache-volatile       
21057 @opindex mcache-volatile 
21058 @opindex mno-cache-volatile
21059 Volatile memory access bypass the cache using the I/O variants of 
21060 the load and store instructions. The default is not to bypass the cache.
21062 @item -mno-fast-sw-div
21063 @itemx -mfast-sw-div
21064 @opindex mno-fast-sw-div
21065 @opindex mfast-sw-div
21066 Do not use table-based fast divide for small numbers. The default 
21067 is to use the fast divide at @option{-O3} and above.
21069 @item -mno-hw-mul
21070 @itemx -mhw-mul
21071 @itemx -mno-hw-mulx
21072 @itemx -mhw-mulx
21073 @itemx -mno-hw-div
21074 @itemx -mhw-div
21075 @opindex mno-hw-mul
21076 @opindex mhw-mul
21077 @opindex mno-hw-mulx
21078 @opindex mhw-mulx
21079 @opindex mno-hw-div
21080 @opindex mhw-div
21081 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
21082 instructions by the compiler. The default is to emit @code{mul}
21083 and not emit @code{div} and @code{mulx}.
21085 @item -mbmx
21086 @itemx -mno-bmx
21087 @itemx -mcdx
21088 @itemx -mno-cdx
21089 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
21090 CDX (code density) instructions.  Enabling these instructions also
21091 requires @option{-march=r2}.  Since these instructions are optional
21092 extensions to the R2 architecture, the default is not to emit them.
21094 @item -mcustom-@var{insn}=@var{N}
21095 @itemx -mno-custom-@var{insn}
21096 @opindex mcustom-@var{insn}
21097 @opindex mno-custom-@var{insn}
21098 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
21099 custom instruction with encoding @var{N} when generating code that uses 
21100 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
21101 instruction 253 for single-precision floating-point add operations instead
21102 of the default behavior of using a library call.
21104 The following values of @var{insn} are supported.  Except as otherwise
21105 noted, floating-point operations are expected to be implemented with
21106 normal IEEE 754 semantics and correspond directly to the C operators or the
21107 equivalent GCC built-in functions (@pxref{Other Builtins}).
21109 Single-precision floating point:
21110 @table @asis
21112 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
21113 Binary arithmetic operations.
21115 @item @samp{fnegs}
21116 Unary negation.
21118 @item @samp{fabss}
21119 Unary absolute value.
21121 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
21122 Comparison operations.
21124 @item @samp{fmins}, @samp{fmaxs}
21125 Floating-point minimum and maximum.  These instructions are only
21126 generated if @option{-ffinite-math-only} is specified.
21128 @item @samp{fsqrts}
21129 Unary square root operation.
21131 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
21132 Floating-point trigonometric and exponential functions.  These instructions
21133 are only generated if @option{-funsafe-math-optimizations} is also specified.
21135 @end table
21137 Double-precision floating point:
21138 @table @asis
21140 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
21141 Binary arithmetic operations.
21143 @item @samp{fnegd}
21144 Unary negation.
21146 @item @samp{fabsd}
21147 Unary absolute value.
21149 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
21150 Comparison operations.
21152 @item @samp{fmind}, @samp{fmaxd}
21153 Double-precision minimum and maximum.  These instructions are only
21154 generated if @option{-ffinite-math-only} is specified.
21156 @item @samp{fsqrtd}
21157 Unary square root operation.
21159 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
21160 Double-precision trigonometric and exponential functions.  These instructions
21161 are only generated if @option{-funsafe-math-optimizations} is also specified.
21163 @end table
21165 Conversions:
21166 @table @asis
21167 @item @samp{fextsd}
21168 Conversion from single precision to double precision.
21170 @item @samp{ftruncds}
21171 Conversion from double precision to single precision.
21173 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
21174 Conversion from floating point to signed or unsigned integer types, with
21175 truncation towards zero.
21177 @item @samp{round}
21178 Conversion from single-precision floating point to signed integer,
21179 rounding to the nearest integer and ties away from zero.
21180 This corresponds to the @code{__builtin_lroundf} function when
21181 @option{-fno-math-errno} is used.
21183 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
21184 Conversion from signed or unsigned integer types to floating-point types.
21186 @end table
21188 In addition, all of the following transfer instructions for internal
21189 registers X and Y must be provided to use any of the double-precision
21190 floating-point instructions.  Custom instructions taking two
21191 double-precision source operands expect the first operand in the
21192 64-bit register X.  The other operand (or only operand of a unary
21193 operation) is given to the custom arithmetic instruction with the
21194 least significant half in source register @var{src1} and the most
21195 significant half in @var{src2}.  A custom instruction that returns a
21196 double-precision result returns the most significant 32 bits in the
21197 destination register and the other half in 32-bit register Y.  
21198 GCC automatically generates the necessary code sequences to write
21199 register X and/or read register Y when double-precision floating-point
21200 instructions are used.
21202 @table @asis
21204 @item @samp{fwrx}
21205 Write @var{src1} into the least significant half of X and @var{src2} into
21206 the most significant half of X.
21208 @item @samp{fwry}
21209 Write @var{src1} into Y.
21211 @item @samp{frdxhi}, @samp{frdxlo}
21212 Read the most or least (respectively) significant half of X and store it in
21213 @var{dest}.
21215 @item @samp{frdy}
21216 Read the value of Y and store it into @var{dest}.
21217 @end table
21219 Note that you can gain more local control over generation of Nios II custom
21220 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
21221 and @code{target("no-custom-@var{insn}")} function attributes
21222 (@pxref{Function Attributes})
21223 or pragmas (@pxref{Function Specific Option Pragmas}).
21225 @item -mcustom-fpu-cfg=@var{name}
21226 @opindex mcustom-fpu-cfg
21228 This option enables a predefined, named set of custom instruction encodings
21229 (see @option{-mcustom-@var{insn}} above).  
21230 Currently, the following sets are defined:
21232 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
21233 @gccoptlist{-mcustom-fmuls=252 @gol
21234 -mcustom-fadds=253 @gol
21235 -mcustom-fsubs=254 @gol
21236 -fsingle-precision-constant}
21238 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
21239 @gccoptlist{-mcustom-fmuls=252 @gol
21240 -mcustom-fadds=253 @gol
21241 -mcustom-fsubs=254 @gol
21242 -mcustom-fdivs=255 @gol
21243 -fsingle-precision-constant}
21245 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
21246 @gccoptlist{-mcustom-floatus=243 @gol
21247 -mcustom-fixsi=244 @gol
21248 -mcustom-floatis=245 @gol
21249 -mcustom-fcmpgts=246 @gol
21250 -mcustom-fcmples=249 @gol
21251 -mcustom-fcmpeqs=250 @gol
21252 -mcustom-fcmpnes=251 @gol
21253 -mcustom-fmuls=252 @gol
21254 -mcustom-fadds=253 @gol
21255 -mcustom-fsubs=254 @gol
21256 -mcustom-fdivs=255 @gol
21257 -fsingle-precision-constant}
21259 Custom instruction assignments given by individual
21260 @option{-mcustom-@var{insn}=} options override those given by
21261 @option{-mcustom-fpu-cfg=}, regardless of the
21262 order of the options on the command line.
21264 Note that you can gain more local control over selection of a FPU
21265 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
21266 function attribute (@pxref{Function Attributes})
21267 or pragma (@pxref{Function Specific Option Pragmas}).
21269 @end table
21271 These additional @samp{-m} options are available for the Altera Nios II
21272 ELF (bare-metal) target:
21274 @table @gcctabopt
21276 @item -mhal
21277 @opindex mhal
21278 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
21279 startup and termination code, and is typically used in conjunction with
21280 @option{-msys-crt0=} to specify the location of the alternate startup code
21281 provided by the HAL BSP.
21283 @item -msmallc
21284 @opindex msmallc
21285 Link with a limited version of the C library, @option{-lsmallc}, rather than
21286 Newlib.
21288 @item -msys-crt0=@var{startfile}
21289 @opindex msys-crt0
21290 @var{startfile} is the file name of the startfile (crt0) to use 
21291 when linking.  This option is only useful in conjunction with @option{-mhal}.
21293 @item -msys-lib=@var{systemlib}
21294 @opindex msys-lib
21295 @var{systemlib} is the library name of the library that provides
21296 low-level system calls required by the C library,
21297 e.g. @code{read} and @code{write}.
21298 This option is typically used to link with a library provided by a HAL BSP.
21300 @end table
21302 @node Nvidia PTX Options
21303 @subsection Nvidia PTX Options
21304 @cindex Nvidia PTX options
21305 @cindex nvptx options
21307 These options are defined for Nvidia PTX:
21309 @table @gcctabopt
21311 @item -m32
21312 @itemx -m64
21313 @opindex m32
21314 @opindex m64
21315 Generate code for 32-bit or 64-bit ABI.
21317 @item -mmainkernel
21318 @opindex mmainkernel
21319 Link in code for a __main kernel.  This is for stand-alone instead of
21320 offloading execution.
21322 @item -moptimize
21323 @opindex moptimize
21324 Apply partitioned execution optimizations.  This is the default when any
21325 level of optimization is selected.
21327 @item -msoft-stack
21328 @opindex msoft-stack
21329 Generate code that does not use @code{.local} memory
21330 directly for stack storage. Instead, a per-warp stack pointer is
21331 maintained explicitly. This enables variable-length stack allocation (with
21332 variable-length arrays or @code{alloca}), and when global memory is used for
21333 underlying storage, makes it possible to access automatic variables from other
21334 threads, or with atomic instructions. This code generation variant is used
21335 for OpenMP offloading, but the option is exposed on its own for the purpose
21336 of testing the compiler; to generate code suitable for linking into programs
21337 using OpenMP offloading, use option @option{-mgomp}.
21339 @item -muniform-simt
21340 @opindex muniform-simt
21341 Switch to code generation variant that allows to execute all threads in each
21342 warp, while maintaining memory state and side effects as if only one thread
21343 in each warp was active outside of OpenMP SIMD regions.  All atomic operations
21344 and calls to runtime (malloc, free, vprintf) are conditionally executed (iff
21345 current lane index equals the master lane index), and the register being
21346 assigned is copied via a shuffle instruction from the master lane.  Outside of
21347 SIMD regions lane 0 is the master; inside, each thread sees itself as the
21348 master.  Shared memory array @code{int __nvptx_uni[]} stores all-zeros or
21349 all-ones bitmasks for each warp, indicating current mode (0 outside of SIMD
21350 regions).  Each thread can bitwise-and the bitmask at position @code{tid.y}
21351 with current lane index to compute the master lane index.
21353 @item -mgomp
21354 @opindex mgomp
21355 Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and
21356 @option{-muniform-simt} options, and selects corresponding multilib variant.
21358 @end table
21360 @node PDP-11 Options
21361 @subsection PDP-11 Options
21362 @cindex PDP-11 Options
21364 These options are defined for the PDP-11:
21366 @table @gcctabopt
21367 @item -mfpu
21368 @opindex mfpu
21369 Use hardware FPP floating point.  This is the default.  (FIS floating
21370 point on the PDP-11/40 is not supported.)
21372 @item -msoft-float
21373 @opindex msoft-float
21374 Do not use hardware floating point.
21376 @item -mac0
21377 @opindex mac0
21378 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
21380 @item -mno-ac0
21381 @opindex mno-ac0
21382 Return floating-point results in memory.  This is the default.
21384 @item -m40
21385 @opindex m40
21386 Generate code for a PDP-11/40.
21388 @item -m45
21389 @opindex m45
21390 Generate code for a PDP-11/45.  This is the default.
21392 @item -m10
21393 @opindex m10
21394 Generate code for a PDP-11/10.
21396 @item -mbcopy-builtin
21397 @opindex mbcopy-builtin
21398 Use inline @code{movmemhi} patterns for copying memory.  This is the
21399 default.
21401 @item -mbcopy
21402 @opindex mbcopy
21403 Do not use inline @code{movmemhi} patterns for copying memory.
21405 @item -mint16
21406 @itemx -mno-int32
21407 @opindex mint16
21408 @opindex mno-int32
21409 Use 16-bit @code{int}.  This is the default.
21411 @item -mint32
21412 @itemx -mno-int16
21413 @opindex mint32
21414 @opindex mno-int16
21415 Use 32-bit @code{int}.
21417 @item -mfloat64
21418 @itemx -mno-float32
21419 @opindex mfloat64
21420 @opindex mno-float32
21421 Use 64-bit @code{float}.  This is the default.
21423 @item -mfloat32
21424 @itemx -mno-float64
21425 @opindex mfloat32
21426 @opindex mno-float64
21427 Use 32-bit @code{float}.
21429 @item -mabshi
21430 @opindex mabshi
21431 Use @code{abshi2} pattern.  This is the default.
21433 @item -mno-abshi
21434 @opindex mno-abshi
21435 Do not use @code{abshi2} pattern.
21437 @item -mbranch-expensive
21438 @opindex mbranch-expensive
21439 Pretend that branches are expensive.  This is for experimenting with
21440 code generation only.
21442 @item -mbranch-cheap
21443 @opindex mbranch-cheap
21444 Do not pretend that branches are expensive.  This is the default.
21446 @item -munix-asm
21447 @opindex munix-asm
21448 Use Unix assembler syntax.  This is the default when configured for
21449 @samp{pdp11-*-bsd}.
21451 @item -mdec-asm
21452 @opindex mdec-asm
21453 Use DEC assembler syntax.  This is the default when configured for any
21454 PDP-11 target other than @samp{pdp11-*-bsd}.
21455 @end table
21457 @node picoChip Options
21458 @subsection picoChip Options
21459 @cindex picoChip options
21461 These @samp{-m} options are defined for picoChip implementations:
21463 @table @gcctabopt
21465 @item -mae=@var{ae_type}
21466 @opindex mcpu
21467 Set the instruction set, register set, and instruction scheduling
21468 parameters for array element type @var{ae_type}.  Supported values
21469 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
21471 @option{-mae=ANY} selects a completely generic AE type.  Code
21472 generated with this option runs on any of the other AE types.  The
21473 code is not as efficient as it would be if compiled for a specific
21474 AE type, and some types of operation (e.g., multiplication) do not
21475 work properly on all types of AE.
21477 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
21478 for compiled code, and is the default.
21480 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
21481 option may suffer from poor performance of byte (char) manipulation,
21482 since the DSP AE does not provide hardware support for byte load/stores.
21484 @item -msymbol-as-address
21485 Enable the compiler to directly use a symbol name as an address in a
21486 load/store instruction, without first loading it into a
21487 register.  Typically, the use of this option generates larger
21488 programs, which run faster than when the option isn't used.  However, the
21489 results vary from program to program, so it is left as a user option,
21490 rather than being permanently enabled.
21492 @item -mno-inefficient-warnings
21493 Disables warnings about the generation of inefficient code.  These
21494 warnings can be generated, for example, when compiling code that
21495 performs byte-level memory operations on the MAC AE type.  The MAC AE has
21496 no hardware support for byte-level memory operations, so all byte
21497 load/stores must be synthesized from word load/store operations.  This is
21498 inefficient and a warning is generated to indicate
21499 that you should rewrite the code to avoid byte operations, or to target
21500 an AE type that has the necessary hardware support.  This option disables
21501 these warnings.
21503 @end table
21505 @node PowerPC Options
21506 @subsection PowerPC Options
21507 @cindex PowerPC options
21509 These are listed under @xref{RS/6000 and PowerPC Options}.
21511 @node RISC-V Options
21512 @subsection RISC-V Options
21513 @cindex RISC-V Options
21515 These command-line options are defined for RISC-V targets:
21517 @table @gcctabopt
21518 @item -mbranch-cost=@var{n}
21519 @opindex mbranch-cost
21520 Set the cost of branches to roughly @var{n} instructions.
21522 @item -mmemcpy
21523 @itemx -mno-memcpy
21524 @opindex mmemcpy
21525 Don't optimize block moves.
21527 @item -mplt
21528 @itemx -mno-plt
21529 @opindex plt
21530 When generating PIC code, allow the use of PLTs. Ignored for non-PIC.
21532 @item -mabi=@var{ABI-string}
21533 @opindex mabi
21534 Specify integer and floating-point calling convention.  This defaults to the
21535 natural calling convention: e.g.@ LP64 for RV64I, ILP32 for RV32I, LP64D for
21536 RV64G.
21538 @item -mfdiv
21539 @itemx -mno-fdiv
21540 @opindex mfdiv
21541 Use hardware floating-point divide and square root instructions.  This requires
21542 the F or D extensions for floating-point registers.
21544 @item -mdiv
21545 @itemx -mno-div
21546 @opindex mdiv
21547 Use hardware instructions for integer division.  This requires the M extension.
21549 @item -march=@var{ISA-string}
21550 @opindex march
21551 Generate code for given RISC-V ISA (e.g.@ @samp{rv64im}).  ISA strings must be
21552 lower-case.  Examples include @samp{rv64i}, @samp{rv32g}, and @samp{rv32imaf}.
21554 @item -mtune=@var{processor-string}
21555 @opindex mtune
21556 Optimize the output for the given processor, specified by microarchitecture
21557 name.
21559 @item -msmall-data-limit=@var{n}
21560 @opindex msmall-data-limit
21561 Put global and static data smaller than @var{n} bytes into a special section
21562 (on some targets).
21564 @item -msave-restore
21565 @itemx -mno-save-restore
21566 @opindex msave-restore
21567 Use smaller but slower prologue and epilogue code.
21569 @item -mstrict-align
21570 @itemx -mno-strict-align
21571 @opindex mstrict-align
21572 Do not generate unaligned memory accesses.
21574 @item -mcmodel=@var{code-model}
21575 @opindex mcmodel
21576 Specify the code model.
21578 @end table
21580 @node RL78 Options
21581 @subsection RL78 Options
21582 @cindex RL78 Options
21584 @table @gcctabopt
21586 @item -msim
21587 @opindex msim
21588 Links in additional target libraries to support operation within a
21589 simulator.
21591 @item -mmul=none
21592 @itemx -mmul=g10
21593 @itemx -mmul=g13
21594 @itemx -mmul=g14
21595 @itemx -mmul=rl78
21596 @opindex mmul
21597 Specifies the type of hardware multiplication and division support to
21598 be used.  The simplest is @code{none}, which uses software for both
21599 multiplication and division.  This is the default.  The @code{g13}
21600 value is for the hardware multiply/divide peripheral found on the
21601 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
21602 the multiplication and division instructions supported by the RL78/G14
21603 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
21604 the value @code{mg10} is an alias for @code{none}.
21606 In addition a C preprocessor macro is defined, based upon the setting
21607 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
21608 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
21610 @item -mcpu=g10
21611 @itemx -mcpu=g13
21612 @itemx -mcpu=g14
21613 @itemx -mcpu=rl78
21614 @opindex mcpu
21615 Specifies the RL78 core to target.  The default is the G14 core, also
21616 known as an S3 core or just RL78.  The G13 or S2 core does not have
21617 multiply or divide instructions, instead it uses a hardware peripheral
21618 for these operations.  The G10 or S1 core does not have register
21619 banks, so it uses a different calling convention.
21621 If this option is set it also selects the type of hardware multiply
21622 support to use, unless this is overridden by an explicit
21623 @option{-mmul=none} option on the command line.  Thus specifying
21624 @option{-mcpu=g13} enables the use of the G13 hardware multiply
21625 peripheral and specifying @option{-mcpu=g10} disables the use of
21626 hardware multiplications altogether.
21628 Note, although the RL78/G14 core is the default target, specifying
21629 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
21630 change the behavior of the toolchain since it also enables G14
21631 hardware multiply support.  If these options are not specified on the
21632 command line then software multiplication routines will be used even
21633 though the code targets the RL78 core.  This is for backwards
21634 compatibility with older toolchains which did not have hardware
21635 multiply and divide support.
21637 In addition a C preprocessor macro is defined, based upon the setting
21638 of this option.  Possible values are: @code{__RL78_G10__},
21639 @code{__RL78_G13__} or @code{__RL78_G14__}.
21641 @item -mg10
21642 @itemx -mg13
21643 @itemx -mg14
21644 @itemx -mrl78
21645 @opindex mg10
21646 @opindex mg13
21647 @opindex mg14
21648 @opindex mrl78
21649 These are aliases for the corresponding @option{-mcpu=} option.  They
21650 are provided for backwards compatibility.
21652 @item -mallregs
21653 @opindex mallregs
21654 Allow the compiler to use all of the available registers.  By default
21655 registers @code{r24..r31} are reserved for use in interrupt handlers.
21656 With this option enabled these registers can be used in ordinary
21657 functions as well.
21659 @item -m64bit-doubles
21660 @itemx -m32bit-doubles
21661 @opindex m64bit-doubles
21662 @opindex m32bit-doubles
21663 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
21664 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
21665 @option{-m32bit-doubles}.
21667 @item -msave-mduc-in-interrupts
21668 @item -mno-save-mduc-in-interrupts
21669 @opindex msave-mduc-in-interrupts
21670 @opindex mno-save-mduc-in-interrupts
21671 Specifies that interrupt handler functions should preserve the
21672 MDUC registers.  This is only necessary if normal code might use
21673 the MDUC registers, for example because it performs multiplication
21674 and division operations.  The default is to ignore the MDUC registers
21675 as this makes the interrupt handlers faster.  The target option -mg13
21676 needs to be passed for this to work as this feature is only available
21677 on the G13 target (S2 core).  The MDUC registers will only be saved
21678 if the interrupt handler performs a multiplication or division
21679 operation or it calls another function.
21681 @end table
21683 @node RS/6000 and PowerPC Options
21684 @subsection IBM RS/6000 and PowerPC Options
21685 @cindex RS/6000 and PowerPC Options
21686 @cindex IBM RS/6000 and PowerPC Options
21688 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
21689 @table @gcctabopt
21690 @item -mpowerpc-gpopt
21691 @itemx -mno-powerpc-gpopt
21692 @itemx -mpowerpc-gfxopt
21693 @itemx -mno-powerpc-gfxopt
21694 @need 800
21695 @itemx -mpowerpc64
21696 @itemx -mno-powerpc64
21697 @itemx -mmfcrf
21698 @itemx -mno-mfcrf
21699 @itemx -mpopcntb
21700 @itemx -mno-popcntb
21701 @itemx -mpopcntd
21702 @itemx -mno-popcntd
21703 @itemx -mfprnd
21704 @itemx -mno-fprnd
21705 @need 800
21706 @itemx -mcmpb
21707 @itemx -mno-cmpb
21708 @itemx -mmfpgpr
21709 @itemx -mno-mfpgpr
21710 @itemx -mhard-dfp
21711 @itemx -mno-hard-dfp
21712 @opindex mpowerpc-gpopt
21713 @opindex mno-powerpc-gpopt
21714 @opindex mpowerpc-gfxopt
21715 @opindex mno-powerpc-gfxopt
21716 @opindex mpowerpc64
21717 @opindex mno-powerpc64
21718 @opindex mmfcrf
21719 @opindex mno-mfcrf
21720 @opindex mpopcntb
21721 @opindex mno-popcntb
21722 @opindex mpopcntd
21723 @opindex mno-popcntd
21724 @opindex mfprnd
21725 @opindex mno-fprnd
21726 @opindex mcmpb
21727 @opindex mno-cmpb
21728 @opindex mmfpgpr
21729 @opindex mno-mfpgpr
21730 @opindex mhard-dfp
21731 @opindex mno-hard-dfp
21732 You use these options to specify which instructions are available on the
21733 processor you are using.  The default value of these options is
21734 determined when configuring GCC@.  Specifying the
21735 @option{-mcpu=@var{cpu_type}} overrides the specification of these
21736 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
21737 rather than the options listed above.
21739 Specifying @option{-mpowerpc-gpopt} allows
21740 GCC to use the optional PowerPC architecture instructions in the
21741 General Purpose group, including floating-point square root.  Specifying
21742 @option{-mpowerpc-gfxopt} allows GCC to
21743 use the optional PowerPC architecture instructions in the Graphics
21744 group, including floating-point select.
21746 The @option{-mmfcrf} option allows GCC to generate the move from
21747 condition register field instruction implemented on the POWER4
21748 processor and other processors that support the PowerPC V2.01
21749 architecture.
21750 The @option{-mpopcntb} option allows GCC to generate the popcount and
21751 double-precision FP reciprocal estimate instruction implemented on the
21752 POWER5 processor and other processors that support the PowerPC V2.02
21753 architecture.
21754 The @option{-mpopcntd} option allows GCC to generate the popcount
21755 instruction implemented on the POWER7 processor and other processors
21756 that support the PowerPC V2.06 architecture.
21757 The @option{-mfprnd} option allows GCC to generate the FP round to
21758 integer instructions implemented on the POWER5+ processor and other
21759 processors that support the PowerPC V2.03 architecture.
21760 The @option{-mcmpb} option allows GCC to generate the compare bytes
21761 instruction implemented on the POWER6 processor and other processors
21762 that support the PowerPC V2.05 architecture.
21763 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
21764 general-purpose register instructions implemented on the POWER6X
21765 processor and other processors that support the extended PowerPC V2.05
21766 architecture.
21767 The @option{-mhard-dfp} option allows GCC to generate the decimal
21768 floating-point instructions implemented on some POWER processors.
21770 The @option{-mpowerpc64} option allows GCC to generate the additional
21771 64-bit instructions that are found in the full PowerPC64 architecture
21772 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
21773 @option{-mno-powerpc64}.
21775 @item -mcpu=@var{cpu_type}
21776 @opindex mcpu
21777 Set architecture type, register usage, and
21778 instruction scheduling parameters for machine type @var{cpu_type}.
21779 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
21780 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
21781 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
21782 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
21783 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
21784 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
21785 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
21786 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
21787 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
21788 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
21789 @samp{power9}, @samp{powerpc}, @samp{powerpc64}, @samp{powerpc64le},
21790 and @samp{rs64}.
21792 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
21793 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
21794 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
21795 architecture machine types, with an appropriate, generic processor
21796 model assumed for scheduling purposes.
21798 The other options specify a specific processor.  Code generated under
21799 those options runs best on that processor, and may not run at all on
21800 others.
21802 The @option{-mcpu} options automatically enable or disable the
21803 following options:
21805 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
21806 -mpopcntb -mpopcntd  -mpowerpc64 @gol
21807 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
21808 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
21809 -mcrypto -mdirect-move -mhtm -mpower8-fusion -mpower8-vector @gol
21810 -mquad-memory -mquad-memory-atomic -mfloat128 -mfloat128-hardware}
21812 The particular options set for any particular CPU varies between
21813 compiler versions, depending on what setting seems to produce optimal
21814 code for that CPU; it doesn't necessarily reflect the actual hardware's
21815 capabilities.  If you wish to set an individual option to a particular
21816 value, you may specify it after the @option{-mcpu} option, like
21817 @option{-mcpu=970 -mno-altivec}.
21819 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
21820 not enabled or disabled by the @option{-mcpu} option at present because
21821 AIX does not have full support for these options.  You may still
21822 enable or disable them individually if you're sure it'll work in your
21823 environment.
21825 @item -mtune=@var{cpu_type}
21826 @opindex mtune
21827 Set the instruction scheduling parameters for machine type
21828 @var{cpu_type}, but do not set the architecture type or register usage,
21829 as @option{-mcpu=@var{cpu_type}} does.  The same
21830 values for @var{cpu_type} are used for @option{-mtune} as for
21831 @option{-mcpu}.  If both are specified, the code generated uses the
21832 architecture and registers set by @option{-mcpu}, but the
21833 scheduling parameters set by @option{-mtune}.
21835 @item -mcmodel=small
21836 @opindex mcmodel=small
21837 Generate PowerPC64 code for the small model: The TOC is limited to
21838 64k.
21840 @item -mcmodel=medium
21841 @opindex mcmodel=medium
21842 Generate PowerPC64 code for the medium model: The TOC and other static
21843 data may be up to a total of 4G in size.  This is the default for 64-bit
21844 Linux.
21846 @item -mcmodel=large
21847 @opindex mcmodel=large
21848 Generate PowerPC64 code for the large model: The TOC may be up to 4G
21849 in size.  Other data and code is only limited by the 64-bit address
21850 space.
21852 @item -maltivec
21853 @itemx -mno-altivec
21854 @opindex maltivec
21855 @opindex mno-altivec
21856 Generate code that uses (does not use) AltiVec instructions, and also
21857 enable the use of built-in functions that allow more direct access to
21858 the AltiVec instruction set.  You may also need to set
21859 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
21860 enhancements.
21862 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
21863 @option{-maltivec=be}, the element order for AltiVec intrinsics such
21864 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
21865 match array element order corresponding to the endianness of the
21866 target.  That is, element zero identifies the leftmost element in a
21867 vector register when targeting a big-endian platform, and identifies
21868 the rightmost element in a vector register when targeting a
21869 little-endian platform.
21871 @item -maltivec=be
21872 @opindex maltivec=be
21873 Generate AltiVec instructions using big-endian element order,
21874 regardless of whether the target is big- or little-endian.  This is
21875 the default when targeting a big-endian platform.
21877 The element order is used to interpret element numbers in AltiVec
21878 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
21879 @code{vec_insert}.  By default, these match array element order
21880 corresponding to the endianness for the target.
21882 @item -maltivec=le
21883 @opindex maltivec=le
21884 Generate AltiVec instructions using little-endian element order,
21885 regardless of whether the target is big- or little-endian.  This is
21886 the default when targeting a little-endian platform.  This option is
21887 currently ignored when targeting a big-endian platform.
21889 The element order is used to interpret element numbers in AltiVec
21890 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
21891 @code{vec_insert}.  By default, these match array element order
21892 corresponding to the endianness for the target.
21894 @item -mvrsave
21895 @itemx -mno-vrsave
21896 @opindex mvrsave
21897 @opindex mno-vrsave
21898 Generate VRSAVE instructions when generating AltiVec code.
21900 @item -msecure-plt
21901 @opindex msecure-plt
21902 Generate code that allows @command{ld} and @command{ld.so}
21903 to build executables and shared
21904 libraries with non-executable @code{.plt} and @code{.got} sections.
21905 This is a PowerPC
21906 32-bit SYSV ABI option.
21908 @item -mbss-plt
21909 @opindex mbss-plt
21910 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
21911 fills in, and
21912 requires @code{.plt} and @code{.got}
21913 sections that are both writable and executable.
21914 This is a PowerPC 32-bit SYSV ABI option.
21916 @item -misel
21917 @itemx -mno-isel
21918 @opindex misel
21919 @opindex mno-isel
21920 This switch enables or disables the generation of ISEL instructions.
21922 @item -misel=@var{yes/no}
21923 This switch has been deprecated.  Use @option{-misel} and
21924 @option{-mno-isel} instead.
21926 @item -mspe
21927 @itemx -mno-spe
21928 @opindex mspe
21929 @opindex mno-spe
21930 This switch enables or disables the generation of SPE simd
21931 instructions.
21933 @item -mpaired
21934 @itemx -mno-paired
21935 @opindex mpaired
21936 @opindex mno-paired
21937 This switch enables or disables the generation of PAIRED simd
21938 instructions.
21940 @item -mspe=@var{yes/no}
21941 This option has been deprecated.  Use @option{-mspe} and
21942 @option{-mno-spe} instead.
21944 @item -mvsx
21945 @itemx -mno-vsx
21946 @opindex mvsx
21947 @opindex mno-vsx
21948 Generate code that uses (does not use) vector/scalar (VSX)
21949 instructions, and also enable the use of built-in functions that allow
21950 more direct access to the VSX instruction set.
21952 @item -mcrypto
21953 @itemx -mno-crypto
21954 @opindex mcrypto
21955 @opindex mno-crypto
21956 Enable the use (disable) of the built-in functions that allow direct
21957 access to the cryptographic instructions that were added in version
21958 2.07 of the PowerPC ISA.
21960 @item -mdirect-move
21961 @itemx -mno-direct-move
21962 @opindex mdirect-move
21963 @opindex mno-direct-move
21964 Generate code that uses (does not use) the instructions to move data
21965 between the general purpose registers and the vector/scalar (VSX)
21966 registers that were added in version 2.07 of the PowerPC ISA.
21968 @item -mhtm
21969 @itemx -mno-htm
21970 @opindex mhtm
21971 @opindex mno-htm
21972 Enable (disable) the use of the built-in functions that allow direct
21973 access to the Hardware Transactional Memory (HTM) instructions that
21974 were added in version 2.07 of the PowerPC ISA.
21976 @item -mpower8-fusion
21977 @itemx -mno-power8-fusion
21978 @opindex mpower8-fusion
21979 @opindex mno-power8-fusion
21980 Generate code that keeps (does not keeps) some integer operations
21981 adjacent so that the instructions can be fused together on power8 and
21982 later processors.
21984 @item -mpower8-vector
21985 @itemx -mno-power8-vector
21986 @opindex mpower8-vector
21987 @opindex mno-power8-vector
21988 Generate code that uses (does not use) the vector and scalar
21989 instructions that were added in version 2.07 of the PowerPC ISA.  Also
21990 enable the use of built-in functions that allow more direct access to
21991 the vector instructions.
21993 @item -mquad-memory
21994 @itemx -mno-quad-memory
21995 @opindex mquad-memory
21996 @opindex mno-quad-memory
21997 Generate code that uses (does not use) the non-atomic quad word memory
21998 instructions.  The @option{-mquad-memory} option requires use of
21999 64-bit mode.
22001 @item -mquad-memory-atomic
22002 @itemx -mno-quad-memory-atomic
22003 @opindex mquad-memory-atomic
22004 @opindex mno-quad-memory-atomic
22005 Generate code that uses (does not use) the atomic quad word memory
22006 instructions.  The @option{-mquad-memory-atomic} option requires use of
22007 64-bit mode.
22009 @item -mfloat128
22010 @itemx -mno-float128
22011 @opindex mfloat128
22012 @opindex mno-float128
22013 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
22014 and use either software emulation for IEEE 128-bit floating point or
22015 hardware instructions.
22017 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7}, or
22018 @option{-mcpu=power8}) must be enabled to use the @option{-mfloat128}
22019 option.  The @option{-mfloat128} option only works on PowerPC 64-bit
22020 Linux systems.
22022 If you use the ISA 3.0 instruction set (@option{-mcpu=power9}), the
22023 @option{-mfloat128} option will also enable the generation of ISA 3.0
22024 IEEE 128-bit floating point instructions.  Otherwise, IEEE 128-bit
22025 floating point will be done with software emulation.
22027 @item -mfloat128-hardware
22028 @itemx -mno-float128-hardware
22029 @opindex mfloat128-hardware
22030 @opindex mno-float128-hardware
22031 Enable/disable using ISA 3.0 hardware instructions to support the
22032 @var{__float128} data type.
22034 If you use @option{-mfloat128-hardware}, it will enable the option
22035 @option{-mfloat128} as well.
22037 If you select ISA 3.0 instructions with @option{-mcpu=power9}, but do
22038 not use either @option{-mfloat128} or @option{-mfloat128-hardware},
22039 the IEEE 128-bit floating point support will not be enabled.
22041 @item -mfloat-gprs=@var{yes/single/double/no}
22042 @itemx -mfloat-gprs
22043 @opindex mfloat-gprs
22044 This switch enables or disables the generation of floating-point
22045 operations on the general-purpose registers for architectures that
22046 support it.
22048 The argument @samp{yes} or @samp{single} enables the use of
22049 single-precision floating-point operations.
22051 The argument @samp{double} enables the use of single and
22052 double-precision floating-point operations.
22054 The argument @samp{no} disables floating-point operations on the
22055 general-purpose registers.
22057 This option is currently only available on the MPC854x.
22059 @item -m32
22060 @itemx -m64
22061 @opindex m32
22062 @opindex m64
22063 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
22064 targets (including GNU/Linux).  The 32-bit environment sets int, long
22065 and pointer to 32 bits and generates code that runs on any PowerPC
22066 variant.  The 64-bit environment sets int to 32 bits and long and
22067 pointer to 64 bits, and generates code for PowerPC64, as for
22068 @option{-mpowerpc64}.
22070 @item -mfull-toc
22071 @itemx -mno-fp-in-toc
22072 @itemx -mno-sum-in-toc
22073 @itemx -mminimal-toc
22074 @opindex mfull-toc
22075 @opindex mno-fp-in-toc
22076 @opindex mno-sum-in-toc
22077 @opindex mminimal-toc
22078 Modify generation of the TOC (Table Of Contents), which is created for
22079 every executable file.  The @option{-mfull-toc} option is selected by
22080 default.  In that case, GCC allocates at least one TOC entry for
22081 each unique non-automatic variable reference in your program.  GCC
22082 also places floating-point constants in the TOC@.  However, only
22083 16,384 entries are available in the TOC@.
22085 If you receive a linker error message that saying you have overflowed
22086 the available TOC space, you can reduce the amount of TOC space used
22087 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
22088 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
22089 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
22090 generate code to calculate the sum of an address and a constant at
22091 run time instead of putting that sum into the TOC@.  You may specify one
22092 or both of these options.  Each causes GCC to produce very slightly
22093 slower and larger code at the expense of conserving TOC space.
22095 If you still run out of space in the TOC even when you specify both of
22096 these options, specify @option{-mminimal-toc} instead.  This option causes
22097 GCC to make only one TOC entry for every file.  When you specify this
22098 option, GCC produces code that is slower and larger but which
22099 uses extremely little TOC space.  You may wish to use this option
22100 only on files that contain less frequently-executed code.
22102 @item -maix64
22103 @itemx -maix32
22104 @opindex maix64
22105 @opindex maix32
22106 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
22107 @code{long} type, and the infrastructure needed to support them.
22108 Specifying @option{-maix64} implies @option{-mpowerpc64},
22109 while @option{-maix32} disables the 64-bit ABI and
22110 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
22112 @item -mxl-compat
22113 @itemx -mno-xl-compat
22114 @opindex mxl-compat
22115 @opindex mno-xl-compat
22116 Produce code that conforms more closely to IBM XL compiler semantics
22117 when using AIX-compatible ABI@.  Pass floating-point arguments to
22118 prototyped functions beyond the register save area (RSA) on the stack
22119 in addition to argument FPRs.  Do not assume that most significant
22120 double in 128-bit long double value is properly rounded when comparing
22121 values and converting to double.  Use XL symbol names for long double
22122 support routines.
22124 The AIX calling convention was extended but not initially documented to
22125 handle an obscure K&R C case of calling a function that takes the
22126 address of its arguments with fewer arguments than declared.  IBM XL
22127 compilers access floating-point arguments that do not fit in the
22128 RSA from the stack when a subroutine is compiled without
22129 optimization.  Because always storing floating-point arguments on the
22130 stack is inefficient and rarely needed, this option is not enabled by
22131 default and only is necessary when calling subroutines compiled by IBM
22132 XL compilers without optimization.
22134 @item -mpe
22135 @opindex mpe
22136 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
22137 application written to use message passing with special startup code to
22138 enable the application to run.  The system must have PE installed in the
22139 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
22140 must be overridden with the @option{-specs=} option to specify the
22141 appropriate directory location.  The Parallel Environment does not
22142 support threads, so the @option{-mpe} option and the @option{-pthread}
22143 option are incompatible.
22145 @item -malign-natural
22146 @itemx -malign-power
22147 @opindex malign-natural
22148 @opindex malign-power
22149 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
22150 @option{-malign-natural} overrides the ABI-defined alignment of larger
22151 types, such as floating-point doubles, on their natural size-based boundary.
22152 The option @option{-malign-power} instructs GCC to follow the ABI-specified
22153 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
22155 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
22156 is not supported.
22158 @item -msoft-float
22159 @itemx -mhard-float
22160 @opindex msoft-float
22161 @opindex mhard-float
22162 Generate code that does not use (uses) the floating-point register set.
22163 Software floating-point emulation is provided if you use the
22164 @option{-msoft-float} option, and pass the option to GCC when linking.
22166 @item -msingle-float
22167 @itemx -mdouble-float
22168 @opindex msingle-float
22169 @opindex mdouble-float
22170 Generate code for single- or double-precision floating-point operations.
22171 @option{-mdouble-float} implies @option{-msingle-float}.
22173 @item -msimple-fpu
22174 @opindex msimple-fpu
22175 Do not generate @code{sqrt} and @code{div} instructions for hardware
22176 floating-point unit.
22178 @item -mfpu=@var{name}
22179 @opindex mfpu
22180 Specify type of floating-point unit.  Valid values for @var{name} are
22181 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
22182 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
22183 @samp{sp_full} (equivalent to @option{-msingle-float}),
22184 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
22186 @item -mxilinx-fpu
22187 @opindex mxilinx-fpu
22188 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
22190 @item -mmultiple
22191 @itemx -mno-multiple
22192 @opindex mmultiple
22193 @opindex mno-multiple
22194 Generate code that uses (does not use) the load multiple word
22195 instructions and the store multiple word instructions.  These
22196 instructions are generated by default on POWER systems, and not
22197 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
22198 PowerPC systems, since those instructions do not work when the
22199 processor is in little-endian mode.  The exceptions are PPC740 and
22200 PPC750 which permit these instructions in little-endian mode.
22202 @item -mstring
22203 @itemx -mno-string
22204 @opindex mstring
22205 @opindex mno-string
22206 Generate code that uses (does not use) the load string instructions
22207 and the store string word instructions to save multiple registers and
22208 do small block moves.  These instructions are generated by default on
22209 POWER systems, and not generated on PowerPC systems.  Do not use
22210 @option{-mstring} on little-endian PowerPC systems, since those
22211 instructions do not work when the processor is in little-endian mode.
22212 The exceptions are PPC740 and PPC750 which permit these instructions
22213 in little-endian mode.
22215 @item -mupdate
22216 @itemx -mno-update
22217 @opindex mupdate
22218 @opindex mno-update
22219 Generate code that uses (does not use) the load or store instructions
22220 that update the base register to the address of the calculated memory
22221 location.  These instructions are generated by default.  If you use
22222 @option{-mno-update}, there is a small window between the time that the
22223 stack pointer is updated and the address of the previous frame is
22224 stored, which means code that walks the stack frame across interrupts or
22225 signals may get corrupted data.
22227 @item -mavoid-indexed-addresses
22228 @itemx -mno-avoid-indexed-addresses
22229 @opindex mavoid-indexed-addresses
22230 @opindex mno-avoid-indexed-addresses
22231 Generate code that tries to avoid (not avoid) the use of indexed load
22232 or store instructions. These instructions can incur a performance
22233 penalty on Power6 processors in certain situations, such as when
22234 stepping through large arrays that cross a 16M boundary.  This option
22235 is enabled by default when targeting Power6 and disabled otherwise.
22237 @item -mfused-madd
22238 @itemx -mno-fused-madd
22239 @opindex mfused-madd
22240 @opindex mno-fused-madd
22241 Generate code that uses (does not use) the floating-point multiply and
22242 accumulate instructions.  These instructions are generated by default
22243 if hardware floating point is used.  The machine-dependent
22244 @option{-mfused-madd} option is now mapped to the machine-independent
22245 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
22246 mapped to @option{-ffp-contract=off}.
22248 @item -mmulhw
22249 @itemx -mno-mulhw
22250 @opindex mmulhw
22251 @opindex mno-mulhw
22252 Generate code that uses (does not use) the half-word multiply and
22253 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
22254 These instructions are generated by default when targeting those
22255 processors.
22257 @item -mdlmzb
22258 @itemx -mno-dlmzb
22259 @opindex mdlmzb
22260 @opindex mno-dlmzb
22261 Generate code that uses (does not use) the string-search @samp{dlmzb}
22262 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
22263 generated by default when targeting those processors.
22265 @item -mno-bit-align
22266 @itemx -mbit-align
22267 @opindex mno-bit-align
22268 @opindex mbit-align
22269 On System V.4 and embedded PowerPC systems do not (do) force structures
22270 and unions that contain bit-fields to be aligned to the base type of the
22271 bit-field.
22273 For example, by default a structure containing nothing but 8
22274 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
22275 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
22276 the structure is aligned to a 1-byte boundary and is 1 byte in
22277 size.
22279 @item -mno-strict-align
22280 @itemx -mstrict-align
22281 @opindex mno-strict-align
22282 @opindex mstrict-align
22283 On System V.4 and embedded PowerPC systems do not (do) assume that
22284 unaligned memory references are handled by the system.
22286 @item -mrelocatable
22287 @itemx -mno-relocatable
22288 @opindex mrelocatable
22289 @opindex mno-relocatable
22290 Generate code that allows (does not allow) a static executable to be
22291 relocated to a different address at run time.  A simple embedded
22292 PowerPC system loader should relocate the entire contents of
22293 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
22294 a table of 32-bit addresses generated by this option.  For this to
22295 work, all objects linked together must be compiled with
22296 @option{-mrelocatable} or @option{-mrelocatable-lib}.
22297 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
22299 @item -mrelocatable-lib
22300 @itemx -mno-relocatable-lib
22301 @opindex mrelocatable-lib
22302 @opindex mno-relocatable-lib
22303 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
22304 @code{.fixup} section to allow static executables to be relocated at
22305 run time, but @option{-mrelocatable-lib} does not use the smaller stack
22306 alignment of @option{-mrelocatable}.  Objects compiled with
22307 @option{-mrelocatable-lib} may be linked with objects compiled with
22308 any combination of the @option{-mrelocatable} options.
22310 @item -mno-toc
22311 @itemx -mtoc
22312 @opindex mno-toc
22313 @opindex mtoc
22314 On System V.4 and embedded PowerPC systems do not (do) assume that
22315 register 2 contains a pointer to a global area pointing to the addresses
22316 used in the program.
22318 @item -mlittle
22319 @itemx -mlittle-endian
22320 @opindex mlittle
22321 @opindex mlittle-endian
22322 On System V.4 and embedded PowerPC systems compile code for the
22323 processor in little-endian mode.  The @option{-mlittle-endian} option is
22324 the same as @option{-mlittle}.
22326 @item -mbig
22327 @itemx -mbig-endian
22328 @opindex mbig
22329 @opindex mbig-endian
22330 On System V.4 and embedded PowerPC systems compile code for the
22331 processor in big-endian mode.  The @option{-mbig-endian} option is
22332 the same as @option{-mbig}.
22334 @item -mdynamic-no-pic
22335 @opindex mdynamic-no-pic
22336 On Darwin and Mac OS X systems, compile code so that it is not
22337 relocatable, but that its external references are relocatable.  The
22338 resulting code is suitable for applications, but not shared
22339 libraries.
22341 @item -msingle-pic-base
22342 @opindex msingle-pic-base
22343 Treat the register used for PIC addressing as read-only, rather than
22344 loading it in the prologue for each function.  The runtime system is
22345 responsible for initializing this register with an appropriate value
22346 before execution begins.
22348 @item -mprioritize-restricted-insns=@var{priority}
22349 @opindex mprioritize-restricted-insns
22350 This option controls the priority that is assigned to
22351 dispatch-slot restricted instructions during the second scheduling
22352 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
22353 or @samp{2} to assign no, highest, or second-highest (respectively) 
22354 priority to dispatch-slot restricted
22355 instructions.
22357 @item -msched-costly-dep=@var{dependence_type}
22358 @opindex msched-costly-dep
22359 This option controls which dependences are considered costly
22360 by the target during instruction scheduling.  The argument
22361 @var{dependence_type} takes one of the following values:
22363 @table @asis
22364 @item @samp{no}
22365 No dependence is costly.
22367 @item @samp{all}
22368 All dependences are costly.
22370 @item @samp{true_store_to_load}
22371 A true dependence from store to load is costly.
22373 @item @samp{store_to_load}
22374 Any dependence from store to load is costly.
22376 @item @var{number}
22377 Any dependence for which the latency is greater than or equal to 
22378 @var{number} is costly.
22379 @end table
22381 @item -minsert-sched-nops=@var{scheme}
22382 @opindex minsert-sched-nops
22383 This option controls which NOP insertion scheme is used during
22384 the second scheduling pass.  The argument @var{scheme} takes one of the
22385 following values:
22387 @table @asis
22388 @item @samp{no}
22389 Don't insert NOPs.
22391 @item @samp{pad}
22392 Pad with NOPs any dispatch group that has vacant issue slots,
22393 according to the scheduler's grouping.
22395 @item @samp{regroup_exact}
22396 Insert NOPs to force costly dependent insns into
22397 separate groups.  Insert exactly as many NOPs as needed to force an insn
22398 to a new group, according to the estimated processor grouping.
22400 @item @var{number}
22401 Insert NOPs to force costly dependent insns into
22402 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
22403 @end table
22405 @item -mcall-sysv
22406 @opindex mcall-sysv
22407 On System V.4 and embedded PowerPC systems compile code using calling
22408 conventions that adhere to the March 1995 draft of the System V
22409 Application Binary Interface, PowerPC processor supplement.  This is the
22410 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
22412 @item -mcall-sysv-eabi
22413 @itemx -mcall-eabi
22414 @opindex mcall-sysv-eabi
22415 @opindex mcall-eabi
22416 Specify both @option{-mcall-sysv} and @option{-meabi} options.
22418 @item -mcall-sysv-noeabi
22419 @opindex mcall-sysv-noeabi
22420 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
22422 @item -mcall-aixdesc
22423 @opindex m
22424 On System V.4 and embedded PowerPC systems compile code for the AIX
22425 operating system.
22427 @item -mcall-linux
22428 @opindex mcall-linux
22429 On System V.4 and embedded PowerPC systems compile code for the
22430 Linux-based GNU system.
22432 @item -mcall-freebsd
22433 @opindex mcall-freebsd
22434 On System V.4 and embedded PowerPC systems compile code for the
22435 FreeBSD operating system.
22437 @item -mcall-netbsd
22438 @opindex mcall-netbsd
22439 On System V.4 and embedded PowerPC systems compile code for the
22440 NetBSD operating system.
22442 @item -mcall-openbsd
22443 @opindex mcall-netbsd
22444 On System V.4 and embedded PowerPC systems compile code for the
22445 OpenBSD operating system.
22447 @item -maix-struct-return
22448 @opindex maix-struct-return
22449 Return all structures in memory (as specified by the AIX ABI)@.
22451 @item -msvr4-struct-return
22452 @opindex msvr4-struct-return
22453 Return structures smaller than 8 bytes in registers (as specified by the
22454 SVR4 ABI)@.
22456 @item -mabi=@var{abi-type}
22457 @opindex mabi
22458 Extend the current ABI with a particular extension, or remove such extension.
22459 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
22460 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
22461 @samp{elfv1}, @samp{elfv2}@.
22463 @item -mabi=spe
22464 @opindex mabi=spe
22465 Extend the current ABI with SPE ABI extensions.  This does not change
22466 the default ABI, instead it adds the SPE ABI extensions to the current
22467 ABI@.
22469 @item -mabi=no-spe
22470 @opindex mabi=no-spe
22471 Disable Book-E SPE ABI extensions for the current ABI@.
22473 @item -mabi=ibmlongdouble
22474 @opindex mabi=ibmlongdouble
22475 Change the current ABI to use IBM extended-precision long double.
22476 This is a PowerPC 32-bit SYSV ABI option.
22478 @item -mabi=ieeelongdouble
22479 @opindex mabi=ieeelongdouble
22480 Change the current ABI to use IEEE extended-precision long double.
22481 This is a PowerPC 32-bit Linux ABI option.
22483 @item -mabi=elfv1
22484 @opindex mabi=elfv1
22485 Change the current ABI to use the ELFv1 ABI.
22486 This is the default ABI for big-endian PowerPC 64-bit Linux.
22487 Overriding the default ABI requires special system support and is
22488 likely to fail in spectacular ways.
22490 @item -mabi=elfv2
22491 @opindex mabi=elfv2
22492 Change the current ABI to use the ELFv2 ABI.
22493 This is the default ABI for little-endian PowerPC 64-bit Linux.
22494 Overriding the default ABI requires special system support and is
22495 likely to fail in spectacular ways.
22497 @item -mgnu-attribute
22498 @itemx -mno-gnu-attribute
22499 @opindex mgnu-attribute
22500 @opindex mno-gnu-attribute
22501 Emit .gnu_attribute assembly directives to set tag/value pairs in a
22502 .gnu.attributes section that specify ABI variations in function
22503 parameters or return values.
22505 @item -mprototype
22506 @itemx -mno-prototype
22507 @opindex mprototype
22508 @opindex mno-prototype
22509 On System V.4 and embedded PowerPC systems assume that all calls to
22510 variable argument functions are properly prototyped.  Otherwise, the
22511 compiler must insert an instruction before every non-prototyped call to
22512 set or clear bit 6 of the condition code register (@code{CR}) to
22513 indicate whether floating-point values are passed in the floating-point
22514 registers in case the function takes variable arguments.  With
22515 @option{-mprototype}, only calls to prototyped variable argument functions
22516 set or clear the bit.
22518 @item -msim
22519 @opindex msim
22520 On embedded PowerPC systems, assume that the startup module is called
22521 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
22522 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
22523 configurations.
22525 @item -mmvme
22526 @opindex mmvme
22527 On embedded PowerPC systems, assume that the startup module is called
22528 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
22529 @file{libc.a}.
22531 @item -mads
22532 @opindex mads
22533 On embedded PowerPC systems, assume that the startup module is called
22534 @file{crt0.o} and the standard C libraries are @file{libads.a} and
22535 @file{libc.a}.
22537 @item -myellowknife
22538 @opindex myellowknife
22539 On embedded PowerPC systems, assume that the startup module is called
22540 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
22541 @file{libc.a}.
22543 @item -mvxworks
22544 @opindex mvxworks
22545 On System V.4 and embedded PowerPC systems, specify that you are
22546 compiling for a VxWorks system.
22548 @item -memb
22549 @opindex memb
22550 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
22551 header to indicate that @samp{eabi} extended relocations are used.
22553 @item -meabi
22554 @itemx -mno-eabi
22555 @opindex meabi
22556 @opindex mno-eabi
22557 On System V.4 and embedded PowerPC systems do (do not) adhere to the
22558 Embedded Applications Binary Interface (EABI), which is a set of
22559 modifications to the System V.4 specifications.  Selecting @option{-meabi}
22560 means that the stack is aligned to an 8-byte boundary, a function
22561 @code{__eabi} is called from @code{main} to set up the EABI
22562 environment, and the @option{-msdata} option can use both @code{r2} and
22563 @code{r13} to point to two separate small data areas.  Selecting
22564 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
22565 no EABI initialization function is called from @code{main}, and the
22566 @option{-msdata} option only uses @code{r13} to point to a single
22567 small data area.  The @option{-meabi} option is on by default if you
22568 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
22570 @item -msdata=eabi
22571 @opindex msdata=eabi
22572 On System V.4 and embedded PowerPC systems, put small initialized
22573 @code{const} global and static data in the @code{.sdata2} section, which
22574 is pointed to by register @code{r2}.  Put small initialized
22575 non-@code{const} global and static data in the @code{.sdata} section,
22576 which is pointed to by register @code{r13}.  Put small uninitialized
22577 global and static data in the @code{.sbss} section, which is adjacent to
22578 the @code{.sdata} section.  The @option{-msdata=eabi} option is
22579 incompatible with the @option{-mrelocatable} option.  The
22580 @option{-msdata=eabi} option also sets the @option{-memb} option.
22582 @item -msdata=sysv
22583 @opindex msdata=sysv
22584 On System V.4 and embedded PowerPC systems, put small global and static
22585 data in the @code{.sdata} section, which is pointed to by register
22586 @code{r13}.  Put small uninitialized global and static data in the
22587 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
22588 The @option{-msdata=sysv} option is incompatible with the
22589 @option{-mrelocatable} option.
22591 @item -msdata=default
22592 @itemx -msdata
22593 @opindex msdata=default
22594 @opindex msdata
22595 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
22596 compile code the same as @option{-msdata=eabi}, otherwise compile code the
22597 same as @option{-msdata=sysv}.
22599 @item -msdata=data
22600 @opindex msdata=data
22601 On System V.4 and embedded PowerPC systems, put small global
22602 data in the @code{.sdata} section.  Put small uninitialized global
22603 data in the @code{.sbss} section.  Do not use register @code{r13}
22604 to address small data however.  This is the default behavior unless
22605 other @option{-msdata} options are used.
22607 @item -msdata=none
22608 @itemx -mno-sdata
22609 @opindex msdata=none
22610 @opindex mno-sdata
22611 On embedded PowerPC systems, put all initialized global and static data
22612 in the @code{.data} section, and all uninitialized data in the
22613 @code{.bss} section.
22615 @item -mblock-move-inline-limit=@var{num}
22616 @opindex mblock-move-inline-limit
22617 Inline all block moves (such as calls to @code{memcpy} or structure
22618 copies) less than or equal to @var{num} bytes.  The minimum value for
22619 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
22620 targets.  The default value is target-specific.
22622 @item -G @var{num}
22623 @opindex G
22624 @cindex smaller data references (PowerPC)
22625 @cindex .sdata/.sdata2 references (PowerPC)
22626 On embedded PowerPC systems, put global and static items less than or
22627 equal to @var{num} bytes into the small data or BSS sections instead of
22628 the normal data or BSS section.  By default, @var{num} is 8.  The
22629 @option{-G @var{num}} switch is also passed to the linker.
22630 All modules should be compiled with the same @option{-G @var{num}} value.
22632 @item -mregnames
22633 @itemx -mno-regnames
22634 @opindex mregnames
22635 @opindex mno-regnames
22636 On System V.4 and embedded PowerPC systems do (do not) emit register
22637 names in the assembly language output using symbolic forms.
22639 @item -mlongcall
22640 @itemx -mno-longcall
22641 @opindex mlongcall
22642 @opindex mno-longcall
22643 By default assume that all calls are far away so that a longer and more
22644 expensive calling sequence is required.  This is required for calls
22645 farther than 32 megabytes (33,554,432 bytes) from the current location.
22646 A short call is generated if the compiler knows
22647 the call cannot be that far away.  This setting can be overridden by
22648 the @code{shortcall} function attribute, or by @code{#pragma
22649 longcall(0)}.
22651 Some linkers are capable of detecting out-of-range calls and generating
22652 glue code on the fly.  On these systems, long calls are unnecessary and
22653 generate slower code.  As of this writing, the AIX linker can do this,
22654 as can the GNU linker for PowerPC/64.  It is planned to add this feature
22655 to the GNU linker for 32-bit PowerPC systems as well.
22657 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
22658 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
22659 addresses represent the callee and the branch island.  The
22660 Darwin/PPC linker prefers the first address and generates a @code{bl
22661 callee} if the PPC @code{bl} instruction reaches the callee directly;
22662 otherwise, the linker generates @code{bl L42} to call the branch
22663 island.  The branch island is appended to the body of the
22664 calling function; it computes the full 32-bit address of the callee
22665 and jumps to it.
22667 On Mach-O (Darwin) systems, this option directs the compiler emit to
22668 the glue for every direct call, and the Darwin linker decides whether
22669 to use or discard it.
22671 In the future, GCC may ignore all longcall specifications
22672 when the linker is known to generate glue.
22674 @item -mtls-markers
22675 @itemx -mno-tls-markers
22676 @opindex mtls-markers
22677 @opindex mno-tls-markers
22678 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
22679 specifying the function argument.  The relocation allows the linker to
22680 reliably associate function call with argument setup instructions for
22681 TLS optimization, which in turn allows GCC to better schedule the
22682 sequence.
22684 @item -mrecip
22685 @itemx -mno-recip
22686 @opindex mrecip
22687 This option enables use of the reciprocal estimate and
22688 reciprocal square root estimate instructions with additional
22689 Newton-Raphson steps to increase precision instead of doing a divide or
22690 square root and divide for floating-point arguments.  You should use
22691 the @option{-ffast-math} option when using @option{-mrecip} (or at
22692 least @option{-funsafe-math-optimizations},
22693 @option{-ffinite-math-only}, @option{-freciprocal-math} and
22694 @option{-fno-trapping-math}).  Note that while the throughput of the
22695 sequence is generally higher than the throughput of the non-reciprocal
22696 instruction, the precision of the sequence can be decreased by up to 2
22697 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
22698 roots.
22700 @item -mrecip=@var{opt}
22701 @opindex mrecip=opt
22702 This option controls which reciprocal estimate instructions
22703 may be used.  @var{opt} is a comma-separated list of options, which may
22704 be preceded by a @code{!} to invert the option:
22706 @table @samp
22708 @item all
22709 Enable all estimate instructions.
22711 @item default 
22712 Enable the default instructions, equivalent to @option{-mrecip}.
22714 @item none 
22715 Disable all estimate instructions, equivalent to @option{-mno-recip}.
22717 @item div 
22718 Enable the reciprocal approximation instructions for both 
22719 single and double precision.
22721 @item divf 
22722 Enable the single-precision reciprocal approximation instructions.
22724 @item divd 
22725 Enable the double-precision reciprocal approximation instructions.
22727 @item rsqrt 
22728 Enable the reciprocal square root approximation instructions for both
22729 single and double precision.
22731 @item rsqrtf 
22732 Enable the single-precision reciprocal square root approximation instructions.
22734 @item rsqrtd 
22735 Enable the double-precision reciprocal square root approximation instructions.
22737 @end table
22739 So, for example, @option{-mrecip=all,!rsqrtd} enables
22740 all of the reciprocal estimate instructions, except for the
22741 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
22742 which handle the double-precision reciprocal square root calculations.
22744 @item -mrecip-precision
22745 @itemx -mno-recip-precision
22746 @opindex mrecip-precision
22747 Assume (do not assume) that the reciprocal estimate instructions
22748 provide higher-precision estimates than is mandated by the PowerPC
22749 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
22750 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
22751 The double-precision square root estimate instructions are not generated by
22752 default on low-precision machines, since they do not provide an
22753 estimate that converges after three steps.
22755 @item -mveclibabi=@var{type}
22756 @opindex mveclibabi
22757 Specifies the ABI type to use for vectorizing intrinsics using an
22758 external library.  The only type supported at present is @samp{mass},
22759 which specifies to use IBM's Mathematical Acceleration Subsystem
22760 (MASS) libraries for vectorizing intrinsics using external libraries.
22761 GCC currently emits calls to @code{acosd2}, @code{acosf4},
22762 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
22763 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
22764 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
22765 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
22766 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
22767 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
22768 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
22769 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
22770 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
22771 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
22772 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
22773 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
22774 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
22775 for power7.  Both @option{-ftree-vectorize} and
22776 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
22777 libraries must be specified at link time.
22779 @item -mfriz
22780 @itemx -mno-friz
22781 @opindex mfriz
22782 Generate (do not generate) the @code{friz} instruction when the
22783 @option{-funsafe-math-optimizations} option is used to optimize
22784 rounding of floating-point values to 64-bit integer and back to floating
22785 point.  The @code{friz} instruction does not return the same value if
22786 the floating-point number is too large to fit in an integer.
22788 @item -mpointers-to-nested-functions
22789 @itemx -mno-pointers-to-nested-functions
22790 @opindex mpointers-to-nested-functions
22791 Generate (do not generate) code to load up the static chain register
22792 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
22793 systems where a function pointer points to a 3-word descriptor giving
22794 the function address, TOC value to be loaded in register @code{r2}, and
22795 static chain value to be loaded in register @code{r11}.  The
22796 @option{-mpointers-to-nested-functions} is on by default.  You cannot
22797 call through pointers to nested functions or pointers
22798 to functions compiled in other languages that use the static chain if
22799 you use @option{-mno-pointers-to-nested-functions}.
22801 @item -msave-toc-indirect
22802 @itemx -mno-save-toc-indirect
22803 @opindex msave-toc-indirect
22804 Generate (do not generate) code to save the TOC value in the reserved
22805 stack location in the function prologue if the function calls through
22806 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
22807 saved in the prologue, it is saved just before the call through the
22808 pointer.  The @option{-mno-save-toc-indirect} option is the default.
22810 @item -mcompat-align-parm
22811 @itemx -mno-compat-align-parm
22812 @opindex mcompat-align-parm
22813 Generate (do not generate) code to pass structure parameters with a
22814 maximum alignment of 64 bits, for compatibility with older versions
22815 of GCC.
22817 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
22818 structure parameter on a 128-bit boundary when that structure contained
22819 a member requiring 128-bit alignment.  This is corrected in more
22820 recent versions of GCC.  This option may be used to generate code
22821 that is compatible with functions compiled with older versions of
22822 GCC.
22824 The @option{-mno-compat-align-parm} option is the default.
22826 @item -mstack-protector-guard=@var{guard}
22827 @itemx -mstack-protector-guard-reg=@var{reg}
22828 @itemx -mstack-protector-guard-offset=@var{offset}
22829 @itemx -mstack-protector-guard-symbol=@var{symbol}
22830 @opindex mstack-protector-guard
22831 @opindex mstack-protector-guard-reg
22832 @opindex mstack-protector-guard-offset
22833 @opindex mstack-protector-guard-symbol
22834 Generate stack protection code using canary at @var{guard}.  Supported
22835 locations are @samp{global} for global canary or @samp{tls} for per-thread
22836 canary in the TLS block (the default with GNU libc version 2.4 or later).
22838 With the latter choice the options
22839 @option{-mstack-protector-guard-reg=@var{reg}} and
22840 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
22841 which register to use as base register for reading the canary, and from what
22842 offset from that base register. The default for those is as specified in the
22843 relevant ABI.  @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
22844 the offset with a symbol reference to a canary in the TLS block.
22845 @end table
22847 @node RX Options
22848 @subsection RX Options
22849 @cindex RX Options
22851 These command-line options are defined for RX targets:
22853 @table @gcctabopt
22854 @item -m64bit-doubles
22855 @itemx -m32bit-doubles
22856 @opindex m64bit-doubles
22857 @opindex m32bit-doubles
22858 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
22859 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
22860 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
22861 works on 32-bit values, which is why the default is
22862 @option{-m32bit-doubles}.
22864 @item -fpu
22865 @itemx -nofpu
22866 @opindex fpu
22867 @opindex nofpu
22868 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
22869 floating-point hardware.  The default is enabled for the RX600
22870 series and disabled for the RX200 series.
22872 Floating-point instructions are only generated for 32-bit floating-point 
22873 values, however, so the FPU hardware is not used for doubles if the
22874 @option{-m64bit-doubles} option is used.
22876 @emph{Note} If the @option{-fpu} option is enabled then
22877 @option{-funsafe-math-optimizations} is also enabled automatically.
22878 This is because the RX FPU instructions are themselves unsafe.
22880 @item -mcpu=@var{name}
22881 @opindex mcpu
22882 Selects the type of RX CPU to be targeted.  Currently three types are
22883 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
22884 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
22886 The only difference between @samp{RX600} and @samp{RX610} is that the
22887 @samp{RX610} does not support the @code{MVTIPL} instruction.
22889 The @samp{RX200} series does not have a hardware floating-point unit
22890 and so @option{-nofpu} is enabled by default when this type is
22891 selected.
22893 @item -mbig-endian-data
22894 @itemx -mlittle-endian-data
22895 @opindex mbig-endian-data
22896 @opindex mlittle-endian-data
22897 Store data (but not code) in the big-endian format.  The default is
22898 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
22899 format.
22901 @item -msmall-data-limit=@var{N}
22902 @opindex msmall-data-limit
22903 Specifies the maximum size in bytes of global and static variables
22904 which can be placed into the small data area.  Using the small data
22905 area can lead to smaller and faster code, but the size of area is
22906 limited and it is up to the programmer to ensure that the area does
22907 not overflow.  Also when the small data area is used one of the RX's
22908 registers (usually @code{r13}) is reserved for use pointing to this
22909 area, so it is no longer available for use by the compiler.  This
22910 could result in slower and/or larger code if variables are pushed onto
22911 the stack instead of being held in this register.
22913 Note, common variables (variables that have not been initialized) and
22914 constants are not placed into the small data area as they are assigned
22915 to other sections in the output executable.
22917 The default value is zero, which disables this feature.  Note, this
22918 feature is not enabled by default with higher optimization levels
22919 (@option{-O2} etc) because of the potentially detrimental effects of
22920 reserving a register.  It is up to the programmer to experiment and
22921 discover whether this feature is of benefit to their program.  See the
22922 description of the @option{-mpid} option for a description of how the
22923 actual register to hold the small data area pointer is chosen.
22925 @item -msim
22926 @itemx -mno-sim
22927 @opindex msim
22928 @opindex mno-sim
22929 Use the simulator runtime.  The default is to use the libgloss
22930 board-specific runtime.
22932 @item -mas100-syntax
22933 @itemx -mno-as100-syntax
22934 @opindex mas100-syntax
22935 @opindex mno-as100-syntax
22936 When generating assembler output use a syntax that is compatible with
22937 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
22938 assembler, but it has some restrictions so it is not generated by default.
22940 @item -mmax-constant-size=@var{N}
22941 @opindex mmax-constant-size
22942 Specifies the maximum size, in bytes, of a constant that can be used as
22943 an operand in a RX instruction.  Although the RX instruction set does
22944 allow constants of up to 4 bytes in length to be used in instructions,
22945 a longer value equates to a longer instruction.  Thus in some
22946 circumstances it can be beneficial to restrict the size of constants
22947 that are used in instructions.  Constants that are too big are instead
22948 placed into a constant pool and referenced via register indirection.
22950 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
22951 or 4 means that constants of any size are allowed.
22953 @item -mrelax
22954 @opindex mrelax
22955 Enable linker relaxation.  Linker relaxation is a process whereby the
22956 linker attempts to reduce the size of a program by finding shorter
22957 versions of various instructions.  Disabled by default.
22959 @item -mint-register=@var{N}
22960 @opindex mint-register
22961 Specify the number of registers to reserve for fast interrupt handler
22962 functions.  The value @var{N} can be between 0 and 4.  A value of 1
22963 means that register @code{r13} is reserved for the exclusive use
22964 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
22965 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
22966 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
22967 A value of 0, the default, does not reserve any registers.
22969 @item -msave-acc-in-interrupts
22970 @opindex msave-acc-in-interrupts
22971 Specifies that interrupt handler functions should preserve the
22972 accumulator register.  This is only necessary if normal code might use
22973 the accumulator register, for example because it performs 64-bit
22974 multiplications.  The default is to ignore the accumulator as this
22975 makes the interrupt handlers faster.
22977 @item -mpid
22978 @itemx -mno-pid
22979 @opindex mpid
22980 @opindex mno-pid
22981 Enables the generation of position independent data.  When enabled any
22982 access to constant data is done via an offset from a base address
22983 held in a register.  This allows the location of constant data to be
22984 determined at run time without requiring the executable to be
22985 relocated, which is a benefit to embedded applications with tight
22986 memory constraints.  Data that can be modified is not affected by this
22987 option.
22989 Note, using this feature reserves a register, usually @code{r13}, for
22990 the constant data base address.  This can result in slower and/or
22991 larger code, especially in complicated functions.
22993 The actual register chosen to hold the constant data base address
22994 depends upon whether the @option{-msmall-data-limit} and/or the
22995 @option{-mint-register} command-line options are enabled.  Starting
22996 with register @code{r13} and proceeding downwards, registers are
22997 allocated first to satisfy the requirements of @option{-mint-register},
22998 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
22999 is possible for the small data area register to be @code{r8} if both
23000 @option{-mint-register=4} and @option{-mpid} are specified on the
23001 command line.
23003 By default this feature is not enabled.  The default can be restored
23004 via the @option{-mno-pid} command-line option.
23006 @item -mno-warn-multiple-fast-interrupts
23007 @itemx -mwarn-multiple-fast-interrupts
23008 @opindex mno-warn-multiple-fast-interrupts
23009 @opindex mwarn-multiple-fast-interrupts
23010 Prevents GCC from issuing a warning message if it finds more than one
23011 fast interrupt handler when it is compiling a file.  The default is to
23012 issue a warning for each extra fast interrupt handler found, as the RX
23013 only supports one such interrupt.
23015 @item -mallow-string-insns
23016 @itemx -mno-allow-string-insns
23017 @opindex mallow-string-insns
23018 @opindex mno-allow-string-insns
23019 Enables or disables the use of the string manipulation instructions
23020 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
23021 @code{SWHILE} and also the @code{RMPA} instruction.  These
23022 instructions may prefetch data, which is not safe to do if accessing
23023 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
23024 for more information).
23026 The default is to allow these instructions, but it is not possible for
23027 GCC to reliably detect all circumstances where a string instruction
23028 might be used to access an I/O register, so their use cannot be
23029 disabled automatically.  Instead it is reliant upon the programmer to
23030 use the @option{-mno-allow-string-insns} option if their program
23031 accesses I/O space.
23033 When the instructions are enabled GCC defines the C preprocessor
23034 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
23035 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
23037 @item -mjsr
23038 @itemx -mno-jsr
23039 @opindex mjsr
23040 @opindex mno-jsr
23041 Use only (or not only) @code{JSR} instructions to access functions.
23042 This option can be used when code size exceeds the range of @code{BSR}
23043 instructions.  Note that @option{-mno-jsr} does not mean to not use
23044 @code{JSR} but instead means that any type of branch may be used.
23045 @end table
23047 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
23048 has special significance to the RX port when used with the
23049 @code{interrupt} function attribute.  This attribute indicates a
23050 function intended to process fast interrupts.  GCC ensures
23051 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
23052 and/or @code{r13} and only provided that the normal use of the
23053 corresponding registers have been restricted via the
23054 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
23055 options.
23057 @node S/390 and zSeries Options
23058 @subsection S/390 and zSeries Options
23059 @cindex S/390 and zSeries Options
23061 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
23063 @table @gcctabopt
23064 @item -mhard-float
23065 @itemx -msoft-float
23066 @opindex mhard-float
23067 @opindex msoft-float
23068 Use (do not use) the hardware floating-point instructions and registers
23069 for floating-point operations.  When @option{-msoft-float} is specified,
23070 functions in @file{libgcc.a} are used to perform floating-point
23071 operations.  When @option{-mhard-float} is specified, the compiler
23072 generates IEEE floating-point instructions.  This is the default.
23074 @item -mhard-dfp
23075 @itemx -mno-hard-dfp
23076 @opindex mhard-dfp
23077 @opindex mno-hard-dfp
23078 Use (do not use) the hardware decimal-floating-point instructions for
23079 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
23080 specified, functions in @file{libgcc.a} are used to perform
23081 decimal-floating-point operations.  When @option{-mhard-dfp} is
23082 specified, the compiler generates decimal-floating-point hardware
23083 instructions.  This is the default for @option{-march=z9-ec} or higher.
23085 @item -mlong-double-64
23086 @itemx -mlong-double-128
23087 @opindex mlong-double-64
23088 @opindex mlong-double-128
23089 These switches control the size of @code{long double} type. A size
23090 of 64 bits makes the @code{long double} type equivalent to the @code{double}
23091 type. This is the default.
23093 @item -mbackchain
23094 @itemx -mno-backchain
23095 @opindex mbackchain
23096 @opindex mno-backchain
23097 Store (do not store) the address of the caller's frame as backchain pointer
23098 into the callee's stack frame.
23099 A backchain may be needed to allow debugging using tools that do not understand
23100 DWARF call frame information.
23101 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
23102 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
23103 the backchain is placed into the topmost word of the 96/160 byte register
23104 save area.
23106 In general, code compiled with @option{-mbackchain} is call-compatible with
23107 code compiled with @option{-mmo-backchain}; however, use of the backchain
23108 for debugging purposes usually requires that the whole binary is built with
23109 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
23110 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
23111 to build a linux kernel use @option{-msoft-float}.
23113 The default is to not maintain the backchain.
23115 @item -mpacked-stack
23116 @itemx -mno-packed-stack
23117 @opindex mpacked-stack
23118 @opindex mno-packed-stack
23119 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
23120 specified, the compiler uses the all fields of the 96/160 byte register save
23121 area only for their default purpose; unused fields still take up stack space.
23122 When @option{-mpacked-stack} is specified, register save slots are densely
23123 packed at the top of the register save area; unused space is reused for other
23124 purposes, allowing for more efficient use of the available stack space.
23125 However, when @option{-mbackchain} is also in effect, the topmost word of
23126 the save area is always used to store the backchain, and the return address
23127 register is always saved two words below the backchain.
23129 As long as the stack frame backchain is not used, code generated with
23130 @option{-mpacked-stack} is call-compatible with code generated with
23131 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
23132 S/390 or zSeries generated code that uses the stack frame backchain at run
23133 time, not just for debugging purposes.  Such code is not call-compatible
23134 with code compiled with @option{-mpacked-stack}.  Also, note that the
23135 combination of @option{-mbackchain},
23136 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
23137 to build a linux kernel use @option{-msoft-float}.
23139 The default is to not use the packed stack layout.
23141 @item -msmall-exec
23142 @itemx -mno-small-exec
23143 @opindex msmall-exec
23144 @opindex mno-small-exec
23145 Generate (or do not generate) code using the @code{bras} instruction
23146 to do subroutine calls.
23147 This only works reliably if the total executable size does not
23148 exceed 64k.  The default is to use the @code{basr} instruction instead,
23149 which does not have this limitation.
23151 @item -m64
23152 @itemx -m31
23153 @opindex m64
23154 @opindex m31
23155 When @option{-m31} is specified, generate code compliant to the
23156 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
23157 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
23158 particular to generate 64-bit instructions.  For the @samp{s390}
23159 targets, the default is @option{-m31}, while the @samp{s390x}
23160 targets default to @option{-m64}.
23162 @item -mzarch
23163 @itemx -mesa
23164 @opindex mzarch
23165 @opindex mesa
23166 When @option{-mzarch} is specified, generate code using the
23167 instructions available on z/Architecture.
23168 When @option{-mesa} is specified, generate code using the
23169 instructions available on ESA/390.  Note that @option{-mesa} is
23170 not possible with @option{-m64}.
23171 When generating code compliant to the GNU/Linux for S/390 ABI,
23172 the default is @option{-mesa}.  When generating code compliant
23173 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
23175 @item -mhtm
23176 @itemx -mno-htm
23177 @opindex mhtm
23178 @opindex mno-htm
23179 The @option{-mhtm} option enables a set of builtins making use of
23180 instructions available with the transactional execution facility
23181 introduced with the IBM zEnterprise EC12 machine generation
23182 @ref{S/390 System z Built-in Functions}.
23183 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
23185 @item -mvx
23186 @itemx -mno-vx
23187 @opindex mvx
23188 @opindex mno-vx
23189 When @option{-mvx} is specified, generate code using the instructions
23190 available with the vector extension facility introduced with the IBM
23191 z13 machine generation.
23192 This option changes the ABI for some vector type values with regard to
23193 alignment and calling conventions.  In case vector type values are
23194 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
23195 command will be added to mark the resulting binary with the ABI used.
23196 @option{-mvx} is enabled by default when using @option{-march=z13}.
23198 @item -mzvector
23199 @itemx -mno-zvector
23200 @opindex mzvector
23201 @opindex mno-zvector
23202 The @option{-mzvector} option enables vector language extensions and
23203 builtins using instructions available with the vector extension
23204 facility introduced with the IBM z13 machine generation.
23205 This option adds support for @samp{vector} to be used as a keyword to
23206 define vector type variables and arguments.  @samp{vector} is only
23207 available when GNU extensions are enabled.  It will not be expanded
23208 when requesting strict standard compliance e.g. with @option{-std=c99}.
23209 In addition to the GCC low-level builtins @option{-mzvector} enables
23210 a set of builtins added for compatibility with AltiVec-style
23211 implementations like Power and Cell.  In order to make use of these
23212 builtins the header file @file{vecintrin.h} needs to be included.
23213 @option{-mzvector} is disabled by default.
23215 @item -mmvcle
23216 @itemx -mno-mvcle
23217 @opindex mmvcle
23218 @opindex mno-mvcle
23219 Generate (or do not generate) code using the @code{mvcle} instruction
23220 to perform block moves.  When @option{-mno-mvcle} is specified,
23221 use a @code{mvc} loop instead.  This is the default unless optimizing for
23222 size.
23224 @item -mdebug
23225 @itemx -mno-debug
23226 @opindex mdebug
23227 @opindex mno-debug
23228 Print (or do not print) additional debug information when compiling.
23229 The default is to not print debug information.
23231 @item -march=@var{cpu-type}
23232 @opindex march
23233 Generate code that runs on @var{cpu-type}, which is the name of a
23234 system representing a certain processor type.  Possible values for
23235 @var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
23236 @samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
23237 @samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11}, and
23238 @samp{native}.
23240 The default is @option{-march=z900}.  @samp{g5}/@samp{arch3} and
23241 @samp{g6} are deprecated and will be removed with future releases.
23243 Specifying @samp{native} as cpu type can be used to select the best
23244 architecture option for the host processor.
23245 @option{-march=native} has no effect if GCC does not recognize the
23246 processor.
23248 @item -mtune=@var{cpu-type}
23249 @opindex mtune
23250 Tune to @var{cpu-type} everything applicable about the generated code,
23251 except for the ABI and the set of available instructions.
23252 The list of @var{cpu-type} values is the same as for @option{-march}.
23253 The default is the value used for @option{-march}.
23255 @item -mtpf-trace
23256 @itemx -mno-tpf-trace
23257 @opindex mtpf-trace
23258 @opindex mno-tpf-trace
23259 Generate code that adds (does not add) in TPF OS specific branches to trace
23260 routines in the operating system.  This option is off by default, even
23261 when compiling for the TPF OS@.
23263 @item -mfused-madd
23264 @itemx -mno-fused-madd
23265 @opindex mfused-madd
23266 @opindex mno-fused-madd
23267 Generate code that uses (does not use) the floating-point multiply and
23268 accumulate instructions.  These instructions are generated by default if
23269 hardware floating point is used.
23271 @item -mwarn-framesize=@var{framesize}
23272 @opindex mwarn-framesize
23273 Emit a warning if the current function exceeds the given frame size.  Because
23274 this is a compile-time check it doesn't need to be a real problem when the program
23275 runs.  It is intended to identify functions that most probably cause
23276 a stack overflow.  It is useful to be used in an environment with limited stack
23277 size e.g.@: the linux kernel.
23279 @item -mwarn-dynamicstack
23280 @opindex mwarn-dynamicstack
23281 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
23282 arrays.  This is generally a bad idea with a limited stack size.
23284 @item -mstack-guard=@var{stack-guard}
23285 @itemx -mstack-size=@var{stack-size}
23286 @opindex mstack-guard
23287 @opindex mstack-size
23288 If these options are provided the S/390 back end emits additional instructions in
23289 the function prologue that trigger a trap if the stack size is @var{stack-guard}
23290 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
23291 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
23292 the frame size of the compiled function is chosen.
23293 These options are intended to be used to help debugging stack overflow problems.
23294 The additionally emitted code causes only little overhead and hence can also be
23295 used in production-like systems without greater performance degradation.  The given
23296 values have to be exact powers of 2 and @var{stack-size} has to be greater than
23297 @var{stack-guard} without exceeding 64k.
23298 In order to be efficient the extra code makes the assumption that the stack starts
23299 at an address aligned to the value given by @var{stack-size}.
23300 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
23302 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
23303 @opindex mhotpatch
23304 If the hotpatch option is enabled, a ``hot-patching'' function
23305 prologue is generated for all functions in the compilation unit.
23306 The funtion label is prepended with the given number of two-byte
23307 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
23308 the label, 2 * @var{post-halfwords} bytes are appended, using the
23309 largest NOP like instructions the architecture allows (maximum
23310 1000000).
23312 If both arguments are zero, hotpatching is disabled.
23314 This option can be overridden for individual functions with the
23315 @code{hotpatch} attribute.
23316 @end table
23318 @node Score Options
23319 @subsection Score Options
23320 @cindex Score Options
23322 These options are defined for Score implementations:
23324 @table @gcctabopt
23325 @item -meb
23326 @opindex meb
23327 Compile code for big-endian mode.  This is the default.
23329 @item -mel
23330 @opindex mel
23331 Compile code for little-endian mode.
23333 @item -mnhwloop
23334 @opindex mnhwloop
23335 Disable generation of @code{bcnz} instructions.
23337 @item -muls
23338 @opindex muls
23339 Enable generation of unaligned load and store instructions.
23341 @item -mmac
23342 @opindex mmac
23343 Enable the use of multiply-accumulate instructions. Disabled by default.
23345 @item -mscore5
23346 @opindex mscore5
23347 Specify the SCORE5 as the target architecture.
23349 @item -mscore5u
23350 @opindex mscore5u
23351 Specify the SCORE5U of the target architecture.
23353 @item -mscore7
23354 @opindex mscore7
23355 Specify the SCORE7 as the target architecture. This is the default.
23357 @item -mscore7d
23358 @opindex mscore7d
23359 Specify the SCORE7D as the target architecture.
23360 @end table
23362 @node SH Options
23363 @subsection SH Options
23365 These @samp{-m} options are defined for the SH implementations:
23367 @table @gcctabopt
23368 @item -m1
23369 @opindex m1
23370 Generate code for the SH1.
23372 @item -m2
23373 @opindex m2
23374 Generate code for the SH2.
23376 @item -m2e
23377 Generate code for the SH2e.
23379 @item -m2a-nofpu
23380 @opindex m2a-nofpu
23381 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
23382 that the floating-point unit is not used.
23384 @item -m2a-single-only
23385 @opindex m2a-single-only
23386 Generate code for the SH2a-FPU, in such a way that no double-precision
23387 floating-point operations are used.
23389 @item -m2a-single
23390 @opindex m2a-single
23391 Generate code for the SH2a-FPU assuming the floating-point unit is in
23392 single-precision mode by default.
23394 @item -m2a
23395 @opindex m2a
23396 Generate code for the SH2a-FPU assuming the floating-point unit is in
23397 double-precision mode by default.
23399 @item -m3
23400 @opindex m3
23401 Generate code for the SH3.
23403 @item -m3e
23404 @opindex m3e
23405 Generate code for the SH3e.
23407 @item -m4-nofpu
23408 @opindex m4-nofpu
23409 Generate code for the SH4 without a floating-point unit.
23411 @item -m4-single-only
23412 @opindex m4-single-only
23413 Generate code for the SH4 with a floating-point unit that only
23414 supports single-precision arithmetic.
23416 @item -m4-single
23417 @opindex m4-single
23418 Generate code for the SH4 assuming the floating-point unit is in
23419 single-precision mode by default.
23421 @item -m4
23422 @opindex m4
23423 Generate code for the SH4.
23425 @item -m4-100
23426 @opindex m4-100
23427 Generate code for SH4-100.
23429 @item -m4-100-nofpu
23430 @opindex m4-100-nofpu
23431 Generate code for SH4-100 in such a way that the
23432 floating-point unit is not used.
23434 @item -m4-100-single
23435 @opindex m4-100-single
23436 Generate code for SH4-100 assuming the floating-point unit is in
23437 single-precision mode by default.
23439 @item -m4-100-single-only
23440 @opindex m4-100-single-only
23441 Generate code for SH4-100 in such a way that no double-precision
23442 floating-point operations are used.
23444 @item -m4-200
23445 @opindex m4-200
23446 Generate code for SH4-200.
23448 @item -m4-200-nofpu
23449 @opindex m4-200-nofpu
23450 Generate code for SH4-200 without in such a way that the
23451 floating-point unit is not used.
23453 @item -m4-200-single
23454 @opindex m4-200-single
23455 Generate code for SH4-200 assuming the floating-point unit is in
23456 single-precision mode by default.
23458 @item -m4-200-single-only
23459 @opindex m4-200-single-only
23460 Generate code for SH4-200 in such a way that no double-precision
23461 floating-point operations are used.
23463 @item -m4-300
23464 @opindex m4-300
23465 Generate code for SH4-300.
23467 @item -m4-300-nofpu
23468 @opindex m4-300-nofpu
23469 Generate code for SH4-300 without in such a way that the
23470 floating-point unit is not used.
23472 @item -m4-300-single
23473 @opindex m4-300-single
23474 Generate code for SH4-300 in such a way that no double-precision
23475 floating-point operations are used.
23477 @item -m4-300-single-only
23478 @opindex m4-300-single-only
23479 Generate code for SH4-300 in such a way that no double-precision
23480 floating-point operations are used.
23482 @item -m4-340
23483 @opindex m4-340
23484 Generate code for SH4-340 (no MMU, no FPU).
23486 @item -m4-500
23487 @opindex m4-500
23488 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
23489 assembler.
23491 @item -m4a-nofpu
23492 @opindex m4a-nofpu
23493 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
23494 floating-point unit is not used.
23496 @item -m4a-single-only
23497 @opindex m4a-single-only
23498 Generate code for the SH4a, in such a way that no double-precision
23499 floating-point operations are used.
23501 @item -m4a-single
23502 @opindex m4a-single
23503 Generate code for the SH4a assuming the floating-point unit is in
23504 single-precision mode by default.
23506 @item -m4a
23507 @opindex m4a
23508 Generate code for the SH4a.
23510 @item -m4al
23511 @opindex m4al
23512 Same as @option{-m4a-nofpu}, except that it implicitly passes
23513 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
23514 instructions at the moment.
23516 @item -mb
23517 @opindex mb
23518 Compile code for the processor in big-endian mode.
23520 @item -ml
23521 @opindex ml
23522 Compile code for the processor in little-endian mode.
23524 @item -mdalign
23525 @opindex mdalign
23526 Align doubles at 64-bit boundaries.  Note that this changes the calling
23527 conventions, and thus some functions from the standard C library do
23528 not work unless you recompile it first with @option{-mdalign}.
23530 @item -mrelax
23531 @opindex mrelax
23532 Shorten some address references at link time, when possible; uses the
23533 linker option @option{-relax}.
23535 @item -mbigtable
23536 @opindex mbigtable
23537 Use 32-bit offsets in @code{switch} tables.  The default is to use
23538 16-bit offsets.
23540 @item -mbitops
23541 @opindex mbitops
23542 Enable the use of bit manipulation instructions on SH2A.
23544 @item -mfmovd
23545 @opindex mfmovd
23546 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
23547 alignment constraints.
23549 @item -mrenesas
23550 @opindex mrenesas
23551 Comply with the calling conventions defined by Renesas.
23553 @item -mno-renesas
23554 @opindex mno-renesas
23555 Comply with the calling conventions defined for GCC before the Renesas
23556 conventions were available.  This option is the default for all
23557 targets of the SH toolchain.
23559 @item -mnomacsave
23560 @opindex mnomacsave
23561 Mark the @code{MAC} register as call-clobbered, even if
23562 @option{-mrenesas} is given.
23564 @item -mieee
23565 @itemx -mno-ieee
23566 @opindex mieee
23567 @opindex mno-ieee
23568 Control the IEEE compliance of floating-point comparisons, which affects the
23569 handling of cases where the result of a comparison is unordered.  By default
23570 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
23571 enabled @option{-mno-ieee} is implicitly set, which results in faster
23572 floating-point greater-equal and less-equal comparisons.  The implicit settings
23573 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
23575 @item -minline-ic_invalidate
23576 @opindex minline-ic_invalidate
23577 Inline code to invalidate instruction cache entries after setting up
23578 nested function trampolines.
23579 This option has no effect if @option{-musermode} is in effect and the selected
23580 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
23581 instruction.
23582 If the selected code generation option does not allow the use of the @code{icbi}
23583 instruction, and @option{-musermode} is not in effect, the inlined code
23584 manipulates the instruction cache address array directly with an associative
23585 write.  This not only requires privileged mode at run time, but it also
23586 fails if the cache line had been mapped via the TLB and has become unmapped.
23588 @item -misize
23589 @opindex misize
23590 Dump instruction size and location in the assembly code.
23592 @item -mpadstruct
23593 @opindex mpadstruct
23594 This option is deprecated.  It pads structures to multiple of 4 bytes,
23595 which is incompatible with the SH ABI@.
23597 @item -matomic-model=@var{model}
23598 @opindex matomic-model=@var{model}
23599 Sets the model of atomic operations and additional parameters as a comma
23600 separated list.  For details on the atomic built-in functions see
23601 @ref{__atomic Builtins}.  The following models and parameters are supported:
23603 @table @samp
23605 @item none
23606 Disable compiler generated atomic sequences and emit library calls for atomic
23607 operations.  This is the default if the target is not @code{sh*-*-linux*}.
23609 @item soft-gusa
23610 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
23611 built-in functions.  The generated atomic sequences require additional support
23612 from the interrupt/exception handling code of the system and are only suitable
23613 for SH3* and SH4* single-core systems.  This option is enabled by default when
23614 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
23615 this option also partially utilizes the hardware atomic instructions
23616 @code{movli.l} and @code{movco.l} to create more efficient code, unless
23617 @samp{strict} is specified.  
23619 @item soft-tcb
23620 Generate software atomic sequences that use a variable in the thread control
23621 block.  This is a variation of the gUSA sequences which can also be used on
23622 SH1* and SH2* targets.  The generated atomic sequences require additional
23623 support from the interrupt/exception handling code of the system and are only
23624 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
23625 parameter has to be specified as well.
23627 @item soft-imask
23628 Generate software atomic sequences that temporarily disable interrupts by
23629 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
23630 in privileged mode and is only suitable for single-core systems.  Additional
23631 support from the interrupt/exception handling code of the system is not
23632 required.  This model is enabled by default when the target is
23633 @code{sh*-*-linux*} and SH1* or SH2*.
23635 @item hard-llcs
23636 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
23637 instructions only.  This is only available on SH4A and is suitable for
23638 multi-core systems.  Since the hardware instructions support only 32 bit atomic
23639 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
23640 Code compiled with this option is also compatible with other software
23641 atomic model interrupt/exception handling systems if executed on an SH4A
23642 system.  Additional support from the interrupt/exception handling code of the
23643 system is not required for this model.
23645 @item gbr-offset=
23646 This parameter specifies the offset in bytes of the variable in the thread
23647 control block structure that should be used by the generated atomic sequences
23648 when the @samp{soft-tcb} model has been selected.  For other models this
23649 parameter is ignored.  The specified value must be an integer multiple of four
23650 and in the range 0-1020.
23652 @item strict
23653 This parameter prevents mixed usage of multiple atomic models, even if they
23654 are compatible, and makes the compiler generate atomic sequences of the
23655 specified model only.
23657 @end table
23659 @item -mtas
23660 @opindex mtas
23661 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
23662 Notice that depending on the particular hardware and software configuration
23663 this can degrade overall performance due to the operand cache line flushes
23664 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
23665 processors the @code{tas.b} instruction must be used with caution since it
23666 can result in data corruption for certain cache configurations.
23668 @item -mprefergot
23669 @opindex mprefergot
23670 When generating position-independent code, emit function calls using
23671 the Global Offset Table instead of the Procedure Linkage Table.
23673 @item -musermode
23674 @itemx -mno-usermode
23675 @opindex musermode
23676 @opindex mno-usermode
23677 Don't allow (allow) the compiler generating privileged mode code.  Specifying
23678 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
23679 inlined code would not work in user mode.  @option{-musermode} is the default
23680 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
23681 @option{-musermode} has no effect, since there is no user mode.
23683 @item -multcost=@var{number}
23684 @opindex multcost=@var{number}
23685 Set the cost to assume for a multiply insn.
23687 @item -mdiv=@var{strategy}
23688 @opindex mdiv=@var{strategy}
23689 Set the division strategy to be used for integer division operations.
23690 @var{strategy} can be one of: 
23692 @table @samp
23694 @item call-div1
23695 Calls a library function that uses the single-step division instruction
23696 @code{div1} to perform the operation.  Division by zero calculates an
23697 unspecified result and does not trap.  This is the default except for SH4,
23698 SH2A and SHcompact.
23700 @item call-fp
23701 Calls a library function that performs the operation in double precision
23702 floating point.  Division by zero causes a floating-point exception.  This is
23703 the default for SHcompact with FPU.  Specifying this for targets that do not
23704 have a double precision FPU defaults to @code{call-div1}.
23706 @item call-table
23707 Calls a library function that uses a lookup table for small divisors and
23708 the @code{div1} instruction with case distinction for larger divisors.  Division
23709 by zero calculates an unspecified result and does not trap.  This is the default
23710 for SH4.  Specifying this for targets that do not have dynamic shift
23711 instructions defaults to @code{call-div1}.
23713 @end table
23715 When a division strategy has not been specified the default strategy is
23716 selected based on the current target.  For SH2A the default strategy is to
23717 use the @code{divs} and @code{divu} instructions instead of library function
23718 calls.
23720 @item -maccumulate-outgoing-args
23721 @opindex maccumulate-outgoing-args
23722 Reserve space once for outgoing arguments in the function prologue rather
23723 than around each call.  Generally beneficial for performance and size.  Also
23724 needed for unwinding to avoid changing the stack frame around conditional code.
23726 @item -mdivsi3_libfunc=@var{name}
23727 @opindex mdivsi3_libfunc=@var{name}
23728 Set the name of the library function used for 32-bit signed division to
23729 @var{name}.
23730 This only affects the name used in the @samp{call} division strategies, and
23731 the compiler still expects the same sets of input/output/clobbered registers as
23732 if this option were not present.
23734 @item -mfixed-range=@var{register-range}
23735 @opindex mfixed-range
23736 Generate code treating the given register range as fixed registers.
23737 A fixed register is one that the register allocator can not use.  This is
23738 useful when compiling kernel code.  A register range is specified as
23739 two registers separated by a dash.  Multiple register ranges can be
23740 specified separated by a comma.
23742 @item -mbranch-cost=@var{num}
23743 @opindex mbranch-cost=@var{num}
23744 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
23745 make the compiler try to generate more branch-free code if possible.  
23746 If not specified the value is selected depending on the processor type that
23747 is being compiled for.
23749 @item -mzdcbranch
23750 @itemx -mno-zdcbranch
23751 @opindex mzdcbranch
23752 @opindex mno-zdcbranch
23753 Assume (do not assume) that zero displacement conditional branch instructions
23754 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
23755 compiler prefers zero displacement branch code sequences.  This is
23756 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
23757 disabled by specifying @option{-mno-zdcbranch}.
23759 @item -mcbranch-force-delay-slot
23760 @opindex mcbranch-force-delay-slot
23761 Force the usage of delay slots for conditional branches, which stuffs the delay
23762 slot with a @code{nop} if a suitable instruction cannot be found.  By default
23763 this option is disabled.  It can be enabled to work around hardware bugs as
23764 found in the original SH7055.
23766 @item -mfused-madd
23767 @itemx -mno-fused-madd
23768 @opindex mfused-madd
23769 @opindex mno-fused-madd
23770 Generate code that uses (does not use) the floating-point multiply and
23771 accumulate instructions.  These instructions are generated by default
23772 if hardware floating point is used.  The machine-dependent
23773 @option{-mfused-madd} option is now mapped to the machine-independent
23774 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
23775 mapped to @option{-ffp-contract=off}.
23777 @item -mfsca
23778 @itemx -mno-fsca
23779 @opindex mfsca
23780 @opindex mno-fsca
23781 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
23782 and cosine approximations.  The option @option{-mfsca} must be used in
23783 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
23784 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
23785 approximations even if @option{-funsafe-math-optimizations} is in effect.
23787 @item -mfsrra
23788 @itemx -mno-fsrra
23789 @opindex mfsrra
23790 @opindex mno-fsrra
23791 Allow or disallow the compiler to emit the @code{fsrra} instruction for
23792 reciprocal square root approximations.  The option @option{-mfsrra} must be used
23793 in combination with @option{-funsafe-math-optimizations} and
23794 @option{-ffinite-math-only}.  It is enabled by default when generating code for
23795 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
23796 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
23797 in effect.
23799 @item -mpretend-cmove
23800 @opindex mpretend-cmove
23801 Prefer zero-displacement conditional branches for conditional move instruction
23802 patterns.  This can result in faster code on the SH4 processor.
23804 @item -mfdpic
23805 @opindex fdpic
23806 Generate code using the FDPIC ABI.
23808 @end table
23810 @node Solaris 2 Options
23811 @subsection Solaris 2 Options
23812 @cindex Solaris 2 options
23814 These @samp{-m} options are supported on Solaris 2:
23816 @table @gcctabopt
23817 @item -mclear-hwcap
23818 @opindex mclear-hwcap
23819 @option{-mclear-hwcap} tells the compiler to remove the hardware
23820 capabilities generated by the Solaris assembler.  This is only necessary
23821 when object files use ISA extensions not supported by the current
23822 machine, but check at runtime whether or not to use them.
23824 @item -mimpure-text
23825 @opindex mimpure-text
23826 @option{-mimpure-text}, used in addition to @option{-shared}, tells
23827 the compiler to not pass @option{-z text} to the linker when linking a
23828 shared object.  Using this option, you can link position-dependent
23829 code into a shared object.
23831 @option{-mimpure-text} suppresses the ``relocations remain against
23832 allocatable but non-writable sections'' linker error message.
23833 However, the necessary relocations trigger copy-on-write, and the
23834 shared object is not actually shared across processes.  Instead of
23835 using @option{-mimpure-text}, you should compile all source code with
23836 @option{-fpic} or @option{-fPIC}.
23838 @end table
23840 These switches are supported in addition to the above on Solaris 2:
23842 @table @gcctabopt
23843 @item -pthreads
23844 @opindex pthreads
23845 This is a synonym for @option{-pthread}.
23846 @end table
23848 @node SPARC Options
23849 @subsection SPARC Options
23850 @cindex SPARC options
23852 These @samp{-m} options are supported on the SPARC:
23854 @table @gcctabopt
23855 @item -mno-app-regs
23856 @itemx -mapp-regs
23857 @opindex mno-app-regs
23858 @opindex mapp-regs
23859 Specify @option{-mapp-regs} to generate output using the global registers
23860 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
23861 global register 1, each global register 2 through 4 is then treated as an
23862 allocable register that is clobbered by function calls.  This is the default.
23864 To be fully SVR4 ABI-compliant at the cost of some performance loss,
23865 specify @option{-mno-app-regs}.  You should compile libraries and system
23866 software with this option.
23868 @item -mflat
23869 @itemx -mno-flat
23870 @opindex mflat
23871 @opindex mno-flat
23872 With @option{-mflat}, the compiler does not generate save/restore instructions
23873 and uses a ``flat'' or single register window model.  This model is compatible
23874 with the regular register window model.  The local registers and the input
23875 registers (0--5) are still treated as ``call-saved'' registers and are
23876 saved on the stack as needed.
23878 With @option{-mno-flat} (the default), the compiler generates save/restore
23879 instructions (except for leaf functions).  This is the normal operating mode.
23881 @item -mfpu
23882 @itemx -mhard-float
23883 @opindex mfpu
23884 @opindex mhard-float
23885 Generate output containing floating-point instructions.  This is the
23886 default.
23888 @item -mno-fpu
23889 @itemx -msoft-float
23890 @opindex mno-fpu
23891 @opindex msoft-float
23892 Generate output containing library calls for floating point.
23893 @strong{Warning:} the requisite libraries are not available for all SPARC
23894 targets.  Normally the facilities of the machine's usual C compiler are
23895 used, but this cannot be done directly in cross-compilation.  You must make
23896 your own arrangements to provide suitable library functions for
23897 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
23898 @samp{sparclite-*-*} do provide software floating-point support.
23900 @option{-msoft-float} changes the calling convention in the output file;
23901 therefore, it is only useful if you compile @emph{all} of a program with
23902 this option.  In particular, you need to compile @file{libgcc.a}, the
23903 library that comes with GCC, with @option{-msoft-float} in order for
23904 this to work.
23906 @item -mhard-quad-float
23907 @opindex mhard-quad-float
23908 Generate output containing quad-word (long double) floating-point
23909 instructions.
23911 @item -msoft-quad-float
23912 @opindex msoft-quad-float
23913 Generate output containing library calls for quad-word (long double)
23914 floating-point instructions.  The functions called are those specified
23915 in the SPARC ABI@.  This is the default.
23917 As of this writing, there are no SPARC implementations that have hardware
23918 support for the quad-word floating-point instructions.  They all invoke
23919 a trap handler for one of these instructions, and then the trap handler
23920 emulates the effect of the instruction.  Because of the trap handler overhead,
23921 this is much slower than calling the ABI library routines.  Thus the
23922 @option{-msoft-quad-float} option is the default.
23924 @item -mno-unaligned-doubles
23925 @itemx -munaligned-doubles
23926 @opindex mno-unaligned-doubles
23927 @opindex munaligned-doubles
23928 Assume that doubles have 8-byte alignment.  This is the default.
23930 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
23931 alignment only if they are contained in another type, or if they have an
23932 absolute address.  Otherwise, it assumes they have 4-byte alignment.
23933 Specifying this option avoids some rare compatibility problems with code
23934 generated by other compilers.  It is not the default because it results
23935 in a performance loss, especially for floating-point code.
23937 @item -muser-mode
23938 @itemx -mno-user-mode
23939 @opindex muser-mode
23940 @opindex mno-user-mode
23941 Do not generate code that can only run in supervisor mode.  This is relevant
23942 only for the @code{casa} instruction emitted for the LEON3 processor.  This
23943 is the default.
23945 @item -mfaster-structs
23946 @itemx -mno-faster-structs
23947 @opindex mfaster-structs
23948 @opindex mno-faster-structs
23949 With @option{-mfaster-structs}, the compiler assumes that structures
23950 should have 8-byte alignment.  This enables the use of pairs of
23951 @code{ldd} and @code{std} instructions for copies in structure
23952 assignment, in place of twice as many @code{ld} and @code{st} pairs.
23953 However, the use of this changed alignment directly violates the SPARC
23954 ABI@.  Thus, it's intended only for use on targets where the developer
23955 acknowledges that their resulting code is not directly in line with
23956 the rules of the ABI@.
23958 @item -mstd-struct-return
23959 @itemx -mno-std-struct-return
23960 @opindex mstd-struct-return
23961 @opindex mno-std-struct-return
23962 With @option{-mstd-struct-return}, the compiler generates checking code
23963 in functions returning structures or unions to detect size mismatches
23964 between the two sides of function calls, as per the 32-bit ABI@.
23966 The default is @option{-mno-std-struct-return}.  This option has no effect
23967 in 64-bit mode.
23969 @item -mlra
23970 @itemx -mno-lra
23971 @opindex mlra
23972 @opindex mno-lra
23973 Enable Local Register Allocation.  This is the default for SPARC since GCC 7
23974 so @option{-mno-lra} needs to be passed to get old Reload.
23976 @item -mcpu=@var{cpu_type}
23977 @opindex mcpu
23978 Set the instruction set, register set, and instruction scheduling parameters
23979 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
23980 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
23981 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
23982 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
23983 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
23984 @samp{niagara3}, @samp{niagara4}, @samp{niagara7} and @samp{m8}.
23986 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
23987 which selects the best architecture option for the host processor.
23988 @option{-mcpu=native} has no effect if GCC does not recognize
23989 the processor.
23991 Default instruction scheduling parameters are used for values that select
23992 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
23993 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
23995 Here is a list of each supported architecture and their supported
23996 implementations.
23998 @table @asis
23999 @item v7
24000 cypress, leon3v7
24002 @item v8
24003 supersparc, hypersparc, leon, leon3
24005 @item sparclite
24006 f930, f934, sparclite86x
24008 @item sparclet
24009 tsc701
24011 @item v9
24012 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
24013 niagara7, m8
24014 @end table
24016 By default (unless configured otherwise), GCC generates code for the V7
24017 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
24018 additionally optimizes it for the Cypress CY7C602 chip, as used in the
24019 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
24020 SPARCStation 1, 2, IPX etc.
24022 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
24023 architecture.  The only difference from V7 code is that the compiler emits
24024 the integer multiply and integer divide instructions which exist in SPARC-V8
24025 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
24026 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
24027 2000 series.
24029 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
24030 the SPARC architecture.  This adds the integer multiply, integer divide step
24031 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
24032 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
24033 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
24034 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
24035 MB86934 chip, which is the more recent SPARClite with FPU@.
24037 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
24038 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
24039 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
24040 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
24041 optimizes it for the TEMIC SPARClet chip.
24043 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
24044 architecture.  This adds 64-bit integer and floating-point move instructions,
24045 3 additional floating-point condition code registers and conditional move
24046 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
24047 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
24048 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
24049 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
24050 @option{-mcpu=niagara}, the compiler additionally optimizes it for
24051 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
24052 additionally optimizes it for Sun UltraSPARC T2 chips. With
24053 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
24054 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
24055 additionally optimizes it for Sun UltraSPARC T4 chips.  With
24056 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
24057 Oracle SPARC M7 chips.  With @option{-mcpu=m8}, the compiler
24058 additionally optimizes it for Oracle M8 chips.
24060 @item -mtune=@var{cpu_type}
24061 @opindex mtune
24062 Set the instruction scheduling parameters for machine type
24063 @var{cpu_type}, but do not set the instruction set or register set that the
24064 option @option{-mcpu=@var{cpu_type}} does.
24066 The same values for @option{-mcpu=@var{cpu_type}} can be used for
24067 @option{-mtune=@var{cpu_type}}, but the only useful values are those
24068 that select a particular CPU implementation.  Those are
24069 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
24070 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
24071 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
24072 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
24073 @samp{niagara4}, @samp{niagara7} and @samp{m8}.  With native Solaris
24074 and GNU/Linux toolchains, @samp{native} can also be used.
24076 @item -mv8plus
24077 @itemx -mno-v8plus
24078 @opindex mv8plus
24079 @opindex mno-v8plus
24080 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
24081 difference from the V8 ABI is that the global and out registers are
24082 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
24083 mode for all SPARC-V9 processors.
24085 @item -mvis
24086 @itemx -mno-vis
24087 @opindex mvis
24088 @opindex mno-vis
24089 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
24090 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
24092 @item -mvis2
24093 @itemx -mno-vis2
24094 @opindex mvis2
24095 @opindex mno-vis2
24096 With @option{-mvis2}, GCC generates code that takes advantage of
24097 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
24098 default is @option{-mvis2} when targeting a cpu that supports such
24099 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
24100 also sets @option{-mvis}.
24102 @item -mvis3
24103 @itemx -mno-vis3
24104 @opindex mvis3
24105 @opindex mno-vis3
24106 With @option{-mvis3}, GCC generates code that takes advantage of
24107 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
24108 default is @option{-mvis3} when targeting a cpu that supports such
24109 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
24110 also sets @option{-mvis2} and @option{-mvis}.
24112 @item -mvis4
24113 @itemx -mno-vis4
24114 @opindex mvis4
24115 @opindex mno-vis4
24116 With @option{-mvis4}, GCC generates code that takes advantage of
24117 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
24118 default is @option{-mvis4} when targeting a cpu that supports such
24119 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
24120 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
24122 @item -mvis4b
24123 @itemx -mno-vis4b
24124 @opindex mvis4b
24125 @opindex mno-vis4b
24126 With @option{-mvis4b}, GCC generates code that takes advantage of
24127 version 4.0 of the UltraSPARC Visual Instruction Set extensions, plus
24128 the additional VIS instructions introduced in the Oracle SPARC
24129 Architecture 2017.  The default is @option{-mvis4b} when targeting a
24130 cpu that supports such instructions, such as m8 and later.  Setting
24131 @option{-mvis4b} also sets @option{-mvis4}, @option{-mvis3},
24132 @option{-mvis2} and @option{-mvis}.
24134 @item -mcbcond
24135 @itemx -mno-cbcond
24136 @opindex mcbcond
24137 @opindex mno-cbcond
24138 With @option{-mcbcond}, GCC generates code that takes advantage of the UltraSPARC
24139 Compare-and-Branch-on-Condition instructions.  The default is @option{-mcbcond}
24140 when targeting a CPU that supports such instructions, such as Niagara-4 and
24141 later.
24143 @item -mfmaf
24144 @itemx -mno-fmaf
24145 @opindex mfmaf
24146 @opindex mno-fmaf
24147 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
24148 Fused Multiply-Add Floating-point instructions.  The default is @option{-mfmaf}
24149 when targeting a CPU that supports such instructions, such as Niagara-3 and
24150 later.
24152 @item -mfsmuld
24153 @itemx -mno-fsmuld
24154 @opindex mfsmuld
24155 @opindex mno-fsmuld
24156 With @option{-mfsmuld}, GCC generates code that takes advantage of the
24157 Floating-point Multiply Single to Double (FsMULd) instruction.  The default is
24158 @option{-mfsmuld} when targeting a CPU supporting the architecture versions V8
24159 or V9 with FPU except @option{-mcpu=leon}.
24161 @item -mpopc
24162 @itemx -mno-popc
24163 @opindex mpopc
24164 @opindex mno-popc
24165 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
24166 Population Count instruction.  The default is @option{-mpopc}
24167 when targeting a CPU that supports such an instruction, such as Niagara-2 and
24168 later.
24170 @item -msubxc
24171 @itemx -mno-subxc
24172 @opindex msubxc
24173 @opindex mno-subxc
24174 With @option{-msubxc}, GCC generates code that takes advantage of the UltraSPARC
24175 Subtract-Extended-with-Carry instruction.  The default is @option{-msubxc}
24176 when targeting a CPU that supports such an instruction, such as Niagara-7 and
24177 later.
24179 @item -mfix-at697f
24180 @opindex mfix-at697f
24181 Enable the documented workaround for the single erratum of the Atmel AT697F
24182 processor (which corresponds to erratum #13 of the AT697E processor).
24184 @item -mfix-ut699
24185 @opindex mfix-ut699
24186 Enable the documented workarounds for the floating-point errata and the data
24187 cache nullify errata of the UT699 processor.
24189 @item -mfix-ut700
24190 @opindex mfix-ut700
24191 Enable the documented workaround for the back-to-back store errata of
24192 the UT699E/UT700 processor.
24194 @item -mfix-gr712rc
24195 @opindex mfix-gr712rc
24196 Enable the documented workaround for the back-to-back store errata of
24197 the GR712RC processor.
24198 @end table
24200 These @samp{-m} options are supported in addition to the above
24201 on SPARC-V9 processors in 64-bit environments:
24203 @table @gcctabopt
24204 @item -m32
24205 @itemx -m64
24206 @opindex m32
24207 @opindex m64
24208 Generate code for a 32-bit or 64-bit environment.
24209 The 32-bit environment sets int, long and pointer to 32 bits.
24210 The 64-bit environment sets int to 32 bits and long and pointer
24211 to 64 bits.
24213 @item -mcmodel=@var{which}
24214 @opindex mcmodel
24215 Set the code model to one of
24217 @table @samp
24218 @item medlow
24219 The Medium/Low code model: 64-bit addresses, programs
24220 must be linked in the low 32 bits of memory.  Programs can be statically
24221 or dynamically linked.
24223 @item medmid
24224 The Medium/Middle code model: 64-bit addresses, programs
24225 must be linked in the low 44 bits of memory, the text and data segments must
24226 be less than 2GB in size and the data segment must be located within 2GB of
24227 the text segment.
24229 @item medany
24230 The Medium/Anywhere code model: 64-bit addresses, programs
24231 may be linked anywhere in memory, the text and data segments must be less
24232 than 2GB in size and the data segment must be located within 2GB of the
24233 text segment.
24235 @item embmedany
24236 The Medium/Anywhere code model for embedded systems:
24237 64-bit addresses, the text and data segments must be less than 2GB in
24238 size, both starting anywhere in memory (determined at link time).  The
24239 global register %g4 points to the base of the data segment.  Programs
24240 are statically linked and PIC is not supported.
24241 @end table
24243 @item -mmemory-model=@var{mem-model}
24244 @opindex mmemory-model
24245 Set the memory model in force on the processor to one of
24247 @table @samp
24248 @item default
24249 The default memory model for the processor and operating system.
24251 @item rmo
24252 Relaxed Memory Order
24254 @item pso
24255 Partial Store Order
24257 @item tso
24258 Total Store Order
24260 @item sc
24261 Sequential Consistency
24262 @end table
24264 These memory models are formally defined in Appendix D of the SPARC-V9
24265 architecture manual, as set in the processor's @code{PSTATE.MM} field.
24267 @item -mstack-bias
24268 @itemx -mno-stack-bias
24269 @opindex mstack-bias
24270 @opindex mno-stack-bias
24271 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
24272 frame pointer if present, are offset by @minus{}2047 which must be added back
24273 when making stack frame references.  This is the default in 64-bit mode.
24274 Otherwise, assume no such offset is present.
24275 @end table
24277 @node SPU Options
24278 @subsection SPU Options
24279 @cindex SPU options
24281 These @samp{-m} options are supported on the SPU:
24283 @table @gcctabopt
24284 @item -mwarn-reloc
24285 @itemx -merror-reloc
24286 @opindex mwarn-reloc
24287 @opindex merror-reloc
24289 The loader for SPU does not handle dynamic relocations.  By default, GCC
24290 gives an error when it generates code that requires a dynamic
24291 relocation.  @option{-mno-error-reloc} disables the error,
24292 @option{-mwarn-reloc} generates a warning instead.
24294 @item -msafe-dma
24295 @itemx -munsafe-dma
24296 @opindex msafe-dma
24297 @opindex munsafe-dma
24299 Instructions that initiate or test completion of DMA must not be
24300 reordered with respect to loads and stores of the memory that is being
24301 accessed.
24302 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
24303 memory accesses, but that can lead to inefficient code in places where the
24304 memory is known to not change.  Rather than mark the memory as volatile,
24305 you can use @option{-msafe-dma} to tell the compiler to treat
24306 the DMA instructions as potentially affecting all memory.  
24308 @item -mbranch-hints
24309 @opindex mbranch-hints
24311 By default, GCC generates a branch hint instruction to avoid
24312 pipeline stalls for always-taken or probably-taken branches.  A hint
24313 is not generated closer than 8 instructions away from its branch.
24314 There is little reason to disable them, except for debugging purposes,
24315 or to make an object a little bit smaller.
24317 @item -msmall-mem
24318 @itemx -mlarge-mem
24319 @opindex msmall-mem
24320 @opindex mlarge-mem
24322 By default, GCC generates code assuming that addresses are never larger
24323 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
24324 a full 32-bit address.
24326 @item -mstdmain
24327 @opindex mstdmain
24329 By default, GCC links against startup code that assumes the SPU-style
24330 main function interface (which has an unconventional parameter list).
24331 With @option{-mstdmain}, GCC links your program against startup
24332 code that assumes a C99-style interface to @code{main}, including a
24333 local copy of @code{argv} strings.
24335 @item -mfixed-range=@var{register-range}
24336 @opindex mfixed-range
24337 Generate code treating the given register range as fixed registers.
24338 A fixed register is one that the register allocator cannot use.  This is
24339 useful when compiling kernel code.  A register range is specified as
24340 two registers separated by a dash.  Multiple register ranges can be
24341 specified separated by a comma.
24343 @item -mea32
24344 @itemx -mea64
24345 @opindex mea32
24346 @opindex mea64
24347 Compile code assuming that pointers to the PPU address space accessed
24348 via the @code{__ea} named address space qualifier are either 32 or 64
24349 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
24350 all object code in an executable must be compiled with the same setting.
24352 @item -maddress-space-conversion
24353 @itemx -mno-address-space-conversion
24354 @opindex maddress-space-conversion
24355 @opindex mno-address-space-conversion
24356 Allow/disallow treating the @code{__ea} address space as superset
24357 of the generic address space.  This enables explicit type casts
24358 between @code{__ea} and generic pointer as well as implicit
24359 conversions of generic pointers to @code{__ea} pointers.  The
24360 default is to allow address space pointer conversions.
24362 @item -mcache-size=@var{cache-size}
24363 @opindex mcache-size
24364 This option controls the version of libgcc that the compiler links to an
24365 executable and selects a software-managed cache for accessing variables
24366 in the @code{__ea} address space with a particular cache size.  Possible
24367 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
24368 and @samp{128}.  The default cache size is 64KB.
24370 @item -matomic-updates
24371 @itemx -mno-atomic-updates
24372 @opindex matomic-updates
24373 @opindex mno-atomic-updates
24374 This option controls the version of libgcc that the compiler links to an
24375 executable and selects whether atomic updates to the software-managed
24376 cache of PPU-side variables are used.  If you use atomic updates, changes
24377 to a PPU variable from SPU code using the @code{__ea} named address space
24378 qualifier do not interfere with changes to other PPU variables residing
24379 in the same cache line from PPU code.  If you do not use atomic updates,
24380 such interference may occur; however, writing back cache lines is
24381 more efficient.  The default behavior is to use atomic updates.
24383 @item -mdual-nops
24384 @itemx -mdual-nops=@var{n}
24385 @opindex mdual-nops
24386 By default, GCC inserts NOPs to increase dual issue when it expects
24387 it to increase performance.  @var{n} can be a value from 0 to 10.  A
24388 smaller @var{n} inserts fewer NOPs.  10 is the default, 0 is the
24389 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
24391 @item -mhint-max-nops=@var{n}
24392 @opindex mhint-max-nops
24393 Maximum number of NOPs to insert for a branch hint.  A branch hint must
24394 be at least 8 instructions away from the branch it is affecting.  GCC
24395 inserts up to @var{n} NOPs to enforce this, otherwise it does not
24396 generate the branch hint.
24398 @item -mhint-max-distance=@var{n}
24399 @opindex mhint-max-distance
24400 The encoding of the branch hint instruction limits the hint to be within
24401 256 instructions of the branch it is affecting.  By default, GCC makes
24402 sure it is within 125.
24404 @item -msafe-hints
24405 @opindex msafe-hints
24406 Work around a hardware bug that causes the SPU to stall indefinitely.
24407 By default, GCC inserts the @code{hbrp} instruction to make sure
24408 this stall won't happen.
24410 @end table
24412 @node System V Options
24413 @subsection Options for System V
24415 These additional options are available on System V Release 4 for
24416 compatibility with other compilers on those systems:
24418 @table @gcctabopt
24419 @item -G
24420 @opindex G
24421 Create a shared object.
24422 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
24424 @item -Qy
24425 @opindex Qy
24426 Identify the versions of each tool used by the compiler, in a
24427 @code{.ident} assembler directive in the output.
24429 @item -Qn
24430 @opindex Qn
24431 Refrain from adding @code{.ident} directives to the output file (this is
24432 the default).
24434 @item -YP,@var{dirs}
24435 @opindex YP
24436 Search the directories @var{dirs}, and no others, for libraries
24437 specified with @option{-l}.
24439 @item -Ym,@var{dir}
24440 @opindex Ym
24441 Look in the directory @var{dir} to find the M4 preprocessor.
24442 The assembler uses this option.
24443 @c This is supposed to go with a -Yd for predefined M4 macro files, but
24444 @c the generic assembler that comes with Solaris takes just -Ym.
24445 @end table
24447 @node TILE-Gx Options
24448 @subsection TILE-Gx Options
24449 @cindex TILE-Gx options
24451 These @samp{-m} options are supported on the TILE-Gx:
24453 @table @gcctabopt
24454 @item -mcmodel=small
24455 @opindex mcmodel=small
24456 Generate code for the small model.  The distance for direct calls is
24457 limited to 500M in either direction.  PC-relative addresses are 32
24458 bits.  Absolute addresses support the full address range.
24460 @item -mcmodel=large
24461 @opindex mcmodel=large
24462 Generate code for the large model.  There is no limitation on call
24463 distance, pc-relative addresses, or absolute addresses.
24465 @item -mcpu=@var{name}
24466 @opindex mcpu
24467 Selects the type of CPU to be targeted.  Currently the only supported
24468 type is @samp{tilegx}.
24470 @item -m32
24471 @itemx -m64
24472 @opindex m32
24473 @opindex m64
24474 Generate code for a 32-bit or 64-bit environment.  The 32-bit
24475 environment sets int, long, and pointer to 32 bits.  The 64-bit
24476 environment sets int to 32 bits and long and pointer to 64 bits.
24478 @item -mbig-endian
24479 @itemx -mlittle-endian
24480 @opindex mbig-endian
24481 @opindex mlittle-endian
24482 Generate code in big/little endian mode, respectively.
24483 @end table
24485 @node TILEPro Options
24486 @subsection TILEPro Options
24487 @cindex TILEPro options
24489 These @samp{-m} options are supported on the TILEPro:
24491 @table @gcctabopt
24492 @item -mcpu=@var{name}
24493 @opindex mcpu
24494 Selects the type of CPU to be targeted.  Currently the only supported
24495 type is @samp{tilepro}.
24497 @item -m32
24498 @opindex m32
24499 Generate code for a 32-bit environment, which sets int, long, and
24500 pointer to 32 bits.  This is the only supported behavior so the flag
24501 is essentially ignored.
24502 @end table
24504 @node V850 Options
24505 @subsection V850 Options
24506 @cindex V850 Options
24508 These @samp{-m} options are defined for V850 implementations:
24510 @table @gcctabopt
24511 @item -mlong-calls
24512 @itemx -mno-long-calls
24513 @opindex mlong-calls
24514 @opindex mno-long-calls
24515 Treat all calls as being far away (near).  If calls are assumed to be
24516 far away, the compiler always loads the function's address into a
24517 register, and calls indirect through the pointer.
24519 @item -mno-ep
24520 @itemx -mep
24521 @opindex mno-ep
24522 @opindex mep
24523 Do not optimize (do optimize) basic blocks that use the same index
24524 pointer 4 or more times to copy pointer into the @code{ep} register, and
24525 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
24526 option is on by default if you optimize.
24528 @item -mno-prolog-function
24529 @itemx -mprolog-function
24530 @opindex mno-prolog-function
24531 @opindex mprolog-function
24532 Do not use (do use) external functions to save and restore registers
24533 at the prologue and epilogue of a function.  The external functions
24534 are slower, but use less code space if more than one function saves
24535 the same number of registers.  The @option{-mprolog-function} option
24536 is on by default if you optimize.
24538 @item -mspace
24539 @opindex mspace
24540 Try to make the code as small as possible.  At present, this just turns
24541 on the @option{-mep} and @option{-mprolog-function} options.
24543 @item -mtda=@var{n}
24544 @opindex mtda
24545 Put static or global variables whose size is @var{n} bytes or less into
24546 the tiny data area that register @code{ep} points to.  The tiny data
24547 area can hold up to 256 bytes in total (128 bytes for byte references).
24549 @item -msda=@var{n}
24550 @opindex msda
24551 Put static or global variables whose size is @var{n} bytes or less into
24552 the small data area that register @code{gp} points to.  The small data
24553 area can hold up to 64 kilobytes.
24555 @item -mzda=@var{n}
24556 @opindex mzda
24557 Put static or global variables whose size is @var{n} bytes or less into
24558 the first 32 kilobytes of memory.
24560 @item -mv850
24561 @opindex mv850
24562 Specify that the target processor is the V850.
24564 @item -mv850e3v5
24565 @opindex mv850e3v5
24566 Specify that the target processor is the V850E3V5.  The preprocessor
24567 constant @code{__v850e3v5__} is defined if this option is used.
24569 @item -mv850e2v4
24570 @opindex mv850e2v4
24571 Specify that the target processor is the V850E3V5.  This is an alias for
24572 the @option{-mv850e3v5} option.
24574 @item -mv850e2v3
24575 @opindex mv850e2v3
24576 Specify that the target processor is the V850E2V3.  The preprocessor
24577 constant @code{__v850e2v3__} is defined if this option is used.
24579 @item -mv850e2
24580 @opindex mv850e2
24581 Specify that the target processor is the V850E2.  The preprocessor
24582 constant @code{__v850e2__} is defined if this option is used.
24584 @item -mv850e1
24585 @opindex mv850e1
24586 Specify that the target processor is the V850E1.  The preprocessor
24587 constants @code{__v850e1__} and @code{__v850e__} are defined if
24588 this option is used.
24590 @item -mv850es
24591 @opindex mv850es
24592 Specify that the target processor is the V850ES.  This is an alias for
24593 the @option{-mv850e1} option.
24595 @item -mv850e
24596 @opindex mv850e
24597 Specify that the target processor is the V850E@.  The preprocessor
24598 constant @code{__v850e__} is defined if this option is used.
24600 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
24601 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
24602 are defined then a default target processor is chosen and the
24603 relevant @samp{__v850*__} preprocessor constant is defined.
24605 The preprocessor constants @code{__v850} and @code{__v851__} are always
24606 defined, regardless of which processor variant is the target.
24608 @item -mdisable-callt
24609 @itemx -mno-disable-callt
24610 @opindex mdisable-callt
24611 @opindex mno-disable-callt
24612 This option suppresses generation of the @code{CALLT} instruction for the
24613 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
24614 architecture.
24616 This option is enabled by default when the RH850 ABI is
24617 in use (see @option{-mrh850-abi}), and disabled by default when the
24618 GCC ABI is in use.  If @code{CALLT} instructions are being generated
24619 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
24621 @item -mrelax
24622 @itemx -mno-relax
24623 @opindex mrelax
24624 @opindex mno-relax
24625 Pass on (or do not pass on) the @option{-mrelax} command-line option
24626 to the assembler.
24628 @item -mlong-jumps
24629 @itemx -mno-long-jumps
24630 @opindex mlong-jumps
24631 @opindex mno-long-jumps
24632 Disable (or re-enable) the generation of PC-relative jump instructions.
24634 @item -msoft-float
24635 @itemx -mhard-float
24636 @opindex msoft-float
24637 @opindex mhard-float
24638 Disable (or re-enable) the generation of hardware floating point
24639 instructions.  This option is only significant when the target
24640 architecture is @samp{V850E2V3} or higher.  If hardware floating point
24641 instructions are being generated then the C preprocessor symbol
24642 @code{__FPU_OK__} is defined, otherwise the symbol
24643 @code{__NO_FPU__} is defined.
24645 @item -mloop
24646 @opindex mloop
24647 Enables the use of the e3v5 LOOP instruction.  The use of this
24648 instruction is not enabled by default when the e3v5 architecture is
24649 selected because its use is still experimental.
24651 @item -mrh850-abi
24652 @itemx -mghs
24653 @opindex mrh850-abi
24654 @opindex mghs
24655 Enables support for the RH850 version of the V850 ABI.  This is the
24656 default.  With this version of the ABI the following rules apply:
24658 @itemize
24659 @item
24660 Integer sized structures and unions are returned via a memory pointer
24661 rather than a register.
24663 @item
24664 Large structures and unions (more than 8 bytes in size) are passed by
24665 value.
24667 @item
24668 Functions are aligned to 16-bit boundaries.
24670 @item
24671 The @option{-m8byte-align} command-line option is supported.
24673 @item
24674 The @option{-mdisable-callt} command-line option is enabled by
24675 default.  The @option{-mno-disable-callt} command-line option is not
24676 supported.
24677 @end itemize
24679 When this version of the ABI is enabled the C preprocessor symbol
24680 @code{__V850_RH850_ABI__} is defined.
24682 @item -mgcc-abi
24683 @opindex mgcc-abi
24684 Enables support for the old GCC version of the V850 ABI.  With this
24685 version of the ABI the following rules apply:
24687 @itemize
24688 @item
24689 Integer sized structures and unions are returned in register @code{r10}.
24691 @item
24692 Large structures and unions (more than 8 bytes in size) are passed by
24693 reference.
24695 @item
24696 Functions are aligned to 32-bit boundaries, unless optimizing for
24697 size.
24699 @item
24700 The @option{-m8byte-align} command-line option is not supported.
24702 @item
24703 The @option{-mdisable-callt} command-line option is supported but not
24704 enabled by default.
24705 @end itemize
24707 When this version of the ABI is enabled the C preprocessor symbol
24708 @code{__V850_GCC_ABI__} is defined.
24710 @item -m8byte-align
24711 @itemx -mno-8byte-align
24712 @opindex m8byte-align
24713 @opindex mno-8byte-align
24714 Enables support for @code{double} and @code{long long} types to be
24715 aligned on 8-byte boundaries.  The default is to restrict the
24716 alignment of all objects to at most 4-bytes.  When
24717 @option{-m8byte-align} is in effect the C preprocessor symbol
24718 @code{__V850_8BYTE_ALIGN__} is defined.
24720 @item -mbig-switch
24721 @opindex mbig-switch
24722 Generate code suitable for big switch tables.  Use this option only if
24723 the assembler/linker complain about out of range branches within a switch
24724 table.
24726 @item -mapp-regs
24727 @opindex mapp-regs
24728 This option causes r2 and r5 to be used in the code generated by
24729 the compiler.  This setting is the default.
24731 @item -mno-app-regs
24732 @opindex mno-app-regs
24733 This option causes r2 and r5 to be treated as fixed registers.
24735 @end table
24737 @node VAX Options
24738 @subsection VAX Options
24739 @cindex VAX options
24741 These @samp{-m} options are defined for the VAX:
24743 @table @gcctabopt
24744 @item -munix
24745 @opindex munix
24746 Do not output certain jump instructions (@code{aobleq} and so on)
24747 that the Unix assembler for the VAX cannot handle across long
24748 ranges.
24750 @item -mgnu
24751 @opindex mgnu
24752 Do output those jump instructions, on the assumption that the
24753 GNU assembler is being used.
24755 @item -mg
24756 @opindex mg
24757 Output code for G-format floating-point numbers instead of D-format.
24758 @end table
24760 @node Visium Options
24761 @subsection Visium Options
24762 @cindex Visium options
24764 @table @gcctabopt
24766 @item -mdebug
24767 @opindex mdebug
24768 A program which performs file I/O and is destined to run on an MCM target
24769 should be linked with this option.  It causes the libraries libc.a and
24770 libdebug.a to be linked.  The program should be run on the target under
24771 the control of the GDB remote debugging stub.
24773 @item -msim
24774 @opindex msim
24775 A program which performs file I/O and is destined to run on the simulator
24776 should be linked with option.  This causes libraries libc.a and libsim.a to
24777 be linked.
24779 @item -mfpu
24780 @itemx -mhard-float
24781 @opindex mfpu
24782 @opindex mhard-float
24783 Generate code containing floating-point instructions.  This is the
24784 default.
24786 @item -mno-fpu
24787 @itemx -msoft-float
24788 @opindex mno-fpu
24789 @opindex msoft-float
24790 Generate code containing library calls for floating-point.
24792 @option{-msoft-float} changes the calling convention in the output file;
24793 therefore, it is only useful if you compile @emph{all} of a program with
24794 this option.  In particular, you need to compile @file{libgcc.a}, the
24795 library that comes with GCC, with @option{-msoft-float} in order for
24796 this to work.
24798 @item -mcpu=@var{cpu_type}
24799 @opindex mcpu
24800 Set the instruction set, register set, and instruction scheduling parameters
24801 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
24802 @samp{mcm}, @samp{gr5} and @samp{gr6}.
24804 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
24806 By default (unless configured otherwise), GCC generates code for the GR5
24807 variant of the Visium architecture.  
24809 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
24810 architecture.  The only difference from GR5 code is that the compiler will
24811 generate block move instructions.
24813 @item -mtune=@var{cpu_type}
24814 @opindex mtune
24815 Set the instruction scheduling parameters for machine type @var{cpu_type},
24816 but do not set the instruction set or register set that the option
24817 @option{-mcpu=@var{cpu_type}} would.
24819 @item -msv-mode
24820 @opindex msv-mode
24821 Generate code for the supervisor mode, where there are no restrictions on
24822 the access to general registers.  This is the default.
24824 @item -muser-mode
24825 @opindex muser-mode
24826 Generate code for the user mode, where the access to some general registers
24827 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
24828 mode; on the GR6, only registers r29 to r31 are affected.
24829 @end table
24831 @node VMS Options
24832 @subsection VMS Options
24834 These @samp{-m} options are defined for the VMS implementations:
24836 @table @gcctabopt
24837 @item -mvms-return-codes
24838 @opindex mvms-return-codes
24839 Return VMS condition codes from @code{main}. The default is to return POSIX-style
24840 condition (e.g.@ error) codes.
24842 @item -mdebug-main=@var{prefix}
24843 @opindex mdebug-main=@var{prefix}
24844 Flag the first routine whose name starts with @var{prefix} as the main
24845 routine for the debugger.
24847 @item -mmalloc64
24848 @opindex mmalloc64
24849 Default to 64-bit memory allocation routines.
24851 @item -mpointer-size=@var{size}
24852 @opindex mpointer-size=@var{size}
24853 Set the default size of pointers. Possible options for @var{size} are
24854 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
24855 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
24856 The later option disables @code{pragma pointer_size}.
24857 @end table
24859 @node VxWorks Options
24860 @subsection VxWorks Options
24861 @cindex VxWorks Options
24863 The options in this section are defined for all VxWorks targets.
24864 Options specific to the target hardware are listed with the other
24865 options for that target.
24867 @table @gcctabopt
24868 @item -mrtp
24869 @opindex mrtp
24870 GCC can generate code for both VxWorks kernels and real time processes
24871 (RTPs).  This option switches from the former to the latter.  It also
24872 defines the preprocessor macro @code{__RTP__}.
24874 @item -non-static
24875 @opindex non-static
24876 Link an RTP executable against shared libraries rather than static
24877 libraries.  The options @option{-static} and @option{-shared} can
24878 also be used for RTPs (@pxref{Link Options}); @option{-static}
24879 is the default.
24881 @item -Bstatic
24882 @itemx -Bdynamic
24883 @opindex Bstatic
24884 @opindex Bdynamic
24885 These options are passed down to the linker.  They are defined for
24886 compatibility with Diab.
24888 @item -Xbind-lazy
24889 @opindex Xbind-lazy
24890 Enable lazy binding of function calls.  This option is equivalent to
24891 @option{-Wl,-z,now} and is defined for compatibility with Diab.
24893 @item -Xbind-now
24894 @opindex Xbind-now
24895 Disable lazy binding of function calls.  This option is the default and
24896 is defined for compatibility with Diab.
24897 @end table
24899 @node x86 Options
24900 @subsection x86 Options
24901 @cindex x86 Options
24903 These @samp{-m} options are defined for the x86 family of computers.
24905 @table @gcctabopt
24907 @item -march=@var{cpu-type}
24908 @opindex march
24909 Generate instructions for the machine type @var{cpu-type}.  In contrast to
24910 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
24911 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
24912 to generate code that may not run at all on processors other than the one
24913 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
24914 @option{-mtune=@var{cpu-type}}.
24916 The choices for @var{cpu-type} are:
24918 @table @samp
24919 @item native
24920 This selects the CPU to generate code for at compilation time by determining
24921 the processor type of the compiling machine.  Using @option{-march=native}
24922 enables all instruction subsets supported by the local machine (hence
24923 the result might not run on different machines).  Using @option{-mtune=native}
24924 produces code optimized for the local machine under the constraints
24925 of the selected instruction set.  
24927 @item i386
24928 Original Intel i386 CPU@.
24930 @item i486
24931 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
24933 @item i586
24934 @itemx pentium
24935 Intel Pentium CPU with no MMX support.
24937 @item lakemont
24938 Intel Lakemont MCU, based on Intel Pentium CPU.
24940 @item pentium-mmx
24941 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
24943 @item pentiumpro
24944 Intel Pentium Pro CPU@.
24946 @item i686
24947 When used with @option{-march}, the Pentium Pro
24948 instruction set is used, so the code runs on all i686 family chips.
24949 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
24951 @item pentium2
24952 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
24953 support.
24955 @item pentium3
24956 @itemx pentium3m
24957 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
24958 set support.
24960 @item pentium-m
24961 Intel Pentium M; low-power version of Intel Pentium III CPU
24962 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
24964 @item pentium4
24965 @itemx pentium4m
24966 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
24968 @item prescott
24969 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
24970 set support.
24972 @item nocona
24973 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
24974 SSE2 and SSE3 instruction set support.
24976 @item core2
24977 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
24978 instruction set support.
24980 @item nehalem
24981 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24982 SSE4.1, SSE4.2 and POPCNT instruction set support.
24984 @item westmere
24985 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24986 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
24988 @item sandybridge
24989 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24990 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
24992 @item ivybridge
24993 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24994 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
24995 instruction set support.
24997 @item haswell
24998 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24999 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
25000 BMI, BMI2 and F16C instruction set support.
25002 @item broadwell
25003 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
25004 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
25005 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
25007 @item skylake
25008 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
25009 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
25010 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
25011 XSAVES instruction set support.
25013 @item bonnell
25014 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
25015 instruction set support.
25017 @item silvermont
25018 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
25019 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
25021 @item knl
25022 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
25023 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
25024 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
25025 AVX512CD instruction set support.
25027 @item skylake-avx512
25028 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
25029 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
25030 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
25031 AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
25033 @item k6
25034 AMD K6 CPU with MMX instruction set support.
25036 @item k6-2
25037 @itemx k6-3
25038 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
25040 @item athlon
25041 @itemx athlon-tbird
25042 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
25043 support.
25045 @item athlon-4
25046 @itemx athlon-xp
25047 @itemx athlon-mp
25048 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
25049 instruction set support.
25051 @item k8
25052 @itemx opteron
25053 @itemx athlon64
25054 @itemx athlon-fx
25055 Processors based on the AMD K8 core with x86-64 instruction set support,
25056 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
25057 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
25058 instruction set extensions.)
25060 @item k8-sse3
25061 @itemx opteron-sse3
25062 @itemx athlon64-sse3
25063 Improved versions of AMD K8 cores with SSE3 instruction set support.
25065 @item amdfam10
25066 @itemx barcelona
25067 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
25068 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
25069 instruction set extensions.)
25071 @item bdver1
25072 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
25073 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
25074 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
25075 @item bdver2
25076 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
25077 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
25078 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
25079 extensions.)
25080 @item bdver3
25081 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
25082 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
25083 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
25084 64-bit instruction set extensions.
25085 @item bdver4
25086 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
25087 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
25088 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
25089 SSE4.2, ABM and 64-bit instruction set extensions.
25091 @item znver1
25092 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
25093 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
25094 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
25095 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
25096 instruction set extensions.
25098 @item btver1
25099 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
25100 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
25101 instruction set extensions.)
25103 @item btver2
25104 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
25105 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
25106 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
25108 @item winchip-c6
25109 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
25110 set support.
25112 @item winchip2
25113 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
25114 instruction set support.
25116 @item c3
25117 VIA C3 CPU with MMX and 3DNow!@: instruction set support.
25118 (No scheduling is implemented for this chip.)
25120 @item c3-2
25121 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
25122 (No scheduling is implemented for this chip.)
25124 @item c7
25125 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
25126 (No scheduling is implemented for this chip.)
25128 @item samuel-2
25129 VIA Eden Samuel 2 CPU with MMX and 3DNow!@: instruction set support.
25130 (No scheduling is implemented for this chip.)
25132 @item nehemiah
25133 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
25134 (No scheduling is implemented for this chip.)
25136 @item esther
25137 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
25138 (No scheduling is implemented for this chip.)
25140 @item eden-x2
25141 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3 instruction set support.
25142 (No scheduling is implemented for this chip.)
25144 @item eden-x4
25145 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
25146 AVX and AVX2 instruction set support.
25147 (No scheduling is implemented for this chip.)
25149 @item nano
25150 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
25151 instruction set support.
25152 (No scheduling is implemented for this chip.)
25154 @item nano-1000
25155 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
25156 instruction set support.
25157 (No scheduling is implemented for this chip.)
25159 @item nano-2000
25160 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
25161 instruction set support.
25162 (No scheduling is implemented for this chip.)
25164 @item nano-3000
25165 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
25166 instruction set support.
25167 (No scheduling is implemented for this chip.)
25169 @item nano-x2
25170 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
25171 instruction set support.
25172 (No scheduling is implemented for this chip.)
25174 @item nano-x4
25175 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
25176 instruction set support.
25177 (No scheduling is implemented for this chip.)
25179 @item geode
25180 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
25181 @end table
25183 @item -mtune=@var{cpu-type}
25184 @opindex mtune
25185 Tune to @var{cpu-type} everything applicable about the generated code, except
25186 for the ABI and the set of available instructions.  
25187 While picking a specific @var{cpu-type} schedules things appropriately
25188 for that particular chip, the compiler does not generate any code that
25189 cannot run on the default machine type unless you use a
25190 @option{-march=@var{cpu-type}} option.
25191 For example, if GCC is configured for i686-pc-linux-gnu
25192 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
25193 but still runs on i686 machines.
25195 The choices for @var{cpu-type} are the same as for @option{-march}.
25196 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
25198 @table @samp
25199 @item generic
25200 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
25201 If you know the CPU on which your code will run, then you should use
25202 the corresponding @option{-mtune} or @option{-march} option instead of
25203 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
25204 of your application will have, then you should use this option.
25206 As new processors are deployed in the marketplace, the behavior of this
25207 option will change.  Therefore, if you upgrade to a newer version of
25208 GCC, code generation controlled by this option will change to reflect
25209 the processors
25210 that are most common at the time that version of GCC is released.
25212 There is no @option{-march=generic} option because @option{-march}
25213 indicates the instruction set the compiler can use, and there is no
25214 generic instruction set applicable to all processors.  In contrast,
25215 @option{-mtune} indicates the processor (or, in this case, collection of
25216 processors) for which the code is optimized.
25218 @item intel
25219 Produce code optimized for the most current Intel processors, which are
25220 Haswell and Silvermont for this version of GCC.  If you know the CPU
25221 on which your code will run, then you should use the corresponding
25222 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
25223 But, if you want your application performs better on both Haswell and
25224 Silvermont, then you should use this option.
25226 As new Intel processors are deployed in the marketplace, the behavior of
25227 this option will change.  Therefore, if you upgrade to a newer version of
25228 GCC, code generation controlled by this option will change to reflect
25229 the most current Intel processors at the time that version of GCC is
25230 released.
25232 There is no @option{-march=intel} option because @option{-march} indicates
25233 the instruction set the compiler can use, and there is no common
25234 instruction set applicable to all processors.  In contrast,
25235 @option{-mtune} indicates the processor (or, in this case, collection of
25236 processors) for which the code is optimized.
25237 @end table
25239 @item -mcpu=@var{cpu-type}
25240 @opindex mcpu
25241 A deprecated synonym for @option{-mtune}.
25243 @item -mfpmath=@var{unit}
25244 @opindex mfpmath
25245 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
25246 for @var{unit} are:
25248 @table @samp
25249 @item 387
25250 Use the standard 387 floating-point coprocessor present on the majority of chips and
25251 emulated otherwise.  Code compiled with this option runs almost everywhere.
25252 The temporary results are computed in 80-bit precision instead of the precision
25253 specified by the type, resulting in slightly different results compared to most
25254 of other chips.  See @option{-ffloat-store} for more detailed description.
25256 This is the default choice for non-Darwin x86-32 targets.
25258 @item sse
25259 Use scalar floating-point instructions present in the SSE instruction set.
25260 This instruction set is supported by Pentium III and newer chips,
25261 and in the AMD line
25262 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
25263 instruction set supports only single-precision arithmetic, thus the double and
25264 extended-precision arithmetic are still done using 387.  A later version, present
25265 only in Pentium 4 and AMD x86-64 chips, supports double-precision
25266 arithmetic too.
25268 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
25269 or @option{-msse2} switches to enable SSE extensions and make this option
25270 effective.  For the x86-64 compiler, these extensions are enabled by default.
25272 The resulting code should be considerably faster in the majority of cases and avoid
25273 the numerical instability problems of 387 code, but may break some existing
25274 code that expects temporaries to be 80 bits.
25276 This is the default choice for the x86-64 compiler, Darwin x86-32 targets,
25277 and the default choice for x86-32 targets with the SSE2 instruction set
25278 when @option{-ffast-math} is enabled.
25280 @item sse,387
25281 @itemx sse+387
25282 @itemx both
25283 Attempt to utilize both instruction sets at once.  This effectively doubles the
25284 amount of available registers, and on chips with separate execution units for
25285 387 and SSE the execution resources too.  Use this option with care, as it is
25286 still experimental, because the GCC register allocator does not model separate
25287 functional units well, resulting in unstable performance.
25288 @end table
25290 @item -masm=@var{dialect}
25291 @opindex masm=@var{dialect}
25292 Output assembly instructions using selected @var{dialect}.  Also affects
25293 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
25294 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
25295 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
25296 not support @samp{intel}.
25298 @item -mieee-fp
25299 @itemx -mno-ieee-fp
25300 @opindex mieee-fp
25301 @opindex mno-ieee-fp
25302 Control whether or not the compiler uses IEEE floating-point
25303 comparisons.  These correctly handle the case where the result of a
25304 comparison is unordered.
25306 @item -m80387
25307 @item -mhard-float
25308 @opindex 80387
25309 @opindex mhard-float
25310 Generate output containing 80387 instructions for floating point.
25312 @item -mno-80387
25313 @item -msoft-float
25314 @opindex no-80387
25315 @opindex msoft-float
25316 Generate output containing library calls for floating point.
25318 @strong{Warning:} the requisite libraries are not part of GCC@.
25319 Normally the facilities of the machine's usual C compiler are used, but
25320 this cannot be done directly in cross-compilation.  You must make your
25321 own arrangements to provide suitable library functions for
25322 cross-compilation.
25324 On machines where a function returns floating-point results in the 80387
25325 register stack, some floating-point opcodes may be emitted even if
25326 @option{-msoft-float} is used.
25328 @item -mno-fp-ret-in-387
25329 @opindex mno-fp-ret-in-387
25330 Do not use the FPU registers for return values of functions.
25332 The usual calling convention has functions return values of types
25333 @code{float} and @code{double} in an FPU register, even if there
25334 is no FPU@.  The idea is that the operating system should emulate
25335 an FPU@.
25337 The option @option{-mno-fp-ret-in-387} causes such values to be returned
25338 in ordinary CPU registers instead.
25340 @item -mno-fancy-math-387
25341 @opindex mno-fancy-math-387
25342 Some 387 emulators do not support the @code{sin}, @code{cos} and
25343 @code{sqrt} instructions for the 387.  Specify this option to avoid
25344 generating those instructions.  This option is the default on
25345 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
25346 indicates that the target CPU always has an FPU and so the
25347 instruction does not need emulation.  These
25348 instructions are not generated unless you also use the
25349 @option{-funsafe-math-optimizations} switch.
25351 @item -malign-double
25352 @itemx -mno-align-double
25353 @opindex malign-double
25354 @opindex mno-align-double
25355 Control whether GCC aligns @code{double}, @code{long double}, and
25356 @code{long long} variables on a two-word boundary or a one-word
25357 boundary.  Aligning @code{double} variables on a two-word boundary
25358 produces code that runs somewhat faster on a Pentium at the
25359 expense of more memory.
25361 On x86-64, @option{-malign-double} is enabled by default.
25363 @strong{Warning:} if you use the @option{-malign-double} switch,
25364 structures containing the above types are aligned differently than
25365 the published application binary interface specifications for the x86-32
25366 and are not binary compatible with structures in code compiled
25367 without that switch.
25369 @item -m96bit-long-double
25370 @itemx -m128bit-long-double
25371 @opindex m96bit-long-double
25372 @opindex m128bit-long-double
25373 These switches control the size of @code{long double} type.  The x86-32
25374 application binary interface specifies the size to be 96 bits,
25375 so @option{-m96bit-long-double} is the default in 32-bit mode.
25377 Modern architectures (Pentium and newer) prefer @code{long double}
25378 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
25379 conforming to the ABI, this is not possible.  So specifying
25380 @option{-m128bit-long-double} aligns @code{long double}
25381 to a 16-byte boundary by padding the @code{long double} with an additional
25382 32-bit zero.
25384 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
25385 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
25387 Notice that neither of these options enable any extra precision over the x87
25388 standard of 80 bits for a @code{long double}.
25390 @strong{Warning:} if you override the default value for your target ABI, this
25391 changes the size of 
25392 structures and arrays containing @code{long double} variables,
25393 as well as modifying the function calling convention for functions taking
25394 @code{long double}.  Hence they are not binary-compatible
25395 with code compiled without that switch.
25397 @item -mlong-double-64
25398 @itemx -mlong-double-80
25399 @itemx -mlong-double-128
25400 @opindex mlong-double-64
25401 @opindex mlong-double-80
25402 @opindex mlong-double-128
25403 These switches control the size of @code{long double} type. A size
25404 of 64 bits makes the @code{long double} type equivalent to the @code{double}
25405 type. This is the default for 32-bit Bionic C library.  A size
25406 of 128 bits makes the @code{long double} type equivalent to the
25407 @code{__float128} type. This is the default for 64-bit Bionic C library.
25409 @strong{Warning:} if you override the default value for your target ABI, this
25410 changes the size of
25411 structures and arrays containing @code{long double} variables,
25412 as well as modifying the function calling convention for functions taking
25413 @code{long double}.  Hence they are not binary-compatible
25414 with code compiled without that switch.
25416 @item -malign-data=@var{type}
25417 @opindex malign-data
25418 Control how GCC aligns variables.  Supported values for @var{type} are
25419 @samp{compat} uses increased alignment value compatible uses GCC 4.8
25420 and earlier, @samp{abi} uses alignment value as specified by the
25421 psABI, and @samp{cacheline} uses increased alignment value to match
25422 the cache line size.  @samp{compat} is the default.
25424 @item -mlarge-data-threshold=@var{threshold}
25425 @opindex mlarge-data-threshold
25426 When @option{-mcmodel=medium} is specified, data objects larger than
25427 @var{threshold} are placed in the large data section.  This value must be the
25428 same across all objects linked into the binary, and defaults to 65535.
25430 @item -mrtd
25431 @opindex mrtd
25432 Use a different function-calling convention, in which functions that
25433 take a fixed number of arguments return with the @code{ret @var{num}}
25434 instruction, which pops their arguments while returning.  This saves one
25435 instruction in the caller since there is no need to pop the arguments
25436 there.
25438 You can specify that an individual function is called with this calling
25439 sequence with the function attribute @code{stdcall}.  You can also
25440 override the @option{-mrtd} option by using the function attribute
25441 @code{cdecl}.  @xref{Function Attributes}.
25443 @strong{Warning:} this calling convention is incompatible with the one
25444 normally used on Unix, so you cannot use it if you need to call
25445 libraries compiled with the Unix compiler.
25447 Also, you must provide function prototypes for all functions that
25448 take variable numbers of arguments (including @code{printf});
25449 otherwise incorrect code is generated for calls to those
25450 functions.
25452 In addition, seriously incorrect code results if you call a
25453 function with too many arguments.  (Normally, extra arguments are
25454 harmlessly ignored.)
25456 @item -mregparm=@var{num}
25457 @opindex mregparm
25458 Control how many registers are used to pass integer arguments.  By
25459 default, no registers are used to pass arguments, and at most 3
25460 registers can be used.  You can control this behavior for a specific
25461 function by using the function attribute @code{regparm}.
25462 @xref{Function Attributes}.
25464 @strong{Warning:} if you use this switch, and
25465 @var{num} is nonzero, then you must build all modules with the same
25466 value, including any libraries.  This includes the system libraries and
25467 startup modules.
25469 @item -msseregparm
25470 @opindex msseregparm
25471 Use SSE register passing conventions for float and double arguments
25472 and return values.  You can control this behavior for a specific
25473 function by using the function attribute @code{sseregparm}.
25474 @xref{Function Attributes}.
25476 @strong{Warning:} if you use this switch then you must build all
25477 modules with the same value, including any libraries.  This includes
25478 the system libraries and startup modules.
25480 @item -mvect8-ret-in-mem
25481 @opindex mvect8-ret-in-mem
25482 Return 8-byte vectors in memory instead of MMX registers.  This is the
25483 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
25484 Studio compilers until version 12.  Later compiler versions (starting
25485 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
25486 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
25487 you need to remain compatible with existing code produced by those
25488 previous compiler versions or older versions of GCC@.
25490 @item -mpc32
25491 @itemx -mpc64
25492 @itemx -mpc80
25493 @opindex mpc32
25494 @opindex mpc64
25495 @opindex mpc80
25497 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
25498 is specified, the significands of results of floating-point operations are
25499 rounded to 24 bits (single precision); @option{-mpc64} rounds the
25500 significands of results of floating-point operations to 53 bits (double
25501 precision) and @option{-mpc80} rounds the significands of results of
25502 floating-point operations to 64 bits (extended double precision), which is
25503 the default.  When this option is used, floating-point operations in higher
25504 precisions are not available to the programmer without setting the FPU
25505 control word explicitly.
25507 Setting the rounding of floating-point operations to less than the default
25508 80 bits can speed some programs by 2% or more.  Note that some mathematical
25509 libraries assume that extended-precision (80-bit) floating-point operations
25510 are enabled by default; routines in such libraries could suffer significant
25511 loss of accuracy, typically through so-called ``catastrophic cancellation'',
25512 when this option is used to set the precision to less than extended precision.
25514 @item -mstackrealign
25515 @opindex mstackrealign
25516 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
25517 option generates an alternate prologue and epilogue that realigns the
25518 run-time stack if necessary.  This supports mixing legacy codes that keep
25519 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
25520 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
25521 applicable to individual functions.
25523 @item -mpreferred-stack-boundary=@var{num}
25524 @opindex mpreferred-stack-boundary
25525 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
25526 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
25527 the default is 4 (16 bytes or 128 bits).
25529 @strong{Warning:} When generating code for the x86-64 architecture with
25530 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
25531 used to keep the stack boundary aligned to 8 byte boundary.  Since
25532 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
25533 intended to be used in controlled environment where stack space is
25534 important limitation.  This option leads to wrong code when functions
25535 compiled with 16 byte stack alignment (such as functions from a standard
25536 library) are called with misaligned stack.  In this case, SSE
25537 instructions may lead to misaligned memory access traps.  In addition,
25538 variable arguments are handled incorrectly for 16 byte aligned
25539 objects (including x87 long double and __int128), leading to wrong
25540 results.  You must build all modules with
25541 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
25542 includes the system libraries and startup modules.
25544 @item -mincoming-stack-boundary=@var{num}
25545 @opindex mincoming-stack-boundary
25546 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
25547 boundary.  If @option{-mincoming-stack-boundary} is not specified,
25548 the one specified by @option{-mpreferred-stack-boundary} is used.
25550 On Pentium and Pentium Pro, @code{double} and @code{long double} values
25551 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
25552 suffer significant run time performance penalties.  On Pentium III, the
25553 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
25554 properly if it is not 16-byte aligned.
25556 To ensure proper alignment of this values on the stack, the stack boundary
25557 must be as aligned as that required by any value stored on the stack.
25558 Further, every function must be generated such that it keeps the stack
25559 aligned.  Thus calling a function compiled with a higher preferred
25560 stack boundary from a function compiled with a lower preferred stack
25561 boundary most likely misaligns the stack.  It is recommended that
25562 libraries that use callbacks always use the default setting.
25564 This extra alignment does consume extra stack space, and generally
25565 increases code size.  Code that is sensitive to stack space usage, such
25566 as embedded systems and operating system kernels, may want to reduce the
25567 preferred alignment to @option{-mpreferred-stack-boundary=2}.
25569 @need 200
25570 @item -mmmx
25571 @opindex mmmx
25572 @need 200
25573 @itemx -msse
25574 @opindex msse
25575 @need 200
25576 @itemx -msse2
25577 @opindex msse2
25578 @need 200
25579 @itemx -msse3
25580 @opindex msse3
25581 @need 200
25582 @itemx -mssse3
25583 @opindex mssse3
25584 @need 200
25585 @itemx -msse4
25586 @opindex msse4
25587 @need 200
25588 @itemx -msse4a
25589 @opindex msse4a
25590 @need 200
25591 @itemx -msse4.1
25592 @opindex msse4.1
25593 @need 200
25594 @itemx -msse4.2
25595 @opindex msse4.2
25596 @need 200
25597 @itemx -mavx
25598 @opindex mavx
25599 @need 200
25600 @itemx -mavx2
25601 @opindex mavx2
25602 @need 200
25603 @itemx -mavx512f
25604 @opindex mavx512f
25605 @need 200
25606 @itemx -mavx512pf
25607 @opindex mavx512pf
25608 @need 200
25609 @itemx -mavx512er
25610 @opindex mavx512er
25611 @need 200
25612 @itemx -mavx512cd
25613 @opindex mavx512cd
25614 @need 200
25615 @itemx -mavx512vl
25616 @opindex mavx512vl
25617 @need 200
25618 @itemx -mavx512bw
25619 @opindex mavx512bw
25620 @need 200
25621 @itemx -mavx512dq
25622 @opindex mavx512dq
25623 @need 200
25624 @itemx -mavx512ifma
25625 @opindex mavx512ifma
25626 @need 200
25627 @itemx -mavx512vbmi
25628 @opindex mavx512vbmi
25629 @need 200
25630 @itemx -msha
25631 @opindex msha
25632 @need 200
25633 @itemx -maes
25634 @opindex maes
25635 @need 200
25636 @itemx -mpclmul
25637 @opindex mpclmul
25638 @need 200
25639 @itemx -mclfushopt
25640 @opindex mclfushopt
25641 @need 200
25642 @itemx -mfsgsbase
25643 @opindex mfsgsbase
25644 @need 200
25645 @itemx -mrdrnd
25646 @opindex mrdrnd
25647 @need 200
25648 @itemx -mf16c
25649 @opindex mf16c
25650 @need 200
25651 @itemx -mfma
25652 @opindex mfma
25653 @need 200
25654 @itemx -mfma4
25655 @opindex mfma4
25656 @need 200
25657 @itemx -mprefetchwt1
25658 @opindex mprefetchwt1
25659 @need 200
25660 @itemx -mxop
25661 @opindex mxop
25662 @need 200
25663 @itemx -mlwp
25664 @opindex mlwp
25665 @need 200
25666 @itemx -m3dnow
25667 @opindex m3dnow
25668 @need 200
25669 @itemx -m3dnowa
25670 @opindex m3dnowa
25671 @need 200
25672 @itemx -mpopcnt
25673 @opindex mpopcnt
25674 @need 200
25675 @itemx -mabm
25676 @opindex mabm
25677 @need 200
25678 @itemx -mbmi
25679 @opindex mbmi
25680 @need 200
25681 @itemx -mbmi2
25682 @need 200
25683 @itemx -mlzcnt
25684 @opindex mlzcnt
25685 @need 200
25686 @itemx -mfxsr
25687 @opindex mfxsr
25688 @need 200
25689 @itemx -mxsave
25690 @opindex mxsave
25691 @need 200
25692 @itemx -mxsaveopt
25693 @opindex mxsaveopt
25694 @need 200
25695 @itemx -mxsavec
25696 @opindex mxsavec
25697 @need 200
25698 @itemx -mxsaves
25699 @opindex mxsaves
25700 @need 200
25701 @itemx -mrtm
25702 @opindex mrtm
25703 @need 200
25704 @itemx -mtbm
25705 @opindex mtbm
25706 @need 200
25707 @itemx -mmpx
25708 @opindex mmpx
25709 @need 200
25710 @itemx -mmwaitx
25711 @opindex mmwaitx
25712 @need 200
25713 @itemx -mclzero
25714 @opindex mclzero
25715 @itemx -mpku
25716 @opindex mpku
25717 These switches enable the use of instructions in the MMX, SSE,
25718 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
25719 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
25720 AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA AVX512VBMI, BMI, BMI2, FXSR,
25721 XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX, PKU, 3DNow!@: or enhanced 3DNow!@:
25722 extended instruction sets.  Each has a corresponding @option{-mno-} option
25723 to disable use of these instructions.
25725 These extensions are also available as built-in functions: see
25726 @ref{x86 Built-in Functions}, for details of the functions enabled and
25727 disabled by these switches.
25729 To generate SSE/SSE2 instructions automatically from floating-point
25730 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
25732 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
25733 generates new AVX instructions or AVX equivalence for all SSEx instructions
25734 when needed.
25736 These options enable GCC to use these extended instructions in
25737 generated code, even without @option{-mfpmath=sse}.  Applications that
25738 perform run-time CPU detection must compile separate files for each
25739 supported architecture, using the appropriate flags.  In particular,
25740 the file containing the CPU detection code should be compiled without
25741 these options.
25743 @item -mdump-tune-features
25744 @opindex mdump-tune-features
25745 This option instructs GCC to dump the names of the x86 performance 
25746 tuning features and default settings. The names can be used in 
25747 @option{-mtune-ctrl=@var{feature-list}}.
25749 @item -mtune-ctrl=@var{feature-list}
25750 @opindex mtune-ctrl=@var{feature-list}
25751 This option is used to do fine grain control of x86 code generation features.
25752 @var{feature-list} is a comma separated list of @var{feature} names. See also
25753 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
25754 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
25755 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
25756 developers. Using it may lead to code paths not covered by testing and can
25757 potentially result in compiler ICEs or runtime errors.
25759 @item -mno-default
25760 @opindex mno-default
25761 This option instructs GCC to turn off all tunable features. See also 
25762 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
25764 @item -mcld
25765 @opindex mcld
25766 This option instructs GCC to emit a @code{cld} instruction in the prologue
25767 of functions that use string instructions.  String instructions depend on
25768 the DF flag to select between autoincrement or autodecrement mode.  While the
25769 ABI specifies the DF flag to be cleared on function entry, some operating
25770 systems violate this specification by not clearing the DF flag in their
25771 exception dispatchers.  The exception handler can be invoked with the DF flag
25772 set, which leads to wrong direction mode when string instructions are used.
25773 This option can be enabled by default on 32-bit x86 targets by configuring
25774 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
25775 instructions can be suppressed with the @option{-mno-cld} compiler option
25776 in this case.
25778 @item -mvzeroupper
25779 @opindex mvzeroupper
25780 This option instructs GCC to emit a @code{vzeroupper} instruction
25781 before a transfer of control flow out of the function to minimize
25782 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
25783 intrinsics.
25785 @item -mprefer-avx128
25786 @opindex mprefer-avx128
25787 This option instructs GCC to use 128-bit AVX instructions instead of
25788 256-bit AVX instructions in the auto-vectorizer.
25790 @item -mcx16
25791 @opindex mcx16
25792 This option enables GCC to generate @code{CMPXCHG16B} instructions in 64-bit
25793 code to implement compare-and-exchange operations on 16-byte aligned 128-bit
25794 objects.  This is useful for atomic updates of data structures exceeding one
25795 machine word in size.  The compiler uses this instruction to implement
25796 @ref{__sync Builtins}.  However, for @ref{__atomic Builtins} operating on
25797 128-bit integers, a library call is always used.
25799 @item -msahf
25800 @opindex msahf
25801 This option enables generation of @code{SAHF} instructions in 64-bit code.
25802 Early Intel Pentium 4 CPUs with Intel 64 support,
25803 prior to the introduction of Pentium 4 G1 step in December 2005,
25804 lacked the @code{LAHF} and @code{SAHF} instructions
25805 which are supported by AMD64.
25806 These are load and store instructions, respectively, for certain status flags.
25807 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
25808 @code{drem}, and @code{remainder} built-in functions;
25809 see @ref{Other Builtins} for details.
25811 @item -mmovbe
25812 @opindex mmovbe
25813 This option enables use of the @code{movbe} instruction to implement
25814 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
25816 @item -mcrc32
25817 @opindex mcrc32
25818 This option enables built-in functions @code{__builtin_ia32_crc32qi},
25819 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
25820 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
25822 @item -mrecip
25823 @opindex mrecip
25824 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
25825 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
25826 with an additional Newton-Raphson step
25827 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
25828 (and their vectorized
25829 variants) for single-precision floating-point arguments.  These instructions
25830 are generated only when @option{-funsafe-math-optimizations} is enabled
25831 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
25832 Note that while the throughput of the sequence is higher than the throughput
25833 of the non-reciprocal instruction, the precision of the sequence can be
25834 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
25836 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
25837 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
25838 combination), and doesn't need @option{-mrecip}.
25840 Also note that GCC emits the above sequence with additional Newton-Raphson step
25841 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
25842 already with @option{-ffast-math} (or the above option combination), and
25843 doesn't need @option{-mrecip}.
25845 @item -mrecip=@var{opt}
25846 @opindex mrecip=opt
25847 This option controls which reciprocal estimate instructions
25848 may be used.  @var{opt} is a comma-separated list of options, which may
25849 be preceded by a @samp{!} to invert the option:
25851 @table @samp
25852 @item all
25853 Enable all estimate instructions.
25855 @item default
25856 Enable the default instructions, equivalent to @option{-mrecip}.
25858 @item none
25859 Disable all estimate instructions, equivalent to @option{-mno-recip}.
25861 @item div
25862 Enable the approximation for scalar division.
25864 @item vec-div
25865 Enable the approximation for vectorized division.
25867 @item sqrt
25868 Enable the approximation for scalar square root.
25870 @item vec-sqrt
25871 Enable the approximation for vectorized square root.
25872 @end table
25874 So, for example, @option{-mrecip=all,!sqrt} enables
25875 all of the reciprocal approximations, except for square root.
25877 @item -mveclibabi=@var{type}
25878 @opindex mveclibabi
25879 Specifies the ABI type to use for vectorizing intrinsics using an
25880 external library.  Supported values for @var{type} are @samp{svml} 
25881 for the Intel short
25882 vector math library and @samp{acml} for the AMD math core library.
25883 To use this option, both @option{-ftree-vectorize} and
25884 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
25885 ABI-compatible library must be specified at link time.
25887 GCC currently emits calls to @code{vmldExp2},
25888 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
25889 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
25890 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
25891 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
25892 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
25893 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
25894 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
25895 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
25896 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
25897 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
25898 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
25899 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
25900 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
25901 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
25902 when @option{-mveclibabi=acml} is used.  
25904 @item -mabi=@var{name}
25905 @opindex mabi
25906 Generate code for the specified calling convention.  Permissible values
25907 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
25908 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
25909 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
25910 You can control this behavior for specific functions by
25911 using the function attributes @code{ms_abi} and @code{sysv_abi}.
25912 @xref{Function Attributes}.
25914 @item -mcall-ms2sysv-xlogues
25915 @opindex mcall-ms2sysv-xlogues
25916 @opindex mno-call-ms2sysv-xlogues
25917 Due to differences in 64-bit ABIs, any Microsoft ABI function that calls a
25918 System V ABI function must consider RSI, RDI and XMM6-15 as clobbered.  By
25919 default, the code for saving and restoring these registers is emitted inline,
25920 resulting in fairly lengthy prologues and epilogues.  Using
25921 @option{-mcall-ms2sysv-xlogues} emits prologues and epilogues that
25922 use stubs in the static portion of libgcc to perform these saves and restores,
25923 thus reducing function size at the cost of a few extra instructions.
25925 @item -mtls-dialect=@var{type}
25926 @opindex mtls-dialect
25927 Generate code to access thread-local storage using the @samp{gnu} or
25928 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
25929 @samp{gnu2} is more efficient, but it may add compile- and run-time
25930 requirements that cannot be satisfied on all systems.
25932 @item -mpush-args
25933 @itemx -mno-push-args
25934 @opindex mpush-args
25935 @opindex mno-push-args
25936 Use PUSH operations to store outgoing parameters.  This method is shorter
25937 and usually equally fast as method using SUB/MOV operations and is enabled
25938 by default.  In some cases disabling it may improve performance because of
25939 improved scheduling and reduced dependencies.
25941 @item -maccumulate-outgoing-args
25942 @opindex maccumulate-outgoing-args
25943 If enabled, the maximum amount of space required for outgoing arguments is
25944 computed in the function prologue.  This is faster on most modern CPUs
25945 because of reduced dependencies, improved scheduling and reduced stack usage
25946 when the preferred stack boundary is not equal to 2.  The drawback is a notable
25947 increase in code size.  This switch implies @option{-mno-push-args}.
25949 @item -mthreads
25950 @opindex mthreads
25951 Support thread-safe exception handling on MinGW.  Programs that rely
25952 on thread-safe exception handling must compile and link all code with the
25953 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
25954 @option{-D_MT}; when linking, it links in a special thread helper library
25955 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
25957 @item -mms-bitfields
25958 @itemx -mno-ms-bitfields
25959 @opindex mms-bitfields
25960 @opindex mno-ms-bitfields
25962 Enable/disable bit-field layout compatible with the native Microsoft
25963 Windows compiler.  
25965 If @code{packed} is used on a structure, or if bit-fields are used,
25966 it may be that the Microsoft ABI lays out the structure differently
25967 than the way GCC normally does.  Particularly when moving packed
25968 data between functions compiled with GCC and the native Microsoft compiler
25969 (either via function call or as data in a file), it may be necessary to access
25970 either format.
25972 This option is enabled by default for Microsoft Windows
25973 targets.  This behavior can also be controlled locally by use of variable
25974 or type attributes.  For more information, see @ref{x86 Variable Attributes}
25975 and @ref{x86 Type Attributes}.
25977 The Microsoft structure layout algorithm is fairly simple with the exception
25978 of the bit-field packing.  
25979 The padding and alignment of members of structures and whether a bit-field 
25980 can straddle a storage-unit boundary are determine by these rules:
25982 @enumerate
25983 @item Structure members are stored sequentially in the order in which they are
25984 declared: the first member has the lowest memory address and the last member
25985 the highest.
25987 @item Every data object has an alignment requirement.  The alignment requirement
25988 for all data except structures, unions, and arrays is either the size of the
25989 object or the current packing size (specified with either the
25990 @code{aligned} attribute or the @code{pack} pragma),
25991 whichever is less.  For structures, unions, and arrays,
25992 the alignment requirement is the largest alignment requirement of its members.
25993 Every object is allocated an offset so that:
25995 @smallexample
25996 offset % alignment_requirement == 0
25997 @end smallexample
25999 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
26000 unit if the integral types are the same size and if the next bit-field fits
26001 into the current allocation unit without crossing the boundary imposed by the
26002 common alignment requirements of the bit-fields.
26003 @end enumerate
26005 MSVC interprets zero-length bit-fields in the following ways:
26007 @enumerate
26008 @item If a zero-length bit-field is inserted between two bit-fields that
26009 are normally coalesced, the bit-fields are not coalesced.
26011 For example:
26013 @smallexample
26014 struct
26015  @{
26016    unsigned long bf_1 : 12;
26017    unsigned long : 0;
26018    unsigned long bf_2 : 12;
26019  @} t1;
26020 @end smallexample
26022 @noindent
26023 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
26024 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
26026 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
26027 alignment of the zero-length bit-field is greater than the member that follows it,
26028 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
26030 For example:
26032 @smallexample
26033 struct
26034  @{
26035    char foo : 4;
26036    short : 0;
26037    char bar;
26038  @} t2;
26040 struct
26041  @{
26042    char foo : 4;
26043    short : 0;
26044    double bar;
26045  @} t3;
26046 @end smallexample
26048 @noindent
26049 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
26050 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
26051 bit-field does not affect the alignment of @code{bar} or, as a result, the size
26052 of the structure.
26054 Taking this into account, it is important to note the following:
26056 @enumerate
26057 @item If a zero-length bit-field follows a normal bit-field, the type of the
26058 zero-length bit-field may affect the alignment of the structure as whole. For
26059 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
26060 normal bit-field, and is of type short.
26062 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
26063 still affect the alignment of the structure:
26065 @smallexample
26066 struct
26067  @{
26068    char foo : 6;
26069    long : 0;
26070  @} t4;
26071 @end smallexample
26073 @noindent
26074 Here, @code{t4} takes up 4 bytes.
26075 @end enumerate
26077 @item Zero-length bit-fields following non-bit-field members are ignored:
26079 @smallexample
26080 struct
26081  @{
26082    char foo;
26083    long : 0;
26084    char bar;
26085  @} t5;
26086 @end smallexample
26088 @noindent
26089 Here, @code{t5} takes up 2 bytes.
26090 @end enumerate
26093 @item -mno-align-stringops
26094 @opindex mno-align-stringops
26095 Do not align the destination of inlined string operations.  This switch reduces
26096 code size and improves performance in case the destination is already aligned,
26097 but GCC doesn't know about it.
26099 @item -minline-all-stringops
26100 @opindex minline-all-stringops
26101 By default GCC inlines string operations only when the destination is 
26102 known to be aligned to least a 4-byte boundary.  
26103 This enables more inlining and increases code
26104 size, but may improve performance of code that depends on fast
26105 @code{memcpy}, @code{strlen},
26106 and @code{memset} for short lengths.
26108 @item -minline-stringops-dynamically
26109 @opindex minline-stringops-dynamically
26110 For string operations of unknown size, use run-time checks with
26111 inline code for small blocks and a library call for large blocks.
26113 @item -mstringop-strategy=@var{alg}
26114 @opindex mstringop-strategy=@var{alg}
26115 Override the internal decision heuristic for the particular algorithm to use
26116 for inlining string operations.  The allowed values for @var{alg} are:
26118 @table @samp
26119 @item rep_byte
26120 @itemx rep_4byte
26121 @itemx rep_8byte
26122 Expand using i386 @code{rep} prefix of the specified size.
26124 @item byte_loop
26125 @itemx loop
26126 @itemx unrolled_loop
26127 Expand into an inline loop.
26129 @item libcall
26130 Always use a library call.
26131 @end table
26133 @item -mmemcpy-strategy=@var{strategy}
26134 @opindex mmemcpy-strategy=@var{strategy}
26135 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
26136 should be inlined and what inline algorithm to use when the expected size
26137 of the copy operation is known. @var{strategy} 
26138 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
26139 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
26140 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
26141 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
26142 in the list must be specified in increasing order.  The minimal byte size for 
26143 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
26144 preceding range.
26146 @item -mmemset-strategy=@var{strategy}
26147 @opindex mmemset-strategy=@var{strategy}
26148 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
26149 @code{__builtin_memset} expansion.
26151 @item -momit-leaf-frame-pointer
26152 @opindex momit-leaf-frame-pointer
26153 Don't keep the frame pointer in a register for leaf functions.  This
26154 avoids the instructions to save, set up, and restore frame pointers and
26155 makes an extra register available in leaf functions.  The option
26156 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
26157 which might make debugging harder.
26159 @item -mtls-direct-seg-refs
26160 @itemx -mno-tls-direct-seg-refs
26161 @opindex mtls-direct-seg-refs
26162 Controls whether TLS variables may be accessed with offsets from the
26163 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
26164 or whether the thread base pointer must be added.  Whether or not this
26165 is valid depends on the operating system, and whether it maps the
26166 segment to cover the entire TLS area.
26168 For systems that use the GNU C Library, the default is on.
26170 @item -msse2avx
26171 @itemx -mno-sse2avx
26172 @opindex msse2avx
26173 Specify that the assembler should encode SSE instructions with VEX
26174 prefix.  The option @option{-mavx} turns this on by default.
26176 @item -mfentry
26177 @itemx -mno-fentry
26178 @opindex mfentry
26179 If profiling is active (@option{-pg}), put the profiling
26180 counter call before the prologue.
26181 Note: On x86 architectures the attribute @code{ms_hook_prologue}
26182 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
26184 @item -mrecord-mcount
26185 @itemx -mno-record-mcount
26186 @opindex mrecord-mcount
26187 If profiling is active (@option{-pg}), generate a __mcount_loc section
26188 that contains pointers to each profiling call. This is useful for
26189 automatically patching and out calls.
26191 @item -mnop-mcount
26192 @itemx -mno-nop-mcount
26193 @opindex mnop-mcount
26194 If profiling is active (@option{-pg}), generate the calls to
26195 the profiling functions as NOPs. This is useful when they
26196 should be patched in later dynamically. This is likely only
26197 useful together with @option{-mrecord-mcount}.
26199 @item -mskip-rax-setup
26200 @itemx -mno-skip-rax-setup
26201 @opindex mskip-rax-setup
26202 When generating code for the x86-64 architecture with SSE extensions
26203 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
26204 register when there are no variable arguments passed in vector registers.
26206 @strong{Warning:} Since RAX register is used to avoid unnecessarily
26207 saving vector registers on stack when passing variable arguments, the
26208 impacts of this option are callees may waste some stack space,
26209 misbehave or jump to a random location.  GCC 4.4 or newer don't have
26210 those issues, regardless the RAX register value.
26212 @item -m8bit-idiv
26213 @itemx -mno-8bit-idiv
26214 @opindex m8bit-idiv
26215 On some processors, like Intel Atom, 8-bit unsigned integer divide is
26216 much faster than 32-bit/64-bit integer divide.  This option generates a
26217 run-time check.  If both dividend and divisor are within range of 0
26218 to 255, 8-bit unsigned integer divide is used instead of
26219 32-bit/64-bit integer divide.
26221 @item -mavx256-split-unaligned-load
26222 @itemx -mavx256-split-unaligned-store
26223 @opindex mavx256-split-unaligned-load
26224 @opindex mavx256-split-unaligned-store
26225 Split 32-byte AVX unaligned load and store.
26227 @item -mstack-protector-guard=@var{guard}
26228 @itemx -mstack-protector-guard-reg=@var{reg}
26229 @itemx -mstack-protector-guard-offset=@var{offset}
26230 @opindex mstack-protector-guard
26231 @opindex mstack-protector-guard-reg
26232 @opindex mstack-protector-guard-offset
26233 Generate stack protection code using canary at @var{guard}.  Supported
26234 locations are @samp{global} for global canary or @samp{tls} for per-thread
26235 canary in the TLS block (the default).  This option has effect only when
26236 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
26238 With the latter choice the options
26239 @option{-mstack-protector-guard-reg=@var{reg}} and
26240 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
26241 which segment register (@code{%fs} or @code{%gs}) to use as base register
26242 for reading the canary, and from what offset from that base register.
26243 The default for those is as specified in the relevant ABI.
26245 @item -mmitigate-rop
26246 @opindex mmitigate-rop
26247 Try to avoid generating code sequences that contain unintended return
26248 opcodes, to mitigate against certain forms of attack. At the moment,
26249 this option is limited in what it can do and should not be relied
26250 on to provide serious protection.
26252 @item -mgeneral-regs-only
26253 @opindex mgeneral-regs-only
26254 Generate code that uses only the general-purpose registers.  This
26255 prevents the compiler from using floating-point, vector, mask and bound
26256 registers.
26258 @end table
26260 These @samp{-m} switches are supported in addition to the above
26261 on x86-64 processors in 64-bit environments.
26263 @table @gcctabopt
26264 @item -m32
26265 @itemx -m64
26266 @itemx -mx32
26267 @itemx -m16
26268 @itemx -miamcu
26269 @opindex m32
26270 @opindex m64
26271 @opindex mx32
26272 @opindex m16
26273 @opindex miamcu
26274 Generate code for a 16-bit, 32-bit or 64-bit environment.
26275 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
26276 to 32 bits, and
26277 generates code that runs on any i386 system.
26279 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
26280 types to 64 bits, and generates code for the x86-64 architecture.
26281 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
26282 and @option{-mdynamic-no-pic} options.
26284 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
26285 to 32 bits, and
26286 generates code for the x86-64 architecture.
26288 The @option{-m16} option is the same as @option{-m32}, except for that
26289 it outputs the @code{.code16gcc} assembly directive at the beginning of
26290 the assembly output so that the binary can run in 16-bit mode.
26292 The @option{-miamcu} option generates code which conforms to Intel MCU
26293 psABI.  It requires the @option{-m32} option to be turned on.
26295 @item -mno-red-zone
26296 @opindex mno-red-zone
26297 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
26298 by the x86-64 ABI; it is a 128-byte area beyond the location of the
26299 stack pointer that is not modified by signal or interrupt handlers
26300 and therefore can be used for temporary data without adjusting the stack
26301 pointer.  The flag @option{-mno-red-zone} disables this red zone.
26303 @item -mcmodel=small
26304 @opindex mcmodel=small
26305 Generate code for the small code model: the program and its symbols must
26306 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
26307 Programs can be statically or dynamically linked.  This is the default
26308 code model.
26310 @item -mcmodel=kernel
26311 @opindex mcmodel=kernel
26312 Generate code for the kernel code model.  The kernel runs in the
26313 negative 2 GB of the address space.
26314 This model has to be used for Linux kernel code.
26316 @item -mcmodel=medium
26317 @opindex mcmodel=medium
26318 Generate code for the medium model: the program is linked in the lower 2
26319 GB of the address space.  Small symbols are also placed there.  Symbols
26320 with sizes larger than @option{-mlarge-data-threshold} are put into
26321 large data or BSS sections and can be located above 2GB.  Programs can
26322 be statically or dynamically linked.
26324 @item -mcmodel=large
26325 @opindex mcmodel=large
26326 Generate code for the large model.  This model makes no assumptions
26327 about addresses and sizes of sections.
26329 @item -maddress-mode=long
26330 @opindex maddress-mode=long
26331 Generate code for long address mode.  This is only supported for 64-bit
26332 and x32 environments.  It is the default address mode for 64-bit
26333 environments.
26335 @item -maddress-mode=short
26336 @opindex maddress-mode=short
26337 Generate code for short address mode.  This is only supported for 32-bit
26338 and x32 environments.  It is the default address mode for 32-bit and
26339 x32 environments.
26340 @end table
26342 @node x86 Windows Options
26343 @subsection x86 Windows Options
26344 @cindex x86 Windows Options
26345 @cindex Windows Options for x86
26347 These additional options are available for Microsoft Windows targets:
26349 @table @gcctabopt
26350 @item -mconsole
26351 @opindex mconsole
26352 This option
26353 specifies that a console application is to be generated, by
26354 instructing the linker to set the PE header subsystem type
26355 required for console applications.
26356 This option is available for Cygwin and MinGW targets and is
26357 enabled by default on those targets.
26359 @item -mdll
26360 @opindex mdll
26361 This option is available for Cygwin and MinGW targets.  It
26362 specifies that a DLL---a dynamic link library---is to be
26363 generated, enabling the selection of the required runtime
26364 startup object and entry point.
26366 @item -mnop-fun-dllimport
26367 @opindex mnop-fun-dllimport
26368 This option is available for Cygwin and MinGW targets.  It
26369 specifies that the @code{dllimport} attribute should be ignored.
26371 @item -mthread
26372 @opindex mthread
26373 This option is available for MinGW targets. It specifies
26374 that MinGW-specific thread support is to be used.
26376 @item -municode
26377 @opindex municode
26378 This option is available for MinGW-w64 targets.  It causes
26379 the @code{UNICODE} preprocessor macro to be predefined, and
26380 chooses Unicode-capable runtime startup code.
26382 @item -mwin32
26383 @opindex mwin32
26384 This option is available for Cygwin and MinGW targets.  It
26385 specifies that the typical Microsoft Windows predefined macros are to
26386 be set in the pre-processor, but does not influence the choice
26387 of runtime library/startup code.
26389 @item -mwindows
26390 @opindex mwindows
26391 This option is available for Cygwin and MinGW targets.  It
26392 specifies that a GUI application is to be generated by
26393 instructing the linker to set the PE header subsystem type
26394 appropriately.
26396 @item -fno-set-stack-executable
26397 @opindex fno-set-stack-executable
26398 This option is available for MinGW targets. It specifies that
26399 the executable flag for the stack used by nested functions isn't
26400 set. This is necessary for binaries running in kernel mode of
26401 Microsoft Windows, as there the User32 API, which is used to set executable
26402 privileges, isn't available.
26404 @item -fwritable-relocated-rdata
26405 @opindex fno-writable-relocated-rdata
26406 This option is available for MinGW and Cygwin targets.  It specifies
26407 that relocated-data in read-only section is put into the @code{.data}
26408 section.  This is a necessary for older runtimes not supporting
26409 modification of @code{.rdata} sections for pseudo-relocation.
26411 @item -mpe-aligned-commons
26412 @opindex mpe-aligned-commons
26413 This option is available for Cygwin and MinGW targets.  It
26414 specifies that the GNU extension to the PE file format that
26415 permits the correct alignment of COMMON variables should be
26416 used when generating code.  It is enabled by default if
26417 GCC detects that the target assembler found during configuration
26418 supports the feature.
26419 @end table
26421 See also under @ref{x86 Options} for standard options.
26423 @node Xstormy16 Options
26424 @subsection Xstormy16 Options
26425 @cindex Xstormy16 Options
26427 These options are defined for Xstormy16:
26429 @table @gcctabopt
26430 @item -msim
26431 @opindex msim
26432 Choose startup files and linker script suitable for the simulator.
26433 @end table
26435 @node Xtensa Options
26436 @subsection Xtensa Options
26437 @cindex Xtensa Options
26439 These options are supported for Xtensa targets:
26441 @table @gcctabopt
26442 @item -mconst16
26443 @itemx -mno-const16
26444 @opindex mconst16
26445 @opindex mno-const16
26446 Enable or disable use of @code{CONST16} instructions for loading
26447 constant values.  The @code{CONST16} instruction is currently not a
26448 standard option from Tensilica.  When enabled, @code{CONST16}
26449 instructions are always used in place of the standard @code{L32R}
26450 instructions.  The use of @code{CONST16} is enabled by default only if
26451 the @code{L32R} instruction is not available.
26453 @item -mfused-madd
26454 @itemx -mno-fused-madd
26455 @opindex mfused-madd
26456 @opindex mno-fused-madd
26457 Enable or disable use of fused multiply/add and multiply/subtract
26458 instructions in the floating-point option.  This has no effect if the
26459 floating-point option is not also enabled.  Disabling fused multiply/add
26460 and multiply/subtract instructions forces the compiler to use separate
26461 instructions for the multiply and add/subtract operations.  This may be
26462 desirable in some cases where strict IEEE 754-compliant results are
26463 required: the fused multiply add/subtract instructions do not round the
26464 intermediate result, thereby producing results with @emph{more} bits of
26465 precision than specified by the IEEE standard.  Disabling fused multiply
26466 add/subtract instructions also ensures that the program output is not
26467 sensitive to the compiler's ability to combine multiply and add/subtract
26468 operations.
26470 @item -mserialize-volatile
26471 @itemx -mno-serialize-volatile
26472 @opindex mserialize-volatile
26473 @opindex mno-serialize-volatile
26474 When this option is enabled, GCC inserts @code{MEMW} instructions before
26475 @code{volatile} memory references to guarantee sequential consistency.
26476 The default is @option{-mserialize-volatile}.  Use
26477 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
26479 @item -mforce-no-pic
26480 @opindex mforce-no-pic
26481 For targets, like GNU/Linux, where all user-mode Xtensa code must be
26482 position-independent code (PIC), this option disables PIC for compiling
26483 kernel code.
26485 @item -mtext-section-literals
26486 @itemx -mno-text-section-literals
26487 @opindex mtext-section-literals
26488 @opindex mno-text-section-literals
26489 These options control the treatment of literal pools.  The default is
26490 @option{-mno-text-section-literals}, which places literals in a separate
26491 section in the output file.  This allows the literal pool to be placed
26492 in a data RAM/ROM, and it also allows the linker to combine literal
26493 pools from separate object files to remove redundant literals and
26494 improve code size.  With @option{-mtext-section-literals}, the literals
26495 are interspersed in the text section in order to keep them as close as
26496 possible to their references.  This may be necessary for large assembly
26497 files.  Literals for each function are placed right before that function.
26499 @item -mauto-litpools
26500 @itemx -mno-auto-litpools
26501 @opindex mauto-litpools
26502 @opindex mno-auto-litpools
26503 These options control the treatment of literal pools.  The default is
26504 @option{-mno-auto-litpools}, which places literals in a separate
26505 section in the output file unless @option{-mtext-section-literals} is
26506 used.  With @option{-mauto-litpools} the literals are interspersed in
26507 the text section by the assembler.  Compiler does not produce explicit
26508 @code{.literal} directives and loads literals into registers with
26509 @code{MOVI} instructions instead of @code{L32R} to let the assembler
26510 do relaxation and place literals as necessary.  This option allows
26511 assembler to create several literal pools per function and assemble
26512 very big functions, which may not be possible with
26513 @option{-mtext-section-literals}.
26515 @item -mtarget-align
26516 @itemx -mno-target-align
26517 @opindex mtarget-align
26518 @opindex mno-target-align
26519 When this option is enabled, GCC instructs the assembler to
26520 automatically align instructions to reduce branch penalties at the
26521 expense of some code density.  The assembler attempts to widen density
26522 instructions to align branch targets and the instructions following call
26523 instructions.  If there are not enough preceding safe density
26524 instructions to align a target, no widening is performed.  The
26525 default is @option{-mtarget-align}.  These options do not affect the
26526 treatment of auto-aligned instructions like @code{LOOP}, which the
26527 assembler always aligns, either by widening density instructions or
26528 by inserting NOP instructions.
26530 @item -mlongcalls
26531 @itemx -mno-longcalls
26532 @opindex mlongcalls
26533 @opindex mno-longcalls
26534 When this option is enabled, GCC instructs the assembler to translate
26535 direct calls to indirect calls unless it can determine that the target
26536 of a direct call is in the range allowed by the call instruction.  This
26537 translation typically occurs for calls to functions in other source
26538 files.  Specifically, the assembler translates a direct @code{CALL}
26539 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
26540 The default is @option{-mno-longcalls}.  This option should be used in
26541 programs where the call target can potentially be out of range.  This
26542 option is implemented in the assembler, not the compiler, so the
26543 assembly code generated by GCC still shows direct call
26544 instructions---look at the disassembled object code to see the actual
26545 instructions.  Note that the assembler uses an indirect call for
26546 every cross-file call, not just those that really are out of range.
26547 @end table
26549 @node zSeries Options
26550 @subsection zSeries Options
26551 @cindex zSeries options
26553 These are listed under @xref{S/390 and zSeries Options}.
26556 @c man end
26558 @node Spec Files
26559 @section Specifying Subprocesses and the Switches to Pass to Them
26560 @cindex Spec Files
26562 @command{gcc} is a driver program.  It performs its job by invoking a
26563 sequence of other programs to do the work of compiling, assembling and
26564 linking.  GCC interprets its command-line parameters and uses these to
26565 deduce which programs it should invoke, and which command-line options
26566 it ought to place on their command lines.  This behavior is controlled
26567 by @dfn{spec strings}.  In most cases there is one spec string for each
26568 program that GCC can invoke, but a few programs have multiple spec
26569 strings to control their behavior.  The spec strings built into GCC can
26570 be overridden by using the @option{-specs=} command-line switch to specify
26571 a spec file.
26573 @dfn{Spec files} are plain-text files that are used to construct spec
26574 strings.  They consist of a sequence of directives separated by blank
26575 lines.  The type of directive is determined by the first non-whitespace
26576 character on the line, which can be one of the following:
26578 @table @code
26579 @item %@var{command}
26580 Issues a @var{command} to the spec file processor.  The commands that can
26581 appear here are:
26583 @table @code
26584 @item %include <@var{file}>
26585 @cindex @code{%include}
26586 Search for @var{file} and insert its text at the current point in the
26587 specs file.
26589 @item %include_noerr <@var{file}>
26590 @cindex @code{%include_noerr}
26591 Just like @samp{%include}, but do not generate an error message if the include
26592 file cannot be found.
26594 @item %rename @var{old_name} @var{new_name}
26595 @cindex @code{%rename}
26596 Rename the spec string @var{old_name} to @var{new_name}.
26598 @end table
26600 @item *[@var{spec_name}]:
26601 This tells the compiler to create, override or delete the named spec
26602 string.  All lines after this directive up to the next directive or
26603 blank line are considered to be the text for the spec string.  If this
26604 results in an empty string then the spec is deleted.  (Or, if the
26605 spec did not exist, then nothing happens.)  Otherwise, if the spec
26606 does not currently exist a new spec is created.  If the spec does
26607 exist then its contents are overridden by the text of this
26608 directive, unless the first character of that text is the @samp{+}
26609 character, in which case the text is appended to the spec.
26611 @item [@var{suffix}]:
26612 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
26613 and up to the next directive or blank line are considered to make up the
26614 spec string for the indicated suffix.  When the compiler encounters an
26615 input file with the named suffix, it processes the spec string in
26616 order to work out how to compile that file.  For example:
26618 @smallexample
26619 .ZZ:
26620 z-compile -input %i
26621 @end smallexample
26623 This says that any input file whose name ends in @samp{.ZZ} should be
26624 passed to the program @samp{z-compile}, which should be invoked with the
26625 command-line switch @option{-input} and with the result of performing the
26626 @samp{%i} substitution.  (See below.)
26628 As an alternative to providing a spec string, the text following a
26629 suffix directive can be one of the following:
26631 @table @code
26632 @item @@@var{language}
26633 This says that the suffix is an alias for a known @var{language}.  This is
26634 similar to using the @option{-x} command-line switch to GCC to specify a
26635 language explicitly.  For example:
26637 @smallexample
26638 .ZZ:
26639 @@c++
26640 @end smallexample
26642 Says that .ZZ files are, in fact, C++ source files.
26644 @item #@var{name}
26645 This causes an error messages saying:
26647 @smallexample
26648 @var{name} compiler not installed on this system.
26649 @end smallexample
26650 @end table
26652 GCC already has an extensive list of suffixes built into it.
26653 This directive adds an entry to the end of the list of suffixes, but
26654 since the list is searched from the end backwards, it is effectively
26655 possible to override earlier entries using this technique.
26657 @end table
26659 GCC has the following spec strings built into it.  Spec files can
26660 override these strings or create their own.  Note that individual
26661 targets can also add their own spec strings to this list.
26663 @smallexample
26664 asm          Options to pass to the assembler
26665 asm_final    Options to pass to the assembler post-processor
26666 cpp          Options to pass to the C preprocessor
26667 cc1          Options to pass to the C compiler
26668 cc1plus      Options to pass to the C++ compiler
26669 endfile      Object files to include at the end of the link
26670 link         Options to pass to the linker
26671 lib          Libraries to include on the command line to the linker
26672 libgcc       Decides which GCC support library to pass to the linker
26673 linker       Sets the name of the linker
26674 predefines   Defines to be passed to the C preprocessor
26675 signed_char  Defines to pass to CPP to say whether @code{char} is signed
26676              by default
26677 startfile    Object files to include at the start of the link
26678 @end smallexample
26680 Here is a small example of a spec file:
26682 @smallexample
26683 %rename lib                 old_lib
26685 *lib:
26686 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
26687 @end smallexample
26689 This example renames the spec called @samp{lib} to @samp{old_lib} and
26690 then overrides the previous definition of @samp{lib} with a new one.
26691 The new definition adds in some extra command-line options before
26692 including the text of the old definition.
26694 @dfn{Spec strings} are a list of command-line options to be passed to their
26695 corresponding program.  In addition, the spec strings can contain
26696 @samp{%}-prefixed sequences to substitute variable text or to
26697 conditionally insert text into the command line.  Using these constructs
26698 it is possible to generate quite complex command lines.
26700 Here is a table of all defined @samp{%}-sequences for spec
26701 strings.  Note that spaces are not generated automatically around the
26702 results of expanding these sequences.  Therefore you can concatenate them
26703 together or combine them with constant text in a single argument.
26705 @table @code
26706 @item %%
26707 Substitute one @samp{%} into the program name or argument.
26709 @item %i
26710 Substitute the name of the input file being processed.
26712 @item %b
26713 Substitute the basename of the input file being processed.
26714 This is the substring up to (and not including) the last period
26715 and not including the directory.
26717 @item %B
26718 This is the same as @samp{%b}, but include the file suffix (text after
26719 the last period).
26721 @item %d
26722 Marks the argument containing or following the @samp{%d} as a
26723 temporary file name, so that that file is deleted if GCC exits
26724 successfully.  Unlike @samp{%g}, this contributes no text to the
26725 argument.
26727 @item %g@var{suffix}
26728 Substitute a file name that has suffix @var{suffix} and is chosen
26729 once per compilation, and mark the argument in the same way as
26730 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
26731 name is now chosen in a way that is hard to predict even when previously
26732 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
26733 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
26734 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
26735 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
26736 was simply substituted with a file name chosen once per compilation,
26737 without regard to any appended suffix (which was therefore treated
26738 just like ordinary text), making such attacks more likely to succeed.
26740 @item %u@var{suffix}
26741 Like @samp{%g}, but generates a new temporary file name
26742 each time it appears instead of once per compilation.
26744 @item %U@var{suffix}
26745 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
26746 new one if there is no such last file name.  In the absence of any
26747 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
26748 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
26749 involves the generation of two distinct file names, one
26750 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
26751 simply substituted with a file name chosen for the previous @samp{%u},
26752 without regard to any appended suffix.
26754 @item %j@var{suffix}
26755 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
26756 writable, and if @option{-save-temps} is not used; 
26757 otherwise, substitute the name
26758 of a temporary file, just like @samp{%u}.  This temporary file is not
26759 meant for communication between processes, but rather as a junk
26760 disposal mechanism.
26762 @item %|@var{suffix}
26763 @itemx %m@var{suffix}
26764 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
26765 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
26766 all.  These are the two most common ways to instruct a program that it
26767 should read from standard input or write to standard output.  If you
26768 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
26769 construct: see for example @file{f/lang-specs.h}.
26771 @item %.@var{SUFFIX}
26772 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
26773 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
26774 terminated by the next space or %.
26776 @item %w
26777 Marks the argument containing or following the @samp{%w} as the
26778 designated output file of this compilation.  This puts the argument
26779 into the sequence of arguments that @samp{%o} substitutes.
26781 @item %o
26782 Substitutes the names of all the output files, with spaces
26783 automatically placed around them.  You should write spaces
26784 around the @samp{%o} as well or the results are undefined.
26785 @samp{%o} is for use in the specs for running the linker.
26786 Input files whose names have no recognized suffix are not compiled
26787 at all, but they are included among the output files, so they are
26788 linked.
26790 @item %O
26791 Substitutes the suffix for object files.  Note that this is
26792 handled specially when it immediately follows @samp{%g, %u, or %U},
26793 because of the need for those to form complete file names.  The
26794 handling is such that @samp{%O} is treated exactly as if it had already
26795 been substituted, except that @samp{%g, %u, and %U} do not currently
26796 support additional @var{suffix} characters following @samp{%O} as they do
26797 following, for example, @samp{.o}.
26799 @item %p
26800 Substitutes the standard macro predefinitions for the
26801 current target machine.  Use this when running @command{cpp}.
26803 @item %P
26804 Like @samp{%p}, but puts @samp{__} before and after the name of each
26805 predefined macro, except for macros that start with @samp{__} or with
26806 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
26809 @item %I
26810 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
26811 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
26812 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
26813 and @option{-imultilib} as necessary.
26815 @item %s
26816 Current argument is the name of a library or startup file of some sort.
26817 Search for that file in a standard list of directories and substitute
26818 the full name found.  The current working directory is included in the
26819 list of directories scanned.
26821 @item %T
26822 Current argument is the name of a linker script.  Search for that file
26823 in the current list of directories to scan for libraries. If the file
26824 is located insert a @option{--script} option into the command line
26825 followed by the full path name found.  If the file is not found then
26826 generate an error message.  Note: the current working directory is not
26827 searched.
26829 @item %e@var{str}
26830 Print @var{str} as an error message.  @var{str} is terminated by a newline.
26831 Use this when inconsistent options are detected.
26833 @item %(@var{name})
26834 Substitute the contents of spec string @var{name} at this point.
26836 @item %x@{@var{option}@}
26837 Accumulate an option for @samp{%X}.
26839 @item %X
26840 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
26841 spec string.
26843 @item %Y
26844 Output the accumulated assembler options specified by @option{-Wa}.
26846 @item %Z
26847 Output the accumulated preprocessor options specified by @option{-Wp}.
26849 @item %a
26850 Process the @code{asm} spec.  This is used to compute the
26851 switches to be passed to the assembler.
26853 @item %A
26854 Process the @code{asm_final} spec.  This is a spec string for
26855 passing switches to an assembler post-processor, if such a program is
26856 needed.
26858 @item %l
26859 Process the @code{link} spec.  This is the spec for computing the
26860 command line passed to the linker.  Typically it makes use of the
26861 @samp{%L %G %S %D and %E} sequences.
26863 @item %D
26864 Dump out a @option{-L} option for each directory that GCC believes might
26865 contain startup files.  If the target supports multilibs then the
26866 current multilib directory is prepended to each of these paths.
26868 @item %L
26869 Process the @code{lib} spec.  This is a spec string for deciding which
26870 libraries are included on the command line to the linker.
26872 @item %G
26873 Process the @code{libgcc} spec.  This is a spec string for deciding
26874 which GCC support library is included on the command line to the linker.
26876 @item %S
26877 Process the @code{startfile} spec.  This is a spec for deciding which
26878 object files are the first ones passed to the linker.  Typically
26879 this might be a file named @file{crt0.o}.
26881 @item %E
26882 Process the @code{endfile} spec.  This is a spec string that specifies
26883 the last object files that are passed to the linker.
26885 @item %C
26886 Process the @code{cpp} spec.  This is used to construct the arguments
26887 to be passed to the C preprocessor.
26889 @item %1
26890 Process the @code{cc1} spec.  This is used to construct the options to be
26891 passed to the actual C compiler (@command{cc1}).
26893 @item %2
26894 Process the @code{cc1plus} spec.  This is used to construct the options to be
26895 passed to the actual C++ compiler (@command{cc1plus}).
26897 @item %*
26898 Substitute the variable part of a matched option.  See below.
26899 Note that each comma in the substituted string is replaced by
26900 a single space.
26902 @item %<S
26903 Remove all occurrences of @code{-S} from the command line.  Note---this
26904 command is position dependent.  @samp{%} commands in the spec string
26905 before this one see @code{-S}, @samp{%} commands in the spec string
26906 after this one do not.
26908 @item %:@var{function}(@var{args})
26909 Call the named function @var{function}, passing it @var{args}.
26910 @var{args} is first processed as a nested spec string, then split
26911 into an argument vector in the usual fashion.  The function returns
26912 a string which is processed as if it had appeared literally as part
26913 of the current spec.
26915 The following built-in spec functions are provided:
26917 @table @code
26918 @item @code{getenv}
26919 The @code{getenv} spec function takes two arguments: an environment
26920 variable name and a string.  If the environment variable is not
26921 defined, a fatal error is issued.  Otherwise, the return value is the
26922 value of the environment variable concatenated with the string.  For
26923 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
26925 @smallexample
26926 %:getenv(TOPDIR /include)
26927 @end smallexample
26929 expands to @file{/path/to/top/include}.
26931 @item @code{if-exists}
26932 The @code{if-exists} spec function takes one argument, an absolute
26933 pathname to a file.  If the file exists, @code{if-exists} returns the
26934 pathname.  Here is a small example of its usage:
26936 @smallexample
26937 *startfile:
26938 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
26939 @end smallexample
26941 @item @code{if-exists-else}
26942 The @code{if-exists-else} spec function is similar to the @code{if-exists}
26943 spec function, except that it takes two arguments.  The first argument is
26944 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
26945 returns the pathname.  If it does not exist, it returns the second argument.
26946 This way, @code{if-exists-else} can be used to select one file or another,
26947 based on the existence of the first.  Here is a small example of its usage:
26949 @smallexample
26950 *startfile:
26951 crt0%O%s %:if-exists(crti%O%s) \
26952 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
26953 @end smallexample
26955 @item @code{replace-outfile}
26956 The @code{replace-outfile} spec function takes two arguments.  It looks for the
26957 first argument in the outfiles array and replaces it with the second argument.  Here
26958 is a small example of its usage:
26960 @smallexample
26961 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
26962 @end smallexample
26964 @item @code{remove-outfile}
26965 The @code{remove-outfile} spec function takes one argument.  It looks for the
26966 first argument in the outfiles array and removes it.  Here is a small example
26967 its usage:
26969 @smallexample
26970 %:remove-outfile(-lm)
26971 @end smallexample
26973 @item @code{pass-through-libs}
26974 The @code{pass-through-libs} spec function takes any number of arguments.  It
26975 finds any @option{-l} options and any non-options ending in @file{.a} (which it
26976 assumes are the names of linker input library archive files) and returns a
26977 result containing all the found arguments each prepended by
26978 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
26979 intended to be passed to the LTO linker plugin.
26981 @smallexample
26982 %:pass-through-libs(%G %L %G)
26983 @end smallexample
26985 @item @code{print-asm-header}
26986 The @code{print-asm-header} function takes no arguments and simply
26987 prints a banner like:
26989 @smallexample
26990 Assembler options
26991 =================
26993 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
26994 @end smallexample
26996 It is used to separate compiler options from assembler options
26997 in the @option{--target-help} output.
26998 @end table
27000 @item %@{S@}
27001 Substitutes the @code{-S} switch, if that switch is given to GCC@.
27002 If that switch is not specified, this substitutes nothing.  Note that
27003 the leading dash is omitted when specifying this option, and it is
27004 automatically inserted if the substitution is performed.  Thus the spec
27005 string @samp{%@{foo@}} matches the command-line option @option{-foo}
27006 and outputs the command-line option @option{-foo}.
27008 @item %W@{S@}
27009 Like %@{@code{S}@} but mark last argument supplied within as a file to be
27010 deleted on failure.
27012 @item %@{S*@}
27013 Substitutes all the switches specified to GCC whose names start
27014 with @code{-S}, but which also take an argument.  This is used for
27015 switches like @option{-o}, @option{-D}, @option{-I}, etc.
27016 GCC considers @option{-o foo} as being
27017 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
27018 text, including the space.  Thus two arguments are generated.
27020 @item %@{S*&T*@}
27021 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
27022 (the order of @code{S} and @code{T} in the spec is not significant).
27023 There can be any number of ampersand-separated variables; for each the
27024 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
27026 @item %@{S:X@}
27027 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
27029 @item %@{!S:X@}
27030 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
27032 @item %@{S*:X@}
27033 Substitutes @code{X} if one or more switches whose names start with
27034 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
27035 once, no matter how many such switches appeared.  However, if @code{%*}
27036 appears somewhere in @code{X}, then @code{X} is substituted once
27037 for each matching switch, with the @code{%*} replaced by the part of
27038 that switch matching the @code{*}.
27040 If @code{%*} appears as the last part of a spec sequence then a space
27041 is added after the end of the last substitution.  If there is more
27042 text in the sequence, however, then a space is not generated.  This
27043 allows the @code{%*} substitution to be used as part of a larger
27044 string.  For example, a spec string like this:
27046 @smallexample
27047 %@{mcu=*:--script=%*/memory.ld@}
27048 @end smallexample
27050 @noindent
27051 when matching an option like @option{-mcu=newchip} produces:
27053 @smallexample
27054 --script=newchip/memory.ld
27055 @end smallexample
27057 @item %@{.S:X@}
27058 Substitutes @code{X}, if processing a file with suffix @code{S}.
27060 @item %@{!.S:X@}
27061 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
27063 @item %@{,S:X@}
27064 Substitutes @code{X}, if processing a file for language @code{S}.
27066 @item %@{!,S:X@}
27067 Substitutes @code{X}, if not processing a file for language @code{S}.
27069 @item %@{S|P:X@}
27070 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
27071 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
27072 @code{*} sequences as well, although they have a stronger binding than
27073 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
27074 alternatives must be starred, and only the first matching alternative
27075 is substituted.
27077 For example, a spec string like this:
27079 @smallexample
27080 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
27081 @end smallexample
27083 @noindent
27084 outputs the following command-line options from the following input
27085 command-line options:
27087 @smallexample
27088 fred.c        -foo -baz
27089 jim.d         -bar -boggle
27090 -d fred.c     -foo -baz -boggle
27091 -d jim.d      -bar -baz -boggle
27092 @end smallexample
27094 @item %@{S:X; T:Y; :D@}
27096 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
27097 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
27098 be as many clauses as you need.  This may be combined with @code{.},
27099 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
27102 @end table
27104 The switch matching text @code{S} in a @samp{%@{S@}}, @samp{%@{S:X@}}
27105 or similar construct can use a backslash to ignore the special meaning
27106 of the character following it, thus allowing literal matching of a
27107 character that is otherwise specially treated.  For example,
27108 @samp{%@{std=iso9899\:1999:X@}} substitutes @code{X} if the
27109 @option{-std=iso9899:1999} option is given.
27111 The conditional text @code{X} in a @samp{%@{S:X@}} or similar
27112 construct may contain other nested @samp{%} constructs or spaces, or
27113 even newlines.  They are processed as usual, as described above.
27114 Trailing white space in @code{X} is ignored.  White space may also
27115 appear anywhere on the left side of the colon in these constructs,
27116 except between @code{.} or @code{*} and the corresponding word.
27118 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
27119 handled specifically in these constructs.  If another value of
27120 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
27121 @option{-W} switch is found later in the command line, the earlier
27122 switch value is ignored, except with @{@code{S}*@} where @code{S} is
27123 just one letter, which passes all matching options.
27125 The character @samp{|} at the beginning of the predicate text is used to
27126 indicate that a command should be piped to the following command, but
27127 only if @option{-pipe} is specified.
27129 It is built into GCC which switches take arguments and which do not.
27130 (You might think it would be useful to generalize this to allow each
27131 compiler's spec to say which switches take arguments.  But this cannot
27132 be done in a consistent fashion.  GCC cannot even decide which input
27133 files have been specified without knowing which switches take arguments,
27134 and it must know which input files to compile in order to tell which
27135 compilers to run).
27137 GCC also knows implicitly that arguments starting in @option{-l} are to be
27138 treated as compiler output files, and passed to the linker in their
27139 proper position among the other output files.
27141 @node Environment Variables
27142 @section Environment Variables Affecting GCC
27143 @cindex environment variables
27145 @c man begin ENVIRONMENT
27146 This section describes several environment variables that affect how GCC
27147 operates.  Some of them work by specifying directories or prefixes to use
27148 when searching for various kinds of files.  Some are used to specify other
27149 aspects of the compilation environment.
27151 Note that you can also specify places to search using options such as
27152 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
27153 take precedence over places specified using environment variables, which
27154 in turn take precedence over those specified by the configuration of GCC@.
27155 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
27156 GNU Compiler Collection (GCC) Internals}.
27158 @table @env
27159 @item LANG
27160 @itemx LC_CTYPE
27161 @c @itemx LC_COLLATE
27162 @itemx LC_MESSAGES
27163 @c @itemx LC_MONETARY
27164 @c @itemx LC_NUMERIC
27165 @c @itemx LC_TIME
27166 @itemx LC_ALL
27167 @findex LANG
27168 @findex LC_CTYPE
27169 @c @findex LC_COLLATE
27170 @findex LC_MESSAGES
27171 @c @findex LC_MONETARY
27172 @c @findex LC_NUMERIC
27173 @c @findex LC_TIME
27174 @findex LC_ALL
27175 @cindex locale
27176 These environment variables control the way that GCC uses
27177 localization information which allows GCC to work with different
27178 national conventions.  GCC inspects the locale categories
27179 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
27180 so.  These locale categories can be set to any value supported by your
27181 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
27182 Kingdom encoded in UTF-8.
27184 The @env{LC_CTYPE} environment variable specifies character
27185 classification.  GCC uses it to determine the character boundaries in
27186 a string; this is needed for some multibyte encodings that contain quote
27187 and escape characters that are otherwise interpreted as a string
27188 end or escape.
27190 The @env{LC_MESSAGES} environment variable specifies the language to
27191 use in diagnostic messages.
27193 If the @env{LC_ALL} environment variable is set, it overrides the value
27194 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
27195 and @env{LC_MESSAGES} default to the value of the @env{LANG}
27196 environment variable.  If none of these variables are set, GCC
27197 defaults to traditional C English behavior.
27199 @item TMPDIR
27200 @findex TMPDIR
27201 If @env{TMPDIR} is set, it specifies the directory to use for temporary
27202 files.  GCC uses temporary files to hold the output of one stage of
27203 compilation which is to be used as input to the next stage: for example,
27204 the output of the preprocessor, which is the input to the compiler
27205 proper.
27207 @item GCC_COMPARE_DEBUG
27208 @findex GCC_COMPARE_DEBUG
27209 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
27210 @option{-fcompare-debug} to the compiler driver.  See the documentation
27211 of this option for more details.
27213 @item GCC_EXEC_PREFIX
27214 @findex GCC_EXEC_PREFIX
27215 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
27216 names of the subprograms executed by the compiler.  No slash is added
27217 when this prefix is combined with the name of a subprogram, but you can
27218 specify a prefix that ends with a slash if you wish.
27220 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
27221 an appropriate prefix to use based on the pathname it is invoked with.
27223 If GCC cannot find the subprogram using the specified prefix, it
27224 tries looking in the usual places for the subprogram.
27226 The default value of @env{GCC_EXEC_PREFIX} is
27227 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
27228 the installed compiler. In many cases @var{prefix} is the value
27229 of @code{prefix} when you ran the @file{configure} script.
27231 Other prefixes specified with @option{-B} take precedence over this prefix.
27233 This prefix is also used for finding files such as @file{crt0.o} that are
27234 used for linking.
27236 In addition, the prefix is used in an unusual way in finding the
27237 directories to search for header files.  For each of the standard
27238 directories whose name normally begins with @samp{/usr/local/lib/gcc}
27239 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
27240 replacing that beginning with the specified prefix to produce an
27241 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
27242 @file{foo/bar} just before it searches the standard directory 
27243 @file{/usr/local/lib/bar}.
27244 If a standard directory begins with the configured
27245 @var{prefix} then the value of @var{prefix} is replaced by
27246 @env{GCC_EXEC_PREFIX} when looking for header files.
27248 @item COMPILER_PATH
27249 @findex COMPILER_PATH
27250 The value of @env{COMPILER_PATH} is a colon-separated list of
27251 directories, much like @env{PATH}.  GCC tries the directories thus
27252 specified when searching for subprograms, if it cannot find the
27253 subprograms using @env{GCC_EXEC_PREFIX}.
27255 @item LIBRARY_PATH
27256 @findex LIBRARY_PATH
27257 The value of @env{LIBRARY_PATH} is a colon-separated list of
27258 directories, much like @env{PATH}.  When configured as a native compiler,
27259 GCC tries the directories thus specified when searching for special
27260 linker files, if it cannot find them using @env{GCC_EXEC_PREFIX}.  Linking
27261 using GCC also uses these directories when searching for ordinary
27262 libraries for the @option{-l} option (but directories specified with
27263 @option{-L} come first).
27265 @item LANG
27266 @findex LANG
27267 @cindex locale definition
27268 This variable is used to pass locale information to the compiler.  One way in
27269 which this information is used is to determine the character set to be used
27270 when character literals, string literals and comments are parsed in C and C++.
27271 When the compiler is configured to allow multibyte characters,
27272 the following values for @env{LANG} are recognized:
27274 @table @samp
27275 @item C-JIS
27276 Recognize JIS characters.
27277 @item C-SJIS
27278 Recognize SJIS characters.
27279 @item C-EUCJP
27280 Recognize EUCJP characters.
27281 @end table
27283 If @env{LANG} is not defined, or if it has some other value, then the
27284 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
27285 recognize and translate multibyte characters.
27286 @end table
27288 @noindent
27289 Some additional environment variables affect the behavior of the
27290 preprocessor.
27292 @include cppenv.texi
27294 @c man end
27296 @node Precompiled Headers
27297 @section Using Precompiled Headers
27298 @cindex precompiled headers
27299 @cindex speed of compilation
27301 Often large projects have many header files that are included in every
27302 source file.  The time the compiler takes to process these header files
27303 over and over again can account for nearly all of the time required to
27304 build the project.  To make builds faster, GCC allows you to
27305 @dfn{precompile} a header file.
27307 To create a precompiled header file, simply compile it as you would any
27308 other file, if necessary using the @option{-x} option to make the driver
27309 treat it as a C or C++ header file.  You may want to use a
27310 tool like @command{make} to keep the precompiled header up-to-date when
27311 the headers it contains change.
27313 A precompiled header file is searched for when @code{#include} is
27314 seen in the compilation.  As it searches for the included file
27315 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
27316 compiler looks for a precompiled header in each directory just before it
27317 looks for the include file in that directory.  The name searched for is
27318 the name specified in the @code{#include} with @samp{.gch} appended.  If
27319 the precompiled header file cannot be used, it is ignored.
27321 For instance, if you have @code{#include "all.h"}, and you have
27322 @file{all.h.gch} in the same directory as @file{all.h}, then the
27323 precompiled header file is used if possible, and the original
27324 header is used otherwise.
27326 Alternatively, you might decide to put the precompiled header file in a
27327 directory and use @option{-I} to ensure that directory is searched
27328 before (or instead of) the directory containing the original header.
27329 Then, if you want to check that the precompiled header file is always
27330 used, you can put a file of the same name as the original header in this
27331 directory containing an @code{#error} command.
27333 This also works with @option{-include}.  So yet another way to use
27334 precompiled headers, good for projects not designed with precompiled
27335 header files in mind, is to simply take most of the header files used by
27336 a project, include them from another header file, precompile that header
27337 file, and @option{-include} the precompiled header.  If the header files
27338 have guards against multiple inclusion, they are skipped because
27339 they've already been included (in the precompiled header).
27341 If you need to precompile the same header file for different
27342 languages, targets, or compiler options, you can instead make a
27343 @emph{directory} named like @file{all.h.gch}, and put each precompiled
27344 header in the directory, perhaps using @option{-o}.  It doesn't matter
27345 what you call the files in the directory; every precompiled header in
27346 the directory is considered.  The first precompiled header
27347 encountered in the directory that is valid for this compilation is
27348 used; they're searched in no particular order.
27350 There are many other possibilities, limited only by your imagination,
27351 good sense, and the constraints of your build system.
27353 A precompiled header file can be used only when these conditions apply:
27355 @itemize
27356 @item
27357 Only one precompiled header can be used in a particular compilation.
27359 @item
27360 A precompiled header cannot be used once the first C token is seen.  You
27361 can have preprocessor directives before a precompiled header; you cannot
27362 include a precompiled header from inside another header.
27364 @item
27365 The precompiled header file must be produced for the same language as
27366 the current compilation.  You cannot use a C precompiled header for a C++
27367 compilation.
27369 @item
27370 The precompiled header file must have been produced by the same compiler
27371 binary as the current compilation is using.
27373 @item
27374 Any macros defined before the precompiled header is included must
27375 either be defined in the same way as when the precompiled header was
27376 generated, or must not affect the precompiled header, which usually
27377 means that they don't appear in the precompiled header at all.
27379 The @option{-D} option is one way to define a macro before a
27380 precompiled header is included; using a @code{#define} can also do it.
27381 There are also some options that define macros implicitly, like
27382 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
27383 defined this way.
27385 @item If debugging information is output when using the precompiled
27386 header, using @option{-g} or similar, the same kind of debugging information
27387 must have been output when building the precompiled header.  However,
27388 a precompiled header built using @option{-g} can be used in a compilation
27389 when no debugging information is being output.
27391 @item The same @option{-m} options must generally be used when building
27392 and using the precompiled header.  @xref{Submodel Options},
27393 for any cases where this rule is relaxed.
27395 @item Each of the following options must be the same when building and using
27396 the precompiled header:
27398 @gccoptlist{-fexceptions}
27400 @item
27401 Some other command-line options starting with @option{-f},
27402 @option{-p}, or @option{-O} must be defined in the same way as when
27403 the precompiled header was generated.  At present, it's not clear
27404 which options are safe to change and which are not; the safest choice
27405 is to use exactly the same options when generating and using the
27406 precompiled header.  The following are known to be safe:
27408 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
27409 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
27410 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
27411 -pedantic-errors}
27413 @end itemize
27415 For all of these except the last, the compiler automatically
27416 ignores the precompiled header if the conditions aren't met.  If you
27417 find an option combination that doesn't work and doesn't cause the
27418 precompiled header to be ignored, please consider filing a bug report,
27419 see @ref{Bugs}.
27421 If you do use differing options when generating and using the
27422 precompiled header, the actual behavior is a mixture of the
27423 behavior for the options.  For instance, if you use @option{-g} to
27424 generate the precompiled header but not when using it, you may or may
27425 not get debugging information for routines in the precompiled header.